├── .gitignore
├── Source
├── libs
│ ├── EditModeExpanded-1.0
│ │ └── EditModeExpanded-1.0.xml
│ ├── AceDB-3.0
│ │ └── AceDB-3.0.xml
│ ├── AceLocale-3.0
│ │ ├── AceLocale-3.0.xml
│ │ └── AceLocale-3.0.lua
│ ├── CallbackHandler-1.0
│ │ ├── CallbackHandler-1.0.xml
│ │ └── CallbackHandler-1.0.lua
│ ├── AceConfig-3.0
│ │ ├── AceConfigCmd-3.0
│ │ │ └── AceConfigCmd-3.0.xml
│ │ ├── AceConfigDialog-3.0
│ │ │ └── AceConfigDialog-3.0.xml
│ │ ├── AceConfigRegistry-3.0
│ │ │ └── AceConfigRegistry-3.0.xml
│ │ ├── AceConfig-3.0.xml
│ │ └── AceConfig-3.0.lua
│ ├── LibStub.lua
│ └── AceGUI-3.0
│ │ ├── AceGUI-3.0.xml
│ │ └── widgets
│ │ ├── AceGUIContainer-SimpleGroup.lua
│ │ ├── AceGUIWidget-Heading.lua
│ │ ├── AceGUIWidget-InteractiveLabel.lua
│ │ ├── AceGUIWidget-Button.lua
│ │ ├── AceGUIContainer-InlineGroup.lua
│ │ ├── AceGUIContainer-BlizOptionsGroup.lua
│ │ ├── AceGUIWidget-Icon.lua
│ │ ├── AceGUIContainer-DropDownGroup.lua
│ │ ├── AceGUIWidget-Label.lua
│ │ ├── AceGUIWidget-ColorPicker.lua
│ │ ├── AceGUIWidget-Keybinding.lua
│ │ ├── AceGUIContainer-ScrollFrame.lua
│ │ ├── AceGUIWidget-EditBox.lua
│ │ └── AceGUIWidget-CheckBox.lua
├── textures
│ ├── UIMicroMenu2x.BLP
│ ├── UI-MicroButton-Housing-Up.blp
│ ├── UI-MicroButton-Housing-Down.blp
│ └── UI-MicroButton-Housing-Disabled.blp
├── Locales
│ ├── esES.lua
│ ├── zhCN.lua
│ ├── zhTW.lua
│ ├── ruRU.lua
│ ├── koKR.lua
│ └── enus.lua
├── FrameHandlers
│ ├── Pet.lua
│ ├── StanceBar.lua
│ ├── ObjectiveTracker.lua
│ ├── ExtraActionButton.lua
│ ├── Buffs.lua
│ ├── Housing.lua
│ ├── TopCenterContainer.lua
│ ├── DurationBars.lua
│ ├── TotemFrame.lua
│ ├── FocusFrame.lua
│ ├── BelowMinimapContainer.lua
│ ├── ClassResources
│ │ ├── Runes.lua
│ │ ├── ChiBar.lua
│ │ ├── SoulShards.lua
│ │ ├── HolyPower.lua
│ │ ├── Essences.lua
│ │ ├── ArcaneCharges.lua
│ │ └── ComboPoints.lua
│ ├── BonusRoll.lua
│ ├── TargetOfTarget.lua
│ ├── ChatButtons.lua
│ ├── FocusCast.lua
│ ├── FocusToT.lua
│ ├── GameMenu.lua
│ ├── GroupLoot.lua
│ ├── Tooltip.lua
│ ├── LossOfControl.lua
│ ├── AlertFrame.lua
│ ├── TargetCast.lua
│ ├── LFG.lua
│ ├── TargetFrame.lua
│ ├── ActionBars.lua
│ ├── StatusTrackingBar.lua
│ ├── PlayerFrame.lua
│ ├── TalkingHead.lua
│ ├── Minimap.lua
│ ├── Menu.lua
│ └── Raid.lua
├── RegisterFrame.lua
├── ResetFrame.lua
├── CombatManager.lua
├── WarningFrame.xml
├── HookOnce.lua
├── AnchorToDropdown.lua
├── EditModeExpanded.toc
├── EditModeExpanded.lua
├── Vigor.xml
├── RegisteredSystemFrames.lua
└── AutoLayoutChanges.lua
├── .pkgmeta
├── .github
└── workflows
│ ├── luacheck.yml
│ ├── beta.yml
│ └── main.yml
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 |
2 | mklink.bat
3 | mklink-xptr.bat
4 |
--------------------------------------------------------------------------------
/Source/libs/EditModeExpanded-1.0/EditModeExpanded-1.0.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/Source/textures/UIMicroMenu2x.BLP:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/teelolws/EditModeExpanded/HEAD/Source/textures/UIMicroMenu2x.BLP
--------------------------------------------------------------------------------
/Source/Locales/esES.lua:
--------------------------------------------------------------------------------
1 | local addonName = ...
2 | local L = LibStub("AceLocale-3.0"):NewLocale(addonName, "esES")
3 | if not L then return end
4 |
5 |
--------------------------------------------------------------------------------
/Source/Locales/zhCN.lua:
--------------------------------------------------------------------------------
1 | local addonName = ...
2 | local L = LibStub("AceLocale-3.0"):NewLocale(addonName, "zhCN")
3 | if not L then return end
4 |
5 |
--------------------------------------------------------------------------------
/Source/Locales/zhTW.lua:
--------------------------------------------------------------------------------
1 | local addonName = ...
2 | local L = LibStub("AceLocale-3.0"):NewLocale(addonName, "zhTW")
3 | if not L then return end
4 |
5 |
--------------------------------------------------------------------------------
/Source/textures/UI-MicroButton-Housing-Up.blp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/teelolws/EditModeExpanded/HEAD/Source/textures/UI-MicroButton-Housing-Up.blp
--------------------------------------------------------------------------------
/Source/textures/UI-MicroButton-Housing-Down.blp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/teelolws/EditModeExpanded/HEAD/Source/textures/UI-MicroButton-Housing-Down.blp
--------------------------------------------------------------------------------
/.pkgmeta:
--------------------------------------------------------------------------------
1 | package-as: EditModeExpanded
2 |
3 | move-folders:
4 | EditModeExpanded/Source: EditModeExpanded
5 |
6 | ignore:
7 | - LICENCE.md
8 | - README.md
9 |
--------------------------------------------------------------------------------
/Source/textures/UI-MicroButton-Housing-Disabled.blp:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/teelolws/EditModeExpanded/HEAD/Source/textures/UI-MicroButton-Housing-Disabled.blp
--------------------------------------------------------------------------------
/Source/FrameHandlers/Pet.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | function addon:initPet()
4 | local db = addon.db.global
5 | if db.EMEOptions.pet then
6 | addon:registerSecureFrameHideable(PetFrame)
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/StanceBar.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | function addon:initStanceBar()
4 | local db = addon.db.global
5 | if db.EMEOptions.stanceBar then
6 | addon:registerSecureFrameHideable(StanceBar)
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/Source/libs/AceDB-3.0/AceDB-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Source/libs/AceLocale-3.0/AceLocale-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
--------------------------------------------------------------------------------
/Source/libs/CallbackHandler-1.0/CallbackHandler-1.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/ObjectiveTracker.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | function addon:initObjectiveTracker()
4 | local db = addon.db.global
5 | if db.EMEOptions.objectiveTrackerFrame then
6 | addon:registerSecureFrameHideable(ObjectiveTrackerFrame)
7 | end
8 | end
9 |
--------------------------------------------------------------------------------
/Source/libs/AceConfig-3.0/AceConfigCmd-3.0/AceConfigCmd-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Source/libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Source/libs/AceConfig-3.0/AceConfigRegistry-3.0/AceConfigRegistry-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/ExtraActionButton.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initExtraActionButton()
6 | local db = addon.db.global
7 | if not db.EMEOptions.extraActionButton then return end
8 | lib:RegisterResizable(ExtraAbilityContainer)
9 | end
10 |
11 |
12 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/Buffs.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | function addon:initBuffs()
4 | local db = addon.db.global
5 | if db.EMEOptions.buffFrame then
6 | addon:registerSecureFrameHideable(BuffFrame)
7 | end
8 |
9 | if db.EMEOptions.debuffFrame then
10 | addon:registerSecureFrameHideable(DebuffFrame)
11 | end
12 | end
13 |
--------------------------------------------------------------------------------
/Source/RegisterFrame.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | -- A simple wrapper for lib:RegisterFrame to also call RegisterCoordinates if that option is enabled
6 |
7 | function addon:registerFrame(frame, ...)
8 | lib:RegisterFrame(frame, ...)
9 | if addon.db.global.EMEOptions.allowSetCoordinates then
10 | lib:RegisterCoordinates(frame)
11 | end
12 | end
--------------------------------------------------------------------------------
/Source/ResetFrame.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | -- A simple wrapper for lib:RepositionFrame with additional protection against infinite loops
4 |
5 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
6 |
7 | local currentlyProcessing
8 |
9 | function addon.ResetFrame(frame)
10 | if currentlyProcessing then return end
11 | currentlyProcessing = true
12 | lib:RepositionFrame(frame)
13 | currentlyProcessing = false
14 | end
--------------------------------------------------------------------------------
/Source/CombatManager.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local handlers = {}
4 | function addon:continueAfterCombatEnds(handler)
5 | if InCombatLockdown() then
6 | table.insert(handlers, handler)
7 | else
8 | handler()
9 | end
10 | end
11 |
12 | EventRegistry:RegisterFrameEventAndCallbackWithHandle("PLAYER_REGEN_ENABLED", function()
13 | for _, handler in ipairs(handlers) do
14 | handler()
15 | end
16 | wipe(handlers)
17 | end)
18 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/Housing.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | function addon:initHousing()
4 | local db = addon.db.global
5 | if not db.EMEOptions.housingControlsFrame then return end
6 |
7 | addon.hookScriptOnce(HousingControlsFrame, "OnShow", function()
8 | addon:continueAfterCombatEnds(function()
9 | addon:registerFrame(HousingControlsFrame, BINDING_HEADER_HOUSING_SYSTEM, db.HousingControlsFrame)
10 | end)
11 | end)
12 | end
13 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/TopCenterContainer.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initTopCenterContainer()
6 | local db = addon.db.global
7 | if db.EMEOptions.uiWidgetTopCenterContainerFrame then
8 | addon:registerFrame(UIWidgetTopCenterContainerFrame, "Subzone Information", db.UIWidgetTopCenterContainerFrame)
9 | lib:SetDontResize(UIWidgetTopCenterContainerFrame)
10 | end
11 | end
12 |
--------------------------------------------------------------------------------
/Source/libs/AceConfig-3.0/AceConfig-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/DurationBars.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initDurationBars()
6 | local db = addon.db.global
7 | if not db.EMEOptions.durationBars then return end
8 |
9 | lib:RegisterResizable(MirrorTimerContainer)
10 |
11 | -- Workaround for bug in base UI
12 | -- If player enters then leaves edit mode, the entire container will no longer show until the next reload
13 | MirrorTimerContainer:HookScript("OnEvent", function(self)
14 | self:SetShown(self:ShouldShow())
15 | end)
16 | end
17 |
--------------------------------------------------------------------------------
/.github/workflows/luacheck.yml:
--------------------------------------------------------------------------------
1 | name: Luacheck
2 | on: [push, pull_request]
3 | jobs:
4 | luacheck:
5 | runs-on: ubuntu-latest
6 | steps:
7 | - name: Checkout
8 | uses: actions/checkout@v4
9 | - name: Luacheck linter - LibEME
10 | uses: lunarmodules/luacheck@v1
11 | with:
12 | args: Source/libs/EditModeExpanded-1.0/EditModeExpanded-1.0.lua --no-max-line-length --no-global --ignore 6 self addonName
13 | - name: Luacheck linter
14 | uses: lunarmodules/luacheck@v1
15 | with:
16 | args: . --exclude-files **/libs/** --no-max-line-length --no-global --ignore 6 self addonName
17 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/TotemFrame.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initTotemFrame()
6 | local db = addon.db.global
7 | if not db.EMEOptions.totem then return end
8 |
9 | TotemFrame:SetParent(UIParent)
10 | addon:registerFrame(TotemFrame, TUTORIAL_TITLE47, db.TotemFrame)
11 | lib:SetDefaultSize(TotemFrame, 100, 40)
12 | lib:RegisterHideable(TotemFrame)
13 | lib:RegisterToggleInCombat(TotemFrame)
14 | lib:RegisterResizable(TotemFrame)
15 |
16 | EventRegistry:RegisterFrameEventAndCallbackWithHandle("PLAYER_TOTEM_UPDATE", function()
17 | addon.ResetFrame(TotemFrame)
18 | end)
19 | end
20 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/FocusFrame.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 |
6 | function addon:initFocusFrame()
7 | local db = addon.db.global
8 | if not db.EMEOptions.focusFrame then return end
9 |
10 | addon:registerSecureFrameHideable(FocusFrame)
11 |
12 | local nameWasHidden
13 | lib:RegisterCustomCheckbox(FocusFrame, L["Hide Name"],
14 | function()
15 | FocusFrame.name:Hide()
16 | nameWasHidden = true
17 | end,
18 | function()
19 | if not nameWasHidden then return end
20 | FocusFrame.name:Show()
21 | nameWasHidden = false
22 | end,
23 | "HideName"
24 | )
25 |
26 | lib:RegisterResizable(FocusFrame)
27 | end
28 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/BelowMinimapContainer.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 |
6 | function addon:initBelowMinimapContainer()
7 | local db = addon.db.global
8 | if db.EMEOptions.UIWidgetBelowMinimapContainerFrame then
9 | if UIWidgetBelowMinimapContainerFrame then
10 | UIWidgetBelowMinimapContainerFrame:SetParent(UIParent)
11 | addon:registerFrame(UIWidgetBelowMinimapContainerFrame, L["PvP Objectives"], db.UIWidgetBelowMinimapContainerFrame)
12 | lib:RegisterResizable(UIWidgetBelowMinimapContainerFrame)
13 | ArenaEnemyFramesContainer:SetParent(UIParent)
14 | addon:registerFrame(ArenaEnemyFramesContainer, L["BG Targets"], db.ArenaEnemyFramesContainer)
15 | end
16 | end
17 | end
18 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/ClassResources/Runes.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initRunes()
6 | local db = addon.db.global
7 | if not db.EMEOptions.runes then return end
8 | addon:registerFrame(RuneFrame, RUNES, db.Runes)
9 | lib:RegisterHideable(RuneFrame)
10 | lib:RegisterToggleInCombat(RuneFrame)
11 | lib:SetDontResize(RuneFrame)
12 | lib:RegisterResizable(RuneFrame)
13 | addon.registerAnchorToDropdown(RuneFrame)
14 | hooksecurefunc(PlayerFrameBottomManagedFramesContainer, "Layout", function()
15 | if not EditModeManagerFrame.editModeActive then
16 | addon.ResetFrame(RuneFrame)
17 | end
18 | end)
19 | RuneFrame:HookScript("OnShow", function()
20 | addon.ResetFrame(RuneFrame)
21 | end)
22 | addon.unlinkClassResourceFrame(RuneFrame)
23 | end
24 |
--------------------------------------------------------------------------------
/Source/WarningFrame.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
21 |
22 |
23 |
24 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/BonusRoll.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 |
6 | function addon:initBonusRoll()
7 | local db = addon.db.global
8 | if db.EMEOptions.bonusRoll then
9 | addon.hookScriptOnce(BonusRollFrame, "OnShow", function()
10 | addon:continueAfterCombatEnds(function()
11 | addon:registerFrame(BonusRollFrame, L["Bonus Roll"], db.BonusRoll)
12 | lib:HideByDefault(BonusRollFrame)
13 | BonusRollFrame.Selection:SetFrameStrata("TOOLTIP")
14 | BonusRollFrame:HookScript("OnShow", function()
15 | if BonusRollFrame.system then
16 | addon.ResetFrame(BonusRollFrame)
17 | end
18 | end)
19 | end)
20 | end)
21 | end
22 | end
23 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/TargetOfTarget.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initTargetOfTarget()
6 | local db = addon.db.global
7 | if db.EMEOptions.targetOfTarget then
8 | TargetFrameToT:SetUserPlaced(false)
9 | addon:registerFrame(TargetFrameToT, SHOW_TARGET_OF_TARGET_TEXT, db.ToT)
10 | lib:RegisterResizable(TargetFrameToT)
11 | TargetFrameToT:HookScript("OnHide", function()
12 | if (not InCombatLockdown()) and EditModeManagerFrame.editModeActive and lib:IsFrameEnabled(TargetFrameToT) then
13 | if C_CVar.GetCVar("showTargetOfTarget") == "1" then
14 | TargetFrameToT:Show()
15 | end
16 | end
17 | end)
18 | addon:registerSecureFrameHideable(TargetFrameToT)
19 | addon.registerAnchorToDropdown(TargetFrameToT)
20 | end
21 | end
22 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/ClassResources/ChiBar.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initChiBar()
6 | local db = addon.db.global
7 | if not db.EMEOptions.chi then return end
8 | addon:registerFrame(MonkHarmonyBarFrame, CHI_POWER, db.Chi)
9 | lib:SetDontResize(MonkHarmonyBarFrame)
10 | lib:RegisterHideable(MonkHarmonyBarFrame)
11 | lib:RegisterToggleInCombat(MonkHarmonyBarFrame)
12 | lib:RegisterResizable(MonkHarmonyBarFrame)
13 | addon.registerAnchorToDropdown(MonkHarmonyBarFrame)
14 | hooksecurefunc(PlayerFrameBottomManagedFramesContainer, "Layout", function()
15 | if not EditModeManagerFrame.editModeActive then
16 | addon.ResetFrame(MonkHarmonyBarFrame)
17 | end
18 | end)
19 | MonkHarmonyBarFrame:HookScript("OnShow", function()
20 | addon.ResetFrame(MonkHarmonyBarFrame)
21 | end)
22 | addon.unlinkClassResourceFrame(MonkHarmonyBarFrame)
23 | end
24 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/ClassResources/SoulShards.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initSoulShards()
6 | local db = addon.db.global
7 | if not db.EMEOptions.soulShards then return end
8 | addon:registerFrame(WarlockPowerFrame, SOUL_SHARDS_POWER, db.SoulShards)
9 | lib:RegisterHideable(WarlockPowerFrame)
10 | lib:RegisterToggleInCombat(WarlockPowerFrame)
11 | lib:SetDontResize(WarlockPowerFrame)
12 | lib:RegisterResizable(WarlockPowerFrame)
13 | addon.registerAnchorToDropdown(WarlockPowerFrame)
14 | hooksecurefunc(PlayerFrameBottomManagedFramesContainer, "Layout", function()
15 | if not EditModeManagerFrame.editModeActive then
16 | addon.ResetFrame(WarlockPowerFrame)
17 | end
18 | end)
19 | hooksecurefunc(WarlockPowerFrame, "Show", function()
20 | addon.ResetFrame(WarlockPowerFrame)
21 | end)
22 | addon.unlinkClassResourceFrame(WarlockPowerFrame)
23 | end
24 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/ChatButtons.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 |
6 | function addon:initChatButtons()
7 | local db = addon.db.global
8 | if not db.EMEOptions.chatButtons then return end
9 | addon:registerFrame(QuickJoinToastButton, SOCIAL_BUTTON, db.QuickJoinToastButton)
10 | lib:SetDontResize(QuickJoinToastButton)
11 | lib:RegisterHideable(QuickJoinToastButton)
12 |
13 | addon:registerFrame(ChatFrameChannelButton, CHANNELS, db.ChatFrameChannelButton)
14 | lib:SetDontResize(ChatFrameChannelButton)
15 | lib:RegisterHideable(ChatFrameChannelButton)
16 |
17 | addon:registerFrame(ChatFrameMenuButton, L["Chat Menu"], db.ChatFrameMenuButton)
18 | lib:SetDontResize(ChatFrameMenuButton)
19 | lib:RegisterHideable(ChatFrameMenuButton)
20 |
21 | lib:GroupOptions({QuickJoinToastButton, ChatFrameChannelButton, ChatFrameMenuButton}, L["Chat Buttons"])
22 | end
23 |
--------------------------------------------------------------------------------
/.github/workflows/beta.yml:
--------------------------------------------------------------------------------
1 | # This is a basic workflow to help you get started with Actions
2 |
3 | name: Package Addon
4 |
5 | # Controls when the action will run. Triggers the workflow on push or pull request
6 | # events but only for the master branch
7 | on:
8 | push:
9 | tags:
10 | - '*beta*'
11 |
12 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel
13 | jobs:
14 | # This workflow contains a single job called "build"
15 | build:
16 | permissions: write-all
17 |
18 | # The type of runner that the job will run on
19 | runs-on: ubuntu-22.04
20 |
21 | # Steps represent a sequence of tasks that will be executed as part of the job
22 | steps:
23 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
24 | - uses: actions/checkout@v1
25 |
26 | - name: Create Package
27 | run: curl -s https://raw.githubusercontent.com/BigWigsMods/packager/master/release.sh | bash
28 | env:
29 | GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}
30 |
--------------------------------------------------------------------------------
/.github/workflows/main.yml:
--------------------------------------------------------------------------------
1 | # This is a basic workflow to help you get started with Actions
2 |
3 | name: Package Addon
4 |
5 | # Controls when the action will run. Triggers the workflow on push or pull request
6 | # events but only for the master branch
7 | on:
8 | push:
9 | tags-ignore:
10 | - '*beta*'
11 |
12 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel
13 | jobs:
14 | # This workflow contains a single job called "build"
15 | build:
16 | permissions: write-all
17 |
18 | # The type of runner that the job will run on
19 | runs-on: ubuntu-22.04
20 |
21 | # Steps represent a sequence of tasks that will be executed as part of the job
22 | steps:
23 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
24 | - uses: actions/checkout@v1
25 |
26 | - name: Create Package
27 | run: curl -s https://raw.githubusercontent.com/BigWigsMods/packager/master/release.sh | bash
28 | env:
29 | CF_API_KEY: ${{ secrets.CF_API_KEY }}
30 | GITHUB_OAUTH: ${{ secrets.GITHUB_TOKEN }}
31 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/FocusCast.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 |
6 | function addon:initFocusCastBar()
7 | local db = addon.db.global
8 | if db.EMEOptions.focusCast then
9 | addon:registerFrame(FocusFrameSpellBar, L["Focus Cast Bar"], db.FocusSpellBar, FocusFrame, "TOPLEFT")
10 | lib:SetDontResize(FocusFrameSpellBar)
11 | hooksecurefunc(FocusFrameSpellBar, "AdjustPosition", function(self)
12 | if EditModeManagerFrame.editModeActive then
13 | FocusFrameSpellBar:Show()
14 | end
15 | addon.ResetFrame(FocusFrameSpellBar)
16 | end)
17 | FocusFrameSpellBar:HookScript("OnShow", function(self)
18 | addon.ResetFrame(FocusFrameSpellBar)
19 | end)
20 | lib:SetDontResize(FocusFrameSpellBar)
21 | lib:RegisterResizable(FocusFrameSpellBar)
22 | lib:RegisterHideable(FocusFrameSpellBar)
23 | addon.registerAnchorToDropdown(FocusFrameSpellBar)
24 | end
25 | end
26 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/FocusToT.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 |
6 | function addon:initFocusToT()
7 | local db = addon.db.global
8 | if db.EMEOptions.focusTargetOfTarget then
9 | FocusFrameToT:SetUserPlaced(false) -- bug with frame being saved in layout cache leading to errors in TargetFrame.lua
10 | addon:registerFrame(FocusFrameToT, L["Focus ToT"], db.FocusToT)
11 | lib:RegisterResizable(FocusFrameToT)
12 | FocusFrameToT:HookScript("OnHide", function()
13 | if (not InCombatLockdown()) and EditModeManagerFrame.editModeActive and lib:IsFrameEnabled(FocusFrameToT) then
14 | FocusFrameToT:Show()
15 | end
16 | end)
17 | hooksecurefunc(FocusFrameToT, "SetPoint", function()
18 | if FocusFrameToT:IsUserPlaced() then
19 | FocusFrameToT:SetUserPlaced(false)
20 | end
21 | end)
22 | addon:registerSecureFrameHideable(FocusFrameToT)
23 | addon.registerAnchorToDropdown(FocusFrameToT)
24 | end
25 | end
26 |
27 |
28 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/GameMenu.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initGameMenu()
6 | local db = addon.db.global
7 | if not db.EMEOptions.gameMenu then return end
8 | local loaded
9 | hooksecurefunc(GameMenuFrame, "Layout", function()
10 | if loaded then return end
11 | if InCombatLockdown() then return end
12 | loaded = true
13 | addon:registerFrame(GameMenuFrame, MAINMENU_BUTTON, db.GameMenuFrame)
14 | lib:RegisterResizable(GameMenuFrame)
15 | lib:HideByDefault(GameMenuFrame)
16 | GameMenuFrame.Selection:SetFrameStrata("DIALOG")
17 | end)
18 |
19 | -- issue: edit mode is closed while in combat, the .Select never gets hidden and gets in the way when player opens menu again
20 | hooksecurefunc(GameMenuFrame, "Show", function()
21 | --if InCombatLockdown() then return end -- uncomment if issues are reported!
22 | if not GameMenuFrame.Selection then return end
23 | if not EditModeManagerFrame:IsEditModeActive() then
24 | GameMenuFrame.Selection:Hide()
25 | end
26 | end)
27 | end
28 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/ClassResources/HolyPower.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initHolyPower()
6 | local db = addon.db.global
7 | if not db.EMEOptions.holyPower then return end
8 | addon:registerFrame(PaladinPowerBarFrame, HOLY_POWER, db.HolyPower)
9 | C_Timer.After(4, function() addon.ResetFrame(PaladinPowerBarFrame) end)
10 | lib:RegisterHideable(PaladinPowerBarFrame)
11 | lib:RegisterToggleInCombat(PaladinPowerBarFrame)
12 | addon.registerAnchorToDropdown(PaladinPowerBarFrame)
13 | hooksecurefunc(PlayerFrameBottomManagedFramesContainer, "Layout", function()
14 | if not EditModeManagerFrame.editModeActive then
15 | addon.ResetFrame(PaladinPowerBarFrame)
16 | if lib:IsFrameMarkedHidden(PaladinPowerBarFrame) then
17 | PaladinPowerBarFrame:Hide()
18 | end
19 | end
20 | end)
21 | PaladinPowerBarFrame:HookScript("OnShow", function()
22 | addon.ResetFrame(PaladinPowerBarFrame)
23 | end)
24 | lib:RegisterResizable(PaladinPowerBarFrame)
25 | addon.unlinkClassResourceFrame(PaladinPowerBarFrame)
26 | end
27 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/GroupLoot.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 |
5 | function addon:initGroupLoot()
6 | local db = addon.db.global
7 | if not db.EMEOptions.groupLootContainer then return end
8 |
9 | addon.hookScriptOnce(GroupLootContainer, "OnShow", function()
10 | addon:continueAfterCombatEnds(function()
11 | addon:registerFrame(GroupLootContainer, L["Group Loot Container"], db.GroupLootContainer)
12 | hooksecurefunc(GroupLootContainer, "SetPoint", function()
13 | addon.ResetFrame(GroupLootContainer)
14 | end)
15 | hooksecurefunc("GroupLootContainer_Update", function()
16 | addon.ResetFrame(GroupLootContainer)
17 | end)
18 | hooksecurefunc(UIParentBottomManagedFrameContainer, "Layout", function()
19 | addon.ResetFrame(GroupLootContainer)
20 | end)
21 | GroupLootContainer:HookScript("OnShow", function()
22 | if GroupLootContainer.system then
23 | addon.ResetFrame(GroupLootContainer)
24 | end
25 | end)
26 | end)
27 | end)
28 | end
29 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/Tooltip.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | function addon:initTooltip()
4 | local db = addon.db.global
5 | if db.EMEOptions.gameTooltip then
6 | GameTooltipDefaultContainer:SetClampedToScreen(false)
7 |
8 | local isHidden = addon:registerSecureFrameHideable(GameTooltipDefaultContainer, true, function()
9 | local _, relativeTo = GameTooltip:GetPoint(1)
10 | if relativeTo == GameTooltipDefaultContainer then
11 | GameTooltip:SetClampedToScreen(false)
12 | end
13 | end,
14 | function()
15 | GameTooltip:SetClampedToScreen(true)
16 | end)
17 |
18 | hooksecurefunc(GameTooltip, "SetPoint", function(self)
19 | local _, relativeTo = GameTooltip:GetPoint(1)
20 | if isHidden() and (relativeTo == GameTooltipDefaultContainer) then
21 | self:SetClampedToScreen(false)
22 | self:ClearAllPoints()
23 | end
24 | end)
25 |
26 | hooksecurefunc(GameTooltip, "SetOwner", function(self, anchorTo)
27 | if isHidden() then
28 | if anchorTo ~= GameTooltipDefaultContainer then
29 | self:SetClampedToScreen(true)
30 | end
31 | end
32 | end)
33 | end
34 | end
35 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/ClassResources/Essences.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initEssences()
6 | local db = addon.db.global
7 | if not db.EMEOptions.evokerEssences then return end
8 | addon:registerFrame(EssencePlayerFrame, POWER_TYPE_ESSENCE, db.EvokerEssences)
9 | lib:SetDontResize(EssencePlayerFrame)
10 | lib:RegisterHideable(EssencePlayerFrame)
11 | lib:RegisterToggleInCombat(EssencePlayerFrame)
12 | lib:RegisterResizable(EssencePlayerFrame)
13 | addon.registerAnchorToDropdown(EssencePlayerFrame)
14 | hooksecurefunc(PlayerFrameBottomManagedFramesContainer, "Layout", function()
15 | if not EditModeManagerFrame.editModeActive then
16 | addon.ResetFrame(EssencePlayerFrame)
17 | end
18 | end)
19 | EssencePlayerFrame:HookScript("OnShow", function()
20 | addon.ResetFrame(EssencePlayerFrame)
21 | end)
22 | addon.unlinkClassResourceFrame(EssencePlayerFrame)
23 |
24 | -- check Blizzard_UnitFrame\EssenceFramePlayer.xml for spacing defaults to -1
25 | local currentSpacing = -1
26 | lib:RegisterSlider(EssencePlayerFrame, "Spacing", "Spacing", function(value)
27 | if value == currentSpacing then return end
28 | EssencePlayerFrame.spacing = value
29 | EssencePlayerFrame:Layout()
30 | end, -10, 20, 1)
31 | end
32 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/ClassResources/ArcaneCharges.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initArcaneCharges()
6 | local db = addon.db.global
7 | if not db.EMEOptions.arcaneCharges then return end
8 | addon:registerFrame(MageArcaneChargesFrame, POWER_TYPE_ARCANE_CHARGES, db.ArcaneCharges)
9 | lib:RegisterHideable(MageArcaneChargesFrame)
10 | lib:RegisterToggleInCombat(MageArcaneChargesFrame)
11 | lib:SetDontResize(MageArcaneChargesFrame)
12 | lib:RegisterResizable(MageArcaneChargesFrame)
13 | addon.registerAnchorToDropdown(MageArcaneChargesFrame)
14 | hooksecurefunc(PlayerFrameBottomManagedFramesContainer, "Layout", function()
15 | if GetSpecialization() ~= 1 then return end
16 | if not EditModeManagerFrame.editModeActive then
17 | addon.ResetFrame(MageArcaneChargesFrame)
18 | end
19 | end)
20 | hooksecurefunc(MageArcaneChargesFrame, "HandleBarSetup", function()
21 | if GetSpecialization() ~= 1 then return end
22 | if not EditModeManagerFrame.editModeActive then
23 | addon.ResetFrame(MageArcaneChargesFrame)
24 | end
25 | end)
26 | MageArcaneChargesFrame:HookScript("OnShow", function()
27 | if GetSpecialization() ~= 1 then return end
28 | addon.ResetFrame(MageArcaneChargesFrame)
29 | end)
30 | addon.unlinkClassResourceFrame(MageArcaneChargesFrame)
31 | end
32 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/LossOfControl.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initLossOfControl()
6 | local db = addon.db.global
7 | if not db.EMEOptions.lossOfControl then return end
8 | addon:registerFrame(LossOfControlFrame, LOSS_OF_CONTROL, db.LOC)
9 | lib:HideByDefault(LossOfControlFrame)
10 |
11 | -- The OnUpdate event will try and hide the LOC Frame for not having any data
12 | -- Suppress its OnUpdate handler during edit mode
13 | hooksecurefunc(EditModeManagerFrame, "EnterEditMode", function(self)
14 | if InCombatLockdown() then return end
15 | LossOfControlFrame:SetScript("OnUpdate", nop)
16 | end)
17 | hooksecurefunc(EditModeManagerFrame, "ExitEditMode", function(self)
18 | if InCombatLockdown() then return end
19 | LossOfControlFrame:SetScript("OnUpdate", LossOfControlMixin.OnUpdate)
20 | end)
21 |
22 | lib:RegisterCustomCheckbox(LossOfControlFrame, "Hide Glow Effect",
23 | function()
24 | LossOfControlFrame.RedLineBottom:Hide()
25 | LossOfControlFrame.RedLineTop:Hide()
26 | LossOfControlFrame.blackBg:Hide()
27 | end,
28 | function()
29 | LossOfControlFrame.RedLineBottom:Show()
30 | LossOfControlFrame.RedLineTop:Show()
31 | LossOfControlFrame.blackBg:Show()
32 | end,
33 | "HideIcons"
34 | )
35 | end
36 |
--------------------------------------------------------------------------------
/Source/libs/LibStub.lua:
--------------------------------------------------------------------------------
1 | -- LibStub is a simple versioning stub meant for use in Libraries. http://www.wowace.com/wiki/LibStub for more info
2 | -- LibStub is hereby placed in the Public Domain Credits: Kaelten, Cladhaire, ckknight, Mikk, Ammo, Nevcairiel, joshborke
3 | local LIBSTUB_MAJOR, LIBSTUB_MINOR = "LibStub", 2 -- NEVER MAKE THIS AN SVN REVISION! IT NEEDS TO BE USABLE IN ALL REPOS!
4 | local LibStub = _G[LIBSTUB_MAJOR]
5 |
6 | if not LibStub or LibStub.minor < LIBSTUB_MINOR then
7 | LibStub = LibStub or {libs = {}, minors = {} }
8 | _G[LIBSTUB_MAJOR] = LibStub
9 | LibStub.minor = LIBSTUB_MINOR
10 |
11 | function LibStub:NewLibrary(major, minor)
12 | assert(type(major) == "string", "Bad argument #2 to `NewLibrary' (string expected)")
13 | minor = assert(tonumber(strmatch(minor, "%d+")), "Minor version must either be a number or contain a number.")
14 |
15 | local oldminor = self.minors[major]
16 | if oldminor and oldminor >= minor then return nil end
17 | self.minors[major], self.libs[major] = minor, self.libs[major] or {}
18 | return self.libs[major], oldminor
19 | end
20 |
21 | function LibStub:GetLibrary(major, silent)
22 | if not self.libs[major] and not silent then
23 | error(("Cannot find a library instance of %q."):format(tostring(major)), 2)
24 | end
25 | return self.libs[major], self.minors[major]
26 | end
27 |
28 | function LibStub:IterateLibraries() return pairs(self.libs) end
29 | setmetatable(LibStub, { __call = LibStub.GetLibrary })
30 | end
--------------------------------------------------------------------------------
/Source/FrameHandlers/AlertFrame.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 |
6 | local function resetScales()
7 | local scale = AlertFrame:GetScale()
8 | for _, alertSystem in pairs(AlertFrame.alertFrameSubSystems) do
9 | if alertSystem.alertFramePool then
10 | for achievementAlertFrame in alertSystem.alertFramePool:EnumerateActive() do
11 | achievementAlertFrame:SetParent(UIParent)
12 | achievementAlertFrame:SetScale(scale)
13 | end
14 | end
15 | end
16 | end
17 |
18 | function addon:initAlertFrame()
19 | local db = addon.db.global
20 |
21 | if not db.EMEOptions.achievementAlert then return end
22 |
23 | if ( not AchievementFrame ) then
24 | AchievementFrame_LoadUI()
25 | end
26 | addon:registerFrame(AlertFrame, L["Alert"], db.Achievements)
27 | lib:SetDefaultSize(AlertFrame, 20, 20)
28 | lib:RegisterResizable(AlertFrame)
29 | AlertFrame.Selection:HookScript("OnMouseDown", function()
30 | AchievementAlertSystem:AddAlert(6)
31 | end)
32 | AlertFrame:HookScript("OnEvent", function()
33 | addon.ResetFrame(AlertFrame)
34 | end)
35 | hooksecurefunc(AlertFrame, "SetScaleOverride", resetScales)
36 | hooksecurefunc(AlertFrame, "ReparentAlerts", resetScales)
37 | hooksecurefunc(AlertFrame, "UpdateAnchors", resetScales)
38 | end
39 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/TargetCast.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
5 |
6 | function addon:initTargetCastBar()
7 | local db = addon.db.global
8 | if db.EMEOptions.targetCast then
9 | addon:registerFrame(TargetFrameSpellBar, L["TARGET_CAST_BAR"], db.TargetSpellBar, TargetFrame, "TOPLEFT")
10 | hooksecurefunc(TargetFrameSpellBar, "AdjustPosition", function(self)
11 | addon.ResetFrame(TargetFrameSpellBar)
12 | if EditModeManagerFrame.editModeActive then
13 | TargetFrameSpellBar:Show()
14 | end
15 | end)
16 | TargetFrameSpellBar:HookScript("OnShow", function(self)
17 | addon.ResetFrame(TargetFrameSpellBar)
18 | end)
19 | lib:SetDontResize(TargetFrameSpellBar)
20 | lib:RegisterResizable(TargetFrameSpellBar, 10, 500)
21 | lib:RegisterHideable(TargetFrameSpellBar)
22 | addon.registerAnchorToDropdown(TargetFrameSpellBar)
23 |
24 | lib:RegisterSlider(TargetFrameSpellBar, "Width", "Width",
25 | function(newValue)
26 | TargetFrameSpellBar:SetWidth(newValue)
27 | end,
28 | 10, 300, 1)
29 | lib:RegisterSlider(TargetFrameSpellBar, "Height", "Height",
30 | function(newValue)
31 | TargetFrameSpellBar:SetHeight(newValue)
32 | end,
33 | 1, 50, 1)
34 | end
35 | end
36 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/LFG.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 |
5 | function addon:initLFG()
6 | local db = addon.db.global
7 | if db.EMEOptions.lfg then
8 | QueueStatusButton:SetParent(UIParent)
9 | addon:registerFrame(QueueStatusButton, L["LFG"], db.QueueStatusButton)
10 | hooksecurefunc(MicroMenu, "UpdateQueueStatusAnchors", function()
11 | if InCombatLockdown() then return end
12 | addon.ResetFrame(QueueStatusButton)
13 | end)
14 | hooksecurefunc(MicroMenuContainer, "Layout", function()
15 | if InCombatLockdown() then return end
16 | MicroMenuContainer:SetWidth(MicroMenu:GetWidth()*MicroMenu:GetScale())
17 | MicroMenuContainer:SetHeight(MicroMenu:GetHeight()*MicroMenu:GetScale())
18 | end)
19 | MicroMenuContainer:SetWidth(MicroMenu:GetWidth()*MicroMenu:GetScale())
20 |
21 | -- the wasVisible saved in the library when entering Edit Mode cannot be relied upon, as entering Edit Mode shows the queue status button even if its hidden
22 | hooksecurefunc(EditModeManagerFrame, "ExitEditMode", function()
23 | if InCombatLockdown() then return end
24 | QueueStatusFrame:Update()
25 | end)
26 |
27 | addon:registerSecureFrameHideable(QueueStatusButton)
28 |
29 | C_Timer.After(1, function()
30 | addon.ResetFrame(QueueStatusButton)
31 | end)
32 | end
33 | end
34 |
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/AceGUI-3.0.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/Source/HookOnce.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | -- A wrapper for :HookScript and hooksecurefunc to only trigger once
4 |
5 | local savedHookScripts = {}
6 | local savedHookFuncs = {}
7 |
8 | function addon.hookScriptOnce(frame, script, callback)
9 | if not savedHookScripts[frame] then
10 | savedHookScripts[frame] = {}
11 | end
12 |
13 | local db = savedHookScripts[frame]
14 | if db[script] then
15 | table.insert(db[script], callback)
16 | else
17 | db[script] = {callback}
18 | local function handler()
19 | for _, cb in ipairs(db[script]) do
20 | cb()
21 | end
22 | wipe(db[script])
23 | end
24 | frame:HookScript(script, handler)
25 | end
26 | end
27 |
28 | function addon.hookFuncOnce(tbl, script, callback)
29 | if type(tbl) == "string" then
30 | callback = script
31 | script = tbl
32 | tbl = nil
33 | end
34 |
35 | if not savedHookFuncs[tbl or script] then
36 | savedHookFuncs[tbl or script] = {}
37 | end
38 |
39 | local db = savedHookFuncs[tbl or script]
40 | if db[script] then
41 | table.insert(db[script], callback)
42 | else
43 | db[script] = {callback}
44 | local function handler()
45 | for _, cb in ipairs(db[script]) do
46 | cb()
47 | end
48 | wipe(db[script])
49 | end
50 | if tbl == nil then
51 | hooksecurefunc(script, handler)
52 | else
53 | hooksecurefunc(tbl, script, handler)
54 | end
55 | end
56 | end
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | Expands Blizzard's Edit Mode to allow other frames to be moved, too.
2 |
3 |
4 |
5 | There are two parts to this addon:
6 |
7 | 1\. EditModeExpanded: The addon itsself, which currently supports moving various parts of the base UI not already supported by Edit Mode, and adds resize and hide support to parts of the base UI that don't already have that option
8 | 2\. EditModeExpanded-1.0: The library, which can be imported by other addons, to allow the other addon to make itsself movable in Edit Mode
9 |
10 | Currently supports:
11 | 1\. Moving custom frames around during Edit Mode (Anything you'd like to move around that Blizzard didn't already highlight in Blue during Edit Mode!)
12 | 2\. Saving the location of custom frames moved during Edit Mode, and restoring that location during login
13 | 3\. Splits the Menu Bar from the Backpack Bar so they can be moved separately
14 |
15 | 4\. Resize custom frames, save and reload the custom size
16 | 5\. Save settings per Edit Mode profile
17 |
18 | 6\. Option to change the menu buttons back to either the Shadowlands versions or the Black and White ones from early Dragonflight
19 | 7\. Option to add back a recreation of the Dragonriding Vigor Bar, with the Algari Stormrider variant
20 |
21 |
22 | Discuss EditModeExpanded on Teelo's Discord: https://discord.gg/KBzF9CHuCy
23 |
24 |
25 | For other addon developers - Usage Information: https://github.com/teelolws/EditModeExpanded/wiki/Authors:-Library-Usage
26 |
27 | License: The Library portion of this Project may be included, used, and distributed in your addon, provided you credit me as the author of the work.
28 |
29 | 
30 | https://www.patreon.com/tldrmissions
31 |
--------------------------------------------------------------------------------
/Source/AnchorToDropdown.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 | local libDD = LibStub:GetLibrary("LibUIDropDownMenu-4.0")
6 |
7 | function addon.registerAnchorToDropdown(frame)
8 | local dropdown, getSettingDB = lib:RegisterDropdown(frame, libDD, "AnchorToDropdown")
9 |
10 | local function updateFrameAnchor()
11 | if InCombatLockdown() then return end
12 | local db = getSettingDB()
13 | if db.checked then
14 | lib:ReanchorFrame(frame, _G[db.checked], "BOTTOMLEFT")
15 | end
16 | end
17 |
18 | libDD:UIDropDownMenu_Initialize(dropdown, function(self) --, level, menuList)
19 | local db = getSettingDB()
20 | local info = libDD:UIDropDownMenu_CreateInfo()
21 |
22 | for _, f in ipairs(EditModeManagerFrame.registeredSystemFrames) do
23 | if frame ~= f then
24 | info.text = f:GetName()
25 | info.checked = db.checked == f:GetName()
26 | info.func = function()
27 | if db.checked == f:GetName() then
28 | db.checked = nil
29 | else
30 | db.checked = f:GetName()
31 | end
32 | updateFrameAnchor()
33 | end
34 | libDD:UIDropDownMenu_AddButton(info)
35 | end
36 | end
37 | end)
38 | libDD:UIDropDownMenu_SetWidth(dropdown, 100)
39 | libDD:UIDropDownMenu_SetText(dropdown, L["Anchor To:"])
40 |
41 | EventRegistry:RegisterCallback("EDIT_MODE_LAYOUTS_UPDATED", updateFrameAnchor)
42 | updateFrameAnchor()
43 | if frame.EMEResetButton then
44 | frame.EMEResetButton:HookScript("OnClick", function()
45 | local db = getSettingDB()
46 | db.checked = false
47 | end)
48 | end
49 | end
50 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/ClassResources/ComboPoints.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initRogueComboPoints()
6 | local db = addon.db.global
7 | if not db.EMEOptions.comboPoints then return end
8 | addon:registerFrame(RogueComboPointBarFrame, COMBO_POINTS_POWER, db.ComboPoints)
9 | lib:SetDontResize(RogueComboPointBarFrame)
10 | lib:RegisterHideable(RogueComboPointBarFrame)
11 | lib:RegisterToggleInCombat(RogueComboPointBarFrame)
12 | lib:RegisterResizable(RogueComboPointBarFrame)
13 | addon.registerAnchorToDropdown(RogueComboPointBarFrame)
14 | hooksecurefunc(PlayerFrameBottomManagedFramesContainer, "Layout", function()
15 | if not EditModeManagerFrame.editModeActive then
16 | addon.ResetFrame(RogueComboPointBarFrame)
17 | end
18 | end)
19 | hooksecurefunc(RogueComboPointBarFrame, "Show", function()
20 | addon.ResetFrame(RogueComboPointBarFrame)
21 | end)
22 | addon.unlinkClassResourceFrame(RogueComboPointBarFrame)
23 | end
24 |
25 | function addon:initDruidComboPoints()
26 | local db = addon.db.global
27 | if not db.EMEOptions.comboPoints then return end
28 | addon:registerFrame(DruidComboPointBarFrame, COMBO_POINTS_POWER, db.ComboPoints)
29 | lib:SetDontResize(DruidComboPointBarFrame)
30 | lib:RegisterHideable(DruidComboPointBarFrame)
31 | lib:RegisterToggleInCombat(DruidComboPointBarFrame)
32 | lib:RegisterResizable(DruidComboPointBarFrame)
33 | addon.registerAnchorToDropdown(DruidComboPointBarFrame)
34 | hooksecurefunc(PlayerFrameBottomManagedFramesContainer, "Layout", function()
35 | if not DruidComboPointBarFrame:ShouldShowBar() then return end
36 | if not EditModeManagerFrame.editModeActive then
37 | addon.ResetFrame(DruidComboPointBarFrame)
38 | end
39 | end)
40 | hooksecurefunc(DruidComboPointBarFrame, "Show", function()
41 | if not DruidComboPointBarFrame:ShouldShowBar() then return end
42 | addon.ResetFrame(DruidComboPointBarFrame)
43 | end)
44 | addon.unlinkClassResourceFrame(DruidComboPointBarFrame)
45 | end
46 |
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIContainer-SimpleGroup.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | SimpleGroup Container
3 | Simple container widget that just groups widgets.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "SimpleGroup", 20
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs = pairs
11 |
12 | -- WoW APIs
13 | local CreateFrame, UIParent = CreateFrame, UIParent
14 |
15 |
16 | --[[-----------------------------------------------------------------------------
17 | Methods
18 | -------------------------------------------------------------------------------]]
19 | local methods = {
20 | ["OnAcquire"] = function(self)
21 | self:SetWidth(300)
22 | self:SetHeight(100)
23 | end,
24 |
25 | -- ["OnRelease"] = nil,
26 |
27 | ["LayoutFinished"] = function(self, width, height)
28 | if self.noAutoHeight then return end
29 | self:SetHeight(height or 0)
30 | end,
31 |
32 | ["OnWidthSet"] = function(self, width)
33 | local content = self.content
34 | content:SetWidth(width)
35 | content.width = width
36 | end,
37 |
38 | ["OnHeightSet"] = function(self, height)
39 | local content = self.content
40 | content:SetHeight(height)
41 | content.height = height
42 | end
43 | }
44 |
45 | --[[-----------------------------------------------------------------------------
46 | Constructor
47 | -------------------------------------------------------------------------------]]
48 | local function Constructor()
49 | local frame = CreateFrame("Frame", nil, UIParent)
50 | frame:SetFrameStrata("FULLSCREEN_DIALOG")
51 |
52 | --Container Support
53 | local content = CreateFrame("Frame", nil, frame)
54 | content:SetPoint("TOPLEFT")
55 | content:SetPoint("BOTTOMRIGHT")
56 |
57 | local widget = {
58 | frame = frame,
59 | content = content,
60 | type = Type
61 | }
62 | for method, func in pairs(methods) do
63 | widget[method] = func
64 | end
65 |
66 | return AceGUI:RegisterAsContainer(widget)
67 | end
68 |
69 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
70 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/TargetFrame.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
3 |
4 | function addon:initTargetFrame()
5 | local db = addon.db.global
6 | if db.EMEOptions.targetFrame then
7 | addon:registerSecureFrameHideable(TargetFrame)
8 |
9 | if db.EMEOptions.targetFrameBuffs then
10 | local targetBuffsFrame = CreateFrame("Frame", "TargetFrameBuffs", TargetFrame)
11 | targetBuffsFrame:SetPoint("TOPLEFT", TargetFrame, "BOTTOMLEFT", 5, -10)
12 | targetBuffsFrame:SetSize(100, 10)
13 | addon:registerFrame(targetBuffsFrame, "Target Buffs", db.TargetBuffs)
14 | lib:SetDontResize(targetBuffsFrame)
15 |
16 | hooksecurefunc("TargetFrame_UpdateDebuffAnchor", function(self, buff)
17 | if self ~= TargetFrame then return end
18 |
19 | local point, relativeTo, relativePoint, offsetX, offsetY = buff:GetPoint()
20 |
21 | if point and (self.TargetFrameContainer.FrameTexture == relativeTo) then
22 | buff:SetPoint(point, targetBuffsFrame, relativePoint, offsetX, offsetY)
23 | end
24 | end)
25 |
26 | hooksecurefunc("TargetFrame_UpdateBuffAnchor", function(self, buff)
27 | if self ~= TargetFrame then return end
28 |
29 | local point, relativeTo, relativePoint, offsetX, offsetY = buff:GetPoint()
30 |
31 | if point and (self.TargetFrameContainer.FrameTexture == relativeTo) then
32 | buff:SetPoint(point, targetBuffsFrame, relativePoint, offsetX, offsetY)
33 | end
34 | end)
35 | end
36 |
37 | local targetFrameWasHidden
38 | lib:RegisterCustomCheckbox(TargetFrame, "Hide Name",
39 | function()
40 | TargetFrame.name:Hide()
41 | targetFrameWasHidden = true
42 | end,
43 | function()
44 | if targetFrameWasHidden then
45 | TargetFrame.name:Show()
46 | end
47 | targetFrameWasHidden = false
48 | end,
49 | "HideName"
50 | )
51 | end
52 | end
53 |
--------------------------------------------------------------------------------
/Source/libs/AceConfig-3.0/AceConfig-3.0.lua:
--------------------------------------------------------------------------------
1 | --- AceConfig-3.0 wrapper library.
2 | -- Provides an API to register an options table with the config registry,
3 | -- as well as associate it with a slash command.
4 | -- @class file
5 | -- @name AceConfig-3.0
6 | -- @release $Id: AceConfig-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $
7 |
8 | --[[
9 | AceConfig-3.0
10 |
11 | Very light wrapper library that combines all the AceConfig subcomponents into one more easily used whole.
12 |
13 | ]]
14 |
15 | local cfgreg = LibStub("AceConfigRegistry-3.0")
16 | local cfgcmd = LibStub("AceConfigCmd-3.0")
17 |
18 | local MAJOR, MINOR = "AceConfig-3.0", 3
19 | local AceConfig = LibStub:NewLibrary(MAJOR, MINOR)
20 |
21 | if not AceConfig then return end
22 |
23 | --TODO: local cfgdlg = LibStub("AceConfigDialog-3.0", true)
24 | --TODO: local cfgdrp = LibStub("AceConfigDropdown-3.0", true)
25 |
26 | -- Lua APIs
27 | local pcall, error, type, pairs = pcall, error, type, pairs
28 |
29 | -- -------------------------------------------------------------------
30 | -- :RegisterOptionsTable(appName, options, slashcmd, persist)
31 | --
32 | -- - appName - (string) application name
33 | -- - options - table or function ref, see AceConfigRegistry
34 | -- - slashcmd - slash command (string) or table with commands, or nil to NOT create a slash command
35 |
36 | --- Register a option table with the AceConfig registry.
37 | -- You can supply a slash command (or a table of slash commands) to register with AceConfigCmd directly.
38 | -- @paramsig appName, options [, slashcmd]
39 | -- @param appName The application name for the config table.
40 | -- @param options The option table (or a function to generate one on demand). http://www.wowace.com/addons/ace3/pages/ace-config-3-0-options-tables/
41 | -- @param slashcmd A slash command to register for the option table, or a table of slash commands.
42 | -- @usage
43 | -- local AceConfig = LibStub("AceConfig-3.0")
44 | -- AceConfig:RegisterOptionsTable("MyAddon", myOptions, {"/myslash", "/my"})
45 | function AceConfig:RegisterOptionsTable(appName, options, slashcmd)
46 | local ok,msg = pcall(cfgreg.RegisterOptionsTable, self, appName, options)
47 | if not ok then error(msg, 2) end
48 |
49 | if slashcmd then
50 | if type(slashcmd) == "table" then
51 | for _,cmd in pairs(slashcmd) do
52 | cfgcmd:CreateChatCommand(cmd, appName)
53 | end
54 | else
55 | cfgcmd:CreateChatCommand(slashcmd, appName)
56 | end
57 | end
58 | end
59 |
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Heading Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "Heading", 20
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local pairs = pairs
10 |
11 | -- WoW APIs
12 | local CreateFrame, UIParent = CreateFrame, UIParent
13 |
14 | --[[-----------------------------------------------------------------------------
15 | Methods
16 | -------------------------------------------------------------------------------]]
17 | local methods = {
18 | ["OnAcquire"] = function(self)
19 | self:SetText()
20 | self:SetFullWidth()
21 | self:SetHeight(18)
22 | end,
23 |
24 | -- ["OnRelease"] = nil,
25 |
26 | ["SetText"] = function(self, text)
27 | self.label:SetText(text or "")
28 | if text and text ~= "" then
29 | self.left:SetPoint("RIGHT", self.label, "LEFT", -5, 0)
30 | self.right:Show()
31 | else
32 | self.left:SetPoint("RIGHT", -3, 0)
33 | self.right:Hide()
34 | end
35 | end
36 | }
37 |
38 | --[[-----------------------------------------------------------------------------
39 | Constructor
40 | -------------------------------------------------------------------------------]]
41 | local function Constructor()
42 | local frame = CreateFrame("Frame", nil, UIParent)
43 | frame:Hide()
44 |
45 | local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontNormal")
46 | label:SetPoint("TOP")
47 | label:SetPoint("BOTTOM")
48 | label:SetJustifyH("CENTER")
49 |
50 | local left = frame:CreateTexture(nil, "BACKGROUND")
51 | left:SetHeight(8)
52 | left:SetPoint("LEFT", 3, 0)
53 | left:SetPoint("RIGHT", label, "LEFT", -5, 0)
54 | left:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
55 | left:SetTexCoord(0.81, 0.94, 0.5, 1)
56 |
57 | local right = frame:CreateTexture(nil, "BACKGROUND")
58 | right:SetHeight(8)
59 | right:SetPoint("RIGHT", -3, 0)
60 | right:SetPoint("LEFT", label, "RIGHT", 5, 0)
61 | right:SetTexture(137057) -- Interface\\Tooltips\\UI-Tooltip-Border
62 | right:SetTexCoord(0.81, 0.94, 0.5, 1)
63 |
64 | local widget = {
65 | label = label,
66 | left = left,
67 | right = right,
68 | frame = frame,
69 | type = Type
70 | }
71 | for method, func in pairs(methods) do
72 | widget[method] = func
73 | end
74 |
75 | return AceGUI:RegisterAsWidget(widget)
76 | end
77 |
78 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
79 |
--------------------------------------------------------------------------------
/Source/Locales/ruRU.lua:
--------------------------------------------------------------------------------
1 | local addonName = ...
2 | local L = LibStub("AceLocale-3.0"):NewLocale(addonName, "ruRU")
3 | if not L then return end
4 | --Translator ZamestoTV
5 | L["Toggle(Show) During Combat"] = "Показать во время боя"
6 | L["Toggle(Hide) During Combat"] = "Скрыть во время боя"
7 | L["OPTIONS_RELOAD_REQUIREMENT_WARNING"] = "ПРЕДУПРЕЖДЕНИЕ О НЕОБХОДИМОСТИ *\nПерезагрузки опций"
8 | L["Class Resources"] = "Ресурсы класса"
9 | L["TOGGLE_SUPPORT_STRING"] = "СТРОКА ПОДДЕРЖКИ ПЕРЕКЛЮЧАТЕЛЯ"
10 | L["TOGGLE_ADDITIONAL_OPTIONS_SUPPORT_STRING"] = "СТРОКА ПОДДЕРЖКИ ДОПОЛНИТЕЛЬНЫХ ОПЦИЙ ПЕРЕКЛЮЧАТЕЛЯ"
11 | L["Minimap Header"] = "Заголовок миникарты"
12 | L["MINIMAP_HEADER_DESCRIPTION"] = "ОПИСАНИЕ ЗАГОЛОВКА МИНИКАРТЫ"
13 | L["Resize Minimap Cluster"] = "Изменить размер кластера миникарты"
14 | L["RESIZE_MINIMAP_DESCRIPTION"] = "ОПИСАНИЕ ИЗМЕНЕНИЯ РАЗМЕРА МИНИКАРТЫ"
15 | L["Subzone Information"] = "Информация о подзоне"
16 | L["SUBZONE_DESCRIPTION"] = "ОПИСАНИЕ ПОДЗОНЫ"
17 | L["Below Minimap"] = "Под миникартой"
18 | L["BELOW_MINIMAP_DESCRIPTION"] = "ОПИСАНИЕ ПОД МИНИКАРТОЙ"
19 | L["Show Coordinates"] = "Показать координаты"
20 | L["SHOW_COORDINATES_DESCRIPTION"] = "ОПИСАНИЕ ПОКАЗА КООРДИНАТ"
21 | L["Resize Player Frame"] = "Изменить размер рамки игрока"
22 | L["RESIZE_PLAYER_FRAME_DESCRIPTION"] = "ОПИСАНИЕ ИЗМЕНЕНИЯ РАЗМЕРА РАМКИ ИГРОКА"
23 | L["Menu Bar"] = "Панель меню"
24 | L["LFG Button"] = "Кнопка поиска группы"
25 | L["Buffs"] = "Баффы"
26 | L["Debuffs"] = "Дебаффы"
27 | L["Bonus Roll"] = "Бонусный бросок"
28 | L["ACTIONBARS_DESCRIPTION"] = "ОПИСАНИЕ ПАНЕЛЕЙ ДЕЙСТВИЙ"
29 | L["Group Loot Container"] = "Контейнер для добычи группы"
30 | L["Chat Buttons"] = "Кнопки чата"
31 | L["Alert"] = "Оповещение"
32 | L["Auction Multisell"] = "Мультипродажа на аукционе"
33 | L["WARNING_FRAME_TEXT"] = "ТЕКСТ РАМКИ ПРЕДУПРЕЖДЕНИЯ"
34 | L["Anchor To:"] = "Привязать к:"
35 | L["ACTION_BARS_CHECKBOX_HIDE_NAMES_DESCRIPTION"] = "ОПИСАНИЕ ФЛАЖКА СКРЫТИЯ ИМЕН ПАНЕЛЕЙ ДЕЙСТВИЙ"
36 | L["PvP Objectives"] = "Цели PvP"
37 | L["BG Targets"] = "Цели на поле боя"
38 | L["Chat Menu"] = "Меню чата"
39 | L["Focus Cast Bar"] = "Полоса заклинаний фокуса"
40 | L["Hide Name"] = "Скрыть имя"
41 | L["Focus ToT"] = "Цель фокуса"
42 | L["LFG"] = "Поиск группы"
43 | L["MENU_CHECKBOX_DF_BUTTONS_DESCRIPTION"] = "ОПИСАНИЕ ФЛАЖКА КНОПОК DF МЕНЮ"
44 | L["MENU_CHECKBOX_SL_BUTTONS_DESCRIPTION"] = "ОПИСАНИЕ ФЛАЖКА КНОПОК SL МЕНЮ"
45 | L["Expansion Button"] = "Кнопка дополнения"
46 | L["Toggle In Combat"] = "Переключить в бою"
47 | L["Zone Name"] = "Название зоны"
48 | L["Hide Resource Bar"] = "Скрыть панель ресурсов"
49 | L["Hide Icons"] = "Скрыть иконки"
50 | L["Hide Level"] = "Скрыть уровень"
51 | L["Raid Manager"] = "Менеджер рейда"
52 | L["Hide Names"] = "Скрыть имена"
53 | L["UNLINK_CLASS_RESOURCE_DESCRIPTION"] = "ОПИСАНИЕ ОТВЯЗКИ РЕСУРСОВ КЛАССА"
54 |
55 |
--------------------------------------------------------------------------------
/Source/Locales/koKR.lua:
--------------------------------------------------------------------------------
1 | local addonName = ...
2 | local L = LibStub("AceLocale-3.0"):NewLocale(addonName, "koKR", false)
3 | if not L then return end
4 |
5 | L["Toggle(Show) During Combat"] = "전투 중 표시 전환"
6 | L["Toggle(Hide) During Combat"] = "전투 중 숨김 전환"
7 | L["OPTIONS_RELOAD_REQUIREMENT_WARNING"] = "변경 사항 적용엔 /reload 필요! 이 프레임을 관리하지 않으려면 체크 해제하세요."
8 | L["Class Resources"] = "직업 자원"
9 | L["TOGGLE_SUPPORT_STRING"] = "%s 지원 활성화/비활성화"
10 | L["TOGGLE_ADDITIONAL_OPTIONS_SUPPORT_STRING"] = "추가 설정 켜기/끄기 %s"
11 | L["Minimap Header"] = "미니맵 제목"
12 | L["MINIMAP_HEADER_DESCRIPTION"] = "미니맵 헤더 기능 켜기/끄기 경고: 미니맵 오류 발생 시 이 옵션을 끄고, ‘헤더 아래 배치’는 사용하지 마세요.!"
13 | L["Resize Minimap Cluster"] = "미니맵 전체 영역 크기 변경"
14 | L["RESIZE_MINIMAP_DESCRIPTION"] = "미니맵 클러스터 크기를 조절할 수 있으며, 연결된 요소 모두에 영향을 줍니다. 참고: 두 슬라이더를 함께 사용하면 예기치 않은 결과가 발생할 수 있습니다."
15 | L["Subzone Information"] = "지역 이름 표시"
16 | L["SUBZONE_DESCRIPTION"] = "화면 상단 하위 영역 정보 위젯 지원을 활성화/비활성화합니다. 이 위젯에는 일반적으로 WSG의 플래그 획득 횟수와 같은 영역 목표가 포함됩니다. 주의: 목표가 있는 영역에 있지 않으면 아무것도 표시되지 않습니다!"
17 | L["Below Minimap"] = "미니맵 하단"
18 | L["BELOW_MINIMAP_DESCRIPTION"] = "미니맵 하단 컨테이너 기능을 활성화/비활성화.전장에서 PvP 목표(깃발 운반자, 점령 진행 등)가 표시됩니다. 참고: 관련 지역이 아니면 표시되지 않습니다."
19 | L["Show Coordinates"] = "좌표 표시"
20 | L["SHOW_COORDINATES_DESCRIPTION"] = "선택한 프레임의 화면 좌표를 표시"
21 | L["Resize Player Frame"] = "플레이어 창 크기 변경"
22 | L["RESIZE_PLAYER_FRAME_DESCRIPTION"] = "플레이어 프레임을 기본 UI보다 더 작게 조절할 수 있습니다. 참고: 두 슬라이더를 함께 사용하면 예기치 않은 결과가 발생할 수 있습니다."
23 | L["Menu Bar"] = "메뉴 바"
24 | L["LFG Button"] = "파티찾기 버튼"
25 | L["Buffs"] = "버프"
26 | L["Debuffs"] = "디버프"
27 | L["Bonus Roll"] = "주사위 굴림"
28 | L["ACTIONBARS_DESCRIPTION"] = "행동 단축바 간격 0 설정 허용. 경고:모든 단축바를 기본 위치에서 이동하고 ‘자석 기능’을 꺼야 오류를 방지할 수 있습니다. 원래 위치로 되돌리는 것은 가능합니다"
29 | L["Group Loot Container"] = "그룹 전리품 창"
30 | L["Chat Buttons"] = "채팅 버튼"
31 | L["Alert"] = "경고"
32 | L["Auction Multisell"] = "경매 일괄 판매"
33 | L["WARNING_FRAME_TEXT"] = "주의: 스냅 기능을 사용할 경우, 예상치 못한 결과가 발생할 수 있으니 주의하세요"
34 | L["Auction Multisell"] = "경매 일괄 판매"
35 | L["Anchor To:"] = "기준 위치 설정:"
36 | L["ACTION_BARS_CHECKBOX_HIDE_NAMES_DESCRIPTION"] = "매크로/단축키 이름 숨기기"
37 | L["PvP Objectives"] = "PvP 목표"
38 | L["BG Targets"] = "전장 대상"
39 | L["Chat Menu"] = "채팅 메뉴"
40 | L["Hide Name"] = "이름 숨기기"
41 | L["LFG"] = "파티 찾기"
42 | L["MENU_CHECKBOX_DF_BUTTONS_DESCRIPTION"] = "10.0 스타일 버튼 사용 (재시작 필요)"
43 | L["MENU_CHECKBOX_SL_BUTTONS_DESCRIPTION"] = "어둠땅 스타일 버튼 사용 (재시작 필요)"
44 | L["Expansion Button"] = "확장 버튼"
45 | L["Toggle In Combat"] = "전투 중 전환"
46 | L["Zone Name"] = "지역 이름"
47 | L["Hide Resource Bar"] = "자원 바 숨기기"
48 | L["Hide Icons"] = "아이콘 숨기기"
49 | L["Hide Level"] = "레벨 숨기기"
50 | L["Raid Manager"] = "공격대 관리자"
51 | L["Hide Names"] = "이름 숨기기"
52 | L["UNLINK_CLASS_RESOURCE_DESCRIPTION"] = "플레이어 창의 연결 해제 (재시작 필요)"
53 | L["Reset Cooldown Manager DB"] = "쿨다운 설정 자료 초기화"
54 |
--------------------------------------------------------------------------------
/Source/EditModeExpanded.toc:
--------------------------------------------------------------------------------
1 | ## Interface: 110207
2 | ## Title: Edit Mode Expanded
3 | ## Version: @project-version@
4 | ## Notes: Expands Edit Mode to apply to other frames
5 | ## Author: Teelo
6 | ## SavedVariables: EditModeExpandedADB
7 | ## X-Curse-Project-ID: 695703
8 | ## IconTexture: 4555600
9 |
10 | ## Category-enUS: User Interface
11 | ## Category-deDE: Benutzerinterface
12 | ## Category-esES: Interfaz de usuario
13 | ## Category-esMX: Interfaz de usuario
14 | ## Category-frFR: Interface utilisateur
15 | ## Category-itIT: Interfaccia utente
16 | ## Category-koKR: 사용자 인터페이스
17 | ## Category-ptBR: Interface do usuário
18 | ## Category-ruRU: Интерфейс пользователя
19 | ## Category-zhCN: 用户界面
20 | ## Category-zhTW: 使用者介面
21 |
22 | libs\LibStub.lua
23 | libs\CallbackHandler-1.0\CallbackHandler-1.0.lua
24 | libs\AceDB-3.0\AceDB-3.0.xml
25 | libs\AceGUI-3.0\AceGUI-3.0.xml
26 | libs\AceConfig-3.0\AceConfig-3.0.xml
27 | libs\AceLocale-3.0\AceLocale-3.0.xml
28 | libs\EditModeExpanded-1.0\EditModeExpanded-1.0.xml
29 | libs\LibUIDropDownMenu\LibUIDropDownMenu.lua
30 |
31 | Locales\enus.lua
32 | Locales\esES.lua
33 | Locales\ruRU.lua
34 | Locales\zhCN.lua
35 | Locales\zhTW.lua
36 | Locales\koKR.lua
37 |
38 | FrameHandlers\ActionBars.lua
39 | FrameHandlers\AlertFrame.lua
40 | FrameHandlers\BelowMinimapContainer.lua
41 | FrameHandlers\BonusRoll.lua
42 | FrameHandlers\Buffs.lua
43 | FrameHandlers\ChatButtons.lua
44 | FrameHandlers\CooldownManager.lua
45 | FrameHandlers\DurationBars.lua
46 | FrameHandlers\ExtraActionButton.lua
47 | FrameHandlers\FocusCast.lua
48 | FrameHandlers\FocusFrame.lua
49 | FrameHandlers\FocusToT.lua
50 | FrameHandlers\GameMenu.lua
51 | FrameHandlers\GroupLoot.lua
52 | FrameHandlers\Housing.lua
53 | FrameHandlers\LFG.lua
54 | FrameHandlers\LossOfControl.lua
55 | FrameHandlers\Menu.lua
56 | FrameHandlers\Minimap.lua
57 | FrameHandlers\ObjectiveTracker.lua
58 | FrameHandlers\Pet.lua
59 | FrameHandlers\PlayerFrame.lua
60 | FrameHandlers\Raid.lua
61 | FrameHandlers\StanceBar.lua
62 | FrameHandlers\StatusTrackingBar.lua
63 | FrameHandlers\TalkingHead.lua
64 | FrameHandlers\TargetCast.lua
65 | FrameHandlers\TargetFrame.lua
66 | FrameHandlers\TargetOfTarget.lua
67 | FrameHandlers\Tooltip.lua
68 | FrameHandlers\TopCenterContainer.lua
69 | FrameHandlers\TotemFrame.lua
70 |
71 | FrameHandlers\ClassResources\ArcaneCharges.lua
72 | FrameHandlers\ClassResources\ChiBar.lua
73 | FrameHandlers\ClassResources\ComboPoints.lua
74 | FrameHandlers\ClassResources\Essences.lua
75 | FrameHandlers\ClassResources\HolyPower.lua
76 | FrameHandlers\ClassResources\Runes.lua
77 | FrameHandlers\ClassResources\SoulShards.lua
78 |
79 | AutoLayoutChanges.lua
80 | Options.lua
81 | RegisterFrame.lua
82 | ResetFrame.lua
83 | HookOnce.lua
84 | AnchorToDropdown.lua
85 | MicroMenu.lua
86 | RegisteredSystemFrames.lua
87 | CombatManager.lua
88 | EditModeExpanded.lua
89 | WarningFrame.xml
90 | Vigor.lua
91 | Vigor.xml
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIWidget-InteractiveLabel.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | InteractiveLabel Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "InteractiveLabel", 21
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local select, pairs = select, pairs
10 |
11 | --[[-----------------------------------------------------------------------------
12 | Scripts
13 | -------------------------------------------------------------------------------]]
14 | local function Control_OnEnter(frame)
15 | frame.obj:Fire("OnEnter")
16 | end
17 |
18 | local function Control_OnLeave(frame)
19 | frame.obj:Fire("OnLeave")
20 | end
21 |
22 | local function Label_OnClick(frame, button)
23 | frame.obj:Fire("OnClick", button)
24 | AceGUI:ClearFocus()
25 | end
26 |
27 | --[[-----------------------------------------------------------------------------
28 | Methods
29 | -------------------------------------------------------------------------------]]
30 | local methods = {
31 | ["OnAcquire"] = function(self)
32 | self:LabelOnAcquire()
33 | self:SetHighlight()
34 | self:SetHighlightTexCoord()
35 | self:SetDisabled(false)
36 | end,
37 |
38 | -- ["OnRelease"] = nil,
39 |
40 | ["SetHighlight"] = function(self, ...)
41 | self.highlight:SetTexture(...)
42 | end,
43 |
44 | ["SetHighlightTexCoord"] = function(self, ...)
45 | local c = select("#", ...)
46 | if c == 4 or c == 8 then
47 | self.highlight:SetTexCoord(...)
48 | else
49 | self.highlight:SetTexCoord(0, 1, 0, 1)
50 | end
51 | end,
52 |
53 | ["SetDisabled"] = function(self,disabled)
54 | self.disabled = disabled
55 | if disabled then
56 | self.frame:EnableMouse(false)
57 | self.label:SetTextColor(0.5, 0.5, 0.5)
58 | else
59 | self.frame:EnableMouse(true)
60 | self.label:SetTextColor(1, 1, 1)
61 | end
62 | end
63 | }
64 |
65 | --[[-----------------------------------------------------------------------------
66 | Constructor
67 | -------------------------------------------------------------------------------]]
68 | local function Constructor()
69 | -- create a Label type that we will hijack
70 | local label = AceGUI:Create("Label")
71 |
72 | local frame = label.frame
73 | frame:EnableMouse(true)
74 | frame:SetScript("OnEnter", Control_OnEnter)
75 | frame:SetScript("OnLeave", Control_OnLeave)
76 | frame:SetScript("OnMouseDown", Label_OnClick)
77 |
78 | local highlight = frame:CreateTexture(nil, "HIGHLIGHT")
79 | highlight:SetTexture(nil)
80 | highlight:SetAllPoints()
81 | highlight:SetBlendMode("ADD")
82 |
83 | label.highlight = highlight
84 | label.type = Type
85 | label.LabelOnAcquire = label.OnAcquire
86 | for method, func in pairs(methods) do
87 | label[method] = func
88 | end
89 |
90 | return label
91 | end
92 |
93 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
94 |
95 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/ActionBars.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 |
6 | function addon:initActionBars()
7 | local db = addon.db.global
8 | if not db.EMEOptions.actionBars then return end
9 | C_Timer.After(5, function()
10 | if InCombatLockdown() then return end
11 | local bars = {MainMenuBar, MultiBarBottomLeft, MultiBarBottomRight, MultiBarRight, MultiBarLeft, MultiBar5, MultiBar6, MultiBar7}
12 |
13 | for _, bar in ipairs(bars) do
14 |
15 | --[[
16 | -- setting.buttonPadding causes taint to spread and cause issues
17 | -- another method needed, if its even possible
18 | lib:RegisterCustomCheckbox(bar, "Override Icon Padding to Zero",
19 | -- on checked
20 | function()
21 | bar.minButtonPadding = 0
22 | bar.buttonPadding = 0
23 | bar:UpdateGridLayout()
24 | end,
25 |
26 | -- on unchecked
27 | function()
28 | bar.minButtonPadding = 2
29 | bar.buttonPadding = 2
30 | bar:UpdateGridLayout()
31 | end,
32 |
33 | "OverrideIconPadding"
34 | )
35 | --]]
36 |
37 | addon:registerSecureFrameHideable(bar)
38 |
39 | local alreadyHidden
40 | lib:RegisterCustomCheckbox(bar, L["ACTION_BARS_CHECKBOX_HIDE_NAMES_DESCRIPTION"],
41 | function()
42 | for _, button in pairs(bar.actionButtons) do
43 | button.Name:Hide()
44 | button.HotKey:Hide()
45 | end
46 | alreadyHidden = true
47 | end,
48 | function()
49 | if not alreadyHidden then return end
50 | for _, button in pairs(bar.actionButtons) do
51 | button.Name:Show()
52 | button.HotKey:Show()
53 | end
54 | alreadyHidden = false
55 | end,
56 | "HideMacroName"
57 | )
58 |
59 | local namesSize = 1
60 |
61 | local function updateNamesSizes()
62 | for _, button in pairs(bar.actionButtons) do
63 | button.HotKey:SetScale(namesSize)
64 | button.Count:SetScale(namesSize)
65 | button.Name:SetScale(namesSize)
66 | end
67 | end
68 |
69 | lib:RegisterSlider(bar, "Name Scale", "Name Scale",
70 | function(newValue)
71 | namesSize = newValue
72 | updateNamesSizes()
73 | end,
74 | 0.5, 2, 0.05)
75 |
76 | lib:RegisterHiddenUntilMouseover(bar, L["HIDE_WHEN_NOT_MOUSEOVER_DESCRIPTION"])
77 |
78 | hooksecurefunc("CompactUnitFrame_UpdateName", updateNamesSizes)
79 | end
80 | end)
81 | end
82 |
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIWidget-Button.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Button Widget
3 | Graphical Button.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "Button", 24
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs = pairs
11 |
12 | -- WoW APIs
13 | local _G = _G
14 | local PlaySound, CreateFrame, UIParent = PlaySound, CreateFrame, UIParent
15 |
16 | --[[-----------------------------------------------------------------------------
17 | Scripts
18 | -------------------------------------------------------------------------------]]
19 | local function Button_OnClick(frame, ...)
20 | AceGUI:ClearFocus()
21 | PlaySound(852) -- SOUNDKIT.IG_MAINMENU_OPTION
22 | frame.obj:Fire("OnClick", ...)
23 | end
24 |
25 | local function Control_OnEnter(frame)
26 | frame.obj:Fire("OnEnter")
27 | end
28 |
29 | local function Control_OnLeave(frame)
30 | frame.obj:Fire("OnLeave")
31 | end
32 |
33 | --[[-----------------------------------------------------------------------------
34 | Methods
35 | -------------------------------------------------------------------------------]]
36 | local methods = {
37 | ["OnAcquire"] = function(self)
38 | -- restore default values
39 | self:SetHeight(24)
40 | self:SetWidth(200)
41 | self:SetDisabled(false)
42 | self:SetAutoWidth(false)
43 | self:SetText()
44 | end,
45 |
46 | -- ["OnRelease"] = nil,
47 |
48 | ["SetText"] = function(self, text)
49 | self.text:SetText(text)
50 | if self.autoWidth then
51 | self:SetWidth(self.text:GetStringWidth() + 30)
52 | end
53 | end,
54 |
55 | ["SetAutoWidth"] = function(self, autoWidth)
56 | self.autoWidth = autoWidth
57 | if self.autoWidth then
58 | self:SetWidth(self.text:GetStringWidth() + 30)
59 | end
60 | end,
61 |
62 | ["SetDisabled"] = function(self, disabled)
63 | self.disabled = disabled
64 | if disabled then
65 | self.frame:Disable()
66 | else
67 | self.frame:Enable()
68 | end
69 | end
70 | }
71 |
72 | --[[-----------------------------------------------------------------------------
73 | Constructor
74 | -------------------------------------------------------------------------------]]
75 | local function Constructor()
76 | local name = "AceGUI30Button" .. AceGUI:GetNextWidgetNum(Type)
77 | local frame = CreateFrame("Button", name, UIParent, "UIPanelButtonTemplate")
78 | frame:Hide()
79 |
80 | frame:EnableMouse(true)
81 | frame:SetScript("OnClick", Button_OnClick)
82 | frame:SetScript("OnEnter", Control_OnEnter)
83 | frame:SetScript("OnLeave", Control_OnLeave)
84 |
85 | local text = frame:GetFontString()
86 | text:ClearAllPoints()
87 | text:SetPoint("TOPLEFT", 15, -1)
88 | text:SetPoint("BOTTOMRIGHT", -15, 1)
89 | text:SetJustifyV("MIDDLE")
90 |
91 | local widget = {
92 | text = text,
93 | frame = frame,
94 | type = Type
95 | }
96 | for method, func in pairs(methods) do
97 | widget[method] = func
98 | end
99 |
100 | return AceGUI:RegisterAsWidget(widget)
101 | end
102 |
103 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
104 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/StatusTrackingBar.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 |
5 | function addon:initStatusTrackingBar()
6 | local db = addon.db.global
7 | if db.EMEOptions.mainStatusTrackingBarContainer then
8 | lib:RegisterResizable(MainStatusTrackingBarContainer)
9 | lib:RegisterHideable(MainStatusTrackingBarContainer)
10 | lib:RegisterToggleInCombat(MainStatusTrackingBarContainer)
11 | C_Timer.After(1, function() lib:UpdateFrameResize(MainStatusTrackingBarContainer) end)
12 | hooksecurefunc(MainStatusTrackingBarContainer, "SetScale", function(_, scale)
13 | for _, bar in ipairs(StatusTrackingBarManager.barContainers) do
14 | local _, anchor = bar:GetPoint(1)
15 | if anchor == MainStatusTrackingBarContainer then
16 | bar:SetScale(scale)
17 | end
18 | end
19 | end)
20 | hooksecurefunc(MainStatusTrackingBarContainer, "SetScaleOverride", function(_, scale)
21 | for _, bar in ipairs(StatusTrackingBarManager.barContainers) do
22 | local _, anchor = bar:GetPoint(1)
23 | if anchor == MainStatusTrackingBarContainer then
24 | bar:SetScale(scale)
25 | end
26 | end
27 | end)
28 |
29 | hooksecurefunc(StatusTrackingBarManager, "UpdateBarsShown", function()
30 | for _, bar in ipairs(StatusTrackingBarManager.barContainers) do
31 | local _, anchor = bar:GetPoint(1)
32 | if anchor == MainStatusTrackingBarContainer then
33 | bar:SetScale(MainStatusTrackingBarContainer:GetScale())
34 | end
35 | end
36 | end)
37 | end
38 |
39 | if db.EMEOptions.secondaryStatusTrackingBarContainer then
40 | lib:RegisterResizable(SecondaryStatusTrackingBarContainer)
41 | lib:RegisterHideable(SecondaryStatusTrackingBarContainer)
42 | lib:RegisterToggleInCombat(SecondaryStatusTrackingBarContainer)
43 | C_Timer.After(1, function() lib:UpdateFrameResize(SecondaryStatusTrackingBarContainer) end)
44 | hooksecurefunc(SecondaryStatusTrackingBarContainer, "SetScale", function(_, scale)
45 | for _, bar in ipairs(StatusTrackingBarManager.barContainers) do
46 | local _, anchor = bar:GetPoint(1)
47 | if anchor == SecondaryStatusTrackingBarContainer then
48 | bar:SetScale(scale)
49 | end
50 | end
51 | end)
52 | hooksecurefunc(SecondaryStatusTrackingBarContainer, "SetScaleOverride", function(_, scale)
53 | for _, bar in ipairs(StatusTrackingBarManager.barContainers) do
54 | local _, anchor = bar:GetPoint(1)
55 | if anchor == SecondaryStatusTrackingBarContainer then
56 | bar:SetScale(scale)
57 | end
58 | end
59 | end)
60 |
61 | hooksecurefunc(StatusTrackingBarManager, "UpdateBarsShown", function()
62 | for _, bar in ipairs(StatusTrackingBarManager.barContainers) do
63 | local _, anchor = bar:GetPoint(1)
64 | if anchor == SecondaryStatusTrackingBarContainer then
65 | bar:SetScale(SecondaryStatusTrackingBarContainer:GetScale())
66 | end
67 | end
68 | end)
69 | end
70 | end
71 |
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIContainer-InlineGroup.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | InlineGroup Container
3 | Simple container widget that creates a visible "box" with an optional title.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "InlineGroup", 22
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs = pairs
11 |
12 | -- WoW APIs
13 | local CreateFrame, UIParent = CreateFrame, UIParent
14 |
15 | --[[-----------------------------------------------------------------------------
16 | Methods
17 | -------------------------------------------------------------------------------]]
18 | local methods = {
19 | ["OnAcquire"] = function(self)
20 | self:SetWidth(300)
21 | self:SetHeight(100)
22 | self:SetTitle("")
23 | end,
24 |
25 | -- ["OnRelease"] = nil,
26 |
27 | ["SetTitle"] = function(self,title)
28 | self.titletext:SetText(title)
29 | end,
30 |
31 |
32 | ["LayoutFinished"] = function(self, width, height)
33 | if self.noAutoHeight then return end
34 | self:SetHeight((height or 0) + 40)
35 | end,
36 |
37 | ["OnWidthSet"] = function(self, width)
38 | local content = self.content
39 | local contentwidth = width - 20
40 | if contentwidth < 0 then
41 | contentwidth = 0
42 | end
43 | content:SetWidth(contentwidth)
44 | content.width = contentwidth
45 | end,
46 |
47 | ["OnHeightSet"] = function(self, height)
48 | local content = self.content
49 | local contentheight = height - 20
50 | if contentheight < 0 then
51 | contentheight = 0
52 | end
53 | content:SetHeight(contentheight)
54 | content.height = contentheight
55 | end
56 | }
57 |
58 | --[[-----------------------------------------------------------------------------
59 | Constructor
60 | -------------------------------------------------------------------------------]]
61 | local PaneBackdrop = {
62 | bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
63 | edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
64 | tile = true, tileSize = 16, edgeSize = 16,
65 | insets = { left = 3, right = 3, top = 5, bottom = 3 }
66 | }
67 |
68 | local function Constructor()
69 | local frame = CreateFrame("Frame", nil, UIParent)
70 | frame:SetFrameStrata("FULLSCREEN_DIALOG")
71 |
72 | local titletext = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
73 | titletext:SetPoint("TOPLEFT", 14, 0)
74 | titletext:SetPoint("TOPRIGHT", -14, 0)
75 | titletext:SetJustifyH("LEFT")
76 | titletext:SetHeight(18)
77 |
78 | local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
79 | border:SetPoint("TOPLEFT", 0, -17)
80 | border:SetPoint("BOTTOMRIGHT", -1, 3)
81 | border:SetBackdrop(PaneBackdrop)
82 | border:SetBackdropColor(0.1, 0.1, 0.1, 0.5)
83 | border:SetBackdropBorderColor(0.4, 0.4, 0.4)
84 |
85 | --Container Support
86 | local content = CreateFrame("Frame", nil, border)
87 | content:SetPoint("TOPLEFT", 10, -10)
88 | content:SetPoint("BOTTOMRIGHT", -10, 10)
89 |
90 | local widget = {
91 | frame = frame,
92 | content = content,
93 | titletext = titletext,
94 | type = Type
95 | }
96 | for method, func in pairs(methods) do
97 | widget[method] = func
98 | end
99 |
100 | return AceGUI:RegisterAsContainer(widget)
101 | end
102 |
103 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
104 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/PlayerFrame.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 |
6 | function addon:initPlayerFrame()
7 | local db = addon.db.global
8 | if db.EMEOptions.playerFrame then
9 | addon:registerSecureFrameHideable(PlayerFrame)
10 | lib:RegisterToggleInCombat(PlayerFrame)
11 | C_Timer.After(4, function()
12 | addon:continueAfterCombatEnds(function()
13 | if lib:IsFrameMarkedHidden(PlayerFrame) then
14 | if InCombatLockdown() then return end
15 | PlayerFrame:Hide()
16 | PlayerFrame:SetScript("OnEvent", nil)
17 | end
18 | end)
19 |
20 | -- From UIParent.lua
21 | hooksecurefunc("UpdateUIElementsForClientScene", function(sceneType)
22 | addon:continueAfterCombatEnds(function()
23 | if sceneType == Enum.ClientSceneType.MinigameSceneType then return end
24 | if lib:IsFrameMarkedHidden(PlayerFrame) then
25 | PlayerFrame:Hide()
26 | PlayerFrame:SetScript("OnEvent", nil)
27 | end
28 | end)
29 | end)
30 | end)
31 |
32 |
33 | do
34 | local frame = PlayerFrame.manabar
35 | local x, y
36 |
37 | lib:RegisterCustomCheckbox(PlayerFrame, L["Hide Resource Bar"],
38 | -- on checked
39 | function()
40 | if InCombatLockdown() then return end
41 | if not x then
42 | x, y = frame:GetLeft(), frame:GetBottom()
43 | end
44 | frame:ClearAllPoints()
45 | frame:SetClampedToScreen(false)
46 | frame:SetPoint("TOPRIGHT", UIParent, "BOTTOMLEFT", -1000, -1000)
47 | end,
48 |
49 | -- on unchecked
50 | function()
51 | if InCombatLockdown() then return end
52 | if not x then return end
53 | frame:ClearAllPoints()
54 | frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", x, y)
55 | x, y = nil, nil
56 | end
57 | )
58 | end
59 |
60 | if db.EMEOptions.playerFrameResize then
61 | lib:RegisterResizable(PlayerFrame)
62 | end
63 |
64 | lib:RegisterCustomCheckbox(PlayerFrame, L["Hide Name"],
65 | function()
66 | PlayerFrame.name:Hide()
67 | end,
68 | function()
69 | PlayerFrame.name:Show()
70 | end,
71 | "HideName"
72 | )
73 |
74 | lib:RegisterCustomCheckbox(PlayerFrame, L["Hide Icons"],
75 | function()
76 | PlayerFrame.PlayerFrameContent.PlayerFrameContentContextual:Hide()
77 | PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.StatusTexture:Hide()
78 | end,
79 | function()
80 | PlayerFrame.PlayerFrameContent.PlayerFrameContentContextual:Show()
81 | PlayerFrame.PlayerFrameContent.PlayerFrameContentMain.StatusTexture:Show()
82 | end,
83 | "HideIcons"
84 | )
85 |
86 | C_Timer.After(4, function()
87 | lib:RegisterCustomCheckbox(PlayerFrame, L["Hide Level"],
88 | function()
89 | PlayerLevelText:Hide()
90 | end,
91 | function()
92 | PlayerLevelText:Show()
93 | end,
94 | "HideLevel"
95 | )
96 | end)
97 | end
98 | end
99 |
--------------------------------------------------------------------------------
/Source/Locales/enus.lua:
--------------------------------------------------------------------------------
1 | local addonName = ...
2 | local L = LibStub("AceLocale-3.0"):NewLocale(addonName, "enUS", true)
3 | if not L then return end
4 |
5 | L["Toggle(Show) During Combat"] = true
6 | L["Toggle(Hide) During Combat"] = true
7 | L["OPTIONS_RELOAD_REQUIREMENT_WARNING"] = "All changes require a /reload to take effect! Uncheck if you don't want this addon to manage that frame."
8 | L["Class Resources"] = true
9 | L["TOGGLE_SUPPORT_STRING"] = "Enables / Disables %s support"
10 | L["TOGGLE_ADDITIONAL_OPTIONS_SUPPORT_STRING"] = "Enables / Disables additional options for %s"
11 | L["Minimap Header"] = true
12 | L["MINIMAP_HEADER_DESCRIPTION"] = "Enables / Disables Minimap Header support. WARNING: The minimap may not behave as expected, disable this option if you have issues. Make sure not to check 'Header Underneath'!"
13 | L["Resize Minimap Cluster"] = true
14 | L["RESIZE_MINIMAP_DESCRIPTION"] = "Allows the whole Minimap Cluster to be resized, affecting everything attached to it. NOTE: You may get unexpected results if you use both sliders."
15 | L["Subzone Information"] = true
16 | L["SUBZONE_DESCRIPTION"] = "Enables / Disables top of screen subzone information widget support. This usually contains zone objectives such as number of flag captures in WSG. Be aware: this will not show anything if you are not in a zone that has an objective!"
17 | L["Below Minimap"] = true
18 | L["BELOW_MINIMAP_DESCRIPTION"] = "Enables / Disables below minimap container support. This usually contains PvP objectives like flag carriers in WSG and base capture progress bars. Be aware: this will not show anything if you are not in an area that puts anything in the container!"
19 | L["Show Coordinates"] = true
20 | L["SHOW_COORDINATES_DESCRIPTION"] = "Show window coordinates of selected frame"
21 | L["Resize Player Frame"] = true
22 | L["RESIZE_PLAYER_FRAME_DESCRIPTION"] = "Allows the Player Frame to be resized to a smaller size than the default UI allows. NOTE: You may get unexpected results if you use both sliders."
23 | L["Menu Bar"] = true
24 | L["LFG Button"] = true
25 | L["Buffs"] = true
26 | L["Debuffs"] = true
27 | L["Bonus Roll"] = true
28 | L["ACTIONBARS_DESCRIPTION"] = "Allows the action bars to have their padding set to zero. WARNING: you MUST move all your action bars from their default position AND disable 'magnetism', or you will get addon errors. You can even move the bars back to where they were originally!"
29 | L["Group Loot Container"] = true
30 | L["Chat Buttons"] = true
31 | L["Alert"] = true
32 | L["Auction Multisell"] = true
33 | L["WARNING_FRAME_TEXT"] = "Warning: Using Snap to Elements can cause unexpected results!"
34 | L["Auction Multisell"] = true
35 | L["Anchor To:"] = true
36 | L["ACTION_BARS_CHECKBOX_HIDE_NAMES_DESCRIPTION"] = "Hide macro/keybind names"
37 | L["PvP Objectives"] = true
38 | L["BG Targets"] = true
39 | L["Chat Menu"] = true
40 | L["Focus Cast Bar"] = FOCUS.." "..HUD_EDIT_MODE_CAST_BAR_LABEL
41 | L["Hide Name"] = true
42 | L["Focus ToT"] = FOCUS.." "..SHOW_TARGET_OF_TARGET_TEXT
43 | L["LFG"] = true
44 | L["MENU_CHECKBOX_DF_BUTTONS_DESCRIPTION"] = "Use 10.0 style buttons (requires reload)"
45 | L["MENU_CHECKBOX_SL_BUTTONS_DESCRIPTION"] = "Use Shadowlands style buttons (requires reload)"
46 | L["Expansion Button"] = true
47 | L["Toggle In Combat"] = true
48 | L["Zone Name"] = true
49 | L["Hide Resource Bar"] = true
50 | L["Hide Icons"] = true
51 | L["Hide Level"] = true
52 | L["Raid Manager"] = true
53 | L["Hide Names"] = true
54 | L["UNLINK_CLASS_RESOURCE_DESCRIPTION"] = "Unlink from Player Frame (may require reload)"
55 | L["Reset Cooldown Manager DB"] = true
56 | L["TARGET_CAST_BAR"] = TARGET.." "..HUD_EDIT_MODE_CAST_BAR_LABEL
57 | L["Solo"] = true
58 | L["Party"] = true
59 | L["Raid (5)"] = true
60 | L["Raid (10)"] = true
61 | L["Raid (25)"] = true
62 | L["Raid (40)"] = true
63 | L["AUTO_LAYOUT_CHANGE_DESCRIPTION"] = "Allows you to automatically change Edit Mode Layouts based on your group size"
64 | L["HIDE_WHEN_NOT_MOUSEOVER_DESCRIPTION"] = "Hide until mouseover"
65 | L["Vigor Bar"] = true
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | BlizOptionsGroup Container
3 | Simple container widget for the integration of AceGUI into the Blizzard Interface Options
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "BlizOptionsGroup", 26
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs = pairs
11 |
12 | -- WoW APIs
13 | local CreateFrame = CreateFrame
14 |
15 | --[[-----------------------------------------------------------------------------
16 | Scripts
17 | -------------------------------------------------------------------------------]]
18 |
19 | local function OnShow(frame)
20 | frame.obj:Fire("OnShow")
21 | end
22 |
23 | local function OnHide(frame)
24 | frame.obj:Fire("OnHide")
25 | end
26 |
27 | --[[-----------------------------------------------------------------------------
28 | Support functions
29 | -------------------------------------------------------------------------------]]
30 |
31 | local function okay(frame)
32 | frame.obj:Fire("okay")
33 | end
34 |
35 | local function cancel(frame)
36 | frame.obj:Fire("cancel")
37 | end
38 |
39 | local function default(frame)
40 | frame.obj:Fire("default")
41 | end
42 |
43 | local function refresh(frame)
44 | frame.obj:Fire("refresh")
45 | end
46 |
47 | --[[-----------------------------------------------------------------------------
48 | Methods
49 | -------------------------------------------------------------------------------]]
50 |
51 | local methods = {
52 | ["OnAcquire"] = function(self)
53 | self:SetName()
54 | self:SetTitle()
55 | end,
56 |
57 | -- ["OnRelease"] = nil,
58 |
59 | ["OnWidthSet"] = function(self, width)
60 | local content = self.content
61 | local contentwidth = width - 63
62 | if contentwidth < 0 then
63 | contentwidth = 0
64 | end
65 | content:SetWidth(contentwidth)
66 | content.width = contentwidth
67 | end,
68 |
69 | ["OnHeightSet"] = function(self, height)
70 | local content = self.content
71 | local contentheight = height - 26
72 | if contentheight < 0 then
73 | contentheight = 0
74 | end
75 | content:SetHeight(contentheight)
76 | content.height = contentheight
77 | end,
78 |
79 | ["SetName"] = function(self, name, parent)
80 | self.frame.name = name
81 | self.frame.parent = parent
82 | end,
83 |
84 | ["SetTitle"] = function(self, title)
85 | local content = self.content
86 | content:ClearAllPoints()
87 | if not title or title == "" then
88 | content:SetPoint("TOPLEFT", 10, -10)
89 | self.label:SetText("")
90 | else
91 | content:SetPoint("TOPLEFT", 10, -40)
92 | self.label:SetText(title)
93 | end
94 | content:SetPoint("BOTTOMRIGHT", -10, 10)
95 | end
96 | }
97 |
98 | --[[-----------------------------------------------------------------------------
99 | Constructor
100 | -------------------------------------------------------------------------------]]
101 | local function Constructor()
102 | local frame = CreateFrame("Frame", nil, InterfaceOptionsFramePanelContainer)
103 | frame:Hide()
104 |
105 | -- support functions for the Blizzard Interface Options
106 | frame.okay = okay
107 | frame.cancel = cancel
108 | frame.default = default
109 | frame.refresh = refresh
110 |
111 | -- 10.0 support function aliases (cancel has been removed)
112 | frame.OnCommit = okay
113 | frame.OnDefault = default
114 | frame.OnRefresh = refresh
115 |
116 | frame:SetScript("OnHide", OnHide)
117 | frame:SetScript("OnShow", OnShow)
118 |
119 | local label = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalLarge")
120 | label:SetPoint("TOPLEFT", 10, -15)
121 | label:SetPoint("BOTTOMRIGHT", frame, "TOPRIGHT", 10, -45)
122 | label:SetJustifyH("LEFT")
123 | label:SetJustifyV("TOP")
124 |
125 | --Container Support
126 | local content = CreateFrame("Frame", nil, frame)
127 | content:SetPoint("TOPLEFT", 10, -10)
128 | content:SetPoint("BOTTOMRIGHT", -10, 10)
129 |
130 | local widget = {
131 | label = label,
132 | frame = frame,
133 | content = content,
134 | type = Type
135 | }
136 | for method, func in pairs(methods) do
137 | widget[method] = func
138 | end
139 |
140 | return AceGUI:RegisterAsContainer(widget)
141 | end
142 |
143 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
144 |
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Icon Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "Icon", 21
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local select, pairs, print = select, pairs, print
10 |
11 | -- WoW APIs
12 | local CreateFrame, UIParent = CreateFrame, UIParent
13 |
14 | --[[-----------------------------------------------------------------------------
15 | Scripts
16 | -------------------------------------------------------------------------------]]
17 | local function Control_OnEnter(frame)
18 | frame.obj:Fire("OnEnter")
19 | end
20 |
21 | local function Control_OnLeave(frame)
22 | frame.obj:Fire("OnLeave")
23 | end
24 |
25 | local function Button_OnClick(frame, button)
26 | frame.obj:Fire("OnClick", button)
27 | AceGUI:ClearFocus()
28 | end
29 |
30 | --[[-----------------------------------------------------------------------------
31 | Methods
32 | -------------------------------------------------------------------------------]]
33 | local methods = {
34 | ["OnAcquire"] = function(self)
35 | self:SetHeight(110)
36 | self:SetWidth(110)
37 | self:SetLabel()
38 | self:SetImage(nil)
39 | self:SetImageSize(64, 64)
40 | self:SetDisabled(false)
41 | end,
42 |
43 | -- ["OnRelease"] = nil,
44 |
45 | ["SetLabel"] = function(self, text)
46 | if text and text ~= "" then
47 | self.label:Show()
48 | self.label:SetText(text)
49 | self:SetHeight(self.image:GetHeight() + 25)
50 | else
51 | self.label:Hide()
52 | self:SetHeight(self.image:GetHeight() + 10)
53 | end
54 | end,
55 |
56 | ["SetImage"] = function(self, path, ...)
57 | local image = self.image
58 | image:SetTexture(path)
59 |
60 | if image:GetTexture() then
61 | local n = select("#", ...)
62 | if n == 4 or n == 8 then
63 | image:SetTexCoord(...)
64 | else
65 | image:SetTexCoord(0, 1, 0, 1)
66 | end
67 | end
68 | end,
69 |
70 | ["SetImageSize"] = function(self, width, height)
71 | self.image:SetWidth(width)
72 | self.image:SetHeight(height)
73 | --self.frame:SetWidth(width + 30)
74 | if self.label:IsShown() then
75 | self:SetHeight(height + 25)
76 | else
77 | self:SetHeight(height + 10)
78 | end
79 | end,
80 |
81 | ["SetDisabled"] = function(self, disabled)
82 | self.disabled = disabled
83 | if disabled then
84 | self.frame:Disable()
85 | self.label:SetTextColor(0.5, 0.5, 0.5)
86 | self.image:SetVertexColor(0.5, 0.5, 0.5, 0.5)
87 | else
88 | self.frame:Enable()
89 | self.label:SetTextColor(1, 1, 1)
90 | self.image:SetVertexColor(1, 1, 1, 1)
91 | end
92 | end
93 | }
94 |
95 | --[[-----------------------------------------------------------------------------
96 | Constructor
97 | -------------------------------------------------------------------------------]]
98 | local function Constructor()
99 | local frame = CreateFrame("Button", nil, UIParent)
100 | frame:Hide()
101 |
102 | frame:EnableMouse(true)
103 | frame:SetScript("OnEnter", Control_OnEnter)
104 | frame:SetScript("OnLeave", Control_OnLeave)
105 | frame:SetScript("OnClick", Button_OnClick)
106 |
107 | local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontHighlight")
108 | label:SetPoint("BOTTOMLEFT")
109 | label:SetPoint("BOTTOMRIGHT")
110 | label:SetJustifyH("CENTER")
111 | label:SetJustifyV("TOP")
112 | label:SetHeight(18)
113 |
114 | local image = frame:CreateTexture(nil, "BACKGROUND")
115 | image:SetWidth(64)
116 | image:SetHeight(64)
117 | image:SetPoint("TOP", 0, -5)
118 |
119 | local highlight = frame:CreateTexture(nil, "HIGHLIGHT")
120 | highlight:SetAllPoints(image)
121 | highlight:SetTexture(136580) -- Interface\\PaperDollInfoFrame\\UI-Character-Tab-Highlight
122 | highlight:SetTexCoord(0, 1, 0.23, 0.77)
123 | highlight:SetBlendMode("ADD")
124 |
125 | local widget = {
126 | label = label,
127 | image = image,
128 | frame = frame,
129 | type = Type
130 | }
131 | for method, func in pairs(methods) do
132 | widget[method] = func
133 | end
134 |
135 | widget.SetText = function(self, ...) print("AceGUI-3.0-Icon: SetText is deprecated! Use SetLabel instead!"); self:SetLabel(...) end
136 |
137 | return AceGUI:RegisterAsWidget(widget)
138 | end
139 |
140 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
141 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/TalkingHead.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
4 | local libDD = LibStub:GetLibrary("LibUIDropDownMenu-4.0")
5 |
6 | function addon:initTalkingHead()
7 | if addon.db.global.EMEOptions.talkingHead then
8 | local function hideDialogKeepSound()
9 | TalkingHeadFrame:ClearAllPoints()
10 | TalkingHeadFrame:SetClampedToScreen(false)
11 | TalkingHeadFrame:SetPoint("TOPRIGHT", UIParent, "BOTTOMLEFT", -1000, -1000)
12 | end
13 |
14 | local function hideDialogMuteSound()
15 | TalkingHeadFrame:Close()
16 | TalkingHeadFrame:Hide()
17 | end
18 |
19 | local shouldHideDialog, shouldMuteSound, hideOnlyInCombat
20 |
21 | TalkingHeadFrame:HookScript("OnEvent", function()
22 | if hideOnlyInCombat and (not InCombatLockdown()) then
23 | return
24 | end
25 |
26 | if shouldHideDialog then
27 | if shouldMuteSound then
28 | hideDialogMuteSound()
29 | else
30 | hideDialogKeepSound()
31 | end
32 | end
33 | end)
34 |
35 | lib:RegisterResizable(TalkingHeadFrame)
36 | -- TODO: should be moved to PLAYER_ENTERING_WORLD or something
37 | C_Timer.After(1, function()
38 | lib:UpdateFrameResize(TalkingHeadFrame)
39 | end)
40 |
41 | local dropdown, getSettingDB = lib:RegisterDropdown(TalkingHeadFrame, libDD, "HideDD")
42 |
43 | libDD:UIDropDownMenu_Initialize(dropdown, function(self)
44 | local db = getSettingDB()
45 | local info = libDD:UIDropDownMenu_CreateInfo()
46 |
47 | info.text = "Never"
48 | info.checked = (db.checked == nil)
49 | info.func = function()
50 | db.checked = nil
51 | shouldHideDialog = nil
52 | shouldMuteSound = nil
53 | hideOnlyInCombat = nil
54 | end
55 | libDD:UIDropDownMenu_AddButton(info)
56 |
57 | info.text = "Dialog only, keep sound"
58 | info.checked = db.checked == 2
59 | info.func = function()
60 | db.checked = 2
61 | shouldHideDialog = true
62 | shouldMuteSound = nil
63 | hideOnlyInCombat = nil
64 | end
65 | libDD:UIDropDownMenu_AddButton(info)
66 |
67 | info.text = "Always, and mute sound"
68 | info.checked = db.checked == 3
69 | info.func = function()
70 | db.checked = 3
71 | shouldHideDialog = true
72 | shouldMuteSound = true
73 | hideOnlyInCombat = nil
74 | end
75 | libDD:UIDropDownMenu_AddButton(info)
76 |
77 | info.text = "In Combat, but keep sound"
78 | info.checked = db.checked == 4
79 | info.func = function()
80 | db.checked = 4
81 | hideOnlyInCombat = true
82 | shouldHideDialog = true
83 | shouldMuteSound = nil
84 | end
85 | libDD:UIDropDownMenu_AddButton(info)
86 |
87 | info.text = "In combat, and mute sound"
88 | info.checked = db.checked == 5
89 | info.func = function()
90 | db.checked = 5
91 | hideOnlyInCombat = true
92 | shouldHideDialog = true
93 | shouldMuteSound = true
94 | end
95 | libDD:UIDropDownMenu_AddButton(info)
96 | end)
97 | libDD:UIDropDownMenu_SetWidth(dropdown, 100)
98 | libDD:UIDropDownMenu_SetText(dropdown, "Hide if:")
99 |
100 | C_Timer.After(1, function()
101 | local db = getSettingDB()
102 | if not db then return end
103 | if not db.checked then return end
104 | if db.checked ~= 1 then
105 | shouldHideDialog = true
106 | end
107 | if (db.checked == 3) or (db.checked == 5) then
108 | shouldMuteSound = true
109 | end
110 | if db.checked > 3 then
111 | hideOnlyInCombat = true
112 | end
113 | end)
114 | end
115 | end
116 |
--------------------------------------------------------------------------------
/Source/EditModeExpanded.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 |
5 | EventUtil.RegisterOnceFrameEventAndCallback("PLAYER_ENTERING_WORLD", function()
6 | addon:registerSecureFrameHideable(BossTargetFrameContainer)
7 |
8 | if addon.db.global.EMEOptions.showCoordinates then
9 | hooksecurefunc(EditModeExpandedSystemSettingsDialog, "AttachToSystemFrame", function(self, frame)
10 | self.Title:SetText(frame:GetSystemName().." ("..math.floor(frame:GetLeft())..","..math.floor(frame:GetBottom())..")")
11 | end)
12 | hooksecurefunc(EditModeExpandedSystemSettingsDialog, "UpdateSettings", function(self, frame)
13 | self.Title:SetText(frame:GetSystemName().." ("..math.floor(frame:GetLeft())..","..math.floor(frame:GetBottom())..")")
14 | end)
15 | end
16 |
17 | addon:initAlertFrame()
18 | addon:initTargetFrame()
19 | addon:initFocusFrame()
20 | addon:initTargetOfTarget()
21 | addon:initTargetCastBar()
22 | addon:initFocusToT()
23 | addon:initFocusCastBar()
24 | addon:initLFG()
25 | addon:initMinimap()
26 | addon:initTopCenterContainer()
27 | addon:initBelowMinimapContainer()
28 | addon:initStanceBar()
29 | addon:initPlayerFrame()
30 | addon:initStatusTrackingBar()
31 | addon:initMenuBar()
32 | addon:initBonusRoll()
33 | addon:initGroupLoot()
34 | addon:initActionBars()
35 | addon:initChatButtons()
36 | addon:initBuffs()
37 | addon:initObjectiveTracker()
38 | addon:initGameMenu()
39 | addon:initTooltip()
40 | addon:initLossOfControl()
41 | addon:initPet()
42 | addon:initExtraActionButton()
43 | addon:initCooldownManager()
44 | addon:initTotemFrame()
45 | addon:initDurationBars()
46 | addon:initVigorBar()
47 |
48 | local class = UnitClassBase("player")
49 |
50 | if class == "PALADIN" then
51 | addon:initHolyPower()
52 | elseif class == "WARLOCK" then
53 | addon:initSoulShards()
54 |
55 | elseif class == "MONK" then
56 | addon:initChiBar()
57 |
58 | elseif class == "DEATHKNIGHT" then
59 | addon:initRunes()
60 |
61 | elseif class == "MAGE" then
62 | addon:initArcaneCharges()
63 |
64 | elseif class == "EVOKER" then
65 | addon:initEssences()
66 |
67 | elseif class == "ROGUE" then
68 | addon:initRogueComboPoints()
69 |
70 | elseif class == "DRUID" then
71 | addon:initDruidComboPoints()
72 |
73 | end
74 | end)
75 |
76 | do
77 | local once
78 | EventRegistry:RegisterFrameEventAndCallback("EDIT_MODE_LAYOUTS_UPDATED", function()
79 | if once then return end
80 | local layoutInfo = EditModeManagerFrame:GetActiveLayoutInfo()
81 | if layoutInfo.layoutType == 0 then return end
82 | once = true
83 | addon:initRaidFrames()
84 |
85 | if EditModeManagerExpandedFrame then
86 | EditModeExpandedWarningFrame:SetParent(EditModeManagerExpandedFrame)
87 | EditModeExpandedWarningFrame:SetPoint("TOPLEFT", EditModeManagerExpandedFrame, "BOTTOMLEFT", 0, -2)
88 | EditModeExpandedWarningFrame.ScrollingFont:SetText(L["WARNING_FRAME_TEXT"])
89 | if EditModeManagerFrame.EnableSnapCheckButton:IsControlChecked() then
90 | EditModeExpandedWarningFrame:Show()
91 | end
92 | hooksecurefunc(EditModeManagerFrame, "SetEnableSnap", function(self, enableSnap)
93 | if enableSnap then
94 | EditModeExpandedWarningFrame:Show()
95 | else
96 | EditModeExpandedWarningFrame:Hide()
97 | end
98 | end)
99 | end
100 | end)
101 | end
102 |
103 | EventUtil.ContinueOnAddOnLoaded(addonName, function()
104 | addon:initOptions()
105 | addon:initSystemFrames()
106 | addon:initTalkingHead()
107 | end)
108 |
109 | EventUtil.ContinueOnAddOnLoaded("Blizzard_AuctionHouseUI", function()
110 | local db = addon.db.global
111 |
112 | if db.EMEOptions.auctionMultisell then
113 | addon.hookScriptOnce(AuctionHouseMultisellProgressFrame, "OnShow", function()
114 | addon:registerFrame(AuctionHouseMultisellProgressFrame, L["Auction Multisell"], db.AuctionHouseMultisellProgressFrame)
115 | hooksecurefunc(UIParentBottomManagedFrameContainer, "Layout", function()
116 | addon.ResetFrame(AuctionHouseMultisellProgressFrame)
117 | end)
118 | AuctionHouseMultisellProgressFrame:HookScript("OnShow", function()
119 | addon.ResetFrame(AuctionHouseMultisellProgressFrame)
120 | end)
121 | end)
122 | end
123 | end)
124 |
125 | EventUtil.ContinueOnAddOnLoaded("Blizzard_UIWidgets", function()
126 | local _, finished = C_AddOns.IsAddOnLoaded(addonName)
127 | if not finished then return end
128 | addon:initBelowMinimapContainer()
129 | end)
130 |
131 | EventUtil.ContinueOnAddOnLoaded("Blizzard_HousingControls", addon.initHousing)
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIContainer-DropDownGroup.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | DropdownGroup Container
3 | Container controlled by a dropdown on the top.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "DropdownGroup", 22
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local assert, pairs, type = assert, pairs, type
11 |
12 | -- WoW APIs
13 | local CreateFrame = CreateFrame
14 |
15 | --[[-----------------------------------------------------------------------------
16 | Scripts
17 | -------------------------------------------------------------------------------]]
18 | local function SelectedGroup(self, event, value)
19 | local group = self.parentgroup
20 | local status = group.status or group.localstatus
21 | status.selected = value
22 | self.parentgroup:Fire("OnGroupSelected", value)
23 | end
24 |
25 | --[[-----------------------------------------------------------------------------
26 | Methods
27 | -------------------------------------------------------------------------------]]
28 | local methods = {
29 | ["OnAcquire"] = function(self)
30 | self.dropdown:SetText("")
31 | self:SetDropdownWidth(200)
32 | self:SetTitle("")
33 | end,
34 |
35 | ["OnRelease"] = function(self)
36 | self.dropdown.list = nil
37 | self.status = nil
38 | for k in pairs(self.localstatus) do
39 | self.localstatus[k] = nil
40 | end
41 | end,
42 |
43 | ["SetTitle"] = function(self, title)
44 | self.titletext:SetText(title)
45 | self.dropdown.frame:ClearAllPoints()
46 | if title and title ~= "" then
47 | self.dropdown.frame:SetPoint("TOPRIGHT", -2, 0)
48 | else
49 | self.dropdown.frame:SetPoint("TOPLEFT", -1, 0)
50 | end
51 | end,
52 |
53 | ["SetGroupList"] = function(self,list,order)
54 | self.dropdown:SetList(list,order)
55 | end,
56 |
57 | ["SetStatusTable"] = function(self, status)
58 | assert(type(status) == "table")
59 | self.status = status
60 | end,
61 |
62 | ["SetGroup"] = function(self,group)
63 | self.dropdown:SetValue(group)
64 | local status = self.status or self.localstatus
65 | status.selected = group
66 | self:Fire("OnGroupSelected", group)
67 | end,
68 |
69 | ["OnWidthSet"] = function(self, width)
70 | local content = self.content
71 | local contentwidth = width - 26
72 | if contentwidth < 0 then
73 | contentwidth = 0
74 | end
75 | content:SetWidth(contentwidth)
76 | content.width = contentwidth
77 | end,
78 |
79 | ["OnHeightSet"] = function(self, height)
80 | local content = self.content
81 | local contentheight = height - 63
82 | if contentheight < 0 then
83 | contentheight = 0
84 | end
85 | content:SetHeight(contentheight)
86 | content.height = contentheight
87 | end,
88 |
89 | ["LayoutFinished"] = function(self, width, height)
90 | self:SetHeight((height or 0) + 63)
91 | end,
92 |
93 | ["SetDropdownWidth"] = function(self, width)
94 | self.dropdown:SetWidth(width)
95 | end
96 | }
97 |
98 | --[[-----------------------------------------------------------------------------
99 | Constructor
100 | -------------------------------------------------------------------------------]]
101 | local PaneBackdrop = {
102 | bgFile = "Interface\\ChatFrame\\ChatFrameBackground",
103 | edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
104 | tile = true, tileSize = 16, edgeSize = 16,
105 | insets = { left = 3, right = 3, top = 5, bottom = 3 }
106 | }
107 |
108 | local function Constructor()
109 | local frame = CreateFrame("Frame")
110 | frame:SetHeight(100)
111 | frame:SetWidth(100)
112 | frame:SetFrameStrata("FULLSCREEN_DIALOG")
113 |
114 | local titletext = frame:CreateFontString(nil, "OVERLAY", "GameFontNormal")
115 | titletext:SetPoint("TOPLEFT", 4, -5)
116 | titletext:SetPoint("TOPRIGHT", -4, -5)
117 | titletext:SetJustifyH("LEFT")
118 | titletext:SetHeight(18)
119 |
120 | local dropdown = AceGUI:Create("Dropdown")
121 | dropdown.frame:SetParent(frame)
122 | dropdown.frame:SetFrameLevel(dropdown.frame:GetFrameLevel() + 2)
123 | dropdown:SetCallback("OnValueChanged", SelectedGroup)
124 | dropdown.frame:SetPoint("TOPLEFT", -1, 0)
125 | dropdown.frame:Show()
126 | dropdown:SetLabel("")
127 |
128 | local border = CreateFrame("Frame", nil, frame, "BackdropTemplate")
129 | border:SetPoint("TOPLEFT", 0, -26)
130 | border:SetPoint("BOTTOMRIGHT", 0, 3)
131 | border:SetBackdrop(PaneBackdrop)
132 | border:SetBackdropColor(0.1,0.1,0.1,0.5)
133 | border:SetBackdropBorderColor(0.4,0.4,0.4)
134 |
135 | --Container Support
136 | local content = CreateFrame("Frame", nil, border)
137 | content:SetPoint("TOPLEFT", 10, -10)
138 | content:SetPoint("BOTTOMRIGHT", -10, 10)
139 |
140 | local widget = {
141 | frame = frame,
142 | localstatus = {},
143 | titletext = titletext,
144 | dropdown = dropdown,
145 | border = border,
146 | content = content,
147 | type = Type
148 | }
149 | for method, func in pairs(methods) do
150 | widget[method] = func
151 | end
152 | dropdown.parentgroup = widget
153 |
154 | return AceGUI:RegisterAsContainer(widget)
155 | end
156 |
157 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
158 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/Minimap.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 |
6 | function addon:initMinimap()
7 | local db = addon.db.global
8 | if db.EMEOptions.minimap then
9 | local isDefault = true
10 | lib:RegisterCustomCheckbox(MinimapCluster, RAID_TARGET_6,
11 | function()
12 | isDefault = false
13 | Minimap:SetMaskTexture("Interface\\BUTTONS\\WHITE8X8")
14 | MinimapBackdrop:Hide()
15 | end,
16 |
17 | function()
18 | -- don't change it to circle if it is already a circle from the last login
19 | if isDefault then return end
20 | Minimap:SetMaskTexture("Interface\\Masks\\CircleMask")
21 | MinimapBackdrop:Show()
22 | end
23 | )
24 |
25 | if ExpansionLandingPageMinimapButton then
26 | ExpansionLandingPageMinimapButton:SetParent(UIParent)
27 | ExpansionLandingPageMinimapButton:SetFrameStrata("MEDIUM")
28 | addon:registerFrame(ExpansionLandingPageMinimapButton, L["Expansion Button"], db.ExpansionLandingPageMinimapButton)
29 | lib:RegisterResizable(ExpansionLandingPageMinimapButton)
30 | hooksecurefunc(ExpansionLandingPageMinimapButton, "UpdateIcon", function()
31 | addon.ResetFrame(ExpansionLandingPageMinimapButton)
32 | end)
33 | Minimap:HookScript("OnHide", function()
34 | ExpansionLandingPageMinimapButton:Hide()
35 | end)
36 | Minimap:HookScript("OnShow", function()
37 | ExpansionLandingPageMinimapButton:Show()
38 | end)
39 | addon:registerSecureFrameHideable(ExpansionLandingPageMinimapButton)
40 | end
41 |
42 | -- slightly simplified version of the code from addon:registerSecureFrameHideable
43 | local hidden, toggleInCombat
44 |
45 | local function hide()
46 | if(Minimap:IsShown()) then
47 | Minimap:Hide();
48 | end
49 | end
50 |
51 | local function show()
52 | if not Minimap:IsShown() then
53 | Minimap:Show()
54 | end
55 | UpdateUIPanelPositions(MinimapCluster)
56 | UpdateUIPanelPositions(Minimap)
57 | end
58 |
59 | EventRegistry:RegisterFrameEventAndCallbackWithHandle("PLAYER_REGEN_ENABLED", function()
60 | if not toggleInCombat then return end
61 | if hidden then
62 | hide()
63 | else
64 | show()
65 | end
66 | end)
67 |
68 | EventRegistry:RegisterFrameEventAndCallbackWithHandle("PLAYER_REGEN_DISABLED", function()
69 | if not toggleInCombat then return end
70 | if hidden then
71 | show()
72 | else
73 | hide()
74 | end
75 | end)
76 |
77 | lib:RegisterCustomCheckbox(MinimapCluster, HIDE,
78 | function()
79 | hidden = true
80 | if not EditModeManagerFrame.editModeActive then
81 | hide()
82 | end
83 | end,
84 | function()
85 | hidden = false
86 | show()
87 | end,
88 | "HidePermanently")
89 |
90 | lib:RegisterCustomCheckbox(MinimapCluster, L["Toggle In Combat"],
91 | function()
92 | toggleInCombat = true
93 | end,
94 | function()
95 | toggleInCombat = false
96 | end,
97 | "ToggleInCombat")
98 |
99 | hooksecurefunc(EditModeManagerFrame, "EnterEditMode", function()
100 | show()
101 | end)
102 |
103 | hooksecurefunc(EditModeManagerFrame, "ExitEditMode", function()
104 | if hidden then
105 | hide()
106 | end
107 | end)
108 |
109 | hooksecurefunc(MinimapCluster, "Show", function()
110 | if InCombatLockdown() then return end
111 | if hidden then hide() end
112 | end)
113 |
114 | hooksecurefunc(MinimapCluster, "SetShown", function()
115 | if InCombatLockdown() then return end
116 | if hidden then hide() end
117 | end)
118 | end
119 |
120 | if db.EMEOptions.minimapHeader then
121 | MinimapCluster.BorderTop:SetParent(UIParent)
122 | addon:registerFrame(MinimapCluster.BorderTop, L["Zone Name"], db.MinimapZoneName)
123 | lib:SetDontResize(MinimapCluster.BorderTop)
124 | addon:registerSecureFrameHideable(MinimapCluster.BorderTop)
125 |
126 | local function update()
127 | MinimapCluster:SetWidth(MinimapCluster.MinimapContainer:GetWidth()*MinimapCluster.MinimapContainer:GetScale())
128 | MinimapCluster:SetHeight(MinimapCluster.MinimapContainer:GetHeight()*MinimapCluster.MinimapContainer:GetScale())
129 | end
130 | MinimapCluster:HookScript("OnShow", update)
131 | hooksecurefunc(MinimapCluster.MinimapContainer, "SetScale", function() C_Timer.After(0.01, update) end)
132 | update()
133 | MinimapCluster:SetClampedToScreen(false)
134 | end
135 |
136 | if db.EMEOptions.minimapResize then
137 | lib:RegisterResizable(MinimapCluster)
138 | end
139 | end
140 |
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Label Widget
3 | Displays text and optionally an icon.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "Label", 28
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local max, select, pairs = math.max, select, pairs
11 |
12 | -- WoW APIs
13 | local CreateFrame, UIParent = CreateFrame, UIParent
14 |
15 | --[[-----------------------------------------------------------------------------
16 | Support functions
17 | -------------------------------------------------------------------------------]]
18 |
19 | local function UpdateImageAnchor(self)
20 | if self.resizing then return end
21 | local frame = self.frame
22 | local width = frame.width or frame:GetWidth() or 0
23 | local image = self.image
24 | local label = self.label
25 | local height
26 |
27 | label:ClearAllPoints()
28 | image:ClearAllPoints()
29 |
30 | if self.imageshown then
31 | local imagewidth = image:GetWidth()
32 | if (width - imagewidth) < 200 or (label:GetText() or "") == "" then
33 | -- image goes on top centered when less than 200 width for the text, or if there is no text
34 | image:SetPoint("TOP")
35 | label:SetPoint("TOP", image, "BOTTOM")
36 | label:SetPoint("LEFT")
37 | label:SetWidth(width)
38 | height = image:GetHeight() + label:GetStringHeight()
39 | else
40 | -- image on the left
41 | image:SetPoint("TOPLEFT")
42 | if image:GetHeight() > label:GetStringHeight() then
43 | label:SetPoint("LEFT", image, "RIGHT", 4, 0)
44 | else
45 | label:SetPoint("TOPLEFT", image, "TOPRIGHT", 4, 0)
46 | end
47 | label:SetWidth(width - imagewidth - 4)
48 | height = max(image:GetHeight(), label:GetStringHeight())
49 | end
50 | else
51 | -- no image shown
52 | label:SetPoint("TOPLEFT")
53 | label:SetWidth(width)
54 | height = label:GetStringHeight()
55 | end
56 |
57 | -- avoid zero-height labels, since they can used as spacers
58 | if not height or height == 0 then
59 | height = 1
60 | end
61 |
62 | self.resizing = true
63 | frame:SetHeight(height)
64 | frame.height = height
65 | self.resizing = nil
66 | end
67 |
68 | --[[-----------------------------------------------------------------------------
69 | Methods
70 | -------------------------------------------------------------------------------]]
71 | local methods = {
72 | ["OnAcquire"] = function(self)
73 | -- set the flag to stop constant size updates
74 | self.resizing = true
75 | -- height is set dynamically by the text and image size
76 | self:SetWidth(200)
77 | self:SetText()
78 | self:SetImage(nil)
79 | self:SetImageSize(16, 16)
80 | self:SetColor()
81 | self:SetFontObject()
82 | self:SetJustifyH("LEFT")
83 | self:SetJustifyV("TOP")
84 |
85 | -- reset the flag
86 | self.resizing = nil
87 | -- run the update explicitly
88 | UpdateImageAnchor(self)
89 | end,
90 |
91 | -- ["OnRelease"] = nil,
92 |
93 | ["OnWidthSet"] = function(self, width)
94 | UpdateImageAnchor(self)
95 | end,
96 |
97 | ["SetText"] = function(self, text)
98 | self.label:SetText(text)
99 | UpdateImageAnchor(self)
100 | end,
101 |
102 | ["SetColor"] = function(self, r, g, b)
103 | if not (r and g and b) then
104 | r, g, b = 1, 1, 1
105 | end
106 | self.label:SetVertexColor(r, g, b)
107 | end,
108 |
109 | ["SetImage"] = function(self, path, ...)
110 | local image = self.image
111 | image:SetTexture(path)
112 |
113 | if image:GetTexture() then
114 | self.imageshown = true
115 | local n = select("#", ...)
116 | if n == 4 or n == 8 then
117 | image:SetTexCoord(...)
118 | else
119 | image:SetTexCoord(0, 1, 0, 1)
120 | end
121 | else
122 | self.imageshown = nil
123 | end
124 | UpdateImageAnchor(self)
125 | end,
126 |
127 | ["SetFont"] = function(self, font, height, flags)
128 | if not self.fontObject then
129 | self.fontObject = CreateFont("AceGUI30LabelFont" .. AceGUI:GetNextWidgetNum(Type))
130 | end
131 | self.fontObject:SetFont(font, height, flags)
132 | self:SetFontObject(self.fontObject)
133 | end,
134 |
135 | ["SetFontObject"] = function(self, font)
136 | self.label:SetFontObject(font or GameFontHighlightSmall)
137 | UpdateImageAnchor(self)
138 | end,
139 |
140 | ["SetImageSize"] = function(self, width, height)
141 | self.image:SetWidth(width)
142 | self.image:SetHeight(height)
143 | UpdateImageAnchor(self)
144 | end,
145 |
146 | ["SetJustifyH"] = function(self, justifyH)
147 | self.label:SetJustifyH(justifyH)
148 | end,
149 |
150 | ["SetJustifyV"] = function(self, justifyV)
151 | self.label:SetJustifyV(justifyV)
152 | end,
153 | }
154 |
155 | --[[-----------------------------------------------------------------------------
156 | Constructor
157 | -------------------------------------------------------------------------------]]
158 | local function Constructor()
159 | local frame = CreateFrame("Frame", nil, UIParent)
160 | frame:Hide()
161 |
162 | local label = frame:CreateFontString(nil, "BACKGROUND", "GameFontHighlightSmall")
163 | local image = frame:CreateTexture(nil, "BACKGROUND")
164 |
165 | -- create widget
166 | local widget = {
167 | label = label,
168 | image = image,
169 | frame = frame,
170 | type = Type
171 | }
172 | for method, func in pairs(methods) do
173 | widget[method] = func
174 | end
175 |
176 | return AceGUI:RegisterAsWidget(widget)
177 | end
178 |
179 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
180 |
--------------------------------------------------------------------------------
/Source/libs/AceLocale-3.0/AceLocale-3.0.lua:
--------------------------------------------------------------------------------
1 | --- **AceLocale-3.0** manages localization in addons, allowing for multiple locale to be registered with fallback to the base locale for untranslated strings.
2 | -- @class file
3 | -- @name AceLocale-3.0
4 | -- @release $Id: AceLocale-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $
5 | local MAJOR,MINOR = "AceLocale-3.0", 6
6 |
7 | local AceLocale, oldminor = LibStub:NewLibrary(MAJOR, MINOR)
8 |
9 | if not AceLocale then return end -- no upgrade needed
10 |
11 | -- Lua APIs
12 | local assert, tostring, error = assert, tostring, error
13 | local getmetatable, setmetatable, rawset, rawget = getmetatable, setmetatable, rawset, rawget
14 |
15 | local gameLocale = GetLocale()
16 | if gameLocale == "enGB" then
17 | gameLocale = "enUS"
18 | end
19 |
20 | AceLocale.apps = AceLocale.apps or {} -- array of ["AppName"]=localetableref
21 | AceLocale.appnames = AceLocale.appnames or {} -- array of [localetableref]="AppName"
22 |
23 | -- This metatable is used on all tables returned from GetLocale
24 | local readmeta = {
25 | __index = function(self, key) -- requesting totally unknown entries: fire off a nonbreaking error and return key
26 | rawset(self, key, key) -- only need to see the warning once, really
27 | geterrorhandler()(MAJOR..": "..tostring(AceLocale.appnames[self])..": Missing entry for '"..tostring(key).."'")
28 | return key
29 | end
30 | }
31 |
32 | -- This metatable is used on all tables returned from GetLocale if the silent flag is true, it does not issue a warning on unknown keys
33 | local readmetasilent = {
34 | __index = function(self, key) -- requesting totally unknown entries: return key
35 | rawset(self, key, key) -- only need to invoke this function once
36 | return key
37 | end
38 | }
39 |
40 | -- Remember the locale table being registered right now (it gets set by :NewLocale())
41 | -- NOTE: Do never try to register 2 locale tables at once and mix their definition.
42 | local registering
43 |
44 | -- local assert false function
45 | local assertfalse = function() assert(false) end
46 |
47 | -- This metatable proxy is used when registering nondefault locales
48 | local writeproxy = setmetatable({}, {
49 | __newindex = function(self, key, value)
50 | rawset(registering, key, value == true and key or value) -- assigning values: replace 'true' with key string
51 | end,
52 | __index = assertfalse
53 | })
54 |
55 | -- This metatable proxy is used when registering the default locale.
56 | -- It refuses to overwrite existing values
57 | -- Reason 1: Allows loading locales in any order
58 | -- Reason 2: If 2 modules have the same string, but only the first one to be
59 | -- loaded has a translation for the current locale, the translation
60 | -- doesn't get overwritten.
61 | --
62 | local writedefaultproxy = setmetatable({}, {
63 | __newindex = function(self, key, value)
64 | if not rawget(registering, key) then
65 | rawset(registering, key, value == true and key or value)
66 | end
67 | end,
68 | __index = assertfalse
69 | })
70 |
71 | --- Register a new locale (or extend an existing one) for the specified application.
72 | -- :NewLocale will return a table you can fill your locale into, or nil if the locale isn't needed for the players
73 | -- game locale.
74 | -- @paramsig application, locale[, isDefault[, silent]]
75 | -- @param application Unique name of addon / module
76 | -- @param locale Name of the locale to register, e.g. "enUS", "deDE", etc.
77 | -- @param isDefault If this is the default locale being registered (your addon is written in this language, generally enUS)
78 | -- @param silent If true, the locale will not issue warnings for missing keys. Must be set on the first locale registered. If set to "raw", nils will be returned for unknown keys (no metatable used).
79 | -- @usage
80 | -- -- enUS.lua
81 | -- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "enUS", true)
82 | -- L["string1"] = true
83 | --
84 | -- -- deDE.lua
85 | -- local L = LibStub("AceLocale-3.0"):NewLocale("TestLocale", "deDE")
86 | -- if not L then return end
87 | -- L["string1"] = "Zeichenkette1"
88 | -- @return Locale Table to add localizations to, or nil if the current locale is not required.
89 | function AceLocale:NewLocale(application, locale, isDefault, silent)
90 |
91 | -- GAME_LOCALE allows translators to test translations of addons without having that wow client installed
92 | local activeGameLocale = GAME_LOCALE or gameLocale
93 |
94 | local app = AceLocale.apps[application]
95 |
96 | if silent and app and getmetatable(app) ~= readmetasilent then
97 | geterrorhandler()("Usage: NewLocale(application, locale[, isDefault[, silent]]): 'silent' must be specified for the first locale registered")
98 | end
99 |
100 | if not app then
101 | if silent=="raw" then
102 | app = {}
103 | else
104 | app = setmetatable({}, silent and readmetasilent or readmeta)
105 | end
106 | AceLocale.apps[application] = app
107 | AceLocale.appnames[app] = application
108 | end
109 |
110 | if locale ~= activeGameLocale and not isDefault then
111 | return -- nop, we don't need these translations
112 | end
113 |
114 | registering = app -- remember globally for writeproxy and writedefaultproxy
115 |
116 | if isDefault then
117 | return writedefaultproxy
118 | end
119 |
120 | return writeproxy
121 | end
122 |
123 | --- Returns localizations for the current locale (or default locale if translations are missing).
124 | -- Errors if nothing is registered (spank developer, not just a missing translation)
125 | -- @param application Unique name of addon / module
126 | -- @param silent If true, the locale is optional, silently return nil if it's not found (defaults to false, optional)
127 | -- @return The locale table for the current language.
128 | function AceLocale:GetLocale(application, silent)
129 | if not silent and not AceLocale.apps[application] then
130 | error("Usage: GetLocale(application[, silent]): 'application' - No locales registered for '"..tostring(application).."'", 2)
131 | end
132 | return AceLocale.apps[application]
133 | end
134 |
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIWidget-ColorPicker.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | ColorPicker Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "ColorPicker", 25
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local pairs = pairs
10 |
11 | -- WoW APIs
12 | local CreateFrame, UIParent = CreateFrame, UIParent
13 |
14 | --[[-----------------------------------------------------------------------------
15 | Support functions
16 | -------------------------------------------------------------------------------]]
17 | local function ColorCallback(self, r, g, b, a, isAlpha)
18 | if not self.HasAlpha then
19 | a = 1
20 | end
21 | self:SetColor(r, g, b, a)
22 | if ColorPickerFrame:IsVisible() then
23 | --colorpicker is still open
24 | self:Fire("OnValueChanged", r, g, b, a)
25 | else
26 | --colorpicker is closed, color callback is first, ignore it,
27 | --alpha callback is the final call after it closes so confirm now
28 | if isAlpha then
29 | self:Fire("OnValueConfirmed", r, g, b, a)
30 | end
31 | end
32 | end
33 |
34 | --[[-----------------------------------------------------------------------------
35 | Scripts
36 | -------------------------------------------------------------------------------]]
37 | local function Control_OnEnter(frame)
38 | frame.obj:Fire("OnEnter")
39 | end
40 |
41 | local function Control_OnLeave(frame)
42 | frame.obj:Fire("OnLeave")
43 | end
44 |
45 | local function ColorSwatch_OnClick(frame)
46 | ColorPickerFrame:Hide()
47 | local self = frame.obj
48 | if not self.disabled then
49 | ColorPickerFrame:SetFrameStrata("FULLSCREEN_DIALOG")
50 | ColorPickerFrame:SetFrameLevel(frame:GetFrameLevel() + 10)
51 | ColorPickerFrame:SetClampedToScreen(true)
52 |
53 | ColorPickerFrame.func = function()
54 | local r, g, b = ColorPickerFrame:GetColorRGB()
55 | local a = 1 - OpacitySliderFrame:GetValue()
56 | ColorCallback(self, r, g, b, a)
57 | end
58 |
59 | ColorPickerFrame.hasOpacity = self.HasAlpha
60 | ColorPickerFrame.opacityFunc = function()
61 | local r, g, b = ColorPickerFrame:GetColorRGB()
62 | local a = 1 - OpacitySliderFrame:GetValue()
63 | ColorCallback(self, r, g, b, a, true)
64 | end
65 |
66 | local r, g, b, a = self.r, self.g, self.b, self.a
67 | if self.HasAlpha then
68 | ColorPickerFrame.opacity = 1 - (a or 0)
69 | end
70 | ColorPickerFrame:SetColorRGB(r, g, b)
71 |
72 | ColorPickerFrame.cancelFunc = function()
73 | ColorCallback(self, r, g, b, a, true)
74 | end
75 |
76 | ColorPickerFrame:Show()
77 | end
78 | AceGUI:ClearFocus()
79 | end
80 |
81 | --[[-----------------------------------------------------------------------------
82 | Methods
83 | -------------------------------------------------------------------------------]]
84 | local methods = {
85 | ["OnAcquire"] = function(self)
86 | self:SetHeight(24)
87 | self:SetWidth(200)
88 | self:SetHasAlpha(false)
89 | self:SetColor(0, 0, 0, 1)
90 | self:SetDisabled(nil)
91 | self:SetLabel(nil)
92 | end,
93 |
94 | -- ["OnRelease"] = nil,
95 |
96 | ["SetLabel"] = function(self, text)
97 | self.text:SetText(text)
98 | end,
99 |
100 | ["SetColor"] = function(self, r, g, b, a)
101 | self.r = r
102 | self.g = g
103 | self.b = b
104 | self.a = a or 1
105 | self.colorSwatch:SetVertexColor(r, g, b, a)
106 | end,
107 |
108 | ["SetHasAlpha"] = function(self, HasAlpha)
109 | self.HasAlpha = HasAlpha
110 | end,
111 |
112 | ["SetDisabled"] = function(self, disabled)
113 | self.disabled = disabled
114 | if self.disabled then
115 | self.frame:Disable()
116 | self.text:SetTextColor(0.5, 0.5, 0.5)
117 | else
118 | self.frame:Enable()
119 | self.text:SetTextColor(1, 1, 1)
120 | end
121 | end
122 | }
123 |
124 | --[[-----------------------------------------------------------------------------
125 | Constructor
126 | -------------------------------------------------------------------------------]]
127 | local function Constructor()
128 | local frame = CreateFrame("Button", nil, UIParent)
129 | frame:Hide()
130 |
131 | frame:EnableMouse(true)
132 | frame:SetScript("OnEnter", Control_OnEnter)
133 | frame:SetScript("OnLeave", Control_OnLeave)
134 | frame:SetScript("OnClick", ColorSwatch_OnClick)
135 |
136 | local colorSwatch = frame:CreateTexture(nil, "OVERLAY")
137 | colorSwatch:SetWidth(19)
138 | colorSwatch:SetHeight(19)
139 | colorSwatch:SetTexture(130939) -- Interface\\ChatFrame\\ChatFrameColorSwatch
140 | colorSwatch:SetPoint("LEFT")
141 |
142 | local texture = frame:CreateTexture(nil, "BACKGROUND")
143 | colorSwatch.background = texture
144 | texture:SetWidth(16)
145 | texture:SetHeight(16)
146 | texture:SetColorTexture(1, 1, 1)
147 | texture:SetPoint("CENTER", colorSwatch)
148 | texture:Show()
149 |
150 | local checkers = frame:CreateTexture(nil, "BACKGROUND")
151 | colorSwatch.checkers = checkers
152 | checkers:SetWidth(14)
153 | checkers:SetHeight(14)
154 | checkers:SetTexture(188523) -- Tileset\\Generic\\Checkers
155 | checkers:SetTexCoord(.25, 0, 0.5, .25)
156 | checkers:SetDesaturated(true)
157 | checkers:SetVertexColor(1, 1, 1, 0.75)
158 | checkers:SetPoint("CENTER", colorSwatch)
159 | checkers:Show()
160 |
161 | local text = frame:CreateFontString(nil,"OVERLAY","GameFontHighlight")
162 | text:SetHeight(24)
163 | text:SetJustifyH("LEFT")
164 | text:SetTextColor(1, 1, 1)
165 | text:SetPoint("LEFT", colorSwatch, "RIGHT", 2, 0)
166 | text:SetPoint("RIGHT")
167 |
168 | --local highlight = frame:CreateTexture(nil, "HIGHLIGHT")
169 | --highlight:SetTexture(136810) -- Interface\\QuestFrame\\UI-QuestTitleHighlight
170 | --highlight:SetBlendMode("ADD")
171 | --highlight:SetAllPoints(frame)
172 |
173 | local widget = {
174 | colorSwatch = colorSwatch,
175 | text = text,
176 | frame = frame,
177 | type = Type
178 | }
179 | for method, func in pairs(methods) do
180 | widget[method] = func
181 | end
182 |
183 | return AceGUI:RegisterAsWidget(widget)
184 | end
185 |
186 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
187 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/Menu.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 | local libDD = LibStub:GetLibrary("LibUIDropDownMenu-4.0")
6 |
7 | function addon:initMenuBar()
8 | local globaldb = addon.db.global
9 | if globaldb.EMEOptions.menu then
10 | lib:RegisterHideable(MicroMenuContainer)
11 | lib:RegisterToggleInCombat(MicroMenuContainer)
12 | C_Timer.After(1, function()
13 | if lib:IsFrameMarkedHidden(MicroMenuContainer) then
14 | MicroMenuContainer:Hide()
15 | end
16 | end)
17 | local dropdown, getSettingDB = lib:RegisterDropdown(MicroMenuContainer, libDD, "PaddingDropdown")
18 | local dropdownOptions = {-4, -3, -2, -1, 0, 1, 2, 3, 4, 5}
19 |
20 | local function updatePadding()
21 | local db = getSettingDB()
22 | if not db.checked then return end
23 | if MicroMenu.overrideScale then return end
24 |
25 | -- local padding = db.checked - 3
26 |
27 | if MicroMenu.isHorizontal then
28 | for key, button in ipairs(MicroMenu:GetLayoutChildren()) do
29 | if key ~= 1 then
30 | local a, b, c, _, e = button:GetPoint(1)
31 | button:ClearAllPoints()
32 | button:SetPoint(a, b, c, (db.checked + button:GetWidth() - 3) * (key-1), e)
33 | end
34 | end
35 |
36 | -- This is a simpler, alternative method I tried.
37 | -- Turns out, it spreads taint into Override Actions Bars. Do not use.
38 | --MicroMenu.childXPadding = padding
39 | --MicroMenu:Layout()
40 | --MicroMenuContainer:SetWidth(MicroMenu:GetWidth()*MicroMenu:GetScale())
41 | else
42 | for key, button in ipairs(MicroMenu:GetLayoutChildren()) do
43 | if key ~= 1 then
44 | local a, b, c, d = button:GetPoint(1)
45 | button:ClearAllPoints()
46 | button:SetPoint(a, b, c, d, -1 * (db.checked + button:GetHeight() - 3) * (key-1))
47 | end
48 | end
49 | end
50 | end
51 |
52 | hooksecurefunc(MicroMenuContainer, "Layout", updatePadding)
53 |
54 | libDD:UIDropDownMenu_Initialize(dropdown, function(self)
55 | local db = getSettingDB()
56 | local info = libDD:UIDropDownMenu_CreateInfo()
57 |
58 | for _, f in ipairs(dropdownOptions) do
59 | info.text = f
60 | info.checked = db.checked == f
61 | info.func = function()
62 | if db.checked == f then
63 | db.checked = nil
64 | else
65 | db.checked = f
66 | end
67 | updatePadding()
68 | end
69 | libDD:UIDropDownMenu_AddButton(info)
70 | end
71 | end)
72 | libDD:UIDropDownMenu_SetWidth(dropdown, 100)
73 | libDD:UIDropDownMenu_SetText(dropdown, HUD_EDIT_MODE_SETTING_ACTION_BAR_ICON_PADDING)
74 |
75 | C_Timer.After(1, updatePadding)
76 |
77 | lib:RegisterCustomCheckbox(MicroMenuContainer, L["MENU_CHECKBOX_DF_BUTTONS_DESCRIPTION"], addon.EnableSkinMicroMenuBW, addon.DisableSkinMicroMenuBW, "10.0Style")
78 | lib:RegisterCustomCheckbox(MicroMenuContainer, L["MENU_CHECKBOX_SL_BUTTONS_DESCRIPTION"], addon.EnableSkinMicroMenuSL, addon.DisableSkinMicroMenuSL, "SLStyle")
79 |
80 | RunNextFrame(function()
81 | if InCombatLockdown() then return end
82 |
83 | -- check if the sound file has already been muted by something else, if it has, lets skip the mute/unmute
84 | local soundFileID = 567481
85 | local willPlay, soundHandle = PlaySoundFile(soundFileID)
86 | if willPlay then
87 | StopSound(soundHandle)
88 | MuteSoundFile(soundFileID)
89 | ShowUIPanel(EditModeManagerFrame, true)
90 | HideUIPanel(EditModeManagerFrame)
91 | UnmuteSoundFile(soundFileID)
92 | else
93 | ShowUIPanel(EditModeManagerFrame, true)
94 | HideUIPanel(EditModeManagerFrame)
95 | end
96 | end)
97 | end
98 |
99 | if globaldb.EMEOptions.bags then
100 | lib:RegisterHideable(BagsBar)
101 | lib:RegisterToggleInCombat(BagsBar)
102 | C_Timer.After(1, function()
103 | if lib:IsFrameMarkedHidden(BagsBar) then
104 | BagsBar:Hide()
105 | end
106 | end)
107 |
108 | addon.hookScriptOnce(ContainerFrame1, "OnShow", function()
109 | addon:continueAfterCombatEnds(function()
110 |
111 | -- workaround for bug introduced in 10.2.5
112 | -- not sure why its happening, something to do with layout-local.txt
113 | -- but trying SetUserPlaced causes an error
114 | ContainerFrame1.Bg:SetFrameLevel(0)
115 |
116 | addon:registerFrame(ContainerFrame1, BACKPACK_TOOLTIP, globaldb.ContainerFrame1)
117 | hooksecurefunc("UpdateContainerFrameAnchors", function()
118 | if InCombatLockdown() then return end
119 | addon.ResetFrame(ContainerFrame1)
120 | end)
121 | end)
122 | end)
123 |
124 | addon.hookScriptOnce(ContainerFrameCombinedBags, "OnShow", function()
125 | addon:continueAfterCombatEnds(function()
126 | addon:registerFrame(ContainerFrameCombinedBags, COMBINED_BAG_TITLE, globaldb.ContainerFrameCombinedBags)
127 | hooksecurefunc("UpdateContainerFrameAnchors", function()
128 | if InCombatLockdown() then return end
129 | addon.ResetFrame(ContainerFrameCombinedBags)
130 | end)
131 | end)
132 | end)
133 | end
134 | end
135 |
--------------------------------------------------------------------------------
/Source/FrameHandlers/Raid.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 |
6 | function addon:initRaidFrames()
7 | local db = addon.db.global
8 | if not db.EMEOptions.compactRaidFrameContainer then return end
9 | addon:registerFrame(CompactRaidFrameManager, L["Raid Manager"], db.CompactRaidFrameManager, nil, "TOPLEFT", false)
10 | --[[
11 | hooksecurefunc("CompactRaidFrameManager_Expand", function()
12 | if InCombatLockdown() then return end
13 | --CompactRaidFrameManager:ClearPoint("TOPLEFT")
14 | addon.ResetFrame(CompactRaidFrameManager)
15 | local db = lib.framesDB[CompactRaidFrameManager.system]
16 | if db.positionWasSavedWhileCollapsed then
17 | for i = 1, CompactRaidFrameManager:GetNumPoints() do
18 | local a, b, c, x, e = CompactRaidFrameManager:GetPoint(i)
19 | x = x + 193
20 | CompactRaidFrameManager:SetPoint(a,b,c,x,e)
21 | end
22 | end
23 | end)
24 | hooksecurefunc("CompactRaidFrameManager_Collapse", function()
25 | if InCombatLockdown() then return end
26 | --CompactRaidFrameManager:ClearPoint("TOPLEFT")
27 | addon.ResetFrame(CompactRaidFrameManager)
28 | local db = lib.framesDB[CompactRaidFrameManager.system]
29 | if not db.positionWasSavedWhileCollapsed then
30 | for i = 1, CompactRaidFrameManager:GetNumPoints() do
31 | local a, b, c, x, e = CompactRaidFrameManager:GetPoint(i)
32 | x = x - 193
33 | CompactRaidFrameManager:SetPoint(a,b,c,x,e)
34 | end
35 | end
36 | end)
37 | CompactRaidFrameManager.Selection:HookScript("OnDragStop", function()
38 | local db = lib.framesDB[CompactRaidFrameManager.system]
39 | db.positionWasSavedWhileCollapsed = CompactRaidFrameManager.collapsed
40 | end)
41 | C_Timer.After(1, function()
42 | if InCombatLockdown() then return end
43 | local db = lib.framesDB[CompactRaidFrameManager.system]
44 | if db.positionWasSavedWhileCollapsed and not CompactRaidFrameManager.collapsed then
45 | for i = 1, CompactRaidFrameManager:GetNumPoints() do
46 | local a, b, c, x, e = CompactRaidFrameManager:GetPoint(i)
47 | x = x + 193
48 | CompactRaidFrameManager:SetPoint(a,b,c,x,e)
49 | end
50 | elseif (not db.positionWasSavedWhileCollapsed) and CompactRaidFrameManager.collapsed then
51 | for i = 1, CompactRaidFrameManager:GetNumPoints() do
52 | local a, b, c, x, e = CompactRaidFrameManager:GetPoint(i)
53 | x = x - 193
54 | CompactRaidFrameManager:SetPoint(a,b,c,x,e)
55 | end
56 | end
57 | end)
58 | lib:RegisterHideable(CompactRaidFrameManager)
59 | lib:RegisterToggleInCombat(CompactRaidFrameManager)
60 |
61 | -- the wasVisible saved in the library when entering Edit Mode cannot be relied upon, as entering Edit Mode shows the raid manager in some situations, before we can detect if it was already visible
62 | hooksecurefunc(EditModeManagerFrame, "ExitEditMode", function()
63 | if InCombatLockdown() then return end
64 | CompactRaidFrameManager:SetShown(IsInGroup() or IsInRaid())
65 | end)
66 |
67 | hooksecurefunc(CompactRaidFrameManager, "SetShown", function()
68 | if InCombatLockdown() then return end
69 | if EditModeManagerFrame.editModeActive then
70 | CompactRaidFrameManager:Show()
71 | else
72 | if not (IsInGroup() or IsInRaid()) then
73 | CompactRaidFrameManager:Hide()
74 | end
75 | end
76 | end)
77 | hooksecurefunc(CompactRaidFrameManager, "Show", function()
78 | if InCombatLockdown() then return end
79 | if not EditModeManagerFrame.editModeActive then
80 | if not (IsInGroup() or IsInRaid()) then
81 | CompactRaidFrameManager:Hide()
82 | end
83 | end
84 | end)
85 | ]]
86 |
87 | local partyFrameNamesWereHidden
88 | lib:RegisterCustomCheckbox(PartyFrame, L["Hide Names"],
89 | function()
90 | for i = 1, 4 do
91 | PartyFrame["MemberFrame"..i].name:Hide()
92 | end
93 | partyFrameNamesWereHidden = true
94 | end,
95 | function()
96 | if not partyFrameNamesWereHidden then return end
97 | for i = 1, 4 do
98 | PartyFrame["MemberFrame"..i].name:Show()
99 | end
100 | partyFrameNamesWereHidden = false
101 | end,
102 | "HidePartyNames"
103 | )
104 |
105 | local showRaidFrameNames
106 |
107 | local function updateHideRaidFrameNames()
108 | for groupID = 1, 8 do
109 | local group = _G["CompactRaidGroup"..groupID]
110 | if group then
111 | for playerID = 1, 5 do
112 | local player = _G["CompactRaidGroup"..groupID.."Member"..playerID]
113 | if player then
114 | player.name:SetShown(showRaidFrameNames)
115 | end
116 | end
117 | end
118 | end
119 | end
120 |
121 | lib:RegisterCustomCheckbox(CompactRaidFrameContainer, L["Hide Names"],
122 | function()
123 | showRaidFrameNames = false
124 | updateHideRaidFrameNames()
125 | end,
126 | function()
127 | showRaidFrameNames = true
128 | updateHideRaidFrameNames()
129 | end,
130 | "HideRaidNames"
131 | )
132 |
133 | local raidFrameNamesSize = 1
134 |
135 | local function updateRaidFrameNamesSizes()
136 | for groupID = 1, 8 do
137 | local group = _G["CompactRaidGroup"..groupID]
138 | if group then
139 | for playerID = 1, 5 do
140 | local player = _G["CompactRaidGroup"..groupID.."Member"..playerID]
141 | if player then
142 | player.name:SetScale(raidFrameNamesSize)
143 | end
144 | end
145 | end
146 | end
147 | end
148 |
149 | lib:RegisterSlider(CompactRaidFrameContainer, "Name Scale", "Name Scale",
150 | function(newValue)
151 | raidFrameNamesSize = newValue
152 | updateRaidFrameNamesSizes()
153 | end,
154 | 0.5, 3, 0.1)
155 |
156 | hooksecurefunc("CompactUnitFrame_UpdateName", updateHideRaidFrameNames)
157 | hooksecurefunc("CompactUnitFrame_UpdateName", updateRaidFrameNamesSizes)
158 | end
159 |
--------------------------------------------------------------------------------
/Source/Vigor.xml:
--------------------------------------------------------------------------------
1 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 | self:GetParent():InAnimFinished();
21 |
22 |
23 |
24 |
25 |
26 |
27 | self:GetParent():OutAnimFinished();
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
52 |
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 |
84 |
85 |
86 |
87 |
88 |
89 |
90 |
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 |
103 |
104 |
105 |
106 |
107 |
108 |
109 |
110 |
111 |
112 |
113 |
114 |
115 |
116 |
117 |
118 |
119 |
120 |
121 |
122 |
123 |
124 |
125 |
126 |
127 |
128 |
129 |
130 |
131 |
132 |
133 |
134 |
135 |
136 |
137 |
138 |
139 |
140 |
141 |
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 |
168 |
169 |
170 |
171 |
172 |
173 |
174 |
175 |
176 |
177 |
178 |
179 |
180 |
--------------------------------------------------------------------------------
/Source/RegisteredSystemFrames.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 | local lib = LibStub:GetLibrary("EditModeExpanded-1.0")
5 |
6 | function addon:initSystemFrames()
7 | local db = addon.db.global
8 |
9 | for _, frame in ipairs(EditModeManagerFrame.registeredSystemFrames) do
10 | local name = frame:GetName()
11 | if not db[name] then db[name] = {} end
12 | addon:registerFrame(frame, "", db[name])
13 | end
14 |
15 | -- The earlier RegisterFrame will :SetShown(true) the TalkingHeadFrame if it was set to Hide then unset.
16 | -- Since its actually not normally shown on login, we will immediately re-hide it again.
17 | TalkingHeadFrame:Hide()
18 | end
19 |
20 | local function getToggleInCombatText(hidden)
21 | if hidden then
22 | return L["Toggle(Show) During Combat"]
23 | else
24 | return L["Toggle(Hide) During Combat"]
25 | end
26 | end
27 |
28 | local actionbars = {[MainActionBar]=true, [MultiBarBottomLeft]=true, [MultiBarBottomRight]=true, [MultiBarRight]=true, [MultiBarLeft]=true, [MultiBar5]=true, [MultiBar6]=true, [MultiBar7]=true}
29 | function addon:registerSecureFrameHideable(frame, usePoint, onHide, onShow)
30 | local hidden, toggleInCombat, x, y, point, parent, relativePoint
31 | local override
32 |
33 | local function hide()
34 | if not x then
35 | x, y = frame:GetLeft(), frame:GetBottom()
36 | if usePoint then
37 | point, parent, relativePoint, x, y = frame:GetPoint(1)
38 | end
39 | end
40 |
41 | frame:ClearAllPoints()
42 | frame:SetClampedToScreen(false)
43 | frame:SetPoint("TOPRIGHT", UIParent, "BOTTOMLEFT", -1000, -1000)
44 |
45 | if onHide then
46 | onHide()
47 | end
48 | end
49 |
50 | local function show()
51 | if not x then return end
52 |
53 | frame:ClearAllPoints()
54 |
55 | if usePoint then
56 | frame:SetPoint(point, parent, relativePoint, x, y)
57 | else
58 | frame:SetPoint("BOTTOMLEFT", UIParent, "BOTTOMLEFT", x, y)
59 | end
60 |
61 | x, y = nil, nil
62 |
63 | if onShow then
64 | onShow()
65 | end
66 | end
67 |
68 | EventRegistry:RegisterFrameEventAndCallbackWithHandle("PLAYER_REGEN_ENABLED", function()
69 | if override then
70 | override = false
71 | if hidden then hide() end
72 | end
73 |
74 | if toggleInCombat then
75 | if hidden then
76 | hide()
77 | else
78 | show()
79 | end
80 | elseif hidden then
81 | hide()
82 | end
83 | end)
84 | EventRegistry:RegisterFrameEventAndCallbackWithHandle("PLAYER_REGEN_DISABLED", function()
85 | if not toggleInCombat then return end
86 | if hidden then
87 | show()
88 | else
89 | hide()
90 | end
91 | end)
92 |
93 | -- The position of some frames reset to default when spec is changed
94 | -- Lets reset it back to the saved spot so we can shove it back off screen again
95 | EventRegistry:RegisterFrameEventAndCallbackWithHandle("PLAYER_TALENT_UPDATE", function()
96 | RunNextFrame(function()
97 | if InCombatLockdown() then return end
98 | if hidden then
99 | show()
100 | hide()
101 | end
102 | end)
103 | end)
104 |
105 | local onResetFunctionHide = lib:RegisterCustomCheckbox(frame, HIDE,
106 | function()
107 | hidden = true
108 | if InCombatLockdown() then return end
109 | if not EditModeManagerFrame.editModeActive then
110 | hide()
111 | end
112 | end,
113 | function()
114 | hidden = false
115 | if InCombatLockdown() then return end
116 | show()
117 | end,
118 | "HidePermanently")
119 |
120 | RunNextFrame(function()
121 | if InCombatLockdown() then return end
122 | if hidden then
123 | show()
124 | hide()
125 | end
126 | end)
127 |
128 | local onResetFunctionToggle = lib:RegisterCustomCheckbox(frame, function() return getToggleInCombatText(hidden) end,
129 | function()
130 | toggleInCombat = true
131 | end,
132 | function()
133 | toggleInCombat = false
134 | end,
135 | "ToggleInCombat")
136 |
137 | hooksecurefunc(EditModeManagerFrame, "EnterEditMode", function()
138 | if InCombatLockdown() then return end
139 | show()
140 | end)
141 |
142 | hooksecurefunc(EditModeManagerFrame, "ExitEditMode", function()
143 | if InCombatLockdown() then return end
144 | if hidden then
145 | hide()
146 | end
147 | end)
148 |
149 | hooksecurefunc(frame, "Show", function()
150 | if InCombatLockdown() then return end
151 | if EditModeManagerFrame.editModeActive then return end
152 | if override then return end
153 | if hidden then hide() end
154 | end)
155 |
156 | hooksecurefunc(frame, "SetShown", function()
157 | if InCombatLockdown() then return end
158 | if override then return end
159 | if hidden then hide() end
160 | end)
161 |
162 | if frame.EMEResetButton then
163 | frame.EMEResetButton:HookScript("OnClick", function()
164 | hidden = false
165 | toggleInCombat = false
166 | onResetFunctionHide()
167 | onResetFunctionToggle()
168 | end)
169 | end
170 |
171 | if actionbars[frame] then
172 | EventUtil.ContinueOnAddOnLoaded("Blizzard_PlayerSpells", function()
173 | hooksecurefunc(PlayerSpellsFrame, "Show", function()
174 | if InCombatLockdown() then return end
175 | if EditModeManagerFrame.editModeActive then return end
176 | override = true
177 | if hidden then show() end
178 | end)
179 |
180 | hooksecurefunc(PlayerSpellsFrame, "Hide", function()
181 | if InCombatLockdown() then return end
182 | if EditModeManagerFrame.editModeActive then return end
183 | override = false
184 | if hidden then hide() end
185 | end)
186 | end)
187 | end
188 |
189 | return function()
190 | return ( hidden and (not toggleInCombat) ) or
191 | ( hidden and toggleInCombat and (not InCombatLockdown()) ) or
192 | ( (not hidden) and toggleInCombat and InCombatLockdown() )
193 | end
194 | end
195 |
196 | -- Reparents the class resource to UIParent so player can move it independently of the player frame, and can hide the player frame without hiding the class resource
197 |
198 | -- See ClassPowerBar.lua\ClassPowerBar:GetUnit() for why I do this parentparent nonsense:
199 | local parentparent = CreateFrame("Frame", nil, UIParent)
200 | local parent = CreateFrame("Frame", nil, parentparent)
201 |
202 | function addon.unlinkClassResourceFrame(frame)
203 | local wasChecked
204 | lib:RegisterCustomCheckbox(frame, L["UNLINK_CLASS_RESOURCE_DESCRIPTION"],
205 | --onChecked
206 | function()
207 | frame:SetParent(parent)
208 | wasChecked = true
209 | end,
210 | --onUnchecked
211 | function()
212 | if not wasChecked then return end
213 | frame:SetParent(PlayerFrameBottomManagedFramesContainer)
214 | end
215 | )
216 | end
217 |
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIWidget-Keybinding.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Keybinding Widget
3 | Set Keybindings in the Config UI.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "Keybinding", 26
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs = pairs
11 |
12 | -- WoW APIs
13 | local IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown = IsShiftKeyDown, IsControlKeyDown, IsAltKeyDown
14 | local CreateFrame, UIParent = CreateFrame, UIParent
15 |
16 | --[[-----------------------------------------------------------------------------
17 | Scripts
18 | -------------------------------------------------------------------------------]]
19 |
20 | local function Control_OnEnter(frame)
21 | frame.obj:Fire("OnEnter")
22 | end
23 |
24 | local function Control_OnLeave(frame)
25 | frame.obj:Fire("OnLeave")
26 | end
27 |
28 | local function Keybinding_OnClick(frame, button)
29 | if button == "LeftButton" or button == "RightButton" then
30 | local self = frame.obj
31 | if self.waitingForKey then
32 | frame:EnableKeyboard(false)
33 | frame:EnableMouseWheel(false)
34 | self.msgframe:Hide()
35 | frame:UnlockHighlight()
36 | self.waitingForKey = nil
37 | else
38 | frame:EnableKeyboard(true)
39 | frame:EnableMouseWheel(true)
40 | self.msgframe:Show()
41 | frame:LockHighlight()
42 | self.waitingForKey = true
43 | end
44 | end
45 | AceGUI:ClearFocus()
46 | end
47 |
48 | local ignoreKeys = {
49 | ["BUTTON1"] = true, ["BUTTON2"] = true,
50 | ["UNKNOWN"] = true,
51 | ["LSHIFT"] = true, ["LCTRL"] = true, ["LALT"] = true,
52 | ["RSHIFT"] = true, ["RCTRL"] = true, ["RALT"] = true,
53 | }
54 | local function Keybinding_OnKeyDown(frame, key)
55 | local self = frame.obj
56 | if self.waitingForKey then
57 | local keyPressed = key
58 | if keyPressed == "ESCAPE" then
59 | keyPressed = ""
60 | else
61 | if ignoreKeys[keyPressed] then return end
62 | if IsShiftKeyDown() then
63 | keyPressed = "SHIFT-"..keyPressed
64 | end
65 | if IsControlKeyDown() then
66 | keyPressed = "CTRL-"..keyPressed
67 | end
68 | if IsAltKeyDown() then
69 | keyPressed = "ALT-"..keyPressed
70 | end
71 | end
72 |
73 | frame:EnableKeyboard(false)
74 | frame:EnableMouseWheel(false)
75 | self.msgframe:Hide()
76 | frame:UnlockHighlight()
77 | self.waitingForKey = nil
78 |
79 | if not self.disabled then
80 | self:SetKey(keyPressed)
81 | self:Fire("OnKeyChanged", keyPressed)
82 | end
83 | end
84 | end
85 |
86 | local function Keybinding_OnMouseDown(frame, button)
87 | if button == "LeftButton" or button == "RightButton" then
88 | return
89 | elseif button == "MiddleButton" then
90 | button = "BUTTON3"
91 | elseif button == "Button4" then
92 | button = "BUTTON4"
93 | elseif button == "Button5" then
94 | button = "BUTTON5"
95 | end
96 | Keybinding_OnKeyDown(frame, button)
97 | end
98 |
99 | local function Keybinding_OnMouseWheel(frame, direction)
100 | local button
101 | if direction >= 0 then
102 | button = "MOUSEWHEELUP"
103 | else
104 | button = "MOUSEWHEELDOWN"
105 | end
106 | Keybinding_OnKeyDown(frame, button)
107 | end
108 |
109 | --[[-----------------------------------------------------------------------------
110 | Methods
111 | -------------------------------------------------------------------------------]]
112 | local methods = {
113 | ["OnAcquire"] = function(self)
114 | self:SetWidth(200)
115 | self:SetLabel("")
116 | self:SetKey("")
117 | self.waitingForKey = nil
118 | self.msgframe:Hide()
119 | self:SetDisabled(false)
120 | self.button:EnableKeyboard(false)
121 | self.button:EnableMouseWheel(false)
122 | end,
123 |
124 | -- ["OnRelease"] = nil,
125 |
126 | ["SetDisabled"] = function(self, disabled)
127 | self.disabled = disabled
128 | if disabled then
129 | self.button:Disable()
130 | self.label:SetTextColor(0.5,0.5,0.5)
131 | else
132 | self.button:Enable()
133 | self.label:SetTextColor(1,1,1)
134 | end
135 | end,
136 |
137 | ["SetKey"] = function(self, key)
138 | if (key or "") == "" then
139 | self.button:SetText(NOT_BOUND)
140 | self.button:SetNormalFontObject("GameFontNormal")
141 | else
142 | self.button:SetText(key)
143 | self.button:SetNormalFontObject("GameFontHighlight")
144 | end
145 | end,
146 |
147 | ["GetKey"] = function(self)
148 | local key = self.button:GetText()
149 | if key == NOT_BOUND then
150 | key = nil
151 | end
152 | return key
153 | end,
154 |
155 | ["SetLabel"] = function(self, label)
156 | self.label:SetText(label or "")
157 | if (label or "") == "" then
158 | self.alignoffset = nil
159 | self:SetHeight(24)
160 | else
161 | self.alignoffset = 30
162 | self:SetHeight(44)
163 | end
164 | end,
165 | }
166 |
167 | --[[-----------------------------------------------------------------------------
168 | Constructor
169 | -------------------------------------------------------------------------------]]
170 |
171 | local ControlBackdrop = {
172 | bgFile = "Interface\\Tooltips\\UI-Tooltip-Background",
173 | edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border",
174 | tile = true, tileSize = 16, edgeSize = 16,
175 | insets = { left = 3, right = 3, top = 3, bottom = 3 }
176 | }
177 |
178 | local function keybindingMsgFixWidth(frame)
179 | frame:SetWidth(frame.msg:GetWidth() + 10)
180 | frame:SetScript("OnUpdate", nil)
181 | end
182 |
183 | local function Constructor()
184 | local name = "AceGUI30KeybindingButton" .. AceGUI:GetNextWidgetNum(Type)
185 |
186 | local frame = CreateFrame("Frame", nil, UIParent)
187 | local button = CreateFrame("Button", name, frame, "UIPanelButtonTemplate")
188 |
189 | button:EnableMouse(true)
190 | button:EnableMouseWheel(false)
191 | button:RegisterForClicks("AnyDown")
192 | button:SetScript("OnEnter", Control_OnEnter)
193 | button:SetScript("OnLeave", Control_OnLeave)
194 | button:SetScript("OnClick", Keybinding_OnClick)
195 | button:SetScript("OnKeyDown", Keybinding_OnKeyDown)
196 | button:SetScript("OnMouseDown", Keybinding_OnMouseDown)
197 | button:SetScript("OnMouseWheel", Keybinding_OnMouseWheel)
198 | button:SetPoint("BOTTOMLEFT")
199 | button:SetPoint("BOTTOMRIGHT")
200 | button:SetHeight(24)
201 | button:EnableKeyboard(false)
202 |
203 | local text = button:GetFontString()
204 | text:SetPoint("LEFT", 7, 0)
205 | text:SetPoint("RIGHT", -7, 0)
206 |
207 | local label = frame:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
208 | label:SetPoint("TOPLEFT")
209 | label:SetPoint("TOPRIGHT")
210 | label:SetJustifyH("CENTER")
211 | label:SetHeight(18)
212 |
213 | local msgframe = CreateFrame("Frame", nil, UIParent, "BackdropTemplate")
214 | msgframe:SetHeight(30)
215 | msgframe:SetBackdrop(ControlBackdrop)
216 | msgframe:SetBackdropColor(0,0,0)
217 | msgframe:SetFrameStrata("FULLSCREEN_DIALOG")
218 | msgframe:SetFrameLevel(1000)
219 | msgframe:SetToplevel(true)
220 |
221 | local msg = msgframe:CreateFontString(nil, "OVERLAY", "GameFontNormal")
222 | msg:SetText("Press a key to bind, ESC to clear the binding or click the button again to cancel.")
223 | msgframe.msg = msg
224 | msg:SetPoint("TOPLEFT", 5, -5)
225 | msgframe:SetScript("OnUpdate", keybindingMsgFixWidth)
226 | msgframe:SetPoint("BOTTOM", button, "TOP")
227 | msgframe:Hide()
228 |
229 | local widget = {
230 | button = button,
231 | label = label,
232 | msgframe = msgframe,
233 | frame = frame,
234 | alignoffset = 30,
235 | type = Type
236 | }
237 | for method, func in pairs(methods) do
238 | widget[method] = func
239 | end
240 | button.obj = widget
241 |
242 | return AceGUI:RegisterAsWidget(widget)
243 | end
244 |
245 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
246 |
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIContainer-ScrollFrame.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | ScrollFrame Container
3 | Plain container that scrolls its content and doesn't grow in height.
4 | -------------------------------------------------------------------------------]]
5 | local Type, Version = "ScrollFrame", 26
6 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
7 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
8 |
9 | -- Lua APIs
10 | local pairs, assert, type = pairs, assert, type
11 | local min, max, floor = math.min, math.max, math.floor
12 |
13 | -- WoW APIs
14 | local CreateFrame, UIParent = CreateFrame, UIParent
15 |
16 | --[[-----------------------------------------------------------------------------
17 | Support functions
18 | -------------------------------------------------------------------------------]]
19 | local function FixScrollOnUpdate(frame)
20 | frame:SetScript("OnUpdate", nil)
21 | frame.obj:FixScroll()
22 | end
23 |
24 | --[[-----------------------------------------------------------------------------
25 | Scripts
26 | -------------------------------------------------------------------------------]]
27 | local function ScrollFrame_OnMouseWheel(frame, value)
28 | frame.obj:MoveScroll(value)
29 | end
30 |
31 | local function ScrollFrame_OnSizeChanged(frame)
32 | frame:SetScript("OnUpdate", FixScrollOnUpdate)
33 | end
34 |
35 | local function ScrollBar_OnScrollValueChanged(frame, value)
36 | frame.obj:SetScroll(value)
37 | end
38 |
39 | --[[-----------------------------------------------------------------------------
40 | Methods
41 | -------------------------------------------------------------------------------]]
42 | local methods = {
43 | ["OnAcquire"] = function(self)
44 | self:SetScroll(0)
45 | self.scrollframe:SetScript("OnUpdate", FixScrollOnUpdate)
46 | end,
47 |
48 | ["OnRelease"] = function(self)
49 | self.status = nil
50 | for k in pairs(self.localstatus) do
51 | self.localstatus[k] = nil
52 | end
53 | self.scrollframe:SetPoint("BOTTOMRIGHT")
54 | self.scrollbar:Hide()
55 | self.scrollBarShown = nil
56 | self.content.height, self.content.width, self.content.original_width = nil, nil, nil
57 | end,
58 |
59 | ["SetScroll"] = function(self, value)
60 | local status = self.status or self.localstatus
61 | local viewheight = self.scrollframe:GetHeight()
62 | local height = self.content:GetHeight()
63 | local offset
64 |
65 | if viewheight > height then
66 | offset = 0
67 | else
68 | offset = floor((height - viewheight) / 1000.0 * value)
69 | end
70 | self.content:ClearAllPoints()
71 | self.content:SetPoint("TOPLEFT", 0, offset)
72 | self.content:SetPoint("TOPRIGHT", 0, offset)
73 | status.offset = offset
74 | status.scrollvalue = value
75 | end,
76 |
77 | ["MoveScroll"] = function(self, value)
78 | local status = self.status or self.localstatus
79 | local height, viewheight = self.scrollframe:GetHeight(), self.content:GetHeight()
80 |
81 | if self.scrollBarShown then
82 | local diff = height - viewheight
83 | local delta = 1
84 | if value < 0 then
85 | delta = -1
86 | end
87 | self.scrollbar:SetValue(min(max(status.scrollvalue + delta*(1000/(diff/45)),0), 1000))
88 | end
89 | end,
90 |
91 | ["FixScroll"] = function(self)
92 | if self.updateLock then return end
93 | self.updateLock = true
94 | local status = self.status or self.localstatus
95 | local height, viewheight = self.scrollframe:GetHeight(), self.content:GetHeight()
96 | local offset = status.offset or 0
97 | -- Give us a margin of error of 2 pixels to stop some conditions that i would blame on floating point inaccuracys
98 | -- No-one is going to miss 2 pixels at the bottom of the frame, anyhow!
99 | if viewheight < height + 2 then
100 | if self.scrollBarShown then
101 | self.scrollBarShown = nil
102 | self.scrollbar:Hide()
103 | self.scrollbar:SetValue(0)
104 | self.scrollframe:SetPoint("BOTTOMRIGHT")
105 | if self.content.original_width then
106 | self.content.width = self.content.original_width
107 | end
108 | self:DoLayout()
109 | end
110 | else
111 | if not self.scrollBarShown then
112 | self.scrollBarShown = true
113 | self.scrollbar:Show()
114 | self.scrollframe:SetPoint("BOTTOMRIGHT", -20, 0)
115 | if self.content.original_width then
116 | self.content.width = self.content.original_width - 20
117 | end
118 | self:DoLayout()
119 | end
120 | local value = (offset / (viewheight - height) * 1000)
121 | if value > 1000 then value = 1000 end
122 | self.scrollbar:SetValue(value)
123 | self:SetScroll(value)
124 | if value < 1000 then
125 | self.content:ClearAllPoints()
126 | self.content:SetPoint("TOPLEFT", 0, offset)
127 | self.content:SetPoint("TOPRIGHT", 0, offset)
128 | status.offset = offset
129 | end
130 | end
131 | self.updateLock = nil
132 | end,
133 |
134 | ["LayoutFinished"] = function(self, width, height)
135 | self.content:SetHeight(height or 0 + 20)
136 |
137 | -- update the scrollframe
138 | self:FixScroll()
139 |
140 | -- schedule another update when everything has "settled"
141 | self.scrollframe:SetScript("OnUpdate", FixScrollOnUpdate)
142 | end,
143 |
144 | ["SetStatusTable"] = function(self, status)
145 | assert(type(status) == "table")
146 | self.status = status
147 | if not status.scrollvalue then
148 | status.scrollvalue = 0
149 | end
150 | end,
151 |
152 | ["OnWidthSet"] = function(self, width)
153 | local content = self.content
154 | content.width = width - (self.scrollBarShown and 20 or 0)
155 | content.original_width = width
156 | end,
157 |
158 | ["OnHeightSet"] = function(self, height)
159 | local content = self.content
160 | content.height = height
161 | end
162 | }
163 | --[[-----------------------------------------------------------------------------
164 | Constructor
165 | -------------------------------------------------------------------------------]]
166 | local function Constructor()
167 | local frame = CreateFrame("Frame", nil, UIParent)
168 | local num = AceGUI:GetNextWidgetNum(Type)
169 |
170 | local scrollframe = CreateFrame("ScrollFrame", nil, frame)
171 | scrollframe:SetPoint("TOPLEFT")
172 | scrollframe:SetPoint("BOTTOMRIGHT")
173 | scrollframe:EnableMouseWheel(true)
174 | scrollframe:SetScript("OnMouseWheel", ScrollFrame_OnMouseWheel)
175 | scrollframe:SetScript("OnSizeChanged", ScrollFrame_OnSizeChanged)
176 |
177 | local scrollbar = CreateFrame("Slider", ("AceConfigDialogScrollFrame%dScrollBar"):format(num), scrollframe, "UIPanelScrollBarTemplate")
178 | scrollbar:SetPoint("TOPLEFT", scrollframe, "TOPRIGHT", 4, -16)
179 | scrollbar:SetPoint("BOTTOMLEFT", scrollframe, "BOTTOMRIGHT", 4, 16)
180 | scrollbar:SetMinMaxValues(0, 1000)
181 | scrollbar:SetValueStep(1)
182 | scrollbar:SetValue(0)
183 | scrollbar:SetWidth(16)
184 | scrollbar:Hide()
185 | -- set the script as the last step, so it doesn't fire yet
186 | scrollbar:SetScript("OnValueChanged", ScrollBar_OnScrollValueChanged)
187 |
188 | local scrollbg = scrollbar:CreateTexture(nil, "BACKGROUND")
189 | scrollbg:SetAllPoints(scrollbar)
190 | scrollbg:SetColorTexture(0, 0, 0, 0.4)
191 |
192 | --Container Support
193 | local content = CreateFrame("Frame", nil, scrollframe)
194 | content:SetPoint("TOPLEFT")
195 | content:SetPoint("TOPRIGHT")
196 | content:SetHeight(400)
197 | scrollframe:SetScrollChild(content)
198 |
199 | local widget = {
200 | localstatus = { scrollvalue = 0 },
201 | scrollframe = scrollframe,
202 | scrollbar = scrollbar,
203 | content = content,
204 | frame = frame,
205 | type = Type
206 | }
207 | for method, func in pairs(methods) do
208 | widget[method] = func
209 | end
210 | scrollframe.obj, scrollbar.obj = widget, widget
211 |
212 | return AceGUI:RegisterAsContainer(widget)
213 | end
214 |
215 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
216 |
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIWidget-EditBox.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | EditBox Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "EditBox", 28
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local tostring, pairs = tostring, pairs
10 |
11 | -- WoW APIs
12 | local PlaySound = PlaySound
13 | local GetCursorInfo, ClearCursor, GetSpellInfo = GetCursorInfo, ClearCursor, GetSpellInfo
14 | local CreateFrame, UIParent = CreateFrame, UIParent
15 | local _G = _G
16 |
17 | --[[-----------------------------------------------------------------------------
18 | Support functions
19 | -------------------------------------------------------------------------------]]
20 | if not AceGUIEditBoxInsertLink then
21 | -- upgradeable hook
22 | hooksecurefunc("ChatEdit_InsertLink", function(...) return _G.AceGUIEditBoxInsertLink(...) end)
23 | end
24 |
25 | function _G.AceGUIEditBoxInsertLink(text)
26 | for i = 1, AceGUI:GetWidgetCount(Type) do
27 | local editbox = _G["AceGUI-3.0EditBox"..i]
28 | if editbox and editbox:IsVisible() and editbox:HasFocus() then
29 | editbox:Insert(text)
30 | return true
31 | end
32 | end
33 | end
34 |
35 | local function ShowButton(self)
36 | if not self.disablebutton then
37 | self.button:Show()
38 | self.editbox:SetTextInsets(0, 20, 3, 3)
39 | end
40 | end
41 |
42 | local function HideButton(self)
43 | self.button:Hide()
44 | self.editbox:SetTextInsets(0, 0, 3, 3)
45 | end
46 |
47 | --[[-----------------------------------------------------------------------------
48 | Scripts
49 | -------------------------------------------------------------------------------]]
50 | local function Control_OnEnter(frame)
51 | frame.obj:Fire("OnEnter")
52 | end
53 |
54 | local function Control_OnLeave(frame)
55 | frame.obj:Fire("OnLeave")
56 | end
57 |
58 | local function Frame_OnShowFocus(frame)
59 | frame.obj.editbox:SetFocus()
60 | frame:SetScript("OnShow", nil)
61 | end
62 |
63 | local function EditBox_OnEscapePressed(frame)
64 | AceGUI:ClearFocus()
65 | end
66 |
67 | local function EditBox_OnEnterPressed(frame)
68 | local self = frame.obj
69 | local value = frame:GetText()
70 | local cancel = self:Fire("OnEnterPressed", value)
71 | if not cancel then
72 | PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON
73 | HideButton(self)
74 | end
75 | end
76 |
77 | local function EditBox_OnReceiveDrag(frame)
78 | local self = frame.obj
79 | local type, id, info = GetCursorInfo()
80 | local name
81 | if type == "item" then
82 | name = info
83 | elseif type == "spell" then
84 | name = GetSpellInfo(id, info)
85 | elseif type == "macro" then
86 | name = GetMacroInfo(id)
87 | end
88 | if name then
89 | self:SetText(name)
90 | self:Fire("OnEnterPressed", name)
91 | ClearCursor()
92 | HideButton(self)
93 | AceGUI:ClearFocus()
94 | end
95 | end
96 |
97 | local function EditBox_OnTextChanged(frame)
98 | local self = frame.obj
99 | local value = frame:GetText()
100 | if tostring(value) ~= tostring(self.lasttext) then
101 | self:Fire("OnTextChanged", value)
102 | self.lasttext = value
103 | ShowButton(self)
104 | end
105 | end
106 |
107 | local function EditBox_OnFocusGained(frame)
108 | AceGUI:SetFocus(frame.obj)
109 | end
110 |
111 | local function Button_OnClick(frame)
112 | local editbox = frame.obj.editbox
113 | editbox:ClearFocus()
114 | EditBox_OnEnterPressed(editbox)
115 | end
116 |
117 | --[[-----------------------------------------------------------------------------
118 | Methods
119 | -------------------------------------------------------------------------------]]
120 | local methods = {
121 | ["OnAcquire"] = function(self)
122 | -- height is controlled by SetLabel
123 | self:SetWidth(200)
124 | self:SetDisabled(false)
125 | self:SetLabel()
126 | self:SetText()
127 | self:DisableButton(false)
128 | self:SetMaxLetters(0)
129 | end,
130 |
131 | ["OnRelease"] = function(self)
132 | self:ClearFocus()
133 | end,
134 |
135 | ["SetDisabled"] = function(self, disabled)
136 | self.disabled = disabled
137 | if disabled then
138 | self.editbox:EnableMouse(false)
139 | self.editbox:ClearFocus()
140 | self.editbox:SetTextColor(0.5,0.5,0.5)
141 | self.label:SetTextColor(0.5,0.5,0.5)
142 | else
143 | self.editbox:EnableMouse(true)
144 | self.editbox:SetTextColor(1,1,1)
145 | self.label:SetTextColor(1,.82,0)
146 | end
147 | end,
148 |
149 | ["SetText"] = function(self, text)
150 | self.lasttext = text or ""
151 | self.editbox:SetText(text or "")
152 | self.editbox:SetCursorPosition(0)
153 | HideButton(self)
154 | end,
155 |
156 | ["GetText"] = function(self, text)
157 | return self.editbox:GetText()
158 | end,
159 |
160 | ["SetLabel"] = function(self, text)
161 | if text and text ~= "" then
162 | self.label:SetText(text)
163 | self.label:Show()
164 | self.editbox:SetPoint("TOPLEFT",self.frame,"TOPLEFT",7,-18)
165 | self:SetHeight(44)
166 | self.alignoffset = 30
167 | else
168 | self.label:SetText("")
169 | self.label:Hide()
170 | self.editbox:SetPoint("TOPLEFT",self.frame,"TOPLEFT",7,0)
171 | self:SetHeight(26)
172 | self.alignoffset = 12
173 | end
174 | end,
175 |
176 | ["DisableButton"] = function(self, disabled)
177 | self.disablebutton = disabled
178 | if disabled then
179 | HideButton(self)
180 | end
181 | end,
182 |
183 | ["SetMaxLetters"] = function (self, num)
184 | self.editbox:SetMaxLetters(num or 0)
185 | end,
186 |
187 | ["ClearFocus"] = function(self)
188 | self.editbox:ClearFocus()
189 | self.frame:SetScript("OnShow", nil)
190 | end,
191 |
192 | ["SetFocus"] = function(self)
193 | self.editbox:SetFocus()
194 | if not self.frame:IsShown() then
195 | self.frame:SetScript("OnShow", Frame_OnShowFocus)
196 | end
197 | end,
198 |
199 | ["HighlightText"] = function(self, from, to)
200 | self.editbox:HighlightText(from, to)
201 | end
202 | }
203 |
204 | --[[-----------------------------------------------------------------------------
205 | Constructor
206 | -------------------------------------------------------------------------------]]
207 | local function Constructor()
208 | local num = AceGUI:GetNextWidgetNum(Type)
209 | local frame = CreateFrame("Frame", nil, UIParent)
210 | frame:Hide()
211 |
212 | local editbox = CreateFrame("EditBox", "AceGUI-3.0EditBox"..num, frame, "InputBoxTemplate")
213 | editbox:SetAutoFocus(false)
214 | editbox:SetFontObject(ChatFontNormal)
215 | editbox:SetScript("OnEnter", Control_OnEnter)
216 | editbox:SetScript("OnLeave", Control_OnLeave)
217 | editbox:SetScript("OnEscapePressed", EditBox_OnEscapePressed)
218 | editbox:SetScript("OnEnterPressed", EditBox_OnEnterPressed)
219 | editbox:SetScript("OnTextChanged", EditBox_OnTextChanged)
220 | editbox:SetScript("OnReceiveDrag", EditBox_OnReceiveDrag)
221 | editbox:SetScript("OnMouseDown", EditBox_OnReceiveDrag)
222 | editbox:SetScript("OnEditFocusGained", EditBox_OnFocusGained)
223 | editbox:SetTextInsets(0, 0, 3, 3)
224 | editbox:SetMaxLetters(256)
225 | editbox:SetPoint("BOTTOMLEFT", 6, 0)
226 | editbox:SetPoint("BOTTOMRIGHT")
227 | editbox:SetHeight(19)
228 |
229 | local label = frame:CreateFontString(nil, "OVERLAY", "GameFontNormalSmall")
230 | label:SetPoint("TOPLEFT", 0, -2)
231 | label:SetPoint("TOPRIGHT", 0, -2)
232 | label:SetJustifyH("LEFT")
233 | label:SetHeight(18)
234 |
235 | local button = CreateFrame("Button", nil, editbox, "UIPanelButtonTemplate")
236 | button:SetWidth(40)
237 | button:SetHeight(20)
238 | button:SetPoint("RIGHT", -2, 0)
239 | button:SetText(OKAY)
240 | button:SetScript("OnClick", Button_OnClick)
241 | button:Hide()
242 |
243 | local widget = {
244 | alignoffset = 30,
245 | editbox = editbox,
246 | label = label,
247 | button = button,
248 | frame = frame,
249 | type = Type
250 | }
251 | for method, func in pairs(methods) do
252 | widget[method] = func
253 | end
254 | editbox.obj, button.obj = widget, widget
255 |
256 | return AceGUI:RegisterAsWidget(widget)
257 | end
258 |
259 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
260 |
--------------------------------------------------------------------------------
/Source/libs/CallbackHandler-1.0/CallbackHandler-1.0.lua:
--------------------------------------------------------------------------------
1 | --[[ $Id: CallbackHandler-1.0.lua 1298 2022-12-12 15:10:10Z nevcairiel $ ]]
2 | local MAJOR, MINOR = "CallbackHandler-1.0", 8
3 | local CallbackHandler = LibStub:NewLibrary(MAJOR, MINOR)
4 |
5 | if not CallbackHandler then return end -- No upgrade needed
6 |
7 | local meta = {__index = function(tbl, key) tbl[key] = {} return tbl[key] end}
8 |
9 | -- Lua APIs
10 | local securecallfunction, error = securecallfunction, error
11 | local setmetatable, rawget = setmetatable, rawget
12 | local next, select, pairs, type, tostring = next, select, pairs, type, tostring
13 |
14 |
15 | local function Dispatch(handlers, ...)
16 | local index, method = next(handlers)
17 | if not method then return end
18 | repeat
19 | securecallfunction(method, ...)
20 | index, method = next(handlers, index)
21 | until not method
22 | end
23 |
24 | --------------------------------------------------------------------------
25 | -- CallbackHandler:New
26 | --
27 | -- target - target object to embed public APIs in
28 | -- RegisterName - name of the callback registration API, default "RegisterCallback"
29 | -- UnregisterName - name of the callback unregistration API, default "UnregisterCallback"
30 | -- UnregisterAllName - name of the API to unregister all callbacks, default "UnregisterAllCallbacks". false == don't publish this API.
31 |
32 | function CallbackHandler.New(_self, target, RegisterName, UnregisterName, UnregisterAllName)
33 |
34 | RegisterName = RegisterName or "RegisterCallback"
35 | UnregisterName = UnregisterName or "UnregisterCallback"
36 | if UnregisterAllName==nil then -- false is used to indicate "don't want this method"
37 | UnregisterAllName = "UnregisterAllCallbacks"
38 | end
39 |
40 | -- we declare all objects and exported APIs inside this closure to quickly gain access
41 | -- to e.g. function names, the "target" parameter, etc
42 |
43 |
44 | -- Create the registry object
45 | local events = setmetatable({}, meta)
46 | local registry = { recurse=0, events=events }
47 |
48 | -- registry:Fire() - fires the given event/message into the registry
49 | function registry:Fire(eventname, ...)
50 | if not rawget(events, eventname) or not next(events[eventname]) then return end
51 | local oldrecurse = registry.recurse
52 | registry.recurse = oldrecurse + 1
53 |
54 | Dispatch(events[eventname], eventname, ...)
55 |
56 | registry.recurse = oldrecurse
57 |
58 | if registry.insertQueue and oldrecurse==0 then
59 | -- Something in one of our callbacks wanted to register more callbacks; they got queued
60 | for event,callbacks in pairs(registry.insertQueue) do
61 | local first = not rawget(events, event) or not next(events[event]) -- test for empty before. not test for one member after. that one member may have been overwritten.
62 | for object,func in pairs(callbacks) do
63 | events[event][object] = func
64 | -- fire OnUsed callback?
65 | if first and registry.OnUsed then
66 | registry.OnUsed(registry, target, event)
67 | first = nil
68 | end
69 | end
70 | end
71 | registry.insertQueue = nil
72 | end
73 | end
74 |
75 | -- Registration of a callback, handles:
76 | -- self["method"], leads to self["method"](self, ...)
77 | -- self with function ref, leads to functionref(...)
78 | -- "addonId" (instead of self) with function ref, leads to functionref(...)
79 | -- all with an optional arg, which, if present, gets passed as first argument (after self if present)
80 | target[RegisterName] = function(self, eventname, method, ... --[[actually just a single arg]])
81 | if type(eventname) ~= "string" then
82 | error("Usage: "..RegisterName.."(eventname, method[, arg]): 'eventname' - string expected.", 2)
83 | end
84 |
85 | method = method or eventname
86 |
87 | local first = not rawget(events, eventname) or not next(events[eventname]) -- test for empty before. not test for one member after. that one member may have been overwritten.
88 |
89 | if type(method) ~= "string" and type(method) ~= "function" then
90 | error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - string or function expected.", 2)
91 | end
92 |
93 | local regfunc
94 |
95 | if type(method) == "string" then
96 | -- self["method"] calling style
97 | if type(self) ~= "table" then
98 | error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): self was not a table?", 2)
99 | elseif self==target then
100 | error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): do not use Library:"..RegisterName.."(), use your own 'self'", 2)
101 | elseif type(self[method]) ~= "function" then
102 | error("Usage: "..RegisterName.."(\"eventname\", \"methodname\"): 'methodname' - method '"..tostring(method).."' not found on self.", 2)
103 | end
104 |
105 | if select("#",...)>=1 then -- this is not the same as testing for arg==nil!
106 | local arg=select(1,...)
107 | regfunc = function(...) self[method](self,arg,...) end
108 | else
109 | regfunc = function(...) self[method](self,...) end
110 | end
111 | else
112 | -- function ref with self=object or self="addonId" or self=thread
113 | if type(self)~="table" and type(self)~="string" and type(self)~="thread" then
114 | error("Usage: "..RegisterName.."(self or \"addonId\", eventname, method): 'self or addonId': table or string or thread expected.", 2)
115 | end
116 |
117 | if select("#",...)>=1 then -- this is not the same as testing for arg==nil!
118 | local arg=select(1,...)
119 | regfunc = function(...) method(arg,...) end
120 | else
121 | regfunc = method
122 | end
123 | end
124 |
125 |
126 | if events[eventname][self] or registry.recurse<1 then
127 | -- if registry.recurse<1 then
128 | -- we're overwriting an existing entry, or not currently recursing. just set it.
129 | events[eventname][self] = regfunc
130 | -- fire OnUsed callback?
131 | if registry.OnUsed and first then
132 | registry.OnUsed(registry, target, eventname)
133 | end
134 | else
135 | -- we're currently processing a callback in this registry, so delay the registration of this new entry!
136 | -- yes, we're a bit wasteful on garbage, but this is a fringe case, so we're picking low implementation overhead over garbage efficiency
137 | registry.insertQueue = registry.insertQueue or setmetatable({},meta)
138 | registry.insertQueue[eventname][self] = regfunc
139 | end
140 | end
141 |
142 | -- Unregister a callback
143 | target[UnregisterName] = function(self, eventname)
144 | if not self or self==target then
145 | error("Usage: "..UnregisterName.."(eventname): bad 'self'", 2)
146 | end
147 | if type(eventname) ~= "string" then
148 | error("Usage: "..UnregisterName.."(eventname): 'eventname' - string expected.", 2)
149 | end
150 | if rawget(events, eventname) and events[eventname][self] then
151 | events[eventname][self] = nil
152 | -- Fire OnUnused callback?
153 | if registry.OnUnused and not next(events[eventname]) then
154 | registry.OnUnused(registry, target, eventname)
155 | end
156 | end
157 | if registry.insertQueue and rawget(registry.insertQueue, eventname) and registry.insertQueue[eventname][self] then
158 | registry.insertQueue[eventname][self] = nil
159 | end
160 | end
161 |
162 | -- OPTIONAL: Unregister all callbacks for given selfs/addonIds
163 | if UnregisterAllName then
164 | target[UnregisterAllName] = function(...)
165 | if select("#",...)<1 then
166 | error("Usage: "..UnregisterAllName.."([whatFor]): missing 'self' or \"addonId\" to unregister events for.", 2)
167 | end
168 | if select("#",...)==1 and ...==target then
169 | error("Usage: "..UnregisterAllName.."([whatFor]): supply a meaningful 'self' or \"addonId\"", 2)
170 | end
171 |
172 |
173 | for i=1,select("#",...) do
174 | local self = select(i,...)
175 | if registry.insertQueue then
176 | for eventname, callbacks in pairs(registry.insertQueue) do
177 | if callbacks[self] then
178 | callbacks[self] = nil
179 | end
180 | end
181 | end
182 | for eventname, callbacks in pairs(events) do
183 | if callbacks[self] then
184 | callbacks[self] = nil
185 | -- Fire OnUnused callback?
186 | if registry.OnUnused and not next(callbacks) then
187 | registry.OnUnused(registry, target, eventname)
188 | end
189 | end
190 | end
191 | end
192 | end
193 | end
194 |
195 | return registry
196 | end
197 |
198 |
199 | -- CallbackHandler purposefully does NOT do explicit embedding. Nor does it
200 | -- try to upgrade old implicit embeds since the system is selfcontained and
201 | -- relies on closures to work.
202 |
203 |
--------------------------------------------------------------------------------
/Source/AutoLayoutChanges.lua:
--------------------------------------------------------------------------------
1 | local addonName, addon = ...
2 |
3 | local L = LibStub("AceLocale-3.0"):GetLocale(addonName)
4 |
5 | local function getLayouts()
6 | local result = {}
7 | -- keep an eye on this function, its convenient for not needing to rebuild the entire GetLayouts, but does it spread taint?
8 | local layouts = EditModeManagerFrame:CreateLayoutTbls()
9 | for _, value in ipairs(layouts) do
10 | result[value.index] = value.layoutInfo.layoutName
11 | end
12 | return result
13 | end
14 |
15 | local categoryNames = {
16 | L["Solo"],
17 | L["Party"],
18 | RAID,
19 | }
20 |
21 | local categoryCodes = {
22 | "solo",
23 | "party",
24 | "raid",
25 | }
26 |
27 | local function getSelectedDB(selectedCategory, selectedSize, specid)
28 | if selectedCategory == 3 then
29 | return addon.db.char.AutoLayoutSwitching[specid.."raid"..selectedSize]
30 | else
31 | return addon.db.char.AutoLayoutSwitching[specid..categoryCodes[selectedCategory]]
32 | end
33 | end
34 |
35 | local function setSelectedDB(selectedCategory, selectedSize, specid, value)
36 | if selectedCategory == 3 then
37 | addon.db.char.AutoLayoutSwitching[specid.."raid"..selectedSize] = value
38 | else
39 | addon.db.char.AutoLayoutSwitching[specid..categoryCodes[selectedCategory]] = value
40 | end
41 | end
42 |
43 | function addon.GetLayoutChangeOptions()
44 | local options = {}
45 | options.description = {
46 | name = L["AUTO_LAYOUT_CHANGE_DESCRIPTION"],
47 | type = "description",
48 | fontSize = "medium",
49 | order = 0,
50 | }
51 | options.enabled = {
52 | name = "Enabled",
53 | type = "toggle",
54 | get = function(_) return addon.db.global.EMEOptions.raidSizeLayoutSwitching end,
55 | set = function(_, value) addon.db.global.EMEOptions.raidSizeLayoutSwitching = value end,
56 | order = 1,
57 | width = "full",
58 | }
59 |
60 | local order = 2
61 | for specIndex = 1, 4 do
62 | options["row"..specIndex] = {
63 | type = "group",
64 | args = {},
65 | width = "full",
66 | inline = true,
67 | name = "",
68 | hidden = function()
69 | local specid = C_SpecializationInfo.GetSpecializationInfo(specIndex)
70 | if specid and (specid ~= 0) then
71 | return false
72 | end
73 | return true
74 | end,
75 | }
76 | local selectedCategory = 1
77 | local selectedSize = 1
78 |
79 | options["row"..specIndex].args["spec"..specIndex.."category"] = {
80 | name = function()
81 | local _, specName = C_SpecializationInfo.GetSpecializationInfo(specIndex)
82 | if specName then
83 | return specName .. " - Group Type"
84 | end
85 | return "N/A"
86 | end,
87 | type = "select",
88 | values = categoryNames,
89 | hidden = function()
90 | local specid = C_SpecializationInfo.GetSpecializationInfo(specIndex)
91 | if specid and (specid ~= 0) then
92 | return false
93 | end
94 | return true
95 | end,
96 | order = order,
97 | set = function(_, value)
98 | selectedCategory = value
99 | end,
100 | get = function()
101 | return selectedCategory
102 | end,
103 | width = 0.8,
104 | }
105 | order = order + 1
106 |
107 | options["row"..specIndex].args["spec"..specIndex.."size"] = {
108 | name = "Group Size",
109 | desc = "You do not need to set a profile for every size, the next-smallest size will be used if nothing is set!",
110 | type = "range",
111 | min = 1,
112 | max = 40,
113 | step = 1,
114 | set = function(_, value)
115 | selectedSize = value
116 | end,
117 | get = function()
118 | return selectedSize
119 | end,
120 | width = 0.9,
121 | disabled = function()
122 | return selectedCategory ~= 3
123 | end,
124 | hidden = function()
125 | local specid = C_SpecializationInfo.GetSpecializationInfo(specIndex)
126 | if specid and (specid ~= 0) then
127 | return false
128 | end
129 | return true
130 | end,
131 | order = order,
132 | }
133 | order = order + 1
134 |
135 | options["row"..specIndex].args["spec"..specIndex.."layout"] = {
136 | name = "Selected Layout",
137 | type = "select",
138 | values = getLayouts,
139 | hidden = function()
140 | local specid = C_SpecializationInfo.GetSpecializationInfo(specIndex)
141 | if specid and (specid ~= 0) then
142 | return false
143 | end
144 | return true
145 | end,
146 | order = order,
147 | set = function(_, value)
148 | local specid = C_SpecializationInfo.GetSpecializationInfo(specIndex)
149 | setSelectedDB(selectedCategory, selectedSize, specid, value)
150 | end,
151 | get = function()
152 | local specid = C_SpecializationInfo.GetSpecializationInfo(specIndex)
153 | return getSelectedDB(selectedCategory, selectedSize, specid)
154 | end,
155 | width = 0.6,
156 | }
157 | order = order + 1
158 |
159 | options["row"..specIndex].args["spec"..specIndex.."redx"] = {
160 | name = "",
161 | type = "execute",
162 | func = function()
163 | local specid = C_SpecializationInfo.GetSpecializationInfo(specIndex)
164 | setSelectedDB(selectedCategory, selectedSize, specid)
165 | end,
166 | image = "interface/auctionframe/auctionhouse.blp",
167 | order = order,
168 | width = 0.2,
169 | imageCoords = {963/1024, 1009/1024, 1/1024, 47/1024},
170 | imageWidth = 23,
171 | imageHeight = 23,
172 | hidden = function()
173 | local specid = C_SpecializationInfo.GetSpecializationInfo(specIndex)
174 | if specid and (specid ~= 0) then
175 | return false
176 | end
177 | return true
178 | end,
179 | }
180 | order = order + 1
181 | end
182 | return options
183 | end
184 |
185 | local function getCurrentSetting(categoryIndex)
186 | local specIndex = C_SpecializationInfo.GetSpecialization()
187 | local specid = C_SpecializationInfo.GetSpecializationInfo(specIndex)
188 | local categoryCode = categoryCodes[categoryIndex]
189 | local raidSize = GetNumGroupMembers()
190 |
191 | if categoryIndex == 3 then
192 | for i = raidSize, 1, -1 do
193 | local db = addon.db.char.AutoLayoutSwitching[specid..categoryCode..i]
194 | if db then return db end
195 | end
196 | return nil
197 | end
198 | return addon.db.char.AutoLayoutSwitching[specid..categoryCode]
199 | end
200 |
201 | local function updateSetting(categoryIndex)
202 | local currentSetting = getCurrentSetting(categoryIndex)
203 | if currentSetting then
204 | if C_EditMode.GetLayouts().activeLayout == currentSetting then return end
205 | C_EditMode.SetActiveLayout(currentSetting)
206 | end
207 | end
208 |
209 | local function updateLayoutChoice()
210 | if not addon.db.global.EMEOptions.raidSizeLayoutSwitching then return end
211 | if C_SpecializationInfo.GetSpecialization() == 0 then return end
212 |
213 | if not IsInGroup() then
214 | updateSetting(1)
215 | return
216 | end
217 |
218 | if not IsInRaid() then
219 | updateSetting(2)
220 | return
221 | end
222 |
223 | updateSetting(3)
224 | end
225 |
226 | local function updateLayoutChoiceDelayed()
227 | C_Timer.After(2, updateLayoutChoice)
228 | end
229 |
230 | EventRegistry:RegisterFrameEventAndCallback("PLAYER_ENTERING_WORLD", updateLayoutChoice)
231 | EventRegistry:RegisterFrameEventAndCallback("GROUP_ROSTER_UPDATE", updateLayoutChoice)
232 | EventRegistry:RegisterFrameEventAndCallback("PLAYER_REGEN_ENABLED", updateLayoutChoice)
233 | EventRegistry:RegisterFrameEventAndCallback("TRAIT_CONFIG_UPDATED", updateLayoutChoiceDelayed)
234 | EventRegistry:RegisterFrameEventAndCallback("ACTIVE_TALENT_GROUP_CHANGED", updateLayoutChoiceDelayed)
--------------------------------------------------------------------------------
/Source/libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua:
--------------------------------------------------------------------------------
1 | --[[-----------------------------------------------------------------------------
2 | Checkbox Widget
3 | -------------------------------------------------------------------------------]]
4 | local Type, Version = "CheckBox", 26
5 | local AceGUI = LibStub and LibStub("AceGUI-3.0", true)
6 | if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end
7 |
8 | -- Lua APIs
9 | local select, pairs = select, pairs
10 |
11 | -- WoW APIs
12 | local PlaySound = PlaySound
13 | local CreateFrame, UIParent = CreateFrame, UIParent
14 |
15 | --[[-----------------------------------------------------------------------------
16 | Support functions
17 | -------------------------------------------------------------------------------]]
18 | local function AlignImage(self)
19 | local img = self.image:GetTexture()
20 | self.text:ClearAllPoints()
21 | if not img then
22 | self.text:SetPoint("LEFT", self.checkbg, "RIGHT")
23 | self.text:SetPoint("RIGHT")
24 | else
25 | self.text:SetPoint("LEFT", self.image, "RIGHT", 1, 0)
26 | self.text:SetPoint("RIGHT")
27 | end
28 | end
29 |
30 | --[[-----------------------------------------------------------------------------
31 | Scripts
32 | -------------------------------------------------------------------------------]]
33 | local function Control_OnEnter(frame)
34 | frame.obj:Fire("OnEnter")
35 | end
36 |
37 | local function Control_OnLeave(frame)
38 | frame.obj:Fire("OnLeave")
39 | end
40 |
41 | local function CheckBox_OnMouseDown(frame)
42 | local self = frame.obj
43 | if not self.disabled then
44 | if self.image:GetTexture() then
45 | self.text:SetPoint("LEFT", self.image,"RIGHT", 2, -1)
46 | else
47 | self.text:SetPoint("LEFT", self.checkbg, "RIGHT", 1, -1)
48 | end
49 | end
50 | AceGUI:ClearFocus()
51 | end
52 |
53 | local function CheckBox_OnMouseUp(frame)
54 | local self = frame.obj
55 | if not self.disabled then
56 | self:ToggleChecked()
57 |
58 | if self.checked then
59 | PlaySound(856) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_ON
60 | else -- for both nil and false (tristate)
61 | PlaySound(857) -- SOUNDKIT.IG_MAINMENU_OPTION_CHECKBOX_OFF
62 | end
63 |
64 | self:Fire("OnValueChanged", self.checked)
65 | AlignImage(self)
66 | end
67 | end
68 |
69 | --[[-----------------------------------------------------------------------------
70 | Methods
71 | -------------------------------------------------------------------------------]]
72 | local methods = {
73 | ["OnAcquire"] = function(self)
74 | self:SetType()
75 | self:SetValue(false)
76 | self:SetTriState(nil)
77 | -- height is calculated from the width and required space for the description
78 | self:SetWidth(200)
79 | self:SetImage()
80 | self:SetDisabled(nil)
81 | self:SetDescription(nil)
82 | end,
83 |
84 | -- ["OnRelease"] = nil,
85 |
86 | ["OnWidthSet"] = function(self, width)
87 | if self.desc then
88 | self.desc:SetWidth(width - 30)
89 | if self.desc:GetText() and self.desc:GetText() ~= "" then
90 | self:SetHeight(28 + self.desc:GetStringHeight())
91 | end
92 | end
93 | end,
94 |
95 | ["SetDisabled"] = function(self, disabled)
96 | self.disabled = disabled
97 | if disabled then
98 | self.frame:Disable()
99 | self.text:SetTextColor(0.5, 0.5, 0.5)
100 | SetDesaturation(self.check, true)
101 | if self.desc then
102 | self.desc:SetTextColor(0.5, 0.5, 0.5)
103 | end
104 | else
105 | self.frame:Enable()
106 | self.text:SetTextColor(1, 1, 1)
107 | if self.tristate and self.checked == nil then
108 | SetDesaturation(self.check, true)
109 | else
110 | SetDesaturation(self.check, false)
111 | end
112 | if self.desc then
113 | self.desc:SetTextColor(1, 1, 1)
114 | end
115 | end
116 | end,
117 |
118 | ["SetValue"] = function(self, value)
119 | local check = self.check
120 | self.checked = value
121 | if value then
122 | SetDesaturation(check, false)
123 | check:Show()
124 | else
125 | --Nil is the unknown tristate value
126 | if self.tristate and value == nil then
127 | SetDesaturation(check, true)
128 | check:Show()
129 | else
130 | SetDesaturation(check, false)
131 | check:Hide()
132 | end
133 | end
134 | self:SetDisabled(self.disabled)
135 | end,
136 |
137 | ["GetValue"] = function(self)
138 | return self.checked
139 | end,
140 |
141 | ["SetTriState"] = function(self, enabled)
142 | self.tristate = enabled
143 | self:SetValue(self:GetValue())
144 | end,
145 |
146 | ["SetType"] = function(self, type)
147 | local checkbg = self.checkbg
148 | local check = self.check
149 | local highlight = self.highlight
150 |
151 | local size
152 | if type == "radio" then
153 | size = 16
154 | checkbg:SetTexture(130843) -- Interface\\Buttons\\UI-RadioButton
155 | checkbg:SetTexCoord(0, 0.25, 0, 1)
156 | check:SetTexture(130843) -- Interface\\Buttons\\UI-RadioButton
157 | check:SetTexCoord(0.25, 0.5, 0, 1)
158 | check:SetBlendMode("ADD")
159 | highlight:SetTexture(130843) -- Interface\\Buttons\\UI-RadioButton
160 | highlight:SetTexCoord(0.5, 0.75, 0, 1)
161 | else
162 | size = 24
163 | checkbg:SetTexture(130755) -- Interface\\Buttons\\UI-CheckBox-Up
164 | checkbg:SetTexCoord(0, 1, 0, 1)
165 | check:SetTexture(130751) -- Interface\\Buttons\\UI-CheckBox-Check
166 | check:SetTexCoord(0, 1, 0, 1)
167 | check:SetBlendMode("BLEND")
168 | highlight:SetTexture(130753) -- Interface\\Buttons\\UI-CheckBox-Highlight
169 | highlight:SetTexCoord(0, 1, 0, 1)
170 | end
171 | checkbg:SetHeight(size)
172 | checkbg:SetWidth(size)
173 | end,
174 |
175 | ["ToggleChecked"] = function(self)
176 | local value = self:GetValue()
177 | if self.tristate then
178 | --cycle in true, nil, false order
179 | if value then
180 | self:SetValue(nil)
181 | elseif value == nil then
182 | self:SetValue(false)
183 | else
184 | self:SetValue(true)
185 | end
186 | else
187 | self:SetValue(not self:GetValue())
188 | end
189 | end,
190 |
191 | ["SetLabel"] = function(self, label)
192 | self.text:SetText(label)
193 | end,
194 |
195 | ["SetDescription"] = function(self, desc)
196 | if desc then
197 | if not self.desc then
198 | local f = self.frame:CreateFontString(nil, "OVERLAY", "GameFontHighlightSmall")
199 | f:ClearAllPoints()
200 | f:SetPoint("TOPLEFT", self.checkbg, "TOPRIGHT", 5, -21)
201 | f:SetWidth(self.frame.width - 30)
202 | f:SetPoint("RIGHT", self.frame, "RIGHT", -30, 0)
203 | f:SetJustifyH("LEFT")
204 | f:SetJustifyV("TOP")
205 | self.desc = f
206 | end
207 | self.desc:Show()
208 | --self.text:SetFontObject(GameFontNormal)
209 | self.desc:SetText(desc)
210 | self:SetHeight(28 + self.desc:GetStringHeight())
211 | else
212 | if self.desc then
213 | self.desc:SetText("")
214 | self.desc:Hide()
215 | end
216 | --self.text:SetFontObject(GameFontHighlight)
217 | self:SetHeight(24)
218 | end
219 | end,
220 |
221 | ["SetImage"] = function(self, path, ...)
222 | local image = self.image
223 | image:SetTexture(path)
224 |
225 | if image:GetTexture() then
226 | local n = select("#", ...)
227 | if n == 4 or n == 8 then
228 | image:SetTexCoord(...)
229 | else
230 | image:SetTexCoord(0, 1, 0, 1)
231 | end
232 | end
233 | AlignImage(self)
234 | end
235 | }
236 |
237 | --[[-----------------------------------------------------------------------------
238 | Constructor
239 | -------------------------------------------------------------------------------]]
240 | local function Constructor()
241 | local frame = CreateFrame("Button", nil, UIParent)
242 | frame:Hide()
243 |
244 | frame:EnableMouse(true)
245 | frame:SetScript("OnEnter", Control_OnEnter)
246 | frame:SetScript("OnLeave", Control_OnLeave)
247 | frame:SetScript("OnMouseDown", CheckBox_OnMouseDown)
248 | frame:SetScript("OnMouseUp", CheckBox_OnMouseUp)
249 |
250 | local checkbg = frame:CreateTexture(nil, "ARTWORK")
251 | checkbg:SetWidth(24)
252 | checkbg:SetHeight(24)
253 | checkbg:SetPoint("TOPLEFT")
254 | checkbg:SetTexture(130755) -- Interface\\Buttons\\UI-CheckBox-Up
255 |
256 | local check = frame:CreateTexture(nil, "OVERLAY")
257 | check:SetAllPoints(checkbg)
258 | check:SetTexture(130751) -- Interface\\Buttons\\UI-CheckBox-Check
259 |
260 | local text = frame:CreateFontString(nil, "OVERLAY", "GameFontHighlight")
261 | text:SetJustifyH("LEFT")
262 | text:SetHeight(18)
263 | text:SetPoint("LEFT", checkbg, "RIGHT")
264 | text:SetPoint("RIGHT")
265 |
266 | local highlight = frame:CreateTexture(nil, "HIGHLIGHT")
267 | highlight:SetTexture(130753) -- Interface\\Buttons\\UI-CheckBox-Highlight
268 | highlight:SetBlendMode("ADD")
269 | highlight:SetAllPoints(checkbg)
270 |
271 | local image = frame:CreateTexture(nil, "OVERLAY")
272 | image:SetHeight(16)
273 | image:SetWidth(16)
274 | image:SetPoint("LEFT", checkbg, "RIGHT", 1, 0)
275 |
276 | local widget = {
277 | checkbg = checkbg,
278 | check = check,
279 | text = text,
280 | highlight = highlight,
281 | image = image,
282 | frame = frame,
283 | type = Type
284 | }
285 | for method, func in pairs(methods) do
286 | widget[method] = func
287 | end
288 |
289 | return AceGUI:RegisterAsWidget(widget)
290 | end
291 |
292 | AceGUI:RegisterWidgetType(Type, Constructor, Version)
293 |
--------------------------------------------------------------------------------