diff --git a/Bindings.xml b/Bindings.xml index 6d28388..31f384a 100644 --- a/Bindings.xml +++ b/Bindings.xml @@ -18,6 +18,50 @@ <Binding name="TEAMMASTER" category="EMA"> --[[dummy]] </Binding> + <Binding name="CLICKTOMOVE" category="EMA"> + --[[dummy]] + </Binding> + <Binding name="MASTERFOCUS" header="ASTERISK" category="EMA"> + --[[dummy]] + </Binding> + <Binding name="MASTERTARGET" category="EMA"> + --[[dummy]] + </Binding> + <Binding name="MASTERASSIST" category="EMA"> + --[[dummy]] + </Binding> + <Binding name="FOCUS1" category="EMA-Set-Team-Focus"> + --[[dummy]] + </Binding> + <Binding name="FOCUS2" category="EMA-Set-Team-Focus"> + --[[dummy]] + </Binding> + <Binding name="FOCUS3" category="EMA-Set-Team-Focus"> + --[[dummy]] + </Binding> + <Binding name="FOCUS4" category="EMA-Set-Team-Focus"> + --[[dummy]] + </Binding> + <Binding name="FOCUS5" category="EMA-Set-Team-Focus"> + --[[dummy]] + </Binding> + <Binding name="FOCUS6" category="EMA-Set-Team-Focus"> + --[[dummy]] + </Binding> + <Binding name="FOCUS7" category="EMA-Set-Team-Focus"> + --[[dummy]] + </Binding> + <Binding name="FOCUS8" category="EMA-Set-Team-Focus"> + --[[dummy]] + </Binding> + <Binding name="FOCUS9" category="EMA-Set-Team-Focus"> + --[[dummy]] + </Binding> + <Binding name="FOCUS10" category="EMA-Set-Team-Focus"> + --[[dummy]] + </Binding> + + <!-- Follow Bindings--> <Binding name="FOLLOWME" header="FOLLOW" category="EMA"> --[[dummy]] @@ -28,68 +72,79 @@ <Binding name="FOLLOWSTROBEOFF" category="EMA"> --[[dummy]] </Binding> - <Binding name="FOLLOWTEAIN" category="EMA"> + <Binding name="FOLLOWSTOP" category="EMA"> + --[[dummy]] + </Binding> + + <Binding name="TEAMMOUNT" header="MOUNT" category="EMA"> --[[dummy]] - </Binding> + </Binding> + <!-- ItemUse Bindings--> - <Binding name="ITEMUSE1" header="ITEMUSE" category="EMA"> + <Binding name="ITEMUSE1" header="ITEMUSE" category="EMA-Item Use"> + --[[dummy]] + </Binding> + <Binding name="ITEMUSE2" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE2" category="EMA"> + <Binding name="ITEMUSE3" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE3" category="EMA"> + <Binding name="ITEMUSE4" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE4" category="EMA"> + <Binding name="ITEMUSE5" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE5" category="EMA"> + <Binding name="ITEMUSE6" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE6" category="EMA"> + <Binding name="ITEMUSE7" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE7" category="EMA"> + <Binding name="ITEMUSE8" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE8" category="EMA"> + <Binding name="ITEMUSE9" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE9" category="EMA"> + <Binding name="ITEMUSE10" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE10" category="EMA"> + <Binding name="ITEMUSE11" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE11" category="EMA"> + <Binding name="ITEMUSE12" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE12" category="EMA"> + <Binding name="ITEMUSE13" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE13" category="EMA"> + <Binding name="ITEMUSE14" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE14" category="EMA"> + <Binding name="ITEMUSE15" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE15" category="EMA"> + <Binding name="ITEMUSE16" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE16" category="EMA"> + <Binding name="ITEMUSE17" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE17" category="EMA"> + <Binding name="ITEMUSE18" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE18" category="EMA"> + <Binding name="ITEMUSE19" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE19" category="EMA"> + <Binding name="ITEMUSE20" category="EMA-Item Use"> --[[dummy]] </Binding> - <Binding name="ITEMUSE20" category="EMA"> + + <!-- Toon Bindings--> + <Binding name="SETVIEW" header="TOON" category="EMA"> --[[dummy]] </Binding> + </Bindings> diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 96ee9da..52a5128 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,7 +1,348 @@ --------------------------- ChangeLogs: --------------------------- -EMA Version: v9.0.1-Release-v3.1(0170) +EMA Version: Release-v4.1(0208) +Game Version: 9.2.0/2.5.2/1.1.14 +Release Date: 06/03/2022 + +## Core + --updated classic toc. + +## Information-Classic + -- should now save settings. + +## Guild Bank + -- Now Loads With TBBC + + + +--------------------------- +EMA Version: Release-v4.1(0207) +Game Version: 9.2.0/2.5.2/1.1.14 +Release Date: 06/03/2022 + +## Interaction + -- Fixed Team Mount in TBBC (again!) + -- come on please be fixxed! + + + + +--------------------------- +EMA Version: Release-v4.1(0206) +Game Version: 9.2.0/2.5.2/1.1.14 +Release Date: 05/03/2022 + +Updated TOC +Updated CopyRight Dates (Happy New Year) + + +## Interaction + -- Fixed Team Mount in Live (again!) + -- issue#63/#55 + -- Fixed issue #85 + +## Quest-Watcher + -- added a space Issue#60 + + + +--------------------------- +EMA Version: Release-v4.1(0205) +Game Version: 9.1.5/2.5.2/1.1.14 +Release Date: 11/12/2021 + +## Toon + --Fixed some errors in for classic/tbc + + +--------------------------- +EMA Version: Release-v4.1(0204) +Game Version: 9.1.5/2.5.2/1.1.14 +Release Date: 11/12/2021 + +## Core + -- Update Ace3 + -- Added Support for classic-era! + + + + +--------------------------- +EMA Version: Release-v4.1(0203) +Game Version: 9.1.5/2.5.2 +Release Date: 06/11/2021 + +-- Sorry am not playing wow, so everything i do is if i can, (rember i don't get paid for this) + +## interaction + -- Fixed a bug with mountWithTeam with retail issue #55 + +--------------------------- +EMA Version: Release-v4.0(0202) +Game Version: 9.1.0/2.5.1 +Release Date: 28/08/2021 + +## Team + -- Fixed Team Invite On TBCC + +## Quest-Tracker + -- Has Come Back From Was AWL + +## Communications + -- Seems 9.1 is running like classic/tbc on sending big data though channels. + +--------------------------- +EMA Version: Release-v4.0(0201) +Game Version: 9.1.0/2.5.1 +Release Date: 26/08/2021 + + +## Toon + -- Fixed a GuildBank funds to repair issue #50 (Jumped the gun on this one) + +## Interaction + -- Stoped Live Code leacking from Retail On Stop Fight! issue #51 + +## Quest-Wascher + -- Wrong Version Of quest-watcher for retail was packed in this Build. Issue #56 + + +--------------------------- +ChangeLogs: +--------------------------- +EMA Version: Release-v4.0(0200) +Game Version: 9.1.0/2.5.1 +Release Date: 22/08/2021 +--------------------------- + +## Core + -- Now supports Classic-TBC 2.5.1 EMA-BCC.toc for tbc, EMA-MainLine.toc + -- All Non Working Live stuff on TBC removed! + -- New Config/GUI Layout. + -- Public API Reworked! + -- Added A WOW_KeyBindings Button to Main Setting Page. + +## Communications + -- On Classic/Tbc When Sending Setting Table Data Over Non Guild Channels Will Send To Whisper + +## Item-Use + -- You Can Now use spells that the other team Members don't have without a Lua Error. + +## Toon + *TODO! + -- Added in loot options for tbc-classic + +## Trade + *TODO + -- Added a Keybinding To Accept Trade( must be pressed on all team members ) + +## Quest-Tracker + *TODO + -- Toggle EMA-Tracker with keybinding + -- Option to Hide Blizzard tracker olny when ema-tracker is showen. + +## Quest-Tracker-Classic (classic/tbc) + -- Has its own copy for classic tracking due to many api changes. + +## Quest-Classic (Classic/tbc) + -- Has its own copy for classic tracking due to many api changes. + -- Added Choose Best Quest Reward + +## Information-Classic + -- Has its own copy for classic tracking due to many api changes. + + +--------------------------- +EMA Version: v9.0.5-Release-v3.1(0189) +Game Version: 9.0.5 +Release Date: 11/03/2021 +--------------------------- + +## Quest-Watcher + -- fixed the watcher Alpha + +--------------------------- +EMA Version: v9.0.5-Release-v3.1(0188) +Game Version: 9.0.5 +Release Date: 11/03/2021 +--------------------------- + +*.TOC Bump + +--------------------------- +EMA Version: v9.0.2-Release-v3.1(0187) +Game Version: 9.0.2 +Release Date: 27/02/2021 + +##Core + +-- Esc key close the config screen, issue/pull #31 #43 + +## Quest Wacher + -- case sensitive error in scenarios and torghast part of the addon. ( pull request #34 ) + +## Quest + -- Fix #21 + +--------------------------- +EMA Version: v9.0.2-Release-v3.1(0186) +Game Version: 9.0.2 +Release Date: 27/02/2021 + +## Vender/Sell + -- Removed Destroying Of Items Due To Api Changes. + +--------------------------- +EMA Version: v9.0.2-Release-v3.1(0185) +Game Version: 9.0.2 +Release Date: 26/02/2021 + + +## Interaction + -- Fixed the Dismounting options issue #35 + -- Works with the keybindings as well. (Team not the master one) + +## Mail + -- Fixed Issue #41 Where gold would still send if shift key was held down. + +## follow + -- Added Request #45 + +--------------------------- +EMA Version: v9.0.2-Release-v3.1(0184) +Game Version: 9.0.2 +Release Date: 04/12/2020 + +## KeyBinding + -- Added a keybinding for "SetView" + +# Display-Team + -- Removed Artifact Power xp Bar ( if they add somthing like this it probs get all changed again ) + - so changed to "Gold". + -- Added Gold to the Display Team + +# Toon + -- Added A Setview Command With Or Without Team + - :) yes you olny have to press it on one toon + + + + + +--------------------------- +EMA Version: v9.0.2-Release-v3.1(0183) +Game Version: 9.0.2 +Release Date: 25/11/2020 + +# Quest + -- Fixed A non-Api change on Shadowlands quest givers when handing in mutiple quests . + + + + +--------------------------- +EMA Version: v9.0.2-Release-v3.1(0182) +Game Version: 9.0.2 +Release Date: 22/11/2020 + +## Team + -- Added New Set Focus KeyBindings to set the team members in the order they sit in the GUI + +## /Click macros + -- Made some easyer to work with see doc at: + https://github.com/ebonyfaye/ema/wiki/Click-Macros + + +--------------------------- +EMA Version: v9.0.2-Release-v3.1(0181) +Game Version: 9.0.2 +Release Date: 20/11/2020 + +## Interaction + --Undo the mount change in (0180) + -- New Mount Option + -New command: "/ema-interaction mount <Tag>" + - New KeyBinding, now calls "/ema-interaction mount all" + - Will Now tell the team to summon a "Random Favorite Mount" (everyone summons there own random mount) + -- Dev note: This works with with shift!!!!!!!. + -- You do not need to Have the settings ticked in the options to copy mount! + +--------------------------- +EMA Version: v9.0.2-Release-v3.1(0180) +Game Version: 9.0.2 +Release Date: 19/11/2020 + +## Interaction + --Added a keybinding to mount from you "Summon Random Favorite Mount" ( you need mount team on for the team to copy ) request #20 + +--------------------------- +EMA Version: v9.0.2-Release-v3.1(0179) +Game Version: 9.0.2 +Release Date: 19/11/2020 + +## Follow + SNW now works again (less follow borken spam!) + /ema-follow me and KeyBinding + -- No Longer spams follow borken when you change Follow Target. + -- No Longer Trys to follow it self in "Vehicle" + + + +--------------------------- +EMA Version: v9.0.2-Release-v3.1(0178) +Game Version: 9.0.2 +Release Date: 18/11/2020 + +## Core + -- Updated Ace3 + -- Updated Ace3-SharedMediaWidgets + +## Information + --Fixed a lua error from changes with the new patch + +--------------------------- +EMA Version: v9.0.1-Release-v3.1(0175) +Game Version: 9.0.1 +Release Date: 13/11/2020 + +## Team + -- Added A new KeyBinding Toggle Click To Move. + -- Added A new CommadLine "/ema-team ctm <group>" + - dev note: (this is a non-boardcasting key to toggle) as well u can set + groups if use the commandline /ema-team ctm <group>, it will not toggle it "on" the the window you send the command from. + (master free) but it will turn it off so if u change windows it will change. + + +--------------------------- +EMA Version: v9.0.1-Release-v3.1(0174) +Game Version: 9.0.1 +Release Date: 11/11/2020 + +## Team + -- Added 3 New KeyBindings + -- Focus Master + -- Target Master + -- Assist Master + -dev note: They will need to be pressed on every Character by "hand"/Window as well they will not update in combat. + + -- You can use /click in custom macros + /click EMAAssistMaster + /click EMATargetMaster + /click EMAFocusMaster + +--------------------------- +EMA Version: v9.0.1-Release-v3.1(0173) +Game Version: 9.0.1 +Release Date: 10/11/2020 + +## Follow + -- Added a new command to stop follow your current Target. + -- KeyBinding can be set the normal way. + -- /ema-follow stop all + +--------------------------- +EMA Version: v9.0.1-Release-v3.1(0170/0171) Game Version: 9.0.1 Release Date: 07/11/2020 diff --git a/Core/Communications.lua b/Core/Communications.lua index dd85fa7..43ebb66 100644 --- a/Core/Communications.lua +++ b/Core/Communications.lua @@ -149,7 +149,7 @@ local function CreateCommandToSend( moduleName, commandName, ... ) message = message..commandName..EMA.COMMAND_SEPERATOR -- Add any arguments to the message (serialized and seperated). local numberArguments = select( "#", ... ) - + --EMA:Print("makecommand", numberArguments, "command",... ) for iterateArguments = 1, numberArguments do local argument = select( iterateArguments, ... ) message = message..AceSerializer:Serialize( argument ) @@ -174,7 +174,7 @@ end local function DefaultCommand( message ) local channel = nil - -- toon has to be in a group + -- toon has to be in a group if UnitInBattleground( "player" ) then channel = "INSTANCE_CHAT" elseif IsInGroup() then @@ -199,7 +199,7 @@ local function DefaultCommand( message ) end end end - --EMA:Print( "CHANNEL", channel) + --EMA:Print( "CHANNEL", channel) if channel then EMA:DebugMessage("Sending command to group.", message, "channel", channel, nil) --EMA:Print("Sending command to group.", message, "channel", channel, nil) @@ -244,12 +244,36 @@ local function CommandAll( moduleName, commandName, ... ) end end --- Should this get removed at some point and use all comms on one channel??? --- WHISPER's don't work cross-realm but do work connected-realm so sending msg to masters would not send. --- TODO: Maybe remove masters???, and fall back to everyone being the master? --- Not really sure what to do so for now will keep with the master, and whisper them, --- if was to use party/raid then everyone will get the command and masters would not work. +-- Classic/tbc Due to a Slow/nonsending Comms in party/raid when Sending settings Tables we need fall over Whisper/Guild +local function CommandSettings( moduleName, commandName, ... ) +--[[ + if EMAPrivate.Core.isEmaClassicBuild() == false then + CommandAll( moduleName, commandName, ... ) + else +]] + local message = CreateCommandToSend( moduleName, commandName, ... ) + if EMA.db.useGuildComms == true then + CommandGuild( message ) + else + for characterName, characterOrder in EMAPrivate.Team.TeamList() do + EMA:DebugMessage( "Toon not in party:", characterName) + if IsCharacterOnline( characterName ) == true then + EMA:DebugMessage("Sending command to others not in party/raid.", message, "WHISPER", characterName) + EMA:SendCommMessage( + EMA.COMMAND_PREFIX, + message, + EMA.COMMUNICATION_WHISPER, + characterName, + EMA.COMMUNICATION_PRIORITY_BULK + ) + --EMA:Print("testWis", EMA.COMMAND_PREFIX, EMA.COMMUNICATION_WHISPER, characterName , EMA.COMMUNICATION_PRIORITY_ALERT) + end + end + end +-- end +end +-- Is This is use? -- Send a command to the master. local function CommandMaster( moduleName, commandName, ... ) EMA:DebugMessage( "Command Master: ", moduleName, commandName, ... ) @@ -269,7 +293,8 @@ local function CommandMaster( moduleName, commandName, ... ) end end --- Send a command to the master. +-- Is This is use? +-- Send a command to the Toon. local function CommandToon( moduleName, characterName, commandName, ... ) -- Get the message to send. local message = CreateCommandToSend( moduleName, commandName, ... ) @@ -342,6 +367,7 @@ function EMA:CommandReceived( prefix, message, distribution, sender ) local argumentsTableSerialized = { strsplit( EMA.COMMAND_ARGUMENT_SEPERATOR, argumentsStringSerialized ) } for index, argumentSerialized in ipairs( argumentsTableSerialized ) do local success, argument = AceSerializer:Deserialize( argumentSerialized ) + --EMA:Print("testSerialized", success, argument ) if success == true then table.insert( argumentsTable, argument ) else @@ -372,7 +398,7 @@ end local function SendSettings( moduleName, settings ) -- Send a push settings command to all. --EMA:Print("test", moduleName, EMA.COMMAND_INTERNAL_SEND_SETTINGS, settings ) - CommandAll( moduleName, EMA.COMMAND_INTERNAL_SEND_SETTINGS, settings ) + CommandSettings( moduleName, EMA.COMMAND_INTERNAL_SEND_SETTINGS, settings ) end -- Command all members of the current team. diff --git a/Core/Core.lua b/Core/Core.lua index f7ef5cf..9556a3e 100644 --- a/Core/Core.lua +++ b/Core/Core.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -39,7 +39,7 @@ EMA.moduleIcon = "Interface\\Addons\\EMA\\Media\\NewsIcon.tga" EMA.pofileIcon = "Interface\\Addons\\EMA\\Media\\SettingsIcon.tga" -- order EMA.moduleOrder = 1 - +local version = GetAddOnMetadata("EMA", "version") -- Load libraries. local AceGUI = LibStub("AceGUI-3.0") @@ -52,8 +52,9 @@ EMAPrivate.SettingsFrame = {} EMAPrivate.SettingsFrame.Widget = AceGUI:Create( "EMAWindow" ) EMAPrivate.SettingsFrame.Widget:SetTitle( "" ) EMAPrivate.SettingsFrame.Widget:SetStatusText(L["STATUSTEXT"]) -EMAPrivate.SettingsFrame.Widget:SetWidth(900) -EMAPrivate.SettingsFrame.Widget:SetHeight(800) +EMAPrivate.SettingsFrame.Widget:EnableResize( false ) +EMAPrivate.SettingsFrame.Widget:SetWidth(800) +EMAPrivate.SettingsFrame.Widget:SetHeight(700) EMAPrivate.SettingsFrame.Widget:SetLayout( "Fill" ) EMAPrivate.SettingsFrame.WidgetTree = AceGUI:Create( "EMATreeGroup" ) EMAPrivate.SettingsFrame.WidgetTree:SetLayout( "Fill" ) @@ -93,7 +94,7 @@ local function InitializePopupDialogs() exclusive = 1, hideOnEscape = 1, whileDead = 1, - } + } StaticPopupDialogs["CAN_NOT_RUN_JAMBA_AND_EMA"] = { text = L["CAN_NOT_RUN_JAMBA_AND_EMA"], button1 = OKAY, @@ -106,7 +107,7 @@ local function InitializePopupDialogs() exclusive = 1, hideOnEscape = 0, whileDead = 1, - } + } StaticPopupDialogs["UpgradeTo_v2"] = { text = L["v2_NEWS"], button1 = OKAY, @@ -121,7 +122,7 @@ local function InitializePopupDialogs() } end -local function EMASettingsTreeSort( a, b ) +local function EmaSettingsTreeSort( a, b ) local aText = "" local bText = "" local aEMAOrder = 0 @@ -148,7 +149,7 @@ local function EMASettingsTreeSort( a, b ) return aEMAOrder < bEMAOrder end -local function EMATreeGroupTreeGetParent( parentName ) +local function EmaTreeGroupTreeGetParent( parentName ) local parent for index, tableInfo in ipairs( EMAPrivate.SettingsFrame.Tree.Data ) do if tableInfo.value == parentName then @@ -158,35 +159,35 @@ local function EMATreeGroupTreeGetParent( parentName ) return parent end -local function EMAAddModuleToSettings( childName, parentName, moduleIcon, order, moduleFrame ) +local function EmaAddModuleToSettings( childName, parentName, moduleIcon, order, moduleFrame ) -- childName is the parentName then make the child the parent. if childName == parentName then - local parent = EMATreeGroupTreeGetParent( parentName ) + local parent = EmaTreeGroupTreeGetParent( parentName ) if parent == nil then table.insert( EMAPrivate.SettingsFrame.Tree.Data, { value = childName, text = childName, EMAOrder = order, icon = moduleIcon } ) - table.sort( EMAPrivate.SettingsFrame.Tree.Data, EMASettingsTreeSort ) + table.sort( EMAPrivate.SettingsFrame.Tree.Data, EmaSettingsTreeSort ) EMAPrivate.SettingsFrame.Tree.ModuleFrames[childName] = moduleFrame end else - local parent = EMATreeGroupTreeGetParent( parentName ) + local parent = EmaTreeGroupTreeGetParent( parentName ) if parent == nil then table.insert( EMAPrivate.SettingsFrame.Tree.Data, { value = parentName, text = parentName, EMAOrder = order } ) end - local parent = EMATreeGroupTreeGetParent( parentName ) + local parent = EmaTreeGroupTreeGetParent( parentName ) if parent.children == nil then parent.children = {} end table.insert( parent.children, { value = childName, text = childName, EMAOrder = order, icon = moduleIcon } ) - table.sort( EMAPrivate.SettingsFrame.Tree.Data, EMASettingsTreeSort ) - table.sort( parent.children, EMASettingsTreeSort ) + table.sort( EMAPrivate.SettingsFrame.Tree.Data, EmaSettingsTreeSort ) + table.sort( parent.children, EmaSettingsTreeSort ) EMAPrivate.SettingsFrame.Tree.ModuleFrames[childName] = moduleFrame end end -local function EMAModuleSelected( tree, event, treeValue, selected ) +local function EmaModuleSelected( tree, event, treeValue, selected ) --EMA:Print("test", tree, event, treeValue, selected) local parentValue, value = strsplit( "\001", treeValue ) if tree == nil and event == nil then @@ -209,34 +210,33 @@ local function EMAModuleSelected( tree, event, treeValue, selected ) moduleFrame.frame:SetAllPoints() moduleFrame.frame:Show() EMAPrivate.SettingsFrame.Tree.CurrentChild = moduleFrame - if value == L["OPTIONS"] then + if value == L["OPTIONS"] then LibStub( "AceConfigDialog-3.0" ):Open( EMA.moduleName..L["OPTIONS"], moduleFrame ) - end + end return end end end + EMAPrivate.SettingsFrame.Tree = {} EMAPrivate.SettingsFrame.Tree.Data = {} EMAPrivate.SettingsFrame.Tree.ModuleFrames = {} EMAPrivate.SettingsFrame.Tree.CurrentChild = nil -EMAPrivate.SettingsFrame.Tree.Add = EMAAddModuleToSettings -EMAPrivate.SettingsFrame.Tree.ButtonClick = EMAModuleSelected +EMAPrivate.SettingsFrame.Tree.Add = EmaAddModuleToSettings +EMAPrivate.SettingsFrame.Tree.ButtonClick = EmaModuleSelected EMAPrivate.SettingsFrame.WidgetTree:SetTree( EMAPrivate.SettingsFrame.Tree.Data ) EMAPrivate.SettingsFrame.WidgetTree:SetCallback( "OnClick", EMAPrivate.SettingsFrame.Tree.ButtonClick ) EMAPrivate.SettingsFrame.Widget:Hide() ---table.insert( UISpecialFrames, "EMASettingsWindowsFrame" ) -- Settings - the values to store and their defaults for the settings database. EMA.settings = { global = { - ['**'] = { - showStartupMessage8000 = false, - showStartupMessage2000 = true, - showStartupMessage3000 = true - }, + showStartupMessage8000 = false, + showStartupMessage2000 = false, + showStartupMessage3000 = false, }, profile = { + useGlobalSettings = true, }, } @@ -284,7 +284,6 @@ local function GetConfiguration() } return configuration end - -- Get a settings value. function EMA:ConfigurationGetSetting( key ) return EMA.db[key[#key]] @@ -299,17 +298,6 @@ local function DebugMessage( ... ) EMA:Print( ... ) end ---WOW BetaBuild! -local function isBetaBuild() - local _, _, _, tocversion = GetBuildInfo() - -- Build For BFA 8.0.1 2018 - if tocversion >= 80000 then - return true - else - return false - end -end - --Ema Alpha local function isEmaAlphaBuild() local EMAVersion = GetAddOnMetadata("EMA", "version") @@ -321,11 +309,37 @@ local function isEmaAlphaBuild() return false end end +-- EMA classic build +local function isEmaClassicBuild() + local classic = false + -- Classic + if _G.WOW_PROJECT_ID == _G.WOW_PROJECT_CLASSIC then + classic = true + end + return classic +end + +-- EMA TBC Build +local function isEmaClassicBccBuild() + local classic = false + if _G.WOW_PROJECT_ID == _G.WOW_PROJECT_BURNING_CRUSADE_CLASSIC then + classic = true + end + -- Classic + if _G.WOW_PROJECT_ID == _G.WOW_PROJECT_CLASSIC then + classic = true + end + return classic +end ------------------------------------------------------------------------------------------------------------- -- Module management. ------------------------------------------------------------------------------------------------------------- +local function globalSetting() + return EMA.db.useGlobalSettings +end + -- Register a EMA module. local function RegisterModule( moduleAddress, moduleName ) if EMA.registeredModulesByName == nil then @@ -388,13 +402,13 @@ function EMA:SendSettingsAllModules() end end - ------------------------------------------------------------------------------------------------------------- -- Commands sending and receiving. ------------------------------------------------------------------------------------------------------------- -- Send a command for the module specified (using its address) to other EMA Team characters. local function SendCommandToTeam( moduleAddress, commandName, ... ) + --EMA:Print("test", moduleAddress, commandName) -- Get the name of the module. local moduleName = EMA.registeredModulesByAddress[moduleAddress] -- Send the command identified by the module name. @@ -570,23 +584,13 @@ function EMA:OnInitialize() -- Create the settings frame. EMA:CoreSettingsCreate() EMA.settingsFrame = EMA.settingsControl.widgetSettings.frame - -- TODO DO WE NEED THIS ?????? - --[[ - -- Blizzard options frame. - local frame = CreateFrame( "Frame" ) - frame.name = L["EMA"] - local button = CreateFrame( "Button", nil, frame, "OptionsButtonTemplate" ) - button:SetPoint( "CENTER" ) - button:SetText( "/EMA" ) - button:SetScript( "OnClick", EMA.LoadEMASettings ) - InterfaceOptions_AddCategory( frame ) - ]] -- Create the settings profile support. LibStub( "AceConfig-3.0" ):RegisterOptionsTable( EMA.moduleName..L["OPTIONS"], LibStub( "AceDBOptions-3.0" ):GetOptionsTable( EMA.completeDatabase ) ) local profileContainerWidget = AceGUI:Create( "ScrollFrame" ) + --local profileContainerWidget = AceGUI:Create( "Frame" ) profileContainerWidget:SetLayout( "Fill" ) -- We need this to make it a working Module local order = 10 @@ -595,9 +599,11 @@ function EMA:OnInitialize() -- Register the core as a module. RegisterModule( EMA, EMA.moduleName ) -- Register the chat command. - EMA:RegisterChatCommand( EMA.chatCommand, "EMAChatCommand" ) + EMA:RegisterChatCommand( EMA.chatCommand, "EMAChatCommand" ) + -- Populate the settings. + EMA:SettingsRefresh() end - +--[[ function EMA:LoadEMAModule( moduleName ) local loaded, reason = LoadAddOn( moduleName ) if not loaded then @@ -606,10 +612,10 @@ function EMA:LoadEMAModule( moduleName ) end end end - +]] function EMA:CoreSettingsCreateInfo( top ) -- Get positions and dimensions. - local buttonPushAllSettingsWidth = 200 + local buttonWidth = 200 local buttonHeight = EMAHelperSettings:GetButtonHeight() local checkBoxHeight = EMAHelperSettings:GetCheckBoxHeight() local radioBoxHeight = EMAHelperSettings:GetRadioBoxHeight() @@ -632,186 +638,61 @@ function EMA:CoreSettingsCreateInfo( top ) local movingTop = top -- A blank to get layout to show right? EMAHelperSettings:CreateHeading( EMA.settingsControl, L[""], movingTop, false ) - movingTop = movingTop - headingHeight + --Main Heading + movingTop = movingTop - checkBoxHeight EMAHelperSettings:CreateHeading( EMA.settingsControl, L["STATUSTEXT"], movingTop, false ) movingTop = movingTop - headingHeight - EMA.settingsControl.labelInformation1 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["ME"] - ) - movingTop = movingTop + movingTop * 2 - EMAHelperSettings:CreateHeading( EMA.settingsControl, L["RELEASE_NOTES"]..GetAddOnMetadata("EMA", "version") , movingTop, false ) - movingTop = movingTop - headingHeight - EMA.settingsControl.labelInformation10 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["TEXT1"] - ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation11 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["TEXT2"] - ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation12 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["TEXT3"] - ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation13 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["TEXT4"] - ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation14 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["TEXT5"] - ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation15 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["TEXT6"] - ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation16 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["TEXT7"] - ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation17 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["TEXT8"] - ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation18 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["TEXT9"] - ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation19 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["TEXT10"] - ) - --movingTop = movingTop - labelContinueHeight - -- Useful websites Heading - movingTop = movingTop - labelContinueHeight * 2 - EMAHelperSettings:CreateHeading( EMA.settingsControl, L["WEBSITES"], movingTop, false ) - movingTop = movingTop - headingHeight - EMA.settingsControl.labelInformation30 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["TEMP_WEBSITE1"] - ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation21 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["ME_TWITTER"] - - ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation22 = EMAHelperSettings:CreateContinueLabel( + EMA.settingsControl.labelInformation2 = EMAHelperSettings:CreateContinueLabel( EMA.settingsControl, headingWidth, - column2Left, + left, movingTop, - L["D-B"] + L["VERSION"]..L[": "]..version ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation23 = EMAHelperSettings:CreateContinueLabel( + movingTop = movingTop - labelHeight + EMA.settingsControl.labelInformation1 = EMAHelperSettings:CreateContinueLabel( EMA.settingsControl, headingWidth, - column2Left, + left, movingTop, - L["ISB"] + L["ME"] ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation24 = EMAHelperSettings:CreateContinueLabel( + movingTop = movingTop - labelHeight + EMA.settingsControl.labelInformation2 = EMAHelperSettings:CreateContinueLabel( EMA.settingsControl, headingWidth, - column2Left, + left, movingTop, - L["TEMP_WEBSITE2"] + L["ME_TWITTER"] ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation25 = EMAHelperSettings:CreateContinueLabel( + + movingTop = movingTop - labelHeight * 14 + EMA.settingsControl.buttonKeyBindings = EMAHelperSettings:CreateButton( EMA.settingsControl, - headingWidth, - column2Left, + buttonWidth, + left, movingTop, - L["TEMP_WEBSITE3"] + L["KEY_BINDINGS"], + EMA.SettingsKeyBindingsCommandClick ) -- Special thanks Heading - movingTop = movingTop - buttonHeight + movingTop = movingTop - buttonHeight * 1 EMAHelperSettings:CreateHeading( EMA.settingsControl, L["SPECIAL_THANKS"], movingTop, false ) movingTop = movingTop - headingHeight EMA.settingsControl.labelInformation20 = EMAHelperSettings:CreateContinueLabel( EMA.settingsControl, headingWidth, - column2Left, + left, movingTop, L["THANKS1"] ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation21 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["THANKS2"] - - ) - movingTop = movingTop - labelContinueHeight - EMA.settingsControl.labelInformation22 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - column2Left, - movingTop, - L["THANKS3"] - ) --CopyRight heading - movingTop = movingTop - labelContinueHeight * 4 + movingTop = movingTop - labelContinueHeight * 3 EMA.settingsControl.labelInformation40 = EMAHelperSettings:CreateContinueLabel( EMA.settingsControl, headingWidth, - column2Left, + left, movingTop, L["COPYRIGHT"] ) @@ -819,7 +700,7 @@ function EMA:CoreSettingsCreateInfo( top ) EMA.settingsControl.labelInformation41 = EMAHelperSettings:CreateContinueLabel( EMA.settingsControl, headingWidth, - column2Left, + left, movingTop, L["COPYRIGHTTWO"] ) @@ -852,6 +733,7 @@ function EMA:OnEMAProfileChanged() end function EMA:SettingsRefresh() + --EMA.settingsControl.checkBoxGlobalSettings:SetValue( EMA.db.useGlobalSettings ) end -- Core settings received. @@ -859,9 +741,6 @@ function EMA:EMAOnSettingsReceived( characterName, settings ) --Checks character is not the the character that send the settings. Now checks the character has a realm on there name to match EMA team list. --characterName = EMAUtilities:AddRealmToNameIfMissing( characterName ) if characterName ~= EMA.characterName then - -- Update the settings. - -- TODO: What is this minimap icon? - EMA.db.showMinimapIcon = settings.showMinimapIcon -- Refresh the settings. EMA:SettingsRefresh() -- Tell the player. @@ -869,13 +748,10 @@ function EMA:EMAOnSettingsReceived( characterName, settings ) end end ---[[ -function EMA:LoadEMASettings() - InterfaceOptionsFrameCancel_OnClick() - HideUIPanel( GameMenuFrame ) - EMA:EMAChatCommand( "" ) +function EMA:SettingsKeyBindingsCommandClick( event ) + KeyBindingFrame_LoadUI() + ShowUIPanel(KeyBindingFrame) end -]] -- Does the Chat Command Exist local function DoesTheChatCommandExist( configuration, command ) @@ -927,13 +803,19 @@ end function EMA:ResetSettingsFrame() EMA:Print( L["FRAME_RESET"] ) - EMAPrivate.SettingsFrame.Widget:SetPoint("TOPLEFT", 0, 0) - EMAPrivate.SettingsFrame.Widget:SetWidth(900) - EMAPrivate.SettingsFrame.Widget:SetHeight(800) + EMAPrivate.SettingsFrame.Widget:SetPoint("CENTER", 0, 0) + EMAPrivate.SettingsFrame.Widget:SetWidth(800) + EMAPrivate.SettingsFrame.Widget:SetHeight(700) EMAPrivate.SettingsFrame.Widget:Show() end -function EMA:SettingsTestBox( event, checked) +function EMA:SettingsToggleGlobalSettings( event, checked ) + EMA.db.useGlobalSettings = checked + StaticPopup_Show( "MUST_RELOAD_UI" ) + EMA:SettingsRefresh() +end + +function EMA:SettingsTestBox( event, checked ) print("test", checked , EMA.db.testBox) EMA.db.testBox = checked EMA:SettingsRefresh() @@ -941,6 +823,7 @@ function EMA:SettingsTestBox( event, checked) end -- Functions available from EMA Core for other EMA internal objects. +EMAPrivate.Core.globalSetting = globalSetting EMAPrivate.Core.RegisterModule = RegisterModule EMAPrivate.Core.UnRegisterModule = UnRegisterModule EMAPrivate.Core.SendSettings = SendSettings @@ -949,6 +832,9 @@ EMAPrivate.Core.SendCommandToTeam = SendCommandToTeam EMAPrivate.Core.SendCommandToMaster = SendCommandToMaster EMAPrivate.Core.SendCommandToToon = SendCommandToToon EMAPrivate.Core.OnCommandReceived = OnCommandReceived -EMAPrivate.Core.isBetaBuild = isBetaBuild +EMAPrivate.Core.isEmaClassicBuild = isEmaClassicBuild +EMAPrivate.Core.isEmaClassicBccBuild = isEmaClassicBccBuild + EMAPrivate.Core.isEmaAlphaBuild = isEmaAlphaBuild -EMAPrivate.Core.SendSettingsAllModules = EMA.SendSettingsAllModules \ No newline at end of file +EMAPrivate.Core.SendSettingsAllModules = EMA.SendSettingsAllModules +EMAPrivate.Core.RefreshSettingsAllModules = EMA.RefreshSettingsAllModules \ No newline at end of file diff --git a/Core/Message.lua b/Core/Message.lua index 6a184eb..6b2e7b7 100644 --- a/Core/Message.lua +++ b/Core/Message.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- diff --git a/Core/Module.lua b/Core/Module.lua index 3edcac6..fdcba4a 100644 --- a/Core/Module.lua +++ b/Core/Module.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- diff --git a/Core/Tag.lua b/Core/Tag.lua index 4739eb4..e9356bd 100644 --- a/Core/Tag.lua +++ b/Core/Tag.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- diff --git a/Core/Team.lua b/Core/Team.lua index e4f4527..2e231ca 100644 --- a/Core/Team.lua +++ b/Core/Team.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -38,10 +38,29 @@ EMA.moduleOrder = 20 -- EMA key bindings. -BINDING_HEADER_TEAM = L["TEAM"] BINDING_NAME_TEAMINVITE = L["INVITE_GROUP"] BINDING_NAME_TEAMDISBAND = L["DISBAND_GROUP"] BINDING_NAME_TEAMMASTER = L["SET_MASTER"] +BINDING_NAME_CLICKTOMOVE = L["BINDING_CLICK_TO_MOVE"] +BINDING_NAME_MASTERFOCUS = L["SET_FOCUS_MASTER"] +BINDING_NAME_MASTERTARGET = L["SET_MASTER_TARGET"] +BINDING_NAME_MASTERASSIST = L["SET_MASTER_ASSIST"] +-- EMA Focus key bindings +BINDING_NAME_FOCUS1 = L["SET_FOCUS_ONE"] +BINDING_NAME_FOCUS2 = L["SET_FOCUS_TWO"] +BINDING_NAME_FOCUS3 = L["SET_FOCUS_THREE"] +BINDING_NAME_FOCUS4 = L["SET_FOCUS_FOUR"] +BINDING_NAME_FOCUS5 = L["SET_FOCUS_FIVE"] +BINDING_NAME_FOCUS6 = L["SET_FOCUS_SIX"] +BINDING_NAME_FOCUS7 = L["SET_FOCUS_SEVEN"] +BINDING_NAME_FOCUS8 = L["SET_FOCUS_EIGHT"] +BINDING_NAME_FOCUS9 = L["SET_FOCUS_NINE"] +BINDING_NAME_FOCUS10 = L["SET_FOCUS_TEN"] + + +--Headers +BINDING_HEADER_TEAM = L["TEAM"] +BINDING_HEADER_ASTERISK = L["FAKE_KEY_BINDING"] -- Settings - the values to store and their defaults for the settings database. EMA.settings = { @@ -157,6 +176,14 @@ function EMA:GetConfiguration() get = false, set = "SetAllMembersOnline", }, + ctm = { + type = "input", + name = L["COMMANDLINE_CLICK_TO_MOVE"], + desc = L["COMMANDLINE_CLICK_TO_MOVE_HELP"], + usage = "/ema-team ctm <group>", + get = false, + set = "CommandClickToMove", + }, push = { type = "input", name = L["PUSH_SETTINGS"], @@ -186,6 +213,7 @@ EMA.COMMAND_SET_MASTER = "EMATeamSetMaster" -- Set Minion OffLine EMA.COMMAND_SET_OFFLINE = "EMATeamSetOffline" EMA.COMMAND_SET_ONLINE = "EMATeamSetOnline" +EMA.COMMAND_CLICK_TO_MOVE = "EMAClickToMove" ------------------------------------------------------------------------------------------------------------- @@ -218,9 +246,9 @@ EMA.simpleAreaList = {} local function SettingsCreateTeamList() -- Position and size constants. - local teamListButtonControlWidth = 250 + local teamListButtonControlWidth = 200 local iconSize = 24 - local groupListWidth = 200 + local groupListWidth = 150 local extaSpacing = 40 local rowHeight = 30 local rowsToDisplay = 8 @@ -259,8 +287,8 @@ local function SettingsCreateTeamList() EMA.settingsControl.labelTwo = EMAHelperSettings:CreateContinueLabel( EMA.settingsControl, teamListButtonControlWidth, - - teamListButtonControlWidth + iconSize + groupListWidth, + teamListWidth / 2, + teamListButtonControlWidth + iconSize + groupListWidth + 100, leftOfList, L["GROUPS_HEADER"] ) @@ -273,17 +301,21 @@ local function SettingsCreateTeamList() list.listWidth = teamListWidth list.rowHeight = rowHeight list.rowsToDisplay = rowsToDisplay - list.columnsToDisplay = 3 + list.columnsToDisplay = 4 list.columnInformation = {} list.columnInformation[1] = {} - list.columnInformation[1].width = 30 + list.columnInformation[1].width = 35 list.columnInformation[1].alignment = "LEFT" list.columnInformation[2] = {} - list.columnInformation[2].width = 55 - list.columnInformation[2].alignment = "CENTER" + list.columnInformation[2].width = 30 + list.columnInformation[2].alignment = "LEFT" list.columnInformation[3] = {} list.columnInformation[3].width = 15 - list.columnInformation[3].alignment = "RIGHT" + list.columnInformation[3].alignment = "LEFT" + list.columnInformation[4] = {} + list.columnInformation[4].width = 15 + list.columnInformation[4].alignment = "LEFT" + list.scrollRefreshCallback = EMA.SettingsTeamListScrollRefresh list.rowClickCallback = EMA.SettingsTeamListRowClick EMA.settingsControl.teamList = list @@ -520,6 +552,34 @@ local function SettingsCreatePartyInvitationsControl( top ) EMA.SettingsDeclineInviteStrangersToggle, L["CHECKBOX_DECLINE_STRANGERS_HELP"] ) + EMA.settingsControl.CickInformationlabel = EMAHelperSettings:CreateLabel( + EMA.settingsControl, + headingWidth, + left, + top - headingHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight, + "You Can Use the current [\Click] in macros" + ) + EMA.settingsControl.CickInformationlabel = EMAHelperSettings:CreateLabel( + EMA.settingsControl, + headingWidth, + left, + top - headingHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight, + "[/click EMAAssistMaster]" + ) + EMA.settingsControl.CickInformationlabel = EMAHelperSettings:CreateLabel( + EMA.settingsControl, + headingWidth, + left, + top - headingHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight, + "[/click EMATargetMaster]" + ) + EMA.settingsControl.CickInformationlabel = EMAHelperSettings:CreateLabel( + EMA.settingsControl, + headingWidth, + left, + top - headingHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight - checkBoxHeight, + "[/click EMAFocusMaster]" + ) return bottomOfSection end @@ -711,10 +771,9 @@ local function IsCharacterInTeam( name ) end - -- Get the master for this character. local function GetMasterName() - return EMA.db.master + return EMA.db.master end -- Return true if the character specified is in the master. @@ -1160,7 +1219,11 @@ end -- Invite team to party. function EMA.DoTeamPartyInvite() - C_PartyInfo.InviteUnit( EMA.inviteList[EMA.currentInviteCount] ) + if EMAPrivate.Core.isEmaClassicBuild() == true or EMAPrivate.Core.isEmaClassicBccBuild() == true then + InviteUnit( EMA.inviteList[EMA.currentInviteCount] ) + else + C_PartyInfo.InviteUnit( EMA.inviteList[EMA.currentInviteCount] ) + end EMA.currentInviteCount = EMA.currentInviteCount + 1 if EMA.currentInviteCount < EMA.inviteCount then --if GetTeamListMaximumOrderOnline() > 5 and EMA.db.inviteConvertToRaid == true then @@ -1322,12 +1385,53 @@ end local function LeaveTheParty() if IsInGroup( "player" ) then - C_PartyInfo.LeaveParty() + if EMAPrivate.Core.isEmaClassicBuild() == true then + LeaveParty() + else + C_PartyInfo.LeaveParty() + end end end +function EMA:UpdateMacros() + if InCombatLockdown() then + return + end + local characterName = ( Ambiguate(EMA.db.master, "none" ) ) + local focus = "/focus " .. characterName + local target = "/target " .. characterName + local assist = "/assist " .. characterName + --EMA:Print("test", characterName, "M", focus ) + EMAFocusMaster:SetAttribute( "macrotext", focus ) + EMATargetMaster:SetAttribute( "macrotext", target ) + EMAAssistMaster:SetAttribute( "macrotext", assist ) + + local EMAFocusOneName = ( Ambiguate(EMAApi.GetCharacterNameAtOrderPosition(1), "none" ) ) + EMAFocusOne:SetAttribute( "macrotext", "/focus " .. EMAFocusOneName ) + local EMAFocusTwoName = ( Ambiguate(EMAApi.GetCharacterNameAtOrderPosition(2), "none" ) ) + EMAFocusTwo:SetAttribute( "macrotext", "/focus " .. EMAFocusTwoName ) + local EMAFocusThreeName = ( Ambiguate(EMAApi.GetCharacterNameAtOrderPosition(3), "none" ) ) + EMAFocusThree:SetAttribute( "macrotext", "/focus " .. EMAFocusThreeName ) + local EMAFocusFourName = ( Ambiguate(EMAApi.GetCharacterNameAtOrderPosition(4), "none" ) ) + EMAFocusFour:SetAttribute( "macrotext", "/focus " .. EMAFocusFourName ) + local EMAFocusFiveName = ( Ambiguate(EMAApi.GetCharacterNameAtOrderPosition(5), "none" ) ) + EMAFocusFive:SetAttribute( "macrotext", "/focus " .. EMAFocusFiveName ) + local EMAFocusSixName = ( Ambiguate(EMAApi.GetCharacterNameAtOrderPosition(6), "none" ) ) + EMAFocusSix:SetAttribute( "macrotext", "/focus " .. EMAFocusSixName ) + local EMAFocusSevenName = ( Ambiguate(EMAApi.GetCharacterNameAtOrderPosition(7), "none" ) ) + EMAFocusSeven:SetAttribute( "macrotext", "/focus " .. EMAFocusSevenName ) + local EMAFocusEightName = ( Ambiguate(EMAApi.GetCharacterNameAtOrderPosition(8), "none" ) ) + EMAFocusEight:SetAttribute( "macrotext", "/focus " .. EMAFocusEightName ) + local EMAFocusNineName = ( Ambiguate(EMAApi.GetCharacterNameAtOrderPosition(9), "none" ) ) + EMAFocusNine:SetAttribute( "macrotext", "/focus " .. EMAFocusNineName ) + local EMAFocusTenName = ( Ambiguate(EMAApi.GetCharacterNameAtOrderPosition(10), "none" ) ) + EMAFocusTen:SetAttribute( "macrotext", "/focus " .. EMAFocusTenName ) +end + + function EMA:OnMasterChange( message, characterName ) --EMA:Print("test", message, characterName) + EMA:UpdateMacros() local playerName = EMA.characterName if EMA.db.masterChangePromoteLeader == true then if IsInGroup( "player" ) and UnitIsGroupLeader( "player" ) == true and GetMasterName() ~= playerName then @@ -1343,6 +1447,27 @@ function EMA:OnMasterChange( message, characterName ) end end +function EMA:CommandClickToMove( info, parameters ) + local tag = parameters + if tag ~= nil and tag:trim() ~= "" then + EMA:EMASendCommandToTeam( EMA.COMMAND_CLICK_TO_MOVE, tag ) + end +end + +function EMA:ReceiveClickToMove( characterName, tag ) + local clickToMove = GetCVar("Autointeract") + --EMA:Print("test", characterName, tag, clickToMove ) + if EMAApi.DoesCharacterHaveTag( EMA.characterName, tag ) then + if clickToMove == "1" then + ConsoleExec("Autointeract 0") + else + if characterName ~= EMA.characterName then + ConsoleExec("Autointeract 1") + end + end + end +end + --[[ function EMA:AddIsboxerMembers() if IsAddOnLoaded("Isboxer" ) then @@ -1379,21 +1504,81 @@ function EMA:OnInitialize() -- Adds DefaultGroups to GUI EMA.characterGroupList = {} -- Key bindings. - EMATeamSecureButtonInvite = CreateFrame( "CheckButton", "EMATeamSecureButtonInvite", nil, "SecureActionButtonTemplate" ) - EMATeamSecureButtonInvite:SetAttribute( "type", "macro" ) - EMATeamSecureButtonInvite:SetAttribute( "macrotext", "/ema-team invite" ) - EMATeamSecureButtonInvite:Hide() - EMATeamSecureButtonDisband = CreateFrame( "CheckButton", "EMATeamSecureButtonDisband", nil, "SecureActionButtonTemplate" ) - EMATeamSecureButtonDisband:SetAttribute( "type", "macro" ) - EMATeamSecureButtonDisband:SetAttribute( "macrotext", "/ema-team disband" ) - EMATeamSecureButtonDisband:Hide() - EMATeamSecureButtonMaster = CreateFrame( "CheckButton", "EMATeamSecureButtonMaster", nil, "SecureActionButtonTemplate" ) - EMATeamSecureButtonMaster:SetAttribute( "type", "macro" ) - EMATeamSecureButtonMaster:SetAttribute( "macrotext", "/ema-team iammaster" ) - EMATeamSecureButtonMaster:Hide() - --Sets The class of the char. - -- setClass() - + if InCombatLockdown() == false then + EMAInvite = CreateFrame( "CheckButton", "EMAInvite", nil, "SecureActionButtonTemplate" ) + EMAInvite:SetAttribute( "type", "macro" ) + EMAInvite:SetAttribute( "macrotext", "/ema-team invite" ) + EMAInvite:Hide() + + EMADisband = CreateFrame( "CheckButton", "EMADisband", nil, "SecureActionButtonTemplate" ) + EMADisband:SetAttribute( "type", "macro" ) + EMADisband:SetAttribute( "macrotext", "/ema-team disband" ) + EMADisband:Hide() + + EMAMaster = CreateFrame( "CheckButton", "EMAMaster", nil, "SecureActionButtonTemplate" ) + EMAMaster:SetAttribute( "type", "macro" ) + EMAMaster:SetAttribute( "macrotext", "/ema-team iammaster" ) + EMAMaster:Hide() + + EMAClickToMove = CreateFrame( "CheckButton", "EMAClickToMove", nil, "SecureActionButtonTemplate" ) + EMAClickToMove:SetAttribute( "type", "macro" ) + EMAClickToMove:SetAttribute( "macrotext", "/ema-team ctm all" ) + EMAClickToMove:Hide() + + EMAFocusMaster = CreateFrame( "CheckButton", "EMAFocusMaster", nil, "SecureActionButtonTemplate" ) + EMAFocusMaster:SetAttribute( "type", "macro" ) + EMAFocusMaster:Hide() + + EMATargetMaster = CreateFrame( "CheckButton", "EMATargetMaster", nil, "SecureActionButtonTemplate" ) + EMATargetMaster:SetAttribute( "type", "macro" ) + EMATargetMaster:Hide() + + EMAAssistMaster = CreateFrame( "CheckButton", "EMAAssistMaster", nil, "SecureActionButtonTemplate" ) + EMAAssistMaster:SetAttribute( "type", "macro" ) + EMAAssistMaster:Hide() + + EMAFocusOne = CreateFrame( "CheckButton", "EMAFocusOne", nil, "SecureActionButtonTemplate" ) + EMAFocusOne:SetAttribute( "type", "macro" ) + EMAFocusOne:Hide() + + EMAFocusTwo = CreateFrame( "CheckButton", "EMAFocusTwo", nil, "SecureActionButtonTemplate" ) + EMAFocusTwo:SetAttribute( "type", "macro" ) + EMAFocusTwo:Hide() + + EMAFocusThree = CreateFrame( "CheckButton", "EMAFocusThree", nil, "SecureActionButtonTemplate" ) + EMAFocusThree:SetAttribute( "type", "macro" ) + EMAFocusThree:Hide() + + EMAFocusFour = CreateFrame( "CheckButton", "EMAFocusFour", nil, "SecureActionButtonTemplate" ) + EMAFocusFour:SetAttribute( "type", "macro" ) + EMAFocusFour:Hide() + + EMAFocusFive = CreateFrame( "CheckButton", "EMAFocusFive", nil, "SecureActionButtonTemplate" ) + EMAFocusFive:SetAttribute( "type", "macro" ) + EMAFocusFive:Hide() + + EMAFocusSix = CreateFrame( "CheckButton", "EMAFocusSix", nil, "SecureActionButtonTemplate" ) + EMAFocusSix:SetAttribute( "type", "macro" ) + EMAFocusSix:Hide() + + EMAFocusSeven = CreateFrame( "CheckButton", "EMAFocusSeven", nil, "SecureActionButtonTemplate" ) + EMAFocusSeven:SetAttribute( "type", "macro" ) + EMAFocusSeven:Hide() + + EMAFocusEight = CreateFrame( "CheckButton", "EMAFocusEight", nil, "SecureActionButtonTemplate" ) + EMAFocusEight:SetAttribute( "type", "macro" ) + EMAFocusEight:Hide() + + EMAFocusNine = CreateFrame( "CheckButton", "EMAFocusNine", nil, "SecureActionButtonTemplate" ) + EMAFocusNine:SetAttribute( "type", "macro" ) + EMAFocusNine:Hide() + + EMAFocusTen = CreateFrame( "CheckButton", "EMAFocusTen", nil, "SecureActionButtonTemplate" ) + EMAFocusTen:SetAttribute( "type", "macro" ) + EMAFocusTen:Hide() + + EMA:UpdateMacros() + end end -- Called when the addon is enabled. @@ -1506,9 +1691,11 @@ function EMA:SettingsTeamListScrollRefresh() EMA.settingsControl.teamList.rows[iterateDisplayRows].columns[1].textString:SetText( "" ) EMA.settingsControl.teamList.rows[iterateDisplayRows].columns[2].textString:SetText( "" ) EMA.settingsControl.teamList.rows[iterateDisplayRows].columns[3].textString:SetText( "" ) + EMA.settingsControl.teamList.rows[iterateDisplayRows].columns[4].textString:SetText( "" ) EMA.settingsControl.teamList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 1.0, 1.0, 1.0, 1.0 ) EMA.settingsControl.teamList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 1.0, 1.0, 1.0 ) EMA.settingsControl.teamList.rows[iterateDisplayRows].columns[3].textString:SetTextColor( 1.0, 1.0, 1.0, 1.0 ) + EMA.settingsControl.teamList.rows[iterateDisplayRows].columns[4].textString:SetTextColor( 1.0, 1.0, 1.0, 1.0 ) EMA.settingsControl.teamList.rows[iterateDisplayRows].highlight:SetColorTexture( 0.0, 0.0, 0.0, 0.0 ) -- Get data. local dataRowNumber = iterateDisplayRows + EMA.settingsControl.teamListOffset @@ -1558,6 +1745,10 @@ function EMA:SettingsTeamListScrollRefresh() EMA.settingsControl.teamList.rows[iterateDisplayRows].columns[1].textString:SetText( displayCharacterName ) EMA.settingsControl.teamList.rows[iterateDisplayRows].columns[2].textString:SetText( displayCharacterRleam ) EMA.settingsControl.teamList.rows[iterateDisplayRows].columns[3].textString:SetText( displayOnline ) + local key1 = "" + key1 = GetBindingKey( "FOCUS"..iterateDisplayRows ) + --EMA:Print("test", key1, "FOCUS"..iterateDisplayRows ) + EMA.settingsControl.teamList.rows[iterateDisplayRows].columns[4].textString:SetText( key1 ) -- Highlight the selected row. if dataRowNumber == EMA.settingsControl.teamListHighlightRow then EMA.settingsControl.teamList.rows[iterateDisplayRows].highlight:SetColorTexture( 1.0, 1.0, 0.0, 0.5 ) @@ -1812,25 +2003,122 @@ function EMA:UPDATE_BINDINGS() ClearOverrideBindings( EMA.keyBindingFrame ) local key1, key2 = GetBindingKey( "TEAMINVITE" ) if key1 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMATeamSecureButtonInvite" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAInvite" ) end if key2 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMATeamSecureButtonInvite" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAInvite" ) end local key1, key2 = GetBindingKey( "TEAMDISBAND" ) if key1 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMATeamSecureButtonDisband" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMADisband" ) end if key2 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMATeamSecureButtonDisband" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMADisband" ) end local key1, key2 = GetBindingKey( "TEAMMASTER" ) if key1 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMATeamSecureButtonMaster" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAMaster" ) end if key2 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMATeamSecureButtonMaster" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAMaster" ) + end + local key1, key2 = GetBindingKey( "MASTERFOCUS" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFocusMaster" ) end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFocusMaster" ) + end + local key1, key2 = GetBindingKey( "MASTERTARGET" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMATargetMaster" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMATargetMaster" ) + end + local key1, key2 = GetBindingKey( "MASTERASSIST" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAAssistMaster" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAAssistMaster" ) + end + local key1, key2 = GetBindingKey( "CLICKTOMOVE" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAClickToMove" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAClickToMove" ) + end + local key1, key2 = GetBindingKey( "FOCUS1" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFocusOne" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFocusOne" ) + end + local key1, key2 = GetBindingKey( "FOCUS2" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFocusTwo" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFocusTwo" ) + end + local key1, key2 = GetBindingKey( "FOCUS3" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFocusThree" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFocusThree" ) + end + local key1, key2 = GetBindingKey( "FOCUS4" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFocusFour" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFocusFour" ) + end + local key1, key2 = GetBindingKey( "FOCUS5" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFocusFive" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFocusFive" ) + end + local key1, key2 = GetBindingKey( "FOCUS6" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFocusSix" ) + end + local key1, key2 = GetBindingKey( "FOCUS7" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFocusSix" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFocusSeven" ) + end + local key1, key2 = GetBindingKey( "FOCUS8" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFocusEight" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFocusEight" ) + end + local key1, key2 = GetBindingKey( "FOCUS9" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFocusNine" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFocusNine" ) + end + local key1, key2 = GetBindingKey( "FOCUS10" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFocusTen" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFocusTen" ) + end + + end ------------------------------------------------------------------------------------------------------------- @@ -1838,31 +2126,26 @@ end ------------------------------------------------------------------------------------------------------------- function EMA:EMAOnCommandReceived( sender, commandName, ... ) + if IsCharacterInTeam( sender ) == false then + return + end if commandName == EMA.COMMAND_LEAVE_PARTY then - if IsCharacterInTeam( sender ) == true then - LeaveTheParty() - end + LeaveTheParty() end if commandName == EMA.COMMAND_SET_MASTER then - if IsCharacterInTeam( sender ) == true then - EMA:ReceiveCommandSetMaster( ... ) - end + EMA:ReceiveCommandSetMaster( ... ) end - --Ebony if commandName == EMA.COMMAND_SET_OFFLINE then - if IsCharacterInTeam( sender ) == true then - EMA.ReceivesetOffline( ... ) - end + EMA:ReceivesetOffline( ... ) end if commandName == EMA.COMMAND_SET_ONLINE then - if IsCharacterInTeam( sender ) == true then - EMA.ReceivesetOnline( ... ) - end + EMA:ReceivesetOnline( ... ) end if commandName == EMA.COMMAND_TAG_PARTY then - if IsCharacterInTeam( sender ) == true then - EMA.doTagParty( characterName, tag, ... ) - end + EMA:doTagParty( characterName, tag, ... ) + end + if commandName == EMA.COMMAND_CLICK_TO_MOVE then + EMA:ReceiveClickToMove( sender, ... ) end end @@ -1872,6 +2155,7 @@ EMAPrivate.Team.MESSAGE_TEAM_ORDER_CHANGED = EMA.MESSAGE_TEAM_ORDER_CHANGED EMAPrivate.Team.MESSAGE_TEAM_CHARACTER_ADDED = EMA.MESSAGE_TEAM_CHARACTER_ADDED EMAPrivate.Team.MESSAGE_TEAM_CHARACTER_REMOVED = EMA.MESSAGE_TEAM_CHARACTER_REMOVED EMAPrivate.Team.TeamList = TeamList +EMAPrivate.Team.TeamListOrdered = TeamListOrdered EMAPrivate.Team.IsCharacterInTeam = IsCharacterInTeam EMAPrivate.Team.IsCharacterTheMaster = IsCharacterTheMaster EMAPrivate.Team.GetMasterName = GetMasterName @@ -1885,6 +2169,7 @@ EMAPrivate.Team.setOffline = setOffline EMAPrivate.Team.setOnline = setOline EMAPrivate.Team.RefreshGroupList = RefreshGroupList + -- Functions available for other addons. EMAApi.MESSAGE_TEAM_MASTER_CHANGED = EMA.MESSAGE_TEAM_MASTER_CHANGED EMAApi.MESSAGE_TEAM_ORDER_CHANGED = EMA.MESSAGE_TEAM_ORDER_CHANGED @@ -1916,3 +2201,4 @@ EMAApi.CommandIAmMaster = EMA.CommandIAmMaster --EMAApi.SetClass = setClass EMAApi.GroupAreaList = EMA.GroupAreaList EMAApi.refreshDropDownList = refreshDropDownList +EMAApi.UpdateMacros = EMA.UpdateMacros \ No newline at end of file diff --git a/EMA.toc b/EMA.toc index 00ba644..19b12ca 100644 --- a/EMA.toc +++ b/EMA.toc @@ -1,13 +1,13 @@ -## Interface: 90001 +## Interface: 90200 ## Title: EMA ## Notes: Ebony's MultiBoxing Assistant ## Author: Jennifer Calladine 'Ebony' -## Version: v9.0.1-Release-v3.1(0170) -## SavedVariables: CoreProfileDB, CommunicationsProfileDB, TeamProfileDB, TagProfileDB, MessageProfileDB, InformationProfileDB, DisplayTeamProfileDB, FollowProfileDB, GuildProfileDB, InteractionProfileDB, ItemUseProfileDB, PurchaseProfileDB, QuestProfileDB, QuestWatcherProfileDB, SellProfileDB, TalkProfileDB, ToonProfileDB, TradeProfileDB, MailProfileDB, BankProfileDB, ISBoxerProfileDB +## Version: Release-v4.1(0208) +## SavedVariables: CoreProfileDB, CommunicationsProfileDB, TeamProfileDB, TagProfileDB, MessageProfileDB, InformationProfileDB, InformationClassicProfileDB, DisplayTeamProfileDB, FollowProfileDB, GuildProfileDB, InteractionProfileDB, ItemUseProfileDB, PurchaseProfileDB, QuestProfileDB, QuestWatcherProfileDB, SellProfileDB, TalkProfileDB, ToonProfileDB, TradeProfileDB, MailProfileDB, BankProfileDB, ISBoxerProfileDB #Libs Embeds.xml -EbonyUtilities.lua +Libs\EbonyUtilities.lua #Locales Locales\Locales.xml diff --git a/EMA_Mainline.toc b/EMA_Mainline.toc new file mode 100644 index 0000000..19b12ca --- /dev/null +++ b/EMA_Mainline.toc @@ -0,0 +1,28 @@ +## Interface: 90200 +## Title: EMA +## Notes: Ebony's MultiBoxing Assistant +## Author: Jennifer Calladine 'Ebony' +## Version: Release-v4.1(0208) +## SavedVariables: CoreProfileDB, CommunicationsProfileDB, TeamProfileDB, TagProfileDB, MessageProfileDB, InformationProfileDB, InformationClassicProfileDB, DisplayTeamProfileDB, FollowProfileDB, GuildProfileDB, InteractionProfileDB, ItemUseProfileDB, PurchaseProfileDB, QuestProfileDB, QuestWatcherProfileDB, SellProfileDB, TalkProfileDB, ToonProfileDB, TradeProfileDB, MailProfileDB, BankProfileDB, ISBoxerProfileDB + +#Libs +Embeds.xml +Libs\EbonyUtilities.lua + +#Locales +Locales\Locales.xml + +#GUI +GUI\EMAHelperSettings.lua + +#Core +Core\Core.lua +Core\Module.lua +Core\Communications.lua + +Core\Team.lua +Core\Tag.lua +Core\Message.lua + +#Modules +Modules\Modules.xml \ No newline at end of file diff --git a/EMA_TBC.toc b/EMA_TBC.toc new file mode 100644 index 0000000..ab672e0 --- /dev/null +++ b/EMA_TBC.toc @@ -0,0 +1,28 @@ +## Interface: 20502 +## Title: EMA +## Notes: Ebony's MultiBoxing Assistant +## Author: Jennifer Calladine 'Ebony' +## Version: Release-v4.1(0208) +## SavedVariables: CoreProfileDB, CommunicationsProfileDB, TeamProfileDB, TagProfileDB, MessageProfileDB, InformationProfileDB, InformationClassicProfileDB, DisplayTeamProfileDB, FollowProfileDB, GuildProfileDB, InteractionProfileDB, ItemUseProfileDB, PurchaseProfileDB, QuestProfileDB, QuestWatcherProfileDB, SellProfileDB, TalkProfileDB, ToonProfileDB, TradeProfileDB, MailProfileDB, BankProfileDB, ISBoxerProfileDB + +#Libs +Embeds.xml +Libs\EbonyUtilities.lua + +#Locales +Locales\Locales.xml + +#GUI +GUI\EMAHelperSettings.lua + +#Core +Core\Core.lua +Core\Module.lua +Core\Communications.lua + +Core\Team.lua +Core\Tag.lua +Core\Message.lua + +#Modules +Modules\Modules.xml \ No newline at end of file diff --git a/EMA_Vanilla.toc b/EMA_Vanilla.toc new file mode 100644 index 0000000..d9f30a4 --- /dev/null +++ b/EMA_Vanilla.toc @@ -0,0 +1,28 @@ +## Interface: 11402 +## Title: EMA +## Notes: Ebony's MultiBoxing Assistant +## Author: Jennifer Calladine 'Ebony' +## Version: Release-v4.1(0208) +## SavedVariables: CoreProfileDB, CommunicationsProfileDB, TeamProfileDB, TagProfileDB, MessageProfileDB, InformationProfileDB, InformationClassicProfileDB, DisplayTeamProfileDB, FollowProfileDB, GuildProfileDB, InteractionProfileDB, ItemUseProfileDB, PurchaseProfileDB, QuestProfileDB, QuestWatcherProfileDB, SellProfileDB, TalkProfileDB, ToonProfileDB, TradeProfileDB, MailProfileDB, BankProfileDB, ISBoxerProfileDB + +#Libs +Embeds.xml +Libs\EbonyUtilities.lua + +#Locales +Locales\Locales.xml + +#GUI +GUI\EMAHelperSettings.lua + +#Core +Core\Core.lua +Core\Module.lua +Core\Communications.lua + +Core\Team.lua +Core\Tag.lua +Core\Message.lua + +#Modules +Modules\Modules.xml \ No newline at end of file diff --git a/GUI/AceGUIContainer-EMATreeGroup.lua b/GUI/AceGUIContainer-EMATreeGroup.lua index de9a4ee..4359f80 100644 --- a/GUI/AceGUIContainer-EMATreeGroup.lua +++ b/GUI/AceGUIContainer-EMATreeGroup.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -61,7 +61,7 @@ do end end -local DEFAULT_TREE_WIDTH = 200 +local DEFAULT_TREE_WIDTH = 170 local DEFAULT_TREE_SIZABLE = true --[[----------------------------------------------------------------------------- diff --git a/GUI/AceGUIContainer-EMAWindow.lua b/GUI/AceGUIContainer-EMAWindow.lua index 54e1725..0992c43 100644 --- a/GUI/AceGUIContainer-EMAWindow.lua +++ b/GUI/AceGUIContainer-EMAWindow.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -156,14 +156,14 @@ local methods = { ["Show"] = function(self) self.frame:Show() end, - + ["EnableResize"] = function(self, state) local func = state and "Show" or "Hide" self.sizer_se[func](self.sizer_se) self.sizer_s[func](self.sizer_s) self.sizer_e[func](self.sizer_e) end, - + -- called to set an external table to store status in ["SetStatusTable"] = function(self, status) assert(type(status) == "table") @@ -206,7 +206,7 @@ local PaneBackdrop = { local function Constructor() - local frame = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil) + local frame = CreateFrame("Frame", "EmaConfigFrame", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil) frame:Hide() frame:EnableMouse(true) @@ -221,6 +221,8 @@ local function Constructor() frame:SetToplevel(true) frame:SetScript("OnHide", Frame_OnClose) frame:SetScript("OnMouseDown", Frame_OnMouseDown) + -- add this frame to a list of frames that get closed with escape key + table.insert(UISpecialFrames, frame:GetName() ) local closebutton = CreateFrame("Button", nil, frame, "UIPanelButtonTemplate") closebutton:SetScript("OnClick", Button_OnClick) diff --git a/GUI/AceGUIWidget-EMAContinueLabel.lua b/GUI/AceGUIWidget-EMAContinueLabel.lua index c8edb63..6f27901 100644 --- a/GUI/AceGUIWidget-EMAContinueLabel.lua +++ b/GUI/AceGUIWidget-EMAContinueLabel.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- diff --git a/GUI/AceGUIWidget-EMANormalLabel.lua b/GUI/AceGUIWidget-EMANormalLabel.lua index c88d1dd..5a766f0 100644 --- a/GUI/AceGUIWidget-EMANormalLabel.lua +++ b/GUI/AceGUIWidget-EMANormalLabel.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- diff --git a/GUI/EMAHelperSettings.lua b/GUI/EMAHelperSettings.lua index 0876f0e..e82e6d6 100644 --- a/GUI/EMAHelperSettings.lua +++ b/GUI/EMAHelperSettings.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -27,7 +27,7 @@ local AceGUI = LibStub( "AceGUI-3.0" ) AceGUI:RegisterLayout( "EMAManual", function(content, children) end ) -AceGUI:RegisterLayout("EMAFill", +AceGUI:RegisterLayout("EMAuiFill", function(content, children) if children[1] then local offset = 12 @@ -85,29 +85,31 @@ function EMAHelperSettings:CreateSettings( settingsControl, displayName, parentD order = 1000 end + local containerWidgetSettings = AceGUI:Create( "SimpleGroup" ) containerWidgetSettings:SetLayout( "Fill" ) local widgetSettings = AceGUI:Create( "ScrollFrame" ) - widgetSettings:SetLayout( "EMAFill" ) + widgetSettings:SetLayout( "EMAuiFill" ) containerWidgetSettings:AddChild( widgetSettings ) + local button = AceGUI:Create( "Button" ) if displayName == "News" then button:SetText( L["PUSH_ALL_SETTINGS"] ) else button:SetText( L["PUSH_SETTINGS"] ) end - containerWidgetSettings:AddChild( button ) button:SetWidth( 200 ) button:SetPoint( "TOPLEFT", containerWidgetSettings.frame, "TOPRIGHT", -200, 40 ) button:SetCallback( "OnClick", pushSettingsCallback ) settingsControl.widgetPushSettingsButton = button - + settingsControl.widgetSettingsHelp = widgetSettingsHelp settingsControl.containerWidgetSettings = containerWidgetSettings + settingsControl.widgetSettings = widgetSettings EMAPrivate.SettingsFrame.Tree.Add( displayName, parentDisplayName, moduleIcon, order, settingsControl.containerWidgetSettings ) end @@ -132,11 +134,12 @@ end ------------------------------------------------------------------------------------------------------------- function EMAHelperSettings:HeadingWidth( hasScrollBar ) - local width = 600 + + local width = 800 - 230 if hasScrollBar == true then - return width + return width - 20 else - return width + 20 + return width end end diff --git a/LICENSE b/LICENSE index a132d50..48c8206 100644 --- a/LICENSE +++ b/LICENSE @@ -15,29 +15,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - ---------------- -Most Core Code: Uses "Jamba" and When "Jamba" Name is Used in EMA uses the following License: ---------------- - -The MIT License (MIT) - -Copyright (c) 2008-2016 Michael "Jafula" Miller - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/Libs/AceComm-3.0/ChatThrottleLib.lua b/Libs/AceComm-3.0/ChatThrottleLib.lua index ad21af4..d1dd8a0 100644 --- a/Libs/AceComm-3.0/ChatThrottleLib.lua +++ b/Libs/AceComm-3.0/ChatThrottleLib.lua @@ -75,7 +75,7 @@ local next = next local strlen = string.len local GetFramerate = GetFramerate local strlower = string.lower -local unpack,type,pairs,wipe = unpack,type,pairs,wipe +local unpack,type,pairs,wipe = unpack,type,pairs,table.wipe local UnitInRaid,UnitInParty = UnitInRaid,UnitInParty diff --git a/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua b/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua index a14e07d..f66086f 100644 --- a/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua +++ b/Libs/AceConfig-3.0/AceConfigDialog-3.0/AceConfigDialog-3.0.lua @@ -1,13 +1,13 @@ --- AceConfigDialog-3.0 generates AceGUI-3.0 based windows based on option tables. -- @class file -- @name AceConfigDialog-3.0 --- @release $Id: AceConfigDialog-3.0.lua 1232 2020-04-14 22:21:22Z nevcairiel $ +-- @release $Id: AceConfigDialog-3.0.lua 1248 2021-02-05 14:27:49Z funkehdude $ local LibStub = LibStub local gui = LibStub("AceGUI-3.0") local reg = LibStub("AceConfigRegistry-3.0") -local MAJOR, MINOR = "AceConfigDialog-3.0", 79 +local MAJOR, MINOR = "AceConfigDialog-3.0", 81 local AceConfigDialog, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not AceConfigDialog then return end @@ -22,10 +22,10 @@ AceConfigDialog.frame.closing = AceConfigDialog.frame.closing or {} AceConfigDialog.frame.closeAllOverride = AceConfigDialog.frame.closeAllOverride or {} -- Lua APIs -local tinsert, tsort, tremove = table.insert, table.sort, table.remove +local tinsert, tsort, tremove, wipe = table.insert, table.sort, table.remove, table.wipe local strmatch, format = string.match, string.format local error = error -local pairs, next, select, type, unpack, wipe, ipairs = pairs, next, select, type, unpack, wipe, ipairs +local pairs, next, select, type, unpack, ipairs = pairs, next, select, type, unpack, ipairs local tostring, tonumber = tostring, tonumber local math_min, math_max, math_floor = math.min, math.max, math.floor @@ -544,13 +544,15 @@ local function GetFuncName(option) end do local frame = AceConfigDialog.popup - if not frame then + if not frame or oldminor < 81 then frame = CreateFrame("Frame", nil, UIParent) AceConfigDialog.popup = frame frame:Hide() frame:SetPoint("CENTER", UIParent, "CENTER") frame:SetSize(320, 72) + frame:EnableMouse(true) -- Do not allow click-through on the frame frame:SetFrameStrata("TOOLTIP") + frame:SetFrameLevel(100) -- Lots of room to draw under it frame:SetScript("OnKeyDown", function(self, key) if key == "ESCAPE" then self:SetPropagateKeyboardInput(false) @@ -564,7 +566,7 @@ do end end) - if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then + if not frame.SetFixedFrameStrata then -- API capability check (classic check) frame:SetBackdrop({ bgFile = [[Interface\DialogFrame\UI-DialogBox-Background-Dark]], edgeFile = [[Interface\DialogFrame\UI-DialogBox-Border]], @@ -574,8 +576,10 @@ do insets = { left = 11, right = 11, top = 11, bottom = 11 }, }) else - local border = CreateFrame("Frame", nil, frame, "DialogBorderDarkTemplate") + local border = CreateFrame("Frame", nil, frame, "DialogBorderOpaqueTemplate") border:SetAllPoints(frame) + frame:SetFixedFrameStrata(true) + frame:SetFixedFrameLevel(true) end local text = frame:CreateFontString(nil, "ARTWORK", "GameFontHighlight") diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc index 8592b88..f552554 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets.toc @@ -1,4 +1,4 @@ -## Interface: 80200 +## Interface: 90001 ## Title: Lib: AceGUI-3.0-SharedMediaWidgets ## Notes: Enables AceGUI-3.0 widgets for the 5 basic SharedMedia-3.0 types @@ -6,11 +6,5 @@ ## OptionalDeps: Ace3, LibSharedMedia-3.0 ## X-Category: Library -#@no-lib-strip@ -Libs\Libstub\Libstub.lua -Libs\CallbackHandler-1.0\CallbackHandler-1.0.xml -Libs\AceGUI-3.0\AceGUI-3.0.xml -Libs\LibSharedMedia-3.0\lib.xml -#@end-no-lib-strip@ widget.xml diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua index 3bb45ed..19ad608 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua @@ -8,7 +8,7 @@ local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0") do local widgetType = "LSM30_Background" - local widgetVersion = 12 + local widgetVersion = 13 local contentFrameCache = {} local function ReturnSelf(self) @@ -38,7 +38,7 @@ do if next(contentFrameCache) then frame = table.remove(contentFrameCache) else - frame = CreateFrame("Button", nil, UIParent) + frame = CreateFrame("Button", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate") --frame:SetWidth(200) frame:SetHeight(18) frame:SetHighlightTexture([[Interface\QuestFrame\UI-QuestTitleHighlight]], "ADD") diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua index 2211a4c..0f2cbea 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua @@ -8,7 +8,7 @@ local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0") do local widgetType = "LSM30_Border" - local widgetVersion = 12 + local widgetVersion = 13 local contentFrameCache = {} local function ReturnSelf(self) diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua index 723b028..e9f98b9 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua @@ -8,7 +8,7 @@ local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0") do local widgetType = "LSM30_Font" - local widgetVersion = 12 + local widgetVersion = 13 local contentFrameCache = {} local function ReturnSelf(self) diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/SharedFunctions.lua b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/SharedFunctions.lua deleted file mode 100644 index 7725598..0000000 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/SharedFunctions.lua +++ /dev/null @@ -1,55 +0,0 @@ --- Widget is based on the AceGUIWidget-DropDown.lua supplied with AceGUI-3.0 --- Widget created by Yssaril -LoadAddOn("LibSharedMedia-3.0") -local AceGUI = LibStub("AceGUI-3.0") -local Media = LibStub("LibSharedMedia-3.0") - -AceGUISharedMediaWidgets = {} -do - AceGUIWidgetLSMlists = { - ['font'] = Media:HashTable("font"), - ['sound'] = Media:HashTable("sound"), - ['statusbar'] = Media:HashTable("statusbar"), - ['border'] = Media:HashTable("border"), - ['background'] = Media:HashTable("background"), - } - - local min, max, floor = math.min, math.max, math.floor - - local function fixlevels(parent,...) - local i = 1 - local child = select(i, ...) - while child do - child:SetFrameLevel(parent:GetFrameLevel()+1) - fixlevels(child, child:GetChildren()) - i = i + 1 - child = select(i, ...) - end - end - - local function OnItemValueChanged(this, event, checked) - local self = this.userdata.obj - if self.multiselect then - self:Fire("OnValueChanged", this.userdata.value, checked) - else - if checked then - self:SetValue(this.userdata.value) - self:Fire("OnValueChanged", this.userdata.value) - else - this:SetValue(true) - end - self.pullout:Close() - end - end - - local function SetValue(self, value) - if value then - self:SetText(value or "") - end - self.value = value - end - - AceGUISharedMediaWidgets.fixlevels = fixlevels - AceGUISharedMediaWidgets.OnItemValueChanged = OnItemValueChanged - AceGUISharedMediaWidgets.SetValue = SetValue -end diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua index 10c8aa4..77557a5 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua @@ -8,7 +8,7 @@ local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0") do local widgetType = "LSM30_Sound" - local widgetVersion = 12 + local widgetVersion = 13 local contentFrameCache = {} local function ReturnSelf(self) diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua index 824ce07..05467aa 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua @@ -8,7 +8,7 @@ local AGSMW = LibStub("AceGUISharedMediaWidgets-1.0") do local widgetType = "LSM30_Statusbar" - local widgetVersion = 12 + local widgetVersion = 13 local contentFrameCache = {} local function ReturnSelf(self) diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/prototypes.lua b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/prototypes.lua index 121e3b4..95b511d 100644 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/prototypes.lua +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/AceGUI-3.0-SharedMediaWidgets/prototypes.lua @@ -1,5 +1,5 @@ -- Widget created by Yssaril -local DataVersion = 9003 +local DataVersion = 9004 local AGSMW = LibStub:NewLibrary("AceGUISharedMediaWidgets-1.0", DataVersion) if not AGSMW then @@ -112,7 +112,7 @@ do function AGSMW:GetBaseFrameWithWindow() local frame = self:GetBaseFrame() - local displayButton = CreateFrame("Button", nil, frame, BackdropTemplateMixin and "BackdropTemplate" or nil) + local displayButton = CreateFrame("Button", nil, frame, BackdropTemplateMixin and "BackdropTemplate") displayButton:SetHeight(42) displayButton:SetWidth(42) displayButton:SetPoint("TOPLEFT", frame, "TOPLEFT", 1, -2) @@ -205,7 +205,7 @@ do if next(DropDownCache) then frame = table.remove(DropDownCache) else - frame = CreateFrame("Frame", nil, UIParent) + frame = CreateFrame("Frame", nil, UIParent, BackdropTemplateMixin and "BackdropTemplate") frame:SetClampedToScreen(true) frame:SetWidth(188) frame:SetBackdrop(frameBackdrop) @@ -235,7 +235,7 @@ do frame.ClearFrames = ClearFrames frame.contentRepo = {} -- store all our frames in here so we can get rid of them later - local slider = CreateFrame("Slider", nil, scrollframe) + local slider = CreateFrame("Slider", nil, scrollframe, BackdropTemplateMixin and "BackdropTemplate") slider:SetOrientation("VERTICAL") slider:SetPoint("TOPRIGHT", frame, "TOPRIGHT", -14, -10) slider:SetPoint("BOTTOMRIGHT", frame, "BOTTOMRIGHT", -14, 10) diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/CHANGES r-65.txt b/Libs/AceGUI-3.0-SharedMediaWidgets/CHANGES r-65.txt new file mode 100644 index 0000000..410408e --- /dev/null +++ b/Libs/AceGUI-3.0-SharedMediaWidgets/CHANGES r-65.txt @@ -0,0 +1,12 @@ +------------------------------------------------------------------------ +r64 | nevcairiel | 2020-10-19 22:06:38 +0000 (Mon, 19 Oct 2020) | 1 line +Changed paths: + M /trunk/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua + M /trunk/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua + M /trunk/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua + M /trunk/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua + M /trunk/AceGUI-3.0-SharedMediaWidgets.toc + +Bump all widget versions to ensure the new prototype is used everywhere +------------------------------------------------------------------------ + diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/CHANGES.txt b/Libs/AceGUI-3.0-SharedMediaWidgets/CHANGES.txt deleted file mode 100644 index d4c7d8b..0000000 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/CHANGES.txt +++ /dev/null @@ -1,25 +0,0 @@ ------------------------------------------------------------------------- -r60 | nevcairiel | 2019-06-14 23:53:41 +0000 (Fri, 14 Jun 2019) | 1 line -Changed paths: - M /trunk/AceGUI-3.0-SharedMediaWidgets.toc - -Update TOC ------------------------------------------------------------------------- -r59 | nevcairiel | 2019-06-14 23:53:15 +0000 (Fri, 14 Jun 2019) | 1 line -Changed paths: - M /trunk/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua - M /trunk/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua - M /trunk/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua - M /trunk/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua - M /trunk/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua - M /trunk/AceGUI-3.0-SharedMediaWidgets/prototypes.lua - -Remove unnecessary UpdateScrollChildRect() calls. The Scroll Child is recomputed when needed automatically, and this improves performance significantly ------------------------------------------------------------------------- -r58 | nevcairiel | 2018-06-21 23:05:54 +0000 (Thu, 21 Jun 2018) | 1 line -Changed paths: - M /trunk/AceGUI-3.0-SharedMediaWidgets/prototypes.lua - -Hard code a version to avoid issues with the version being populated from the hosting repository ------------------------------------------------------------------------- - diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/Changelog-AceGUI-3.0-SharedMediaWidgets-r48-release.txt b/Libs/AceGUI-3.0-SharedMediaWidgets/Changelog-AceGUI-3.0-SharedMediaWidgets-r48-release.txt deleted file mode 100644 index 2163c0d..0000000 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/Changelog-AceGUI-3.0-SharedMediaWidgets-r48-release.txt +++ /dev/null @@ -1,19 +0,0 @@ ------------------------------------------------------------------------- -r48 | funkydude | 2013-05-26 11:10:27 +0000 (Sun, 26 May 2013) | 1 line -Changed paths: - A /tags/r48-release (from /trunk:47) - -Tagging as r48-release ------------------------------------------------------------------------- -r47 | funkydude | 2013-05-26 11:09:17 +0000 (Sun, 26 May 2013) | 1 line -Changed paths: - M /trunk/AceGUI-3.0-SharedMediaWidgets.toc - -bump toc ------------------------------------------------------------------------- -r46 | Phanx | 2013-01-02 06:47:48 +0000 (Wed, 02 Jan 2013) | 1 line -Changed paths: - M /trunk/AceGUI-3.0-SharedMediaWidgets/prototypes.lua - -Fixed an anchoring issue that could prevent interaction with menu buttons. ------------------------------------------------------------------------- diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/Changelog-AceGUI-3.0-SharedMediaWidgets-r53.txt b/Libs/AceGUI-3.0-SharedMediaWidgets/Changelog-AceGUI-3.0-SharedMediaWidgets-r53.txt deleted file mode 100644 index 91e3976..0000000 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/Changelog-AceGUI-3.0-SharedMediaWidgets-r53.txt +++ /dev/null @@ -1,7 +0,0 @@ ------------------------------------------------------------------------- -r53 | nevcairiel | 2016-06-03 06:51:46 +0000 (Fri, 03 Jun 2016) | 1 line -Changed paths: - M /trunk/AceGUI-3.0-SharedMediaWidgets/prototypes.lua - -Remove SetPoint to UIParent, AceGUI-3.0 will properly position the element when its used ------------------------------------------------------------------------- diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/Changelog-AceGUI-3.0-SharedMediaWidgets-v3.3.2.txt b/Libs/AceGUI-3.0-SharedMediaWidgets/Changelog-AceGUI-3.0-SharedMediaWidgets-v3.3.2.txt deleted file mode 100644 index eeb78d0..0000000 --- a/Libs/AceGUI-3.0-SharedMediaWidgets/Changelog-AceGUI-3.0-SharedMediaWidgets-v3.3.2.txt +++ /dev/null @@ -1,17 +0,0 @@ ------------------------------------------------------------------------- -r19 | yssaril | 2009-12-05 07:44:46 +0000 (Sat, 05 Dec 2009) | 1 line -Changed paths: - A /tags/v3.3.2 (from /trunk:18) - -Tagging as v3.3.2 ------------------------------------------------------------------------- -r18 | yssaril | 2009-12-05 07:43:22 +0000 (Sat, 05 Dec 2009) | 1 line -Changed paths: - M /trunk/AceGUI-3.0-SharedMediaWidgets/BackgroundWidget.lua - M /trunk/AceGUI-3.0-SharedMediaWidgets/BorderWidget.lua - M /trunk/AceGUI-3.0-SharedMediaWidgets/FontWidget.lua - M /trunk/AceGUI-3.0-SharedMediaWidgets/SoundWidget.lua - M /trunk/AceGUI-3.0-SharedMediaWidgets/StatusbarWidget.lua - -fix dropdowns not clearing properly ------------------------------------------------------------------------- diff --git a/Libs/AceGUI-3.0-SharedMediaWidgets/R61 updated.txt b/Libs/AceGUI-3.0-SharedMediaWidgets/R61 updated.txt deleted file mode 100644 index e69de29..0000000 diff --git a/Libs/AceGUI-3.0/AceGUI-3.0.lua b/Libs/AceGUI-3.0/AceGUI-3.0.lua index cde61f6..438650f 100644 --- a/Libs/AceGUI-3.0/AceGUI-3.0.lua +++ b/Libs/AceGUI-3.0/AceGUI-3.0.lua @@ -24,14 +24,14 @@ -- f:AddChild(btn) -- @class file -- @name AceGUI-3.0 --- @release $Id: AceGUI-3.0.lua 1231 2020-04-14 22:20:36Z nevcairiel $ +-- @release $Id: AceGUI-3.0.lua 1247 2021-01-23 23:16:39Z funkehdude $ local ACEGUI_MAJOR, ACEGUI_MINOR = "AceGUI-3.0", 41 local AceGUI, oldminor = LibStub:NewLibrary(ACEGUI_MAJOR, ACEGUI_MINOR) if not AceGUI then return end -- No upgrade needed -- Lua APIs -local tinsert = table.insert +local tinsert, wipe = table.insert, table.wipe local select, pairs, next, type = select, pairs, next, type local error, assert = error, assert local setmetatable, rawget = setmetatable, rawget diff --git a/Libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua b/Libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua index 9a48f8b..2f8ba04 100644 --- a/Libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua +++ b/Libs/AceGUI-3.0/widgets/AceGUIContainer-BlizOptionsGroup.lua @@ -2,7 +2,7 @@ BlizOptionsGroup Container Simple container widget for the integration of AceGUI into the Blizzard Interface Options -------------------------------------------------------------------------------]] -local Type, Version = "BlizOptionsGroup", 21 +local Type, Version = "BlizOptionsGroup", 22 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end @@ -99,7 +99,7 @@ local methods = { Constructor -------------------------------------------------------------------------------]] local function Constructor() - local frame = CreateFrame("Frame") + local frame = CreateFrame("Frame", nil, InterfaceOptionsFramePanelContainer) frame:Hide() -- support functions for the Blizzard Interface Options diff --git a/Libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua b/Libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua index fbd6005..de7b358 100644 --- a/Libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua +++ b/Libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua @@ -1,7 +1,7 @@ --[[----------------------------------------------------------------------------- Frame Container -------------------------------------------------------------------------------]] -local Type, Version = "Frame", 27 +local Type, Version = "Frame", 28 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end @@ -83,6 +83,7 @@ local methods = { ["OnAcquire"] = function(self) self.frame:SetParent(UIParent) self.frame:SetFrameStrata("FULLSCREEN_DIALOG") + self.frame:SetFrameLevel(100) -- Lots of room to draw under it self:SetTitle() self:SetStatusText() self:ApplyStatus() @@ -186,6 +187,7 @@ local function Constructor() frame:SetMovable(true) frame:SetResizable(true) frame:SetFrameStrata("FULLSCREEN_DIALOG") + frame:SetFrameLevel(100) -- Lots of room to draw under it frame:SetBackdrop(FrameBackdrop) frame:SetBackdropColor(0, 0, 0, 1) frame:SetMinResize(400, 200) diff --git a/Libs/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua b/Libs/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua index 195ab0b..3e45541 100644 --- a/Libs/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua +++ b/Libs/AceGUI-3.0/widgets/AceGUIContainer-TabGroup.lua @@ -7,7 +7,7 @@ local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end -- Lua APIs -local pairs, ipairs, assert, type, wipe = pairs, ipairs, assert, type, wipe +local pairs, ipairs, assert, type, wipe = pairs, ipairs, assert, type, table.wipe -- WoW APIs local PlaySound = PlaySound diff --git a/Libs/AceHook-3.0/AceHook-3.0.lua b/Libs/AceHook-3.0/AceHook-3.0.lua index d91c36f..af6a265 100644 --- a/Libs/AceHook-3.0/AceHook-3.0.lua +++ b/Libs/AceHook-3.0/AceHook-3.0.lua @@ -9,8 +9,8 @@ -- make into AceHook. -- @class file -- @name AceHook-3.0 --- @release $Id: AceHook-3.0.lua 1202 2019-05-15 23:11:22Z nevcairiel $ -local ACEHOOK_MAJOR, ACEHOOK_MINOR = "AceHook-3.0", 8 +-- @release $Id: AceHook-3.0.lua 1243 2020-10-18 00:00:19Z nevcairiel $ +local ACEHOOK_MAJOR, ACEHOOK_MINOR = "AceHook-3.0", 9 local AceHook, oldminor = LibStub:NewLibrary(ACEHOOK_MAJOR, ACEHOOK_MINOR) if not AceHook then return end -- No upgrade needed @@ -478,10 +478,10 @@ function AceHook:UnhookAll() for key, value in pairs(registry[self]) do if type(key) == "table" then for method in pairs(value) do - self:Unhook(key, method) + AceHook.Unhook(self, key, method) end else - self:Unhook(key) + AceHook.Unhook(self, key) end end end diff --git a/Libs/EMALibActionButton-1.0.lua b/Libs/EMALibActionButton-1.0.lua index 1ba1c07..80d36c8 100644 --- a/Libs/EMALibActionButton-1.0.lua +++ b/Libs/EMALibActionButton-1.0.lua @@ -30,6 +30,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. the file was edit for Ema by Jennifer cally 2016-2020 9.0 ]] + local MAJOR_VERSION = "EMALibActionButton-1.0" local MINOR_VERSION = 75 @@ -56,6 +57,15 @@ local str_match, format, tinsert, tremove = string.match, format, tinsert, tremo -- GLOBALS: RANGE_INDICATOR, SetBinding, SetBindingClick, SetClampedTextureRotation, SpellFlyout, TOOLTIP_UPDATE_TIME, UIParent, ZoneAbilityFrame +local function isClassicBuild() + local isClassicBuild = false + local _, _, _, tocversion = GetBuildInfo() + if tocversion >= 10000 and tocversion <= 30000 then + isClassicBuild = true + end + return isClassicBuild +end + local KeyBound = LibStub("LibKeyBound-1.0", true) local CBH = LibStub("CallbackHandler-1.0") local LBG = LibStub("LibButtonGlow-1.0", true) @@ -710,7 +720,9 @@ function InitializeEventHandler() lib.eventFrame:RegisterEvent("ACTIONBAR_SLOT_CHANGED") lib.eventFrame:RegisterEvent("UPDATE_BINDINGS") lib.eventFrame:RegisterEvent("UPDATE_SHAPESHIFT_FORM") - lib.eventFrame:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR") + if isClassicBuild() == false then + lib.eventFrame:RegisterEvent("UPDATE_VEHICLE_ACTIONBAR") + end lib.eventFrame:RegisterEvent("PLAYER_MOUNT_DISPLAY_CHANGED") lib.eventFrame:RegisterEvent("ACTIONBAR_UPDATE_STATE") @@ -719,14 +731,18 @@ function InitializeEventHandler() lib.eventFrame:RegisterEvent("PLAYER_TARGET_CHANGED") lib.eventFrame:RegisterEvent("TRADE_SKILL_SHOW") lib.eventFrame:RegisterEvent("TRADE_SKILL_CLOSE") - lib.eventFrame:RegisterEvent("ARCHAEOLOGY_CLOSED") + if isClassicBuild() == false then + lib.eventFrame:RegisterEvent("ARCHAEOLOGY_CLOSED") + end lib.eventFrame:RegisterEvent("PLAYER_ENTER_COMBAT") lib.eventFrame:RegisterEvent("PLAYER_LEAVE_COMBAT") lib.eventFrame:RegisterEvent("START_AUTOREPEAT_SPELL") lib.eventFrame:RegisterEvent("STOP_AUTOREPEAT_SPELL") lib.eventFrame:RegisterEvent("UNIT_ENTERED_VEHICLE") lib.eventFrame:RegisterEvent("UNIT_EXITED_VEHICLE") - lib.eventFrame:RegisterEvent("COMPANION_UPDATE") + if isClassicBuild() == false then + lib.eventFrame:RegisterEvent("COMPANION_UPDATE") + end lib.eventFrame:RegisterEvent("UNIT_INVENTORY_CHANGED") lib.eventFrame:RegisterEvent("LEARNED_SPELL_IN_TAB") lib.eventFrame:RegisterEvent("PET_STABLE_UPDATE") @@ -734,7 +750,9 @@ function InitializeEventHandler() lib.eventFrame:RegisterEvent("SPELL_ACTIVATION_OVERLAY_GLOW_SHOW") lib.eventFrame:RegisterEvent("SPELL_ACTIVATION_OVERLAY_GLOW_HIDE") lib.eventFrame:RegisterEvent("SPELL_UPDATE_CHARGES") - lib.eventFrame:RegisterEvent("UPDATE_SUMMONPETS_ACTION") + if isClassicBuild() == false then + lib.eventFrame:RegisterEvent("UPDATE_SUMMONPETS_ACTION") + end lib.eventFrame:RegisterEvent("SPELL_UPDATE_ICON") -- With those two, do we still need the ACTIONBAR equivalents of them? @@ -1657,13 +1675,13 @@ Spell.GetTexture = function(self) return GetSpellTexture(self._stat Spell.GetCharges = function(self) return GetSpellCharges(self._state_action) end Spell.GetCount = function(self) return GetSpellCount(self._state_action) end Spell.GetCooldown = function(self) return GetSpellCooldown(self._state_action) end -Spell.IsAttack = function(self) return IsAttackSpell(FindSpellBookSlotBySpellID(self._state_action), "spell") end -- needs spell book id as of 4.0.1.13066 +Spell.IsAttack = function(self) if FindSpellBookSlotBySpellID(self._state_action)==nil then return false end return IsAttackSpell(FindSpellBookSlotBySpellID(self._state_action), "spell") end Spell.IsEquipped = function(self) return nil end Spell.IsCurrentlyActive = function(self) return IsCurrentSpell(self._state_action) end Spell.IsAutoRepeat = function(self) return IsAutoRepeatSpell(FindSpellBookSlotBySpellID(self._state_action), "spell") end -- needs spell book id as of 4.0.1.13066 Spell.IsUsable = function(self) return IsUsableSpell(self._state_action) end Spell.IsConsumableOrStackable = function(self) return IsConsumableSpell(self._state_action) end -Spell.IsUnitInRange = function(self, unit) return IsSpellInRange(FindSpellBookSlotBySpellID(self._state_action), "spell", unit) end -- needs spell book id as of 4.0.1.13066 +Spell.IsUnitInRange = function(self, unit) if FindSpellBookSlotBySpellID(self._state_action)==nil then return false end return IsSpellInRange(FindSpellBookSlotBySpellID(self._state_action), "spell", unit) end Spell.SetTooltip = function(self) return GameTooltip:SetSpellByID(self._state_action) end Spell.GetSpellId = function(self) return self._state_action end diff --git a/Libs/EbonyUtilities.lua b/Libs/EbonyUtilities.lua new file mode 100644 index 0000000..c82724d --- /dev/null +++ b/Libs/EbonyUtilities.lua @@ -0,0 +1,344 @@ +-- ================================================================================ -- +-- EMA - ( Ebony's MultiBoxing Assistant ) -- +-- Current Author: Jennifer Cally (Ebony) -- +-- -- +-- License: MIT License 2018-2020 Jennifer Cally -- +-- -- +-- Some Code Used from "Jamba" that is -- +-- Released under the MIT License -- +-- "Jamba" Copyright 2008-2015 Michael "Jafula" Miller -- +-- -- +-- ================================================================================ -- + +-- Localization debugging. +--GAME_LOCALE = "frFR" + +local MAJOR, MINOR = "EbonyUtilities-1.0", 1 +local EbonyUtilities, oldMinor = LibStub:NewLibrary( MAJOR, MINOR ) + +if not EbonyUtilities then + return +end + +-- Code modified from http://lua-users.org/wiki/CopyTable +function EbonyUtilities:CopyTable(object) + local lookup_table = {} + local function _copy(object) + if type(object) ~= "table" then + return object + elseif lookup_table[object] then + return lookup_table[object] + end + local new_table = {} + lookup_table[object] = new_table + for index, value in pairs(object) do + new_table[_copy(index)] = _copy(value) + end + return setmetatable(new_table, getmetatable(object)) + end + return _copy(object) +end + +function EbonyUtilities:ClearTable( object ) + for key in next, object do + if type( object[key] ) == "table" then + EbonyUtilities:ClearTable( object[key] ) + end + object[key] = nil + end +end + +function EbonyUtilities:GetStatusPercent(val, max) + if (max > 0) then + return (val / max) + end + return 1.0 +end + +function EbonyUtilities:Lowercase( name ) + if name ~= nil then + return string.utf8lower( name ) + end +end + +function EbonyUtilities:AddRealmToNameIfMissing( name ) + if name == nil then + return + end + Name = name:gsub("^%l", string.upper ) + fullName = Name:gsub( "%s+", "") + local matchDash = fullName:find( "-" ) + if not matchDash then + local k = GetRealmName() + local realm = k:gsub( "%s+", "") + fullName = fullName.."-"..realm + end + return fullName +end + +-- Capitalise the name. +function EbonyUtilities:Capitalise( name ) + if name ~= nil then + return string.utf8upper( string.utf8sub( name, 1, 1 ) )..string.utf8lower( string.utf8sub( name, 2 ) ) + end +end + +function EbonyUtilities:AddRealmToNameIfNotNil( name, realm ) + local fullName = name + if realm ~= nil and realm:trim() ~= "" then + fullName = name.."-"..realm + end + return fullName +end + +-- Money constants. +EbonyUtilities.COLOUR_COPPER = "eda55f" +EbonyUtilities.COLOUR_SILVER = "c7c7cf" +EbonyUtilities.COLOUR_GOLD = "ffd700" +EbonyUtilities.COPPER_PER_SILVER = 100; +EbonyUtilities.SILVER_PER_GOLD = 100; +EbonyUtilities.COPPER_PER_GOLD = EbonyUtilities.COPPER_PER_SILVER * EbonyUtilities.SILVER_PER_GOLD; + +-- value - the amount of money to display formatted. +-- Creates a money string from the value passed; don't pass negative values! +function EbonyUtilities:FormatMoneyString( value ) + local gold = floor( value / ( EbonyUtilities.COPPER_PER_SILVER * EbonyUtilities.SILVER_PER_GOLD ) ); + local silver = floor( ( value - ( gold * EbonyUtilities.COPPER_PER_SILVER * EbonyUtilities.SILVER_PER_GOLD ) ) / EbonyUtilities.COPPER_PER_SILVER ); + local copper = mod( value, EbonyUtilities.COPPER_PER_SILVER ); + local goldFormat = format( "|cff%s%d|r", EbonyUtilities.COLOUR_GOLD, gold ) + local silverFormat = format( "|cff%s%02d|r", EbonyUtilities.COLOUR_SILVER, silver ) + local copperFormat = format( "|cff%s%02d|r", EbonyUtilities.COLOUR_COPPER, copper ) + if gold <=0 then + goldFormat = "" + if silver <= 0 then + silverFormat = "" + end + end + return strtrim(goldFormat.." "..silverFormat.." "..copperFormat) +end + +-- A little toy to retun Gold, silver and copper for mail use +function EbonyUtilities:MoneyString( value ) + local gold = floor( value / ( EbonyUtilities.COPPER_PER_SILVER * EbonyUtilities.SILVER_PER_GOLD ) ); + local silver = floor( ( value - ( gold * EbonyUtilities.COPPER_PER_SILVER * EbonyUtilities.SILVER_PER_GOLD ) ) / EbonyUtilities.COPPER_PER_SILVER ); + local copper = mod( value, EbonyUtilities.COPPER_PER_SILVER ); + if gold <=0 then + goldFormat = "" + if silver <= 0 then + silverFormat = "" + end + end + return gold, silver, copper +end + + +-- A little toy to retun Gold, silver and copper for formatted use. +function EbonyUtilities:MoneyStringFormatted( value ) + local gold = floor( value / ( EbonyUtilities.COPPER_PER_SILVER * EbonyUtilities.SILVER_PER_GOLD ) ); + local silver = floor( ( value - ( gold * EbonyUtilities.COPPER_PER_SILVER * EbonyUtilities.SILVER_PER_GOLD ) ) / EbonyUtilities.COPPER_PER_SILVER ); + local copper = mod( value, EbonyUtilities.COPPER_PER_SILVER ); + if gold <=0 then + goldFormat = "" + if silver <= 0 then + silverFormat = "" + end + end + return BreakUpLargeNumbers(gold), silver, copper +end + + +-- itemLink - the item link to extract an item id from. +-- Gets an item id from an item link. Returns nil, if an item id could not be found. +function EbonyUtilities:GetItemIdFromItemLink( itemLink ) + if itemLink == nil then + return + end + local itemIdFound = nil + local itemStringStart, itemStringEnd, itemString = itemLink:find( "^|c%x+|H(.+)|h%[.*%]" ) + if itemStringStart then + local matchStart, matchEnd, itemId = itemString:find( "(item:%d+)" ) + if matchStart then + itemIdFound = itemId + end + end + return itemIdFound +end + +-- itemLink1 - the first item link to compare. +-- itemLink2 - the second item link to compare. +-- Compares two itemlinks to see if they both refer to the same item. Return true if they do, false if they don't. +function EbonyUtilities:DoItemLinksContainTheSameItem( itemLink1, itemLink2 ) + local theSame = false + local itemId1 = EbonyUtilities:GetItemIdFromItemLink( itemLink1 ) + local itemId2 = EbonyUtilities:GetItemIdFromItemLink( itemLink2 ) + if itemId1 ~= nil and itemId2 ~= nil then + if itemId1 == itemId2 then + theSame = true + end + end + return theSame +end + +-- state - string value containing "on" or "off". +-- onCommand - string that is equivalent to true, like "on". +-- offCommand - string that is equivalent to false, like "off". +-- Returns true for "on"; false for "off"; nil for invalid. +function EbonyUtilities:GetOnOrOffFromCommand( state, onCommand, offCommand ) + local setToOn = nil + state = state:lower():trim() + if state == onCommand then + setToOn = true + end + if state == offCommand then + setToOn = false + end + return setToOn +end + +-- Check for a buff. +function EbonyUtilities:DoesThisCharacterHaveBuff( buffName ) + local hasBuff = false + local iterateBuffs = 1 + local buff = UnitBuff( "player", iterateBuffs ) + while buff ~= nil do + if buff == buffName then + hasBuff = true + break + end + iterateBuffs = iterateBuffs + 1 + buff = UnitBuff( "player", iterateBuffs ) + end + return hasBuff +end + +function EbonyUtilities:FixValueToRange( value, minValue, maxValue ) + if value < minValue then + value = minValue + end + if value > maxValue then + value = maxValue + end + return value +end + +function EbonyUtilities:MerchantFrameIsShown() + local Show = false + if MerchantFrame:IsVisible() == true then + Show = true + else + if IsAddOnLoaded("TradeSkillMaster" ) == true then + if TSM_API.IsUIVisible("VENDORING") == true then + Show = true + end + end + end + return Show +end + +function EbonyUtilities:CheckIsFromMyRealm( name ) + --print("test", name) + local sameRealm = false + if name ~= nil then + local player, realm = strsplit( "-", name, 2 ) + local myRealm = string.gsub(GetRealmName(), "%s+", "") + if realm == myRealm then + --print("Real SameRealm") + sameRealm = true + else + local connectedServers = GetAutoCompleteRealms() + if connectedServers then --Check if realm matches any realm in our connection + for i = 1, #connectedServers do + if realm == connectedServers[i] then + --print("connectedRealm") + sameRealm = true + end + end + else + --print("NotFromARealm") + sameRealm = false + end + end + end + return sameRealm +end + +function EbonyUtilities:InTagList( tag ) + local isInTagList = false + if JambaApi.DoesGroupExist( tag ) then + isInTagList = true + end + return isInTagList +end + +function EbonyUtilities:TooltipScaner(item) + local text = nil + local text2 = nil + if item ~= nil then + local tooltipName = "EMAScanner" + local tooltipScanner = CreateFrame("GameTooltip", tooltipName, nil, "GameTooltipTemplate") + tooltipScanner:SetOwner( WorldFrame, "ANCHOR_NONE") + tooltipScanner:SetHyperlink(item) + local tooltipText = _G[tooltipName.."TextLeft2"]:GetText() + local tooltipTextTwo = _G[tooltipName.."TextLeft3"]:GetText() + --print("test", tooltipTextTwo) + text = tooltipText + text2 = tooltipTextTwo + --print("test9", text, text2) + --tooltipScanner:Hide() + tooltipScanner:Hide() + tooltipScanner:ClearLines() + end + + return text, text2 +end + +-- We should Not need this anymore but its always here incase! using ItemMixIn +function EbonyUtilities:ToolTipBagScaner(item, bag, slot) + --print("test", item, bag, slot ) + if item ~= nil or bag ~= nil or slot ~= nil then + local boe = nil + local ilvl = nil + local tooltipName = "EMABagScanner" + local tooltipbagScanner = CreateFrame("GameTooltip", tooltipName , nil, "GameTooltipTemplate") + tooltipbagScanner:SetOwner(UIParent, "ANCHOR_NONE") + tooltipbagScanner:SetBagItem(bag, slot) + tooltipbagScanner:Show() + for i = 1,6 do + local t = _G[tooltipName.."TextLeft"..i]:GetText() + --print("test", t) + if (t == ITEM_SOULBOUND) then + boe = ITEM_SOULBOUND + end + end + tooltipbagScanner:Hide() + return boe + end +end + +-- GetPetOwner +function EbonyUtilities:getPetOwner( petName ) + --print(petName) + if petName ~= nil then + local tooltipName = "EMAPetScanner" + local tooltipPetScanner = CreateFrame("GameTooltip", tooltipName, nil, "GameTooltipTemplate") + tooltipPetScanner:ClearLines() + tooltipPetScanner:SetOwner(WorldFrame, "ANCHOR_NONE") + tooltipPetScanner:SetUnit( petName ) + local ownerName = _G[tooltipName.."TextLeft2"]:GetText() -- This is the line with <[Player]'s Pet> + if not ownerName then + return nil + end + local owner, _ = string.split("'",ownerName) + tooltipPetScanner:Hide() + return owner -- This is the pet's owner + -- print(owner) + end +end + +function EbonyUtilities:endsWith(str, ending) + if str ~= nil then + return str:match(ending .. '$') + else + return false + end +end diff --git a/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua b/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua index 55aa35f..c14eee7 100644 --- a/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua +++ b/Libs/LibBagUtils-1.0/LibBagUtils-1.0.lua @@ -32,10 +32,20 @@ local GetTime=GetTime local GetContainerNumSlots, GetContainerNumFreeSlots = GetContainerNumSlots, GetContainerNumFreeSlots local GetContainerItemLink,GetContainerItemInfo = GetContainerItemLink,GetContainerItemInfo local GetItemInfo, GetItemFamily = GetItemInfo, GetItemFamily + -- GLOBALS: error, geterrorhandler, PickupContainerItem -- GLOBALS: CursorHasItem, ClearCursor, GetCursorInfo -- GLOBALS: DEFAULT_CHAT_FRAME, SELECTED_CHAT_FRAME +local function isClassicBuild() + local isClassicBuild = false + local _, _, _, tocversion = GetBuildInfo() + if tocversion >= 10000 and tocversion <= 30000 then + isClassicBuild = true + end + return isClassicBuild +end + local BANK_CONTAINER = BANK_CONTAINER -- local KEYRING_CONTAINER = KEYRING_CONTAINER local NUM_BANKBAGSLOTS = NUM_BANKBAGSLOTS @@ -259,7 +269,9 @@ for k,v in pairs(bags.BANK) do end -- Reagent Bank -bags.REAGENTBANK[REAGENTBANK_CONTAINER] = REAGENTBANK_CONTAINER +if isClassicBuild() == false then + bags.REAGENTBANK[REAGENTBANK_CONTAINER] = REAGENTBANK_CONTAINER +end local function iterbags(tab, cur) cur = next(tab, cur) diff --git a/Libs/changelog-Ace3-r1252.txt b/Libs/changelog-Ace3-r1252.txt new file mode 100644 index 0000000..54fa71b --- /dev/null +++ b/Libs/changelog-Ace3-r1252.txt @@ -0,0 +1,441 @@ +Ace3 Release - Revision r1252 (May 17th, 2021) +-------------------------------------------------- +- AceConfigDialog-3.0: Increased the frame level of dialogs to allow other addons to draw below them. +- AceConfigDialog-3.0: The validation/confirmation popup is now opaque and not click-through, to avoid accidentally activating options below it. +- AceHook-3.0: Allow UnhookAll to be used without embedding (Fixes #558) + +Ace3 Release - Revision r1241 (October 13th, 2020) +-------------------------------------------------- +- AceAddon-3.0: Suppress more Blizzard addon load events from activating Ace3 addons "too early", causing loading issues. +- AceGUI-3.0: Updated for Backdrop changes in WoW 9.0 +- AceGUI-3.0: Re-structured widget releasing to avoid recursive release in some circumstances +- AceGUI-3.0: Label: Anchors are being refreshed when the font is changed (Ticket #540) +- AceGUI-3.0: Dropdown: Initialize the widget with an empty list so that AddItem can be used on a fresh dropdown (Ticket #542) + +Ace3 Release - Revision r1227 (August 12th, 2019) +------------------------------------------------- +- AceConfigDialog-3.0: Fixed an issue with a missing template on WoW Classic (Ticket #517) + +Ace3 Release - Revision r1224 (August 1st, 2019) +------------------------------------------------ +- AceConfigDialog-3.0: Replace use of StaticPopup with a custom frame to minimize taint +- AceGUI-3.0: Ensure the OnLeave callback on various widgets still fires when its being released while visible (Ticket #505) +- AceGUI-3.0: Various fixes for anchoring problems in WoW 8.2 (Ticket #512, and other reports) + +Ace3 Release - Revision r1214 (June 26th, 2019) +----------------------------------------------- +- AceConfigDialog-3.0: Exposed "select" type sorting control through a new "sorting" config table member +- AceConfigDialog-3.0: Clear existing anchors on the GameTooltip before re-anchoring it for 8.2 compatibility +- AceConfigDialog-3.0: Improved options table sorting algorithm to produce a stable result in certain edge cases (Ticket #501) +- AceConfigRegistry-3.0: Added missing custom controls entries for all types added in the last release (Ticket #494) +- AceGUI-3.0: ColorPicker: Removed usage of Show/HideUIPanel for WoW 8.2 compatibiliy +- AceGUI-3.0: DropDown: Improved dropdown sorting algorithm to support tables with mixed string and numeric keys + +Ace3 Release - Revision r1200 (January 24th, 2019) +-------------------------------------------------- +- Cleanup for WoW 8.0 improvements +- AceGUI-3.0: Worked around various quirks in the WoW 8.0/8.1 API +- AceGUI-3.0: ColorPicker: Store references to the background/checkers textures (Ticket #473) +- AceConfigDialog-3.0: Allow custom controls for almost all option types (Ticket #475) + +Ace3 Release - Revision r1182 (July 17th, 2018) +----------------------------------------------- +- AceComm-3.0: Support numeric targets for custom channels (Ticket #419) +- AceComm-3.0/ChatThrottleLib: Updated for WoW 8.0 API changes +- AceConfig-3.0: Allow number values for the "width" parameter, which acts as a multiplier of the default width +- AceConfigDialog-3.0: Enable iconCoords for the main level of a tree group (Ticket #417) +- AceGUI-3.0: Implement a Table Layout (#442) +- AceGUI-3.0: EditBox: Only try to handle dragging if a valid object is being dragged into the text box +- AceGUI-3.0: Various fixes and work-arounds for WoW 8.0 changes + +Ace3 Release - Revision r1166 (August 29th, 2017) +------------------------------------------------- +- Updated any use of PlaySound to the new numeric constants (Fix for WoW 7.3) +- AceConfigDialog-3.0: implement fallback validation feedback in a StaticPopup (Ticket #2) + +Ace3 Release - Revision r1158 (March 28th, 2017) +------------------------------------------------ +- AceGUI-3.0: Fire OnShow events from Frame and Windows containers (Ticket #396) +- AceGUI-3.0: Add SetJustifyV/H API to the Label/InteractiveLabel widgets (Ticket #397) + +Ace3 Release - Revision r1151 (July 18th, 2016) +----------------------------------------------- +- AceConfig-3.0: Allow specifying images using the numeric fileID (Ticket #389) +- AceGUI-3.0: Use SetColorTexture in WoW 7.0 +- AceGUI-3.0: Expose the HighlightText API for EditBox and MultiLineEditBox Widgets (Ticket #378) +- AceGUI-3.0: Keybinding: Support MouseWheel Up/Down bindings (Ticket #372) +- AceGUI-3.0: TreeGroup: Refresh the tree in an OnUpdate once after Acquire, not only after creation (Fixes missing tree in WoW 7.0) +- AceSerializer-3.0: Create consistent tokens for infinity, independent of the clients platform + +Ace3 Release - Revision r1134 (June 23rd, 2015) +----------------------------------------------- +- AceGUI-3.0: TreeGroup: Prevent Word Wrap in tree elements + +Ace3 Release - Revision r1128 (February 24th, 2015) +--------------------------------------------------- +- AceGUI-3.0: Fixed an error in GameTooltip handling causing wrong formatting in some cases + +Ace3 Release - Revision r1122 (October 14th, 2014) +-------------------------------------------------- +- AceDB-3.0: Now using the GetCurrentRegion() API to determine region-based profile keys (fix for WoW 6.0) +- AceComm-3.0: Update ChatThrottleLib to v23 +- AceConfigDialog-3.0: Show a more meaningful title on Blizzard Options Groups (Ticket #353) +- AceGUI-3.0: ColorPicker: Frame Level is automatically increased to ensure the color picker frame is above the option panel +- AceGUI-3.0: DropDown: Properly disable all clickable areas when the dropdown is disabled (Ticket #360) +- AceHook-3.0: Always use HookScript when hooking scripts in a secure fashion (Ticket #338) +- AceTimer-3.0: New timer implementation based on C_Timer.After + +Ace3 Release - Revision r1109 (February 19th, 2014) +--------------------------------------------------- +- AceComm-3.0: Ambiguate addon comm messages to restore behavior to be identical to pre-5.4.7 +- AceConfigRegistry-3.0: Added an option to skip options table validation on registering + +Ace3 Release - Revision r1104 (October 31st, 2013) +-------------------------------------------------- +- AceGUI-3.0: Flow Layout: Added a safeguard to prevent an infinite loop in the layout engine +- AceGUI-3.0: DropDown: Adjust its style slightly to closer resemble the Blizzard DropDown Widget +- AceGUI-3.0: DropDown: API enhancements to specify the width of the pullout and be notified when its opened + +Ace3 Release - Revision r1098 (September 13th, 2013) +---------------------------------------------------- +- AceDB-3.0: Switch characters to the default profile if their active profile is deleted (Ticket #324) +- AceConfigDialog-3.0: Try to prevent static popup taint (Ticket #322) +- AceGUI-3.0: Button: Add a new "Auto Width" option (Ticket #310) +- AceGUI-3.0: DropDown: Make the entire DropDown widget clickable (Ticket #339) +- AceGUI-3.0: EditBox: Allow dragging macros to the editbox (which will then contain the macros name) (Ticket #337) +- AceGUI-3.0: Slider: Add a workaround for the broken slider steps in WoW 5.4 (Ticket #346) +- AceGUI-3.0: TreeGroup: Fix an issue introduced by 5.4 broken scrollbars (Ticket #345) +- AceHook-3.0: Allow hooking of AnimationGroup scripts (Ticket #314) + +Ace3 Release - Revision r1086 (May 21st, 2013) +---------------------------------------------- +- AceAddon-3.0: Improved behavior when loading modules during game startup, ensures proper loading order + +Ace3 Release - Revision r1083 (March 4th, 2013) +----------------------------------------------- +- AceTimer-3.0: Fixed an issue that caused the parameter list passed to the callback to be cut off at nil values +- AceGUI-3.0: InlineGroup: The title attribute is properly reset for recycled objects + +Ace3 Release - Revision r1078 (February 10th, 2013) +--------------------------------------------------- +- AceTimer-3.0: Re-write based on AnimationTimers +- AceHook-3.0: Improved checks/error messages when trying to hook a script on a "nil" frame +- AceDBOptions-3.0: Added Italian locale +- AceGUI-3.0: BlizOptionsGroup: Fixed the "default" button callback +- AceGUI-3.0: Colorpicker: The colorpicker is now clamped to the screen + +Ace3 Release - Revision r1061 (August 27th, 2012) +------------------------------------------------- +- AceConfigDialog-3.0: Try to avoid potential taints in static popup dialogs +- AceConfigDialog-3.0: Sort multiselects with "radio" style +- AceGUI-3.0: Support for WoW 5.0 +- AceGUI-3.0: MultiLineEditBox: Support shift-click'ing items/spells/etc. into the editbox +- AceGUI-3.0: Label: Fix text alignment (Ticket #301) +- AceGUI-3.0: Checkbox: Description text on a disable checkbox should look disabled (Ticket #304) +- AceGUI-3.0: Keybinding: Ensure the Keybinding popup is on the top level (Ticket #305) + +Ace3 Release - Revision r1041 (November 29th, 2011) +--------------------------------------------------- +- AceDB-3.0: Added locale and factionrealmregion profile keys +- AceSerializer-3.0: Removed support for NaN, as WoW 4.3 does no longer allow it. +- AceGUI-3.0: Frame: Add :EnableResize (Ticket #214) + +Ace3 Release - Revision r1032 (June 29th, 2011) +----------------------------------------------- +- AceTab-3.0: Improvements to Match handling (Ticket #255 and #256) +- AceGUI-3.0: DropDown layout fix with hidden labels (Ticket #234) + +Ace3 Release - Revision r1025 (April 27th, 2011) +------------------------------------------------ +- AceComm-3.0: Updated for 4.1 changes - now handles RegisterAddonMessagePrefix internally for you. +- AceGUI-3.0: TabGroup: Fixed width of tabs in 4.1(Ticket #243) + +Ace3 Release - Revision r1009 (February 9th, 2011) +-------------------------------------------------- +- AceLocale-3.0: Fix erronous assumption that the default locale is always the first to be registered for the :NewLocale() "silent" flag. The flag must now be set on the FIRST locale to be registered. +- AceLocale-3.0: The :NewLocale() "silent" flag may now be set to the string "raw", meaning nils are returned for unknown translations. +- AceGUI-3.0: Fix the disabled state of Icon widgets +- AceGUI-3.0: The header of the Frame widget now dynamically changes size to fit the text (Ticket #171) +- AceGUI-3.0: Its now possible to define a custom order the elements in a dropdown widget +- AceGUI-3.0: Improved widget focus behaviour across the board (Ticket #192, #193) +- AceGUI-3.0: Fixed a bug that made it impossible to block the tree widget from being user resizable (Ticket #163) +- AceGUI-3.0: Fixed a bug that caused TreeGroups to become unresponsive under certain conditions (Ticket #189, #202) +- AceGUI-3.0: Enhanced the DropDown widget to allow it to be reused more easily. +- AceConfigDialog-3.0: Select Groups now have the proper order in the dropdown (Ticket #184) +- AceConfigDialog-3.0: Implemented "radio" style select boxes (Ticket #149) + +Ace3 Release - Revision r981 (October 27th, 2010) +------------------------------------------------- +- AceAddon-3.0: Fixed a library upgrading issue +- AceAddon-3.0: Modules are now enabled in loading order +- AceGUI-3.0: Keybinding: The widget will no longer steal keybindings even when inactive (Ticket #169) +- AceGUI-3.0: EditBox: Fixed spell drag'n'drop + + +Ace3 Release - Revision r971 (October 12th, 2010) +------------------------------------------------- +- Small fixes and adjustments for the 4.0 Content Patch. +- AceGUI-3.0: ScrollFrame: Allow for a small margin of error when determining if the scroll bar should be shown. +- AceGUI-3.0: Added new widget APIs: GetText for EditBox and DisableButton for MultiLineEditBox + +Ace3 Release - Revision r960 (July 20th, 2010) +---------------------------------------------- +- AceGUI-3.0: Label: Reset Image Size and TexCoords on Acquire (Ticket #110) +- AceGUI-3.0: CheckBox: Re-apply the disabled state after setting a value, so the visuals are correct in either case. (Ticket #107) +- AceGUI-3.0: Icon: Fix the vertical size. It'll now properly scale with the image size, and not be fixed to about 110px. (Ticket #104) +- AceGUI-3.0: External Containers (Frame, Window) should always start in a visible state. (Ticket #121) +- AceGUI-3.0: Added Blizzard sounds to widgets (Ticket #120) +- AceGUI-3.0: CheckBox: check for self.desc:GetText() being nil as well as "" to prevent setting the wrong height on the checkbox causing bouncing checkboxes. +- AceGUI-3.0: Rewrite of the MultiLineEditBox (Ticket #68) +- AceGUI-3.0: CheckBox: Fix alignment of the text in OnMouseDown when an image is set. (Ticket #142) +- AceGUI-3.0: Add SetMaxLetters APIs to EB and MLEB (Ticket #135) +- AceGUI-3.0: Frame: Add events for OnEnter/OnLeave of the statusbar (Ticket #139) +- AceGUI-3.0: Major cleanups and refactoring in nearly all widgets and containers. +- AceConfigDialog-3.0: Always obey the min/max values on range-type widgets (Ticket #114) +- AceConfigDialog-3.0: Pass iconCoords set on groups in the options table to the tree widget (Ticket #111) +- AceConfigDialog-3.0: Implement "softMin" and "softMax", allowing for a UI-specific minimum/maximum for range controls, while allowing manual input of values in the old min/max range. (Ticket #123) +- AceConfigDialog-3.0: Don't close frames in CloseAll that are being opened after the CloseAll event was dispatched. (Ticket #132). +- AceSerializer-3.0: Fix encoding & decoding of \030. (Ticket #115) +- AceDB-3.0: Remove empty sections on logout, keeping the SV clean of more useless informations. +- AceDBOptions-3.0.lua: Fix a string typo (Ticket #141) + +Ace3 Release - Revision r907 (December 16th, 2009) +--------------------------------------------------- +- AceGUI-3.0: Frame: Properly save the width in the status table. +- AceConfigCmd-3.0: Properly handle help output of inline groups with a different handler. (Ticket #101) +- AceConfigDialog-3.0: Don't bail out and error when a dialogControl was invalid, instead show the error and fallback to the default control for that type. +- AceConfigDialog-3.0: Fix a hickup with the OnUpdate script not getting upgraded properly in some situations. + +Ace3 Release - Revision r900 (December 8th, 2009) +-------------------------------------------------- +- AceGUI-3.0: Alot of visual fixes regarding margins and general widget styles. +- AceGUI-3.0: Ability to accept links for EditBox Widget (Ticket #21) +- AceGUI-3.0: ScrollFrame: Hide the scrollbar when there is no overflowing content, and allow the Layout functions to use that space for widgets. +- AceGUI-3.0: DropDown: Added a GetValue() API to the Widget (Ticket #69) +- AceGUI-3.0: Button: Pass the arguments of the OnClick handler to the OnClick callback (Ticket #57) +- AceGUI-3.0: add a Window container, basically a plain window with close button +- AceGUI-3.0: Add support for inline descriptions to the checkbox widget. +- AceGUI-3.0: Added an API to the Window container to disable the user-resizing of the same. (Ticket #80) +- AceGUI-3.0: TreeGroup: Allow iconCoords to be passed for the tree elements. (Ticket #59) +- AceGUI-3.0: Slider: Add a more visible backdrop/border around the manual input area (Ticket #98, #46) +- AceGUI-3.0: Allow displaying a image in front of the checkbox label. (Ticket #82) +- AceConfig-3.0: Added an experimental "descStyle" member to all option table nodes that allows you to control the way the description is presented. + Supported values are "tooltip" for the old behaviour, and "inline" for a inline display of the description, pending support in AceGUI-3.0 widgets. +- AceConfigCmd-3.0: Properly parse functions and methods supplied for the "hidden" option table member. (Ticket #96) +- AceConfigDialog-3.0: Fix the unpacking of the basepath arguments when internally calling :Open (Ticket #90) +- AceConfigDialog-3.0: Properly refresh BlizOptions Windows which are registered with a path on NotifyChange. (Ticket #93) +- AceConfigDialog-3.0: Allow image/imageCoords on toogle elements (Note that the width/height of the image on the toggle cannot be changed) (Ticket #82) +- AceConfigDialog-3.0: Pass the groups "name" tag to DropDownGroups as the title. (Ticket #79) +- AceDB-3.0: Remove the metatable from the DB before removing defaults, so we don't accidentally invoke it in the process. (Ticket #66) +- AceDB-3.0: Don't save the profileKeys for namespaces, since we use the profile of the parent DB anyway. This will cut down on SV complexity when using alot of namespaces. +- AceDB-3.0: Don't fire the OnProfileReset callback when copying a profile. +- AceDBOptions-3.0: Show the current profile on the dialog. (Ticket #56) +- AceComm-3.0: Add callbacks for message chunks going out the wire (via CTL). Useful for displaying progress for very large messages. +- AceConsole-3.0: Add :Printf() so you don't have to do Print(format()) + +Ace3 Beta - Revision 820 (August 7th, 2009) +-------------------------------------------- +- AceComm-3.0: Updated ChatThrottleLib to v21 +- AceGUI-3.0: Fixed a glitch in the TabGroup code that caused tabs to be unresponsive under rare conditions. (Ticket #38) +- AceGUI-3.0: Consistent "disabled" behaviour of all widgets. (Ticket #47) +- AceGUI-3.0: Changed the way widgets are handled on release to avoid a crash in the game client. (Ticket #49) +- AceGUI-3.0: Fixed a glitch in the button graphics. (Ticket #58) +- AceGUI-3.0: Localized the "Close" Text on the Frame widget. + +Ace3 Beta - Revision 803 (April 14th, 2009) +-------------------------------------------- +- AceConfig-3.0: Allow spaces in the keys of config tables. Spaces will be changed on the fly to underscores in AceConfigCmd-3.0 - there is no collision check in place, yet. +- AceConfig-3.0: Support a "fontSize" attribute to the description type. Possible values are "small" (default), "medium" and "large". +- AceConfigDialog-3.0: Fixed an error that would occur when calling InterfaceOptionsFrame_OpenToCategory from within an event handler in a Blizzard Options integrated frame. (Ticket #33) +- AceConfigDialog-3.0: The "execute" type does now recognize the "image" attributes, and will display a clickable icon instead of the button when an image is supplied. (Ticket #35) +- AceConfigDialog-3.0: Pass icons defined in the option table to the TreeGroup widget (Ticket #20) +- AceConfigDialog-3.0: Fixed a bug that caused an empty group widget to be drawn if all groups were hidden. +- AceConfigCmd-3.0: Improved the behaviour of select and multiselect elements. (Ticket #26) +- AceDB-3.0: Add a GetNamespace function to the DB Objects which returns an existing namespace from the DB object. +- AceGUI-3.0 Slider Widget: Properly show percentage values as min/max if isPercent is true. (Ticket #32) +- AceGUI-3.0: Fixed an error in the TreeGroup Widget that caused execution to stop if no name was provided. +- AceGUI-3.0: Fixed the behaviour of the MultiLineEditbox Widget (Accept button not clickable). (Ticket #28) +- AceGUI-3.0: TabGroup: Set a maximum width for tabs based on the size of the widget. (Ticket #34) +- AceGUI-3.0: Added a new InteractiveLabel with OnEnter/OnLeave/OnClick callbacks and a highlight texture +- AceGUI-3.0: Add SetFont and SetFontObject functions to the Label widget (and the new InteractiveLabel) +- AceGUI-3.0: Support icons in the TreeGroup display. (Ticket #20) +- AceGUI-3.0: Added a new :SetRelativeWidth Widget-API that allows you to set the width of widgets relative to their container. +- AceGUI-3.0: Alot of fixes, tweaks and consistency changes. + +Ace3 Beta - Revision 741 (Feb 15th, 2009) +-------------------------------------------- +- AceDBOptions-3.0: Disable the "Copy From" and "Delete" dropdowns if there are no profiles to choose from. (Ticket #19) +- AceGUI-3.0: Improve TabGroup visual style - only stretch them to the full width if they would use more then 75% of the exisiting space. +- AceGUI-3.0: Added a third optional argument to <container>:AddChild() to specify the position for the new widget. (Ticket #22) +- AceConfigCmd-3.0: Improve help output when viewing groups. +- AceConfigDialog-3.0: Refresh the Options Panel after a confirmation is canceled to reset the value to its previous value. (Ticket #23) +- AceDB-3.0: Fix a data inconsistency when using false as a table key. (Ticket #25) + +Ace3 Beta - Revision 722 (Jan 4th, 2009) +-------------------------------------------- +- AceHook-3.0: Fix :SecureHookScript to not fail on previously empty scripts since frame:HookScript does nothing at all in that case. (Ticket #16) +- AceLocale-3.0: Implement 'silent' option for :NewLocale to disable the warnings on unknown entrys (Ticket #18) +- AceTimer-3.0: Implement :TimeLeft(handle) function (Ticket #10) +- AceGUI-3.0: Fix TabGroup tab resizing to be consistent +- AceGUI-3.0: Fixed EditBox alignment when the label is disabled (Ticket #13) +- AceDB-3.0: Implement OnProfileShutdown callback (Ticket #7) +- AceDBOptions-3.0: Updated esES and ruRU locale + +Ace3 Beta - Revision 706 (Oct 18th, 2008) +-------------------------------------------- +- First Beta release after WoWAce move +- Removed WoW 2.4.x compat layer +- AceGUI-3.0: Fix disabling of the Multiline Editbox +- AceGUI-3.0: Improvements to the Keybinding Widget + +Ace3 Beta - Revision 81437 (Sept 6th, 2008) +-------------------------------------------- +- AceConfigDialog-3.0: the confirm callback will now receive the new value that is being set (same signature as the validate callback) +- AceConfigDialog-3.0: :Close and :CloseAll are now safe to call from within callbacks. +- AceGUI-3.0: Added new methods to the widget base table, see ACE-205 for full reference +- AceGUI-3.0: Various fixes to Widgets and recycling process +- Now compatible with WoW 3.0 (compat layer is to be removed upon 3.0 release) + + +Ace3 Beta - Revision 76325 (June 9th, 2008) +-------------------------------------------- +- AceGUI-3.0: Finish Multiselect support for the Dropdown widget (nargiddley) +- AceGUI-3.0: Re-write TabGroup layouting (nargiddley) +- AceGUI-3.0: TreeGroup: Add :EnableButtonTooltips(enable) to make the default tooltips on the tree optional, enabled by default. (nargiddley) +- AceGUI-3.0: TabGroup: Add OnTabEnter and OnTabLeave Callbacks (nargiddley) +- AceConfigDialog-3.0: Add :SelectGroup(appName, ...) - Selects the group given by the path specified then refreshes open windows. (nargiddley) +- AceConfigDialog-3.0: :Open now accepts an optional path, when given will open the window with only the given group and its children visible (nargiddley) +- AceConfigDialog-3.0: :AddToBlizOptions now accepts an optional path, this will add the config page to display the specified group and its children only. (nargiddley) +- AceConfigDialog-3.0: ACE-189: allow multiselect to be shown as a dropdown by setting dialogControl = "Dropdown" (nargiddley) +- AceConfigDialog-3.0: Add Custom tooltips to the TreeGroup and TabGroup, shows both name and desc for the group. (nargiddley) +- AceConfigCmd-3.0: ACE-195: Remove unneeded references to .confirm, will no longer error when .confirm is a boolean (nargiddley) +- AceAddon-3.0: Allow for an optional first argument to NewAddon to be a table to be used as the base for the addon. (ammo) + +Ace3 Beta - Revision 74633 (May 19th, 2008) +-------------------------------------------- +- AceTimer-3.0: ACE-173: don't error on nil handle for CancelTimer(), just bail out early. (ammo) +- AceGUI-3.0: ACE-161, ACE-180, ACE-181: New and improved DropDown widget (originally coded by Borlox) (nargiddley,nevcairiel) +- AceGUI-3.0: AceGUI will call OnWidthSet and OnHeightSet as frames resize (nargiddley) +- AceGUI-3.0: TabGroup: Use OptionsFrameTabButtonTemplate for tabs (nargiddley) +- AceGUI-3.0: TabGroup: Tabs now span multiple lines when there are too many to fit in the width of the frame (nargiddley) +- AceGUI-3.0: TreeGroup: Tree is now sizable by dragging, orig patch by yssaril (nargiddley) +- AceGUI-3.0: Flow layout will now reduce widgets width to fit rather than leaving them sticking out the side of container widgets (nargiddley) +- AceGUI-3.0: Dropdowns will no longer be left open in the background when the frame is clicked or other widgets are activated (nargiddley) +- AceGUI-3.0: ACE-159: Rename Release to OnRelease and Acquire to OnAcquire for widgets. (nargiddley) +- AceGUI-3.0: ACE-171: add IsVisible and IsShown methods to the widget metatable (nargiddley) +- AceGUI-3.0: ACE-164: add tooltips to tree to show full text of childs that got clipped (ammo) +- AceGUI-3.0: ACE-174: make buttons in AceGUI-3.0 locale independant (ammo) +- AceGUI-3.0: ACE-166: fix treegroup visual bug (ammo) +- AceGUI-3.0: ACE-184: make numeric entry for slider more intuitive (ammo) +- AceConfigCmd-3.0: ACE-172 - ignore description in cmd (ammo) +- AceConsole-3.0: nolonger check for existance of slashcommands, overwrite where needed. Last one wins, this enables AddonLoader to X-LoadOn-Slash and override the slashcommand from AddonLoader slashcommand with an Ace3 one. (Ammo) + +Ace3 Beta - Revision 69509 (April 13th, 2008) +--------------------------------------------- +- AceComm-3.0: turn off error messages when receiving invalid multi-part messages (its happening on login etc) (nevcairiel) +- AceDBOptions-3.0: shorten info text at top to prevent scrollbars. (nevcairiel) +- AceHook-3.0: ACE-162: fix unhooking of objects that were not actually hooked (nevcairiel) +- AceDB-3.0: fire the DB callbacks after the namespaces changed their profile as well (nevcairiel) +- AceDB-3.0: namespaces can now be individually reset using :ResetProfile() on the namespace directly (nevcairiel) +- AceDB-3.0: added a optional argument to :ResetProfile to not populate the reset to all namespaces (so the main profile can reset individually without reseting all namespaces too) (nevcairiel) + +Ace3 Beta - Revision 66329 (March 27th, 2008) +--------------------------------------------- +- Overall 2.4 clean ups - removing 2.4 checks and work arounds (nevcairiel) +- AceBucket-3.0: clear the timer reference when unregistering a bucket to prevent a error when unregistering a bucket that was never fired (nevcairiel) +- AceAddon-3.0: Bugfix when enabling/disabling modules from the parents OnEnable after disabling / enabling the parent addon. (ammo) +- AceGUI-3.0: Don't parent the BlizOptionsGroup widget to UIParent and Hide it by default. Fixes stray controls on the screen. (nargiddley) +- AceConfigDialog-3.0: Config windows without a default size won't incorrectly get a default size from a previously open window. (nargiddley) +- AceDBOptions-3.0: added zhCN and zhTW locale (nevcairiel) + +Ace3 Beta - Revision 65665 (March 25th, 2008) +--------------------------------------------- +- AceGUI-3.0: ACE-139: Changed all Widgets to resemble the Blizzard 2.4 Options Style (nevcairiel) +- AceGUI-3.0: Fixed "List"-Layout not reporting new width to "fill"-mode widgets (mikk) +- AceGUI-3.0: added :SetColor to the Label widget (nevcairiel) +- AceGUI-3.0: ACE-132: ColorPicker: added checkers texture for better alpha channel display, and fixed "white"-texture bug (nevcairiel,nargiddley,ammo) +- AceConfig-3.0: ACE-113: Added uiName, uiType, handler, option, type to the info table (nevcairiel,nargiddley) +- AceConfigDialog-3.0: ACE-139: Adjusted for 2.4 options panels (nevcairiel) +- AceConfigDialog-3.0: Use "width" parameter for the description widget (if present) (nevcairiel) +- AceConfigDialog-3.0: ACE-135: Add support for specifying a rowcount for multiline editboxes (nargiddley) +- AceConfigDialog-3.0: :AddToBlizOptions will return the frame registered so you can use it in InterfaceOptionsFrame_OpenToFrame (nevcairiel) +- AceConfigCmd-3.0: handle "hidden" in help-output (nevcairiel) +- AceHook-3.0: fix unhooking of secure hooks (nevcairiel) +- AceDBOptions-3.0: add optional argument to GetOptionsTable(db[, noDefaultProfiles]) - if set to true will not show the default profiles in the profile selection (nevcairiel) +- AceDBOptions-3.0: added koKR locale (nevcairiel) +- Ace3 Standalone: Removed the "Ace3" Category from the 2.4 options panel (nevcairiel) + +Ace3 Beta - Revision 64176 (March 10th, 2008) +--------------------------------------------- +- AceGUI-3.0: Improve Alpha handling for the ColorPicker widget, ColorPicker widget closes the ColorPickerFrame before opening to prevent values getting carried over (nargiddley) +- AceGUI-3.0: The Slider widget will only react to the mousewheel after it has been clicked (anywhere including the label) to prevent accidental changes to the value when trying to scroll the container it is in (nargiddley) +- AceGUI-3.0: The TreeGroup widget is scrollable with the mousewheel (nargiddley) +- AceGUI-3.0: ACE-154: Fix frame levels in more cases to prevent widgets ending up behind their containers (nargiddley) +- AceConfigDialog: Color picker obeys hasAlpha on the color type (nargiddley) +- AceConfigDialog-3.0: ACE-155: Make sure that the selected group is type='group' when checking if it exists (nargiddley) +- AceDBOptions-3.0: added frFR locale (nevcairiel) + +Ace3 Beta - Revision 63886 (March 8th, 2008) +--------------------------------------------- +- AceDBOptions-3.0: new library to provide a Ace3Options table to control the AceDB-3.0 profiles (nevcairiel) +- AceDB-3.0: add "silent" option to DeleteProfile and CopyProfile when we deal with namespaces (nevcairiel) +- AceDB-3.0: implement library upgrade path (nevcairiel) +- AceDB-3.0: ACE-146: fix problem with non-table values overruling ['*']-type defaults (nevcairiel) +- AceConsole-3.0: treat |T|t texture links similar to |H|h|h links. (ammo) +- AceGUI-3.0: Use Blizzard Templates for the EditBox and DropDown widget (nevcairiel) +- AceBucket-3.0: ACE-150: callback is now optional, if not supplied will use the eventname as method name (only possible if one event is supplied, and not a event table) (nevcairiel) +- tests: adjust tests for AceGUI and AceConsole changes (nevcairiel) + +Ace3 Beta - Revision 63220 (Feb 29th, 2008) +--------------------------------------------- +- AceTimer-3.0: CancelAllTimers() now cancels silent (elkano) +- AceConfigDialog: Add :SetDefaultSize(appName, width, height), sets the size the dialog will open to. Does not effect already open windows. (nargiddley) +- AceConfigDialog: Fix typo in type check for range values (nargiddley) +- AceGUI: ColorPicker widget will correctly fire OnValueChanged for the cancel event of the colorpicker popup. Reset ColorPicker's color on Acquire. (nargiddley) +- AceGUI: Fix Spelling of Aquire -> Acquire for widgets, all custom widgets will need to be updated. A warning will be printed for widgets not upgraded yet. (nargiddley) +- AceConfigCmd-3.0: add simple coloring to slashcommand output. (ammo) +- AceConsole-3.0: add some color to :Print (ammo) +- AceAddon-3.0: set error level on library embedding to point to the :NewAddon call (nevcairiel) + +Ace3 Beta - Revision 62182 (Feb 20th, 2008) +--------------------------------------------- +- Ace3 StandAlone: Add a page to the Blizzard 2.4 Interface Options with icons to open dialogs for configs registered when installed standalone (nargiddley) +- AceConfigDialog: type = 'description' now uses the fields image and imageCoords instead of icon and iconCoords, add imageWidth and imageHeight (nargiddley) +- AceConfigDialog: Add :AddToBlizzardOptions(appName, name), this will add the specified config to the Blizzard Options pane new in 2.4. This will only be available if running on the 2.4 PTR (nargiddley) +- AceDB: fix GetProfiles() when setting the same profile twice (nevcairiel) +- AceDB: bail out of :SetProfile early when trying to set to the same profile (nevcairiel) +- AceDB: add nil checks to metatable handling (nevcairiel) +- AceDB: clear tables that are empty after defaults removal (nevcairiel) +- AceGUI: Fix a couple of layout bugs causing the width of groups to be wrong (nargiddley) +- AceGUI: Add Icon widget (nargiddley) +- AceGUI: Allow room for the border in the BlizOptionsGroup widget (nargiddley) +- AceGUI: Button and Keybinding use UIPanelButtonTemplate2 (nargiddley) +- AceConsole-3.0: Fix bug where no table for [self] was created when registering weak commands (ammo) +- AceTimer-3.0: add missing :OnEmbedDisable (ammo) +- AceAddon-3.0: added :GetName() that will always return the "real" name of a addon or module object without any prefixes (nevcairiel) + +Ace3 Beta - Revision 60697 (Feb 9th, 2008) +--------------------------------------------- +- CallbackHandler-1.0: remove unnecessary table creation if a event is fired thats not registered (nevcairiel) +- AceAddon-3.0: fixed a bug with recursive addon loading (nevcairiel) +- AceGUI: Update TabGroup's tablist format, tabs are selected by value not index (nargiddley) +- AceGUI: Add MultiLineEditBox widget (nargiddley, originally by bam) +- AceGUI: Small fix to the flow layout preventing controls overlapping in some cases (nargiddley) +- AceConfigDialog: Implement control and dialogControl for types 'input' and 'select' (nargiddley) +- AceConfigDialog: Add support for multiline = true on type = 'input' (nargiddley) +- AceConfigDialog: Fix an error when all groups are hidden in a group with childGroups = 'select' (nargiddley) +- AceConfigDialog: type = 'description' will now show .icon as an image with its text (nargiddley) +- AceConfigDialog: multiline inputs are no longer forced to width = "full" (nargiddley) +- AceConfigDialog: bug fix when loading without AceConsole present (nevcairiel) + +Ace3 Beta - Revision 60545 (Feb 7th, 2008) +--------------------------------------------- +- AceGUI: SetToplevel(true) for the Frame widget, multiple open windows should play nice together now (nargiddley) +- AceGUI: Move Frames to the FULLSCREEN_DIALOG strata (nargiddley) +- AceGUI: Dropdown, Editbox and Keybinding labels grey out when disabled (nargiddley) +- AceGUI: Add OnClick callback to the TreeGroup widget (nargiddley) +- AceConfigDialog: Confirm popups will be above the config window (nargiddley) + +Ace3 Beta - Revision 60163 (Feb 3rd, 2008) +--------------------------------------------- +- Initial Beta release diff --git a/Libs/changelogAce3-r1244.txt b/Libs/changelogAce3-r1244.txt new file mode 100644 index 0000000..b00755e --- /dev/null +++ b/Libs/changelogAce3-r1244.txt @@ -0,0 +1,435 @@ +Ace3 Release - Revision r1241 (October 13th, 2020) +-------------------------------------------------- +- AceAddon-3.0: Suppress more Blizzard addon load events from activating Ace3 addons "too early", causing loading issues. +- AceGUI-3.0: Updated for Backdrop changes in WoW 9.0 +- AceGUI-3.0: Re-structured widget releasing to avoid recursive release in some circumstances +- AceGUI-3.0: Label: Anchors are being refreshed when the font is changed (Ticket #540) +- AceGUI-3.0: Dropdown: Initialize the widget with an empty list so that AddItem can be used on a fresh dropdown (Ticket #542) + +Ace3 Release - Revision r1227 (August 12th, 2019) +------------------------------------------------- +- AceConfigDialog-3.0: Fixed an issue with a missing template on WoW Classic (Ticket #517) + +Ace3 Release - Revision r1224 (August 1st, 2019) +------------------------------------------------ +- AceConfigDialog-3.0: Replace use of StaticPopup with a custom frame to minimize taint +- AceGUI-3.0: Ensure the OnLeave callback on various widgets still fires when its being released while visible (Ticket #505) +- AceGUI-3.0: Various fixes for anchoring problems in WoW 8.2 (Ticket #512, and other reports) + +Ace3 Release - Revision r1214 (June 26th, 2019) +----------------------------------------------- +- AceConfigDialog-3.0: Exposed "select" type sorting control through a new "sorting" config table member +- AceConfigDialog-3.0: Clear existing anchors on the GameTooltip before re-anchoring it for 8.2 compatibility +- AceConfigDialog-3.0: Improved options table sorting algorithm to produce a stable result in certain edge cases (Ticket #501) +- AceConfigRegistry-3.0: Added missing custom controls entries for all types added in the last release (Ticket #494) +- AceGUI-3.0: ColorPicker: Removed usage of Show/HideUIPanel for WoW 8.2 compatibiliy +- AceGUI-3.0: DropDown: Improved dropdown sorting algorithm to support tables with mixed string and numeric keys + +Ace3 Release - Revision r1200 (January 24th, 2019) +-------------------------------------------------- +- Cleanup for WoW 8.0 improvements +- AceGUI-3.0: Worked around various quirks in the WoW 8.0/8.1 API +- AceGUI-3.0: ColorPicker: Store references to the background/checkers textures (Ticket #473) +- AceConfigDialog-3.0: Allow custom controls for almost all option types (Ticket #475) + +Ace3 Release - Revision r1182 (July 17th, 2018) +----------------------------------------------- +- AceComm-3.0: Support numeric targets for custom channels (Ticket #419) +- AceComm-3.0/ChatThrottleLib: Updated for WoW 8.0 API changes +- AceConfig-3.0: Allow number values for the "width" parameter, which acts as a multiplier of the default width +- AceConfigDialog-3.0: Enable iconCoords for the main level of a tree group (Ticket #417) +- AceGUI-3.0: Implement a Table Layout (#442) +- AceGUI-3.0: EditBox: Only try to handle dragging if a valid object is being dragged into the text box +- AceGUI-3.0: Various fixes and work-arounds for WoW 8.0 changes + +Ace3 Release - Revision r1166 (August 29th, 2017) +------------------------------------------------- +- Updated any use of PlaySound to the new numeric constants (Fix for WoW 7.3) +- AceConfigDialog-3.0: implement fallback validation feedback in a StaticPopup (Ticket #2) + +Ace3 Release - Revision r1158 (March 28th, 2017) +------------------------------------------------ +- AceGUI-3.0: Fire OnShow events from Frame and Windows containers (Ticket #396) +- AceGUI-3.0: Add SetJustifyV/H API to the Label/InteractiveLabel widgets (Ticket #397) + +Ace3 Release - Revision r1151 (July 18th, 2016) +----------------------------------------------- +- AceConfig-3.0: Allow specifying images using the numeric fileID (Ticket #389) +- AceGUI-3.0: Use SetColorTexture in WoW 7.0 +- AceGUI-3.0: Expose the HighlightText API for EditBox and MultiLineEditBox Widgets (Ticket #378) +- AceGUI-3.0: Keybinding: Support MouseWheel Up/Down bindings (Ticket #372) +- AceGUI-3.0: TreeGroup: Refresh the tree in an OnUpdate once after Acquire, not only after creation (Fixes missing tree in WoW 7.0) +- AceSerializer-3.0: Create consistent tokens for infinity, independent of the clients platform + +Ace3 Release - Revision r1134 (June 23rd, 2015) +----------------------------------------------- +- AceGUI-3.0: TreeGroup: Prevent Word Wrap in tree elements + +Ace3 Release - Revision r1128 (February 24th, 2015) +--------------------------------------------------- +- AceGUI-3.0: Fixed an error in GameTooltip handling causing wrong formatting in some cases + +Ace3 Release - Revision r1122 (October 14th, 2014) +-------------------------------------------------- +- AceDB-3.0: Now using the GetCurrentRegion() API to determine region-based profile keys (fix for WoW 6.0) +- AceComm-3.0: Update ChatThrottleLib to v23 +- AceConfigDialog-3.0: Show a more meaningful title on Blizzard Options Groups (Ticket #353) +- AceGUI-3.0: ColorPicker: Frame Level is automatically increased to ensure the color picker frame is above the option panel +- AceGUI-3.0: DropDown: Properly disable all clickable areas when the dropdown is disabled (Ticket #360) +- AceHook-3.0: Always use HookScript when hooking scripts in a secure fashion (Ticket #338) +- AceTimer-3.0: New timer implementation based on C_Timer.After + +Ace3 Release - Revision r1109 (February 19th, 2014) +--------------------------------------------------- +- AceComm-3.0: Ambiguate addon comm messages to restore behavior to be identical to pre-5.4.7 +- AceConfigRegistry-3.0: Added an option to skip options table validation on registering + +Ace3 Release - Revision r1104 (October 31st, 2013) +-------------------------------------------------- +- AceGUI-3.0: Flow Layout: Added a safeguard to prevent an infinite loop in the layout engine +- AceGUI-3.0: DropDown: Adjust its style slightly to closer resemble the Blizzard DropDown Widget +- AceGUI-3.0: DropDown: API enhancements to specify the width of the pullout and be notified when its opened + +Ace3 Release - Revision r1098 (September 13th, 2013) +---------------------------------------------------- +- AceDB-3.0: Switch characters to the default profile if their active profile is deleted (Ticket #324) +- AceConfigDialog-3.0: Try to prevent static popup taint (Ticket #322) +- AceGUI-3.0: Button: Add a new "Auto Width" option (Ticket #310) +- AceGUI-3.0: DropDown: Make the entire DropDown widget clickable (Ticket #339) +- AceGUI-3.0: EditBox: Allow dragging macros to the editbox (which will then contain the macros name) (Ticket #337) +- AceGUI-3.0: Slider: Add a workaround for the broken slider steps in WoW 5.4 (Ticket #346) +- AceGUI-3.0: TreeGroup: Fix an issue introduced by 5.4 broken scrollbars (Ticket #345) +- AceHook-3.0: Allow hooking of AnimationGroup scripts (Ticket #314) + +Ace3 Release - Revision r1086 (May 21st, 2013) +---------------------------------------------- +- AceAddon-3.0: Improved behavior when loading modules during game startup, ensures proper loading order + +Ace3 Release - Revision r1083 (March 4th, 2013) +----------------------------------------------- +- AceTimer-3.0: Fixed an issue that caused the parameter list passed to the callback to be cut off at nil values +- AceGUI-3.0: InlineGroup: The title attribute is properly reset for recycled objects + +Ace3 Release - Revision r1078 (February 10th, 2013) +--------------------------------------------------- +- AceTimer-3.0: Re-write based on AnimationTimers +- AceHook-3.0: Improved checks/error messages when trying to hook a script on a "nil" frame +- AceDBOptions-3.0: Added Italian locale +- AceGUI-3.0: BlizOptionsGroup: Fixed the "default" button callback +- AceGUI-3.0: Colorpicker: The colorpicker is now clamped to the screen + +Ace3 Release - Revision r1061 (August 27th, 2012) +------------------------------------------------- +- AceConfigDialog-3.0: Try to avoid potential taints in static popup dialogs +- AceConfigDialog-3.0: Sort multiselects with "radio" style +- AceGUI-3.0: Support for WoW 5.0 +- AceGUI-3.0: MultiLineEditBox: Support shift-click'ing items/spells/etc. into the editbox +- AceGUI-3.0: Label: Fix text alignment (Ticket #301) +- AceGUI-3.0: Checkbox: Description text on a disable checkbox should look disabled (Ticket #304) +- AceGUI-3.0: Keybinding: Ensure the Keybinding popup is on the top level (Ticket #305) + +Ace3 Release - Revision r1041 (November 29th, 2011) +--------------------------------------------------- +- AceDB-3.0: Added locale and factionrealmregion profile keys +- AceSerializer-3.0: Removed support for NaN, as WoW 4.3 does no longer allow it. +- AceGUI-3.0: Frame: Add :EnableResize (Ticket #214) + +Ace3 Release - Revision r1032 (June 29th, 2011) +----------------------------------------------- +- AceTab-3.0: Improvements to Match handling (Ticket #255 and #256) +- AceGUI-3.0: DropDown layout fix with hidden labels (Ticket #234) + +Ace3 Release - Revision r1025 (April 27th, 2011) +------------------------------------------------ +- AceComm-3.0: Updated for 4.1 changes - now handles RegisterAddonMessagePrefix internally for you. +- AceGUI-3.0: TabGroup: Fixed width of tabs in 4.1(Ticket #243) + +Ace3 Release - Revision r1009 (February 9th, 2011) +-------------------------------------------------- +- AceLocale-3.0: Fix erronous assumption that the default locale is always the first to be registered for the :NewLocale() "silent" flag. The flag must now be set on the FIRST locale to be registered. +- AceLocale-3.0: The :NewLocale() "silent" flag may now be set to the string "raw", meaning nils are returned for unknown translations. +- AceGUI-3.0: Fix the disabled state of Icon widgets +- AceGUI-3.0: The header of the Frame widget now dynamically changes size to fit the text (Ticket #171) +- AceGUI-3.0: Its now possible to define a custom order the elements in a dropdown widget +- AceGUI-3.0: Improved widget focus behaviour across the board (Ticket #192, #193) +- AceGUI-3.0: Fixed a bug that made it impossible to block the tree widget from being user resizable (Ticket #163) +- AceGUI-3.0: Fixed a bug that caused TreeGroups to become unresponsive under certain conditions (Ticket #189, #202) +- AceGUI-3.0: Enhanced the DropDown widget to allow it to be reused more easily. +- AceConfigDialog-3.0: Select Groups now have the proper order in the dropdown (Ticket #184) +- AceConfigDialog-3.0: Implemented "radio" style select boxes (Ticket #149) + +Ace3 Release - Revision r981 (October 27th, 2010) +------------------------------------------------- +- AceAddon-3.0: Fixed a library upgrading issue +- AceAddon-3.0: Modules are now enabled in loading order +- AceGUI-3.0: Keybinding: The widget will no longer steal keybindings even when inactive (Ticket #169) +- AceGUI-3.0: EditBox: Fixed spell drag'n'drop + + +Ace3 Release - Revision r971 (October 12th, 2010) +------------------------------------------------- +- Small fixes and adjustments for the 4.0 Content Patch. +- AceGUI-3.0: ScrollFrame: Allow for a small margin of error when determining if the scroll bar should be shown. +- AceGUI-3.0: Added new widget APIs: GetText for EditBox and DisableButton for MultiLineEditBox + +Ace3 Release - Revision r960 (July 20th, 2010) +---------------------------------------------- +- AceGUI-3.0: Label: Reset Image Size and TexCoords on Acquire (Ticket #110) +- AceGUI-3.0: CheckBox: Re-apply the disabled state after setting a value, so the visuals are correct in either case. (Ticket #107) +- AceGUI-3.0: Icon: Fix the vertical size. It'll now properly scale with the image size, and not be fixed to about 110px. (Ticket #104) +- AceGUI-3.0: External Containers (Frame, Window) should always start in a visible state. (Ticket #121) +- AceGUI-3.0: Added Blizzard sounds to widgets (Ticket #120) +- AceGUI-3.0: CheckBox: check for self.desc:GetText() being nil as well as "" to prevent setting the wrong height on the checkbox causing bouncing checkboxes. +- AceGUI-3.0: Rewrite of the MultiLineEditBox (Ticket #68) +- AceGUI-3.0: CheckBox: Fix alignment of the text in OnMouseDown when an image is set. (Ticket #142) +- AceGUI-3.0: Add SetMaxLetters APIs to EB and MLEB (Ticket #135) +- AceGUI-3.0: Frame: Add events for OnEnter/OnLeave of the statusbar (Ticket #139) +- AceGUI-3.0: Major cleanups and refactoring in nearly all widgets and containers. +- AceConfigDialog-3.0: Always obey the min/max values on range-type widgets (Ticket #114) +- AceConfigDialog-3.0: Pass iconCoords set on groups in the options table to the tree widget (Ticket #111) +- AceConfigDialog-3.0: Implement "softMin" and "softMax", allowing for a UI-specific minimum/maximum for range controls, while allowing manual input of values in the old min/max range. (Ticket #123) +- AceConfigDialog-3.0: Don't close frames in CloseAll that are being opened after the CloseAll event was dispatched. (Ticket #132). +- AceSerializer-3.0: Fix encoding & decoding of \030. (Ticket #115) +- AceDB-3.0: Remove empty sections on logout, keeping the SV clean of more useless informations. +- AceDBOptions-3.0.lua: Fix a string typo (Ticket #141) + +Ace3 Release - Revision r907 (December 16th, 2009) +--------------------------------------------------- +- AceGUI-3.0: Frame: Properly save the width in the status table. +- AceConfigCmd-3.0: Properly handle help output of inline groups with a different handler. (Ticket #101) +- AceConfigDialog-3.0: Don't bail out and error when a dialogControl was invalid, instead show the error and fallback to the default control for that type. +- AceConfigDialog-3.0: Fix a hickup with the OnUpdate script not getting upgraded properly in some situations. + +Ace3 Release - Revision r900 (December 8th, 2009) +-------------------------------------------------- +- AceGUI-3.0: Alot of visual fixes regarding margins and general widget styles. +- AceGUI-3.0: Ability to accept links for EditBox Widget (Ticket #21) +- AceGUI-3.0: ScrollFrame: Hide the scrollbar when there is no overflowing content, and allow the Layout functions to use that space for widgets. +- AceGUI-3.0: DropDown: Added a GetValue() API to the Widget (Ticket #69) +- AceGUI-3.0: Button: Pass the arguments of the OnClick handler to the OnClick callback (Ticket #57) +- AceGUI-3.0: add a Window container, basically a plain window with close button +- AceGUI-3.0: Add support for inline descriptions to the checkbox widget. +- AceGUI-3.0: Added an API to the Window container to disable the user-resizing of the same. (Ticket #80) +- AceGUI-3.0: TreeGroup: Allow iconCoords to be passed for the tree elements. (Ticket #59) +- AceGUI-3.0: Slider: Add a more visible backdrop/border around the manual input area (Ticket #98, #46) +- AceGUI-3.0: Allow displaying a image in front of the checkbox label. (Ticket #82) +- AceConfig-3.0: Added an experimental "descStyle" member to all option table nodes that allows you to control the way the description is presented. + Supported values are "tooltip" for the old behaviour, and "inline" for a inline display of the description, pending support in AceGUI-3.0 widgets. +- AceConfigCmd-3.0: Properly parse functions and methods supplied for the "hidden" option table member. (Ticket #96) +- AceConfigDialog-3.0: Fix the unpacking of the basepath arguments when internally calling :Open (Ticket #90) +- AceConfigDialog-3.0: Properly refresh BlizOptions Windows which are registered with a path on NotifyChange. (Ticket #93) +- AceConfigDialog-3.0: Allow image/imageCoords on toogle elements (Note that the width/height of the image on the toggle cannot be changed) (Ticket #82) +- AceConfigDialog-3.0: Pass the groups "name" tag to DropDownGroups as the title. (Ticket #79) +- AceDB-3.0: Remove the metatable from the DB before removing defaults, so we don't accidentally invoke it in the process. (Ticket #66) +- AceDB-3.0: Don't save the profileKeys for namespaces, since we use the profile of the parent DB anyway. This will cut down on SV complexity when using alot of namespaces. +- AceDB-3.0: Don't fire the OnProfileReset callback when copying a profile. +- AceDBOptions-3.0: Show the current profile on the dialog. (Ticket #56) +- AceComm-3.0: Add callbacks for message chunks going out the wire (via CTL). Useful for displaying progress for very large messages. +- AceConsole-3.0: Add :Printf() so you don't have to do Print(format()) + +Ace3 Beta - Revision 820 (August 7th, 2009) +-------------------------------------------- +- AceComm-3.0: Updated ChatThrottleLib to v21 +- AceGUI-3.0: Fixed a glitch in the TabGroup code that caused tabs to be unresponsive under rare conditions. (Ticket #38) +- AceGUI-3.0: Consistent "disabled" behaviour of all widgets. (Ticket #47) +- AceGUI-3.0: Changed the way widgets are handled on release to avoid a crash in the game client. (Ticket #49) +- AceGUI-3.0: Fixed a glitch in the button graphics. (Ticket #58) +- AceGUI-3.0: Localized the "Close" Text on the Frame widget. + +Ace3 Beta - Revision 803 (April 14th, 2009) +-------------------------------------------- +- AceConfig-3.0: Allow spaces in the keys of config tables. Spaces will be changed on the fly to underscores in AceConfigCmd-3.0 - there is no collision check in place, yet. +- AceConfig-3.0: Support a "fontSize" attribute to the description type. Possible values are "small" (default), "medium" and "large". +- AceConfigDialog-3.0: Fixed an error that would occur when calling InterfaceOptionsFrame_OpenToCategory from within an event handler in a Blizzard Options integrated frame. (Ticket #33) +- AceConfigDialog-3.0: The "execute" type does now recognize the "image" attributes, and will display a clickable icon instead of the button when an image is supplied. (Ticket #35) +- AceConfigDialog-3.0: Pass icons defined in the option table to the TreeGroup widget (Ticket #20) +- AceConfigDialog-3.0: Fixed a bug that caused an empty group widget to be drawn if all groups were hidden. +- AceConfigCmd-3.0: Improved the behaviour of select and multiselect elements. (Ticket #26) +- AceDB-3.0: Add a GetNamespace function to the DB Objects which returns an existing namespace from the DB object. +- AceGUI-3.0 Slider Widget: Properly show percentage values as min/max if isPercent is true. (Ticket #32) +- AceGUI-3.0: Fixed an error in the TreeGroup Widget that caused execution to stop if no name was provided. +- AceGUI-3.0: Fixed the behaviour of the MultiLineEditbox Widget (Accept button not clickable). (Ticket #28) +- AceGUI-3.0: TabGroup: Set a maximum width for tabs based on the size of the widget. (Ticket #34) +- AceGUI-3.0: Added a new InteractiveLabel with OnEnter/OnLeave/OnClick callbacks and a highlight texture +- AceGUI-3.0: Add SetFont and SetFontObject functions to the Label widget (and the new InteractiveLabel) +- AceGUI-3.0: Support icons in the TreeGroup display. (Ticket #20) +- AceGUI-3.0: Added a new :SetRelativeWidth Widget-API that allows you to set the width of widgets relative to their container. +- AceGUI-3.0: Alot of fixes, tweaks and consistency changes. + +Ace3 Beta - Revision 741 (Feb 15th, 2009) +-------------------------------------------- +- AceDBOptions-3.0: Disable the "Copy From" and "Delete" dropdowns if there are no profiles to choose from. (Ticket #19) +- AceGUI-3.0: Improve TabGroup visual style - only stretch them to the full width if they would use more then 75% of the exisiting space. +- AceGUI-3.0: Added a third optional argument to <container>:AddChild() to specify the position for the new widget. (Ticket #22) +- AceConfigCmd-3.0: Improve help output when viewing groups. +- AceConfigDialog-3.0: Refresh the Options Panel after a confirmation is canceled to reset the value to its previous value. (Ticket #23) +- AceDB-3.0: Fix a data inconsistency when using false as a table key. (Ticket #25) + +Ace3 Beta - Revision 722 (Jan 4th, 2009) +-------------------------------------------- +- AceHook-3.0: Fix :SecureHookScript to not fail on previously empty scripts since frame:HookScript does nothing at all in that case. (Ticket #16) +- AceLocale-3.0: Implement 'silent' option for :NewLocale to disable the warnings on unknown entrys (Ticket #18) +- AceTimer-3.0: Implement :TimeLeft(handle) function (Ticket #10) +- AceGUI-3.0: Fix TabGroup tab resizing to be consistent +- AceGUI-3.0: Fixed EditBox alignment when the label is disabled (Ticket #13) +- AceDB-3.0: Implement OnProfileShutdown callback (Ticket #7) +- AceDBOptions-3.0: Updated esES and ruRU locale + +Ace3 Beta - Revision 706 (Oct 18th, 2008) +-------------------------------------------- +- First Beta release after WoWAce move +- Removed WoW 2.4.x compat layer +- AceGUI-3.0: Fix disabling of the Multiline Editbox +- AceGUI-3.0: Improvements to the Keybinding Widget + +Ace3 Beta - Revision 81437 (Sept 6th, 2008) +-------------------------------------------- +- AceConfigDialog-3.0: the confirm callback will now receive the new value that is being set (same signature as the validate callback) +- AceConfigDialog-3.0: :Close and :CloseAll are now safe to call from within callbacks. +- AceGUI-3.0: Added new methods to the widget base table, see ACE-205 for full reference +- AceGUI-3.0: Various fixes to Widgets and recycling process +- Now compatible with WoW 3.0 (compat layer is to be removed upon 3.0 release) + + +Ace3 Beta - Revision 76325 (June 9th, 2008) +-------------------------------------------- +- AceGUI-3.0: Finish Multiselect support for the Dropdown widget (nargiddley) +- AceGUI-3.0: Re-write TabGroup layouting (nargiddley) +- AceGUI-3.0: TreeGroup: Add :EnableButtonTooltips(enable) to make the default tooltips on the tree optional, enabled by default. (nargiddley) +- AceGUI-3.0: TabGroup: Add OnTabEnter and OnTabLeave Callbacks (nargiddley) +- AceConfigDialog-3.0: Add :SelectGroup(appName, ...) - Selects the group given by the path specified then refreshes open windows. (nargiddley) +- AceConfigDialog-3.0: :Open now accepts an optional path, when given will open the window with only the given group and its children visible (nargiddley) +- AceConfigDialog-3.0: :AddToBlizOptions now accepts an optional path, this will add the config page to display the specified group and its children only. (nargiddley) +- AceConfigDialog-3.0: ACE-189: allow multiselect to be shown as a dropdown by setting dialogControl = "Dropdown" (nargiddley) +- AceConfigDialog-3.0: Add Custom tooltips to the TreeGroup and TabGroup, shows both name and desc for the group. (nargiddley) +- AceConfigCmd-3.0: ACE-195: Remove unneeded references to .confirm, will no longer error when .confirm is a boolean (nargiddley) +- AceAddon-3.0: Allow for an optional first argument to NewAddon to be a table to be used as the base for the addon. (ammo) + +Ace3 Beta - Revision 74633 (May 19th, 2008) +-------------------------------------------- +- AceTimer-3.0: ACE-173: don't error on nil handle for CancelTimer(), just bail out early. (ammo) +- AceGUI-3.0: ACE-161, ACE-180, ACE-181: New and improved DropDown widget (originally coded by Borlox) (nargiddley,nevcairiel) +- AceGUI-3.0: AceGUI will call OnWidthSet and OnHeightSet as frames resize (nargiddley) +- AceGUI-3.0: TabGroup: Use OptionsFrameTabButtonTemplate for tabs (nargiddley) +- AceGUI-3.0: TabGroup: Tabs now span multiple lines when there are too many to fit in the width of the frame (nargiddley) +- AceGUI-3.0: TreeGroup: Tree is now sizable by dragging, orig patch by yssaril (nargiddley) +- AceGUI-3.0: Flow layout will now reduce widgets width to fit rather than leaving them sticking out the side of container widgets (nargiddley) +- AceGUI-3.0: Dropdowns will no longer be left open in the background when the frame is clicked or other widgets are activated (nargiddley) +- AceGUI-3.0: ACE-159: Rename Release to OnRelease and Acquire to OnAcquire for widgets. (nargiddley) +- AceGUI-3.0: ACE-171: add IsVisible and IsShown methods to the widget metatable (nargiddley) +- AceGUI-3.0: ACE-164: add tooltips to tree to show full text of childs that got clipped (ammo) +- AceGUI-3.0: ACE-174: make buttons in AceGUI-3.0 locale independant (ammo) +- AceGUI-3.0: ACE-166: fix treegroup visual bug (ammo) +- AceGUI-3.0: ACE-184: make numeric entry for slider more intuitive (ammo) +- AceConfigCmd-3.0: ACE-172 - ignore description in cmd (ammo) +- AceConsole-3.0: nolonger check for existance of slashcommands, overwrite where needed. Last one wins, this enables AddonLoader to X-LoadOn-Slash and override the slashcommand from AddonLoader slashcommand with an Ace3 one. (Ammo) + +Ace3 Beta - Revision 69509 (April 13th, 2008) +--------------------------------------------- +- AceComm-3.0: turn off error messages when receiving invalid multi-part messages (its happening on login etc) (nevcairiel) +- AceDBOptions-3.0: shorten info text at top to prevent scrollbars. (nevcairiel) +- AceHook-3.0: ACE-162: fix unhooking of objects that were not actually hooked (nevcairiel) +- AceDB-3.0: fire the DB callbacks after the namespaces changed their profile as well (nevcairiel) +- AceDB-3.0: namespaces can now be individually reset using :ResetProfile() on the namespace directly (nevcairiel) +- AceDB-3.0: added a optional argument to :ResetProfile to not populate the reset to all namespaces (so the main profile can reset individually without reseting all namespaces too) (nevcairiel) + +Ace3 Beta - Revision 66329 (March 27th, 2008) +--------------------------------------------- +- Overall 2.4 clean ups - removing 2.4 checks and work arounds (nevcairiel) +- AceBucket-3.0: clear the timer reference when unregistering a bucket to prevent a error when unregistering a bucket that was never fired (nevcairiel) +- AceAddon-3.0: Bugfix when enabling/disabling modules from the parents OnEnable after disabling / enabling the parent addon. (ammo) +- AceGUI-3.0: Don't parent the BlizOptionsGroup widget to UIParent and Hide it by default. Fixes stray controls on the screen. (nargiddley) +- AceConfigDialog-3.0: Config windows without a default size won't incorrectly get a default size from a previously open window. (nargiddley) +- AceDBOptions-3.0: added zhCN and zhTW locale (nevcairiel) + +Ace3 Beta - Revision 65665 (March 25th, 2008) +--------------------------------------------- +- AceGUI-3.0: ACE-139: Changed all Widgets to resemble the Blizzard 2.4 Options Style (nevcairiel) +- AceGUI-3.0: Fixed "List"-Layout not reporting new width to "fill"-mode widgets (mikk) +- AceGUI-3.0: added :SetColor to the Label widget (nevcairiel) +- AceGUI-3.0: ACE-132: ColorPicker: added checkers texture for better alpha channel display, and fixed "white"-texture bug (nevcairiel,nargiddley,ammo) +- AceConfig-3.0: ACE-113: Added uiName, uiType, handler, option, type to the info table (nevcairiel,nargiddley) +- AceConfigDialog-3.0: ACE-139: Adjusted for 2.4 options panels (nevcairiel) +- AceConfigDialog-3.0: Use "width" parameter for the description widget (if present) (nevcairiel) +- AceConfigDialog-3.0: ACE-135: Add support for specifying a rowcount for multiline editboxes (nargiddley) +- AceConfigDialog-3.0: :AddToBlizOptions will return the frame registered so you can use it in InterfaceOptionsFrame_OpenToFrame (nevcairiel) +- AceConfigCmd-3.0: handle "hidden" in help-output (nevcairiel) +- AceHook-3.0: fix unhooking of secure hooks (nevcairiel) +- AceDBOptions-3.0: add optional argument to GetOptionsTable(db[, noDefaultProfiles]) - if set to true will not show the default profiles in the profile selection (nevcairiel) +- AceDBOptions-3.0: added koKR locale (nevcairiel) +- Ace3 Standalone: Removed the "Ace3" Category from the 2.4 options panel (nevcairiel) + +Ace3 Beta - Revision 64176 (March 10th, 2008) +--------------------------------------------- +- AceGUI-3.0: Improve Alpha handling for the ColorPicker widget, ColorPicker widget closes the ColorPickerFrame before opening to prevent values getting carried over (nargiddley) +- AceGUI-3.0: The Slider widget will only react to the mousewheel after it has been clicked (anywhere including the label) to prevent accidental changes to the value when trying to scroll the container it is in (nargiddley) +- AceGUI-3.0: The TreeGroup widget is scrollable with the mousewheel (nargiddley) +- AceGUI-3.0: ACE-154: Fix frame levels in more cases to prevent widgets ending up behind their containers (nargiddley) +- AceConfigDialog: Color picker obeys hasAlpha on the color type (nargiddley) +- AceConfigDialog-3.0: ACE-155: Make sure that the selected group is type='group' when checking if it exists (nargiddley) +- AceDBOptions-3.0: added frFR locale (nevcairiel) + +Ace3 Beta - Revision 63886 (March 8th, 2008) +--------------------------------------------- +- AceDBOptions-3.0: new library to provide a Ace3Options table to control the AceDB-3.0 profiles (nevcairiel) +- AceDB-3.0: add "silent" option to DeleteProfile and CopyProfile when we deal with namespaces (nevcairiel) +- AceDB-3.0: implement library upgrade path (nevcairiel) +- AceDB-3.0: ACE-146: fix problem with non-table values overruling ['*']-type defaults (nevcairiel) +- AceConsole-3.0: treat |T|t texture links similar to |H|h|h links. (ammo) +- AceGUI-3.0: Use Blizzard Templates for the EditBox and DropDown widget (nevcairiel) +- AceBucket-3.0: ACE-150: callback is now optional, if not supplied will use the eventname as method name (only possible if one event is supplied, and not a event table) (nevcairiel) +- tests: adjust tests for AceGUI and AceConsole changes (nevcairiel) + +Ace3 Beta - Revision 63220 (Feb 29th, 2008) +--------------------------------------------- +- AceTimer-3.0: CancelAllTimers() now cancels silent (elkano) +- AceConfigDialog: Add :SetDefaultSize(appName, width, height), sets the size the dialog will open to. Does not effect already open windows. (nargiddley) +- AceConfigDialog: Fix typo in type check for range values (nargiddley) +- AceGUI: ColorPicker widget will correctly fire OnValueChanged for the cancel event of the colorpicker popup. Reset ColorPicker's color on Acquire. (nargiddley) +- AceGUI: Fix Spelling of Aquire -> Acquire for widgets, all custom widgets will need to be updated. A warning will be printed for widgets not upgraded yet. (nargiddley) +- AceConfigCmd-3.0: add simple coloring to slashcommand output. (ammo) +- AceConsole-3.0: add some color to :Print (ammo) +- AceAddon-3.0: set error level on library embedding to point to the :NewAddon call (nevcairiel) + +Ace3 Beta - Revision 62182 (Feb 20th, 2008) +--------------------------------------------- +- Ace3 StandAlone: Add a page to the Blizzard 2.4 Interface Options with icons to open dialogs for configs registered when installed standalone (nargiddley) +- AceConfigDialog: type = 'description' now uses the fields image and imageCoords instead of icon and iconCoords, add imageWidth and imageHeight (nargiddley) +- AceConfigDialog: Add :AddToBlizzardOptions(appName, name), this will add the specified config to the Blizzard Options pane new in 2.4. This will only be available if running on the 2.4 PTR (nargiddley) +- AceDB: fix GetProfiles() when setting the same profile twice (nevcairiel) +- AceDB: bail out of :SetProfile early when trying to set to the same profile (nevcairiel) +- AceDB: add nil checks to metatable handling (nevcairiel) +- AceDB: clear tables that are empty after defaults removal (nevcairiel) +- AceGUI: Fix a couple of layout bugs causing the width of groups to be wrong (nargiddley) +- AceGUI: Add Icon widget (nargiddley) +- AceGUI: Allow room for the border in the BlizOptionsGroup widget (nargiddley) +- AceGUI: Button and Keybinding use UIPanelButtonTemplate2 (nargiddley) +- AceConsole-3.0: Fix bug where no table for [self] was created when registering weak commands (ammo) +- AceTimer-3.0: add missing :OnEmbedDisable (ammo) +- AceAddon-3.0: added :GetName() that will always return the "real" name of a addon or module object without any prefixes (nevcairiel) + +Ace3 Beta - Revision 60697 (Feb 9th, 2008) +--------------------------------------------- +- CallbackHandler-1.0: remove unnecessary table creation if a event is fired thats not registered (nevcairiel) +- AceAddon-3.0: fixed a bug with recursive addon loading (nevcairiel) +- AceGUI: Update TabGroup's tablist format, tabs are selected by value not index (nargiddley) +- AceGUI: Add MultiLineEditBox widget (nargiddley, originally by bam) +- AceGUI: Small fix to the flow layout preventing controls overlapping in some cases (nargiddley) +- AceConfigDialog: Implement control and dialogControl for types 'input' and 'select' (nargiddley) +- AceConfigDialog: Add support for multiline = true on type = 'input' (nargiddley) +- AceConfigDialog: Fix an error when all groups are hidden in a group with childGroups = 'select' (nargiddley) +- AceConfigDialog: type = 'description' will now show .icon as an image with its text (nargiddley) +- AceConfigDialog: multiline inputs are no longer forced to width = "full" (nargiddley) +- AceConfigDialog: bug fix when loading without AceConsole present (nevcairiel) + +Ace3 Beta - Revision 60545 (Feb 7th, 2008) +--------------------------------------------- +- AceGUI: SetToplevel(true) for the Frame widget, multiple open windows should play nice together now (nargiddley) +- AceGUI: Move Frames to the FULLSCREEN_DIALOG strata (nargiddley) +- AceGUI: Dropdown, Editbox and Keybinding labels grey out when disabled (nargiddley) +- AceGUI: Add OnClick callback to the TreeGroup widget (nargiddley) +- AceConfigDialog: Confirm popups will be above the config window (nargiddley) + +Ace3 Beta - Revision 60163 (Feb 3rd, 2008) +--------------------------------------------- +- Initial Beta release diff --git a/Locales/Core-Locale-deDE.lua b/Locales/Core-Locale-deDE.lua index a33a0bc..d574ddf 100644 --- a/Locales/Core-Locale-deDE.lua +++ b/Locales/Core-Locale-deDE.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2021 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -164,7 +164,7 @@ L["ISB"] = "http://IsBoxer.com" L["TEMP_WEBSITE1"] = "" L["TEMP_WEBSITE2"] = "" L["TEMP_WEBSITE3"] = "" -L["COPYRIGHT"] = "Copyright (c) 2015-2019 Jennifer Calladine (Ebony)" +L["COPYRIGHT"] = "Copyright (c) 2015-2021 Jennifer Calladine (Ebony)" L["COPYRIGHTTWO"] = "Released Under License: The MIT License" L["FRAME_RESET"] = "Frame Reset" -- Msg 8000 diff --git a/Locales/Core-Locale-enUS.lua b/Locales/Core-Locale-enUS.lua index e95cb26..1179883 100644 --- a/Locales/Core-Locale-enUS.lua +++ b/Locales/Core-Locale-enUS.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -18,6 +18,7 @@ local L = LibStub("AceLocale-3.0"):NewLocale( "Core", "enUS", true ) L["JAMBA"] = "Jamba" L["JAMBA EE"] = "Jamba EE" L["EMA"] = "EMA" +L["DISABLED_IN_CLASSIC"] = "Not Supported In Classic or Classic-TBC" L[""] = true L[" "] = true L[": "] = true @@ -27,6 +28,7 @@ L[" / "] = true L["/"] = true L["%"] = true L["N/A"] = true +L["WIP"] = "wip" L["OPEN_CONFIG"] = "Opens The Config" L["OPEN_CONFIG_HELP"] = "Opens The Configuration GUI" L["PUSH_SETTINGS"] = "Push Settings" @@ -106,15 +108,13 @@ L["MESSAGE_DISPLAY"] = "Message Display" L["GROUP_LIST"] = "Group List" L["DISPLAY"] = "Display" L["ITEM_USE"] = "Item Use" -L["VENDER_LIST_MODULE"] = "Sell List" +L["VENDOR_LIST_MODULE"] = "Sell List" L["INTERACTION"] = "Interaction" L["CURRENCY"] = "Currency" L["INFORMATION"] = "Information" L["TOON"] = "Toon" L["FOLLOW"] = "Follow" L["PURCHASE"] = "Purchase" --- FUCKED UP! -L["VENDER"] = "Vendor" L["VENDOR"] = "Vendor" L["PURCHASE"] = "Purchase" L["WARNINGS"] = "Warnings" @@ -152,29 +152,14 @@ L["RESETTING_PROFILE"] = "Resetting profile: " L["PROFILE_DELETED"] = "Profile deleted - iterating all modules." L["DELETING_PROFILE"] = "Deleting profile: " L["Failed_LOAD_MODULE"] = "Failed to load EMA Module: " -L["TEXT1"] = "Ebony's MultiBoxing Assistant v3.0 For 9.0.1!" -L["TEXT2"] = "" -L["TEXT3"] = "Welcome To v3.0!" -L["TEXT4"] = "" -L["TEXT5"] = "" -L["TEXT6"] = "|cFFFFFFFFRead The ChangeLog For More Information" -L["TEXT7"] = "" -L["TEXT8"] = "" -L["TEXT9"] = "" -L["TEXT10"] = "" +L["KEY_BINDINGS"] = "Key Bindings" +L["VERSION"] = "Version" L["SPECIAL_THANKS"] = "Special Thanks:" L["THANKS1"] = "Michael \"Jafula\" Miller For Making Jamba That Some Of This Code Is Based On" -L["THANKS2"] = "tk911 For Translating EMA To German (DE)" -L["THANKS3"] = "" L["WEBSITES"] = "Websites" L["ME"] = "Current Project Manger Jennifer Calladine (Ebony) " L["ME_TWITTER"] = "https://twitter.com/Jenn_Ebony" -L["D-B"] = "http://Dual-boxing.com" -L["ISB"] = "" -L["TEMP_WEBSITE1"] = "" -L["TEMP_WEBSITE2"] = "" -L["TEMP_WEBSITE3"] = "" -L["COPYRIGHT"] = "Copyright (c) 2015-2020 Jennifer Calladine (Ebony)" +L["COPYRIGHT"] = "Copyright (C) 2015-2021 Jennifer Calladine (Ebony)" L["COPYRIGHTTWO"] = "Released Under License: All Rights Reserved unless otherwise explicitly stated" L["FRAME_RESET"] = "Frame Reset" -- Msg 8000 @@ -267,6 +252,23 @@ L["ONLINE"] = "Online" L["OFFLINE"] = "Offline" L["STATICPOPUP_ADD"] = "Enter character to add in name-server format:" L["STATICPOPUP_REMOVE"] = "Are you sure you wish to remove %s from the team list?" +L["SET_FOCUS_MASTER"] = "Sets Focus To Master* " +L["SET_MASTER_TARGET"] = "Sets Target To Master* " +L["SET_MASTER_ASSIST"] = "Sets Assist To Master* " +L["FAKE_KEY_BINDING"] = "* Needs to Press the key on all clones" +L["BINDING_CLICK_TO_MOVE"] = "Toggle Click To Move" +L["COMMANDLINE_CLICK_TO_MOVE"] = "Toggles Click To Move <Group> " +L["COMMANDLINE_CLICK_TO_MOVE_HELP"] = "Toggles Click To Move By <Group>" +L["SET_FOCUS_ONE"] = "Sets Focus To Order One" +L["SET_FOCUS_TWO"] = "Sets Focus To Order Two" +L["SET_FOCUS_THREE"] = "Sets Focus To Order Three" +L["SET_FOCUS_FOUR"] = "Sets Focus To Order Four" +L["SET_FOCUS_FIVE"] = "Sets Focus To Order Five" +L["SET_FOCUS_SIX"] = "Sets Focus To Order Six" +L["SET_FOCUS_SEVEN"] = "Sets Focus To Order Seven" +L["SET_FOCUS_EIGHT"] = "Sets Focus To Order Eight" +L["SET_FOCUS_NINE"] = "Sets Focus To Order Nine" +L["SET_FOCUS_TEN"] = "Sets Focus To Order Ten" -------------------------- -- Message Locale @@ -367,8 +369,6 @@ L["AUTO_SELL_ITEMS_HELP"] = "Automatically Sell Items Below" L["GLOBAL_SELL_LIST"] = "Global Sell List" L["BLACKLIST_ITEM"] = "Black List" L["BLACKLIST_ITEM_HELP"] = "EMA Can Not Sell This Item \ne.g.: Philosopher's Stones" -L["DESTROY_ITEM"] = "Destroy Items" -L["DESTROY_ITEM_HELP"] = "Destroy Items At The Vender \n\nThat Means They GET DELETED \nUse With Care!" L["ONLY_SB"] = "Only SoulBound" L["ONLY_SB_HELP"] = "Only Sell SoulBound Items" L["iLVL"] = "Item Level" @@ -424,6 +424,8 @@ L["ONLY_DISMOUNT_WITH_MASTER_HELP"] = "Only Dismount's When Master Character Dis L["ONLY_MOUNT_WHEN_IN_RANGE"] = "Only Mount When In Range" L["ONLY_MOUNT_WHEN_IN_RANGE_HELP"] = "Dismounts Only When The Team Is In Range /nOnly Works In A Party!" L["I_AM_UNABLE_TO_MOUNT"] = "I Am Unable To Mount." +L["MOUNT_HELP"] = "Command Teams To Summon A Random Favorite Mount" + -- Loot Locale L["LOOT_OPTIONS"] = "Loot v2 Options" L["DISMOUNT_WITH_CHARACTER"] = "Dismount With Character That Dismount" @@ -484,6 +486,10 @@ L["SPACE_FOR_POINTS"] = "Space For Points" L["SPACE_BETWEEN_VALUES"] = "Space Between Values" L["TOTAL"] = "Total" L["CURR"] = "Curr" +L["BAG_SPACE_HELP"] = "Shows The Characters Current Bag Space" +L["DURR"] = "Durability" +L["DURR_HELP"] = "Shows The Character Durability " +-- chat Triggers L["CHAT_TRIGGER"] = "Chat !Triggers" L["CHAT_TRIGGERS"] = "Listen to Chat Triggers" L["CHAT_TRIGGERS_HELP"] = "Listen to !Triggers in \nParty/raid/guild to tell your team about things\n!emahelp" @@ -540,6 +546,8 @@ L["VALUES"] = "Values" L["VALUES_HELP"] = "Show Values" L["PERCENTAGE"] = "Percentage" L["PERCENTAGE_HELP"] = "Show Percentage" +L["SHOW_LEVEL"] = "Show Level" +L["SHOW_LEVEL_HELP"] = "Show level on experience bar" L["SHOW_XP"] = "Experience Bar" L["SHOW_XP_HELP"] = "Show the Team Experience bar" L["ARTIFACT_BAR"] = "Artifact Bar" @@ -591,6 +599,8 @@ L["FOLLOW_SET_MASTER"] = "Sets Follow By Name" L["FOLLOW_SET_MASTER_HELP"] = "Sets Follow By Name" L["TRAIN"] = "Makes All Characters Follow In A Train" L["FOLLOW_ME"] = "Follow Me" +L["FOLLOW_STOP"] = "Follow Stop" +L["FOLLOW_STOP_HELP"] = "Sends A Command To The Minions To Stop Follow There Target" L["TRAIN_HELP"] = "Makes All Characters Follow In A Train Behind Each Other" L["FOLLOW_ME_HELP"] = "Follow Me <EMA Group>" L["SNW"] = "Snw" @@ -613,9 +623,12 @@ L["ANY_MEMBER_IN_COMBAT"] = "Any Member In Combat" L["FOLLOW_STROBING"] = "Follow Strobing" L["FOLLOW_STROBING_EMA_FOLLOW_COMMANDS."] = "Follow Strobing Is Controlled By \"/ema Commands\" Or KeyBindings" L["USE_MASTER_STROBE_TARGET"] = "Always Use Master As The Strobe Target" +-- L["PAUSE_FOLLOW_STROBING"] = "Pause Follow Strobing If ...." L["DRINKING_EATING"] = "Drinking/Eating" L["IN_A_VEHICLE"] = "In A Vehicle" +L["PLAYER_DEAD"] = "Dead Or Ghost" +-- L["GROUP_FOLLOW_STROBE"] = "Group For Follow Strobe" L["FREQUENCY"] = "Frequency (s)" L["FREQUENCY_COMABT"] = "Frequency In Combat (s)" @@ -630,7 +643,7 @@ L["PVP_FOLLOW_ERR"] = "Can Not Follow You, I Am Engaged In PvP Combat" -- Vendor/Purchase Locale. L["AUTO_BUY_ITEMS"] = "Auto Buy Items" L["OVERFLOW"] = "Overflow" -L["REMOVE_VENDER_LIST"] = "Remove From Vendor List" +L["REMOVE_VENDOR_LIST"] = "Remove From Vendor List" L["ITEM_DROP"] = "Item (Shift+Click Item In Bag)" L["PURCHASE_ITEMS"] = "Auto Purchase Items" L["ADD_ITEM"] = "Add Item" @@ -737,6 +750,14 @@ L["RELEASE_TEAM_Q"] = "Release All Team?" L["RELEASE_TEAM"] = "Release Team" L["RECOVER_CORPSES"] = "Recover All Team Corpses?" L["ERR_GOLD_TO_REPAIR"] = "I Do Not Have Enough Money To Repair All My Items" +--Set View +L["SET_VIEW_HEADER"] = "Set View Settings" +L["SET_VIEW"] = "Set View" +L["SET_VIEW_HELP"] = "Set View Team View" +L["SET_VIEW_WITHOUT_MASTER"] = "Set View Without Master" +L["SET_VIEW_WITHOUT_MASTER_HELP"] = "Set View Without The Master" + + L["RELEASE_CORPSE_FOR_X"] = function( delay ) return string.format( "I can not release to my Corpse for: %s seconds", delay ) end @@ -851,6 +872,8 @@ L["MUST_CHOOSE_OWN_REWARD"] = "Toon Must Choose Own Reward" L["MUST_CHOOSE_OWN_REWARD_HELP"] = "Toon Must Select Own Quest Reward" L["CHOOSE_SAME_REWARD"] = "Toon Choose Same Reward As Team" L["CHOOSE_SAME_REWARD_HELP"] = "Toon Will Choose Same Reward As EMA Team Members \n\nOnly Use If All Team Members Class" +L["CHOOSE_BEST_REWARD"] = "Choose Best Quest Reward" +L["CHOOSE_BEST_REWARD_HELP"] = "Try & Choose Best Quest Reward\nCan i use it < better in slot < If not best sell price!" L["MODIFIER_CHOOSE_SAME_REWARD"] = "If Modifier Keys Pressed, Toon Choose Same Reward" L["MODIFIER_CHOOSE_SAME_REWARD_HELP"] = "If Modifier Key Below Is Pressed, Minion Can Choose Same Reward" L["OVERRIDE_REWARD_SELECTED"] = "Override: If Minion Already Has Reward Selected, Choose That Reward" @@ -859,6 +882,10 @@ L["SHARING_QUEST_TO_ALLMINIONS"] = "Sharing Quests To All Minions" L["TRACKING_QUEST_TO_ALLMINIONS"] = "Tracking Quests To All Minions" L["UNTRACKING_QUESTS_ALLMINIONS"] = "Untracking Quests To All Minions" L["TOGGLE"] = "Toggle" +L["TRACK_SINGLE_QUEST"] = "Track Selected" +L["TRACK_SINGLE_QUEST_TOOLTIP"] = "Track The Selected Quest" +L["UNTRACK_SINGLE_QUEST"] = "UnTrack Selected" +L["UNTRACK_SINGLE_QUEST_TOOLTIP"] = "UnTrack The Selected Quest" L["ABANDON_ALL"] = "Abandon All Quests" L["ABANDON_ALL_TOOLTIP"] = "Aabandon All Quests On All Minions" L["SHARE_ALL"] = "Share All" @@ -895,7 +922,6 @@ end ------------------------ -- QuestTracker Locale - L["SHOW_QUEST_WATCHER"] = "Show Objective Tracker" L["SHOW_QUEST_WATCHER_HELP"] = "Show The Objective/Quest EMA Tracker Window." L["HIDE_QUEST_WATCHER"] = "Hide Objective Tracker" @@ -945,23 +971,7 @@ L["REMOVE_GUILD_LIST"] = "Are You Sure You Wish To Remove The Selected Item From L["I_HAVE_DEPOSITED_X_TO_GB"] = function( gold ) return string.format("Deposited %s To The Guild Bank", gold ) end ------------------------- --- ISBOXER Locale -L["ISBOXER_LIST_HEADER"] = "Your Current ISBoxer Team" -L["CHECKBOX_ISBOXER_SYNC"] = "Sync With ISBoxer" -L["CHECKBOX_ISBOXER_SYNC_HELP"] = "Sync With ISBoxer TeamList \nAdd/Remove Characters No Longer In ISBoxer Team" -L["ISBOXER_SYNC_HEADER"] = "Sync With ISBoxer" -L["SYNCINFORMATIONONE"] = "|cFFFF0000 This Will Remove All Your Team Members!" -L["SYNCINFORMATIONTWO"] = "|cFFFF0000 And Will Sync WIth The ISBoxer TeamList" -L["SYNCINFORMATIONTHREE"] = "|cFFFF0000 Note: Some Parts Of EMA Is Not Supported Useing This Method Currently" -L["REMOVE_ISBOXER_LIST"] = "" -L["ISBOXER_COMMAND_LINE_HELP"] = "PH For Isboxer Use Only" -L["ISBOXER_SET_MASTER"] = "ISBoxer Set Master" -L["ISBOXER_SET_STROBEONME"] = "ISBoxer Set Strobe On Me" -L["ISBOXER_SET_SNW"] = "ISBoxer Set snw PH" -L["ISBOXER_COMMAND_LINE_HELP_TWO"] = "PH For Isboxer Use Only" -L["ISBOXER_SET_STROBEOFF"] = "ISBoxer Set Strobe Off" ----------------------- -- Mail Locale diff --git a/Modules/Bank.lua b/Modules/Bank.lua index 89702a8..ee36374 100644 --- a/Modules/Bank.lua +++ b/Modules/Bank.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- diff --git a/Modules/DisplayTeam.lua b/Modules/DisplayTeam.lua index de723ef..d7faed3 100644 --- a/Modules/DisplayTeam.lua +++ b/Modules/DisplayTeam.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -75,8 +75,9 @@ EMA.settings = { followStatusHeight = 15, followStatusShowName = true, showExperienceStatus = true, + showLevel = true, showXpStatus = true, - showArtifactStatus = false, + showGoldStatus = false, showHonorStatus = false, showRepStatus = false, experienceStatusWidth = 100, @@ -469,9 +470,9 @@ function EMA:SettingsUpdateStatusBarTexture() characterStatusBar["experienceBar"]:SetStatusBarTexture( statusBarTexture ) characterStatusBar["experienceBar"]:GetStatusBarTexture():SetHorizTile( false ) characterStatusBar["experienceBar"]:GetStatusBarTexture():SetVertTile( false ) - characterStatusBar["experienceArtBar"]:SetStatusBarTexture( statusBarTexture ) - characterStatusBar["experienceArtBar"]:GetStatusBarTexture():SetHorizTile( false ) - characterStatusBar["experienceArtBar"]:GetStatusBarTexture():SetVertTile( false ) + characterStatusBar["experienceGoldBar"]:SetStatusBarTexture( statusBarTexture ) + characterStatusBar["experienceGoldBar"]:GetStatusBarTexture():SetHorizTile( false ) + characterStatusBar["experienceGoldBar"]:GetStatusBarTexture():SetVertTile( false ) characterStatusBar["reputationBar"]:SetStatusBarTexture( statusBarTexture ) characterStatusBar["reputationBar"]:GetStatusBarTexture():SetHorizTile( false ) characterStatusBar["reputationBar"]:GetStatusBarTexture():SetVertTile( false ) @@ -493,7 +494,7 @@ function EMA:SettingsUpdateFontStyle() for characterName, characterStatusBar in pairs( EMA.characterStatusBar ) do characterStatusBar["followBarText"]:SetFont( textFont , textSize , "OUTLINE") characterStatusBar["experienceBarText"]:SetFont( textFont , textSize , "OUTLINE") - characterStatusBar["experienceArtBarText"]:SetFont( textFont , textSize , "OUTLINE") + characterStatusBar["experienceGoldBarText"]:SetFont( textFont , textSize , "OUTLINE") characterStatusBar["reputationBarText"]:SetFont( textFont , textSize , "OUTLINE") characterStatusBar["healthBarText"]:SetFont( textFont , textSize , "OUTLINE") characterStatusBar["powerBarText"]:SetFont( textFont , textSize , "OUTLINE") @@ -590,33 +591,31 @@ function EMA:CreateEMATeamStatusBar( characterName, parentFrame ) characterStatusBar["experienceBarText"] = experienceBarText EMA:UpdateExperienceStatus( characterName, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ) - -- Set the artifactXP bar. - local experienceArtName = EMA.globalFramePrefix.."ExperienceArtBar" - local experienceArtBar = CreateFrame( "StatusBar", experienceArtName, parentFrame, "AnimatedStatusBarTemplate" ) --"TextStatusBar,SecureActionButtonTemplate" ) - experienceArtBar.backgroundTexture = experienceArtBar:CreateTexture( experienceArtName.."BackgroundTexture", "ARTWORK" ) - experienceArtBar.backgroundTexture:SetColorTexture( 1.0, 0.0, 0.0, 0.15 ) - experienceArtBar:SetStatusBarTexture( statusBarTexture ) - experienceArtBar:GetStatusBarTexture():SetHorizTile( false ) - experienceArtBar:GetStatusBarTexture():SetVertTile( false ) - experienceArtBar:SetMinMaxValues( 0, 100 ) - experienceArtBar:SetValue( 100 ) - experienceArtBar:SetFrameStrata( "LOW" ) - local experienceArtBarClick = CreateFrame( "CheckButton", experienceArtName.."Click", parentFrame, "SecureActionButtonTemplate" ) - experienceArtBarClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) - experienceArtBarClick:SetFrameStrata( "MEDIUM" ) - characterStatusBar["experienceArtBar"] = experienceArtBar - characterStatusBar["experienceArtBarClick"] = experienceArtBarClick - local experienceArtBarText = experienceArtBar:CreateFontString( experienceArtName.."Text", "OVERLAY", "GameFontNormal" ) - experienceArtBarText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - experienceArtBarText:SetFont( textFont , textSize, "OUTLINE") - experienceArtBarText:SetAllPoints() - experienceArtBarText.artifactName = "N/A" - experienceArtBarText.artifactXP = 0 - experienceArtBarText.artifactForNextPoint = 100 - experienceArtBarText.artifactPointsSpent = 1 - experienceArtBarText.artifactPointsAvailable = 0 - characterStatusBar["experienceArtBarText"] = experienceArtBarText - EMA:UpdateExperienceStatus( characterName, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil ) + -- Set the Gold bar. + local experienceGoldName = EMA.globalFramePrefix.."ExperienceGoldBar" + local experienceGoldBar = CreateFrame( "StatusBar", experienceGoldName, parentFrame, "TextStatusBar", "SecureActionButtonTemplate" ) + experienceGoldBar.backgroundTexture = experienceGoldBar:CreateTexture( experienceGoldName.."BackgroundTexture", "ARTWORK" ) + experienceGoldBar.backgroundTexture:SetColorTexture( 1.0, 0.0, 0.0, 0.15 ) + experienceGoldBar:SetStatusBarTexture( statusBarTexture ) + experienceGoldBar:GetStatusBarTexture():SetHorizTile( false ) + experienceGoldBar:GetStatusBarTexture():SetHorizTile( false ) + experienceGoldBar:GetStatusBarTexture():SetVertTile( false ) + experienceGoldBar:SetMinMaxValues( 0, 100 ) + experienceGoldBar:SetValue( 100 ) + experienceGoldBar:SetFrameStrata( "LOW" ) + local experienceGoldBarClick = CreateFrame( "CheckButton", experienceGoldName.."Click", parentFrame, "SecureActionButtonTemplate" ) + experienceGoldBarClick:SetAttribute( "unit", Ambiguate( characterName, "all" ) ) + experienceGoldBarClick:SetFrameStrata( "MEDIUM" ) + characterStatusBar["experienceGoldBar"] = experienceGoldBar + characterStatusBar["experienceGoldBarClick"] = experienceGoldBarClick + local experienceGoldBarText = experienceGoldBar:CreateFontString( experienceGoldName.."Text", "OVERLAY", "GameFontNormal" ) + experienceGoldBarText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + experienceGoldBarText:SetFont( textFont , textSize, "OUTLINE") + experienceGoldBarText:SetAllPoints() + experienceGoldBarText.currentGold = 100 + + characterStatusBar["experienceGoldBarText"] = experienceGoldBarText + EMA:UpdateExperienceStatus( characterName, nil, nil, nil, nil, nil, nil, nil, nil ) -- Set the reputation bar. local reputationName = EMA.globalFramePrefix.."ReputationBar" @@ -795,8 +794,8 @@ function EMA:HideEMATeamStatusBar( characterName ) characterStatusBar["followBarClick"]:Hide() characterStatusBar["experienceBar"]:Hide() characterStatusBar["experienceBarClick"]:Hide() - characterStatusBar["experienceArtBar"]:Hide() - characterStatusBar["experienceArtBarClick"]:Hide() + characterStatusBar["experienceGoldBar"]:Hide() + characterStatusBar["experienceGoldBarClick"]:Hide() characterStatusBar["reputationBar"]:Hide() characterStatusBar["reputationBarClick"]:Hide() characterStatusBar["healthBar"]:Hide() @@ -950,47 +949,47 @@ function EMA:UpdateEMATeamStatusBar( characterName, characterPosition ) -- Display the experience bar. local experienceBar = characterStatusBar["experienceBar"] local experienceBarClick = characterStatusBar["experienceBarClick"] - local experienceArtBar = characterStatusBar["experienceArtBar"] - local experienceArtBarClick = characterStatusBar["experienceArtBarClick"] + local experienceGoldBar = characterStatusBar["experienceGoldBar"] + local experienceGoldBarClick = characterStatusBar["experienceGoldBarClick"] local experienceHonorBar = characterStatusBar["experienceHonorBar"] local experienceHonorBarClick = characterStatusBar["experienceHonorBarClick"] local reputationBar = characterStatusBar["reputationBar"] local reputationBarClick = characterStatusBar["reputationBarClick"] if EMA.db.showExperienceStatus == true then - --EMA:Print("TestLevel", characterName, level, maxLevel, xpDisabled, showXP, showArtifact ) + --EMA:Print("TestLevel", characterName, level, maxLevel, xpDisabled, showXP, showGold ) local showBarCount = 0 if EMA.db.showXpStatus == true then showBarCount = showBarCount + 1 showBeforeBar = parentFrame showXP = true end - if EMA.db.showArtifactStatus == true then - --EMA:Print("ShowArtifact") + if EMA.db.showGoldStatus == true then + --EMA:Print("ShowGold") showBarCount = showBarCount + 1 if EMA.db.showXpStatus == true then - showArtBeforeBar = experienceBar - setArtPoint = "BOTTOMLEFT" - setArtLeft = 0 - setArtTop = -1 + showGoldBeforeBar = experienceBar + setGoldPoint = "BOTTOMLEFT" + setGoldLeft = 0 + setGoldTop = -1 else - showArtBeforeBar = parentFrame - setArtPoint = "TOPLEFT" - setArtLeft = positionLeft - setArtTop = positionTop + showGoldBeforeBar = parentFrame + setGoldPoint = "TOPLEFT" + setGoldLeft = positionLeft + setGoldTop = positionTop end end if EMA.db.showRepStatus == true then --EMA:Print("Show Reputation") showBarCount = showBarCount + 1 - if EMA.db.showXpStatus == true and EMA.db.showArtifactStatus == false then --and EMA.db.showHonorStatus == false then + if EMA.db.showXpStatus == true and EMA.db.showGoldStatus == false then --and EMA.db.showHonorStatus == false then --EMA:Print("Show Reputation 1") showRepBeforeBar = experienceBar setRepPoint = "BOTTOMLEFT" setRepLeft = 0 setRepTop = -1 - elseif EMA.db.showArtifactStatus == true then --and EMA.db.showHonorStatus == false then + elseif EMA.db.showGoldStatusStatus == true then --and EMA.db.showHonorStatus == false then --EMA:Print("Show Reputation 2") - showRepBeforeBar = experienceArtBar + showRepBeforeBar = experienceGoldBar setRepPoint = "BOTTOMLEFT" setRepLeft = 0 setRepTop = -1 @@ -1023,22 +1022,22 @@ function EMA:UpdateEMATeamStatusBar( characterName, characterPosition ) experienceBar:Hide() experienceBarClick:Hide() end - --Artifact Bar - experienceArtBar.backgroundTexture:SetAllPoints() - experienceArtBar:SetWidth( EMA.db.experienceStatusWidth ) - experienceArtBar:SetHeight( EMA.db.experienceStatusHeight / showBarCount ) - experienceArtBar:ClearAllPoints() - experienceArtBar:SetPoint( "TOPLEFT", showArtBeforeBar, setArtPoint, setArtLeft , setArtTop ) - experienceArtBarClick:ClearAllPoints() - experienceArtBarClick:SetPoint( "TOPLEFT", showArtBeforeBar, setArtPoint, setArtLeft , setArtTop ) - experienceArtBarClick:SetWidth( EMA.db.experienceStatusWidth ) - experienceArtBarClick:SetHeight( EMA.db.experienceStatusHeight / showBarCount ) - if EMA.db.showArtifactStatus == true then - experienceArtBar:Show() - experienceArtBarClick:Show() + --Gold Bar + experienceGoldBar.backgroundTexture:SetAllPoints() + experienceGoldBar:SetWidth( EMA.db.experienceStatusWidth ) + experienceGoldBar:SetHeight( EMA.db.experienceStatusHeight / showBarCount ) + experienceGoldBar:ClearAllPoints() + experienceGoldBar:SetPoint( "TOPLEFT", showGoldBeforeBar, setGoldPoint, setGoldLeft , setGoldTop ) + experienceGoldBarClick:ClearAllPoints() + experienceGoldBarClick:SetPoint( "TOPLEFT", showGoldBeforeBar, setGoldPoint, setGoldLeft , setGoldTop ) + experienceGoldBarClick:SetWidth( EMA.db.experienceStatusWidth ) + experienceGoldBarClick:SetHeight( EMA.db.experienceStatusHeight / showBarCount ) + if EMA.db.showGoldStatus == true then + experienceGoldBar:Show() + experienceGoldBarClick:Show() else - experienceArtBar:Hide() - experienceArtBarClick:Hide() + experienceGoldBar:Hide() + experienceGoldBarClick:Hide() end --rep @@ -1068,9 +1067,12 @@ function EMA:UpdateEMATeamStatusBar( characterName, characterPosition ) else experienceBar:Hide() experienceBarClick:Hide() - experienceArtBar:Hide() - experienceArtBarClick:Hide() + experienceGoldBar:Hide() + experienceGoldBarClick:Hide() end + + + -- Display the health bar. local healthBar = characterStatusBar["healthBar"] local healthIncomingBar = characterStatusBar["healthIncomingBar"] @@ -1487,23 +1489,32 @@ local function SettingsCreateDisplayOptions( top ) L["PERCENTAGE_HELP"] ) movingTop = movingTop - checkBoxHeight - verticalSpacing - EMA.settingsControl.displayOptionsCheckBoxShowXpStatus = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl.displayOptionsCheckBoxShowLevel = EMAHelperSettings:CreateCheckBox( EMA.settingsControl, thirdWidth, left, movingTop, + L["SHOW_LEVEL"], + EMA.SettingsToggleShowLevel, + L["SHOW_LEVEL_HELP"] + ) + EMA.settingsControl.displayOptionsCheckBoxShowXpStatus = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + thirdWidth, + left2, + movingTop, L["SHOW_XP"], EMA.SettingsToggleShowXpStatus, L["SHOW_XP_HELP"] ) - EMA.settingsControl.displayOptionsCheckBoxShowArtifactStatus = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl.displayOptionsCheckBoxShowGoldStatus = EMAHelperSettings:CreateCheckBox( EMA.settingsControl, thirdWidth, - left2, + left3, movingTop, - L["ARTIFACT_BAR"], - EMA.SettingsToggleShowArtifactStatus, - L["ARTIFACT_BAR_HELP"] + L["GOLD"], + EMA.SettingsToggleShowGoldStatus, + L["GOLD"] ) movingTop = movingTop - checkBoxHeight - verticalSpacing EMA.settingsControl.displayOptionsCheckBoxShowRepStatus = EMAHelperSettings:CreateCheckBox( @@ -1807,7 +1818,8 @@ function EMA:SettingsRefresh() EMA.settingsControl.displayOptionsFollowStatusHeightSlider:SetValue( EMA.db.followStatusHeight ) EMA.settingsControl.displayOptionsCheckBoxShowExperienceStatus:SetValue( EMA.db.showExperienceStatus ) EMA.settingsControl.displayOptionsCheckBoxShowXpStatus:SetValue( EMA.db.showXpStatus ) - EMA.settingsControl.displayOptionsCheckBoxShowArtifactStatus:SetValue( EMA.db.showArtifactStatus ) + EMA.settingsControl.displayOptionsCheckBoxShowLevel:SetValue( EMA.db.showLevel ) + EMA.settingsControl.displayOptionsCheckBoxShowGoldStatus:SetValue( EMA.db.showGoldStatus ) EMA.settingsControl.displayOptionsCheckBoxShowRepStatus:SetValue( EMA.db.showRepStatus ) EMA.settingsControl.displayOptionsCheckBoxShowExperienceStatusValues:SetValue( EMA.db.experienceStatusShowValues ) EMA.settingsControl.displayOptionsCheckBoxShowExperienceStatusPercentage:SetValue( EMA.db.experienceStatusShowPercentage ) @@ -1863,7 +1875,8 @@ function EMA:SettingsRefresh() EMA.settingsControl.displayOptionsFollowStatusHeightSlider:SetDisabled( not EMA.db.showTeamList or not EMA.db.showFollowStatus) EMA.settingsControl.displayOptionsCheckBoxShowExperienceStatus:SetDisabled( not EMA.db.showTeamList ) EMA.settingsControl.displayOptionsCheckBoxShowXpStatus:SetDisabled( not EMA.db.showTeamList or not EMA.db.showExperienceStatus) - EMA.settingsControl.displayOptionsCheckBoxShowArtifactStatus:SetDisabled( not EMA.db.showTeamList or not EMA.db.showExperienceStatus) + EMA.settingsControl.displayOptionsCheckBoxShowLevel:SetDisabled( not EMA.db.showTeamList or not EMA.db.showExperienceStatus) + EMA.settingsControl.displayOptionsCheckBoxShowGoldStatus:SetDisabled( not EMA.db.showTeamList or not EMA.db.showExperienceStatus) EMA.settingsControl.displayOptionsCheckBoxShowRepStatus:SetDisabled( not EMA.db.showTeamList or not EMA.db.showExperienceStatus ) EMA.settingsControl.displayOptionsCheckBoxShowExperienceStatusValues:SetDisabled( not EMA.db.showTeamList or not EMA.db.showExperienceStatus ) EMA.settingsControl.displayOptionsCheckBoxShowExperienceStatusPercentage:SetDisabled( not EMA.db.showTeamList or not EMA.db.showExperienceStatus ) @@ -1939,7 +1952,8 @@ function EMA:EMAOnSettingsReceived( characterName, settings ) EMA.db.followStatusShowName = settings.followStatusShowName EMA.db.showExperienceStatus = settings.showExperienceStatus EMA.db.showXpStatus = settings.showXpStatus - EMA.db.showArtifactStatus = settings.showArtifactStatus + EMA.db.showLevel = settings.showLevel + EMA.db.showGoldStatus = settings.showGoldStatus EMA.db.showRepStatus = settings.showRepStatus EMA.db.experienceStatusWidth = settings.experienceStatusWidth EMA.db.experienceStatusHeight = settings.experienceStatusHeight @@ -2121,14 +2135,18 @@ function EMA:SettingsToggleShowExperienceStatus( event, checked ) EMA:SettingsRefresh() end -- +function EMA:SettingsToggleShowLevel( event, checked ) + EMA.db.showLevel = checked + EMA:SettingsRefresh() +end function EMA:SettingsToggleShowXpStatus( event, checked ) EMA.db.showXpStatus = checked EMA:SettingsRefresh() end -function EMA:SettingsToggleShowArtifactStatus( event, checked ) - EMA.db.showArtifactStatus = checked +function EMA:SettingsToggleShowGoldStatus( event, checked ) + EMA.db.showGoldStatus = checked EMA:SettingsRefresh() end @@ -2497,7 +2515,8 @@ function EMA:PLAYER_LEVEL_UP( event, ... ) EMA:SendExperienceStatusUpdateCommand() end -function EMA:ARTIFACT_XP_UPDATE(event, ...) + +function EMA:PLAYER_MONEY(event, ...) EMA:SendExperienceStatusUpdateCommand() end @@ -2509,52 +2528,34 @@ function EMA:SendExperienceStatusUpdateCommand() local playerMaxLevel = GetMaxPlayerLevel() local playerLevel = UnitLevel("player") local exhaustionStateID, exhaustionStateName, exhaustionStateMultiplier = GetRestState() - --Artifact XP - local artifactName = "n/a" - local artifactXP = 0 - local artifactForNextPoint = 100 - local artifactPointsAvailable = 0 - local artifactPointsSpent = 0 + -- Gold + local currentGold = GetMoney() - - local azeriteItemLocation = C_AzeriteItem.FindActiveAzeriteItem() - if (azeriteItemLocation) and HasArtifactEquipped() == false then - local azeriteXP, azeriteTotalXP = C_AzeriteItem.GetAzeriteItemXPInfo(azeriteItemLocation) - local azeriteLevel = C_AzeriteItem.GetPowerLevel(azeriteItemLocation) - local azeriteItem = Item:CreateFromItemLocation(azeriteItemLocation) - local azeriteName = azeriteItem:GetItemName() - --EMA:Print("test", azeriteName, azeriteXP, azeriteTotalXP ) - artifactName = azeriteName - artifactXP = azeriteXP - artifactForNextPoint = azeriteTotalXP - artifactPointsAvailable = 0 - artifactPointsSpent = 0 - end if EMA.db.showTeamListOnMasterOnly == true then --EMA:Print("Testtoteam", characterName, name, xp, xpForNextPoint, numPointsAvailableToSpend) --EMA:Print("TestTOTEAM", characterName, name, xp, xpForNextPoint, numPointsAvailableToSpend) - EMA:EMASendCommandToMaster( EMA.COMMAND_EXPERIENCE_STATUS_UPDATE, playerExperience, playerMaxExperience, exhaustionStateID, playerLevel, artifactName, artifactXP, artifactPointsSpent, artifactForNextPoint, artifactPointsAvailable )--, honorXP, honorMax, HonorLevel, prestigeLevel, honorExhaustionStateID ) + EMA:EMASendCommandToMaster( EMA.COMMAND_EXPERIENCE_STATUS_UPDATE, playerExperience, playerMaxExperience, exhaustionStateID, playerLevel, currentGold )--, honorXP, honorMax, HonorLevel, prestigeLevel, honorExhaustionStateID ) else --EMA:DebugMessage( "SendExperienceStatusUpdateCommand TO TEAM!" ) --EMA:Print("TestTOTEAM", characterName, name, xp, xpForNextPoint, numPointsAvailableToSpend) - EMA:EMASendCommandToTeam( EMA.COMMAND_EXPERIENCE_STATUS_UPDATE, playerExperience, playerMaxExperience, exhaustionStateID, playerLevel, artifactName, artifactXP, artifactPointsSpent, artifactForNextPoint, artifactPointsAvailable ) --, honorXP, honorMax, HonorLevel, prestigeLevel, honorExhaustionStateID) + EMA:EMASendCommandToTeam( EMA.COMMAND_EXPERIENCE_STATUS_UPDATE, playerExperience, playerMaxExperience, exhaustionStateID, playerLevel, currentGold ) --, honorXP, honorMax, HonorLevel, prestigeLevel, honorExhaustionStateID) end end end -function EMA:ProcessUpdateExperienceStatusMessage( characterName, playerExperience, playerMaxExperience, exhaustionStateID, playerLevel, artifactName, artifactXP, artifactForNextPoint, artifactPointsSpent, artifactPointsAvailable ) --, honorXP, honorMax, HonorLevel, prestigeLevel, honorExhaustionStateID) - EMA:UpdateExperienceStatus( characterName, playerExperience, playerMaxExperience, exhaustionStateID, playerLevel, artifactName, artifactXP, artifactForNextPoint, artifactPointsSpent, artifactPointsAvailable ) --, honorXP, honorMax, HonorLevel, prestigeLevel, honorExhaustionStateID ) +function EMA:ProcessUpdateExperienceStatusMessage( characterName, playerExperience, playerMaxExperience, exhaustionStateID, playerLevel, currentGold ) --, honorXP, honorMax, HonorLevel, prestigeLevel, honorExhaustionStateID) + EMA:UpdateExperienceStatus( characterName, playerExperience, playerMaxExperience, exhaustionStateID, playerLevel, currentGold ) --, honorXP, honorMax, HonorLevel, prestigeLevel, honorExhaustionStateID ) end function EMA:SettingsUpdateExperienceAll() for characterName, characterStatusBar in pairs( EMA.characterStatusBar ) do - EMA:UpdateExperienceStatus( characterName, nil, nil, nil, nil, nil, nil, nil, nil, nil) --, nil, nil, nil, nil, nil ) + EMA:UpdateExperienceStatus( characterName, nil, nil, nil, nil, nil, nil) --, nil, nil, nil) --, nil, nil, nil, nil, nil ) end end -function EMA:UpdateExperienceStatus( characterName, playerExperience, playerMaxExperience, exhaustionStateID, playerLevel, artifactName, artifactXP, artifactPointsSpent, artifactForNextPoint, artifactPointsAvailable) --, honorXP, honorMax, HonorLevel, prestigeLevel, honorExhaustionStateID ) +function EMA:UpdateExperienceStatus( characterName, playerExperience, playerMaxExperience, exhaustionStateID, playerLevel, currentGold ) --, honorXP, honorMax, HonorLevel, prestigeLevel, honorExhaustionStateID ) -- EMA:Print( "UpdateExperienceStatus", characterName, playerExperience, playerMaxExperience, exhaustionStateID, playerLevel) --- EMA:Print("ArtTest", characterName, "name", artifactName, "xp", artifactXP, "Points", artifactForNextPoint, artifactPointsAvailable) +-- EMA:Print("GoldTest", characterName, "gold", currentGold) if CanDisplayTeamList() == false then return end @@ -2570,12 +2571,12 @@ function EMA:UpdateExperienceStatus( characterName, playerExperience, playerMaxE local experienceBarText = characterStatusBar["experienceBarText"] local experienceBar = characterStatusBar["experienceBar"] - local experienceArtBarText = characterStatusBar["experienceArtBarText"] - if characterStatusBar["experienceArtBarText"] == nil then + local experienceGoldBarText = characterStatusBar["experienceGoldBarText"] + if characterStatusBar["experienceGoldBarText"] == nil then return end - local experienceArtBar = characterStatusBar["experienceArtBar"] - if characterStatusBar["experienceArtBar"] == nil then + local experienceGoldBar = characterStatusBar["experienceGoldBar"] + if characterStatusBar["experienceGoldBar"] == nil then return end if playerExperience == nil then @@ -2590,37 +2591,22 @@ function EMA:UpdateExperienceStatus( characterName, playerExperience, playerMaxE if playerLevel == nil then playerLevel = experienceBarText.playerLevel end - if artifactName == nil then - artifactName = experienceArtBarText.artifactName - end - - if artifactXP == nil then - artifactXP = experienceArtBarText.artifactXP - end - if artifactPointsSpent == nil then - artifactPointsSpent = experienceArtBarText.artifactPointsSpent - end - if artifactForNextPoint == nil then - artifactForNextPoint = experienceArtBarText.artifactForNextPoint + --EMA:Print("test", currentGold, "v", experienceGoldBarText.currentGold) + if currentGold == nil then + currentGold = experienceGoldBarText.currentGold end - if artifactPointsAvailable == nil then - artifactPointsAvailable = experienceArtBarText.artifactPointsAvailable - end - experienceBarText.playerExperience = playerExperience experienceBarText.playerMaxExperience = playerMaxExperience experienceBarText.exhaustionStateID = exhaustionStateID experienceBarText.playerLevel = playerLevel - experienceArtBarText.artifactName = artifactName - experienceArtBarText.artifactXP = artifactXP - experienceArtBarText.artifactPointsSpent = artifactPointsSpent - experienceArtBarText.artifactForNextPoint = artifactForNextPoint - experienceArtBarText.artifactPointsAvailable = artifactPointsAvailable + experienceGoldBarText.currentGold = currentGold + local min, max = math.min(0, playerExperience), playerMaxExperience experienceBar:SetAnimatedValues(playerExperience, min, max , playerLevel) - experienceArtBar:SetAnimatedValues(artifactXP, 0, artifactForNextPoint, artifactPointsAvailable + artifactPointsSpent) + + experienceGoldBar:SetValue( currentGold, currentGold ) local text = "" if EMA.db.experienceStatusShowValues == true then @@ -2632,6 +2618,9 @@ function EMA:UpdateExperienceStatus( characterName, playerExperience, playerMaxE else text = tostring( floor( (playerExperience/playerMaxExperience)*100) )..L["%"] end + if EMA.db.showLevel then + text = "Lv " ..tostring( playerLevel ) .. " | ".. text + end end experienceBarText:SetText( text ) if exhaustionStateID == 1 then @@ -2642,26 +2631,19 @@ function EMA:UpdateExperienceStatus( characterName, playerExperience, playerMaxE experienceBar.backgroundTexture:SetColorTexture( 0.58, 0.0, 0.55, 0.15 ) end ---ArtText - local artText = "" - --EMA:Print("TextTest", artifactXP, artifactForNextPoint) +-- Gold Text + local goldText = "" + --EMA:Print("TextTest", currentGold) if EMA.db.experienceStatusShowValues == true and EMA.db.experienceStatusShowPercentage == false then - artText = artText..tostring( AbbreviateLargeNumbers(artifactXP ) )..L[" / "]..tostring( AbbreviateLargeNumbers(artifactForNextPoint) )..L[" "] + goldText = goldText..tostring( EMAUtilities:FormatMoneyString(currentGold ) ) end if EMA.db.experienceStatusShowPercentage == true then - if EMA.db.experienceStatusShowValues == true then - artText = artText..L["("]..tostring( AbbreviateLargeNumbers(artifactXP ) )..L[" "]..tostring( floor( (artifactXP/artifactForNextPoint)*100) )..L["%"]..L[")"] - else - artText = artText..L["("]..tostring( floor( (artifactXP/artifactForNextPoint)*100) )..L["%"]..L[")"] - end + goldText = goldText..tostring( EMAUtilities:FormatMoneyString(currentGold ) ) end - if artifactPointsAvailable > 0 then - artText = artText..L[" "].."[+ "..artifactPointsAvailable.."]" - end - --EMA:Print("arttest", artText) - experienceArtBarText:SetText( artText ) - experienceArtBar:SetStatusBarColor( 0.901, 0.8, 0.601, 1.0 ) - experienceArtBar.backgroundTexture:SetColorTexture( 0.901, 0.8, 0.601, 0.20 ) + --EMA:Print("arttest", goldText) + experienceGoldBarText:SetText( goldText ) + experienceGoldBar:SetStatusBarColor( 0.80,0.60,0.00, 0 ) + experienceGoldBar.backgroundTexture:SetColorTexture( 0.80, 0.60, 0.00, 0.20 ) end @@ -2807,7 +2789,12 @@ function EMA:SendHealthStatusUpdateCommand(unit) --EMA:Print("itsme", unit) local playerHealth = UnitHealth( unit ) local playerMaxHealth = UnitHealthMax( unit ) - local inComingHeal = UnitGetIncomingHeals( unit ) + -- TODO FIX ME! probs need to add libincoming heal. + if EMAPrivate.Core.isEmaClassicBccBuild() == false or EMAPrivate.Core.isEmaClassicBuild() == false then + local inComingHeal = UnitGetIncomingHeals( unit ) + else + local inComingHeal = 0 + end local _, class = UnitClass ("player") if EMA.db.showTeamListOnMasterOnly == true then @@ -2821,7 +2808,12 @@ function EMA:SendHealthStatusUpdateCommand(unit) else local playerHealth = UnitHealth( unit ) local playerMaxHealth = UnitHealthMax( unit ) - local inComingHeal = UnitGetIncomingHeals( unit ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false or EMAPrivate.Core.isEmaClassicBuild() == false then + local inComingHeal = UnitGetIncomingHeals( unit ) + else + local inComingHeal = 0 + end + local characterName, characterRealm = UnitName( unit ) local _, class = UnitClass ( unit ) local character = EMAUtilities:AddRealmToNameIfNotNil( characterName, characterRealm ) @@ -3330,21 +3322,23 @@ function EMA:OnEnable() EMA:RegisterEvent( "PLAYER_LEVEL_UP" ) EMA:RegisterEvent( "UNIT_HEALTH" ) EMA:RegisterEvent( "UNIT_MAXHEALTH" ) - EMA:RegisterEvent( "UNIT_HEAL_PREDICTION" ) EMA:RegisterEvent( "UNIT_POWER_UPDATE", "UNIT_POWER" ) EMA:RegisterEvent( "UNIT_MAXPOWER", "UNIT_POWER" ) EMA:RegisterEvent( "UNIT_DISPLAYPOWER" ) EMA:RegisterEvent( "CHAT_MSG_COMBAT_FACTION_CHANGE" ) EMA:RegisterEvent( "UNIT_POWER_FREQUENT") - EMA:RegisterEvent( "RUNE_POWER_UPDATE" ) - EMA:RegisterEvent( "PLAYER_TALENT_UPDATE") EMA:RegisterEvent( "GROUP_ROSTER_UPDATE" ) - EMA:RegisterEvent( "ARTIFACT_XP_UPDATE" ) + EMA:RegisterEvent( "PLAYER_MONEY" ) EMA:RegisterEvent("UNIT_PORTRAIT_UPDATE") EMA:RegisterEvent("UNIT_SPELLCAST_START") EMA:RegisterEvent("UNIT_SPELLCAST_SUCCEEDED") EMA:RegisterEvent("UNIT_SPELLCAST_STOP") EMA:RegisterEvent("UNIT_SPELLCAST_CHANNEL_STOP") + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + EMA:RegisterEvent( "UNIT_HEAL_PREDICTION" ) + EMA:RegisterEvent( "PLAYER_TALENT_UPDATE") + EMA:RegisterEvent( "RUNE_POWER_UPDATE" ) + end EMA.SharedMedia.RegisterCallback( EMA, "LibSharedMedia_Registered" ) EMA.SharedMedia.RegisterCallback( EMA, "LibSharedMedia_SetGlobal" ) EMA:RegisterMessage( EMAApi.MESSAGE_TEAM_CHARACTER_ADDED, "OnCharactersChanged" ) diff --git a/Modules/Follow.lua b/Modules/Follow.lua index 1ebe81f..33da86b 100644 --- a/Modules/Follow.lua +++ b/Modules/Follow.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -36,12 +36,12 @@ EMA.moduleIcon = "Interface\\Addons\\EMA\\Media\\FollowIcon.tga" EMA.moduleOrder = 20 -- EMA key bindings. - -BINDING_HEADER_F0LLOW = L["FOLLOW_BINDING_HEADER"] +BINDING_HEADER_FOLLOW = L["FOLLOW_BINDING_HEADER"] BINDING_NAME_FOLLOWME = L["FOLLOW_ME"] BINDING_NAME_FOLLOWSTROBEME = L["FOLLOW_STROBE_ME"] BINDING_NAME_FOLLOWSTROBEOFF = L["FOLLOW_STROBE_OFF"] BINDING_NAME_FOLLOWTEAIN = L["FOLLOW_TRAIN"] +BINDING_NAME_FOLLOWSTOP = L["FOLLOW_STOP"] -- Settings - the values to store and their defaults for the settings database. EMA.settings = { @@ -60,13 +60,13 @@ EMA.settings = { strobePauseInCombat = false, strobePauseIfDrinking = false, strobePauseIfInVehicle = false, + strobePauseIfDead = false, strobePauseTag = EMAApi.AllTag(), warningArea = EMAApi.DefaultWarningArea(), followMaster = "", useFollowMaster = false, overrideStrobeTargetWithMaster = false, onlyWarnIfOutOfFollowRange = false, - }, } @@ -173,7 +173,15 @@ function EMA:GetConfiguration() usage = "/ema-follow snw", get = false, set = "SuppressNextFollowWarningCommand", - }, + }, + stop = { + type = "input", + name = L["FOLLOW_STOP"], + desc = L["FOLLOW_STOP_HELP"], + usage = "/ema-follow stop <group>", + get = false, + set = "CommandFollowStop", + }, }, } return configuration @@ -194,6 +202,7 @@ EMA.COMMAND_FOLLOW_STROBE_OFF = "FollowStrobeOff" EMA.COMMAND_SET_FOLLOW_MASTER = "FollowMaster" EMA.COMMAND_FOLLOW_TRAIN = "FollowTrain" EMA.COMMAND_FOLLOW_ME = "FollowMe" +EMA.COMMAND_FOLLOW_STOP = "FollowStop" ------------------------------------------------------------------------------------------------------------- -- Messages module sends. @@ -419,13 +428,23 @@ local function SettingsCreateDisplayOptions( top ) EMA.SettingsTogglePauseDrinking ) movingTop = movingTop - checkBoxHeight - EMA.settingsControl.checkBoxPauseIfInVehicle = EMAHelperSettings:CreateCheckBox( + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + EMA.settingsControl.checkBoxPauseIfInVehicle = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + halfWidth, + left, + movingTop, + L["IN_A_VEHICLE"], + EMA.SettingsTogglePauseIfInVehicle + ) + end + EMA.settingsControl.checkBoxPauseIfDead = EMAHelperSettings:CreateCheckBox( EMA.settingsControl, halfWidth, - left, + column2left, movingTop, - L["IN_A_VEHICLE"], - EMA.SettingsTogglePauseIfInVehicle + L["PLAYER_DEAD"], + EMA.SettingsTogglePauseIfDead ) movingTop = movingTop - checkBoxHeight EMA.settingsControl.editBoxFollowStrobePauseTag = EMAHelperSettings:CreateEditBox( EMA.settingsControl, @@ -502,7 +521,10 @@ function EMA:SettingsRefresh() EMA.settingsControl.checkBoxOverrideStrobeTargetWithMaster:SetValue( EMA.db.overrideStrobeTargetWithMaster ) EMA.settingsControl.checkBoxPauseInCombat:SetValue( EMA.db.strobePauseInCombat ) EMA.settingsControl.checkBoxPauseDrinking:SetValue( EMA.db.strobePauseIfDrinking ) - EMA.settingsControl.checkBoxPauseIfInVehicle:SetValue( EMA.db.strobePauseIfInVehicle ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + EMA.settingsControl.checkBoxPauseIfInVehicle:SetValue( EMA.db.strobePauseIfInVehicle ) + end + EMA.settingsControl.checkBoxPauseIfDead:SetValue( EMA.db.strobePauseIfDead ) EMA.settingsControl.editBoxFollowStrobePauseTag:SetText( EMA.db.strobePauseTag ) EMA.settingsControl.editBoxFollowStrobeDelaySeconds:SetText( EMA.db.strobeFrequencySeconds ) EMA.settingsControl.editBoxFollowStrobeDelaySecondsInCombat:SetText( EMA.db.strobeFrequencySecondsInCombat ) @@ -602,6 +624,11 @@ function EMA:SettingsTogglePauseIfInVehicle( event, checked ) EMA:SettingsRefresh() end +function EMA:SettingsTogglePauseIfDead( event, checked ) + EMA.db.strobePauseIfDead = checked + EMA:SettingsRefresh() +end + function EMA:EditBoxChangedFollowStrobePauseTag( event, text ) EMA.db.strobePauseTag = text EMA:SettingsRefresh() @@ -638,32 +665,39 @@ function EMA:UPDATE_BINDINGS() ClearOverrideBindings( EMA.keyBindingFrame ) local key1, key2 = GetBindingKey( "FOLLOWME" ) if key1 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFollowSecureButtonFollowMe" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFollowMe" ) end if key2 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFollowSecureButtonFollowMe" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFollowMe" ) end local key1, key2 = GetBindingKey( "FOLLOWSTROBEME" ) if key1 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFollowSecureButtonFollowStrobeMe" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFollowStrobeMe" ) end if key2 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFollowSecureButtonFollowStrobeMe" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFollowStrobeMe" ) end local key1, key2 = GetBindingKey( "FOLLOWSTROBEOFF" ) if key1 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFollowSecureButtonFollowStrobeOff" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFollowStrobeOff" ) end if key2 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFollowSecureButtonFollowStrobeOff" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFollowStrobeOff" ) end local key1, key2 = GetBindingKey( "FOLLOWTEAIN" ) if key1 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFollowSecureButtonFollowTrain" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFollowTrain" ) end if key2 then - SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFollowSecureButtonFollowTrain" ) + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFollowTrain" ) end + local key1, key2 = GetBindingKey( "FOLLOWSTOP" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFollowStop" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFollowStop" ) + end end ------------------------------------------------------------------------------------------------------------- @@ -701,22 +735,26 @@ function EMA:OnInitialize() -- Character on taxi flag. EMA.characterIsOnTaxi = false -- Key bindings. - EMAFollowSecureButtonFollowMe = CreateFrame( "CheckButton", "EMAFollowSecureButtonFollowMe", nil, "SecureActionButtonTemplate" ) - EMAFollowSecureButtonFollowMe:SetAttribute( "type", "macro" ) - EMAFollowSecureButtonFollowMe:SetAttribute( "macrotext", "/ema-follow me all" ) - EMAFollowSecureButtonFollowMe:Hide() - EMAFollowSecureButtonStrobeMe = CreateFrame( "CheckButton", "EMAFollowSecureButtonFollowStrobeMe", nil, "SecureActionButtonTemplate" ) - EMAFollowSecureButtonStrobeMe:SetAttribute( "type", "macro" ) - EMAFollowSecureButtonStrobeMe:SetAttribute( "macrotext", "/ema-follow strobeonme all" ) - EMAFollowSecureButtonStrobeMe:Hide() - EMAFollowSecureButtonFollowStrobeOff = CreateFrame( "CheckButton", "EMAFollowSecureButtonFollowStrobeOff", nil, "SecureActionButtonTemplate" ) - EMAFollowSecureButtonFollowStrobeOff:SetAttribute( "type", "macro" ) - EMAFollowSecureButtonFollowStrobeOff:SetAttribute( "macrotext", "/ema-follow strobeoff all" ) - EMAFollowSecureButtonFollowStrobeOff:Hide() - EMAFollowSecureButtonFollowTrain = CreateFrame( "CheckButton", "EMAFollowSecureButtonFollowTrain", nil, "SecureActionButtonTemplate" ) - EMAFollowSecureButtonFollowTrain:SetAttribute( "type", "macro" ) - EMAFollowSecureButtonFollowTrain:SetAttribute( "macrotext", "/ema-follow train all" ) - EMAFollowSecureButtonFollowTrain:Hide() + EMAFollowMe = CreateFrame( "CheckButton", "EMAFollowMe", nil, "SecureActionButtonTemplate" ) + EMAFollowMe:SetAttribute( "type", "macro" ) + EMAFollowMe:SetAttribute( "macrotext", "/ema-follow me all" ) + EMAFollowMe:Hide() + EMAFollowStrobeMe = CreateFrame( "CheckButton", "EMAFollowStrobeMe", nil, "SecureActionButtonTemplate" ) + EMAFollowStrobeMe:SetAttribute( "type", "macro" ) + EMAFollowStrobeMe:SetAttribute( "macrotext", "/ema-follow strobeonme all" ) + EMAFollowStrobeMe:Hide() + EMAFollowStrobeOff = CreateFrame( "CheckButton", "EMAFollowStrobeOff", nil, "SecureActionButtonTemplate" ) + EMAFollowStrobeOff:SetAttribute( "type", "macro" ) + EMAFollowStrobeOff:SetAttribute( "macrotext", "/ema-follow strobeoff all" ) + EMAFollowStrobeOff:Hide() + EMAFollowTrain = CreateFrame( "CheckButton", "EMAFollowTrain", nil, "SecureActionButtonTemplate" ) + EMAFollowTrain:SetAttribute( "type", "macro" ) + EMAFollowTrain:SetAttribute( "macrotext", "/ema-follow train all" ) + EMAFollowTrain:Hide() + EMAFollowStop = CreateFrame( "CheckButton", "EMAFollowStop", nil, "SecureActionButtonTemplate" ) + EMAFollowStop:SetAttribute( "type", "macro" ) + EMAFollowStop:SetAttribute( "macrotext", "/ema-follow stop all" ) + EMAFollowStop:Hide() end -- Called when the addon is enabled. @@ -727,9 +765,11 @@ function EMA:OnEnable() EMA:RegisterEvent( "PLAYER_REGEN_DISABLED" ) EMA:RegisterEvent( "PLAYER_REGEN_ENABLED" ) EMA:RegisterEvent( "PLAYER_CONTROL_GAINED" ) - EMA:RegisterEvent( "UNIT_ENTERING_VEHICLE" ) - EMA:RegisterEvent( "UNIT_EXITING_VEHICLE" ) - EMA:RegisterEvent( "UI_ERROR_MESSAGE", "PVP_FOLLOW" ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + EMA:RegisterEvent( "UNIT_ENTERING_VEHICLE" ) + EMA:RegisterEvent( "UNIT_EXITING_VEHICLE" ) + EMA:RegisterEvent( "UI_ERROR_MESSAGE", "PVP_FOLLOW" ) + end -- Initialise key bindings. EMA.keyBindingFrame = CreateFrame( "Frame", nil, UIParent ) EMA:RegisterEvent( "UPDATE_BINDINGS" ) @@ -763,6 +803,7 @@ function EMA:EMAOnSettingsReceived( characterName, settings ) EMA.db.warnFollowPvP = settings.warnFollowPvP EMA.db.strobePauseInCombat = settings.strobePauseInCombat EMA.db.strobePauseIfInVehicle = settings.strobePauseIfInVehicle + EMA.db.strobePauseIfDead = settings.strobePauseIfDead EMA.db.strobePauseIfDrinking = settings.strobePauseIfDrinking EMA.db.strobePauseTag = settings.strobePauseTag EMA.db.doNotWarnFollowStrobing = settings.doNotWarnFollowStrobing @@ -857,6 +898,7 @@ end function EMA:SuppressNextFollowWarning() -- Events are fired as follows for a /follow command. + --EMA:Print("testfollow", EMA.isFollowing) if EMA.isFollowing == true then EMA:SetNoFollowBrokenWarningNextBreak() EMA:SetNoFollowBrokenWarningNextSecondBreak() @@ -904,19 +946,21 @@ function EMA:AutoFollowEndSend() end -- Do not warn if on Taxi if UnitOnTaxi("player") == true then - --EMA:Print("taxi") - canWarn = false + --EMA:Print("taxi") + canWarn = false end --Do not warn if in combat? if EMA.db.doNotWarnFollowBreakInCombat == true and EMA.outOfCombat == false then --EMA:Print("Do Not warn in comabt") canWarn = false end - --Do not warn if a passenger in a vehicle. - if UnitInVehicle("Player") == true and UnitControllingVehicle("player") == false then - --EMA:Print("UnitInVehicle") - canWarn = false - end + --Do not warn if a passenger in a vehicle. -- not in classic or bc + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + if UnitInVehicle("Player") == true and UnitControllingVehicle("player") == false then + --EMA:Print("UnitInVehicle") + canWarn = false + end + end -- Do not warn if any other members in combat? if EMA.db.doNotWarnFollowBreakMembersInCombat == true and EMA:AreTeamMembersInCombat() == true or UnitAffectingCombat("player") == true then --EMA:Print("doNotWarnFollowBreakMembersInCombat") @@ -936,6 +980,11 @@ function EMA:AutoFollowEndSend() canWarn = false end end + if EMA.EMAExternalNoWarnNextBreak == true then + --EMA:Print("test", EMA.EMAExternalNoWarnNextBreak ) + canWarn = false + EMA.EMAExternalNoWarnNextBreak = false + end -- If allowed to warn, then warn. if canWarn == true then EMA:EMASendMessageToTeam( EMA.db.warningArea, EMA.db.followBrokenMessage, false ) @@ -990,7 +1039,7 @@ end function EMA:PVP_FOLLOW(event, arg1, message, ... ) --EMA:Print("test", message, EMA.warnFollowPvPCombat ) - if EMA.db.warnFollowPvP == false and EMA.db.warnWhenFollowBreaks == false then + if EMA.db.warnFollowPvP == false and EMA.db.warnWhenFollowBreaks == false and EMAPrivate.Core.isEmaClassicBccBuild() == true then return end if message == ERR_INVALID_FOLLOW_TARGET_PVP_COMBAT or message == ERR_INVALID_FOLLOW_PVP_COMBAT then @@ -1107,13 +1156,15 @@ end function EMA:CommandFollowMe( info, parameters ) local tag = parameters if tag ~= nil and tag:trim() ~= "" then + EMA.SuppressNextFollowWarning() EMA:EMASendCommandToTeam( EMA.COMMAND_FOLLOW_ME, tag ) end end function EMA:ReceiveCommandFollowMe( characterName, tag ) - --EMA:Print("testfollowme", characterName, tag ) - if EMAApi.DoesCharacterHaveTag( EMA.characterName, tag ) then + --EMA:Print("testfollowme", characterName, tag ) + if EMAApi.DoesCharacterHaveTag( EMA.characterName, tag ) and characterName ~= EMA.characterName then + --EMA:Print("works") FollowUnit( Ambiguate( characterName, "none" ), true ) end end @@ -1278,6 +1329,12 @@ function EMA:FollowTarget( target ) end end end + if EMA.followingStrobing == true and EMA.db.strobePauseIfDead == true then + local isDeadOrGhost = UnitIsDeadOrGhost("player") + if isDeadOrGhost == true then + canFollowTarget = false + end + end -- If follow strobing and strobing paused. if EMA.followingStrobing == true and EMA.followingStrobingPaused == true then -- Follow strobing is paused, do not follow target. @@ -1342,6 +1399,20 @@ function EMA:FollowStrobingPause( pause ) end end +function EMA:CommandFollowStop( info, parameters ) + local tag = parameters + if tag ~= nil and tag:trim() ~= "" then + EMA:EMASendCommandToTeam( EMA.COMMAND_FOLLOW_STOP, tag ) + end +end + +function EMA:ReceiveCommandFollowStop( characterName, tag ) + --EMA:Print("testfollowStop", characterName, tag ) + if EMAApi.DoesCharacterHaveTag( EMA.characterName, tag ) and characterName ~= EMA.characterName then + FollowUnit( "player" ) + end +end + -- A EMA command has been recieved. function EMA:EMAOnCommandReceived( characterName, commandName, ... ) if commandName == EMA.COMMAND_FOLLOW_TARGET then @@ -1365,6 +1436,9 @@ function EMA:EMAOnCommandReceived( characterName, commandName, ... ) if commandName == EMA.COMMAND_FOLLOW_ME then EMA:ReceiveCommandFollowMe( characterName, ... ) end + if commandName == EMA.COMMAND_FOLLOW_STOP then + EMA:ReceiveCommandFollowStop( characterName, ... ) + end end EMAApi.Follow = {} diff --git a/Modules/Guild.lua b/Modules/Guild.lua index d3034af..a58792e 100644 --- a/Modules/Guild.lua +++ b/Modules/Guild.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -10,6 +10,10 @@ -- -- -- ================================================================================ -- +-- Olny Load on Live/Tbc! +if WOW_PROJECT_ID == WOW_PROJECT_CLASSIC then + return +end -- Create the addon using AceAddon-3.0 and embed some libraries. local EMA = LibStub( "AceAddon-3.0" ):NewAddon( @@ -817,10 +821,14 @@ end function EMA:GUILDBANKFRAME_OPENED() if EMA.db.showEMAGuildWindow == true then - EMA:AddAllToGuildBank() + if not IsShiftKeyDown() then + EMA:AddAllToGuildBank() + end end if EMA.db.adjustMoneyWithGuildBank == true then - AddGoldToGuildBank() + if not IsShiftKeyDown() then + AddGoldToGuildBank() + end end end diff --git a/Modules/ISBoxer.lua b/Modules/ISBoxer.lua deleted file mode 100644 index c8e0440..0000000 --- a/Modules/ISBoxer.lua +++ /dev/null @@ -1,534 +0,0 @@ --- ================================================================================ -- --- EMA - ( Ebony's MultiBoxing Assistant ) -- --- Current Author: Jennifer Cally (Ebony) -- --- -- --- License: All Rights Reserved 2018-2019 Jennifer Cally -- --- -- --- Some Code Used from "Jamba" that is -- --- Released under the MIT License -- --- "Jamba" Copyright 2008-2015 Michael "Jafula" Miller -- --- -- --- ================================================================================ -- --- Create the addon using AceAddon-3.0 and embed some libraries. - -local EMA = LibStub( "AceAddon-3.0" ):NewAddon( - "ISBoxer", - "Module-1.0", - "AceConsole-3.0", - "AceEvent-3.0", - "AceHook-3.0", - "AceTimer-3.0" -) - --- Get the EMA Utilities Library. -local EMAUtilities = LibStub:GetLibrary( "EbonyUtilities-1.0" ) -local EMAHelperSettings = LibStub:GetLibrary( "EMAHelperSettings-1.0" ) -local ISBoxerAddon = IsAddOnLoaded("Isboxer" ) -local AceGUI = LibStub( "AceGUI-3.0" ) - --- Constants and Locale for this module. -EMA.moduleName = "ISBoxer" -EMA.settingsDatabaseName = "ISBoxerProfileDB" -EMA.chatCommand = "ema-isboxer" -local L = LibStub( "AceLocale-3.0" ):GetLocale( "Core" ) -EMA.parentDisplayName = L["TEAM"] -EMA.moduleDisplayName = L["ISBOXER"] --- Icon -EMA.moduleIcon = "Interface\\Addons\\EMA\\Media\\ISBoxerIcon.tga" --- order -EMA.moduleOrder = 30 - - --- Settings - the values to store and their defaults for the settings database. -EMA.settings = { - profile = { - messageArea = EMAApi.DefaultMessageArea(), - isboxerTeamList = {}, - isboxerTeamName = L["N/A"], - isboxerSync = false, - }, -} - --- Configuration. -function EMA:GetConfiguration() - local configuration = { - name = EMA.moduleDisplayName, - handler = EMA, - type = 'group', - childGroups = "tab", - get = "EMAConfigurationGetSetting", - set = "EMAConfigurationSetSetting", - args = { - config = { - type = "input", - name = L["OPEN_CONFIG"], - desc = L["OPEN_CONFIG_HELP"], - usage = "/ema-isboxer config", - get = false, - set = "", - }, - push = { - type = "input", - name = L["PUSH_SETTINGS"], - desc = L["PUSH_ALL_SETTINGS"], - usage = "/ema-isboxer push", - get = false, - set = "EMASendSettings", - guiHidden = true, - }, - iammaster = { - type = "input", - name = L["ISBOXER_SET_MASTER"], - desc = L["ISBOXER_COMMAND_LINE_HELP"], - usage = "/ema-isboxer iammaster <group>", - get = false, - set = "CommandIAmMasterIsboxer", - guiHidden = true, - }, - strobeOnMe = { - type = "input", - name = L["ISBOXER_SET_STROBEONME"], - desc = L["ISBOXER_COMMAND_LINE_HELP"], - usage = "/ema-isboxer strobeOnMe <group>", - get = false, - set = "FollowStrobeOnMeCommandIsboxer", - guiHidden = true, - }, - strobeoff = { - type = "input", - name = L["ISBOXER_SET_STROBEOFF"], - desc = L["ISBOXER_COMMAND_LINE_HELP"], - usage = "/ema-isboxer strobeoff <group>", - get = false, - set = "FollowStrobeOffCommandIsboxer", - guiHidden = true, - }, - snw = { - type = "input", - name = L["ISBOXER_SET_SNW"], - desc = L["ISBOXER_COMMAND_LINE_HELP"], - usage = "/ema-isboxer snw", - get = false, - set = "FollowStrobeOffCommandSnw", - guiHidden = true, - }, - }, - } - return configuration -end - -------------------------------------------------------------------------------------------------------------- --- CommandLines for this module sends. (cross "Jamba" Support) for isboxer -------------------------------------------------------------------------------------------------------------- - -function EMA:ChatCommandTeam(input) - if not input or input:trim() == "" then - return - else - LibStub( "AceConfigCmd-3.0" ):HandleCommand( EMA.chatCommand, EMA.moduleName, input ) - end -end - -function EMA:ChatCommandFollow(input) - --EMA:Print("test", input ) - if not input or input:trim() == "" then - return - else - LibStub( "AceConfigCmd-3.0" ):HandleCommand( EMA.chatCommand, EMA.moduleName, input ) - end -end - -function EMA:CommandIAmMasterIsboxer( info, parameters ) - EMAApi.CommandIAmMaster( parameters ) -end - -function EMA:FollowStrobeOnMeCommandIsboxer( info, parameters ) - EMAApi.Follow.StrobeOnMeCommand( parameters ) -end - -function EMA:FollowStrobeOffCommandIsboxer( info, parameters ) - EMAApi.Follow.StrobeOffCommand( parameters ) -end - -function EMA:FollowStrobeOffCommandSnw( info, parameters ) - -end - -------------------------------------------------------------------------------------------------------------- --- Messages module sends. -------------------------------------------------------------------------------------------------------------- - - -------------------------------------------------------------------------------------------------------------- --- Popup Dialogs. -------------------------------------------------------------------------------------------------------------- - -local function InitializePopupDialogs() - StaticPopupDialogs["EMAISBoxer_CONFIRM_REMOVE_ISBoxer_ITEMS"] = { - text = L["REMOVE_ISBOXER_LIST"], - button1 = YES, - button2 = NO, - timeout = 0, - whileDead = 1, - hideOnEscape = 1, - OnAccept = function() - EMA:RemoveItem() - end, - } -end - -------------------------------------------------------------------------------------------------------------- --- Addon initialization, enabling and disabling. -------------------------------------------------------------------------------------------------------------- - --- Initialise the module. -function EMA:OnInitialize() - -- Initialise the popup dialogs. - InitializePopupDialogs() - --EMA.autoISBoxerItemLink = L["N/A"] - EMA.isboxerTeamName = L["N/A"] - -- CommandLines for this module sends. (cross "Jamba" Support) for isboxer - EMA:RegisterChatCommand("jamba-team", "ChatCommandTeam") - EMA:RegisterChatCommand("jamba-follow", "ChatCommandFollow") - EMA.autoISBoxerItemTag = EMAApi.AllTag() - -- Create the settings control. - EMA:SettingsCreate() - -- Initialse the EMAModule part of this module. - EMA:EMAModuleInitialize( EMA.settingsControl.widgetSettings.frame ) - -- Populate the settings. - EMA:SettingsRefresh() -end - --- Called when the addon is enabled. -function EMA:OnEnable() - EMA:RegisterEvent( "PLAYER_ENTERING_WORLD" ) - --EMA:RegisterMessage( EMAApi.MESSAGE_MESSAGE_AREAS_CHANGED, "OnMessageAreasChanged" ) - --EMA:RegisterMessage( EMAApi.GROUP_LIST_CHANGED , "OnGroupAreasChanged" ) -end - --- Called when the addon is disabled. -function EMA:OnDisable() - -- AceHook-3.0 will tidy up the hooks for us. -end - -function EMA:SettingsCreate() - EMA.settingsControl = {} - -- Create the settings panel. - EMAHelperSettings:CreateSettings( - EMA.settingsControl, - EMA.moduleDisplayName, - EMA.parentDisplayName, - EMA.SettingsPushSettingsClick, - EMA.moduleIcon, - EMA.moduleOrder - ) - local bottomOfInfo = EMA:SettingsCreateISBoxer( EMAHelperSettings:TopOfSettings() ) - EMA.settingsControl.widgetSettings.content:SetHeight( -bottomOfInfo ) - -- Help - local helpTable = {} - EMAHelperSettings:CreateHelp( EMA.settingsControl, helpTable, EMA:GetConfiguration() ) -end - -function EMA:SettingsPushSettingsClick( event ) - EMA:EMASendSettings() -end - -function EMA:SettingsCreateISBoxer( top ) - local buttonControlWidth = 85 - local checkBoxHeight = EMAHelperSettings:GetCheckBoxHeight() - local labelHeight = EMAHelperSettings:GetLabelHeight() - local labelContinueHeight = EMAHelperSettings:GetContinueLabelHeight() - local editBoxHeight = EMAHelperSettings:GetEditBoxHeight() - local buttonHeight = EMAHelperSettings:GetButtonHeight() - local dropdownHeight = EMAHelperSettings:GetDropdownHeight() - local left = EMAHelperSettings:LeftOfSettings() - local headingHeight = EMAHelperSettings:HeadingHeight() - local headingWidth = EMAHelperSettings:HeadingWidth( false ) - local horizontalSpacing = EMAHelperSettings:GetHorizontalSpacing() - local verticalSpacing = EMAHelperSettings:GetVerticalSpacing() - local ISBoxerWidth = headingWidth - local dropBoxWidth = (headingWidth - horizontalSpacing) / 4 - local movingTop = top - -- A blank to get layout to show right? - EMAHelperSettings:CreateHeading( EMA.settingsControl, L[""], movingTop, false ) - movingTop = movingTop - headingHeight - EMAHelperSettings:CreateHeading( EMA.settingsControl, L["ISBOXER_LIST_HEADER"], movingTop, false ) - movingTop = movingTop - headingHeight - EMA.settingsControl.ISBoxerItemsHighlightRow = 1 - EMA.settingsControl.ISBoxerItemsOffset = 1 - local list = {} - list.listFrameName = "EMAISBoxerIteamsSettingsFrame" - list.parentFrame = EMA.settingsControl.widgetSettings.content - list.listTop = movingTop - list.listLeft = left - list.listWidth = ISBoxerWidth - list.rowHeight = 20 - list.rowsToDisplay = 10 - list.columnsToDisplay = 3 - list.columnInformation = {} - list.columnInformation[1] = {} - list.columnInformation[1].width = 10 - list.columnInformation[1].alignment = "LEFT" - list.columnInformation[2] = {} - list.columnInformation[2].width = 70 - list.columnInformation[2].alignment = "LEFT" - list.columnInformation[3] = {} - list.columnInformation[3].width = 20 - list.columnInformation[3].alignment = "LEFT" - list.scrollRefreshCallback = EMA.SettingsScrollRefresh - list.rowClickCallback = EMA.SettingsISBoxerItemsRowClick - EMA.settingsControl.ISBoxerItems = list - EMAHelperSettings:CreateScrollList( EMA.settingsControl.ISBoxerItems ) - movingTop = movingTop - list.listHeight - verticalSpacing - EMAHelperSettings:CreateHeading( EMA.settingsControl, L["ISBOXER_SYNC_HEADER"], movingTop, false ) - movingTop = movingTop - headingHeight - -- Information line 1. - EMA.settingsControl.labelSyncInformation1 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["SYNCINFORMATIONONE"] - ) - movingTop = movingTop - labelContinueHeight - -- Information line 2. - EMA.settingsControl.labelSyncInformation2 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["SYNCINFORMATIONTWO"] - ) - movingTop = movingTop - labelContinueHeight - -- Information line 3. - EMA.settingsControl.labelSyncInformation3 = EMAHelperSettings:CreateContinueLabel( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["SYNCINFORMATIONTHREE"] - ) - movingTop = movingTop - labelHeight - - EMA.settingsControl.checkBoxISBoxerSnyc = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["CHECKBOX_ISBOXER_SYNC"], - EMA.SettingsToggleIsboxerSync, - L["CHECKBOX_ISBOXER_SYNC_HELP"] - ) - --[[ - movingTop = movingTop - checkBoxHeight - EMA.settingsControl.dropdownMessageArea = EMAHelperSettings:CreateDropdown( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["MESSAGE_AREA"] - ) - EMA.settingsControl.dropdownMessageArea:SetList( EMAApi.MessageAreaList() ) - EMA.settingsControl.dropdownMessageArea:SetCallback( "OnValueChanged", EMA.SettingsSetMessageArea ) - ]] - movingTop = movingTop - dropdownHeight - verticalSpacing - return movingTop -end - - -------------------------------------------------------------------------------------------------------------- --- Settings Callbacks. -------------------------------------------------------------------------------------------------------------- - -local function GetISBoxerTeamMaxPosition() - return #EMA.db.isboxerTeamList -end - -function EMA:GetISBoxerTeamAtPosition( position ) - return EMA.db.isboxerTeamList[position] -end - -local function GetCharacterNameAtOrderPosition( position ) - local characterNameAtPosition = "" - for characterPosition, characterName in pairs(EMA.db.isboxerTeamList) do - if characterPosition == position then - characterNameAtPosition = characterName - break - end - end - return characterNameAtPosition -end - -function EMA:SettingsScrollRefresh() - FauxScrollFrame_Update( - EMA.settingsControl.ISBoxerItems.listScrollFrame, - GetISBoxerTeamMaxPosition(), - EMA.settingsControl.ISBoxerItems.rowsToDisplay, - EMA.settingsControl.ISBoxerItems.rowHeight - ) - EMA.settingsControl.ISBoxerItemsOffset = FauxScrollFrame_GetOffset( EMA.settingsControl.ISBoxerItems.listScrollFrame ) - for iterateDisplayRows = 1, EMA.settingsControl.ISBoxerItems.rowsToDisplay do - -- Reset. - EMA.settingsControl.ISBoxerItems.rows[iterateDisplayRows].columns[1].textString:SetText( "" ) - EMA.settingsControl.ISBoxerItems.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 1.0, 1.0, 1.0, 1.0 ) - EMA.settingsControl.ISBoxerItems.rows[iterateDisplayRows].columns[2].textString:SetText( "" ) - EMA.settingsControl.ISBoxerItems.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 1.0, 1.0, 1.0 ) - EMA.settingsControl.ISBoxerItems.rows[iterateDisplayRows].columns[3].textString:SetText( "" ) - EMA.settingsControl.ISBoxerItems.rows[iterateDisplayRows].columns[3].textString:SetTextColor( 1.0, 1.0, 1.0, 1.0 ) - EMA.settingsControl.ISBoxerItems.rows[iterateDisplayRows].highlight:SetColorTexture( 0.0, 0.0, 0.0, 0.0 ) - -- Get data. - local dataRowNumber = iterateDisplayRows + EMA.settingsControl.ISBoxerItemsOffset - if dataRowNumber <= GetISBoxerTeamMaxPosition() then - -- Put data information into columns. - local characterName = GetCharacterNameAtOrderPosition( dataRowNumber ) - local teamName = EMA.db.isboxerTeamName - EMA.settingsControl.ISBoxerItems.rows[iterateDisplayRows].columns[1].textString:SetText( dataRowNumber ) - EMA.settingsControl.ISBoxerItems.rows[iterateDisplayRows].columns[2].textString:SetText( characterName ) - EMA.settingsControl.ISBoxerItems.rows[iterateDisplayRows].columns[3].textString:SetText( teamName ) - -- Highlight the selected row. - --if dataRowNumber == EMA.settingsControl.ISBoxerItemsHighlightRow then - -- EMA.settingsControl.ISBoxerItems.rows[iterateDisplayRows].highlight:SetColorTexture( 1.0, 1.0, 0.0, 0.5 ) - --end - end - end -end - -function EMA:SettingsISBoxerItemsRowClick( rowNumber, columnNumber ) - --[[ - if EMA.settingsControl.ISBoxerItemsOffset + rowNumber <= EMA:GetISBoxerItemsMaxPosition() then - EMA.settingsControl.ISBoxerItemsHighlightRow = EMA.settingsControl.ISBoxerItemsOffset + rowNumber - EMA:SettingsScrollRefresh() - end - ]] -end - ---[[ -function EMA:OnMessageAreasChanged( message ) - EMA.settingsControl.dropdownMessageArea:SetList( EMAApi.MessageAreaList() ) -end - -function EMA:OnGroupAreasChanged( message ) - EMA.settingsControl.ISBoxerItemsEditBoxToonTag:SetList( EMAApi.GroupList() ) -end - -function EMA:SettingsSetMessageArea( event, value ) - EMA.db.messageArea = value - EMA:SettingsRefresh() -end -]] - -function EMA:SettingsToggleIsboxerSync( event, checked ) - EMA.db.isboxerSync = checked - EMA:SettingsRefresh() -end - --- Settings received. -function EMA:EMAOnSettingsReceived( characterName, settings ) - if characterName ~= EMA.characterName then - -- Update the settings. - EMA.db.isboxerSync = settings.isboxerSync - --EMA.db.messageArea = settings.messageArea - -- Refresh the settings. - EMA:SettingsRefresh() - -- Tell the player. - EMA:Print( L["SETTINGS_RECEIVED_FROM_A"]( characterName ) ) - end -end - -function EMA:BeforeEMAProfileChanged() -end - -function EMA:OnEMAProfileChanged() - EMA:SettingsRefresh() -end - -function EMA:SettingsRefresh() - EMA.settingsControl.checkBoxISBoxerSnyc:SetValue ( EMA.db.isboxerSync ) - - --EMA.settingsControl.dropdownMessageArea:SetValue( EMA.db.messageArea ) - EMA:SettingsScrollRefresh() -end - ---Comms not sure if we going to use comms here. --- A EMA command has been received. -function EMA:EMAOnCommandReceived( characterName, commandName, ... ) - if characterName == self.characterName then - return - end -end - -------------------------------------------------------------------------------------------------------------- --- ISBoxer functionality. -------------------------------------------------------------------------------------------------------------- - -function EMA:PLAYER_ENTERING_WORLD(event, ... ) - EMA:ScheduleTimer( "IsboxerSyncTeamList", 0.5 ) - EMA:AddIsboxerMembers() -end - -function EMA:AddIsboxerMembers() - --table.wipe( EMA.db.isboxerTeamList ) - if IsAddOnLoaded("Isboxer" ) == true then - --EMA:Print("test") - --local _, teamName, members = isboxer.CharacterSet - for value, data in pairs( isboxer.CharacterSet ) do - --EMA:Print("test",value, "data", data ) - if value == "Members" then - --EMA:Print("testMembersList") - for isbSlot, characterName in pairs( data ) do - if EMA.db.isboxerTeamList[isbSlot] == nil then - EMA.db.isboxerTeamList[isbSlot] = characterName - end - end - else - --EMA:Print("testTeamListName", data ) - EMA.db.isboxerTeamName = data - end - end - end -end - -local function IsboxerTeamList() - return pairs( EMA.db.isboxerTeamList ) -end - -local function IsStillInTeam( characterName ) - local stillInTeam = false - for value, data in pairs( isboxer.CharacterSet ) do - --EMA:Print("test",value, "data", data ) - if value == "Members" then - --EMA:Print("testMembersList") - for b, isboxerCharacterName in pairs( data ) do - --EMA:Print("test", characterName, "vs", isboxerCharacterName ) - if isboxerCharacterName == characterName then - stillInTeam = true - break - end - end - end - end - return stillInTeam -end - -function EMA:IsboxerSyncTeamList() - if EMA.db.isboxerSync == true and IsAddOnLoaded("Isboxer" ) == true then - for isbSlot, isboxerCharacterName in pairs( EMA.db.isboxerTeamList ) do - --EMA:Print("test", isboxerCharacterName) - local characterName = EMAUtilities:AddRealmToNameIfMissing( isboxerCharacterName ) - if EMAApi.IsCharacterInTeam ( isboxerCharacterName ) == false and (characterName ~= EMA.characterName ) then - --EMA:Print("NOT IN TEAM", isboxerCharacterName) - EMAApi.AddMember( characterName ) - elseif IsStillInTeam( characterName ) == false and (characterName ~= EMA.characterName ) then - if EMAApi.IsCharacterInTeam ( characterName ) == true then - --EMA:Print("NoLongerInTeam", characterName, isbSlot ) - EMA.db.isboxerTeamList[isbSlot] = nil - EMAApi.RemoveMember( characterName ) - end - end - end - end - EMA:SettingsScrollRefresh() -end - -EMAApi.IsboxerTeamList = IsboxerTeamList -EMAApi.addisboxermembers = EMA.AddIsboxerMembers \ No newline at end of file diff --git a/Modules/Information-Classic.lua b/Modules/Information-Classic.lua new file mode 100644 index 0000000..da7dfcd --- /dev/null +++ b/Modules/Information-Classic.lua @@ -0,0 +1,1135 @@ +-- ================================================================================ -- +-- EMA - ( Ebony's MultiBoxing Assistant ) -- +-- Current Author: Jennifer Cally (Ebony) -- +-- -- +-- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- -- +-- Some Code Used from "Jamba" that is -- +-- Released under the MIT License -- +-- "Jamba" Copyright 2008-2015 Michael "Jafula" Miller -- +-- -- +-- ================================================================================ -- + +-- Only Load for Classic/TBC +if _G.WOW_PROJECT_ID == _G.WOW_PROJECT_MAINLINE then + return +end + +-- Create the addon using AceAddon-3.0 and embed some libraries. +local EMA = LibStub( "AceAddon-3.0" ):NewAddon( + "Information", + "Module-1.0", + "AceConsole-3.0", + "AceEvent-3.0", + "AceTimer-3.0" +) + +-- Get the EMA Utilities Library. +local EMAUtilities = LibStub:GetLibrary( "EbonyUtilities-1.0" ) +local EMAHelperSettings = LibStub:GetLibrary( "EMAHelperSettings-1.0" ) +local LibBagUtils = LibStub:GetLibrary( "LibBagUtils-1.0" ) +EMA.SharedMedia = LibStub( "LibSharedMedia-3.0" ) + +-- Constants and Locale for this module. +EMA.moduleName = "Information" +EMA.settingsDatabaseName = "InformationClassicProfileDB" +EMA.chatCommand = "ema-information" +local L = LibStub( "AceLocale-3.0" ):GetLocale( "Core" ) +EMA.parentDisplayName = L["DISPLAY"] +EMA.moduleDisplayName = L["CURRENCY"] +-- Icon +EMA.moduleIcon = "Interface\\Addons\\EMA\\Media\\SellIcon.tga" +-- order +EMA.moduleOrder = 3 + +EMA.globalCurrencyFramePrefix = "EMAToonCurrencyListFrame" +EMA.currTypes = {} +EMA.simpleCurrList = {} + +-------------------------------------- End of edit -------------------------------------------------------------- + + + +-- Settings - the values to store and their defaults for the settings database. +EMA.settings = { + profile = { + currGold = true, + bagSpace = true, + charDurr = true, + + currencyFrameAlpha = 1.0, + currencyFramePoint = "CENTER", + currencyFrameRelativePoint = "CENTER", + currencyFrameXOffset = 0, + currencyFrameYOffset = 0, + currencyFrameBackgroundColourR = 1.0, + currencyFrameBackgroundColourG = 1.0, + currencyFrameBackgroundColourB = 1.0, + currencyFrameBackgroundColourA = 1.0, + currencyFrameBorderColourR = 1.0, + currencyFrameBorderColourG = 1.0, + currencyFrameBorderColourB = 1.0, + currencyFrameBorderColourA = 1.0, + currencyBorderStyle = L["BLIZZARD_TOOLTIP"], + currencyBackgroundStyle = L["BLIZZARD_DIALOG_BACKGROUND"], + currencyFontStyle = L["ARIAL_NARROW"], + currencyFontSize = 12, + currencyScale = 1, + currencyNameWidth = 60, + currencyPointsWidth = 50, + currencyGoldWidth = 140, + currencySpacingWidth = 3, + currencyLockWindow = false, + currOpenStartUpMaster = false, + }, +} + +-- Configuration. +function EMA:GetConfiguration() + local configuration = { + name = EMA.moduleDisplayName, + handler = EMA, + type = 'group', + childGroups = "tab", + get = "EMAConfigurationGetSetting", + set = "EMAConfigurationSetSetting", + args = { + config = { + type = "input", + name = L["OPEN_CONFIG"], + desc = L["OPEN_CONFIG_HELP"], + usage = "/ema-information config", + get = false, + set = "", + }, + show = { + type = "input", + name = L["SHOW_CURRENCY"], + desc = L["SHOW_CURRENCY_HELP"], + usage = "ema-information show", + get = false, + set = "EMAToonRequestCurrency", + }, + hide = { + type = "input", + name = L["HIDE_CURRENCY"], + desc = L["HIDE_CURRENCY_HELP"], + usage = "ema-information hide", + get = false, + set = "EMAToonHideCurrency", + }, + push = { + type = "input", + name = L["PUSH_ALL_SETTINGS"], + desc = L["PUSH_SETTINGS_INFO"], + usage = "ema-information push", + get = false, + set = "EMASendSettings", + }, + }, + } + return configuration +end + +local function DebugMessage( ... ) + --EMA:Print( ... ) +end + +------------------------------------------------------------------------------------------------------------- +-- Command this module sends. +------------------------------------------------------------------------------------------------------------- + +EMA.COMMAND_REQUEST_CURRENCY = "SendCurrency" +EMA.COMMAND_HERE_IS_CURRENCY = "HereIsCurrency" + +------------------------------------------------------------------------------------------------------------- +-- Messages module sends. +------------------------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------------------------- +-- Variables used by module. +------------------------------------------------------------------------------------------------------------- + + +------------------------------------------------------------------------------------------------------------- +-- Settings Dialogs. +------------------------------------------------------------------------------------------------------------- + +local function SettingsCreate() + EMA.settingsControl = {} + -- Create the settings panel. + EMAHelperSettings:CreateSettings( + EMA.settingsControl, + EMA.moduleDisplayName, + EMA.parentDisplayName, + EMA.SettingsPushSettingsClick, + EMA.moduleIcon, + EMA.moduleOrder + ) + local bottomOfInfo = EMA:SettingsCreateCurrency( EMAHelperSettings:TopOfSettings() ) + EMA.settingsControl.widgetSettings.content:SetHeight( -bottomOfInfo ) + -- Help + local helpTable = {} + EMAHelperSettings:CreateHelp( EMA.settingsControl, helpTable, EMA:GetConfiguration() ) +end + + + + +function EMA:SettingsCreateCurrency( top ) + -- Get positions. + local checkBoxHeight = EMAHelperSettings:GetCheckBoxHeight() + local sliderHeight = EMAHelperSettings:GetSliderHeight() + local mediaHeight = EMAHelperSettings:GetMediaHeight() + local editBoxHeight = EMAHelperSettings:GetEditBoxHeight() + local buttonHeight = EMAHelperSettings:GetButtonHeight() + local dropdownHeight = EMAHelperSettings:GetDropdownHeight() + 10 + local labelHeight = EMAHelperSettings:GetLabelHeight() + local continueLabelHeight = 18 + local left = EMAHelperSettings:LeftOfSettings() + local headingHeight = EMAHelperSettings:HeadingHeight() + local headingWidth = EMAHelperSettings:HeadingWidth( true ) + local horizontalSpacing = EMAHelperSettings:GetHorizontalSpacing() + local indent = horizontalSpacing * 12 + local verticalSpacing = EMAHelperSettings:GetVerticalSpacing() + local halfWidth = (headingWidth - horizontalSpacing) / 2 + local thirdWidth = (headingWidth - (horizontalSpacing * 5)) / 5 + local halfWidthSlider = (headingWidth - horizontalSpacing) / 2 + local column2left = left + halfWidthSlider + local left2 = left + thirdWidth + local left3 = left + (thirdWidth * 1) + local right = left + halfWidth + horizontalSpacing + local movingTop = top + EMAHelperSettings:CreateHeading( EMA.settingsControl, L["CURRENCY_HEADER"], movingTop, false ) + movingTop = movingTop - headingHeight + EMA.settingsControl.checkBoxCurrencyGold = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["GOLD"], + EMA.SettingsToggleCurrencyGold, + L["GOLD_HELP"] + ) + movingTop = movingTop - checkBoxHeight + EMA.settingsControl.checkBoxCurrencyBagSpace = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["BAG_SPACE"], + EMA.SettingsToggleCurrencyBagSpace, + L["BAG_SPACE_HELP"] + ) + movingTop = movingTop - checkBoxHeight + EMA.settingsControl.checkBoxCurrencyCharDurr = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["DURR"], + EMA.SettingsToggleCurrencyCharDurr, + L["DURR_HELP"] + ) + movingTop = movingTop - checkBoxHeight + + -- Other Stuff + EMA.settingsControl.currencyButtonShowList = EMAHelperSettings:CreateButton( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["SHOW_CURRENCY"], + EMA.EMAToonRequestCurrency, + L["SHOW_CURRENCY_HELP"] + ) + movingTop = movingTop - buttonHeight + EMA.settingsControl.checkBoxCurrencyOpenStartUpMaster = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["CURR_STARTUP"], + EMA.SettingsToggleCurrencyOpenStartUpMaster, + L["CURR_STARTUP_HELP"] + ) + movingTop = movingTop - checkBoxHeight + -- Create appearance & layout. + EMAHelperSettings:CreateHeading( EMA.settingsControl, L["APPEARANCE_LAYOUT_HEALDER"], movingTop, true ) + movingTop = movingTop - headingHeight + EMA.settingsControl.checkBoxCurrencyLockWindow = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["LOCK_CURR_LIST"], + EMA.SettingsToggleCurrencyLockWindow, + L["LOCK_CURR_LIST_HELP"] + ) + movingTop = movingTop - checkBoxHeight + EMA.settingsControl.currencyScaleSlider = EMAHelperSettings:CreateSlider( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["SCALE"] + ) + EMA.settingsControl.currencyScaleSlider:SetSliderValues( 0.5, 2, 0.01 ) + EMA.settingsControl.currencyScaleSlider:SetCallback( "OnValueChanged", EMA.SettingsChangeScale ) + movingTop = movingTop - sliderHeight - verticalSpacing + EMA.settingsControl.currencyTransparencySlider = EMAHelperSettings:CreateSlider( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["TRANSPARENCY"] + ) + EMA.settingsControl.currencyTransparencySlider:SetSliderValues( 0, 1, 0.01 ) + EMA.settingsControl.currencyTransparencySlider:SetCallback( "OnValueChanged", EMA.SettingsChangeTransparency ) + movingTop = movingTop - sliderHeight - verticalSpacing + EMA.settingsControl.currencyMediaBorder = EMAHelperSettings:CreateMediaBorder( + EMA.settingsControl, + halfWidthSlider, + left, + movingTop, + L["BORDER_STYLE"] + ) + EMA.settingsControl.currencyMediaBorder:SetCallback( "OnValueChanged", EMA.SettingsChangeBorderStyle ) + + EMA.settingsControl.currencyBorderColourPicker = EMAHelperSettings:CreateColourPicker( + EMA.settingsControl, + halfWidthSlider, + column2left + 15, + movingTop - 15, + L["BORDER COLOUR"] + ) + EMA.settingsControl.currencyBorderColourPicker:SetHasAlpha( true ) + EMA.settingsControl.currencyBorderColourPicker:SetCallback( "OnValueConfirmed", EMA.SettingsBorderColourPickerChanged ) + movingTop = movingTop - mediaHeight - verticalSpacing + EMA.settingsControl.currencyMediaBackground = EMAHelperSettings:CreateMediaBackground( + EMA.settingsControl, + halfWidthSlider, + left, + movingTop, + L["BACKGROUND"] + ) + EMA.settingsControl.currencyMediaBackground:SetCallback( "OnValueChanged", EMA.SettingsChangeBackgroundStyle ) + EMA.settingsControl.currencyBackgroundColourPicker = EMAHelperSettings:CreateColourPicker( + EMA.settingsControl, + halfWidthSlider, + column2left + 15, + movingTop - 15, + L["BG_COLOUR"] + ) + EMA.settingsControl.currencyBackgroundColourPicker:SetHasAlpha( true ) + EMA.settingsControl.currencyBackgroundColourPicker:SetCallback( "OnValueConfirmed", EMA.SettingsBackgroundColourPickerChanged ) + movingTop = movingTop - mediaHeight - verticalSpacing + --Font + EMA.settingsControl.currencyMediaFont = EMAHelperSettings:CreateMediaFont( + EMA.settingsControl, + halfWidthSlider, + left, + movingTop, + L["FONT"] + ) + EMA.settingsControl.currencyMediaFont:SetCallback( "OnValueChanged", EMA.SettingsChangeFontStyle ) + EMA.settingsControl.currencyFontSize = EMAHelperSettings:CreateSlider( + EMA.settingsControl, + halfWidthSlider, + column2left, + movingTop, + L["FONT_SIZE"] + ) + EMA.settingsControl.currencyFontSize:SetSliderValues( 8, 20 , 1 ) + EMA.settingsControl.currencyFontSize:SetCallback( "OnValueChanged", EMA.SettingsChangeFontSize ) + movingTop = movingTop - mediaHeight - verticalSpacing + EMA.settingsControl.currencySliderSpaceForName = EMAHelperSettings:CreateSlider( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["SPACE_FOR_NAME"] + ) + EMA.settingsControl.currencySliderSpaceForName:SetSliderValues( 20, 200, 1 ) + EMA.settingsControl.currencySliderSpaceForName:SetCallback( "OnValueChanged", EMA.SettingsChangeSliderSpaceForName ) + movingTop = movingTop - sliderHeight - verticalSpacing + EMA.settingsControl.currencySliderSpaceForGold = EMAHelperSettings:CreateSlider( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["SPACE_FOR_GOLD"] + ) + EMA.settingsControl.currencySliderSpaceForGold:SetSliderValues( 20, 200, 1 ) + EMA.settingsControl.currencySliderSpaceForGold:SetCallback( "OnValueChanged", EMA.SettingsChangeSliderSpaceForGold ) + movingTop = movingTop - sliderHeight - verticalSpacing + EMA.settingsControl.currencySliderSpaceForPoints = EMAHelperSettings:CreateSlider( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["SPACE_FOR_POINTS"] + ) + EMA.settingsControl.currencySliderSpaceForPoints:SetSliderValues( 20, 200, 1 ) + EMA.settingsControl.currencySliderSpaceForPoints:SetCallback( "OnValueChanged", EMA.SettingsChangeSliderSpaceForPoints ) + movingTop = movingTop - sliderHeight - verticalSpacing + EMA.settingsControl.currencySliderSpaceBetweenValues = EMAHelperSettings:CreateSlider( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["SPACE_BETWEEN_VALUES"] + ) + EMA.settingsControl.currencySliderSpaceBetweenValues:SetSliderValues( 0, 20, 1 ) + EMA.settingsControl.currencySliderSpaceBetweenValues:SetCallback( "OnValueChanged", EMA.SettingsChangeSliderSpaceBetweenValues ) + movingTop = movingTop - sliderHeight - verticalSpacing + return movingTop +end + + + +------------------------------------------------------------------------------------------------------------- +-- Settings Populate. +------------------------------------------------------------------------------------------------------------- + +function EMA:BeforeEMAProfileChanged() +end + +function EMA:OnEMAProfileChanged() + EMA:SettingsRefresh() +end + +function EMA:SettingsRefresh() + EMA.settingsControl.checkBoxCurrencyGold:SetValue( EMA.db.currGold ) + EMA.settingsControl.checkBoxCurrencyBagSpace:SetValue ( EMA.db.bagSpace ) + EMA.settingsControl.checkBoxCurrencyCharDurr:SetValue ( EMA.db.charDurr ) + + --state + EMA.settingsControl.checkBoxCurrencyOpenStartUpMaster:SetValue( EMA.db.currOpenStartUpMaster ) + EMA.settingsControl.currencyTransparencySlider:SetValue( EMA.db.currencyFrameAlpha ) + EMA.settingsControl.currencyScaleSlider:SetValue( EMA.db.currencyScale ) + EMA.settingsControl.currencyMediaBorder:SetValue( EMA.db.currencyBorderStyle ) + EMA.settingsControl.currencyMediaBackground:SetValue( EMA.db.currencyBackgroundStyle ) + EMA.settingsControl.currencyBackgroundColourPicker:SetColor( EMA.db.currencyFrameBackgroundColourR, EMA.db.currencyFrameBackgroundColourG, EMA.db.currencyFrameBackgroundColourB, EMA.db.currencyFrameBackgroundColourA ) + EMA.settingsControl.currencyBorderColourPicker:SetColor( EMA.db.currencyFrameBorderColourR, EMA.db.currencyFrameBorderColourG, EMA.db.currencyFrameBorderColourB, EMA.db.currencyFrameBorderColourA ) + EMA.settingsControl.currencyMediaFont:SetValue( EMA.db.currencyFontStyle ) + EMA.settingsControl.currencyFontSize:SetValue( EMA.db.currencyFontSize ) + EMA.settingsControl.currencySliderSpaceForName:SetValue( EMA.db.currencyNameWidth ) + EMA.settingsControl.currencySliderSpaceForGold:SetValue( EMA.db.currencyGoldWidth ) + EMA.settingsControl.currencySliderSpaceForPoints:SetValue( EMA.db.currencyPointsWidth ) + EMA.settingsControl.currencySliderSpaceBetweenValues:SetValue( EMA.db.currencySpacingWidth ) + EMA.settingsControl.checkBoxCurrencyLockWindow:SetValue( EMA.db.currencyLockWindow ) + if EMA.currencyListFrameCreated == true then + EMA:CurrencyListSetColumnWidth() + EMA:SettingsUpdateBorderStyle() + EMA:SettingsUpdateFontStyle() + EMA:CurrencyUpdateWindowLock() + EMAToonCurrencyListFrame:SetScale( EMA.db.currencyScale ) +---???? EMA:UpdateHendingText() + EMA:CurrencyListSetHeight() + end +end + +function EMA:SettingsPushSettingsClick( event ) + EMA:EMASendSettings() +end + +function EMA:SettingsToggleCurrencyGold( event, checked ) + EMA.db.currGold = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleCurrencyBagSpace( event, checked ) + EMA.db.bagSpace = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleCurrencyCharDurr( event, checked ) + EMA.db.charDurr = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleCurrencyOpenStartUpMaster( event, checked ) + EMA.db.currOpenStartUpMaster = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeScale( event, value ) + EMA.db.currencyScale = tonumber( value ) + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeTransparency( event, value ) + EMA.db.currencyFrameAlpha = tonumber( value ) + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeBorderStyle( event, value ) + EMA.db.currencyBorderStyle = value + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeBackgroundStyle( event, value ) + EMA.db.currencyBackgroundStyle = value + EMA:SettingsRefresh() +end + +function EMA:SettingsBackgroundColourPickerChanged( event, r, g, b, a ) + EMA.db.currencyFrameBackgroundColourR = r + EMA.db.currencyFrameBackgroundColourG = g + EMA.db.currencyFrameBackgroundColourB = b + EMA.db.currencyFrameBackgroundColourA = a + EMA:SettingsRefresh() +end + +function EMA:SettingsBorderColourPickerChanged( event, r, g, b, a ) + EMA.db.currencyFrameBorderColourR = r + EMA.db.currencyFrameBorderColourG = g + EMA.db.currencyFrameBorderColourB = b + EMA.db.currencyFrameBorderColourA = a + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeFontStyle( event, value ) + EMA.db.currencyFontStyle = value + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeFontSize( event, value ) + EMA.db.currencyFontSize = value + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeSliderSpaceForName( event, value ) + EMA.db.currencyNameWidth = tonumber( value ) + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeSliderSpaceForGold( event, value ) + EMA.db.currencyGoldWidth = tonumber( value ) + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeSliderSpaceForPoints( event, value ) + EMA.db.currencyPointsWidth = tonumber( value ) + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeSliderSpaceBetweenValues( event, value ) + EMA.db.currencySpacingWidth = tonumber( value ) + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleCurrencyLockWindow( event, checked ) + EMA.db.currencyLockWindow = checked + EMA:CurrencyUpdateWindowLock() + EMA:SettingsRefresh() +end + +------------------------------------------------------------------------------------------------------------- +-- Addon initialization, enabling and disabling. +------------------------------------------------------------------------------------------------------------- + +-- Initialise the module. +function EMA:OnInitialize() + EMA.currencyTotalGold = 0 + EMA.currencyListFrameCreated = false + EMA.currencyFrameCharacterInfo = {} + EMA.currentCurrencyValues = {} + -- Create the settings control. + SettingsCreate() + -- Initialise the EMAModule part of this module. + EMA:EMAModuleInitialize( EMA.settingsControl.widgetSettings.frame ) + -- Populate the settings. + EMA:SettingsRefresh() + -- Create the currency list frame. + EMA:CreateEMAToonCurrencyListFrame() +end + +-- Called when the addon is enabled. +function EMA:OnEnable() + -- WoW events. + --EMA:RegisterMessage( EMAApi.MESSAGE_MESSAGE_AREAS_CHANGED, "OnMessageAreasChanged" ) + if EMA.db.currOpenStartUpMaster == true then + if EMAApi.IsCharacterTheMaster( self.characterName ) == true then + EMA:ScheduleTimer( "EMAToonRequestCurrency", 5 ) + end + end +end + +-- Called when the addon is disabled. +function EMA:OnDisable() +end + +-- Settings received. +function EMA:EMAOnSettingsReceived( characterName, settings ) + if characterName ~= EMA.characterName then + -- Update the settings. + EMA.db.currGold = settings.currGold + EMA.db.bagSpace = settings.bagSpace + EMA.db.charDurr = settings.charDurr + + EMA.db.currOpenStartUpMaster = settings.currOpenStartUpMaster + EMA.db.currencyScale = settings.currencyScale + EMA.db.currencyFrameAlpha = settings.currencyFrameAlpha + EMA.db.currencyFramePoint = settings.currencyFramePoint + EMA.db.currencyFrameRelativePoint = settings.currencyFrameRelativePoint + EMA.db.currencyFrameXOffset = settings.currencyFrameXOffset + EMA.db.currencyFrameYOffset = settings.currencyFrameYOffset + EMA.db.currencyFrameBackgroundColourR = settings.currencyFrameBackgroundColourR + EMA.db.currencyFrameBackgroundColourG = settings.currencyFrameBackgroundColourG + EMA.db.currencyFrameBackgroundColourB = settings.currencyFrameBackgroundColourB + EMA.db.currencyFrameBackgroundColourA = settings.currencyFrameBackgroundColourA + EMA.db.currencyFrameBorderColourR = settings.currencyFrameBorderColourR + EMA.db.currencyFrameBorderColourG = settings.currencyFrameBorderColourG + EMA.db.currencyFrameBorderColourB = settings.currencyFrameBorderColourB + EMA.db.currencyFrameBorderColourA = settings.currencyFrameBorderColourA + EMA.db.currencyBorderStyle = settings.currencyBorderStyle + EMA.db.currencyBackgroundStyle = settings.currencyBackgroundStyle + EMA.db.currencyFontSize = settings.currencyFontSize + EMA.db.currencyFontStyle = settings.currencyFontStyle + EMA.db.currencyNameWidth = settings.currencyNameWidth + EMA.db.currencyPointsWidth = settings.currencyPointsWidth + EMA.db.currencyGoldWidth = settings.currencyGoldWidth + EMA.db.currencySpacingWidth = settings.currencySpacingWidth + EMA.db.currencyLockWindow = settings.currencyLockWindow + -- Refresh the settings. + EMA:SettingsRefresh() + -- Tell the player. + EMA:Print( L["SETTINGS_RECEIVED_FROM_A"]( characterName ) ) + end +end + +function EMA:CreateEMAToonCurrencyListFrame() + -- The frame. + local frame = CreateFrame( "Frame", "EMAToonCurrencyListWindowFrame", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil ) + frame.obj = EMA + frame:SetFrameStrata( "LOW" ) + frame:SetToplevel( false ) + frame:SetClampedToScreen( true ) + frame:EnableMouse( true ) + frame:SetMovable( true ) + frame:RegisterForDrag( "LeftButton" ) + frame:SetScript( "OnDragStart", + function( this ) + if IsAltKeyDown() then + this:StartMoving() + end + end ) + frame:SetScript( "OnDragStop", + function( this ) + this:StopMovingOrSizing() + local point, relativeTo, relativePoint, xOffset, yOffset = this:GetPoint() + EMA.db.currencyFramePoint = point + EMA.db.currencyFrameRelativePoint = relativePoint + EMA.db.currencyFrameXOffset = xOffset + EMA.db.currencyFrameYOffset = yOffset + end ) + frame:SetWidth( 500 ) + frame:SetHeight( 200 ) + frame:ClearAllPoints() + frame:SetPoint( EMA.db.currencyFramePoint, UIParent, EMA.db.currencyFrameRelativePoint, EMA.db.currencyFrameXOffset, EMA.db.currencyFrameYOffset ) + frame:SetBackdrop( { + bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", + edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, tileSize = 10, edgeSize = 10, + insets = { left = 3, right = 3, top = 3, bottom = 3 } + } ) + + -- Create the title for the frame. + local titleName = frame:CreateFontString( "EMAToonCurrencyListWindowFrameTitleText", "OVERLAY", "GameFontNormal" ) + titleName:SetPoint( "TOPLEFT", frame, "TOPLEFT", 3, -8 ) + titleName:SetTextColor( NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1.0 ) + titleName:SetText( L["CURRENCY"] ) + titleName:SetWidth( 200 ) + titleName:SetJustifyH( "LEFT" ) + titleName:SetWordWrap( false ) + frame.titleName = titleName + + -- Create the headings. + local left = 10 + local spacing = 50 + local width = 50 + local top = -30 + local parentFrame = frame + local r = 1.0 + local g = 0.96 + local b = 0.41 + local a = 1.0 + -- Set the characters name font string. + local frameCharacterName = EMA.globalCurrencyFramePrefix.."TitleCharacterName" + local frameCharacterNameText = parentFrame:CreateFontString( frameCharacterName.."Text", "OVERLAY", "GameFontNormal" ) + frameCharacterNameText:SetText( L["NAME"] ) + frameCharacterNameText:SetTextColor( r, g, b, a ) + frameCharacterNameText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameCharacterNameText:SetWidth( width * 2.5 ) + frameCharacterNameText:SetJustifyH( "LEFT" ) + frame.characterNameText = frameCharacterNameText + left = left + (spacing * 2) + -- Set the Gold font string. + local frameGold = EMA.globalCurrencyFramePrefix.."TitleGold" + local frameGoldText = parentFrame:CreateFontString( frameGold.."Text", "OVERLAY", "GameFontNormal" ) + frameGoldText:SetText( L["GOLD"] ) + frameGoldText:SetTextColor( r, g, b, a ) + frameGoldText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameGoldText:SetWidth( width ) + frameGoldText:SetJustifyH( "CENTER" ) + frame.GoldText = frameGoldText + left = left + spacing + -- Set the BagSpace font string. + local frameBagSpace = EMA.globalCurrencyFramePrefix.."TitleBagSpace" + local frameBagSpaceText = parentFrame:CreateFontString( frameBagSpace.."Text", "OVERLAY", "GameFontNormal" ) + frameBagSpaceText:SetText( L["BAG_SPACE"] ) + frameBagSpaceText:SetTextColor( r, g, b, a ) + frameBagSpaceText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameBagSpaceText:SetWidth( width ) + frameBagSpaceText:SetJustifyH( "CENTER" ) + frame.BagSpaceText = frameBagSpaceText + left = left + spacing + -- Set the CharDurr font string. + local frameCharDurr = EMA.globalCurrencyFramePrefix.."TitleBagSpace" + local frameCharDurrText = parentFrame:CreateFontString( frameCharDurr.."Text", "OVERLAY", "GameFontNormal" ) + frameCharDurrText:SetText( L["DURR"] ) + frameCharDurrText:SetTextColor( r, g, b, a ) + frameCharDurrText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameCharDurrText:SetWidth( width ) + frameCharDurrText:SetJustifyH( "CENTER" ) + frame.CharDurrText = frameCharDurrText + left = left + spacing + + -- Set the Total Gold font string. + left = 10 + top = -50 + local frameTotalGoldTitle = EMA.globalCurrencyFramePrefix.."TitleTotalGold" + local frameTotalGoldTitleText = parentFrame:CreateFontString( frameTotalGoldTitle.."Text", "OVERLAY", "GameFontNormal" ) + frameTotalGoldTitleText:SetText( L["TOTAL"] ) + frameTotalGoldTitleText:SetTextColor( r, g, b, a ) + frameTotalGoldTitleText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameTotalGoldTitleText:SetWidth( width ) + frameTotalGoldTitleText:SetJustifyH( "LEFT" ) + frame.TotalGoldTitleText = frameTotalGoldTitleText + + local frameTotalGold = EMA.globalCurrencyFramePrefix.."TotalGold" + local frameTotalGoldText = parentFrame:CreateFontString( frameTotalGold.."Text", "OVERLAY", "GameFontNormal" ) + frameTotalGoldText:SetText( "0" ) + frameTotalGoldText:SetTextColor( r, g, b, a ) + frameTotalGoldText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameTotalGoldText:SetWidth( width ) + frameTotalGoldText:SetJustifyH( "RIGHT" ) + frame.TotalGoldText = frameTotalGoldText + + -- Set frame width. + frame:SetWidth( left + 10 ) + + -- Set transparency of the the frame (and all its children). + frame:SetAlpha( EMA.db.currencyFrameAlpha ) + + -- Set scale. + frame:SetScale( EMA.db.currencyScale ) + + -- Set the global frame reference for this frame. + EMAToonCurrencyListFrame = frame + + -- Close. + local closeButton = CreateFrame( "Button", EMA.globalCurrencyFramePrefix.."ButtonClose", frame, "UIPanelCloseButton" ) + closeButton:SetScript( "OnClick", function() EMAToonCurrencyListFrame:Hide() end ) + closeButton:SetPoint( "TOPRIGHT", frame, "TOPRIGHT", 0, 0 ) + frame.closeButton = closeButton + + -- Update. + local updateButton = CreateFrame( "Button", EMA.globalCurrencyFramePrefix.."ButtonUpdate", frame, "UIPanelButtonTemplate" ) + updateButton:SetScript( "OnClick", function() EMA:EMAToonRequestCurrency() end ) + updateButton:SetPoint( "TOPRIGHT", frame, "TOPRIGHT", -30, -4 ) + updateButton:SetHeight( 22 ) + updateButton:SetWidth( 55 ) + updateButton:SetText( L["UPDATE"] ) + + frame.updateButton = updateButton + + EMA:SettingsUpdateBorderStyle() + EMA:CurrencyUpdateWindowLock() + EMA:SettingsUpdateFontStyle() + EMAToonCurrencyListFrame:Hide() + EMA.currencyListFrameCreated = true + + EMA:CurrencyListSetHeight() +end + +function EMA:CurrencyUpdateWindowLock() + if EMA.db.currencyLockWindow == false then + EMAToonCurrencyListFrame:EnableMouse( true ) + else + EMAToonCurrencyListFrame:EnableMouse( false ) + end +end + +function EMA:SettingsUpdateBorderStyle() + local borderStyle = EMA.SharedMedia:Fetch( "border", EMA.db.currencyBorderStyle ) + local backgroundStyle = EMA.SharedMedia:Fetch( "background", EMA.db.currencyBackgroundStyle ) + local frame = EMAToonCurrencyListFrame + frame:SetBackdrop( { + bgFile = backgroundStyle, + edgeFile = borderStyle, + tile = true, tileSize = frame:GetWidth(), edgeSize = 10, + insets = { left = 3, right = 3, top = 3, bottom = 3 } + } ) + frame:SetBackdropColor( EMA.db.currencyFrameBackgroundColourR, EMA.db.currencyFrameBackgroundColourG, EMA.db.currencyFrameBackgroundColourB, EMA.db.currencyFrameBackgroundColourA ) + frame:SetBackdropBorderColor( EMA.db.currencyFrameBorderColourR, EMA.db.currencyFrameBorderColourG, EMA.db.currencyFrameBorderColourB, EMA.db.currencyFrameBorderColourA ) + frame:ClearAllPoints() + frame:SetAlpha( EMA.db.currencyFrameAlpha ) + frame:SetPoint( EMA.db.currencyFramePoint, UIParent, EMA.db.currencyFrameRelativePoint, EMA.db.currencyFrameXOffset, EMA.db.currencyFrameYOffset ) +end + +function EMA:SettingsUpdateFontStyle() + local textFont = EMA.SharedMedia:Fetch( "font", EMA.db.currencyFontStyle ) + local textSize = EMA.db.currencyFontSize + local frame = EMAToonCurrencyListFrame + frame.titleName:SetFont( textFont , textSize , "OUTLINE") + frame.characterNameText:SetFont( textFont , textSize , "OUTLINE") + frame.GoldText:SetFont( textFont , textSize , "OUTLINE") + frame.BagSpaceText:SetFont( textFont , textSize , "OUTLINE") + frame.CharDurrText:SetFont( textFont , textSize , "OUTLINE") + for characterName, currencyFrameCharacterInfo in pairs( EMA.currencyFrameCharacterInfo ) do + --EMA:Print("test", characterName) + currencyFrameCharacterInfo.characterNameText:SetFont( textFont , textSize , "OUTLINE") + currencyFrameCharacterInfo.GoldText:SetFont( textFont , textSize , "OUTLINE") + currencyFrameCharacterInfo.BagSpaceText:SetFont( textFont , textSize , "OUTLINE") + currencyFrameCharacterInfo.CharDurrText:SetFont( textFont , textSize , "OUTLINE") + end +end + + +function EMA:CurrencyListSetHeight() + local additionalLines = 0 + local addHeight = 0 + if EMA.db.currGold == true then + additionalLines = 1 + addHeight = 5 + end + EMAToonCurrencyListFrame:SetHeight( 56 + (( EMAApi.GetTeamListMaximumOrderOnline() + additionalLines) * 15) + addHeight ) +end + +function EMA:CurrencyListSetColumnWidth() + local nameWidth = EMA.db.currencyNameWidth + local pointsWidth = EMA.db.currencyPointsWidth + local goldWidth = EMA.db.currencyGoldWidth + local spacingWidth = EMA.db.currencySpacingWidth + local frameHorizontalSpacing = 10 + local numberOfPointsColumns = 0 + local parentFrame = EMAToonCurrencyListFrame + local headingRowTopPoint = -30 + local left = frameHorizontalSpacing + local haveGold = 0 + -- Heading rows. + parentFrame.characterNameText:SetWidth( nameWidth ) + parentFrame.characterNameText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) + left = left + nameWidth + spacingWidth + if EMA.db.currGold == true then + parentFrame.GoldText:SetWidth( goldWidth ) + parentFrame.GoldText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) + left = left + goldWidth + (spacingWidth * 3) + parentFrame.GoldText:Show() + haveGold = 1 + else + parentFrame.GoldText:Hide() + haveGold = 0 + end + if EMA.db.bagSpace == true then + parentFrame.BagSpaceText:SetWidth( pointsWidth ) + parentFrame.BagSpaceText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) + left = left + pointsWidth + spacingWidth + numberOfPointsColumns = numberOfPointsColumns + 1 + parentFrame.BagSpaceText:Show() + else + parentFrame.BagSpaceText:Hide() + end + if EMA.db.charDurr == true then + parentFrame.CharDurrText:SetWidth( pointsWidth ) + parentFrame.CharDurrText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) + left = left + pointsWidth + spacingWidth + numberOfPointsColumns = numberOfPointsColumns + 1 + parentFrame.CharDurrText:Show() + else + parentFrame.CharDurrText:Hide() + end + -- Character rows. + for characterName, currencyFrameCharacterInfo in pairs( EMA.currencyFrameCharacterInfo ) do + if EMAPrivate.Team.GetCharacterOnlineStatus (characterName) == true then + local left = frameHorizontalSpacing + local characterRowTopPoint = currencyFrameCharacterInfo.characterRowTopPoint + currencyFrameCharacterInfo.characterNameText:SetWidth( nameWidth ) + currencyFrameCharacterInfo.characterNameText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) + left = left + nameWidth + spacingWidth + if EMA.db.currGold == true then + currencyFrameCharacterInfo.GoldText:SetWidth( goldWidth ) + currencyFrameCharacterInfo.GoldText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) + left = left + goldWidth + (spacingWidth * 3) + currencyFrameCharacterInfo.GoldText:Show() + else + currencyFrameCharacterInfo.GoldText:Hide() + end + if EMA.db.bagSpace == true then + currencyFrameCharacterInfo.BagSpaceText:SetWidth( pointsWidth ) + currencyFrameCharacterInfo.BagSpaceText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) + left = left + pointsWidth + spacingWidth + currencyFrameCharacterInfo.BagSpaceText:Show() + else + currencyFrameCharacterInfo.BagSpaceText:Hide() + end + if EMA.db.charDurr == true then + currencyFrameCharacterInfo.CharDurrText:SetWidth( pointsWidth ) + currencyFrameCharacterInfo.CharDurrText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) + left = left + pointsWidth + spacingWidth + currencyFrameCharacterInfo.CharDurrText:Show() + else + currencyFrameCharacterInfo.CharDurrText:Hide() + end + end + end + -- Parent frame width and title. + local finalParentWidth = frameHorizontalSpacing + nameWidth + spacingWidth + (haveGold * (goldWidth + (spacingWidth * 3))) + (numberOfPointsColumns * (pointsWidth + spacingWidth)) + frameHorizontalSpacing + if finalParentWidth < 95 then + finalParentWidth = 95 + end + local widthOfCloseAndUpdateButtons = 70 + parentFrame.titleName:SetWidth( finalParentWidth - widthOfCloseAndUpdateButtons - frameHorizontalSpacing - frameHorizontalSpacing ) + parentFrame.titleName:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", frameHorizontalSpacing, -9 ) + if EMA.db.currGold == true then + if numberOfPointsColumns > 1 then + parentFrame.titleName:SetText( L["EMA_CURRENCY"] ) + else + parentFrame.titleName:SetText( L["CURRENCY"] ) + end + else + if numberOfPointsColumns < 2 then + parentFrame.titleName:SetText( "" ) + end + if numberOfPointsColumns == 2 then + parentFrame.titleName:SetText( L["CURR"] ) + end + if (numberOfPointsColumns >= 3) and (numberOfPointsColumns <= 4) then + parentFrame.titleName:SetText( L["CURRENCY"] ) + end + if numberOfPointsColumns > 4 then + parentFrame.titleName:SetText( L["EMA_CURRENCY"] ) + end + end + parentFrame:SetWidth( finalParentWidth ) + -- Total Gold. + local nameLeft = frameHorizontalSpacing + local goldLeft = frameHorizontalSpacing + nameWidth + spacingWidth + local guildTop = -35 - ((EMAApi.GetTeamListMaximumOrderOnline() + 1) * 15) - 5 + local goldTop = -35 - ((EMAApi.GetTeamListMaximumOrderOnline() + 1) * 15) - 7 + if EMA.db.currGold == true then + parentFrame.TotalGoldTitleText:SetWidth( nameWidth ) + parentFrame.TotalGoldTitleText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", nameLeft, goldTop ) + parentFrame.TotalGoldTitleText:Show() + parentFrame.TotalGoldText:SetWidth( goldWidth ) + parentFrame.TotalGoldText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", goldLeft, goldTop ) + parentFrame.TotalGoldText:Show() + else + parentFrame.TotalGoldTitleText:Hide() + parentFrame.TotalGoldText:Hide() + end +end + + + + +function EMA:CreateEMACurrencyFrameInfo( characterName, parentFrame ) + --EMA.Print("makelist", characterName) + --if EMAPrivate.Team.GetCharacterOnlineStatus (characterName) == true then + local left = 10 + local spacing = 50 + local width = 50 + local top = 0 + --local top = -35 + (-15 * EMAApi.GetPositionForCharacterName( characterName )) + -- WHAT THE HELL IS GOING ON HERE! Ebony! + local height1 = -35 + ( -15 * EMAApi.GetPositionForCharacterName( characterName) ) + local height2 = -35 + ( -15 * EMAApi.GetPositionForCharacterNameOnline( characterName) ) + if height1 < height2 then + --EMA:Print("greater than ", characterName ) + top = height2 + elseif height1 > height2 then + top = height2 + else + top = height2 + end + --EMA:Print("Top", top) + -- Create the table to hold the status bars for this character. + EMA.currencyFrameCharacterInfo[characterName] = {} + -- Get the character info table. + local currencyFrameCharacterInfo = EMA.currencyFrameCharacterInfo[characterName] + currencyFrameCharacterInfo.characterRowTopPoint = top + -- Set the characters name font string. + local frameCharacterName = EMA.globalCurrencyFramePrefix.."CharacterName" + local frameCharacterNameText = parentFrame:CreateFontString( frameCharacterName.."Text", "OVERLAY", "GameFontNormal" ) + frameCharacterNameText:SetText( Ambiguate( characterName , "none" ) ) + frameCharacterNameText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + frameCharacterNameText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameCharacterNameText:SetWidth( width * 2.5 ) + frameCharacterNameText:SetJustifyH( "LEFT" ) + currencyFrameCharacterInfo.characterNameText = frameCharacterNameText + left = left + (spacing * 2) + -- Set the Gold font string. + local frameGold = EMA.globalCurrencyFramePrefix.."Gold" + local frameGoldText = parentFrame:CreateFontString( frameGold.."Text", "OVERLAY", "GameFontNormal" ) + frameGoldText:SetText( "0" ) + frameGoldText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + frameGoldText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameGoldText:SetWidth( width ) + frameGoldText:SetJustifyH( "RIGHT" ) + currencyFrameCharacterInfo.GoldText = frameGoldText + left = left + spacing + -- Set the BagSpace font string. + local frameBagSpace = EMA.globalCurrencyFramePrefix.."BagSpace" + local frameBagSpaceText = parentFrame:CreateFontString( frameBagSpace.."Text", "OVERLAY", "GameFontNormal" ) + frameBagSpaceText:SetText( "0/0" ) + frameBagSpaceText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + frameBagSpaceText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameBagSpaceText:SetWidth( width ) + frameBagSpaceText:SetJustifyH( "RIGHT" ) + currencyFrameCharacterInfo.BagSpaceText = frameBagSpaceText + left = left + spacing + -- Set the Durability font string. + local frameCharDurr = EMA.globalCurrencyFramePrefix.."CharDurr" + local frameCharDurrText = parentFrame:CreateFontString( frameCharDurr.."Text", "OVERLAY", "GameFontNormal" ) + frameCharDurrText:SetText( "0"..L["%"] ) + frameCharDurrText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) + frameCharDurrText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) + frameCharDurrText:SetWidth( width ) + frameCharDurrText:SetJustifyH( "RIGHT" ) + currencyFrameCharacterInfo.CharDurrText = frameCharDurrText + left = left + spacing + + EMA:SettingsUpdateFontStyle() +end + +function EMA:EMAToonHideCurrency() + EMAToonCurrencyListFrame:Hide() +end + +function EMA:EMAToonRequestCurrency() + -- Colour Light Red. + local r = 1.0 + local g = 0.42 + local b = 0.42 + local a = 0.6 + for characterName, currencyFrameCharacterInfo in pairs( EMA.currencyFrameCharacterInfo ) do + --EMA.Print("DoRequestCurrency", characterName) + -- Change Hight if a new member joins the team or leaves the team. + local height1 = currencyFrameCharacterInfo.characterRowTopPoint + local height2 = -35 + ( -15 * EMAApi.GetPositionForCharacterNameOnline( characterName) ) + if height1 < height2 then + currencyFrameCharacterInfo.characterRowTopPoint = height2 + elseif height1 > height2 then + currencyFrameCharacterInfo.characterRowTopPoint = height2 + end + if EMAApi.GetCharacterOnlineStatus ( characterName ) == false then + -- Hides currency for offline members. + --EMA.Print("offlineRemove", characterName ) + currencyFrameCharacterInfo.characterNameText:Hide() + currencyFrameCharacterInfo.GoldText:Hide() + currencyFrameCharacterInfo.BagSpaceText:Hide() + currencyFrameCharacterInfo.CharDurrText:Hide() + else + currencyFrameCharacterInfo.characterNameText:Show() + currencyFrameCharacterInfo.characterNameText:SetTextColor( r, g, b, a ) + currencyFrameCharacterInfo.GoldText:SetTextColor( r, g, b, a ) + currencyFrameCharacterInfo.BagSpaceText:SetTextColor( r, g, b, a ) + currencyFrameCharacterInfo.CharDurrText:SetTextColor( r, g, b, a ) + end + end + EMA.currencyTotalGold = 0 + EMA:EMASendCommandToTeam( EMA.COMMAND_REQUEST_CURRENCY, "" ) + EMA.SettingsRefresh() + +end + +function EMA:DoSendCurrency( characterName, dummyValue ) + --EMA:Print("Test2") + if EMAApi.GetCharacterOnlineStatus ( characterName ) == true then + table.wipe( EMA.currentCurrencyValues ) + EMA.currentCurrencyValues.currGold = GetMoney() + -- BagSpace Maths + local numFreeSlots, numTotalSlots = LibBagUtils:CountSlots("BAGS", 0) + EMA.currentCurrencyValues.bagSpace = numFreeSlots + EMA.currentCurrencyValues.bagSpaceMax = numTotalSlots + -- Durability Maths + local curTotal, maxTotal, broken = 0, 0, 0 + for i = 1, 18 do + local curItemDurability, maxItemDurability = GetInventoryItemDurability(i) + if curItemDurability and maxItemDurability then + curTotal = curTotal + curItemDurability + maxTotal = maxTotal + maxItemDurability + if maxItemDurability > 0 and curItemDurability == 0 then + broken = broken + 1 + end + end + end + local durability = (curTotal / maxTotal) * 100 + local durabilityText = tostring(gsub( durability, "%.[^|]+", "") ) + EMA.currentCurrencyValues.durability = durabilityText + + EMA:EMASendCommandToToon( characterName, EMA.COMMAND_HERE_IS_CURRENCY, EMA.currentCurrencyValues ) + else + return + end +end + +function EMA:DoShowToonsCurrency( characterName, currencyValues ) + --EMA.Print("DoShowCurrency", characterName, EMA.currentCurrencyValues.currGold ) + local parentFrame = EMAToonCurrencyListFrame + -- Get (or create and get) the character information. + local currencyFrameCharacterInfo = EMA.currencyFrameCharacterInfo[characterName] + --EMA.Print("Frame", characterName) + if currencyFrameCharacterInfo == nil then + EMA:CreateEMACurrencyFrameInfo( characterName, parentFrame ) + currencyFrameCharacterInfo = EMA.currencyFrameCharacterInfo[characterName] + end + -- Colour white. + local r = 1.0 + local g = 1.0 + local b = 1.0 + local a = 1.0 + local v = 0 + + currencyFrameCharacterInfo.GoldText:SetTextColor( r, g, b, a ) + currencyFrameCharacterInfo.characterNameText:SetTextColor( r, g, b, a ) + currencyFrameCharacterInfo.GoldText:SetTextColor( r, g, b, a ) + + if currencyValues.bagSpace == 0 then + --EMA:Print("SetRed") + currencyFrameCharacterInfo.BagSpaceText:SetTextColor( r, v, v, a ) + else + --EMA:Print("SetWhite") + currencyFrameCharacterInfo.BagSpaceText:SetTextColor( r, g, b, a ) + end + if currencyValues.durability == "0" then + currencyFrameCharacterInfo.CharDurrText:SetTextColor( r, v, v, a ) + else + --EMA:Print("SetWhite") + currencyFrameCharacterInfo.CharDurrText:SetTextColor( r, g, b, a ) + end + + currencyFrameCharacterInfo.GoldText:SetText( EMAUtilities:FormatMoneyString( currencyValues.currGold ) ) + currencyFrameCharacterInfo.BagSpaceText:SetText( currencyValues.bagSpace..L["/"]..currencyValues.bagSpaceMax ) + currencyFrameCharacterInfo.CharDurrText:SetText ( currencyValues.durability..L["%"] ) + + -- Total gold. + EMA.currencyTotalGold = EMA.currencyTotalGold + currencyValues.currGold + parentFrame.TotalGoldText:SetText( EMAUtilities:FormatMoneyString( EMA.currencyTotalGold ) ) + -- Update width of currency list. + EMA:CurrencyListSetColumnWidth() + EMAToonCurrencyListFrame:Show() +end + +-- A EMA command has been received. +function EMA:EMAOnCommandReceived( characterName, commandName, ... ) + if commandName == EMA.COMMAND_REQUEST_CURRENCY then + EMA:DoSendCurrency( characterName, ... ) + end + if commandName == EMA.COMMAND_HERE_IS_CURRENCY then + EMA:DoShowToonsCurrency( characterName, ... ) + end +end diff --git a/Modules/Information.lua b/Modules/Information.lua index ed219af..bf91b1a 100644 --- a/Modules/Information.lua +++ b/Modules/Information.lua @@ -10,6 +10,11 @@ -- -- -- ================================================================================ -- +-- Only Load for Live +if _G.WOW_PROJECT_ID ~= _G.WOW_PROJECT_MAINLINE then + return +end + -- Create the addon using AceAddon-3.0 and embed some libraries. local EMA = LibStub( "AceAddon-3.0" ):NewAddon( "Information", @@ -137,8 +142,8 @@ end function EMA:CurrencyIconAndName( id ) local info = C_CurrencyInfo.GetCurrencyInfo(id) - --EMA:Print("test", info.name, info.iconFileID, info.description ) - if info.iconFileID ~= nil then + if info ~= nil and info.iconFileID ~= nil then + --EMA:Print("test", info.name, info.iconFileID ) local currName = strconcat(" |T"..info.iconFileID..":20|t", L[" "]..info.name) return currName end diff --git a/Modules/Interaction.lua b/Modules/Interaction.lua index 29315c6..05cd23b 100644 --- a/Modules/Interaction.lua +++ b/Modules/Interaction.lua @@ -11,10 +11,10 @@ -- ================================================================================ -- -- Create the addon using AceAddon-3.0 and embed some libraries. -local EMA = LibStub( "AceAddon-3.0" ):NewAddon( - "Interaction", - "Module-1.0", - "AceConsole-3.0", +local EMA = LibStub( "AceAddon-3.0" ):NewAddon( + "Interaction", + "Module-1.0", + "AceConsole-3.0", "AceEvent-3.0", "AceHook-3.0", "AceTimer-3.0" @@ -32,13 +32,36 @@ EMA.chatCommand = "ema-Interaction" local L = LibStub( "AceLocale-3.0" ):GetLocale( "Core" ) EMA.parentDisplayName = L["INTERACTION"] EMA.moduleDisplayName = L["INTERACTION"] --- Icon +-- Icon EMA.moduleIcon = "Interface\\Addons\\EMA\\Media\\InteractionIcon.tga" -- order EMA.moduleOrder = 60 +-- EMA key bindings. +--if EMAPrivate.Core.isEmaClassicBccBuild() == false then + BINDING_HEADER_MOUNT = L["MOUNT"] + BINDING_NAME_TEAMMOUNT = L["MOUNT_WITH_TEAM"] +--end + -- Settings - the values to store and their defaults for the settings database. EMA.settings = { + global = { + takeMastersTaxi = true, + requestTaxiStop = true, + changeTexiTime = 2, + --Mount + mountWithTeam = false, + dismountWithTeam = false, + dismountWithMaster = false, + mountInRange = false, + --Loot + autoLoot = false, + tellBoERare = false, + tellBoEEpic = false, + tellBoEMount = false, + messageArea = EMAApi.DefaultMessageArea(), + warningArea = EMAApi.DefaultWarningArea() + }, profile = { takeMastersTaxi = true, requestTaxiStop = true, @@ -67,14 +90,24 @@ function EMA:GetConfiguration() childGroups = "tab", get = "EMAConfigurationGetSetting", set = "EMAConfigurationSetSetting", - args = { + args = { config = { type = "input", name = L["OPEN_CONFIG"], desc = L["OPEN_CONFIG_HELP"], usage = "/ema-interaction config", get = false, - set = "", + set = "", + }, + mount = { + type = "input", + name = L["MOUNT"], + desc = L["MOUNT_HELP"], + usage = "/ema-interaction mount <tag>", + get = false, + set = "RandomMountWithTeam", + order = 3, + guiHidden = true, }, push = { type = "input", @@ -99,6 +132,7 @@ EMA.COMMAND_TAKE_TAXI = "EMATaxiTakeTaxi" EMA.COMMAND_EXIT_TAXI = "EMATaxiExitTaxi" EMA.COMMAND_CLOSE_TAXI = "EMACloseTaxi" EMA.COMMAND_MOUNT_ME = "EMAMountMe" +EMA.COMMAND_MOUNT_COMMAND = "EMAMountCommand" EMA.COMMAND_MOUNT_DISMOUNT = "EMAMountDisMount" ------------------------------------------------------------------------------------------------------------- @@ -114,6 +148,7 @@ EMA.MESSAGE_TAXI_TAKEN = "EMATaxiTaxiTaken" -- Initialise the module. function EMA:OnInitialize() + --EMA.config = nil -- Taxi EMA.TakesTaxi = false EMA.LeavsTaxi = false @@ -122,52 +157,62 @@ function EMA:OnInitialize() EMA.castingMount = nil EMA.isMounted = nil EMA.responding = false - --7.3.5 code Remove! - EMA.mountName = nil -- Create the settings control. EMA:SettingsCreate() -- Initialse the EMAModule part of this module. EMA:EMAModuleInitialize( EMA.settingsControl.widgetSettings.frame ) -- Populate the settings. EMA:SettingsRefresh() - --EMA:DisableAutoLoot() + if InCombatLockdown() == false then + EMATeamSecureButtonMount = CreateFrame( "CheckButton", "EMATeamSecureButtonMount", nil, "SecureActionButtonTemplate" ) + EMATeamSecureButtonMount:SetAttribute( "type", "macro" ) + EMATeamSecureButtonMount:SetAttribute( "macrotext", "/ema-interaction mount all" ) + EMATeamSecureButtonMount:Hide() + end end -- Called when the addon is enabled. function EMA:OnEnable() + -- Hook the TaketaxiNode function. EMA:SecureHook( "TakeTaxiNode" ) EMA:SecureHook( "TaxiRequestEarlyLanding" ) EMA:RegisterEvent( "PLAYER_ENTERING_WORLD" ) - EMA:RegisterEvent( "UNIT_SPELLCAST_START" ) - EMA:RegisterEvent( "UNIT_SPELLCAST_SUCCEEDED" ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + EMA:RegisterEvent( "UNIT_SPELLCAST_START" ) + EMA:RegisterEvent( "UNIT_SPELLCAST_SUCCEEDED" ) + end EMA:RegisterEvent( "LOOT_READY" ) EMA:RegisterEvent( "TAXIMAP_OPENED" ) EMA:RegisterEvent( "TAXIMAP_CLOSED" ) + -- Initialise key bindings. + EMA.keyBindingFrame = CreateFrame( "Frame", nil, UIParent ) + EMA:RegisterEvent( "UPDATE_BINDINGS" ) + EMA:UPDATE_BINDINGS() EMA:RegisterMessage( EMAApi.MESSAGE_MESSAGE_AREAS_CHANGED, "OnMessageAreasChanged" ) end -- Called when the addon is disabled. function EMA:OnDisable() - -- AceHook-3.0 will tidy up the hooks for us. + -- AceHook-3.0 will tidy up the hooks for us. end function EMA:SettingsCreate() EMA.settingsControl = {} -- Create the settings panel. - EMAHelperSettings:CreateSettings( - EMA.settingsControl, - EMA.moduleDisplayName, - EMA.parentDisplayName, + EMAHelperSettings:CreateSettings( + EMA.settingsControl, + EMA.moduleDisplayName, + EMA.parentDisplayName, EMA.SettingsPushSettingsClick, EMA.moduleIcon, - EMA.moduleOrder + EMA.moduleOrder ) local bottomOfInfo = EMA:SettingsCreateTaxi( EMAHelperSettings:TopOfSettings() ) EMA.settingsControl.widgetSettings.content:SetHeight( -bottomOfInfo ) -- Help local helpTable = {} - EMAHelperSettings:CreateHelp( EMA.settingsControl, helpTable, EMA:GetConfiguration() ) + EMAHelperSettings:CreateHelp( EMA.settingsControl, helpTable, EMA:GetConfiguration() ) end function EMA:SettingsPushSettingsClick( event ) @@ -176,6 +221,7 @@ end function EMA:SettingsCreateTaxi( top ) local checkBoxHeight = EMAHelperSettings:GetCheckBoxHeight() + local labelHeight = EMAHelperSettings:GetLabelHeight() local iconSize = EMAHelperSettings:GetIconHeight() local left = EMAHelperSettings:LeftOfSettings() local sliderHeight = EMAHelperSettings:GetSliderHeight() @@ -185,152 +231,157 @@ function EMA:SettingsCreateTaxi( top ) local halfWidthSlider = (headingWidth - horizontalSpacing) / 2 local dropdownHeight = EMAHelperSettings:GetDropdownHeight() local verticalSpacing = EMAHelperSettings:GetVerticalSpacing() - local leftIcon = left + iconSize + local leftIcon = left + iconSize local movingTop = top -- A blank to get layout to show right? EMAHelperSettings:CreateHeading( EMA.settingsControl, L[""], movingTop, false ) - movingTop = movingTop - headingHeight + movingTop = movingTop - headingHeight EMAHelperSettings:CreateHeading( EMA.settingsControl, L["TAXI_OPTIONS"], movingTop, false ) movingTop = movingTop - headingHeight - EMA.settingsControl.checkBoxTakeMastersTaxi = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, + EMA.settingsControl.checkBoxTakeMastersTaxi = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, movingTop, L["TAKE_TEAMS_TAXI"], EMA.SettingsToggleTakeTaxi, L["TAKE_TEAMS_TAXI_HELP"] - ) + ) movingTop = movingTop - checkBoxHeight - EMA.settingsControl.checkBoxrequestStop = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, + EMA.settingsControl.checkBoxrequestStop = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, movingTop, L["REQUEST_TAXI_STOP"], EMA.SettingsTogglerequestStop, L["REQUEST_TAXI_STOP_HELP"] - ) - movingTop = movingTop - checkBoxHeight - EMA.settingsControl.changeTexiTime = EMAHelperSettings:CreateSlider( - EMA.settingsControl, - halfWidthSlider, - left, + ) + movingTop = movingTop - checkBoxHeight + EMA.settingsControl.changeTexiTime = EMAHelperSettings:CreateSlider( + EMA.settingsControl, + halfWidthSlider, + left, movingTop, L["CLONES_TO_TAKE_TAXI_AFTER"] - ) + ) EMA.settingsControl.changeTexiTime:SetSliderValues( 0, 5, 0.5 ) EMA.settingsControl.changeTexiTime:SetCallback( "OnValueChanged", EMA.SettingsChangeTaxiTimer ) - -- Mount movingTop = movingTop - sliderHeight + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + -- Mount EMAHelperSettings:CreateHeading( EMA.settingsControl, L["MOUNT_OPTIONS"], movingTop, false ) movingTop = movingTop - headingHeight - EMA.settingsControl.checkBoxMountWithTeam = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["MOUNT_WITH_TEAM"], - EMA.SettingsToggleMountWithTeam, - L["MOUNT_WITH_TEAM_HELP"] - ) - movingTop = movingTop - checkBoxHeight - EMA.settingsControl.checkBoxDismountWithTeam = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["DISMOUNT_WITH_TEAM"], - EMA.SettingsToggleDisMountWithTeam, - L["DISMOUNT_WITH_TEAM_HELP"] - ) - movingTop = movingTop - checkBoxHeight - EMA.settingsControl.checkBoxDismountWithMaster = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["ONLY_DISMOUNT_WITH_MASTER"], - EMA.SettingsToggleDisMountWithMaster, - L["ONLY_DISMOUNT_WITH_MASTER_HELP"] - ) - --[[ - movingTop = movingTop - checkBoxHeight - EMA.settingsControl.checkBoxMountInRange = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["ONLY_MOUNT_WHEN_IN_RANGE"], - EMA.SettingsToggleMountInRange, - L["ONLY_MOUNT_WHEN_IN_RANGE_HELP"] - ) - ]] + --Disabled in classic note + EMA.settingsControl.checkBoxMountWithTeam = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["MOUNT_WITH_TEAM"], + EMA.SettingsToggleMountWithTeam, + L["MOUNT_WITH_TEAM_HELP"] + ) + movingTop = movingTop - checkBoxHeight + EMA.settingsControl.checkBoxDismountWithTeam = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["DISMOUNT_WITH_TEAM"], + EMA.SettingsToggleDisMountWithTeam, + L["DISMOUNT_WITH_TEAM_HELP"] + ) + movingTop = movingTop - checkBoxHeight + EMA.settingsControl.checkBoxDismountWithMaster = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["ONLY_DISMOUNT_WITH_MASTER"], + EMA.SettingsToggleDisMountWithMaster, + L["ONLY_DISMOUNT_WITH_MASTER_HELP"] + ) + --[[ + movingTop = movingTop - checkBoxHeight + EMA.settingsControl.checkBoxMountInRange = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["ONLY_MOUNT_WHEN_IN_RANGE"], + EMA.SettingsToggleMountInRange, + L["ONLY_MOUNT_WHEN_IN_RANGE_HELP"] + ) + ]] + end -- Loot movingTop = movingTop - headingHeight - EMAHelperSettings:CreateHeading( EMA.settingsControl, L["LOOT_OPTIONS"] , movingTop, false ) + EMAHelperSettings:CreateHeading( EMA.settingsControl, L["LOOT_OPTIONS"] , movingTop, false ) movingTop = movingTop - headingHeight - EMA.settingsControl.checkBoxAutoLoot = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, + EMA.settingsControl.checkBoxAutoLoot = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, movingTop, L["ENABLE_AUTO_LOOT"], EMA.SettingsToggleAutoLoot, L["ENABLE_AUTO_LOOT_HELP"] ) movingTop = movingTop - checkBoxHeight - EMA.settingsControl.checkBoxTellBoERare = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, + EMA.settingsControl.checkBoxTellBoERare = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, movingTop, L["TELL_TEAM_BOE_RARE"], EMA.SettingsToggleTellBoERare, L["TELL_TEAM_BOE_RARE_HELP"] ) movingTop = movingTop - checkBoxHeight - EMA.settingsControl.checkBoxTellBoEEpic = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, + EMA.settingsControl.checkBoxTellBoEEpic = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, movingTop, L["TELL_TEAM_BOE_EPIC"] , EMA.SettingsToggleTellBoEEpic, L["TELL_TEAM_BOE_EPIC_HELP"] ) - movingTop = movingTop - checkBoxHeight - EMA.settingsControl.checkBoxTellBoEMount = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["TELL_TEAM_BOE_MOUNT"] , - EMA.SettingsToggleTellBoEMount, - L["TELL_TEAM_BOE_MOUNT_HELP"] - ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + movingTop = movingTop - checkBoxHeight + EMA.settingsControl.checkBoxTellBoEMount = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["TELL_TEAM_BOE_MOUNT"] , + EMA.SettingsToggleTellBoEMount, + L["TELL_TEAM_BOE_MOUNT_HELP"] + ) + end movingTop = movingTop - sliderHeight - verticalSpacing - EMA.settingsControl.dropdownMessageArea = EMAHelperSettings:CreateDropdown( - EMA.settingsControl, - headingWidth, - left, - movingTop, + EMA.settingsControl.dropdownMessageArea = EMAHelperSettings:CreateDropdown( + EMA.settingsControl, + headingWidth, + left, + movingTop, L["MESSAGE_AREA"] ) EMA.settingsControl.dropdownMessageArea:SetList( EMAApi.MessageAreaList() ) EMA.settingsControl.dropdownMessageArea:SetCallback( "OnValueChanged", EMA.SettingsSetMessageArea ) movingTop = movingTop - dropdownHeight - verticalSpacing - EMA.settingsControl.dropdownWarningArea = EMAHelperSettings:CreateDropdown( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["SEND_WARNING_AREA"] + EMA.settingsControl.dropdownWarningArea = EMAHelperSettings:CreateDropdown( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["SEND_WARNING_AREA"] ) EMA.settingsControl.dropdownWarningArea:SetList( EMAApi.MessageAreaList() ) EMA.settingsControl.dropdownWarningArea:SetCallback( "OnValueChanged", EMA.SettingsSetWarningArea ) movingTop = movingTop - dropdownHeight - verticalSpacing - return movingTop + return movingTop end function EMA:OnMessageAreasChanged( message ) @@ -363,7 +414,7 @@ function EMA:SettingsChangeTaxiTimer( event, value ) EMA:SettingsRefresh() end --- Mount +-- Mount function EMA:SettingsToggleMountWithTeam( event, checked ) EMA.db.mountWithTeam = checked EMA:SettingsRefresh() @@ -405,24 +456,24 @@ function EMA:SettingsToggleTellBoEMount( event, checked ) end -- Settings received. -function EMA:EMAOnSettingsReceived( characterName, settings ) +function EMA:EMAOnSettingsReceived( characterName, settings ) if characterName ~= EMA.characterName then -- Update the settings. EMA.db.takeMastersTaxi = settings.takeMastersTaxi EMA.db.requestTaxiStop = settings.requestTaxiStop EMA.db.changeTexiTime = settings.changeTexiTime - + EMA.db.mountWithTeam = settings.mountWithTeam EMA.db.dismountWithTeam = settings.dismountWithTeam EMA.db.dismountWithMaster = settings.dismountWithMaster --EMA.db.mountInRange = settings.mountInRange - + EMA.db.autoLoot = settings.autoLoot EMA.db.tellBoERare = settings.tellBoERare EMA.db.tellBoEEpic = settings.tellBoEEpic - EMA.db.tellBoEMount = settings.tellBoEMount + EMA.db.tellBoEMount = settings.tellBoEMount EMA.db.messageArea = settings.messageArea - EMA.db.warningArea = settings.warningArea + EMA.db.warningArea = settings.warningArea -- Refresh the settings. EMA:SettingsRefresh() -- Tell the player. @@ -430,31 +481,30 @@ function EMA:EMAOnSettingsReceived( characterName, settings ) end end -function EMA:BeforeEMAProfileChanged() +function EMA:BeforeEMAProfileChanged() end -function EMA:OnEMAProfileChanged() +function EMA:OnEMAProfileChanged() EMA:SettingsRefresh() end function EMA:SettingsRefresh() +-- EMA:Print("test", EMA.db, "vs", EMA.db.global ) EMA.settingsControl.checkBoxTakeMastersTaxi:SetValue( EMA.db.takeMastersTaxi ) EMA.settingsControl.checkBoxrequestStop:SetValue( EMA.db.requestTaxiStop ) EMA.settingsControl.changeTexiTime:SetValue( EMA.db.changeTexiTime ) - EMA.settingsControl.checkBoxMountWithTeam:SetValue( EMA.db.mountWithTeam ) - EMA.settingsControl.checkBoxDismountWithTeam:SetValue( EMA.db.dismountWithTeam ) - EMA.settingsControl.checkBoxDismountWithMaster:SetValue( EMA.db.dismountWithMaster ) - --EMA.settingsControl.checkBoxMountInRange:SetValue( EMA.db.mountInRange ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + EMA.settingsControl.checkBoxMountWithTeam:SetValue( EMA.db.mountWithTeam ) + EMA.settingsControl.checkBoxDismountWithTeam:SetValue( EMA.db.dismountWithTeam ) + EMA.settingsControl.checkBoxDismountWithMaster:SetValue( EMA.db.dismountWithMaster ) + --EMA.settingsControl.checkBoxMountInRange:SetValue( EMA.db.mountInRange ) + EMA.settingsControl.checkBoxTellBoEMount:SetValue( EMA.db.tellBoEMount ) + end EMA.settingsControl.dropdownMessageArea:SetValue( EMA.db.messageArea ) EMA.settingsControl.dropdownWarningArea:SetValue( EMA.db.warningArea ) EMA.settingsControl.checkBoxAutoLoot:SetValue( EMA.db.autoLoot ) EMA.settingsControl.checkBoxTellBoERare:SetValue( EMA.db.tellBoERare ) EMA.settingsControl.checkBoxTellBoEEpic:SetValue( EMA.db.tellBoEEpic ) - EMA.settingsControl.checkBoxTellBoEMount:SetValue( EMA.db.tellBoEMount ) - -- Set state. - EMA.settingsControl.checkBoxDismountWithTeam:SetDisabled( not EMA.db.mountWithTeam ) - EMA.settingsControl.checkBoxDismountWithMaster:SetDisabled( not EMA.db.dismountWithTeam or not EMA.db.mountWithTeam ) - --EMA.settingsControl.checkBoxMountInRange:SetDisabled( not EMA.db.mountWithTeam ) end ------------------------------------------------------------------------------------------------------------- @@ -463,12 +513,12 @@ end function EMA:TAXIMAP_OPENED(event, ...) local uiMapSystem = ... - if (uiMapSystem == Enum.UIMapSystem.Taxi) then + if (uiMapSystem == Enum.UIMapSystem.Taxi) then EMA.TaxiFrameName = TaxiFrame else EMA.TaxiFrameName = FlightMapFrame end -end +end -- Take a taxi. local function TakeTaxi( sender, nodeName, taxiNodeIndex ) @@ -495,7 +545,7 @@ local function TakeTaxi( sender, nodeName, taxiNodeIndex ) break end end - end + end -- If a node index was found... if nodeIndex ~= nil then -- Send a message to any listeners that a taxi is being taken. @@ -515,7 +565,7 @@ function EMA.TakeTimedTaxi( event, nodeIndex, ...) if nodeIndex ~= nil then GetNumRoutes( nodeIndex ) TakeTaxiNode( nodeIndex ) - end + end end -- Called after the character has just taken a flight (hooked function). @@ -538,16 +588,16 @@ local function LeaveTaxi ( sender ) if sender ~= EMA.characterName then EMA.LeavsTaxi = true TaxiRequestEarlyLanding() - EMA:EMASendMessageToTeam( EMA.db.messageArea, L["REQUESTED_STOP_X"]( sender ), false ) + EMA:EMASendMessageToTeam( EMA.db.messageArea, L["REQUESTED_STOP_X"]( sender ), false ) end - end + end end function EMA.TaxiRequestEarlyLanding( sender ) -- If the take masters taxi option is on. --EMA:Print("test") if EMA.db.requestTaxiStop == true then - if UnitOnTaxi( "player" ) and CanExitVehicle() == true then + if UnitOnTaxi( "player" ) == true then if EMA.LeavsTaxi == false then -- Send a message to any listeners that a taxi is being taken. EMA:EMASendCommandToTeam ( EMA.COMMAND_EXIT_TAXI ) @@ -577,11 +627,12 @@ end --EMA:UNIT_SPELLCAST_START(event, unitID, spell, rank, lineID, spellID, ... ) function EMA:PLAYER_ENTERING_WORLD(event, ... ) - if EMA.db.autoLoot == true then + if EMA.db.autoLoot == true then EMA:EnableAutoLoot() - end - if IsMounted() then - local mountIDs = C_MountJournal.GetMountIDs() + end + if EMAPrivate.Core.isEmaClassicBccBuild() == true then return end + if IsMounted() then + local mountIDs = C_MountJournal.GetMountIDs() for i = 1, #mountIDs do local creatureName, spellID, icon, active = C_MountJournal.GetMountInfoByID(mountIDs[i]) if active then @@ -591,12 +642,13 @@ function EMA:PLAYER_ENTERING_WORLD(event, ... ) end end end -end +end function EMA:UNIT_SPELLCAST_START(event, unitID, lineID, spellID, ... ) + if EMAPrivate.Core.isEmaClassicBccBuild() == true then return end --EMA:Print("Looking for Spells.", unitID, spellID) if unitID == "player" then - local mountIDs = C_MountJournal.GetMountIDs() + local mountIDs = C_MountJournal.GetMountIDs() for i = 1, #mountIDs do --local name , id, icon, active = C_MountJournal.GetMountInfoByID(i) local creatureName,mountSpellID,_,_,_,_,_,_,_,_,_,mountID = C_MountJournal.GetMountInfoByID(mountIDs[i]) @@ -604,58 +656,63 @@ function EMA:UNIT_SPELLCAST_START(event, unitID, lineID, spellID, ... ) if spellID == mountSpellID then --EMA:Print("SendtoTeam", "name", creatureName, "id", mountID) if IsShiftKeyDown() == false then - if EMA.responding == false then + if EMA.responding == false then EMA:EMASendCommandToTeam( EMA.COMMAND_MOUNT_ME, creatureName, mountID ) EMA.castingMount = spellID break - end - end + end + end end - end + end end end function EMA:UNIT_SPELLCAST_SUCCEEDED(event, unitID, lineID, spellID, ... ) - if EMA.db.mountWithTeam == false or EMA.castingMount == nil or unitID ~= "player" then + if EMAPrivate.Core.isEmaClassicBccBuild() == true then return end + if EMA.db.mountWithTeam == false or EMA.castingMount == nil or unitID ~= "player" or EMA.CommandLineMount == true then return end --EMA:Print("Looking for Spells Done", spellID, EMA.castingMount) if spellID == EMA.castingMount then --EMA:Print("Mounted!", EMA.isMounted) EMA.isMounted = spellID - EMA.mountName = spell + EMA.mountName = spell EMA:RegisterEvent("UNIT_AURA") end end function EMA:UNIT_AURA(event, unitID, ... ) + if EMAPrivate.Core.isEmaClassicBccBuild() == true then return end --EMA:Print("tester", unitID, EMA.isMounted) - if unitID ~= "player" or EMA.isMounted == nil or EMA.db.dismountWithTeam == false then + if unitID ~= "player" or EMA.isMounted == nil then return end --EMA:Print("auraTrack", unitID, EMA.isMounted, EMA.mountName ) - if not LibAuras:UnitAura(unitID, EMA.isMounted ) then + if not LibAuras:UnitAura(unitID, EMA.isMounted ) then --EMA:Print("I have Dismounted - Send to team!") if EMA.db.dismountWithMaster == true then if EMAApi.IsCharacterTheMaster( EMA.characterName ) == true then - if IsShiftKeyDown() == false then - --EMA:Print("test") + if IsShiftKeyDown() == false then + --EMA:Print("test") EMA:EMASendCommandToTeam( EMA.COMMAND_MOUNT_DISMOUNT ) EMA:UnregisterEvent("UNIT_AURA") - end + end end else - if IsShiftKeyDown() == false then - EMA:EMASendCommandToTeam( EMA.COMMAND_MOUNT_DISMOUNT ) - EMA:UnregisterEvent("UNIT_AURA") - end - end + if EMA.db.dismountWithTeam == true then + if IsShiftKeyDown() == false then + EMA:EMASendCommandToTeam( EMA.COMMAND_MOUNT_DISMOUNT ) + EMA:UnregisterEvent("UNIT_AURA") + end + end + end end end function EMA:TeamMount(characterName, name, mountID) + if EMAPrivate.Core.isEmaClassicBccBuild() == true then return end --EMA:Print("testTeamMount", characterName, name, mountID ) EMA.responding = true --mount with team truned off. @@ -663,14 +720,14 @@ function EMA:TeamMount(characterName, name, mountID) return end -- already mounted. - if IsMounted() then + if IsMounted() then return end -- Checks if character is in range. if EMA.db.mountInRange == true then if UnitIsVisible(Ambiguate(characterName, "none") ) == false then --EMA:Print("UnitIsNotVisible", characterName) - return + return end end -- Checks done now the fun stuff! @@ -696,35 +753,58 @@ function EMA:TeamMount(characterName, name, mountID) hasMount = true break end - end + end end - end - + end + --EMA:Print("test1420", mount, name) - -- for unsupported mounts. + -- for unsupported mounts. if hasMount == true then --EMA:Print("test14550", mount, name ) if name == "Random" then -- name doesn't seem to be set anywhere... C_MountJournal.SummonByID(0) EMA.responding = false - else + else --EMA:Print("test1054" ) C_MountJournal.SummonByID( mount ) EMA.responding = false end - if IsMounted() == false then + if IsMounted() == false then EMA:ScheduleTimer( "AmNotMounted", 2 ) - end - end + end + end end function EMA:AmNotMounted() if IsMounted() == false then --EMA:Print("test") EMA:EMASendMessageToTeam( EMA.db.warningArea, L["I_AM_UNABLE_TO_MOUNT"], false ) - end + end +end + +function EMA:RandomMountWithTeam( info, parameters ) + if EMAPrivate.Core.isEmaClassicBccBuild() == true then return end + local tag = parameters + --EMA:Print("test", tag ) + EMA:EMASendCommandToTeam( EMA.COMMAND_MOUNT_COMMAND, tag ) end +function EMA:ReceiveRandomMountWithTeam( characterName, tag) + if EMAPrivate.Core.isEmaClassicBccBuild() == true then return end + --EMA:Print("test", characterName, tag ) + if EMAApi.IsCharacterInGroup( EMA.characterName, tag ) == true then + if IsMounted() == false then + C_MountJournal.SummonByID(0) + else + if EMA.db.dismountWithTeam == true then + Dismount() + end + end + end +end + + + ------------------------------------------------------------------------------------------------------------- -- Loot Functionality. ------------------------------------------------------------------------------------------------------------- @@ -732,7 +812,7 @@ end function EMA:LOOT_READY( event, ... ) if EMA.db.autoLoot == true then EMA:doLoot() - end + end end function EMA:doLoot( tries ) @@ -752,27 +832,27 @@ function EMA:doLoot( tries ) if lootQuality == 3 then EMA:ScheduleTimer( "TellTeamEpicBoE", 1 , name) end - end + end if EMA.db.tellBoEEpic == true or EMA.db.tellBoEMount == true then if lootQuality == 4 then --EMA:Print("Can Tell") EMA:ScheduleTimer( "TellTeamEpicBoE", 1 , name) end - end + end ---EMA:Print("canLoot", "slot", slot, "name", name ) LootSlot(slot) numloot = GetNumLootItems() - end + end end tries = tries + 1 if tries < 8 then EMA:doLootLoop( tries ) - else + else CloseLoot() - end + end else CloseLoot() - end + end end function EMA:doLootLoop( tries ) @@ -781,18 +861,18 @@ function EMA:doLootLoop( tries ) end function EMA:EnableAutoLoot() - if EMA.db.autoLoot == true then - if GetCVar("autoLootDefault") == "0" then + if EMA.db.autoLoot == true then + if GetCVar("autoLootDefault") == "0" then --EMA:Print("testSetOFF") SetCVar( "autoLootDefault", 1 ) - end - end + end + end end function EMA:TellTeamEpicBoE( name ) --EMA:Print("loottest", name ) for bagID = 0, NUM_BAG_SLOTS do - for slotID = 1,GetContainerNumSlots( bagID ),1 do + for slotID = 1,GetContainerNumSlots( bagID ),1 do --EMA:Print( "Bags OK. checking", itemLink ) local rarity = nil local item = Item:CreateFromBagAndSlot(bagID, slotID) @@ -815,16 +895,16 @@ function EMA:TellTeamEpicBoE( name ) else rarity = L["RARE"] end - end - if rarity ~= nil then - EMA:EMASendMessageToTeam( EMA.db.messageArea, L["I_HAVE_LOOTED_X_Y_ITEM"]( rarity, itemLink ), false ) + end + if rarity ~= nil then + EMA:EMASendMessageToTeam( EMA.db.messageArea, L["I_HAVE_LOOTED_X_Y_ITEM"]( rarity, itemLink ), false ) end else - if EMA.db.tellBoEMount == true then + if EMA.db.tellBoEMount == true and EMAPrivate.Core.isEmaClassicBccBuild() == false then if isBop == false then - local mountIDs = C_MountJournal.GetMountIDs() + local mountIDs = C_MountJournal.GetMountIDs() for i = 1, #mountIDs do - local creatureName, mountSpellID,_,_,_,_,_,_,_,_, isCollected, mountID = C_MountJournal.GetMountInfoByID(mountIDs[i]) + local creatureName, mountSpellID,_,_,_,_,_,_,_,_, isCollected, mountID = C_MountJournal.GetMountInfoByID(mountIDs[i]) --EMA:Print("test2", itemLink) if name == creatureName then --EMA:Print("FoundAMount", bagItemName) @@ -832,19 +912,19 @@ function EMA:TellTeamEpicBoE( name ) end end end - end + end --EMA:Print("I have looted a Epic BOE Item: ", rarity, itemLink ) - if rarity ~= nil then - EMA:EMASendMessageToTeam( EMA.db.messageArea, L["I_HAVE_LOOTED_X_Y_ITEM"]( rarity, itemLink ), false ) + if rarity ~= nil then + EMA:EMASendMessageToTeam( EMA.db.messageArea, L["I_HAVE_LOOTED_X_Y_ITEM"]( rarity, itemLink ), false ) end end end end - end - end + end + end end -end - +end + ------------------------------------------------------------------------------------------------------------- -- EMA Commands functionality. ------------------------------------------------------------------------------------------------------------- @@ -861,7 +941,7 @@ function EMA:EMAOnCommandReceived( characterName, commandName, ... ) local TaxiFrame = EMA.TaxiFrameName if TaxiFrame:IsVisible() then TakeTaxi( characterName, ... ) - end + end end end if commandName == EMA.COMMAND_EXIT_TAXI then @@ -872,20 +952,38 @@ function EMA:EMAOnCommandReceived( characterName, commandName, ... ) if commandName == EMA.COMMAND_CLOSE_TAXI then CloseTaxiMapFrame() end - + if commandName == EMA.COMMAND_MOUNT_ME then --EMA:Print("command") - EMA:TeamMount( characterName, ... ) + EMA:TeamMount( characterName, ... ) end -- Dismount if mounted! if commandName == EMA.COMMAND_MOUNT_DISMOUNT then --EMA:Print("time to Dismount") if IsMounted() then Dismount() - end - end + end + end + end + if commandName == EMA.COMMAND_MOUNT_COMMAND then + EMA:ReceiveRandomMountWithTeam( characterName, ... ) end end +function EMA:UPDATE_BINDINGS() + if InCombatLockdown() then + return + end + ClearOverrideBindings( EMA.keyBindingFrame ) + local key1, key2 = GetBindingKey( "TEAMMOUNT" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMATeamSecureButtonMount" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMATeamSecureButtonMount" ) + end +end + + EMAApi.Taxi = {} EMAApi.Taxi.MESSAGE_TAXI_TAKEN = EMA.MESSAGE_TAXI_TAKEN diff --git a/Modules/ItemUse.lua b/Modules/ItemUse.lua index f1a2648..43e0d62 100644 --- a/Modules/ItemUse.lua +++ b/Modules/ItemUse.lua @@ -10,6 +10,7 @@ -- -- -- ================================================================================ -- + -- Create the addon using AceAddon-3.0 and embed some libraries. local EMA = LibStub( "AceAddon-3.0" ):NewAddon( "ItemUse", @@ -41,7 +42,7 @@ EMA.moduleOrder = 1 -- EMA key bindings. -BINDING_HEADER_EMAITEMUSE = L["ITEM-USE"] +BINDING_HEADER_ITEMUSE = L["ITEM-USE"] BINDING_NAME_ITEMUSE1 = L["ITEM"]..L[" "]..L["1"] BINDING_NAME_ITEMUSE2 = L["ITEM"]..L[" "]..L["2"] BINDING_NAME_ITEMUSE3 = L["ITEM"]..L[" "]..L["3"] @@ -206,7 +207,8 @@ end local function CreateEMAItemUseFrame() -- The frame. EMAItemUseWindowFrame - local frame = CreateFrame("Frame", "EMAItemUseWindowFrame", UIParent, "SecureHandlerStateTemplate")Mixin(frame, BackdropTemplateMixin or {}) + local frame = CreateFrame("Frame", "EMAItemUseWindowFrame", UIParent, "SecureHandlerStateTemplate") Mixin(frame, BackdropTemplateMixin or {}) + --local frame = CreateFrame( "Frame", "EMAItemUseWindowFrame" , UIParent, "SecureHandlerStateTemplate" ) frame:SetAttribute("_onstate-page", [[ self:SetAttribute("state", newstate) control:ChildUpdate("state", newstate) @@ -237,14 +239,12 @@ local function CreateEMAItemUseFrame() EMA.db.frameXOffset = xOffset EMA.db.frameYOffset = yOffset end ) - frame:SetBackdrop( { bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", tile = true, tileSize = 10, edgeSize = 10, insets = { left = 3, right = 3, top = 3, bottom = 3 } - } ) - + } ) frame:ClearAllPoints() frame:SetPoint( EMA.db.framePoint, nil, EMA.db.frameRelativePoint, EMA.db.frameXOffset, EMA.db.frameYOffset ) -- Clear Button @@ -482,27 +482,41 @@ end --ebony test Using the wowapi and not the scanning of tooltips function EMA:CheckForQuestItemAndAddToBar() - --for iterateQuests = 1, GetNumQuestLogEntries() do - -- local questLogTitleText,_,_,isHeader, _, _, _, questID = GetQuestLogTitle(iterateQuests) - - local index = C_QuestLog.GetNumQuestLogEntries() - for iterateQuests = 1, index do - local info = C_QuestLog.GetInfo( iterateQuests ) - - - if not info.isHeader then - --EMA:Print("test", questItemLink, iterateQuests, questLogTitleText, questID ) - local questItemLink, questItemIcon, questItemCharges = GetQuestLogSpecialItemInfo( iterateQuests ) - if questItemLink ~= nil then - local itemName = GetItemInfo(questItemLink) - local questName, rank = GetItemSpell(questItemLink) -- Only means to detect if the item is usable - if questName then - --EMA:Print("addItem", questItemLink ) - EMA:AddAnItemToTheBarIfNotExists( questItemLink, false) + if EMAPrivate.Core.isEmaClassicBccBuild() == true then + for bag = 0, NUM_BAG_SLOTS do + for slot = 1, GetContainerNumSlots(bag) do + local itemLink = GetContainerItemLink(bag, slot) + if itemLink and itemLink:match("item:%d") then + local name, itemLink,_,_,_,itemType,questItem = GetItemInfo( itemLink ) + --EMA:Print("test", itemType,questItem ) + if itemType ~= nil and itemType == "Quest" then + local spellName, spellID = GetItemSpell( itemLink ) + if spellName then + --EMA:Print("test", itemLink, tooltipText ) + EMA:AddAnItemToTheBarIfNotExists( itemLink, false ) + end + end end - end + end end - end + else + local index = C_QuestLog.GetNumQuestLogEntries() + for iterateQuests = 1, index do + local info = C_QuestLog.GetInfo( iterateQuests ) + if not info.isHeader then + --EMA:Print("test", questItemLink, iterateQuests, questLogTitleText, questID ) + local questItemLink, questItemIcon, questItemCharges = GetQuestLogSpecialItemInfo( iterateQuests ) + if questItemLink ~= nil then + local itemName = GetItemInfo(questItemLink) + local questName, rank = GetItemSpell(questItemLink) -- Only means to detect if the item is usable + if questName then + --EMA:Print("addItem", questItemLink ) + EMA:AddAnItemToTheBarIfNotExists( questItemLink, false) + end + end + end + end + end end -- Removes unused items. diff --git a/Modules/LDBBar.lua b/Modules/LDBBar.lua index 974f876..39a1197 100644 --- a/Modules/LDBBar.lua +++ b/Modules/LDBBar.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -13,7 +13,7 @@ -- With Help From Jabberie, EMA Edit By Jennifer local ldb = LibStub:GetLibrary("LibDataBroker-1.1") -local dataobj = ldb:NewDataObject("EMA" .." ".. "Ebony's Muktiboxing Assistant", { +local dataobj = ldb:NewDataObject("EMA" .." ".. "Ebony's Multiboxing Assistant", { type = "data source", text = "EMA", OnLeave = dataObject_OnLeave diff --git a/Modules/Macro.lua b/Modules/Macro.lua index 0fe1b8e..e8ab4c3 100644 --- a/Modules/Macro.lua +++ b/Modules/Macro.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- diff --git a/Modules/Mail.lua b/Modules/Mail.lua index aaf90d9..8bc4851 100644 --- a/Modules/Mail.lua +++ b/Modules/Mail.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -937,14 +937,14 @@ function EMA:AddAllToMailBox() --EMA:Print( "Bags OK. checking", itemLink ) local itemLink = item:GetItemLink() local location = item:GetItemLocation() - local itemType = C_Item.GetItemInventoryType( location ) + local itemTypeNew = C_Item.GetItemInventoryType( location ) local isBop = C_Item.IsBound( location ) local itemRarity = C_Item.GetItemQuality( location ) local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemIcon, itemSellPrice, itemClassID, itemSubClassID, bindType, expacID, itemSetID, isCraftingReagent = GetItemInfo( bagItemLink ) local canSend = false local toonName = nil if EMA.db.MailBoEItems == true then - if itemType ~= 0 then + if itemTypeNew ~= 0 then if EMAApi.IsCharacterInGroup( EMA.characterName, EMA.db.autoBoEItemTag ) == true then if isBop == false then if itemRarity == 2 or itemRarity == 3 or itemRarity == 4 then @@ -1013,7 +1013,7 @@ function EMA:AddAllToMailBox() end end end - EMA:ScheduleTimer( "DoSendMail", 1, nil ) + EMA:ScheduleTimer( "DoSendMail", 2, nil ) end function EMA:MAIL_SEND_SUCCESS( event, ... ) @@ -1047,6 +1047,9 @@ end -- gold function EMA:AddGoldToMailBox() + if EMA.ShiftkeyDown == true then + return + end local moneyToKeepOnToon = tonumber( EMA.db.goldAmountToKeepOnToon ) * 10000 local moneyOnToon = GetMoney() - 30 local moneyToDepositOrWithdraw = moneyOnToon - moneyToKeepOnToon @@ -1071,7 +1074,7 @@ function EMA:AddGoldToMailBox() SendMailMoneyGold:SetText(gold) SendMailMoneySilver:SetText(silver) SendMailMoneyCopper:SetText(copper) - EMA:ScheduleTimer( "DoSendMail", 1, true ) + EMA:ScheduleTimer( "DoSendMail", 2, true ) end end else diff --git a/Modules/Modules.xml b/Modules/Modules.xml index 09f163d..13d08bf 100644 --- a/Modules/Modules.xml +++ b/Modules/Modules.xml @@ -1,7 +1,7 @@ <!-- EMA - ( Ebony's MultiBoxing Assistant ) Current Author: Jennifer Cally (Ebony) - License: All Rights Reserved 2018-2020 Jennifer Cally + License: All Rights Reserved 2018-2022 Jennifer Calladine Some Code Used from 'Jamba' that is Released under the MIT License @@ -23,12 +23,15 @@ <Script file="Guild.lua" /> <Script file="Mail.lua" /> + + <Script file="Quest-Classic.lua" /> + <Script file="QuestWatcher-Classic.lua" /> <Script file="Quest.lua" /> <Script file="QuestWatcher.lua" /> <Script file="DisplayTeam.lua" /> <Script file="Information.lua" /> + <Script file="Information-Classic.lua" /> <Script file="ItemUse.lua" /> -<!-- <Script file="ISBoxer.lua" /> --> <Script file="LDBBar.lua" /> </Ui> diff --git a/Modules/Purchase.lua b/Modules/Purchase.lua index 030d7f3..284b241 100644 --- a/Modules/Purchase.lua +++ b/Modules/Purchase.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -30,7 +30,7 @@ EMA.moduleName = "Purchase" EMA.settingsDatabaseName = "PurchaseProfileDB" EMA.chatCommand = "ema-purchase" local L = LibStub( "AceLocale-3.0" ):GetLocale( "Core" ) -EMA.parentDisplayName = L["VENDER"] +EMA.parentDisplayName = L["VENDOR"] EMA.moduleDisplayName = L["PURCHASE"] -- Icon EMA.moduleIcon = "Interface\\Addons\\EMA\\Media\\SellIcon.tga" @@ -233,8 +233,7 @@ local function SettingsCreateOptions( top ) left2 + 50, movingTop, L["REMOVE"], - EMA.SettingsRemoveClick, - L["REMOVE_VENDER_LIST"] + EMA.SettingsRemoveClick ) movingTop = movingTop - buttonHeight - verticalSpacing EMAHelperSettings:CreateHeading( EMA.settingsControl, L["ADD_ITEM"], movingTop, false ) diff --git a/Modules/Quest-Classic.lua b/Modules/Quest-Classic.lua new file mode 100644 index 0000000..63752a6 --- /dev/null +++ b/Modules/Quest-Classic.lua @@ -0,0 +1,2295 @@ +-- ================================================================================ -- +-- EMA - ( Ebony's MultiBoxing Assistant ) -- +-- Current Author: Jennifer Cally (Ebony) -- +-- -- +-- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- -- +-- Some Code Used from "Jamba" that is -- +-- Released under the MIT License -- +-- "Jamba" Copyright 2008-2015 Michael "Jafula" Miller -- +-- -- +-- ================================================================================ -- + +-- Only Load for Classic/TBC +if _G.WOW_PROJECT_ID == _G.WOW_PROJECT_MAINLINE then + return +end + +-- Create the addon using AceAddon-3.0 and embed some libraries. +local EMA = LibStub( "AceAddon-3.0" ):NewAddon( + "Quest", + "Module-1.0", + "AceConsole-3.0", + "AceEvent-3.0", + "AceHook-3.0", + "AceTimer-3.0" +) + +-- Load libraries. +local EMAUtilities = LibStub:GetLibrary( "EbonyUtilities-1.0" ) +local EMAHelperSettings = LibStub:GetLibrary( "EMAHelperSettings-1.0" ) +local AceGUI = LibStub( "AceGUI-3.0" ) +EMA.SharedMedia = LibStub( "LibSharedMedia-3.0" ) + + +-- Constants and Locale for this module. +EMA.moduleName = "Quest" +EMA.settingsDatabaseName = "QuestProfileDB" +EMA.chatCommand = "ema-quest" +local L = LibStub( "AceLocale-3.0" ):GetLocale( "Core" ) +EMA.parentDisplayName = L["QUEST"] +EMA.moduleDisplayName = L["QUEST"] +-- Icon +EMA.moduleIcon = "Interface\\Addons\\EMA\\Media\\QuestIcon.tga" +EMA.moduleCompletionIcon = "Interface\\Addons\\EMA\\Media\\QuestCompletionIcon.tga" +-- order +EMA.moduleOrder = 50 +EMA.moduleCompletionOrder = 1 + +-- Settings - the values to store and their defaults for the settings database. +EMA.settings = { + profile = { + mirrorMasterQuestSelectionAndDeclining = true, + acceptQuests = true, + slaveMirrorMasterAccept = true, + allAutoSelectQuests = false, + doNotAutoAccept = true, + allAcceptAnyQuest = false, + onlyAcceptQuestsFrom = false, + hideStaticPopup = false, + acceptFromTeam = false, + acceptFromNpc = false, + acceptFromFriends = false, + acceptFromParty = false, + acceptFromRaid = false, + acceptFromGuild = false, + masterAutoShareQuestOnAccept = false, + slaveAutoAcceptEscortQuest = true, + showEMAQuestLogWithWoWQuestLog = true, + enableAutoQuestCompletion = true, + noChoiceAllDoNothing = false, + noChoiceSlaveCompleteQuestWithMaster = true, + noChoiceAllAutoCompleteQuest = false, + hasChoiceSlaveDoNothing = false, + hasChoiceSlaveCompleteQuestWithMaster = true, + hasChoiceSlaveChooseSameRewardAsMaster = false, + hasChoiceSlaveMustChooseOwnReward = true, + hasChoiceAquireBestQuestRewardForCharacter = false, + hasChoiceSlaveRewardChoiceModifierConditional = false, + hasChoiceCtrlKeyModifier = false, + hasChoiceShiftKeyModifier = false, + hasChoiceAltKeyModifier = false, + hasChoiceOverrideUseSlaveRewardSelected = true, + messageArea = EMAApi.DefaultMessageArea(), + warningArea = EMAApi.DefaultWarningArea(), + framePoint = "CENTER", + frameRelativePoint = "CENTER", + frameXOffset = 0, + frameYOffset = 0, + overrideQuestAutoSelectAndComplete = false, + }, +} + +-- Configuration. +function EMA:GetConfiguration() + local configuration = { + name = EMA.moduleDisplayName, + handler = EMA, + type = "group", + get = "EMAConfigurationGetSetting", + set = "EMAConfigurationSetSetting", + args = { + config = { + type = "input", + name = L["OPEN_CONFIG"], + desc = L["OPEN_CONFIG_HELP"], + usage = "/ema-quest config", + get = false, + set = "", + }, + push = { + type = "input", + name = L["PUSH_SETTINGS"], + desc = L["PUSH_SETTINGS_INFO"], + usage = "/ema-quest push", + get = false, + set = "EMASendSettings", + }, + }, + } + return configuration +end + +------------------------------------------------------------------------------------------------------------- +-- Command this module sends. +------------------------------------------------------------------------------------------------------------- + +EMA.COMMAND_SELECT_GOSSIP_OPTION = "EMASelectGossipOption" +EMA.COMMAND_SELECT_GOSSIP_ACTIVE_QUEST = "EMASelectGossipActiveQuest" +EMA.COMMAND_SELECT_GOSSIP_AVAILABLE_QUEST = "EMASelectGossipAvailableQuest" +EMA.COMMAND_SELECT_ACTIVE_QUEST = "EMASelectActiveQuest" +EMA.COMMAND_SELECT_AVAILABLE_QUEST = "EMASelectAvailableQuest" +EMA.COMMAND_ACCEPT_QUEST = "EMAAcceptQuest" +EMA.COMMAND_COMPLETE_QUEST = "EMACompleteQuest" +EMA.COMMAND_CHOOSE_QUEST_REWARD = "EMAChooseQuestReward" +EMA.COMMAND_DECLINE_QUEST = "EMADeclineQuest" +EMA.COMMAND_SELECT_QUEST_LOG_ENTRY = "EMASelectQuestLogEntry" +EMA.COMMAND_QUEST_TRACK = "EMAQuestTrack" +EMA.COMMAND_ABANDON_QUEST = "EMAAbandonQuest" +EMA.COMMAND_ABANDON_ALL_QUESTS = "EMAAbandonAllQuests" +EMA.COMMAND_TRACK_ALL_QUESTS = "EMATrackAllQuests" +EMA.COMMAND_UNTRACK_ALL_QUESTS = "EMAUnTrackAllQuests" +EMA.COMMAND_SHARE_ALL_QUESTS = "EMAShareAllQuests" +EMA.COMMAND_TOGGLE_AUTO_SELECT = "EMAToggleAutoSelect" +EMA.COMMAND_LOG_COMPLETE_QUEST = "EMALogCompleteQuest" +EMA.COMMAND_ACCEPT_QUEST_FAKE = "EMAAcceptQuestFake" + +------------------------------------------------------------------------------------------------------------- +-- Messages module sends. +------------------------------------------------------------------------------------------------------------- + + +------------------------------------------------------------------------------------------------------------- +-- Popup Dialogs. +------------------------------------------------------------------------------------------------------------- + +-- Initialize Popup Dialogs. +local function InitializePopupDialogs() + -- Asks If you like to Abandon on all toons + StaticPopupDialogs["EMAQUEST_ABANDON_ALL_TOONS"] = { + text = L["ABANDON_QUESTS_TEAM"], + button1 = YES, + button2 = NO, + timeout = 0, + whileDead = 1, + hideOnEscape = 1, + OnAccept = function( self, data ) + -- EMA:Print("button1", data.questID, data.title ) + EMA:EMASendCommandToTeam( EMA.COMMAND_ABANDON_QUEST, data.questID, data.title) + end, + OnCancel = function( self ) + end, + } + -- Asks If you like to Track on all toons + StaticPopupDialogs["EMA_QUEST_TRACK_ALL_TOONS"] = { + text = L["TRACK_QUEST_ON_TEAM"], + button1 = YES, + button2 = NO, + timeout = 0, + whileDead = 1, + hideOnEscape = 1, + OnAccept = function( self, data ) + EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_TRACK, data.questID, data.title, true ) + end, + OnCancel = function( self ) + end, + } + StaticPopupDialogs["EMA_QUEST_UNTRACK_ALL_TOONS"] = { + text = L["UNTRACK_QUEST_ON_TEAM"], + button1 = YES, + button2 = NO, + timeout = 0, + whileDead = 1, + hideOnEscape = 1, + OnAccept = function( self, data ) + EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_TRACK, data.questID, data.title, false ) + end, + OnCancel = function( self ) + end, + } + StaticPopupDialogs["EMA_ABANDON_ALL_TOON_QUEST"] = { + text = L["ABANDON_ALL_QUESTS"], + button1 = L["YES_IAM_SURE"], + button2 = NO, + timeout = 0, + showAlert = 1, + whileDead = true, + hideOnEscape = true, + OnAccept = function() + EMA:DoAbandonAllQuestsFromAllToons() + end, + } +end + +------------------------------------------------------------------------------------------------------------- +-- Addon initialization, enabling and disabling. +------------------------------------------------------------------------------------------------------------- + +function EMA:DebugMessage( ... ) + --EMA:Print( ... ) +end + +-- Initialise the module. +function EMA:OnInitialize() + -- Create the settings control. + EMA:SettingsCreate() + -- Initialise the EMAModule part of this module. + EMA:EMAModuleInitialize( EMA.settingsControl.widgetSettings.frame ) + -- Populate the settings. + EMA:SettingsRefresh() + -- Initialise the popup dialogs. + InitializePopupDialogs() + -- Create the EMA Quest Log frame. + EMA:CreateEMAMiniQuestLogFrame() + -- An empty table to hold the available and active quests at an npc. + EMA.gossipQuests = {} +end + +-- Called when the addon is enabled. +function EMA:OnEnable() + -- No internal commands active. + EMA.isInternalCommand = false + EMA:RegisterMessage( EMAApi.MESSAGE_MESSAGE_AREAS_CHANGED, "OnMessageAreasChanged" ) + -- Quest events. + EMA:RegisterEvent( "QUEST_ACCEPTED" ) + EMA:RegisterEvent( "QUEST_DETAIL" ) + EMA:RegisterEvent( "QUEST_COMPLETE" ) + EMA:RegisterEvent( "QUEST_ACCEPT_CONFIRM" ) + EMA:RegisterEvent( "GOSSIP_SHOW" ) + EMA:RegisterEvent( "QUEST_GREETING" ) + EMA:RegisterEvent( "QUEST_PROGRESS" ) + EMA:RegisterEvent( "CHAT_MSG_SYSTEM", "QUEST_FAIL" ) + -- Quest post hooks. + EMA:SecureHook( "SelectGossipOption" ) + EMA:SecureHook( "SelectGossipActiveQuest" ) + EMA:SecureHook( "SelectGossipAvailableQuest" ) + EMA:SecureHook( "SelectActiveQuest" ) + EMA:SecureHook( "SelectAvailableQuest" ) + EMA:SecureHook( "AcceptQuest" ) + EMA:SecureHook( "CompleteQuest" ) + EMA:SecureHook( "GetQuestReward" ) + EMA:SecureHook( "ToggleFrame" ) + EMA:SecureHook( "ToggleQuestLog" ) + EMA:SecureHook( "ShowQuestComplete" ) + EMA:SecureHook( "AbandonQuest" ) +-- EMA:SecureHook( "QuestWatch_Update" ) +-- EMA:SecureHook( "QuestMapQuestOptions_TrackQuest" ) +-- EMA:SecureHook( "QuestLog" ) +end + +-- Called when the addon is disabled. +function EMA:OnDisable() + -- AceHook-3.0 will tidy up the hooks for us. +end + +------------------------------------------------------------------------------------------------------------- +-- Settings Dialogs. +------------------------------------------------------------------------------------------------------------- + +function EMA:SettingsCreate() + EMA.settingsControl = {} + EMA.settingsControlCompletion = {} + -- Create the settings panels. + EMAHelperSettings:CreateSettings( + EMA.settingsControl, + EMA.moduleDisplayName, + EMA.parentDisplayName, + EMA.SettingsPushSettingsClick, + EMA.moduleIcon, + EMA.moduleOrder + ) + EMAHelperSettings:CreateSettings( + EMA.settingsControlCompletion, + L["COMPLETION"], + EMA.parentDisplayName, + EMA.SettingsPushSettingsClick, + EMA.moduleCompletionIcon, + EMA.moduleCompletionOrder + ) + -- Create the quest controls. + local bottomOfQuestOptions = EMA:SettingsCreateQuestControl( EMAHelperSettings:TopOfSettings() ) + EMA.settingsControl.widgetSettings.content:SetHeight( -bottomOfQuestOptions ) + local bottomOfQuestCompletionOptions = EMA:SettingsCreateQuestCompletionControl( EMAHelperSettings:TopOfSettings() ) + EMA.settingsControlCompletion.widgetSettings.content:SetHeight( -bottomOfQuestCompletionOptions ) + -- Help + local helpTable = {} + EMAHelperSettings:CreateHelp( EMA.settingsControl, helpTable, EMA:GetConfiguration() ) +end + +function EMA:SettingsCreateQuestControl( top ) + -- Get positions and dimensions. + local checkBoxHeight = EMAHelperSettings:GetCheckBoxHeight() + local radioBoxHeight = EMAHelperSettings:GetRadioBoxHeight() + local labelHeight = EMAHelperSettings:GetLabelHeight() + local labelContinueHeight = EMAHelperSettings:GetContinueLabelHeight() + local dropdownHeight = EMAHelperSettings:GetDropdownHeight() + local left = EMAHelperSettings:LeftOfSettings() + local headingHeight = EMAHelperSettings:HeadingHeight() + local headingWidth = EMAHelperSettings:HeadingWidth( false ) + local horizontalSpacing = EMAHelperSettings:GetHorizontalSpacing() + local verticalSpacing = EMAHelperSettings:GetVerticalSpacing() + local indent = horizontalSpacing * 10 + local indentContinueLabel = horizontalSpacing * 22 + local checkBoxThirdWidth = (headingWidth - indentContinueLabel) / 3 + local halfWidth = (headingWidth - horizontalSpacing) / 2 + local middle = left + halfWidth + local column1Left = left + local column1LeftIndent = left + indentContinueLabel + local column2LeftIndent = column1LeftIndent + checkBoxThirdWidth + horizontalSpacing + local column3LeftIndent = column2LeftIndent + checkBoxThirdWidth + horizontalSpacing + local movingTop = top + -- A blank to get layout to show right? + EMAHelperSettings:CreateHeading( EMA.settingsControl, "", movingTop, false ) + movingTop = movingTop - headingHeight + -- Create a heading for information. + EMAHelperSettings:CreateHeading( EMA.settingsControl, EMA.moduleDisplayName..L[" "]..L["INFORMATION"], movingTop, false ) + movingTop = movingTop - headingHeight + -- Information line 1. + EMA.settingsControl.labelQuestInformation1 = EMAHelperSettings:CreateContinueLabel( + EMA.settingsControl, + headingWidth, + column1Left, + movingTop, + L["QUESTINFORMATIONONE"] + ) + movingTop = movingTop - labelContinueHeight + -- Information line 2. + EMA.settingsControl.labelQuestInformation2 = EMAHelperSettings:CreateContinueLabel( + EMA.settingsControl, + headingWidth, + column1Left, + movingTop, + L["QUESTINFORMATIONTWO"] + ) + movingTop = movingTop - labelContinueHeight + -- Information line 3. + EMA.settingsControl.labelQuestInformation3 = EMAHelperSettings:CreateContinueLabel( + EMA.settingsControl, + headingWidth, + column1Left, + movingTop, + L["QUESTINFORMATIONTHREE"] + ) + movingTop = movingTop - labelContinueHeight + -- Create a heading for quest selection. + EMAHelperSettings:CreateHeading( EMA.settingsControl, L["QUEST_HEADER"], movingTop, false ) + movingTop = movingTop - headingHeight + -- Radio box: Minion select, accept and decline quest with master. + EMA.settingsControl.checkBoxMirrorMasterQuestSelectionAndDeclining = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + column1Left, + movingTop, + L["MIRROR_QUEST"], + EMA.SettingsToggleMirrorMasterQuestSelectionAndDeclining, + L["MIRROR_QUEST_HELP"] + ) + EMA.settingsControl.checkBoxMirrorMasterQuestSelectionAndDeclining:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight + -- Radio box: All auto select quests. + EMA.settingsControl.checkBoxAllAutoSelectQuests = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + column1Left, + movingTop, + L["AUTO_SELECT_QUESTS"], + EMA.SettingsToggleAllAutoSelectQuests, + L["AUTO_SELECT_QUESTS_HELP"] + ) + EMA.settingsControl.checkBoxAllAutoSelectQuests:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight + -- Check box: Accept quests. + EMA.settingsControl.checkBoxAcceptQuests = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + column1Left, + movingTop, + L["ACCEPT_QUESTS"], + EMA.SettingsToggleAcceptQuests, + L["ACCEPT_QUESTS_HELP"] + ) + movingTop = movingTop - checkBoxHeight + -- Radio box: Minion accept quest with master. + EMA.settingsControl.checkBoxMinionMirrorMasterAccept = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + column1Left + indent, + movingTop, + L["ACCEPT_QUEST_WITH_TEAM"], + EMA.SettingsToggleMinionMirrorMasterAccept, + L["ACCEPT_QUEST_WITH_TEAM_HELP"] + ) + movingTop = movingTop - checkBoxHeight + -- Information line 3. + EMA.settingsControl.labelQuestInformationAuto = EMAHelperSettings:CreateContinueLabel( + EMA.settingsControl, + headingWidth, + column1Left, + movingTop, + L["QUEST_INFORMATION_AUTO"] + ) + movingTop = movingTop - labelContinueHeight + -- Radio box: All auto accept any quest. + EMA.settingsControl.checkBoxDoNotAutoAccept = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + column1Left + indent, + movingTop, + L["DONOT_AUTO_ACCEPT_QUESTS"], + EMA.SettingsToggleDoNotAutoAccept + ) + EMA.settingsControl.checkBoxDoNotAutoAccept:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight + -- Radio box: All auto accept any quest. + EMA.settingsControl.checkBoxAllAcceptAnyQuest = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + column1Left + indent, + movingTop, + L["AUTO_ACCEPT_QUESTS"], + EMA.SettingsToggleAllAcceptAnyQuest, + L["AUTO_ACCEPT_QUESTS_HELP"] + ) + EMA.settingsControl.checkBoxAllAcceptAnyQuest:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight + -- Radio box: Choose who to auto accept quests from. + EMA.settingsControl.checkBoxOnlyAcceptQuestsFrom = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + column1Left + indent, + movingTop, + L["AUTO_ACCEPT_QUESTS_LIST"], + EMA.SettingsToggleOnlyAcceptQuestsFrom, + L["AUTO_ACCEPT_QUESTS_LIST_HELP"] + ) + EMA.settingsControl.checkBoxOnlyAcceptQuestsFrom:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight + -- Check box: Team. + EMA.settingsControl.checkBoxAcceptFromTeam = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + checkBoxThirdWidth, + column1LeftIndent, + movingTop, + L["TEAM"], + EMA.SettingsToggleAcceptFromTeam, + L["TEAM_QUEST_HELP"] + ) + -- Check box: NPC. + EMA.settingsControl.checkBoxAcceptFromNpc = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + checkBoxThirdWidth, + column2LeftIndent, + movingTop, + L["NPC"], + EMA.SettingsToggleAcceptFromNpc, + L["NPC_HELP"] + ) + -- Check box: Friends. + EMA.settingsControl.checkBoxAcceptFromFriends = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + checkBoxThirdWidth, + column3LeftIndent, + movingTop, + L["FRIENDS"], + EMA.SettingsToggleAcceptFromFriends, + L["FRIENDS_HELP"] + ) + movingTop = movingTop - checkBoxHeight + -- Check box: Party. + EMA.settingsControl.checkBoxAcceptFromParty = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + checkBoxThirdWidth, + column1LeftIndent, + movingTop, + L["PARTY"], + EMA.SettingsToggleAcceptFromParty, + L["QUEST_GROUP_HELP"] + + ) + -- Check box: Guild. + --movingTop = movingTop - checkBoxHeight + EMA.settingsControl.checkBoxAcceptFromGuild = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + checkBoxThirdWidth, + column2LeftIndent, + movingTop, + L["GUILD"], + EMA.SettingsToggleAcceptFromGuild, + L["GUILD_HELP"] + ) +-- TODO Change To Community's + -- Check box: Raid. + EMA.settingsControl.checkBoxAcceptFromRaid = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + checkBoxThirdWidth, + column3LeftIndent, + movingTop, + L["PH_RAID"], + EMA.SettingsToggleAcceptFromRaid, + L["PH_RAID_HELP"] + ) + -- Check box: Master auto share quest on accept. + movingTop = movingTop - checkBoxHeight + EMA.settingsControl.checkBoxMasterAutoShareQuestOnAccept = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + column1Left, + movingTop, + L["MASTER_SHARE_QUESTS"], + EMA.SettingsToggleMasterAutoShareQuestOnAccept, + L["MASTER_SHARE_QUESTS_HELP"] + ) + movingTop = movingTop - checkBoxHeight + -- Check box: Minion auto accept escort quest from master. + EMA.settingsControl.checkBoxMinionAutoAcceptEscortQuest = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + column1Left, + movingTop, + L["ACCEPT_ESCORT_QUEST"], + EMA.SettingsToggleMinionAutoAcceptEscortQuest, + L["ACCEPT_ESCORT_QUEST_HELP"] + ) + movingTop = movingTop - checkBoxHeight + -- Create a heading for other options. + EMAHelperSettings:CreateHeading( EMA.settingsControl, L["OTHER"]..L[" "]..L["OPTIONS"], movingTop, false ) + movingTop = movingTop - headingHeight + -- Check box: Override quest auto select and auto complete. + EMA.settingsControl.checkBoxOverrideQuestAutoSelectAndComplete = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + column1Left, + movingTop, + L["HOLD_SHIFT_TO_OVERRIDE"], + EMA.SettingsToggleOverrideQuestAutoSelectAndComplete, + L["HOLD_SHIFT_TO_OVERRIDE_HELP"] + ) + movingTop = movingTop - checkBoxHeight + -- Check box: Show EMA quest log with WoW quest log. + EMA.settingsControl.checkBoxShowEMAQuestLogWithWoWQuestLog = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + column1Left, + movingTop, + L["SHOW_PANEL_UNDER_QUESTLOG"], + EMA.SettingsToggleShowEMAQuestLogWithWoWQuestLog, + L["SHOW_PANEL_UNDER_QUESTLOG_HELP"] + ) + movingTop = movingTop - checkBoxHeight + -- Message area. + EMA.settingsControl.dropdownMessageArea = EMAHelperSettings:CreateDropdown( + EMA.settingsControl, + headingWidth, + column1Left, + movingTop, + L["MESSAGE_AREA"] + ) + EMA.settingsControl.dropdownMessageArea:SetList( EMAApi.MessageAreaList() ) + EMA.settingsControl.dropdownMessageArea:SetCallback( "OnValueChanged", EMA.SettingsSetMessageArea ) + movingTop = movingTop - dropdownHeight + -- Warning area. + EMA.settingsControl.dropdownWarningArea = EMAHelperSettings:CreateDropdown( + EMA.settingsControl, + headingWidth, + column1Left, + movingTop, + L["SEND_WARNING_AREA"] + ) + EMA.settingsControl.dropdownWarningArea:SetList( EMAApi.MessageAreaList() ) + EMA.settingsControl.dropdownWarningArea:SetCallback( "OnValueChanged", EMA.SettingsSetWarningArea ) + movingTop = movingTop - dropdownHeight + return movingTop +end + +function EMA:OnMessageAreasChanged( message ) + EMA.settingsControl.dropdownMessageArea:SetList( EMAApi.MessageAreaList() ) + EMA.settingsControl.dropdownWarningArea:SetList( EMAApi.MessageAreaList() ) +end + +function EMA:SettingsCreateQuestCompletionControl( top ) + -- Get positions and dimensions. + local checkBoxHeight = EMAHelperSettings:GetCheckBoxHeight() + local radioBoxHeight = EMAHelperSettings:GetRadioBoxHeight() + local labelHeight = EMAHelperSettings:GetLabelHeight() + local labelContinueHeight = EMAHelperSettings:GetContinueLabelHeight() + local left = EMAHelperSettings:LeftOfSettings() + local headingHeight = EMAHelperSettings:HeadingHeight() + local headingWidth = EMAHelperSettings:HeadingWidth( false ) + local horizontalSpacing = EMAHelperSettings:GetHorizontalSpacing() + local verticalSpacing = EMAHelperSettings:GetVerticalSpacing() + local indent = horizontalSpacing * 10 + local indentContinueLabel = horizontalSpacing * 18 + local indentSpecial = indentContinueLabel + 9 + local checkBoxThirdWidth = (headingWidth - indentContinueLabel) / 3 + local column1Left = left + local column1LeftIndent = left + indentContinueLabel + local column2LeftIndent = column1LeftIndent + checkBoxThirdWidth + horizontalSpacing + local column3LeftIndent = column2LeftIndent + checkBoxThirdWidth + horizontalSpacing + local movingTop = top + -- A blank to get layout to show right? + EMAHelperSettings:CreateHeading( EMA.settingsControlCompletion, "", movingTop, false ) + movingTop = movingTop - headingHeight + -- Create a heading for quest completion. + EMAHelperSettings:CreateHeading( EMA.settingsControlCompletion, L["QUEST_COMPLETION"], movingTop, false ) + movingTop = movingTop - headingHeight + -- Check box: Enable auto quest completion. + EMA.settingsControlCompletion.checkBoxEnableAutoQuestCompletion = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + headingWidth, + column1Left, + movingTop, + L["ENABLE_QUEST_COMPLETION"], + EMA.SettingsToggleEnableAutoQuestCompletion, + L["ENABLE_QUEST_COMPLETION_HELP"] + ) + movingTop = movingTop - checkBoxHeight + EMAHelperSettings:CreateHeading( EMA.settingsControlCompletion, L["NOREWARDS_OR_ONEREWARD"], movingTop, false ) + movingTop = movingTop - headingHeight + -- Radio box: No choice, minion do nothing. + EMA.settingsControlCompletion.checkBoxNoChoiceAllDoNothing = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + headingWidth, + column1Left, + movingTop, + L["QUEST_DO_NOTHING"], + EMA.SettingsToggleNoChoiceAllDoNothing, + L["QUEST_DO_NOTHING_HELP"] + ) + EMA.settingsControlCompletion.checkBoxNoChoiceAllDoNothing:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight + -- Radio box: No choice, minion complete quest with master. + EMA.settingsControlCompletion.checkBoxNoChoiceMinionCompleteQuestWithMaster = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + headingWidth, + column1Left, + movingTop, + L["COMPLETE_QUEST_WITH_TEAM"], + EMA.SettingsToggleNoChoiceMinionCompleteQuestWithMaster, + L["COMPLETE_QUEST_WITH_TEAM_HELP"] + ) + EMA.settingsControlCompletion.checkBoxNoChoiceMinionCompleteQuestWithMaster:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight + -- Radio box: No Choice, all automatically complete quest. + EMA.settingsControlCompletion.checkBoxNoChoiceAllAutoCompleteQuest = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + headingWidth, + column1Left, + movingTop, + L["AUTO_COMPLETE_QUEST"], + EMA.SettingsToggleNoChoiceAllAutoCompleteQuest, + L["AUTO_COMPLETE_QUEST_HELP"] + ) + EMA.settingsControlCompletion.checkBoxNoChoiceAllAutoCompleteQuest:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight + EMAHelperSettings:CreateHeading( EMA.settingsControlCompletion, L["MORE_THEN_ONE_REWARD"], movingTop, false ) + movingTop = movingTop - headingHeight + -- Radio box: Has choice, minion do nothing. + EMA.settingsControlCompletion.checkBoxHasChoiceMinionDoNothing = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + headingWidth, + column1Left, + movingTop, + L["QUEST_DO_NOTHING"] , + EMA.SettingsToggleHasChoiceMinionDoNothing, + L["QUEST_DO_NOTHING_HELP"] + ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionDoNothing:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight + -- Radio box: Has choice, minion complete quest with master. + EMA.settingsControlCompletion.checkBoxHasChoiceMinionCompleteQuestWithMaster = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + headingWidth, + column1Left, + movingTop, + L["COMPLETE_QUEST_WITH_TEAM"], + EMA.SettingsToggleHasChoiceMinionCompleteQuestWithMaster, + L["COMPLETE_QUEST_WITH_TEAM_HELP"] + ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionCompleteQuestWithMaster:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight + -- Radio box: Has choice, minion must choose own reward. + EMA.settingsControlCompletion.checkBoxHasChoiceMinionMustChooseOwnReward = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + headingWidth, + column1Left + indent, + movingTop, + L["MUST_CHOOSE_OWN_REWARD"], + EMA.SettingsToggleHasChoiceMinionMustChooseOwnReward, + L["MUST_CHOOSE_OWN_REWARD_HELP"] + ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionMustChooseOwnReward:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight + -- Radio box: Has choice, minion choose same reward as master. + EMA.settingsControlCompletion.checkBoxHasChoiceMinionChooseSameRewardAsMaster = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + headingWidth, + column1Left + indent, + movingTop, + L["CHOOSE_SAME_REWARD"], + EMA.SettingsToggleHasChoiceMinionChooseSameRewardAsMaster, + L["CHOOSE_SAME_REWARD_HELP"] + ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionChooseSameRewardAsMaster:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight + -- Radio box: Has choice, minion choose same reward as master. + EMA.settingsControlCompletion.checkBoxHasChoiceAquireBestQuestRewardForCharacter = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + headingWidth, + column1Left + indent, + movingTop, + L["CHOOSE_BEST_REWARD"], + EMA.SettingsToggleHasChoiceAquireBestQuestRewardForCharacter, + L["CHOOSE_BEST_REWARD_HELP"] + ) + EMA.settingsControlCompletion.checkBoxHasChoiceAquireBestQuestRewardForCharacter:SetType( "radio" ) + movingTop = movingTop - radioBoxHeight + -- Radio box: Has choice, minion reward choice depends on modifier key pressed down. + EMA.settingsControlCompletion.checkBoxHasChoiceMinionRewardChoiceModifierConditional = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + headingWidth, + column1Left + indent, + movingTop, + L["MODIFIER_CHOOSE_SAME_REWARD"], + EMA.SettingsToggleHasChoiceMinionRewardChoiceModifierConditional, + L["MODIFIER_CHOOSE_SAME_REWARD_HELP"] + ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionRewardChoiceModifierConditional:SetType( "radio" ) + + movingTop = movingTop - radioBoxHeight + -- Check box: Ctrl modifier key. + EMA.settingsControlCompletion.checkBoxHasChoiceCtrlKeyModifier = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + checkBoxThirdWidth, + column1LeftIndent, + movingTop, + L["CTRL"], + EMA.SettingsToggleHasChoiceCtrlKeyModifier + ) + -- Check box: Shift modifier key. + EMA.settingsControlCompletion.checkBoxHasChoiceShiftKeyModifier = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + checkBoxThirdWidth, + column2LeftIndent, + movingTop, + L["SHIFT"], + EMA.SettingsToggleHasChoiceShiftKeyModifier + ) + -- Check box: Alt modifier key. + EMA.settingsControlCompletion.checkBoxHasChoiceAltKeyModifier = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + checkBoxThirdWidth, + column3LeftIndent, + movingTop, + L["ALT"], + EMA.SettingsToggleHasChoiceAltKeyModifier + ) + movingTop = movingTop - checkBoxHeight + -- Check box: Has choice, override, if minion already has reward selected, choose that reward. + EMA.settingsControlCompletion.checkBoxHasChoiceOverrideUseMinionRewardSelected = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlCompletion, + headingWidth, + column1Left + indent, + movingTop, + L["OVERRIDE_REWARD_SELECTED"], + EMA.SettingsToggleHasChoiceOverrideUseMinionRewardSelected, + L["OVERRIDE_REWARD_SELECTED_HELP"] + ) + movingTop = movingTop - checkBoxHeight + return movingTop +end + +------------------------------------------------------------------------------------------------------------- +-- Settings functionality. +------------------------------------------------------------------------------------------------------------- + +-- Settings received. +function EMA:EMAOnSettingsReceived( characterName, settings ) + if characterName ~= EMA.characterName then + -- Update the settings. + EMA.db.mirrorMasterQuestSelectionAndDeclining = settings.mirrorMasterQuestSelectionAndDeclining + EMA.db.allAutoSelectQuests = settings.allAutoSelectQuests + EMA.db.acceptQuests = settings.acceptQuests + EMA.db.slaveMirrorMasterAccept = settings.slaveMirrorMasterAccept + EMA.db.doNotAutoAccept = settings.doNotAutoAccept + EMA.db.allAcceptAnyQuest = settings.allAcceptAnyQuest + EMA.db.onlyAcceptQuestsFrom = settings.onlyAcceptQuestsFrom + EMA.db.acceptFromTeam = settings.acceptFromTeam + EMA.db.acceptFromNpc = settings.acceptFromNpc + EMA.db.acceptFromFriends = settings.acceptFromFriends + EMA.db.acceptFromParty = settings.acceptFromParty + EMA.db.acceptFromRaid = settings.acceptFromRaid + EMA.db.acceptFromGuild = settings.acceptFromGuild + EMA.db.masterAutoShareQuestOnAccept = settings.masterAutoShareQuestOnAccept + EMA.db.slaveAutoAcceptEscortQuest = settings.slaveAutoAcceptEscortQuest + EMA.db.showEMAQuestLogWithWoWQuestLog = settings.showEMAQuestLogWithWoWQuestLog + EMA.db.enableAutoQuestCompletion = settings.enableAutoQuestCompletion + EMA.db.noChoiceAllDoNothing = settings.noChoiceAllDoNothing + EMA.db.noChoiceSlaveCompleteQuestWithMaster = settings.noChoiceSlaveCompleteQuestWithMaster + EMA.db.noChoiceAllAutoCompleteQuest = settings.noChoiceAllAutoCompleteQuest + EMA.db.hasChoiceSlaveDoNothing = settings.hasChoiceSlaveDoNothing + EMA.db.hasChoiceSlaveCompleteQuestWithMaster = settings.hasChoiceSlaveCompleteQuestWithMaster + EMA.db.hasChoiceSlaveChooseSameRewardAsMaster = settings.hasChoiceSlaveChooseSameRewardAsMaster + EMA.db.hasChoiceAquireBestQuestRewardForCharacter = settings.hasChoiceAquireBestQuestRewardForCharacter + EMA.db.hasChoiceSlaveMustChooseOwnReward = settings.hasChoiceSlaveMustChooseOwnReward + EMA.db.hasChoiceSlaveRewardChoiceModifierConditional = settings.hasChoiceSlaveRewardChoiceModifierConditional + EMA.db.hasChoiceCtrlKeyModifier = settings.hasChoiceCtrlKeyModifier + EMA.db.hasChoiceShiftKeyModifier = settings.hasChoiceShiftKeyModifier + EMA.db.hasChoiceAltKeyModifier = settings.hasChoiceAltKeyModifier + EMA.db.hasChoiceOverrideUseSlaveRewardSelected = settings.hasChoiceOverrideUseSlaveRewardSelected + EMA.db.messageArea = settings.messageArea + EMA.db.warningArea = settings.warningArea + EMA.db.overrideQuestAutoSelectAndComplete = settings.overrideQuestAutoSelectAndComplete + -- Refresh the settings. + EMA:SettingsRefresh() + -- Tell the player. + EMA:Print( L["SETTINGS_RECEIVED_FROM_A"]( characterName ) ) + end +end + +------------------------------------------------------------------------------------------------------------- +-- Settings Populate. +------------------------------------------------------------------------------------------------------------- + +function EMA:BeforeEMAProfileChanged() +end + +function EMA:OnEMAProfileChanged() + EMA:SettingsRefresh() +end + +function EMA:SettingsRefresh() + -- Quest general and acceptance options. + EMA.settingsControl.checkBoxMirrorMasterQuestSelectionAndDeclining:SetValue( EMA.db.mirrorMasterQuestSelectionAndDeclining ) + EMA.settingsControl.checkBoxAllAutoSelectQuests:SetValue( EMA.db.allAutoSelectQuests ) + EMA.settingsControl.checkBoxAcceptQuests:SetValue( EMA.db.acceptQuests ) + EMA.settingsControl.checkBoxMinionMirrorMasterAccept:SetValue( EMA.db.slaveMirrorMasterAccept ) + EMA.settingsControl.checkBoxDoNotAutoAccept:SetValue( EMA.db.doNotAutoAccept ) + EMA.settingsControl.checkBoxAllAcceptAnyQuest:SetValue( EMA.db.allAcceptAnyQuest ) + EMA.settingsControl.checkBoxOnlyAcceptQuestsFrom:SetValue( EMA.db.onlyAcceptQuestsFrom ) + EMA.settingsControl.checkBoxAcceptFromTeam:SetValue( EMA.db.acceptFromTeam ) + EMA.settingsControl.checkBoxAcceptFromNpc:SetValue( EMA.db.acceptFromNpc ) + EMA.settingsControl.checkBoxAcceptFromFriends:SetValue( EMA.db.acceptFromFriends ) + EMA.settingsControl.checkBoxAcceptFromParty:SetValue( EMA.db.acceptFromParty ) + EMA.settingsControl.checkBoxAcceptFromRaid:SetValue( EMA.db.acceptFromRaid ) + EMA.settingsControl.checkBoxAcceptFromGuild:SetValue( EMA.db.acceptFromGuild ) + EMA.settingsControl.checkBoxMasterAutoShareQuestOnAccept:SetValue( EMA.db.masterAutoShareQuestOnAccept ) + EMA.settingsControl.checkBoxMinionAutoAcceptEscortQuest:SetValue( EMA.db.slaveAutoAcceptEscortQuest ) + EMA.settingsControl.checkBoxShowEMAQuestLogWithWoWQuestLog:SetValue( EMA.db.showEMAQuestLogWithWoWQuestLog ) + EMA.settingsControl.checkBoxOverrideQuestAutoSelectAndComplete:SetValue( EMA.db.overrideQuestAutoSelectAndComplete ) + EMA.settingsControl.dropdownMessageArea:SetValue( EMA.db.messageArea ) + EMA.settingsControl.dropdownWarningArea:SetValue( EMA.db.warningArea ) + -- Quest completion options. + EMA.settingsControlCompletion.checkBoxEnableAutoQuestCompletion:SetValue( EMA.db.enableAutoQuestCompletion ) + EMA.settingsControlCompletion.checkBoxNoChoiceAllDoNothing:SetValue( EMA.db.noChoiceAllDoNothing ) + EMA.settingsControlCompletion.checkBoxNoChoiceMinionCompleteQuestWithMaster:SetValue( EMA.db.noChoiceSlaveCompleteQuestWithMaster ) + EMA.settingsControlCompletion.checkBoxNoChoiceAllAutoCompleteQuest:SetValue( EMA.db.noChoiceAllAutoCompleteQuest ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionDoNothing:SetValue( EMA.db.hasChoiceSlaveDoNothing ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionCompleteQuestWithMaster:SetValue( EMA.db.hasChoiceSlaveCompleteQuestWithMaster ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionChooseSameRewardAsMaster:SetValue( EMA.db.hasChoiceSlaveChooseSameRewardAsMaster ) + EMA.settingsControlCompletion.checkBoxHasChoiceAquireBestQuestRewardForCharacter:SetValue ( EMA.db.hasChoiceAquireBestQuestRewardForCharacter ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionMustChooseOwnReward:SetValue( EMA.db.hasChoiceSlaveMustChooseOwnReward ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionRewardChoiceModifierConditional:SetValue( EMA.db.hasChoiceSlaveRewardChoiceModifierConditional ) + EMA.settingsControlCompletion.checkBoxHasChoiceCtrlKeyModifier:SetValue( EMA.db.hasChoiceCtrlKeyModifier ) + EMA.settingsControlCompletion.checkBoxHasChoiceShiftKeyModifier:SetValue( EMA.db.hasChoiceShiftKeyModifier ) + EMA.settingsControlCompletion.checkBoxHasChoiceAltKeyModifier:SetValue( EMA.db.hasChoiceAltKeyModifier ) + EMA.settingsControlCompletion.checkBoxHasChoiceOverrideUseMinionRewardSelected:SetValue( EMA.db.hasChoiceOverrideUseSlaveRewardSelected ) + -- Ensure correct state (general and acceptance options). + EMA.settingsControl.checkBoxMinionMirrorMasterAccept:SetDisabled( not EMA.db.acceptQuests ) + EMA.settingsControl.checkBoxDoNotAutoAccept:SetDisabled( not EMA.db.acceptQuests ) + EMA.settingsControl.checkBoxAllAcceptAnyQuest:SetDisabled( not EMA.db.acceptQuests ) + EMA.settingsControl.checkBoxOnlyAcceptQuestsFrom:SetDisabled( not EMA.db.acceptQuests ) + EMA.settingsControl.checkBoxAcceptFromTeam:SetDisabled( not EMA.db.acceptQuests or not EMA.db.onlyAcceptQuestsFrom ) + EMA.settingsControl.checkBoxAcceptFromNpc:SetDisabled( not EMA.db.acceptQuests or not EMA.db.onlyAcceptQuestsFrom ) + EMA.settingsControl.checkBoxAcceptFromFriends:SetDisabled( not EMA.db.acceptQuests or not EMA.db.onlyAcceptQuestsFrom ) + EMA.settingsControl.checkBoxAcceptFromParty:SetDisabled( not EMA.db.acceptQuests or not EMA.db.onlyAcceptQuestsFrom ) + EMA.settingsControl.checkBoxAcceptFromRaid:SetDisabled( not EMA.db.acceptQuests or not EMA.db.onlyAcceptQuestsFrom ) + EMA.settingsControl.checkBoxAcceptFromGuild:SetDisabled( not EMA.db.acceptQuests or not EMA.db.onlyAcceptQuestsFrom ) + -- Ensure correct state (completion options). + EMA.settingsControlCompletion.checkBoxNoChoiceAllDoNothing:SetDisabled( not EMA.db.enableAutoQuestCompletion ) + EMA.settingsControlCompletion.checkBoxNoChoiceMinionCompleteQuestWithMaster:SetDisabled( not EMA.db.enableAutoQuestCompletion ) + EMA.settingsControlCompletion.checkBoxNoChoiceAllAutoCompleteQuest:SetDisabled( not EMA.db.enableAutoQuestCompletion ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionDoNothing:SetDisabled( not EMA.db.enableAutoQuestCompletion ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionCompleteQuestWithMaster:SetDisabled( not EMA.db.enableAutoQuestCompletion ) + + EMA.settingsControlCompletion.checkBoxHasChoiceMinionChooseSameRewardAsMaster:SetDisabled( not EMA.db.enableAutoQuestCompletion or not EMA.db.hasChoiceSlaveCompleteQuestWithMaster ) + EMA.settingsControlCompletion.checkBoxHasChoiceAquireBestQuestRewardForCharacter:SetDisabled( not EMA.db.enableAutoQuestCompletion or not EMA.db.hasChoiceSlaveCompleteQuestWithMaster ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionMustChooseOwnReward:SetDisabled( not EMA.db.enableAutoQuestCompletion or not EMA.db.hasChoiceSlaveCompleteQuestWithMaster ) + EMA.settingsControlCompletion.checkBoxHasChoiceMinionRewardChoiceModifierConditional:SetDisabled( not EMA.db.enableAutoQuestCompletion or not EMA.db.hasChoiceSlaveCompleteQuestWithMaster ) + + EMA.settingsControlCompletion.checkBoxHasChoiceCtrlKeyModifier:SetDisabled( not EMA.db.enableAutoQuestCompletion or not EMA.db.hasChoiceSlaveCompleteQuestWithMaster or not EMA.db.hasChoiceSlaveRewardChoiceModifierConditional ) + EMA.settingsControlCompletion.checkBoxHasChoiceShiftKeyModifier:SetDisabled( not EMA.db.enableAutoQuestCompletion or not EMA.db.hasChoiceSlaveCompleteQuestWithMaster or not EMA.db.hasChoiceSlaveRewardChoiceModifierConditional ) + EMA.settingsControlCompletion.checkBoxHasChoiceAltKeyModifier:SetDisabled( not EMA.db.enableAutoQuestCompletion or not EMA.db.hasChoiceSlaveCompleteQuestWithMaster or not EMA.db.hasChoiceSlaveRewardChoiceModifierConditional ) + EMA.settingsControlCompletion.checkBoxHasChoiceOverrideUseMinionRewardSelected:SetDisabled( not EMA.db.enableAutoQuestCompletion or not EMA.db.hasChoiceSlaveCompleteQuestWithMaster ) +end + +function EMA:SettingsPushSettingsClick( event ) + EMA:EMASendSettings() +end + +function EMA:SettingsToggleMirrorMasterQuestSelectionAndDeclining( event, checked ) + EMA.db.mirrorMasterQuestSelectionAndDeclining = checked + EMA.db.allAutoSelectQuests = not checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleAllAutoSelectQuests( event, checked ) + EMA.db.allAutoSelectQuests = checked + EMA.db.mirrorMasterQuestSelectionAndDeclining = not checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleAcceptQuests( event, checked ) + EMA.db.acceptQuests = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleMinionMirrorMasterAccept( event, checked ) + EMA.db.slaveMirrorMasterAccept = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleOverrideQuestAutoSelectAndComplete( event, checked ) + EMA.db.overrideQuestAutoSelectAndComplete = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleDoNotAutoAccept( event, checked ) + EMA.db.doNotAutoAccept = checked + EMA.db.allAcceptAnyQuest = not checked + EMA.db.onlyAcceptQuestsFrom = not checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleAllAcceptAnyQuest( event, checked ) + EMA.db.allAcceptAnyQuest = checked + EMA.db.onlyAcceptQuestsFrom = not checked + EMA.db.doNotAutoAccept = not checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleOnlyAcceptQuestsFrom( event, checked ) + EMA.db.onlyAcceptQuestsFrom = checked + EMA.db.allAcceptAnyQuest = not checked + EMA.db.doNotAutoAccept = not checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleAcceptFromTeam( event, checked ) + EMA.db.acceptFromTeam = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleAcceptFromNpc( event, checked ) + EMA.db.acceptFromNpc = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleAcceptFromFriends( event, checked ) + EMA.db.acceptFromFriends = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleAcceptFromParty( event, checked ) + EMA.db.acceptFromParty = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleAcceptFromRaid( event, checked ) + EMA.db.acceptFromRaid = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleAcceptFromGuild( event, checked ) + EMA.db.acceptFromGuild = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleMasterAutoShareQuestOnAccept( event, checked ) + EMA.db.masterAutoShareQuestOnAccept = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleMinionAutoAcceptEscortQuest( event, checked ) + EMA.db.slaveAutoAcceptEscortQuest = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleShowEMAQuestLogWithWoWQuestLog( event, checked ) + EMA.db.showEMAQuestLogWithWoWQuestLog = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleEnableAutoQuestCompletion( event, checked ) + EMA.db.enableAutoQuestCompletion = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleNoChoiceAllDoNothing( event, checked ) + EMA.db.noChoiceAllDoNothing = checked + EMA.db.noChoiceSlaveCompleteQuestWithMaster = not checked + EMA.db.noChoiceAllAutoCompleteQuest = not checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleNoChoiceMinionCompleteQuestWithMaster( event, checked ) + EMA.db.noChoiceSlaveCompleteQuestWithMaster = checked + EMA.db.noChoiceAllDoNothing = not checked + EMA.db.noChoiceAllAutoCompleteQuest = not checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleNoChoiceAllAutoCompleteQuest( event, checked ) + EMA.db.noChoiceAllAutoCompleteQuest = checked + EMA.db.noChoiceAllDoNothing = not checked + EMA.db.noChoiceSlaveCompleteQuestWithMaster = not checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleHasChoiceMinionDoNothing( event, checked ) + EMA.db.hasChoiceSlaveDoNothing = checked + if checked ~= false then + EMA.db.hasChoiceSlaveCompleteQuestWithMaster = not checked + EMA.db.hasChoiceSlaveMustChooseOwnReward = not checked + EMA.db.hasChoiceAquireBestQuestRewardForCharacter = not checked + EMA.db.hasChoiceSlaveRewardChoiceModifierConditional = not checked + end + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleHasChoiceMinionCompleteQuestWithMaster( event, checked ) + EMA.db.hasChoiceSlaveCompleteQuestWithMaster = checked + if checked ~= false then + EMA.db.hasChoiceSlaveDoNothing = not checked + EMA.db.hasChoiceSlaveMustChooseOwnReward = not checked + EMA.db.hasChoiceAquireBestQuestRewardForCharacter = not checked + EMA.db.hasChoiceSlaveRewardChoiceModifierConditional = not checked + end + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleHasChoiceAquireBestQuestRewardForCharacter( event, checked ) + --EMA:Print("test") + EMA.db.hasChoiceAquireBestQuestRewardForCharacter = checked + if checked ~= false then + EMA.db.hasChoiceSlaveMustChooseOwnReward = not checked + EMA.db.hasChoiceSlaveChooseSameRewardAsMaster = not checked + EMA.db.hasChoiceSlaveRewardChoiceModifierConditional = not checked + end + + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleHasChoiceMinionChooseSameRewardAsMaster( event, checked ) + EMA.db.hasChoiceSlaveChooseSameRewardAsMaster = checked + if checked ~= false then + EMA.db.hasChoiceSlaveMustChooseOwnReward = not checked + EMA.db.hasChoiceAquireBestQuestRewardForCharacter = not checked + EMA.db.hasChoiceSlaveRewardChoiceModifierConditional = not checked + end + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleHasChoiceMinionMustChooseOwnReward( event, checked ) + EMA.db.hasChoiceSlaveMustChooseOwnReward = checked + if checked ~= false then + EMA.db.hasChoiceSlaveChooseSameRewardAsMaster = not checked + EMA.db.hasChoiceAquireBestQuestRewardForCharacter = not checked + EMA.db.hasChoiceSlaveRewardChoiceModifierConditional = not checked + end + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleHasChoiceMinionRewardChoiceModifierConditional( event, checked ) + EMA.db.hasChoiceSlaveRewardChoiceModifierConditional = checked + if checked ~= false then + EMA.db.hasChoiceSlaveChooseSameRewardAsMaster = not checked + EMA.db.hasChoiceSlaveMustChooseOwnReward = not checked + EMA.db.hasChoiceAquireBestQuestRewardForCharacter = not checked + end + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleHasChoiceCtrlKeyModifier( event, checked ) + EMA.db.hasChoiceCtrlKeyModifier = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleHasChoiceShiftKeyModifier( event, checked ) + EMA.db.hasChoiceShiftKeyModifier = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleHasChoiceAltKeyModifier( event, checked ) + EMA.db.hasChoiceAltKeyModifier = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleHasChoiceOverrideUseMinionRewardSelected( event, checked ) + EMA.db.hasChoiceOverrideUseSlaveRewardSelected = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsSetMessageArea( event, messageAreaValue ) + EMA:DebugMessage( event, messageAreaValue ) + EMA.db.messageArea = messageAreaValue + EMA:SettingsRefresh() +end + +function EMA:SettingsSetWarningArea( event, messageAreaValue ) + EMA.db.warningArea = messageAreaValue + EMA:SettingsRefresh() +end + +------------------------------------------------------------------------------------------------------------- +-- NPC QUEST PROCESSING - SELECTING AND DECLINING +------------------------------------------------------------------------------------------------------------- + +function EMA:ChurnNpcGossip() + EMA:DebugMessage( "ChurnNpcGossip" ) + -- GetGossipAvailableQuests and GetGossipActiveQuests are returning nil in some cases, so do this as well. + -- GetGossipAvailableQuests() now returns 6 elements per quest and GetGossipActiveQuests() returns 4. title, level, isTrivial, isDaily, ... + -- Patch 5.0.4 added isLegendary. + -- title1, level1, isLowLevel1, isDaily1, isRepeatable1, isLegendary1, title2, level2, isLowLevel2, isDaily2, isRepeatable2, isLegendary2 = GetGossipAvailableQuests() + -- title1, level1, isLowLevel1, isComplete1, isLegendary1, title2, level2, isLowLevel2, isComplete2, isLegendary2 = GetGossipActiveQuests() + local numberAvailableQuestInfo = 6 + local numberActiveQuestInfo = 5 + local index + EMA:DebugMessage( "GetNumAvailableQuests", GetNumAvailableQuests() ) + EMA:DebugMessage( "GetNumActiveQuests", GetNumActiveQuests() ) + EMA:DebugMessage( "GetGossipAvailableQuests", GetGossipAvailableQuests() ) + EMA:DebugMessage( "GetGossipActiveQuests", GetGossipActiveQuests() ) + for index = 0, GetNumAvailableQuests() do + SelectAvailableQuest( index ) + end + for index = 0, GetNumActiveQuests() do + SelectActiveQuest( index ) + end + EMAUtilities:ClearTable( EMA.gossipQuests ) + local availableQuestsData = { GetGossipAvailableQuests() } + local iterateQuests = 1 + local questIndex = 1 + while( availableQuestsData[iterateQuests] ) do + local questInformation = {} + questInformation.type = "available" + questInformation.index = questIndex + questInformation.name = availableQuestsData[iterateQuests] + questInformation.level = availableQuestsData[iterateQuests + 1] + table.insert( EMA.gossipQuests, questInformation ) + iterateQuests = iterateQuests + numberAvailableQuestInfo + questIndex = questIndex + 1 + end + local activeQuestsData = { GetGossipActiveQuests() } + iterateQuests = 1 + while( activeQuestsData[iterateQuests] ) do + local questInformation = {} + questInformation.type = "active" + questInformation.index = questIndex + questInformation.name = activeQuestsData[iterateQuests] + questInformation.level = activeQuestsData[iterateQuests + 1] + questInformation.isComplete = activeQuestsData[iterateQuests + 3] + table.insert( EMA.gossipQuests, questInformation ) + iterateQuests = iterateQuests + numberActiveQuestInfo + questIndex = questIndex + 1 + end + for index, questInformation in ipairs( EMA.gossipQuests ) do + if questInformation.type == "available" then + SelectGossipAvailableQuest( questInformation.index ) + end + -- If this is an active quest... + if questInformation.type == "active" then + -- If this quest has been completed... + if questInformation.isComplete then + -- Complete it. + SelectGossipActiveQuest( questInformation.index ) + end + end + end + +end + +function EMA:CanAutomateAutoSelectAndComplete() + if EMA.db.overrideQuestAutoSelectAndComplete == true then + if IsShiftKeyDown() then + return false + else + return true + end + end + return true + end + +function EMA:GOSSIP_SHOW() + if EMA.db.allAutoSelectQuests == true and EMA:CanAutomateAutoSelectAndComplete() == true then + EMA:ChurnNpcGossip() + end +end + +function EMA:QUEST_GREETING() + if EMA.db.allAutoSelectQuests == true and EMA:CanAutomateAutoSelectAndComplete() == true then + EMA:ChurnNpcGossip() + end +end + +function EMA:QUEST_PROGRESS() + if EMA.db.allAutoSelectQuests == true and EMA:CanAutomateAutoSelectAndComplete() == true then + if IsQuestCompletable() then + + if QuestFrame:IsShown() == true then + EMA.isInternalCommand = true + CompleteQuest() + EMA.isInternalCommand = false + else + EMA:Print( "NO QUEST PAGE CAN NOT HAND IN" ) + end + end + end +end + +function EMA:SelectGossipOption( gossipIndex ) + if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then + if EMA.isInternalCommand == false then + EMA:DebugMessage( "SelectGossipOption" ) + EMA:EMASendCommandToTeam( EMA.COMMAND_SELECT_GOSSIP_OPTION, gossipIndex ) + end + end +end + +function EMA:DoSelectGossipOption( sender, gossipIndex ) + if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then + EMA.isInternalCommand = true + EMA:DebugMessage( "DoSelectGossipOption" ) + SelectGossipOption( gossipIndex ) + EMA.isInternalCommand = false + end +end + +function EMA:SelectGossipActiveQuest( gossipIndex ) + if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then + if EMA.isInternalCommand == false then + EMA:DebugMessage( "SelectGossipActiveQuest" ) + EMA:EMASendCommandToTeam( EMA.COMMAND_SELECT_GOSSIP_ACTIVE_QUEST, gossipIndex ) + end + end +end + +function EMA:DoSelectGossipActiveQuest( sender, gossipIndex ) + if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then + EMA.isInternalCommand = true + EMA:DebugMessage( "DoSelectGossipActiveQuest" ) + SelectGossipActiveQuest( gossipIndex ) + EMA.isInternalCommand = false + end +end + +function EMA:SelectGossipAvailableQuest( gossipIndex ) + if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then + if EMA.isInternalCommand == false then + EMA:DebugMessage( "SelectGossipAvailableQuest" ) + EMA:EMASendCommandToTeam( EMA.COMMAND_SELECT_GOSSIP_AVAILABLE_QUEST, gossipIndex ) + end + end +end + +function EMA:DoSelectGossipAvailableQuest( sender, gossipIndex ) + if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then + EMA.isInternalCommand = true + EMA:DebugMessage( "DoSelectGossipAvailableQuest" ) + SelectGossipAvailableQuest( gossipIndex ) + EMA.isInternalCommand = false + end +end + +function EMA:SelectActiveQuest( questIndex ) + if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then + if EMA.isInternalCommand == false then + EMA:DebugMessage( "SelectActiveQuest" ) + EMA:EMASendCommandToTeam( EMA.COMMAND_SELECT_ACTIVE_QUEST, questIndex ) + end + end +end + +function EMA:DoSelectActiveQuest( sender, questIndex ) + if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then + EMA.isInternalCommand = true + EMA:DebugMessage( "DoSelectActiveQuest" ) + SelectActiveQuest( questIndex ) + EMA.isInternalCommand = false + end +end + +function EMA:SelectAvailableQuest( questIndex ) + if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then + if EMA.isInternalCommand == false then + EMA:DebugMessage( "SelectAvailableQuest" ) + EMA:EMASendCommandToTeam( EMA.COMMAND_SELECT_AVAILABLE_QUEST, questIndex ) + end + end +end + +function EMA:DoSelectAvailableQuest( sender, questIndex ) + if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then + EMA.isInternalCommand = true + EMA:DebugMessage( "DoSelectAvailableQuest" ) + SelectAvailableQuest( questIndex ) + EMA.isInternalCommand = false + end +end + +function EMA:QUEST_FINISHED(...) + if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then + if EMA.isInternalCommand == false then + --EMA:Print( "DeclineQuest" ) + EMA:DebugMessage( "DeclineQuest" ) + EMA:ScheduleTimer("EMASendCommandToTeam", 0.5, EMA.COMMAND_DECLINE_QUEST ) + end + end +end + +function EMA:DoDeclineQuest( sender ) + if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then + --EMA:Print("DoDeclineQuest", sender ) + EMA.isInternalCommand = true + EMA:DebugMessage( "DoDeclineQuest" ) + HideUIPanel(QuestFrame) + EMA.isInternalCommand = false + end +end + +------------------------------------------------------------------------------------------------------------- +-- NPC QUEST PROCESSING - COMPLETING +------------------------------------------------------------------------------------------------------------- + +function EMA:CompleteQuest() + if EMA.db.enableAutoQuestCompletion == true then + if EMA.isInternalCommand == false then + EMA:DebugMessage( "CompleteQuest" ) + EMA:EMASendCommandToTeam( EMA.COMMAND_COMPLETE_QUEST ) + end + end +end + +function EMA:DoCompleteQuest( sender ) + if EMA.db.enableAutoQuestCompletion == true then + EMA.isInternalCommand = true + EMA:DebugMessage( "DoCompleteQuest" ) + CompleteQuest() + EMA.isInternalCommand = false + end +end + +function EMA:QUEST_COMPLETE() + EMA:DebugMessage( "QUEST_COMPLETE" ) + if EMA.db.enableAutoQuestCompletion == true then + if EMA.db.hasChoiceAquireBestQuestRewardForCharacter == true then + EMA:ChooseBestRewardForCharacter() + elseif (EMA.db.hasChoiceAquireBestQuestRewardForCharacter == true) and (GetNumQuestChoices() > 1) then + local bestQuestItemIndex = nil + if bestQuestItemIndex ~= nil and bestQuestItemIndex > 0 then + local questItemChoice = _G["QuestInfoItem"..bestQuestItemIndex] + QuestInfoItem_OnClick( questItemChoice ) + QuestInfoFrame.itemChoice = bestQuestItemIndex + if EMA.db.hasChoiceAquireBestQuestRewardForCharacterAndGet == true then + GetQuestReward( bestQuestItemIndex ) + end + end + elseif (EMA.db.noChoiceAllAutoCompleteQuest == true) and (GetNumQuestChoices() <= 1) then + GetQuestReward( GetNumQuestChoices() ) + end + end +end + + +function EMA:QUEST_FAIL( event, message, ... ) + --EMA:Print("QUEST_FAIL", message ) + local questName = GetTitleText() + if questName ~= nil then + local questInvFull = string.format( ERR_QUEST_FAILED_BAG_FULL_S, questName ) + --EMA:Print("A", questInvFull ) + if message == questInvFull then + --EMA:Print("test") + EMA:EMASendMessageToTeam( EMA.db.warningArea, L["INVENTORY_IS_FULL_CAN_NOT_HAND_IN_QUEST"]( questName ), false ) + end + end +end + +------------------------------------------------------------------------------------------------------------- +-- IN THE FIELD QUEST PROCESSING - COMPLETING +------------------------------------------------------------------------------------------------------------- + +function EMA:ShowQuestComplete( questIndex ) + EMA:DebugMessage( "ShowQuestComplete" ) + if EMA.db.enableAutoQuestCompletion == false then + return + end + if EMA.isInternalCommand == true then + return + end + local questName = select( 1, GetQuestLogTitle( questIndex ) ) + EMA:EMASendCommandToTeam( EMA.COMMAND_LOG_COMPLETE_QUEST, questName ) +end + +function EMA:DoShowQuestComplete( sender, questName ) + EMA:DebugMessage( "DoShowQuestComplete" ) + if EMA.db.enableAutoQuestCompletion == false then + return + end + EMA.isInternalCommand = true + local questIndex = EMA:GetQuestLogIndexByName( questName ) + if questIndex ~= 0 then + ShowQuestComplete( questIndex ) + end + EMA.isInternalCommand = false +end + +------------------------------------------------------------------------------------------------------------- +-- NPC QUEST PROCESSING - REWARDS +------------------------------------------------------------------------------------------------------------- + +function EMA:CheckForOverrideAndChooseQuestReward( questIndex ) + -- Yes, override if minion has reward selected? + if (EMA.db.hasChoiceOverrideUseSlaveRewardSelected == true) and (QuestInfoFrame.itemChoice > 0) then + -- Yes, choose minions reward. + GetQuestReward( QuestInfoFrame.itemChoice ) + else + -- No, choose masters reward. + GetQuestReward( questIndex ) + end +end + +function EMA:CheckForOverrideAndDoNotChooseQuestReward( questIndex ) + -- Yes, override if minion has reward selected? + if QuestInfoFrame.itemChoice ~= nil then + if (EMA.db.hasChoiceOverrideUseSlaveRewardSelected == true) and (QuestInfoFrame.itemChoice > 0) then + -- Yes, choose minions reward. + GetQuestReward( QuestInfoFrame.itemChoice ) + end + end +end + +function EMA:AreCorrectConditionalKeysPressed() + local failTest = false + if EMA.db.hasChoiceCtrlKeyModifier == true and not IsControlKeyDown() then + failTest = true + end + if EMA.db.hasChoiceShiftKeyModifier == true and not IsShiftKeyDown() then + failTest = true + end + if EMA.db.hasChoiceAltKeyModifier == true and not IsAltKeyDown() then + failTest = true + end + return not failTest +end + +function EMA:GetQuestReward( questIndex ) + if EMA.db.enableAutoQuestCompletion == true then + if (EMA.db.noChoiceSlaveCompleteQuestWithMaster == true) or (EMA.db.hasChoiceSlaveCompleteQuestWithMaster == true) or (EMA.db.hasChoiceAquireBestQuestRewardForCharacter == true) then + if EMA.isInternalCommand == false then + EMA:DebugMessage( "GetQuestReward" ) + EMA:EMASendCommandToTeam( EMA.COMMAND_CHOOSE_QUEST_REWARD, questIndex, EMA:AreCorrectConditionalKeysPressed(), EMA.db.hasChoiceAquireBestQuestRewardForCharacter ) + end + end + end +end + +function EMA:DoChooseQuestReward( sender, questIndex, modifierKeysPressed, rewardPickedAlready ) + local numberOfQuestRewards = GetNumQuestChoices() + if EMA.db.enableAutoQuestCompletion == true then + if (EMA.db.noChoiceSlaveCompleteQuestWithMaster == true) or (EMA.db.hasChoiceSlaveCompleteQuestWithMaster == true) or (EMA.db.hasChoiceAquireBestQuestRewardForCharacter == true) then + EMA.isInternalCommand = true + EMA:DebugMessage( "DoChooseQuestReward" ) + EMA:DebugMessage( "Quest has ", numberOfQuestRewards, " reward choices." ) + -- How many reward choices does this quest have? + if numberOfQuestRewards <= 1 then + -- One or less. + if EMA.db.noChoiceSlaveCompleteQuestWithMaster == true then + QuestInfoFrame.itemChoice = 1 + --GetQuestReward( 1 ) + GetQuestReward( QuestInfoFrame.itemChoice ) + end + else + -- More than one. + if EMA.db.hasChoiceSlaveCompleteQuestWithMaster == true then + -- Choose same as master? + if EMA.db.hasChoiceSlaveChooseSameRewardAsMaster == true then + EMA:CheckForOverrideAndChooseQuestReward( questIndex ) + -- Choose same as master, conditional keys? + elseif EMA.db.hasChoiceSlaveRewardChoiceModifierConditional == true then + if modifierKeysPressed == true then + EMA:CheckForOverrideAndChooseQuestReward( questIndex ) + else + EMA:CheckForOverrideAndDoNotChooseQuestReward( questIndex ) + end + end + end + if (EMA.db.hasChoiceAquireBestQuestRewardForCharacter == true) and (rewardPickedAlready == true) then + if QuestInfoFrame.itemChoice > 0 then + -- Yes, choose minions reward. + GetQuestReward( QuestInfoFrame.itemChoice ) + end + end + end + EMA.isInternalCommand = false + end + end +end + +function EMA:ChooseBestRewardForCharacter() + -- Idea by loop: http://www.dual-boxing.com/showpost.php?p=257610&postcount=1505 + -- Choose the best item for this character, otherwise choose the most valuable to vendor: + -- Fixed for classic/tbc by ebony + local numberOfQuestRewards = GetNumQuestChoices() + local mostValuableQuestItemIndex, mostValuableQuestItemValue, bestQuestItemIndex, bestQuestItemArmorWeight = 1, 0, -1, -1 + local name = nil + local armorWeights = { Plate = 4, Mail = 2, Leather = 1, Cloth = 0 } + -- Yanked this from LibItemUtils; sucks that we need this lookup table, but GetItemInfo only + -- returns an equipment location, which must first be converted to a slot value that GetInventoryItemLink understands: + local equipmentSlotLookup = { + INVTYPE_HEAD = {"HeadSlot", nil}, + INVTYPE_NECK = {"NeckSlot", nil}, + INVTYPE_SHOULDER = {"ShoulderSlot", nil}, + INVTYPE_CLOAK = {"BackSlot", nil}, + INVTYPE_CHEST = {"ChestSlot", nil}, + INVTYPE_WRIST = {"WristSlot", nil}, + INVTYPE_HAND = {"HandsSlot", nil}, + INVTYPE_WAIST = {"WaistSlot", nil}, + INVTYPE_LEGS = {"LegsSlot", nil}, + INVTYPE_FEET = {"FeetSlot", nil}, + INVTYPE_SHIELD = {"SecondaryHandSlot", nil}, + INVTYPE_ROBE = {"ChestSlot", nil}, + INVTYPE_2HWEAPON = {"MainHandSlot", "SecondaryHandSlot"}, + INVTYPE_WEAPONMAINHAND = {"MainHandSlot", nil}, + INVTYPE_WEAPONOFFHAND = {"SecondaryHandSlot", "MainHandSlot"}, + INVTYPE_WEAPON = {"MainHandSlot","SecondaryHandSlot"}, + INVTYPE_THROWN = {"RangedSlot", nil}, + INVTYPE_RANGED = {"RangedSlot", nil}, + INVTYPE_RANGEDRIGHT = {"RangedSlot", nil}, + INVTYPE_FINGER = {"Finger0Slot", "Finger1Slot"}, + INVTYPE_HOLDABLE = {"SecondaryHandSlot", "MainHandSlot"}, + INVTYPE_TRINKET = {"Trinket0Slot", "Trinket1Slot"} + } + + for questItemIndex = 1, numberOfQuestRewards do + local itemName, itemLink, itemRarity, itemLevel, itemMinLevel, itemType, itemSubType, itemStackCount, itemEquipLoc, itemTexture, itemSellPrice = GetItemInfo(GetQuestItemLink("choice", questItemIndex)) + --EMA:Print("PickReward", itemName, itemRarity ) + -- If there is a rare item as a reward, bail and let the player choose. + if itemRarity >= 3 then + return + end + local itemId = itemLink:match("|Hitem:(%d+)") + local isItemEquippable = IsEquippableItem(itemId) + local _, _, _, _, isItemUsable = GetQuestItemInfo("choice", questItemIndex) + + if itemSellPrice > mostValuableQuestItemValue then + -- Keep track of which item is most valuable: + mostValuableQuestItemIndex = questItemIndex + mostValuableQuestItemValue = itemSellPrice + end + --EMA:Print("Sell", itemSellPrice,mostValuableQuestItemValue ) + --EMA:Print("testcanuse", isItemEquippable,isItemUsable ) + if isItemEquippable == true and isItemUsable ~= nil then + -- NPC is offering us an item we can actually wear: + local currentEquippedItemLinksInSlots = {} + local currentWorstEquippedItemInSlot = nil + + -- Figure out what we already have equipped: + for _, itemSlot in ipairs(equipmentSlotLookup[itemEquipLoc]) do + if itemSlot ~= nil then + local currentEquippedItemLinkInSlot = GetInventoryItemLink("player", GetInventorySlotInfo(itemSlot)) + + if currentEquippedItemLinkInSlot == nil then + -- Of the n item slots available, at least one of them has nothing equipped. Ergo, it is the worst: + currentWorstEquippedItemInSlot = nil + break + else + -- There's an item in this slot, get some details on it: + local _, _, _, currentEquippedItemLevelInSlot, _, _, currentEquippedItemSubTypeInSlot = GetItemInfo(currentEquippedItemLinkInSlot) + + -- We haven't yet determined the worst item, or the item we see in this slot happens to be worse than the other item + -- we saw in this partner slot (ie. a ring in one slot is worse than a ring in another slot): + if currentWorstEquippedItemInSlot == nil or currentWorstEquippedItemInSlot.itemLevel > currentEquippedItemLevelInSlot then + currentWorstEquippedItemInSlot = { + itemLink = currentEquippedItemLinkInSlot, + itemLevel = currentEquippedItemLevelInSlot, + itemSubType = currentEquippedItemSubTypeInSlot + } + end + end + end + end + + if currentWorstEquippedItemInSlot == nil then + -- We're not even wearing an item in this slot, and the vendor has something we can use, take it: + bestQuestItemIndex = questItemIndex + else + if itemLevel > currentWorstEquippedItemInSlot.itemLevel then + -- NPC is providing us with an better item than what we currently have in this slot: + if armorWeights[itemSubType] ~= nil then + -- Armor subtype is one which we care to select based on some priority order: + if armorWeights[itemSubType] > bestQuestItemArmorWeight then + -- If this piece of armor is a better subtype (ie. Plate is better than Cloth if we can wear it): + bestQuestItemIndex = questItemIndex + bestQuestItemArmorWeight = armorWeights[itemSubType] + end + elseif currentWorstEquippedItemInSlot.itemSubType == itemSubType then + -- This isn't a piece of armor (ie. might be a weapon) - only take it if it's the same + -- subtype as the item we are already wearing (if we're wearing a staff, and NPC offers + -- a staff and a dagger, we'll take the staff): + bestQuestItemIndex = questItemIndex + bestQuestItemArmorWeight = -1 + end + end + end + end + end + if bestQuestItemIndex < 0 then + -- If we haven't determined an item upgrade by now, just choose the one that we can vendor for the most gold: + bestQuestItemIndex = mostValuableQuestItemIndex + end + -- DebugCode + local _, name = GetItemInfo(GetQuestItemLink("choice", bestQuestItemIndex) ) + EMA:Print("PickQuestReward", bestQuestItemIndex, name ) + -- DoStuff + --GetQuestReward(bestQuestItemIndex) + +end + +------------------------------------------------------------------------------------------------------------- +-- NPC QUEST PROCESSING - ACCEPTING +------------------------------------------------------------------------------------------------------------- + +function EMA:QUEST_ACCEPTED( ... ) + local event, questIndex = ... + if EMA.db.acceptQuests == true then + if EMA.db.masterAutoShareQuestOnAccept == true then + if EMAApi.IsCharacterTheMaster( EMA.characterName ) == true then + if EMA.isInternalCommand == false then + SelectQuestLogEntry( questIndex ) + if GetQuestLogPushable() and GetNumSubgroupMembers() > 0 then + EMA:EMASendMessageToTeam( EMA.db.messageArea, "Pushing newly accepted quest.", false ) + QuestLogPushQuest() + end + end + end + end + end +end + +function EMA:AcceptQuest() + if EMA.db.acceptQuests == true then + if EMA.db.slaveMirrorMasterAccept == true then + if EMA.isInternalCommand == false then + EMA:DebugMessage( "AcceptQuest" ) + EMA:EMASendCommandToTeam( EMA.COMMAND_ACCEPT_QUEST ) + end + end + end +end + +function EMA:DoAcceptQuest( sender ) + if EMA.db.acceptQuests == true and EMA.db.slaveMirrorMasterAccept == true then + local questName = GetTitleText() + local questIndex = EMA:GetQuestLogIndexByName( questName ) + + --Only works if the quest frame is open. Stops sending a blank quest. Tell the team a char not got the quest window open???? <<<<<< TODO + if QuestFrame:IsShown() == true then + --EMA:Print( "DoAcceptQuest", questName, questIndex, sender) + EMA.isInternalCommand = true + EMA:DebugMessage( "DoAcceptQuest" ) + EMA:EMASendMessageToTeam( EMA.db.messageArea, L["ACCEPTED_QUEST_QN"]( questName ), false ) + AcceptQuest() + HideUIPanel( QuestFrame ) + AcceptQuest() + EMA.isInternalCommand = false + end + end +end + +-- Auto quest magic! +function EMA:AcknowledgeAutoAcceptQuest() + if EMA.db.acceptQuests == true then + if EMA.db.slaveMirrorMasterAccept == true then + if EMA.isInternalCommand == false then + EMA:DebugMessage( "MagicAutoAcceptQuestGrrrr", QuestGetAutoAccept() ) + EMA:EMASendCommandToTeam( EMA.COMMAND_ACCEPT_QUEST_FAKE ) + end + end + end +end + +function EMA:DoMagicAutoAcceptQuestGrrrr() + if EMA.db.acceptQuests == true and EMA.db.slaveMirrorMasterAccept == true and QuestFrame:IsVisible() then + local questIndex = EMA:GetQuestLogIndexByName( questName ) + EMA.isInternalCommand = true + EMA:DebugMessage( "DoMagicAutoAcceptQuestGrrrr" ) + EMA:EMASendMessageToTeam( EMA.db.messageArea, L["AUTO_ACCEPTED_PICKUPQUEST_QN"]( GetTitleText() ), false ) + -- AcknowledgeAutoAcceptQuest() + HideUIPanel( QuestFrame ) + EMA.isInternalCommand = false + end +end + +------------------------------------------------------------------------------------------------------------- +-- QUEST PROCESSING - AUTO ACCEPTING +------------------------------------------------------------------------------------------------------------- + +--TODO: this could do with some work with Friends. +function EMA:CanAutoAcceptSharedQuestFromPlayer() + local canAccept = false + if EMA.db.allAcceptAnyQuest == true then + canAccept = true + elseif EMA.db.onlyAcceptQuestsFrom == true then + local questSourceName, questSourceRealm = UnitName( "npc" ) + local character = EMAUtilities:AddRealmToNameIfNotNil( questSourceName, questSourceRealm ) + if EMA.db.acceptFromTeam == true then + if EMAApi.IsCharacterInTeam( character ) == true then + canAccept = true + end + end + if EMA.db.acceptFromFriends == true then + for friendIndex = 1, GetNumFriends() do + local friendName = GetFriendInfo( friendIndex ) + if questSourceName == friendName then + canAccept = true + break + end + end + end + if EMA.db.acceptFromParty == true then + if UnitInParty( "npc" ) then + EMA:DebugMessage( "test" ) + canAccept = true + end + end + if EMA.db.acceptFromRaid == true then + if UnitInRaid( "npc" ) then + canAccept = true + end + end + if EMA.db.acceptFromGuild == true then + if UnitIsInMyGuild( "npc" ) then + canAccept = true + end + end + end + return canAccept +end + +function EMA:QUEST_DETAIL() + EMA:DebugMessage( "QUEST_DETAIL" ) + if EMA.db.acceptQuests == true then + -- Who is this quest from. + if UnitIsPlayer( "npc" ) then + -- Quest is shared from a player. + if EMA:CanAutoAcceptSharedQuestFromPlayer() == true then + EMA.isInternalCommand = true + EMA:EMASendMessageToTeam( EMA.db.messageArea, L["AUTOMATICALLY_ACCEPTED_QUEST"]( GetTitleText() ), false ) + AcceptQuest() + EMA.isInternalCommand = false + end + else + -- Quest is from an NPC. + if (EMA.db.allAcceptAnyQuest == true) or ((EMA.db.onlyAcceptQuestsFrom == true) and (EMA.db.acceptFromNpc == true)) then + EMA.isInternalCommand = true + --EMA:DebugMessage( "QUEST_DETAIL - auto accept is: ", QuestGetAutoAccept() ) + EMA:EMASendMessageToTeam( EMA.db.messageArea, L["AUTOMATICALLY_ACCEPTED_QUEST"]( GetTitleText() ), false ) + AcceptQuest() + HideUIPanel( QuestFrame ) + EMA.isInternalCommand = false + end + end + end +end + +------------------------------------------------------------------------------------------------------------- +-- EMA QUEST CONTEXT MENU +------------------------------------------------------------------------------------------------------------- + +function EMA:QuestWatch_Update() + local lastQuestIndex = GetQuestLogSelection() + local title, _, _, _, _, _, _, questID = GetQuestLogTitle(lastQuestIndex) + EMA:Print("test", questID ) + if ( IsQuestWatched(lastQuestIndex) ) then + --EMA:Print("TrackingQuest") + EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_TRACK, questID, title, true ) + else + --EMA:Print("UnTrackQuest") + EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_TRACK, questID, title, false ) + end +end + +local function EMAApiAbandonQuests(questID, questText) + --EMA:Print(questID, questText) + title = questText + local data = {} + data.questID = questID + data.title = questText + StaticPopup_Hide( "ABANDON_QUEST" ) + StaticPopup_Hide( "ABANDON_QUEST_WITH_ITEMS" ) + StaticPopup_Show( "EMAQUEST_ABANDON_ALL_TOONS", title, nil, data ) +end + +local function EMAApiUnTrackQuests(questID, questText) + --EMA:Print("test", questID, questText) + EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_TRACK, questID, questText, false ) +end + +local function EMAApiTrackAllQuests() + EMA:DoTrackAllQuestsFromThisToon() + EMA:ScheduleTimer("EMASendCommandToTeam", 1, EMA.COMMAND_TRACK_ALL_QUESTS) +end + + +function EMA:AbandonQuest () + if EMAApi.GetTeamListMaximumOrderOnline() > 1 then + local lastQuestIndex = GetQuestLogSelection() + local _, _, _, _, _, _, _, questID = GetQuestLogTitle(lastQuestIndex) + --EMA:Print("SetAbandonQuest", lastQuestIndex, questID) + title = GetAbandonQuestName() + local data = {} + data.questID = questID + data.title = title + StaticPopup_Show( "EMAQUEST_ABANDON_ALL_TOONS", title, nil, data ) + end + +end + +function EMA:QuestObjectiveTracker_UntrackQuest(dropDownButton, questID) + --EMA:Print("test", questID) + EMA:QuestMapQuestOptions_TrackQuest(questID) +end + +function EMA:QuestMapQuestOptions_TrackQuest(questID) + if EMAApi.GetTeamListMaximumOrderOnline() > 1 then + --EMA:Print("test", questID) + local questLogIndex = GetQuestLogIndexByID(questID) + local title = GetQuestLogTitle( questLogIndex ) + local data = {} + data.questID = questID + data.title = title + if ( IsQuestWatched(questLogIndex) ) then + --EMA:Print("TrackingQuest") + StaticPopup_Show( "EMA_QUEST_TRACK_ALL_TOONS", title, nil, data ) + else + --EMA:Print("UnTrackQuest") + StaticPopup_Show( "EMA_QUEST_UNTRACK_ALL_TOONS", title, nil, data ) + end + end +end + +function EMA:QuestMapQuestOptions_EMA_DoQuestTrack( sender, questID, title, track ) + --EMA:Print("test1.5", sender, questID, title, track) + local questLogIndex = GetQuestLogIndexByID( questID ) + if questLogIndex ~= 0 then + if track then + isInternalCommand = true + EMA:EMADoQuest_TrackQuest( questID, questLogIndex ) + else + isInternalCommand = true + EMA:EMADoQuest_UnTrackQuest( questID, questLogIndex ) + end + else + -- EMA:EMASendMessageToTeam( EMA.db.messageArea, L["QUESTLOG_DO_NOT_HAVE_QUEST"]( title ), false ) + end +end + +function EMA:EMADoQuest_TrackQuest(questID, questLogIndex) + --EMA:Print("test", questID, questLogIndex ) + if EMA.isInternalCommand == false then + if ( not IsQuestWatched(questID) ) then + AddQuestWatch(questLogIndex, true) + AutoQuestWatch_Insert(questLogIndex, QUEST_WATCH_NO_EXPIRE) + QuestWatch_Update() + end + QuestLog_SetSelection(questLogIndex) + QuestLog_Update() + end +end + + +function EMA:EMADoQuest_UnTrackQuest(questID, questLogIndex) + --EMA:Print("test2", questID, questLogIndex ) + if ( IsQuestWatched(questLogIndex) ) then + RemoveQuestWatch(questLogIndex) + QuestWatch_Update() + end + QuestLog_SetSelection(questLogIndex) + QuestLog_Update() +end + +function EMA:QuestMapQuestOptions_EMA_DoAbandonQuest( sender, questID, title ) + local questLogIndex = GetQuestLogIndexByID( questID ) + if questLogIndex ~= 0 then + EMA:Unhook( "AbandonQuest" ) + local lastQuestIndex = GetQuestLogSelection(); + SelectQuestLogEntry(GetQuestLogIndexByID(questID)); + SetAbandonQuest(); + AbandonQuest(); + SelectQuestLogEntry(lastQuestIndex); + EMA:EMASendMessageToTeam( EMA.db.messageArea, L["QUESTLOG_HAVE_ABANDONED_QUEST"]( title ), false ) + EMA:SecureHook( "AbandonQuest" ) + end +end + +-- EMA ALL menu at the bottom of quest WorldMap Quest Log + + +function EMA:CreateEMAMiniQuestLogFrame() + EMAMiniQuestLogFrame = CreateFrame( "Frame", "EMAMiniQuestLogFrame", QuestLogFrame, BackdropTemplateMixin and "BackdropTemplate" or nil ) + local frame = EMAMiniQuestLogFrame + frame:SetWidth( 270 ) + frame:SetHeight( 80 ) + frame:SetFrameStrata( "HIGH" ) + frame:SetToplevel( true ) + frame:SetClampedToScreen( true ) + frame:EnableMouse( true ) + frame:SetMovable( true ) + frame:ClearAllPoints() + if IsAddOnLoaded("ElvUI" ) == true then + frame:SetPoint("BOTTOMLEFT", QuestLogFrame, "BOTTOMLEFT", 40, -80) + else + frame:SetPoint("BOTTOMLEFT", QuestLogFrame, "BOTTOMLEFT", 40, -30) + end + frame:SetBackdrop( { + bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", + edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", + tile = true, tileSize = 15, edgeSize = 15, + insets = { left = 5, right = 5, top = 5, bottom = 5 } + } ) + table.insert( UISpecialFrames, "EMAQuestLogWindowFrame" ) + -- Single Track Button + local singleTrackButton = CreateFrame( "Button", "singleTrackButton", frame, "UIPanelButtonTemplate" ) + singleTrackButton:SetScript( "OnClick", function() local lastQuestIndex = GetQuestLogSelection() local title, _, _, _, _, _, _, questID = GetQuestLogTitle(lastQuestIndex) EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_TRACK, questID, title, true ) end ) + singleTrackButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", 30 , -10) + singleTrackButton:SetHeight( 20 ) + singleTrackButton:SetWidth( 100 ) + singleTrackButton:SetText( L["TRACK_SINGLE_QUEST"] ) + singleTrackButton:SetScript("OnEnter", function(self) EMA:ShowTooltip(trackButton, true, L["TRACK_SINGLE_QUEST_TOOLTIP"]) end) + singleTrackButton:SetScript("OnLeave", function(self) GameTooltip:Hide() end) + singleTrackQuestLogWindowAbandonFrameButton = singleTrackButton + -- Single unTrack Button + local singleUnTrackButton = CreateFrame( "Button", "singleUnTrackButton", frame, "UIPanelButtonTemplate" ) + singleUnTrackButton:SetScript( "OnClick", function() local lastQuestIndex = GetQuestLogSelection() local title, _, _, _, _, _, _, questID = GetQuestLogTitle(lastQuestIndex) EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_TRACK, questID, title, false ) end ) + singleUnTrackButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", 140 , -10) + singleUnTrackButton:SetHeight( 20 ) + singleUnTrackButton:SetWidth( 120 ) + singleUnTrackButton:SetText( L["UNTRACK_SINGLE_QUEST"] ) + singleUnTrackButton:SetScript("OnEnter", function(self) EMA:ShowTooltip(trackButton, true, L["UNTRACK_SINGLE_QUEST_TOOLTIP"]) end) + singleUnTrackButton:SetScript("OnLeave", function(self) GameTooltip:Hide() end) + singleUnTrackQuestLogWindowAbandonFrameButton = singleUnTrackButton + -- abandon ALL button + local abandonButton = CreateFrame( "Button", "abandonButton", frame, "UIPanelButtonTemplate" ) + abandonButton:SetScript( "OnClick", function() StaticPopup_Show("EMA_ABANDON_ALL_TOON_QUEST") end ) + abandonButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", 10 , -30) + abandonButton:SetHeight( 20 ) + abandonButton:SetWidth( 150 ) + abandonButton:SetText( L["ABANDON_ALL"] ) + abandonButton:SetScript("OnEnter", function(self) EMA:ShowTooltip(trackButton, true, L["ABANDON_ALL_TOOLTIP"]) end) + abandonButton:SetScript("OnLeave", function(self) GameTooltip:Hide() end) + abandonQuestLogWindowAbandonFrameButton = abandonButton + -- Share All Button + local shareButton = CreateFrame( "Button", "shareButton", frame, "UIPanelButtonTemplate" ) + shareButton:SetScript( "OnClick", function() EMA:DoShareAllQuestsFromAllToons() end ) + shareButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", 160, -30) + shareButton:SetHeight( 20 ) + shareButton:SetWidth( 100 ) + shareButton:SetText( L["SHARE_ALL"] ) + shareButton:SetScript("OnEnter", function(self) EMA:ShowTooltip(shareButton, true, L["SHARE_ALL_TOOLTIP"]) end) + shareButton:SetScript("OnLeave", function(self) GameTooltip:Hide() end) + shareQuestLogWindowFrameShareButton = shareButton + --Track All Button + local trackButton = CreateFrame( "Button", "trackButton", frame, "UIPanelButtonTemplate" ) + trackButton:SetScript( "OnClick", function() EMA:DoTrackAllQuestsFromAllToons() end ) + trackButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", 35, -50) + trackButton:SetHeight( 20 ) + trackButton:SetWidth( 100 ) + trackButton:SetText( L["TRACK_ALL"] ) + trackButton:SetScript("OnEnter", function(self) EMA:ShowTooltip(trackButton, true, L["TRACK_ALL_TOOLTIP"]) end) + trackButton:SetScript("OnLeave", function(self) GameTooltip:Hide() end) + EMAQuestLogWindowFrameTrackButton = trackButton + -- Untrack All + local unTrackButton = CreateFrame( "Button", "unTrackButton", frame, "UIPanelButtonTemplate" ) + unTrackButton:SetScript( "OnClick", function() EMA:DoUnTrackAllQuestsFromAllToons() end ) + unTrackButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", 160, -50) + unTrackButton:SetHeight( 20 ) + unTrackButton:SetWidth( 100 ) + unTrackButton:SetText( L["UNTRACK_ALL"] ) + unTrackButton:SetScript("OnEnter", function(self) EMA:ShowTooltip(trackButton, true, L["UNTRACK_ALL_TOOLTIP"]) end) + unTrackButton:SetScript("OnLeave", function(self) GameTooltip:Hide() end) + EMAQuestLogWindowFrameUnTrackButton = unTrackButton +end + + +function EMA:ShowTooltip(frame, show, text) + if show then + GameTooltip:SetOwner(frame, "ANCHOR_TOP") + GameTooltip:SetPoint("TOPLEFT", frame, "TOPRIGHT", 16, 0) + GameTooltip:ClearLines() + GameTooltip:AddLine( text , 1, 0.82, 0, 1) + GameTooltip:Show() + else + GameTooltip:Hide() + end +end + +function EMA:DoAbandonAllQuestsFromAllToons() + EMA:EMASendMessageToTeam( EMA.db.messageArea, L["ABANDONING_ALLQUEST"], false ) + EMA:DoAbandonAllQuestsFromThisToon() + EMA:ScheduleTimer("EMASendCommandToTeam" , 2, EMA.COMMAND_ABANDON_ALL_QUESTS) +end + +function EMA:DoAbandonAllQuestsFromThisToon() + EMA.iterateQuests = 0 + EMA:IterateQuests("AbandonNextQuest", 0.5) +end + +function EMA.AbandonNextQuest() + local title, isHeader, questID = EMA:GetRelevantQuestInfo(EMA.iterateQuests) + if isHeader == false and questID ~= 0 then + local canAbandon = CanAbandonQuest(questID) + if canAbandon then + EMA:EMASendCommandToTeam( EMA.COMMAND_ABANDON_QUEST, questID, title) + if (EMA.iterateQuests ~= GetNumQuestLogEntries()) then + -- decrement quest count as we have removed one if not last quest + EMA.iterateQuests = EMA.iterateQuests - 1 + end + end + end + EMA:IterateQuests("AbandonNextQuest", 0.5) +end + +function EMA.DoShareAllQuestsFromAllToons() + EMA:EMASendMessageToTeam( EMA.db.messageArea, L["SHARING_QUEST_TO_ALLMINIONS"], false ) + EMA:DoShareAllQuestsFromThisToon() + EMA:ScheduleTimer("EMASendCommandToTeam" , 2, EMA.COMMAND_SHARE_ALL_QUESTS) +end + +function EMA.DoShareAllQuestsFromThisToon() + EMA.iterateQuests = 0 + EMA:IterateQuests("ShareNextQuest", 1) +end + +function EMA.ShareNextQuest() + local title, isHeader, questID = EMA:GetRelevantQuestInfo(EMA.iterateQuests) + if GetQuestLogPushable() then + if isHeader == false and questID ~= 0 then + EMA:Print("test", questID ) + QuestLogPushQuest() + end + end + EMA:IterateQuests("ShareNextQuest", 1) +end + + +function EMA:DoTrackAllQuestsFromAllToons() + EMA:EMASendMessageToTeam( EMA.db.messageArea, L["TRACKING_QUEST_TO_ALLMINIONS"], false ) + EMA:DoTrackAllQuestsFromThisToon() + EMA:ScheduleTimer("EMASendCommandToTeam", 1, EMA.COMMAND_TRACK_ALL_QUESTS) +end + +function EMA:DoTrackAllQuestsFromThisToon() + EMA.iterateQuests = 0 + EMA:IterateQuests("TrackNextQuest", 0.5) +end + +function EMA.TrackNextQuest() + + local title, isHeader, questID = EMA:GetRelevantQuestInfo(EMA.iterateQuests) + + if isHeader == false and questID ~= 0 then + EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_TRACK, questID, title, true ) + end + + EMA:IterateQuests("TrackNextQuest", 0.5) +end + +function EMA:DoUnTrackAllQuestsFromAllToons() + EMA:EMASendMessageToTeam( EMA.db.messageArea, L["UNTRACKING_QUESTS_ALLMINIONS"], false ) + EMA:DoUnTrackAllQuestsFromThisToon() + EMA:ScheduleTimer("EMASendCommandToTeam", 1, EMA.COMMAND_UNTRACK_ALL_QUESTS) +end + +function EMA:DoUnTrackAllQuestsFromThisToon() + EMA.iterateQuests = 0 + EMA:IterateQuests("UnTrackNextQuest", 0.5) +end + + +function EMA.UnTrackNextQuest() + local title, isHeader, questID = EMA:GetRelevantQuestInfo(EMA.iterateQuests) + if isHeader == false and questID ~= 0 then + EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_TRACK, questID, title, false ) + end + EMA:IterateQuests("UnTrackNextQuest", 0.5) +end + +function EMA:IterateQuests(methodToCall, timer) + EMA.iterateQuests = EMA.iterateQuests + 1 + if EMA.iterateQuests <= GetNumQuestLogEntries() then + EMA:ScheduleTimer( methodToCall, timer ) + end +end + +function EMA:GetRelevantQuestInfo(questLogIndex) + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questLogIndex ) + return title, isHeader, questID +end + +function EMA:ToggleFrame( frame ) + if frame == QuestLogFrame then + EMA:ToggleQuestLog() + end +end + +function EMA:ToggleQuestLog() + -- This sorts out hooking on L or marcioMenu button + if EMA.db.showEMAQuestLogWithWoWQuestLog == true then + if QuestLogFrame:IsVisible() then + EMA:ToggleShowQuestCommandWindow( true ) + else + EMA:ToggleShowQuestCommandWindow( false ) + end + end +end + +function EMA:QuestLogFrameHide() + if EMA.db.showEMAQuestLogWithWoWQuestLog == true then + EMA:ToggleShowQuestCommandWindow( false ) + end +end + +function EMA:ToggleShowQuestCommandWindow( show ) + if show == true then + EMAMiniQuestLogFrame:Show() + else + EMAMiniQuestLogFrame:Hide() + end +end + + +------------------------------------------------------------------------------------------------------------- +-- ESCORT QUEST +------------------------------------------------------------------------------------------------------------- + +function EMA:QUEST_ACCEPT_CONFIRM( event, senderName, questName ) + EMA:DebugMessage( "QUEST_ACCEPT_CONFIRM" ) + if EMA.db.acceptQuests == true then + if EMA.db.slaveAutoAcceptEscortQuest == true then + EMA:EMASendMessageToTeam( EMA.db.messageArea, L["AUTOMATICALLY_ACCEPTED_ESCORT_QUEST"]( questName ), false ) + EMA.isInternalCommand = true + ConfirmAcceptQuest() + EMA.isInternalCommand = false + StaticPopup_Hide( "QUEST_ACCEPT" ) + end + end +end + +function EMA:GetQuestLogIndexByName( questName ) + for iterateQuests = 1, GetNumQuestLogEntries() do + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( iterateQuests ) + if not isHeader then + if title == questName then + return iterateQuests + end + end + end + return 0 +end + +function EMA:AutoSelectToggleCommand( info, parameters ) + local toggle, tag = strsplit( " ", parameters ) + if tag ~= nil and tag:trim() ~= "" then + EMA:EMASendCommandToTeam( EMA.COMMAND_TOGGLE_AUTO_SELECT, toggle, tag ) + else + EMA:AutoSelectToggle( toggle ) + end +end + +function EMA:DoAutoSelectToggle( sender, toggle, tag ) + if EMAApi.DoesCharacterHaveTag( EMA.characterName, tag ) == true then + EMA:AutoSelectToggle( toggle ) + end +end + +function EMA:AutoSelectToggle( toggle ) + if toggle == L["TOGGLE"] then + if EMA.db.allAutoSelectQuests == true then + toggle = L["OFF"] + else + toggle = L["ON"] + end + end + if toggle == L["ON"] then + EMA.db.mirrorMasterQuestSelectionAndDeclining = false + EMA.db.allAutoSelectQuests = true + elseif toggle == L["OFF"] then + EMA.db.mirrorMasterQuestSelectionAndDeclining = true + EMA.db.allAutoSelectQuests = false + end + EMA:SettingsRefresh() +end + +------------------------------------------------------------------------------------------------------------- +-- COMMAND MANAGEMENT +------------------------------------------------------------------------------------------------------------- + +-- A EMA command has been recieved. +function EMA:EMAOnCommandReceived( characterName, commandName, ... ) + EMA:DebugMessage( 'got a command', characterName, commandName, ... ) + if commandName == EMA.COMMAND_TOGGLE_AUTO_SELECT then + EMA:DoAutoSelectToggle( characterName, ... ) + end +-- Want to action track and abandon command on the same character tat sent the command. + if commandName == EMA.COMMAND_QUEST_TRACK then + EMA:QuestMapQuestOptions_EMA_DoQuestTrack( characterName, ... ) + end + if commandName == EMA.COMMAND_ABANDON_QUEST then + EMA:QuestMapQuestOptions_EMA_DoAbandonQuest( characterName, ... ) + end + + + + -- If this character sent this command, don't action it. + if characterName == EMA.characterName then + return + end + if commandName == EMA.COMMAND_UNTRACK_ALL_QUESTS then + EMA:DoUnTrackAllQuestsFromThisToon() + end + if commandName == EMA.COMMAND_ABANDON_ALL_QUESTS then + EMA:DoAbandonAllQuestsFromThisToon() + end + if commandName == EMA.COMMAND_TRACK_ALL_QUESTS then + EMA:DoTrackAllQuestsFromThisToon() + end + + if commandName == EMA.COMMAND_SHARE_ALL_QUESTS then + EMA:DoShareAllQuestsFromThisToon() + end + if commandName == EMA.COMMAND_ACCEPT_QUEST then + EMA:DoAcceptQuest( characterName, ... ) + end + if commandName == EMA.COMMAND_SELECT_GOSSIP_OPTION then + EMA:DoSelectGossipOption( characterName, ... ) + end + if commandName == EMA.COMMAND_SELECT_GOSSIP_ACTIVE_QUEST then + EMA:DoSelectGossipActiveQuest( characterName, ... ) + end + if commandName == EMA.COMMAND_SELECT_GOSSIP_AVAILABLE_QUEST then + EMA:DoSelectGossipAvailableQuest( characterName, ... ) + end + if commandName == EMA.COMMAND_SELECT_ACTIVE_QUEST then + EMA:DoSelectActiveQuest( characterName, ... ) + end + if commandName == EMA.COMMAND_SELECT_AVAILABLE_QUEST then + EMA:DoSelectAvailableQuest( characterName, ... ) + end + if commandName == EMA.COMMAND_DECLINE_QUEST then + EMA:ScheduleTimer("DoDeclineQuest" , 1, characterName, ... ) + end + if commandName == EMA.COMMAND_COMPLETE_QUEST then + EMA:DoCompleteQuest( characterName, ... ) + end + if commandName == EMA.COMMAND_CHOOSE_QUEST_REWARD then + EMA:DoChooseQuestReward( characterName, ... ) + end + if commandName == EMA.COMMAND_LOG_COMPLETE_QUEST then + EMA:DoShowQuestComplete( characterName, ... ) + end + if commandName == EMA.COMMAND_ACCEPT_QUEST_FAKE then + EMA:DoMagicAutoAcceptQuestGrrrr( characterName, ... ) + end +end + +EMAApi.EMAApiAbandonQuest = EMAApiAbandonQuests +EMAApi.EMAApiUnTrackQuest = EMAApiUnTrackQuests +EMAApi.EMAApiTrackAllQuests = EMAApiTrackAllQuests \ No newline at end of file diff --git a/Modules/Quest.lua b/Modules/Quest.lua index c174a98..175ffb0 100644 --- a/Modules/Quest.lua +++ b/Modules/Quest.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -10,6 +10,11 @@ -- -- -- ================================================================================ -- +-- Only Load for Live +if _G.WOW_PROJECT_ID ~= _G.WOW_PROJECT_MAINLINE then + return +end + -- Create the addon using AceAddon-3.0 and embed some libraries. local EMA = LibStub( "AceAddon-3.0" ):NewAddon( "Quest", @@ -252,6 +257,7 @@ function EMA:OnEnable() EMA:RegisterEvent( "CHAT_MSG_SYSTEM", "QUEST_FAIL" ) -- Quest post hooks. EMA:SecureHook( C_GossipInfo, "SelectOption", "SelectGossipOption") + --EMA:SecureHook( "SelectOption", "SelectGossipOption") EMA:SecureHook( C_GossipInfo, "SelectActiveQuest" ) EMA:SecureHook( "SelectActiveQuest" ) -- Seems bfa uses the old API? EMA:SecureHook( C_GossipInfo, "SelectAvailableQuest" ) @@ -1109,15 +1115,15 @@ function EMA:ChurnNpcGossip() local numberActiveQuestInfo = 5 local index --EMA:Print("test" ) - EMA:DebugMessage( "GetNumAvailableQuests", GetNumAvailableQuests() ) - EMA:DebugMessage( "GetNumActiveQuests", GetNumActiveQuests() ) + EMA:DebugMessage( "GetNumAvailableQuests", C_GossipInfo.GetNumAvailableQuests() ) + EMA:DebugMessage( "GetNumActiveQuests", C_GossipInfo.GetNumActiveQuests() ) EMA:DebugMessage( "GetGossipAvailableQuests", C_GossipInfo.GetAvailableQuests() ) EMA:DebugMessage( "GetGossipActiveQuests", C_GossipInfo.GetActiveQuests() ) - for index = 0, GetNumAvailableQuests() do - SelectAvailableQuest( index ) + for index = 0, C_GossipInfo.GetNumAvailableQuests() do + C_GossipInfo.SelectAvailableQuest( index ) end - for index = 0, GetNumActiveQuests() do - SelectActiveQuest( index ) + for index = 0, C_GossipInfo.GetNumActiveQuests() do + C_GossipInfo.SelectActiveQuest( index ) end EMAUtilities:ClearTable( EMA.gossipQuests ) local availableQuestsData = { C_GossipInfo.GetAvailableQuests() } @@ -1155,7 +1161,7 @@ function EMA:ChurnNpcGossip() -- If this quest has been completed... if questInformation.isComplete then -- Complete it. - SelectGossipActiveQuest( questInformation.index ) + C_GossipInfo.SelectGossipActiveQuest( questInformation.index ) end end end @@ -1232,7 +1238,7 @@ function EMA:DoSelectGossipActiveQuest( sender, gossipIndex ) if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then EMA.isInternalCommand = true EMA:DebugMessage( "DoSelectGossipActiveQuest" ) - SelectGossipActiveQuest( gossipIndex ) + C_GossipInfo.SelectGossipActiveQuest( gossipIndex ) EMA.isInternalCommand = false end end @@ -1270,7 +1276,11 @@ function EMA:DoSelectActiveQuest( sender, questIndex ) if EMA.db.mirrorMasterQuestSelectionAndDeclining == true then EMA.isInternalCommand = true --EMA:Print( "DoSelectActiveQuest" ) - C_GossipInfo.SelectActiveQuest( questIndex ) + if C_GossipInfo.GetNumActiveQuests() >= 1 then + C_GossipInfo.SelectActiveQuest( questIndex ) + else + SelectActiveQuest( questIndex ) + end EMA.isInternalCommand = false end end @@ -1291,10 +1301,10 @@ function EMA:DoSelectAvailableQuest( sender, questIndex ) EMA.isInternalCommand = true EMA:DebugMessage( "DoSelectAvailableQuest" ) -- BFA npcs are not using the c_gossipInfo????? - if C_GossipInfo.GetNumAvailableQuests() > 1 then + if C_GossipInfo.GetNumAvailableQuests() >= 1 then C_GossipInfo.SelectAvailableQuest( questIndex ) else - SelectAvailableQuest( questIndex ) + SelectAvailableQuest( questIndex ) end EMA.isInternalCommand = false end diff --git a/Modules/QuestWatcher-Classic.lua b/Modules/QuestWatcher-Classic.lua new file mode 100644 index 0000000..5d15643 --- /dev/null +++ b/Modules/QuestWatcher-Classic.lua @@ -0,0 +1,2254 @@ +-- ================================================================================ -- +-- EMA - ( Ebony's MultiBoxing Assistant ) -- +-- Current Author: Jennifer Cally (Ebony) -- +-- -- +-- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- -- +-- Some Code Used from "Jamba" that is -- +-- Released under the MIT License -- +-- "Jamba" Copyright 2008-2015 Michael "Jafula" Miller -- +-- -- +-- ================================================================================ -- + +-- Only Load for Classic/TBC +if _G.WOW_PROJECT_ID == _G.WOW_PROJECT_MAINLINE then + return +end + + +-- Create the addon using AceAddon-3.0 and embed some libraries. +local EMA = LibStub( "AceAddon-3.0" ):NewAddon( + "QuestWatcher", + "Module-1.0", + "AceConsole-3.0", + "AceEvent-3.0", + "AceHook-3.0", + "AceTimer-3.0" +) + + + +-- Load libraries. +local EMAUtilities = LibStub:GetLibrary( "EbonyUtilities-1.0" ) +local EMAHelperSettings = LibStub:GetLibrary( "EMAHelperSettings-1.0" ) +EMA.SharedMedia = LibStub( "LibSharedMedia-3.0" ) + +local EMAQuestMapQuestOptionsDropDown = CreateFrame("Frame", "EMAQuestMapQuestOptionsDropDown", EMAQuestWatcherFrame, "UIDropDownMenuTemplate") + +-- Constants and Locale for this module. +EMA.moduleName = "QuestWatcher" +EMA.settingsDatabaseName = "QuestWatcherProfileDB" +EMA.chatCommand = "ema-quest-watcher" +local L = LibStub( "AceLocale-3.0" ):GetLocale( "Core" ) +EMA.parentDisplayName = L["QUEST"] +EMA.moduleDisplayName = L["TRACKER"] +-- Icon +EMA.moduleIcon = "Interface\\Addons\\EMA\\Media\\QuestTrackerIcon.tga" +-- order +EMA.moduleOrder = 20 + + +-- Settings - the values to store and their defaults for the settings database. +EMA.settings = { + profile = { + enableQuestWatcher = true, + watcherFramePoint = "RIGHT", + watcherFrameRelativePoint = "RIGHT", + watcherFrameXOffset = 0, + watcherFrameYOffset = 50, + watcherFrameAlpha = 1.0, + watcherFrameScale = 1.0, + borderStyle = L["BLIZZARD_TOOLTIP"], + backgroundStyle = L["BLIZZARD_DIALOG_BACKGROUND"], + watchFontStyle = L["ARIAL_NARROW"], + watchFontSize = 14, + hideQuestWatcherInCombat = false, + enableQuestWatcherOnMasterOnly = false, + watchFrameBackgroundColourR = 0.0, + watchFrameBackgroundColourG = 0.0, + watchFrameBackgroundColourB = 0.0, + watchFrameBackgroundColourA = 0.0, + watchFrameBorderColourR = 0.0, + watchFrameBorderColourG = 0.0, + watchFrameBorderColourB = 0.0, + watchFrameBorderColourA = 0.0, + watcherListLines = 20, + watcherFrameWidth = 340, + unlockWatcherFrame = true, + hideBlizzardWatchFrame = true, + doNotHideCompletedObjectives = true, + showCompletedObjectivesAsDone = true, + hideQuestIfAllComplete = false, + showFrame = true, + --messageArea = EMAApi.DefaultMessageArea(), + --sendProgressChatMessages = false, + }, +} + +-- Configuration. +function EMA:GetConfiguration() + local configuration = { + name = EMA.moduleDisplayName, + handler = EMA, + type = "group", + get = "EMAConfigurationGetSetting", + set = "EMAConfigurationSetSetting", + args = { + config = { + type = "input", + name = L["OPEN_CONFIG"], + desc = L["OPEN_CONFIG_HELP"], + usage = "/ema-quest-watcher config", + get = false, + set = "", + }, + show = { + type = "input", + name = L["SHOW_QUEST_WATCHER"], + desc = L["SHOW_QUEST_WATCHER_HELP"], + usage = "/ema-quest-watcher show", + get = false, + set = "ShowFrameCommand", + }, + hide = { + type = "input", + name = L["HIDE_QUEST_WATCHER"] , + desc = L["HIDE_QUEST_WATCHER_HELP"] , + usage = "/ema-quest-watcher hide", + get = false, + set = "HideFrameCommand", + }, + push = { + type = "input", + name = L["PUSH_SETTINGS"], + desc = L["PUSH_SETTINGS_INFO"], + usage = "/ema-quest-watcher push", + get = false, + set = "EMASendSettings", + }, + }, + } + return configuration +end + +------------------------------------------------------------------------------------------------------------- +-- Command this module sends. +------------------------------------------------------------------------------------------------------------- + +EMA.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE = "JQWObjUpd" +EMA.COMMAND_UPDATE_QUEST_WATCHER_LIST = "JQWLstUpd" +EMA.COMMAND_QUEST_WATCH_REMOVE_QUEST = "JQWRmveQst" +EMA.COMMAND_AUTO_QUEST_COMPLETE = "JQWAtQstCmplt" +EMA.COMMAND_REMOVE_AUTO_QUEST_COMPLETE = "JQWRmvAtQstCmplt" +EMA.COMMAND_AUTO_QUEST_OFFER = "JQWAqQstOfr" + +------------------------------------------------------------------------------------------------------------- +-- Messages module sends. +------------------------------------------------------------------------------------------------------------- + +------------------------------------------------------------------------------------------------------------- +-- Addon initialization, enabling and disabling. +------------------------------------------------------------------------------------------------------------- + +function EMA:DebugMessage( ... ) + --EMA:Print( ... ) +end + +-- Initialise the module. +function EMA:OnInitialize() + EMA.currentAutoQuestPopups = {} + EMA.countAutoQuestPopUpFrames = 0 + EMA.questWatcherFrameCreated = false + -- Create the settings control. + EMA:SettingsCreate() + -- Initialise the EMAModule part of this module. + EMA:EMAModuleInitialize( EMA.settingsControlWatcher.widgetSettings.frame ) + -- Populate the settings. + EMA:SettingsRefresh() + -- Create the quest watcher frame. + EMA:CreateQuestWatcherFrame() + EMA:SetQuestWatcherVisibility() + -- Quest watcher. + EMA.questWatchListOfQuests = {} + EMA.questWatchCache = {} + EMA.questWatchObjectivesList = {} +end + +-- Called when the addon is enabled. +function EMA:OnEnable() + -- Register for the EMA master changed message. + EMA:RegisterMessage( EMAApi.MESSAGE_TEAM_MASTER_CHANGED, "OnMasterChanged" ) + --EMA:RegisterMessage( EMAApi.MESSAGE_MESSAGE_AREAS_CHANGED, "OnMessageAreasChanged" ) + -- Quest events. + -- Watcher events. + EMA:RegisterEvent( "PLAYER_REGEN_ENABLED" ) + EMA:RegisterEvent( "PLAYER_REGEN_DISABLED" ) + EMA:RegisterEvent( "QUEST_WATCH_UPDATE" ) + EMA:RegisterEvent( "QUEST_LOG_UPDATE") + EMA:RegisterEvent( "UNIT_QUEST_LOG_CHANGED", "QUEST_WATCH_UPDATE" ) + EMA:RegisterEvent( "QUEST_WATCH_LIST_CHANGED", "QUEST_WATCH_UPDATE" ) + -- For in the field auto quests. And Bonus Quests. + EMA:RegisterEvent("QUEST_ACCEPTED", "QUEST_WATCH_UPDATE") + EMA:RegisterEvent("QUEST_REMOVED", "RemoveQuestsNotBeingWatched") + EMA:RegisterEvent( "QUEST_AUTOCOMPLETE" ) + EMA:RegisterEvent( "QUEST_COMPLETE" ) + EMA:RegisterEvent( "QUEST_DETAIL" ) + EMA:RegisterEvent( "PLAYER_ENTERING_WORLD" ) + -- Quest post hooks. + EMA:SecureHook( "SelectActiveQuest" ) + EMA:SecureHook( "GetQuestReward" ) + EMA:SecureHook( "AddQuestWatch" ) + EMA:SecureHook( "RemoveQuestWatch" ) + EMA:SecureHook( "AbandonQuest" ) + EMA:SecureHook( "SetAbandonQuest" ) + -- Update the quest watcher for watched quests. + EMA:ScheduleTimer( "EMAQuestWatcherUpdate", 1, false, "all" ) + EMA:UpdateUnlockWatcherFrame() + EMA:UpdateHideBlizzardWatchFrame() + EMA:ScheduleTimer( "UpdateHideBlizzardWatchFrame", 0.3 ) + if EMA.db.enableQuestWatcher == true then + EMA:QuestWatcherQuestListScrollRefresh() + end + EMAQuestMapQuestOptionsDropDown.questID = 0 + EMAQuestMapQuestOptionsDropDown.questText = nil + UIDropDownMenu_Initialize(EMAQuestMapQuestOptionsDropDown, EMAQuestMapQuestOptionsDropDown_Initialize, "MENU") +end + +-- Called when the addon is disabled. +function EMA:OnDisable() + -- AceHook-3.0 will tidy up the hooks for us. +end + +------------------------------------------------------------------------------------------------------------- +-- Messages. +------------------------------------------------------------------------------------------------------------- + +function EMA:OnMasterChanged( message, characterName ) + if EMA.db.enableQuestWatcher == false then + return + end + EMA:SetQuestWatcherVisibility() +end + +------------------------------------------------------------------------------------------------------------- +-- Settings Dialogs. +------------------------------------------------------------------------------------------------------------- + +function EMA:SettingsCreate() + EMA.settingsControlWatcher = {} + -- Create the settings panels. + EMAHelperSettings:CreateSettings( + EMA.settingsControlWatcher, + EMA.moduleDisplayName, + EMA.parentDisplayName, + EMA.SettingsPushSettingsClick, + EMA.moduleIcon, + EMA.moduleOrder + ) + -- Create the quest controls. + local bottomOfQuestWatcherOptions = EMA:SettingsCreateQuestWatcherControl( EMAHelperSettings:TopOfSettings() ) + EMA.settingsControlWatcher.widgetSettings.content:SetHeight( -bottomOfQuestWatcherOptions ) +end + +function EMA:SettingsCreateQuestWatcherControl( top ) + -- Get positions and dimensions. + local checkBoxHeight = EMAHelperSettings:GetCheckBoxHeight() + local radioBoxHeight = EMAHelperSettings:GetRadioBoxHeight() + local mediaHeight = EMAHelperSettings:GetMediaHeight() + local labelHeight = EMAHelperSettings:GetLabelHeight() + local sliderHeight = EMAHelperSettings:GetSliderHeight() + local dropdownHeight = EMAHelperSettings:GetDropdownHeight() + local labelContinueHeight = EMAHelperSettings:GetContinueLabelHeight() + local left = EMAHelperSettings:LeftOfSettings() + local headingHeight = EMAHelperSettings:HeadingHeight() + local headingWidth = EMAHelperSettings:HeadingWidth( true ) + local horizontalSpacing = EMAHelperSettings:GetHorizontalSpacing() + local verticalSpacing = EMAHelperSettings:GetVerticalSpacing() + local halfWidthSlider = (headingWidth - horizontalSpacing) / 2 + local indent = horizontalSpacing * 10 + local indentContinueLabel = horizontalSpacing * 18 + local indentSpecial = indentContinueLabel + 9 + local checkBoxThirdWidth = (headingWidth - indentContinueLabel) / 3 + local column1Left = left + local column2Left = left + halfWidthSlider + local column1LeftIndent = left + indentContinueLabel + local column2LeftIndent = column1LeftIndent + checkBoxThirdWidth + horizontalSpacing + local column3LeftIndent = column2LeftIndent + checkBoxThirdWidth + horizontalSpacing + local movingTop = top + -- A blank to get layout to show right? + EMAHelperSettings:CreateHeading( EMA.settingsControlWatcher, "", movingTop, false ) + movingTop = movingTop - headingHeight + -- Create a heading for quest completion. + EMAHelperSettings:CreateHeading( EMA.settingsControlWatcher, L["QUEST_TRACKER_HEADER"], movingTop, true ) + movingTop = movingTop - headingHeight + -- Check box: Enable auto quest completion. + EMA.settingsControlWatcher.checkBoxEnableQuestWatcher = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlWatcher, + headingWidth, + column1Left, + movingTop, + L["ENABLE_TRACKER"], + EMA.SettingsToggleEnableQuestWatcher, + L["ENABLE_TRACKER_HELP"] + ) +--[[ + movingTop = movingTop - checkBoxHeight + EMA.settingsControlWatcher.checkBoxUnlockWatcherFrame = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlWatcher, + headingWidth, + left, + movingTop, + L["UNLOCK_TRACKER"], + EMA.SettingsToggleUnlockWatcherFrame, + L["UNLOCK_TRACKER_HELP"] + ) +]] + movingTop = movingTop - checkBoxHeight + EMA.settingsControlWatcher.checkBoxHideBlizzardWatchFrame = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlWatcher, + headingWidth, + left, + movingTop, + L["HIDE_BLIZZ_OBJ_TRACKER"], + EMA.SettingsToggleHideBlizzardWatchFrame, + L["HIDE_BLIZZ_OBJ_TRACKER_HELP"] + ) + movingTop = movingTop - checkBoxHeight + EMA.settingsControlWatcher.checkBoxEnableQuestWatcherMasterOnly = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlWatcher, + headingWidth, + column1Left, + movingTop, + L["SHOW_JOT_ON_MASTER"], + EMA.SettingsToggleEnableQuestWatcherMasterOnly, + L["SHOW_JOT_ON_MASTER_HELP"] + + ) + movingTop = movingTop - checkBoxHeight + EMA.settingsControlWatcher.displayOptionsCheckBoxHideQuestWatcherInCombat = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlWatcher, + headingWidth, + column1Left, + movingTop, + L["HIDE_JOT_IN_COMBAT"], + EMA.SettingsToggleHideQuestWatcherInCombat, + L["HIDE_JOT_IN_COMBAT_HELP"] + ) + movingTop = movingTop - checkBoxHeight + EMA.settingsControlWatcher.checkBoxShowCompletedObjectivesAsDone = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlWatcher, + headingWidth, + left, + movingTop, + L["SHOW_COMPLETED_OBJ_DONE"], + EMA.SettingsShowCompletedObjectivesAsDone, + L["SHOW_COMPLETED_OBJ_DONE_HELP"] + ) + movingTop = movingTop - checkBoxHeight + EMA.settingsControlWatcher.checkBoxHideQuestIfAllComplete = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlWatcher, + headingWidth, + left, + movingTop, + L["HIDE_OBJ_COMPLETED"], + EMA.SettingsHideQuestIfAllComplete, + L["HIDE_OBJ_COMPLETED_HELP"] + ) + movingTop = movingTop - checkBoxHeight +--[[ + EMA.settingsControlWatcher.checkBoxSendProgressChatMessages = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlWatcher, + headingWidth, + left, + movingTop, + L["SEND_PROGRESS_MESSAGES"], + EMA.SettingsToggleSendProgressChatMessages, + L["SEND_PROGRESS_MESSAGES_HELP"] + ) + movingTop = movingTop - checkBoxHeight + -- Message area. + EMA.settingsControlWatcher.dropdownMessageArea = EMAHelperSettings:CreateDropdown( + EMA.settingsControlWatcher, + headingWidth, + left, + movingTop, + L["MESSAGE_AREA"] + ) + EMA.settingsControlWatcher.dropdownMessageArea:SetList( EMAApi.MessageAreaList() ) + EMA.settingsControlWatcher.dropdownMessageArea:SetCallback( "OnValueChanged", EMA.SettingsSetMessageArea ) + + movingTop = movingTop - dropdownHeight +]] + EMAHelperSettings:CreateHeading( EMA.settingsControlWatcher, L["APPEARANCE_LAYOUT_HEALDER"], movingTop, true ) + movingTop = movingTop - headingHeight - verticalSpacing + -- Information line 1. + EMA.settingsControlWatcher.displayOptionsQuestWatcherInformation1 = EMAHelperSettings:CreateContinueLabel( + EMA.settingsControlWatcher, + headingWidth, + left, + movingTop, + L["QUESTWACHERINFORMATIONONE"] + ) + movingTop = movingTop - labelContinueHeight + EMA.settingsControlWatcher.displayOptionsQuestWatcherLinesSlider = EMAHelperSettings:CreateSlider( + EMA.settingsControlWatcher, + halfWidthSlider, + left, + movingTop, + L["LINES_TO_DISPLAY"] + ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherLinesSlider:SetSliderValues( 5, 50, 1 ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherLinesSlider:SetCallback( "OnValueChanged", EMA.SettingsChangeWatchLines ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherFrameWidthSlider = EMAHelperSettings:CreateSlider( + EMA.settingsControlWatcher, + halfWidthSlider, + column2Left, + movingTop, + L["TRACKER_WIDTH"] + ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherFrameWidthSlider:SetSliderValues( 250, 600, 5 ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherFrameWidthSlider:SetCallback( "OnValueChanged", EMA.SettingsChangeWatchFrameWidth ) + movingTop = movingTop - sliderHeight - verticalSpacing + EMA.settingsControlWatcher.displayOptionsQuestWatcherMediaBorder = EMAHelperSettings:CreateMediaBorder( + EMA.settingsControlWatcher, + halfWidthSlider, + left, + movingTop, + L["BORDER_STYLE"] + ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherMediaBorder:SetCallback( "OnValueChanged", EMA.SettingsChangeBorderStyle ) + EMA.settingsControlWatcher.questWatchBorderColourPicker = EMAHelperSettings:CreateColourPicker( + EMA.settingsControlWatcher, + halfWidthSlider, + column2Left + 15, + movingTop - 15, + L["BORDER COLOUR"] + ) + EMA.settingsControlWatcher.questWatchBorderColourPicker:SetHasAlpha( true ) + EMA.settingsControlWatcher.questWatchBorderColourPicker:SetCallback( "OnValueConfirmed", EMA.SettingsQuestWatchBorderColourPickerChanged ) + movingTop = movingTop - mediaHeight - verticalSpacing + EMA.settingsControlWatcher.displayOptionsQuestWatcherMediaBackground = EMAHelperSettings:CreateMediaBackground( + EMA.settingsControlWatcher, + halfWidthSlider, + column1Left, + movingTop, + L["BACKGROUND"] + ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherMediaBackground:SetCallback( "OnValueChanged", EMA.SettingsChangeBackgroundStyle ) + EMA.settingsControlWatcher.questWatchBackgroundColourPicker = EMAHelperSettings:CreateColourPicker( + EMA.settingsControlWatcher, + halfWidthSlider, + column2Left + 15, + movingTop - 15, + L["BG_COLOUR"] + ) + EMA.settingsControlWatcher.questWatchBackgroundColourPicker:SetHasAlpha( true ) + EMA.settingsControlWatcher.questWatchBackgroundColourPicker:SetCallback( "OnValueConfirmed", EMA.SettingsQuestWatchBackgroundColourPickerChanged ) + movingTop = movingTop - mediaHeight - verticalSpacing + EMA.settingsControlWatcher.questWatchMediaFont = EMAHelperSettings:CreateMediaFont( + EMA.settingsControlWatcher, + halfWidthSlider, + left, + movingTop, + L["FONT"] + ) + EMA.settingsControlWatcher.questWatchMediaFont:SetCallback( "OnValueChanged", EMA.SettingsChangeFontStyle ) + EMA.settingsControlWatcher.questWatchFontSize = EMAHelperSettings:CreateSlider( + EMA.settingsControlWatcher, + halfWidthSlider, + column2Left, + movingTop, + L["FONT_SIZE"] + ) + EMA.settingsControlWatcher.questWatchFontSize:SetSliderValues( 8, 20 , 1 ) + EMA.settingsControlWatcher.questWatchFontSize:SetCallback( "OnValueChanged", EMA.SettingsChangeFontSize ) + movingTop = movingTop - mediaHeight - verticalSpacing + EMA.settingsControlWatcher.displayOptionsQuestWatcherScaleSlider = EMAHelperSettings:CreateSlider( + EMA.settingsControlWatcher, + halfWidthSlider, + column1Left, + movingTop, + L["SCALE"] + ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherScaleSlider:SetSliderValues( 0.5, 2, 0.01 ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherScaleSlider:SetCallback( "OnValueChanged", EMA.SettingsChangeScale ) + --movingTop = movingTop - sliderHeight - verticalSpacing + EMA.settingsControlWatcher.displayOptionsQuestWatcherTransparencySlider = EMAHelperSettings:CreateSlider( + EMA.settingsControlWatcher, + halfWidthSlider, + column2Left, + movingTop, + L["TRANSPARENCY"] + ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherTransparencySlider:SetSliderValues( 0, 1, 0.01 ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherTransparencySlider:SetCallback( "OnValueChanged", EMA.SettingsChangeTransparency ) + movingTop = movingTop - sliderHeight - verticalSpacing + return movingTop +end +--[[ +function EMA:OnMessageAreasChanged( message ) + EMA.settingsControlWatcher.dropdownMessageArea:SetList( EMAApi.MessageAreaList() ) +end +]] +------------------------------------------------------------------------------------------------------------- +-- Watcher frame. +------------------------------------------------------------------------------------------------------------- + +function EMA:CanDisplayQuestWatcher() + -- Do not show is quest watcher disabled. + if EMA.db.enableQuestWatcher == false then + return false + end + -- Do not show if user has hidden frame. + if EMA.db.showFrame == false then + return false + end + -- Do not show if master only and not the master. + if EMA.db.enableQuestWatcherOnMasterOnly == true then + if EMAApi.IsCharacterTheMaster( EMA.characterName ) == false then + return false + end + end + -- Show if at least one line in the watch list. + if EMA:CountLinesInQuestWatchList() > 0 then + return true + end + -- Show if at least one auto quest popup. + if EMA:HasAtLeastOneAutoQuestPopup() == true then + return true + end + -- Nothing to show. + return false +end + +local function Title_OnMouseDown(frame) + if IsAltKeyDown() then + frame:GetParent():StartMoving() + end +end + +local function MoverSizer_OnMouseUp(mover) + local frame = mover:GetParent() + frame:StopMovingOrSizing() + local point, relativeTo, relativePoint, xOffset, yOffset = frame:GetPoint() + EMA.db.watcherFramePoint = point + EMA.db.watcherFrameRelativePoint = relativePoint + EMA.db.watcherFrameXOffset = xOffset + EMA.db.watcherFrameYOffset = yOffset +end + + +function EMA:CreateQuestWatcherFrame() + -- The frame. + local frame = CreateFrame( "Frame", "EMAQuestWatcherWindowFrame", UIParent, BackdropTemplateMixin and "BackdropTemplate" or nil ) + frame.obj = EMA + frame:SetFrameStrata( "BACKGROUND" ) + frame:SetClampedToScreen( true ) + frame:EnableMouse( false ) + frame:SetMovable( true ) + frame:ClearAllPoints() + frame:SetPoint( EMA.db.watcherFramePoint, UIParent, EMA.db.watcherFrameRelativePoint, EMA.db.watcherFrameXOffset, EMA.db.watcherFrameYOffset ) + frame:SetBackdrop( { + bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", + edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, tileSize = 10, edgeSize = 10, + insets = { left = 3, right = 3, top = 3, bottom = 3 } + } ) + -- Create the title for the questWaster list frame. + local titleButton = CreateFrame( "Button", "EMAQuestWatcherWindowFrameTitle", frame ) + titleButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", -5, -4 ) + titleButton:SetWidth( EMA.db.watcherFrameWidth - 100 ) + titleButton:SetHeight( 20 ) + titleButton:SetScript("OnMouseDown", Title_OnMouseDown) + titleButton:SetScript("OnMouseUp", MoverSizer_OnMouseUp) + titleButton:SetScript("OnEnter", function(self) EMA:ShowTooltip(titleButton, "headerMouseOver", true) end) + titleButton:SetScript("OnLeave", function(self) GameTooltip:Hide() end) + titleButton.titleName = titleButton:CreateFontString( titleButton:GetName().."Text", "OVERLAY", "GameFontNormal" ) + titleButton.titleName:SetJustifyH( "CENTER" ) + titleButton.titleName:SetAllPoints( titleButton ) + titleButton.titleName:SetTextColor( 1.00, 1.00, 1.00 ) + titleButton.titleName:SetText( L["TRACKER_TITLE_NAME"] ) + frame.titleName = titleButton.titleName + + -- Update button. + local updateButton = CreateFrame( "Button", "EMAQuestWatcherWindowFrameButtonUpdate", frame, "UIPanelButtonGrayTemplate" ) + updateButton:SetPoint( "TOPRIGHT", frame, "TOPRIGHT", -5, -4 ) + updateButton:SetHeight( 20 ) + updateButton:SetWidth( 100 ) + updateButton:SetText( L["UPDATE"] ) + updateButton:SetScript( "OnClick", EMA.EMAQuestWatchListUpdateButtonClicked ) + updateButton:SetScript("OnEnter", function(self) EMA:ShowTooltip(updateButton, "update", true) end) + updateButton:SetScript("OnLeave", function(self) GameTooltip:Hide() end) + -- Add an area for the "in the field quest" notifications. + frame.fieldNotificationsTop = -24 + frame.fieldNotifications = CreateFrame( "Frame", "EMAQuestWatcherFieldQuestFrame", frame ) + frame.fieldNotifications:SetFrameStrata( "BACKGROUND" ) + frame.fieldNotifications:SetClampedToScreen( true ) + frame.fieldNotifications:EnableMouse( false ) + frame.fieldNotifications:ClearAllPoints() + frame.fieldNotifications:SetPoint( "TOPLEFT", frame, "TOPLEFT", 0, frame.fieldNotificationsTop ) + frame.fieldNotifications:Show() + -- Set transparency of the the frame (and all its children). + frame:SetAlpha( EMA.db.watcherFrameAlpha ) + -- List. + local topOfList = frame.fieldNotificationsTop + local list = {} + list.listFrameName = "EMAQuestWatcherQuestListFrame" + list.parentFrame = frame + list.listTop = topOfList + list.listLeft = 2 + list.listWidth = EMA.db.watcherFrameWidth + list.rowHeight = 19 + list.rowsToDisplay = EMA.db.watcherListLines + list.columnsToDisplay = 2 + list.columnInformation = {} + list.columnInformation[1] = {} + list.columnInformation[1].width = 80 + list.columnInformation[1].alignment = "LEFT" + list.columnInformation[2] = {} + list.columnInformation[2].width = 20 + list.columnInformation[2].alignment = "CENTER" + list.scrollRefreshCallback = EMA.QuestWatcherQuestListScrollRefresh + list.rowClickCallback = EMA.QuestWatcherQuestListRowClick + list.rowRightClickCallback = EMA.QuestWatcherQuestListRowRightClick + list.rowMouseOverCallBack_OnEnter = EMA.QuestWatcherQuestListRowOnEnter + list.rowMouseOverCallBack_OnLeave = EMA.QuestWatcherQuestListRowOnLeave + frame.questWatchList = list + EMAHelperSettings:CreateScrollList( frame.questWatchList ) + -- Change appearance from default. + frame.questWatchList.listFrame:SetBackdropColor( 0.0, 0.0, 0.0, 0.0 ) + frame.questWatchList.listFrame:SetBackdropBorderColor( 0.0, 0.0, 0.0, 0.0 ) + -- Disable mouse on columns so click-through works. + for iterateDisplayRows = 1, frame.questWatchList.rowsToDisplay do + for iterateDisplayColumns = 1, frame.questWatchList.columnsToDisplay do + if InCombatLockdown() == false then + frame.questWatchList.rows[iterateDisplayRows].columns[iterateDisplayColumns]:EnableMouse( false ) + end + end + end + -- Position and size constants (once list height is known). + frame.questWatchListBottom = topOfList - list.listHeight + frame.questWatchListHeight = list.listHeight + frame.questWatchHighlightRow = 1 + frame.questWatchListOffset = 1 + -- Set the global frame reference for this frame. + EMAQuestWatcherFrame = frame + EMAQuestWatcherFrame.autoQuestPopupsHeight = 0 + EMA:SettingsUpdateBorderStyle() + EMA:SettingsUpdateFontStyle() + EMA.questWatcherFrameCreated = true +end + +function EMA:ShowTooltip(frame, info, show) + if show then + GameTooltip:SetOwner(frame, "ANCHOR_TOP") + GameTooltip:SetPoint("TOPLEFT", frame, "TOPRIGHT", 16, 0) + GameTooltip:ClearLines() + if info == "headerMouseOver" then + GameTooltip:AddLine(L["HEADER_MOUSE_OVER_QUESTWATCHER"], 1, 0.82, 0, 1) + elseif info == "update" then + GameTooltip:AddLine(L["UPDATE_MOUSE_OVER_QUESTWATCHER"], 1, 0.82, 0, 1) + end + GameTooltip:Show() + else + GameTooltip:Hide() + end +end + + +function EMA:SettingsUpdateBorderStyle() + local borderStyle = EMA.SharedMedia:Fetch( "border", EMA.db.borderStyle ) + local backgroundStyle = EMA.SharedMedia:Fetch( "background", EMA.db.backgroundStyle ) + local frame = EMAQuestWatcherFrame + frame:SetBackdrop( { + bgFile = backgroundStyle, + edgeFile = borderStyle, + tile = true, tileSize = frame:GetWidth(), edgeSize = 10, + insets = { left = 3, right = 3, top = 3, bottom = 3 } + } ) + frame:SetBackdropColor( EMA.db.watchFrameBackgroundColourR, EMA.db.watchFrameBackgroundColourG, EMA.db.watchFrameBackgroundColourB, EMA.db.watchFrameBackgroundColourA ) + frame:SetBackdropBorderColor( EMA.db.watchFrameBorderColourR, EMA.db.watchFrameBorderColourG, EMA.db.watchFrameBorderColourB, EMA.db.watchFrameBorderColourA ) +end + +function EMA:SettingsUpdateFontStyle() + local textFont = EMA.SharedMedia:Fetch( "font", EMA.db.watchFontStyle ) + local textSize = EMA.db.watchFontSize + local frame = EMAQuestWatcherFrame + frame.titleName:SetFont( textFont , textSize , "OUTLINE") +end + + +function EMA:UpdateQuestWatcherDimensions() + if InCombatLockdown() == true then + return + end + local frame = EMAQuestWatcherFrame + frame:SetWidth( frame.questWatchList.listWidth + 4 ) + frame:SetHeight( frame.questWatchListHeight + 40 ) + -- Field notifications. + frame.fieldNotifications:SetWidth( frame.questWatchList.listWidth + 4 ) + frame.fieldNotifications:SetHeight( EMAQuestWatcherFrame.autoQuestPopupsHeight ) + -- List. + frame.questWatchList.listTop = frame.fieldNotificationsTop - EMAQuestWatcherFrame.autoQuestPopupsHeight + frame.questWatchList.listFrame:SetPoint( "TOPLEFT", frame.questWatchList.parentFrame, "TOPLEFT", frame.questWatchList.listLeft, frame.questWatchList.listTop ) + -- Scale. + frame:SetScale( EMA.db.watcherFrameScale ) +end + +function EMA:SetQuestWatcherVisibility() + if InCombatLockdown() == true then + return + end + if EMA:CanDisplayQuestWatcher() == true then + EMA:UpdateQuestWatcherDimensions() + EMAQuestWatcherFrame:ClearAllPoints() + EMAQuestWatcherFrame:SetPoint( EMA.db.watcherFramePoint, UIParent, EMA.db.watcherFrameRelativePoint, EMA.db.watcherFrameXOffset, EMA.db.watcherFrameYOffset ) + EMAQuestWatcherFrame:SetAlpha( EMA.db.watcherFrameAlpha ) + EMAQuestWatcherFrame:Show() + else + EMAQuestWatcherFrame:Hide() + end +end + +------------------------------------------------------------------------------------------------------------- +-- Settings functionality. +------------------------------------------------------------------------------------------------------------- + +-- Settings received. +function EMA:EMAOnSettingsReceived( characterName, settings ) + if characterName ~= EMA.characterName then + -- Update the settings. + EMA.db.enableQuestWatcher = settings.enableQuestWatcher + EMA.db.watcherFrameAlpha = settings.watcherFrameAlpha + EMA.db.watcherFramePoint = settings.watcherFramePoint + EMA.db.watcherFrameRelativePoint = settings.watcherFrameRelativePoint + EMA.db.watcherFrameXOffset = settings.watcherFrameXOffset + EMA.db.watcherFrameYOffset = settings.watcherFrameYOffset + EMA.db.borderStyle = settings.borderStyle + EMA.db.backgroundStyle = settings.backgroundStyle + EMA.db.watchFontStyle = settings.watchFontStyle + EMA.db.watchFontSize = settings.watchFontSize + EMA.db.hideQuestWatcherInCombat = settings.hideQuestWatcherInCombat + EMA.db.watcherFrameScale = settings.watcherFrameScale + EMA.db.enableQuestWatcherOnMasterOnly = settings.enableQuestWatcherOnMasterOnly + EMA.db.watchFrameBackgroundColourR = settings.watchFrameBackgroundColourR + EMA.db.watchFrameBackgroundColourG = settings.watchFrameBackgroundColourG + EMA.db.watchFrameBackgroundColourB = settings.watchFrameBackgroundColourB + EMA.db.watchFrameBackgroundColourA = settings.watchFrameBackgroundColourA + EMA.db.watchFrameBorderColourR = settings.watchFrameBorderColourR + EMA.db.watchFrameBorderColourG = settings.watchFrameBorderColourG + EMA.db.watchFrameBorderColourB = settings.watchFrameBorderColourB + EMA.db.watchFrameBorderColourA = settings.watchFrameBorderColourA + EMA.db.watcherListLines = settings.watcherListLines + EMA.db.watcherFrameWidth = settings.watcherFrameWidth + EMA.db.unlockWatcherFrame = settings.unlockWatcherFrame + EMA.db.hideBlizzardWatchFrame = settings.hideBlizzardWatchFrame + EMA.db.doNotHideCompletedObjectives = settings.doNotHideCompletedObjectives + EMA.db.showCompletedObjectivesAsDone = settings.showCompletedObjectivesAsDone + EMA.db.hideQuestIfAllComplete = settings.hideQuestIfAllComplete +-- EMA.db.showFrame = settings.showFrame +-- EMA.db.sendProgressChatMessages = settings.sendProgressChatMessages +-- EMA.db.messageArea = settings.messageArea + -- Refresh the settings. + EMA:SettingsRefresh() + EMA:UpdateUnlockWatcherFrame() + EMA:UpdateHideBlizzardWatchFrame() + EMA:ScheduleTimer( "UpdateHideBlizzardWatchFrame", 0.3 ) + -- Tell the player. + EMA:Print( L["SETTINGS_RECEIVED_FROM_A"] ( characterName ) ) + end +end + +------------------------------------------------------------------------------------------------------------- +-- Settings Populate. +------------------------------------------------------------------------------------------------------------- + +function EMA:BeforeEMAProfileChanged() +end + +function EMA:OnEMAProfileChanged() + EMA:SettingsRefresh() +end + +function EMA:SettingsRefresh() + -- Quest watcher options. + EMA.settingsControlWatcher.checkBoxEnableQuestWatcher:SetValue( EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherMediaBorder:SetValue( EMA.db.borderStyle ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherMediaBackground:SetValue( EMA.db.backgroundStyle ) + + EMA.settingsControlWatcher.questWatchMediaFont:SetValue( EMA.db.watchFontStyle ) + EMA.settingsControlWatcher.questWatchFontSize:SetValue( EMA.db.watchFontSize ) + + EMA.settingsControlWatcher.displayOptionsCheckBoxHideQuestWatcherInCombat:SetValue( EMA.db.hideQuestWatcherInCombat ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherTransparencySlider:SetValue( EMA.db.watcherFrameAlpha ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherScaleSlider:SetValue( EMA.db.watcherFrameScale ) + EMA.settingsControlWatcher.checkBoxEnableQuestWatcherMasterOnly:SetValue( EMA.db.enableQuestWatcherOnMasterOnly ) + EMA.settingsControlWatcher.questWatchBackgroundColourPicker:SetColor( EMA.db.watchFrameBackgroundColourR, EMA.db.watchFrameBackgroundColourG, EMA.db.watchFrameBackgroundColourB, EMA.db.watchFrameBackgroundColourA ) + EMA.settingsControlWatcher.questWatchBorderColourPicker:SetColor( EMA.db.watchFrameBorderColourR, EMA.db.watchFrameBorderColourG, EMA.db.watchFrameBorderColourB, EMA.db.watchFrameBorderColourA ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherLinesSlider:SetValue( EMA.db.watcherListLines ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherFrameWidthSlider:SetValue( EMA.db.watcherFrameWidth ) +-- EMA.settingsControlWatcher.checkBoxUnlockWatcherFrame:SetValue( EMA.db.unlockWatcherFrame ) + EMA.settingsControlWatcher.checkBoxHideBlizzardWatchFrame:SetValue( EMA.db.hideBlizzardWatchFrame ) + EMA.settingsControlWatcher.checkBoxShowCompletedObjectivesAsDone:SetValue( EMA.db.showCompletedObjectivesAsDone ) + EMA.settingsControlWatcher.checkBoxHideQuestIfAllComplete:SetValue( EMA.db.hideQuestIfAllComplete ) +-- EMA.settingsControlWatcher.dropdownMessageArea:SetValue( EMA.db.messageArea ) +-- EMA.settingsControlWatcher.checkBoxSendProgressChatMessages:SetValue( EMA.db.sendProgressChatMessages ) + -- Quest watcher state. + EMA.settingsControlWatcher.displayOptionsQuestWatcherMediaBorder:SetDisabled( not EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherMediaBackground:SetDisabled( not EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.questWatchMediaFont:SetDisabled( not EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.questWatchFontSize:SetDisabled( not EMA.db.enableQuestWatcher ) + + EMA.settingsControlWatcher.displayOptionsCheckBoxHideQuestWatcherInCombat:SetDisabled( not EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherTransparencySlider:SetDisabled( not EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherScaleSlider:SetDisabled( not EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.checkBoxEnableQuestWatcherMasterOnly:SetDisabled( not EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.questWatchBackgroundColourPicker:SetDisabled( not EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.questWatchBorderColourPicker:SetDisabled( not EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherLinesSlider:SetDisabled( not EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.displayOptionsQuestWatcherFrameWidthSlider:SetDisabled( not EMA.db.enableQuestWatcher ) +-- EMA.settingsControlWatcher.checkBoxUnlockWatcherFrame:SetDisabled( not EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.checkBoxHideBlizzardWatchFrame:SetDisabled( not EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.checkBoxShowCompletedObjectivesAsDone:SetDisabled( not EMA.db.enableQuestWatcher ) + EMA.settingsControlWatcher.checkBoxHideQuestIfAllComplete:SetDisabled( not EMA.db.enableQuestWatcher ) +-- EMA.settingsControlWatcher.dropdownMessageArea:SetDisabled( not EMA.db.enableQuestWatcher ) +-- EMA.settingsControlWatcher.checkBoxSendProgressChatMessages:SetDisabled( not EMA.db.enableQuestWatcher ) + if EMA.questWatcherFrameCreated == true and InCombatLockdown() == false then + EMA:SettingsUpdateBorderStyle() + EMA:SettingsUpdateFontStyle() + EMA:SetQuestWatcherVisibility() + end +end + +function EMA:SettingsPushSettingsClick( event ) + EMA:EMASendSettings() +end + +function EMA:SettingsToggleEnableQuestWatcher( event, checked ) + EMA.db.enableQuestWatcher = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeBorderStyle( event, value ) + EMA.db.borderStyle = value + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeBackgroundStyle( event, value ) + EMA.db.backgroundStyle = value + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeFontStyle( event, value ) + EMA.db.watchFontStyle = value + EMA:SettingsRefresh() + EMA:EMAQuestWatcherUpdate( false, "all" ) +end + +function EMA:SettingsChangeFontSize( event, value ) + EMA.db.watchFontSize = value + EMA:SettingsRefresh() + EMA:EMAQuestWatcherUpdate( false, "all" ) +end + +function EMA:SettingsToggleHideQuestWatcherInCombat( event, checked ) + EMA.db.hideQuestWatcherInCombat = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeTransparency( event, value ) + EMA.db.watcherFrameAlpha = tonumber( value ) + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeScale( event, value ) + EMA.db.watcherFrameScale = tonumber( value ) + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeWatchLines( event, value ) + EMA.db.watcherListLines = tonumber( value ) + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeWatchFrameWidth( event, value ) + EMA.db.watcherFrameWidth = tonumber( value ) + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleEnableQuestWatcherMasterOnly( event, checked ) + EMA.db.enableQuestWatcherOnMasterOnly = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsQuestWatchBackgroundColourPickerChanged( event, r, g, b, a ) + EMA.db.watchFrameBackgroundColourR = r + EMA.db.watchFrameBackgroundColourG = g + EMA.db.watchFrameBackgroundColourB = b + EMA.db.watchFrameBackgroundColourA = a + EMA:SettingsRefresh() +end + +function EMA:SettingsQuestWatchBorderColourPickerChanged( event, r, g, b, a ) + EMA.db.watchFrameBorderColourR = r + EMA.db.watchFrameBorderColourG = g + EMA.db.watchFrameBorderColourB = b + EMA.db.watchFrameBorderColourA = a + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleUnlockWatcherFrame( event, checked ) + EMA.db.unlockWatcherFrame = checked + EMA:UpdateUnlockWatcherFrame() + EMA:SettingsRefresh() +end +--[[ +function EMA:SettingsToggleSendProgressChatMessages( event, checked ) + EMA.db.sendProgressChatMessages = checked + EMA:SettingsRefresh() +end +]] +function EMA:SettingsToggleShowFrame( event, checked ) + EMA.db.showFrame = checked + EMA:SettingsRefresh() +end + +function EMA:ShowFrameCommand( info, parameters ) + EMA.db.showFrame = true + EMA:SettingsRefresh() +end + +function EMA:HideFrameCommand( info, parameters ) + EMA.db.showFrame = false + EMA:SettingsRefresh() +end + +function EMA:SettingsSetMessageArea( event, messageAreaValue ) + EMA.db.messageArea = messageAreaValue + EMA:SettingsRefresh() +end + +function EMA:SettingsToggleHideBlizzardWatchFrame( event, checked ) + EMA.db.hideBlizzardWatchFrame = checked + EMA:UpdateHideBlizzardWatchFrame() + EMA:ScheduleTimer( "UpdateHideBlizzardWatchFrame", 0.3 ) + EMA:SettingsRefresh() +end + +function EMA:SettingsShowCompletedObjectivesAsDone( event, checked ) + EMA.db.showCompletedObjectivesAsDone = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsHideQuestIfAllComplete( event, checked ) + EMA.db.hideQuestIfAllComplete = checked + EMA:SettingsRefresh() +end + +function EMA:SettingsDoNotHideCompletedObjectives( event, checked ) + EMA.db.doNotHideCompletedObjectives = checked + EMA:SettingsRefresh() +end + +function EMA:UpdateUnlockWatcherFrame() + if EMA.db.enableQuestWatcher == false then + return + end + if EMA.db.unlockWatcherFrame == true then + EMAQuestWatcherFrame:EnableMouse( true ) + else + EMAQuestWatcherFrame:EnableMouse( false ) + end +end + +function EMA:UpdateHideBlizzardWatchFrame() + if EMA.db.enableQuestWatcher == false then + return + end + if EMA.db.hideBlizzardWatchFrame == true then + if QuestWatchFrame:IsVisible() then + --QuestLogFrame:Hide() + QuestWatchFrame:HookScript("OnShow", function(self) self:Hide() end) + QuestWatchFrame:Hide() + end + else + QuestWatchFrame:Show() + end +end + +------------------------------------------------------------------------------------------------------------- +-- QUEST WATCHING HOOKS +------------------------------------------------------------------------------------------------------------- + +function EMA:SelectActiveQuest( questIndex ) + EMA:DebugMessage("select active quest", questIndex) + if EMA.db.enableQuestWatcher == false then + return + end + EMA:SetActiveQuestForQuestWatcherCache( questIndex ) +end + +function EMA:GetQuestReward( itemChoice ) + if EMA.db.enableQuestWatcher == false then + return + end + local questJustCompletedName = GetTitleText() + EMA:DebugMessage( "GetQuestReward: ", questIndex, questJustCompletedName ) + local questIndex = EMA:GetQuestLogIndexByName( questJustCompletedName ) + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questIndex ) + EMA:DebugMessage( "GetQuestReward after GetQuestLogTitle: ", questIndex, questJustCompletedName, questID ) + EMA:RemoveQuestFromWatchList( questID ) +end + +function EMA:AddQuestWatch( questIndex ) + if EMA.db.enableQuestWatcher == false then + return + end + EMA:UpdateHideBlizzardWatchFrame() + EMA:ScheduleTimer( "UpdateHideBlizzardWatchFrame", 0.3 ) + EMA:EMAQuestWatcherUpdate( true, "all" ) + --EMA:EMAQuestWatcherScenarioUpdate( true ) +end + +function EMA:RemoveQuestWatch( questIndex ) + if EMA.db.enableQuestWatcher == false then + return + end + EMA:DebugMessage( "RemoveQuestWatch", questIndex ) + EMA:UpdateHideBlizzardWatchFrame() + EMA:ScheduleTimer( "UpdateHideBlizzardWatchFrame", 0.3 ) + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questIndex ) + EMA:DebugMessage( "About to call RemoveQuestFromWatchList with value:", questID ) + EMA:RemoveQuestFromWatchList( questID ) +end + +function EMA:SetAbandonQuest() + if EMA.db.enableQuestWatcher == false then + return + end + local questName = GetAbandonQuestName() + if questName ~= nil then + local questIndex = EMA:GetQuestLogIndexByName( questName ) + EMA:SetActiveQuestForQuestWatcherCache( questIndex ) + end +end + +function EMA:AbandonQuest() + if EMA.db.enableQuestWatcher == false then + return + end + -- Wait a bit for the correct information to come through from the server... + EMA:ScheduleTimer( "AbandonQuestDelayed", 1 ) +end + + +function EMA:QUEST_WATCH_UPDATE( event, ... ) + --EMA:Print("test4") + if EMA.db.enableQuestWatcher == true then + EMA:UpdateHideBlizzardWatchFrame() + EMA:ScheduleTimer( "UpdateHideBlizzardWatchFrame", 0.3 ) + -- Wait a bit for the correct information to come through from the server... + EMA:ScheduleTimer( "EMAQuestWatcherUpdate", 1, true, "all" ) + end +end + + +function EMA:QUEST_LOG_UPDATE( event, ... ) + --EMA:Print("QuestTestUpdates") + if EMA.db.enableQuestWatcher == true then + EMA:UpdateHideBlizzardWatchFrame() + --EMA:ScheduleTimer( "UpdateHideBlizzardWatchFrame", 0.5 ) + -- Wait a bit for the correct information to come through from the server... + EMA:ScheduleTimer( "EMAQuestWatcherUpdate", 1, true, "all" ) + end +end + + +function EMA:SCENARIO_UPDATE( event, ... ) + --EMA:Print("test2") + if EMA.db.enableQuestWatcher == true then + + EMA:RemoveQuestsNotBeingWatched() + EMA:ScheduleTimer( "EMAQuestWatcherUpdate", 1, true, "scenario" ) + end +end + + +function EMA:SCENARIO_CRITERIA_UPDATE( event, ... ) + --EMA:Print("test3.5") + if EMA.db.enableQuestWatcher == true then + -- Wait a bit for the correct information to come through from the server... + EMA:ScheduleTimer( "EMAQuestWatcherUpdate", 1, true, "scenario" ) + + end +end + +function EMA:PLAYER_ENTERING_WORLD( event, ... ) + --EMA:Print("test4") + if EMA.db.enableQuestWatcher == true then + EMA:RemoveQuestsNotBeingWatched() + EMA:ScheduleTimer( "EMAQuestWatcherUpdate", 1, false, "all" ) + end +end + + +function EMA:PLAYER_REGEN_ENABLED( event, ... ) + if EMA.db.enableQuestWatcher == false then + return + end + if EMA.db.hideQuestWatcherInCombat == true then + EMA:SetQuestWatcherVisibility() + end +end + +function EMA:PLAYER_REGEN_DISABLED( event, ... ) + if EMA.db.enableQuestWatcher == false then + return + end + if EMA.db.hideQuestWatcherInCombat == true then + EMAQuestWatcherFrame:Hide() + end +end + +------------------------------------------------------------------------------------------------------------- +-- QUEST WATCHING +------------------------------------------------------------------------------------------------------------- + +function EMA:AbandonQuestDelayed() + EMA:RemoveCurrentQuestFromWatcherCache() + EMA:RemoveQuestsNotBeingWatched() +end + +function EMA:EMAQuestWatchListUpdateButtonClicked() + EMA:RemoveQuestsNotBeingWatched() + EMA:EMASendCommandToTeam( EMA.COMMAND_UPDATE_QUEST_WATCHER_LIST ) +end + +function EMA:DoQuestWatchListUpdate( characterName ) + EMA:EMAQuestWatcherUpdate( false, "all" ) + --EMA:EMAQuestWatcherScenarioUpdate( false ) +end + + +function EMA:GetQuestObjectiveCompletion( text ) + if text == nil then + return L["N/A"], L["N/A"] + end + local _, _, arg1, arg2 = string.find(text, "(.*):%s(.*)") + if arg1 and arg2 then + return arg2, arg1 + else + return L["N/A"], text + end +end + +--[[:GetQuestObjectiveCompletion( text ) + if text == nil then + return L["N/A"], L["N/A"] + end + local makeString = nil + local dig1, dig2 = string.match( text, "(%d*)/(%d*)") + if (dig1 and dig2) then + local arg1, arg2 = string.match(text, "(.-%S)%s(.*)") + EMA:Print("testm", arg1, "A", arg2) + makeString = dig1..L["/"]..dig2 + end + if makeString ~= nil then + local arg1, arg2 = string.match(text, "(.-%S)%s(.*)") + local textFind = string.find(arg1, "(%d*)") + EMA:Print("text", textFind) + if textFind then + return makeString, arg2 + else + return makeString, text + end + else + return L["DONE"] , text + end +end +]] +function EMA:QuestWatchGetObjectiveText( questIndex, objectiveIndex ) + local objectiveFullText, objectiveType, objectiveFinished = GetQuestLogLeaderBoard( objectiveIndex, questIndex ) + local amountCompleted, objectiveText = EMA:GetQuestObjectiveCompletion( objectiveFullText ) + return objectiveText +end + + + + +------------------------------------------------------------------------------------------------------------- +-- QUEST WATCH CACHE +------------------------------------------------------------------------------------------------------------- + +function EMA:IsQuestObjectiveInCache( questID, objectiveIndex ) + local key = questID..objectiveIndex + if EMA.questWatchCache[key] == nil then + return false + end + return true +end + +function EMA:AddQuestObjectiveToCache( questID, objectiveIndex, amountCompleted, objectiveFinished ) + local key = questID..objectiveIndex + EMA.questWatchCache[key] = {} + EMA.questWatchCache[key].questID = questID + EMA.questWatchCache[key].amountCompleted = amountCompleted + EMA.questWatchCache[key].objectiveFinished = objectiveFinished +end + +function EMA:GetQuestCachedValues( questID, objectiveIndex ) + local key = questID..objectiveIndex + return EMA.questWatchCache[key].amountCompleted, EMA.questWatchCache[key].objectiveFinished +end + +function EMA:UpdateQuestCachedValues( questID, objectiveIndex, amountCompleted, objectiveFinished ) + local key = questID..objectiveIndex + EMA.questWatchCache[key].amountCompleted = amountCompleted + EMA.questWatchCache[key].objectiveFinished = objectiveFinished +end + +function EMA:QuestCacheUpdate( questID, objectiveIndex, amountCompleted, objectiveFinished ) + if EMA:IsQuestObjectiveInCache( questID, objectiveIndex ) == false then + EMA:AddQuestObjectiveToCache( questID, objectiveIndex, amountCompleted, objectiveFinished ) + return true + end + local cachedAmountCompleted, cachedObjectiveFinished = EMA:GetQuestCachedValues( questID, objectiveIndex ) + if cachedAmountCompleted == amountCompleted and cachedObjectiveFinished == objectiveFinished then + return false + end + EMA:UpdateQuestCachedValues( questID, objectiveIndex, amountCompleted, objectiveFinished ) + return true +end + +function EMA:SetActiveQuestForQuestWatcherCache( questIndex ) + if EMA.db.enableQuestWatcher == false then + return + end + if questIndex ~= nil then + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questIndex ) + EMA.currentQuestForQuestWatcherID = questID + else + EMA.currentQuestForQuestWatcherID = nil + end +end + +function EMA:RemoveQuestFromWatcherCache( questID ) + EMA:DebugMessage( "RemoveQuestFromWatcherCache", questID ) + for key, questInfo in pairs( EMA.questWatchCache ) do + if questInfo.questID == questID then + EMA.questWatchCache[key].questID = nil + EMA.questWatchCache[key].amountCompleted = nil + EMA.questWatchCache[key].objectiveFinished = nil + EMA.questWatchCache[key] = nil + EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_WATCH_REMOVE_QUEST, questID ) + end + end +end + +function EMA:RemoveCurrentQuestFromWatcherCache() + if EMA.db.enableQuestWatcher == false then + return + end + EMA:DebugMessage( "RemoveCurrentQuestFromWatcherCache", EMA.currentQuestForQuestWatcherID ) + if EMA.currentQuestForQuestWatcherID == nil then + return + end + EMA:RemoveQuestFromWatcherCache( EMA.currentQuestForQuestWatcherID ) +end + +------------------------------------------------------------------------------------------------------------- +-- AUTO QUEST COMMUNICATION +------------------------------------------------------------------------------------------------------------- + +function EMA:IsCompletedAutoCompleteFieldQuest( questIndex, isComplete ) + -- Send an isComplete true flag if the quest is completed and is an in the field autocomplete quest. + if isComplete and isComplete > 0 then + if GetQuestLogIsAutoComplete( questIndex ) then + isComplete = true + else + isComplete = false + end + else + isComplete = false + end + return isComplete +end + +function EMA:QUEST_AUTOCOMPLETE( event, questID, ... ) + -- In the field autocomplete quest event. + if EMA.db.enableQuestWatcher == false then + return + end + EMA:EMASendCommandToTeam( EMA.COMMAND_AUTO_QUEST_COMPLETE, questID ) +end + +function EMA:DoAutoQuestFieldComplete( characterName, questID ) + EMA:EMAAddAutoQuestPopUp( questID, "COMPLETE", characterName ) +end + +function EMA:QUEST_COMPLETE() + if EMA.db.enableQuestWatcher == false then + return + end + EMA:EMASendCommandToTeam( EMA.COMMAND_REMOVE_AUTO_QUEST_COMPLETE, questID ) +end + +function EMA:DoRemoveAutoQuestFieldComplete( characterName, questID ) + EMA:EMARemoveAutoQuestPopUp( questID, characterName ) +end + +function EMA:QUEST_DETAIL() + if EMA.db.enableQuestWatcher == false then + return + end +-- if QuestGetAutoAccept() and QuestIsFromAreaTrigger() then +-- EMA:EMASendCommandToTeam( EMA.COMMAND_AUTO_QUEST_OFFER, GetQuestID() ) +-- end +end + +function EMA:DoAutoQuestFieldOffer( characterName, questID ) + EMA:EMAAddAutoQuestPopUp( questID, "OFFER", characterName ) +end + +------------------------------------------------------------------------------------------------------------- +-- QUEST WATCH COMMUNICATION +------------------------------------------------------------------------------------------------------------- + +function EMA:EMAQuestWatcherQuestLogUpdate( useCache ) + for i = 1, GetNumQuestLogEntries() do + local questID, title, questLogIndex, numObjectives, requiredMoney, isComplete, startEvent, isAutoComplete, failureTime, timeElapsed, questType, isTask, isBounty, isStory, isOnMap, hasLocalPOI, isHidden = GetQuestWatchInfo(i) + if questID ~= nil then + --EMA:Print("EMAQuestData", questID, title, questLogIndex, numObjectives, requiredMoney, isComplete, startEvent, isAutoComplete, failureTime, timeElapsed, questType, isTask, isBounty, isStory, isOnMap, hasLocalPOI, isHidden) + if numObjectives > 0 then + for iterateObjectives = 1, numObjectives do + --EMA:Print( "NumObjs:", numObjectives ) + local objectiveFullText, objectiveType, objectiveFinished = GetQuestLogLeaderBoard( iterateObjectives, questLogIndex ) + local amountCompleted, objectiveText = EMA:GetQuestObjectiveCompletion( objectiveFullText, objectiveType ) + if objectiveType == "progressbar" then + local progress = GetQuestProgressBarPercent( questID ) + objectiveText = "ProgressBar"..": "..objectiveText + amountCompleted = tostring(progress)..L["%"] + end + if objectiveFullText ~= nil then + --EMA:Print("test2", questID, title, iterateObjectives, objectiveText, amountCompleted, objectiveFinished, isComplete ) + if (EMA:QuestCacheUpdate( questID, iterateObjectives, amountCompleted, objectiveFinished ) == true) or (useCache == false) then + EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, questID, title, iterateObjectives, objectiveText, amountCompleted, isComplete, isComplete ) + end + end + end + end + end + end +end + +function EMA:EMAQuestWatcherUpdate( useCache, questType ) + if EMA.db.enableQuestWatcher == false then + return + end + if questType == "quest" or "all" then + EMA:EMAQuestWatcherQuestLogUpdate( useCache ) + end +end + +-- Gathers messages from team. +function EMA:DoQuestWatchObjectiveUpdate( characterName, questID, questName, objectiveIndex, objectiveText, amountCompleted, objectiveFinished, isComplete ) + EMA:UpdateQuestWatchList( questID, questName, objectiveIndex, objectiveText, characterName, amountCompleted, objectiveFinished, isComplete ) +end + +function EMA:UpdateQuestWatchList( questID, questName, objectiveIndex, objectiveText, characterName, amountCompleted, objectiveFinished, isComplete ) + --local characterName = (( Ambiguate( name, "none" ) )) + --EMA:Print( "UpdateQuestWatchList", questID, questName, objectiveIndex, objectiveText, characterName, amountCompleted, objectiveFinished, isComplete ) + local questHeaderPosition = EMA:GetQuestHeaderInWatchList( questID, questName, characterName ) + local objectiveHeaderPosition = EMA:GetObjectiveHeaderInWatchList( questID, questName, objectiveIndex, objectiveText, "", questHeaderPosition ) + local characterPosition = EMA:GetCharacterInWatchList( questID, objectiveIndex, characterName, amountCompleted, objectiveHeaderPosition, objectiveFinished ) + local totalAmountCompleted = EMA:GetTotalCharacterAmountFromWatchList( questID, objectiveIndex ) + objectiveHeaderPosition = EMA:GetObjectiveHeaderInWatchList( questID, questName, objectiveIndex, objectiveText, totalAmountCompleted, questHeaderPosition ) + -- isComplete piggybacks on the quest watch update, so we are always displaying a complete quest button (in case the QUEST_AUTOCOMPLETE event does not fire). + if isComplete == true then + EMA:DoAutoQuestFieldComplete( characterName, questID ) + end + if EMA.db.hideQuestIfAllComplete == true then + EMA:CheckQuestForAllObjectivesCompleteAndHide( questID ) + end + EMA:QuestWatcherQuestListScrollRefresh() + EMA:SetQuestWatcherVisibility() +end + +------------------------------------------------------------------------------------------------------------- + +function EMA:RemoveQuestFromWatchList( questID ) + EMA:RemoveQuestFromWatcherCache( questID ) + EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_WATCH_REMOVE_QUEST, questID ) +end + +function EMA:DoRemoveQuestFromWatchList( characterName, questID ) + -- Remove character lines for this character. + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + if questWatchInfo.questID == questID and questWatchInfo.character == characterName then + EMA:RemoveQuestWatchInfo( questWatchInfo.key ) + end + end + -- See if any character lines left, if none, then remove quest completely. + local found = false + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + if questWatchInfo.questID == questID and questWatchInfo.type == "CHARACTER_AMOUNT" then + found = true + end + end + if found == false then + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + if questWatchInfo.questID == questID then + EMA:RemoveQuestWatchInfo( questWatchInfo.key ) + end + end + else + -- Still some character lines left, update the total amount of objectives to reflect lost team member. + -- Find any remaining quest objective headers. + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + if questWatchInfo.questID == questID and questWatchInfo.type == "OBJECTIVE_HEADER" then + questWatchInfo.amount = EMA:GetTotalCharacterAmountFromWatchList( questID, questWatchInfo.objectiveIndex ) + -- If all done auto-collapse when complete, collapse objective header. + if (questWatchInfo.amount == L["DONE"]) and (EMA.db.doNotHideCompletedObjectives == true) then + questWatchInfo.childrenAreHidden = true + end + end + if questWatchInfo.questID == questID and questWatchInfo.type == "QUEST_HEADER" then + EMA:UpdateTeamQuestCountRemoveCharacter( questWatchInfo, characterName ) + if EMA.db.hideQuestIfAllComplete == true then + EMA:CheckQuestForAllObjectivesCompleteAndHide( questID ) + end + end + end + end + -- Remove any auto quest buttons. + EMA:DoRemoveAutoQuestFieldComplete( characterName, questID ) + EMA:QuestWatcherQuestListScrollRefresh() + EMA:SetQuestWatcherVisibility() +end + +------------------------------------------------------------------------------------------------------------- +-- QUEST WATCH DISPLAY LIST LOGIC +------------------------------------------------------------------------------------------------------------- + + +function EMA:GetTotalCharacterAmountFromWatchList( questID, objectiveIndex ) + local amount = 0 + local total = 0 + local countCharacters = 0 + local countDones = 0 + local questType = nil + local amountOverTotal = nil + local ProgressQuest = nil + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + local position = questWatchInfoContainer.position + if questWatchInfo.questID == questID and questWatchInfo.type == "CHARACTER_AMOUNT" and questWatchInfo.objectiveIndex == objectiveIndex then + countCharacters = countCharacters + 1 + local amountCompletedText = questWatchInfo.amount + if amountCompletedText == L["DONE"] then + countDones = countDones + 1 + end + local arg1, arg2 = string.match(amountCompletedText, "(%d*)/(%d*)") + if (arg1 ~= nil) and (arg2 ~= nil) then + if strtrim( arg1 ) ~= "" and strtrim( arg2 ) ~= "" then + amount = amount + tonumber( arg1 ) + total = total + tonumber( arg2 ) + end + else + local arg1 = string.match(amountCompletedText, "(%d*)") + if (arg1 ~= nil) then + if strtrim( arg1 ) ~= "" then + amount = amount + total = total + tonumber( arg1 ) + ProgressQuest = true + end + end + end + end + if questWatchInfo.questID == questID and questWatchInfo.type == "OBJECTIVE_HEADER" and string.find( questWatchInfo.information, "ProgressBar" ) then + questType = "ProgressBar" + end + end + if countCharacters == 0 then + return L["DONE"] + end + if questType == "ProgressBar" and ProgressQuest == true then + local totalChars = (100 * countCharacters) + local maths = (total / totalChars) * 100 + amountOverTotal = maths..L["%"] + else + if amount == total then + amountOverTotal = L["DONE"] + else + amountOverTotal = string.format( "%s/%s", amount, total ) + end + end + EMA:DebugMessage( "AMTOT:", amountOverTotal ) + if amountOverTotal == "0/0" then + --EMA:Print("test", countDones, countCharacters) + if countDones == countCharacters then + amountOverTotal = L["DONE"] + else + amountOverTotal = L["N/A"] + end + end + return amountOverTotal +end + +function EMA:RemoveQuestsNotBeingWatched() + EMA:UpdateAllQuestsInWatchList() + for checkQuestID, value in pairs( EMA.questWatchListOfQuests ) do + local found = false + for iterateWatchedQuests = 1, GetNumQuestWatches() do + local questIndex = GetQuestIndexForWatch( iterateWatchedQuests ) + if questIndex ~= nil then + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( questIndex ) + if checkQuestID == questID then + found = true + end + end + end + if found == false then + EMA:RemoveQuestFromWatchList( checkQuestID ) + end + end +end + +function EMA:UpdateAllQuestsInWatchList() + table.wipe( EMA.questWatchListOfQuests ) + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + -- TODO- whats going on here? + EMA.questWatchListOfQuests[questWatchInfoContainer.info.questID] = true + end +end + +function EMA:GetCharacterInWatchList( questID, objectiveIndex, characterName, amountCompleted, objectiveHeaderPosition, objectiveFinished ) + local characterPosition = -1 + local characterQuestWatchInfo + if objectiveFinished then + if EMA.db.showCompletedObjectivesAsDone == true then + amountCompleted = L["DONE"] + end + end + -- Try and find the character line. + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + local position = questWatchInfoContainer.position + if questWatchInfo.questID == questID and questWatchInfo.type == "CHARACTER_AMOUNT" and questWatchInfo.objectiveIndex == objectiveIndex and questWatchInfo.character == characterName then + -- Character line found. Update information. + questWatchInfo.amount = amountCompleted + characterQuestWatchInfo = questWatchInfo + characterPosition = position + break + end + end + -- Was not found, add character line. + if characterPosition == -1 then + -- Only if not completed or user wants to show completed. + if ((objectiveFinished == nil) or (objectiveFinished == false)) or (EMA.db.doNotHideCompletedObjectives == true) then + local questWatchInfo = EMA:CreateQuestWatchInfo( questID, "CHARACTER_AMOUNT", objectiveIndex, characterName, characterName, amountCompleted ) + EMA:InsertQuestWatchInfoToListAfterPosition( questWatchInfo, objectiveHeaderPosition ) + return objectiveHeaderPosition + 1 + end + return -1 + else + -- Character line was found. Remove it if objective finished? + if (objectiveFinished) and (EMA.db.doNotHideCompletedObjectives == false) then + EMA:RemoveQuestWatchInfo( characterQuestWatchInfo.key ) + return -1 + end + end + return -1 +end + +function EMA:GetObjectiveHeaderInWatchList( questID, questName, objectiveIndex, objectiveText, totalAmountCompleted, questHeaderPosition ) + --EMA:Print("testposition", questName, "oT", objectiveText, questHeaderPosition) + if strtrim( objectiveText ) == "" then + objectiveText = questName + end + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + local position = questWatchInfoContainer.position + if questWatchInfo.questID == questID and questWatchInfo.type == "OBJECTIVE_HEADER" and questWatchInfo.objectiveIndex == objectiveIndex then + questWatchInfo.information = objectiveText + questWatchInfo.amount = totalAmountCompleted + -- If all done auto-collapse when complete, collapse objective header. + if (questWatchInfo.amount == L["DONE"]) and (EMA.db.doNotHideCompletedObjectives == true) then + questWatchInfo.childrenAreHidden = true + end + return position + end + end + local questWatchInfo = EMA:CreateQuestWatchInfo( questID, "OBJECTIVE_HEADER", objectiveIndex, "", objectiveText, totalAmountCompleted ) + -- Hide the team list by default. + questWatchInfo.childrenAreHidden = true + EMA:InsertQuestWatchInfoToListAfterPosition( questWatchInfo, questHeaderPosition ) + return questHeaderPosition + 1 +end + +--TODO CLEAN UP + +function EMA:GetQuestItemFromQuestID(findQuestID) + for iterateQuests=1,GetNumQuestLogEntries() do + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID = GetQuestLogTitle(iterateQuests) + --if title ~= nil then + if not isHeader then + if findQuestID == questID then + local questItemLink, questItemIcon, questItemCharges = GetQuestLogSpecialItemInfo( iterateQuests ) + if questItemLink then + --EMA:Print("Item", questItemLink, questItemIcon, questID) + return questItemLink, questItemIcon + else + return nil, nil + end + end + end + end +end + +function EMA:GetQuestHeaderInWatchList( questID, questName, characterName ) + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + local position = questWatchInfoContainer.position + if questWatchInfo.questID == questID and questWatchInfo.type == "QUEST_HEADER" then + EMA:UpdateTeamQuestCountAddCharacter( questWatchInfo, characterName ) + + if EMA.db.hideQuestIfAllComplete == true then + EMA:CheckQuestForAllObjectivesCompleteAndHide( questID ) + end + return position + end + end + local questWatchInfo = EMA:CreateQuestWatchInfo( questID, "QUEST_HEADER", -1, "", questName, icon ) + + EMA:UpdateTeamQuestCountAddCharacter( questWatchInfo, characterName ) + if EMA.db.hideQuestIfAllComplete == true then + EMA:CheckQuestForAllObjectivesCompleteAndHide( questID ) + end + local newPositionAtEnd = EMA:GetQuestWatchMaximumOrder() + 1 + EMA:AddQuestWatchInfoToListAtPosition( questWatchInfo, newPositionAtEnd ) + return newPositionAtEnd +end + +function EMA:UpdateTeamQuestCount( questWatchInfo, characterName ) + local count = 0 + for character, dummy in pairs( questWatchInfo.teamCharacters ) do + count = count + 1 + end + questWatchInfo.questTeamCount = count +end + +function EMA:UpdateTeamQuestCountAddCharacter( questWatchInfo, name ) + + questWatchInfo.teamCharacters[name] = true + EMA:UpdateTeamQuestCount( questWatchInfo, name ) +end + +function EMA:UpdateTeamQuestCountRemoveCharacter( questWatchInfo, characterName ) + questWatchInfo.teamCharacters[characterName] = nil + EMA:UpdateTeamQuestCount( questWatchInfo, characterName ) +end + +function EMA:CheckQuestForAllObjectivesCompleteAndHide( questID ) + if EMA.db.hideQuestIfAllComplete == false then + return + end + -- If all objective headers for quest say "DONE" then hide quest if hideQuestIfAllComplete option set. + local allDone = true + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + if questWatchInfo.questID == questID and questWatchInfo.type == "OBJECTIVE_HEADER" then + if questWatchInfo.amount ~= L["DONE"] then + allDone = false + end + end + end + -- Set quest header hidden or not as appropriate. + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + if questWatchInfo.questID == questID and questWatchInfo.type == "QUEST_HEADER" then + questWatchInfo.childrenAreHidden = allDone + end + end +end + +------------------------------------------------------------------------------------------------------------- +-- QUEST WATCH INFO FUNCTIONS +------------------------------------------------------------------------------------------------------------- + +function EMA:CreateQuestWatchInfo( questID, type, objectiveIndex, character, information, amount ) + local questWatchInfo = {} + questWatchInfo.key = questID..type..objectiveIndex..character + questWatchInfo.questID = questID + questWatchInfo.type = type + questWatchInfo.objectiveIndex = objectiveIndex + questWatchInfo.character = character + questWatchInfo.information = information + questWatchInfo.amount = amount + questWatchInfo.childrenAreHidden = false + questWatchInfo.questTeamCount = 0 + questWatchInfo.teamCharacters = {} + return questWatchInfo +end + +function EMA:AddQuestWatchInfoToListAtPosition( questWatchInfo, position ) + EMA.questWatchObjectivesList[questWatchInfo.key] = {} + EMA.questWatchObjectivesList[questWatchInfo.key].position = position + EMA.questWatchObjectivesList[questWatchInfo.key].info = questWatchInfo +end + +function EMA:InsertQuestWatchInfoToListAfterPosition( questWatchInfo, position ) + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + local checkPosition = questWatchInfoContainer.position + if checkPosition > position then + questWatchInfoContainer.position = checkPosition + 1 + end + end + EMA:AddQuestWatchInfoToListAtPosition( questWatchInfo, position + 1 ) +end + +function EMA:RemoveQuestWatchInfo( key ) + local removedPosition = EMA.questWatchObjectivesList[key].position + for checkKey, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local checkPosition = questWatchInfoContainer.position + if checkPosition > removedPosition then + questWatchInfoContainer.position = checkPosition - 1 + end + end + EMA.questWatchObjectivesList[key].info.key = nil + EMA.questWatchObjectivesList[key].info.questID = nil + EMA.questWatchObjectivesList[key].info.type = nil + EMA.questWatchObjectivesList[key].info.objectiveIndex = nil + EMA.questWatchObjectivesList[key].info.character = nil + EMA.questWatchObjectivesList[key].info.information = nil + EMA.questWatchObjectivesList[key].info.amount = nil + EMA.questWatchObjectivesList[key].info.childrenAreHidden = nil + EMA.questWatchObjectivesList[key].info.questTeamCount = nil + table.wipe( EMA.questWatchObjectivesList[key].info.teamCharacters ) + table.wipe( EMA.questWatchObjectivesList[key].info ) + EMA.questWatchObjectivesList[key].info = nil + EMA.questWatchObjectivesList[key].position = nil + table.wipe( EMA.questWatchObjectivesList[key] ) + EMA.questWatchObjectivesList[key] = nil +end + +-- Get the largest order number from the quest watch list. +function EMA:GetQuestWatchMaximumOrder() + local largestPosition = 0 + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + local position = questWatchInfoContainer.position + if position > largestPosition then + largestPosition = position + end + end + return largestPosition +end + +function EMA:GetQuestWatchInfoFromKey( key ) + local questWatchInfo = EMA.questWatchObjectivesList[key].info + return questWatchInfo.information, questWatchInfo.amount, questWatchInfo.type, questWatchInfo.questID, questWatchInfo.childrenAreHidden, key, questWatchInfo.objectiveIndex +end + +-- Get the quest watch info at a specific position. +function EMA:GetQuestWatchInfoAtOrderPosition( position ) + local information = "" + local amount = "" + local type = "" + local questID = "" + local childrenAreHidden = "" + local key = "" + local questTeamCount = "" + local objectiveIndex = "" + for keyStored, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + local questWatchPosition = questWatchInfoContainer.position + if questWatchPosition == position then + information = questWatchInfo.information + amount = questWatchInfo.amount + type = questWatchInfo.type + questID = questWatchInfo.questID + childrenAreHidden = questWatchInfo.childrenAreHidden + key = keyStored + questTeamCount = questWatchInfo.questTeamCount + objectiveIndex = questWatchInfo.objectiveIndex + break + end + end + return information, amount, type, questID, childrenAreHidden, key, questTeamCount, objectiveIndex +end + +function EMA:ToggleChildrenAreHiddenQuestWatchInfoByKey( key ) + local questWatchInfo = EMA.questWatchObjectivesList[key].info + questWatchInfo.childrenAreHidden = not questWatchInfo.childrenAreHidden +end + +function EMA:CountLinesInQuestWatchList() + if EMA.questWatchObjectivesList == nil then + return 1 + end + local count = 1 + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + count = count + 1 + end + return count +end + +------------------------------------------------------------------------------------------------------------- +-- QUEST WATCH DISPLAY LIST MECHANICS +------------------------------------------------------------------------------------------------------------- + +function EMA:QuestWatcherQuestListDrawLine( frame, iterateDisplayRows, type, information, amount, childrenAreHidden, key, questTeamCount, questID ) + local toggleDisplay = "" + local padding = "" + local teamCount = "" + local textFont = EMA.SharedMedia:Fetch( "font", EMA.db.watchFontStyle ) + local textSize = EMA.db.watchFontSize + if type == "CHARACTER_AMOUNT" then + padding = " " + end + if type == "OBJECTIVE_HEADER" then + padding = " " + if childrenAreHidden == true then + toggleDisplay = "+ " + else + toggleDisplay = "- " + end + end + if type == "QUEST_HEADER" then + if questTeamCount ~= 0 then + teamCount = " ("..questTeamCount.."/"..EMAApi.GetTeamListMaximumOrderOnline()..") " + end + end + frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetFont( textFont , textSize , "OUTLINE") + frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetFont( textFont , textSize , "OUTLINE") + --EMA:Print("test2343", type, information ) + frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetText( padding..toggleDisplay..teamCount..information ) + frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetText( amount ) + if type == "QUEST_HEADER" then + if matchData then + frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 1.0, 0, 0, 1.0, 1.0 ) + frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 0, 0, 1.0, 1.0 ) + else + frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 1.0, 0.96, 0.41, 1.0 ) + frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 0.96, 0.41, 1.0 ) + end + + end + if InCombatLockdown() == false then + frame.questWatchList.rows[iterateDisplayRows].columns[1]:EnableMouse( true ) + frame.questWatchList.rows[iterateDisplayRows].columns[2]:EnableMouse( true ) + end + + if type == "OBJECTIVE_HEADER" then + + frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1.0 ) + frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( NORMAL_FONT_COLOR.r, NORMAL_FONT_COLOR.g, NORMAL_FONT_COLOR.b, 1.0 ) + + frame.questWatchList.rows[iterateDisplayRows].key = key + end +end + +function EMA:QuestWatcherQuestListScrollRefresh() + local frame = EMAQuestWatcherFrame + FauxScrollFrame_Update( + frame.questWatchList.listScrollFrame, + EMA:GetQuestWatchMaximumOrder(), + frame.questWatchList.rowsToDisplay, + frame.questWatchList.rowHeight + ) + frame.questWatchListOffset = FauxScrollFrame_GetOffset( frame.questWatchList.listScrollFrame ) + frame.dataRowOffset = 0 + local atLeastOneRowShowing = false + local afterTextEdit = false + for iterateDisplayRows = 1, frame.questWatchList.rowsToDisplay do + -- Reset. + frame.questWatchList.rows[iterateDisplayRows].key = "" + frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetText( "" ) + frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetText( "" ) + frame.questWatchList.rows[iterateDisplayRows].columns[1].textString:SetTextColor( 1.0, 1.0, 1.0, 1.0 ) + frame.questWatchList.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 1.0, 1.0, 1.0 ) + frame.questWatchList.rows[iterateDisplayRows].highlight:SetTexture( 0.0, 0.0, 0.0, 1.0 ) + -- Get data. + local dataRowNumber = iterateDisplayRows + frame.questWatchListOffset + frame.dataRowOffset + local foundDataRow = false + local finishedRows = false + while (foundDataRow == false) and (finishedRows == false) do + dataRowNumber = iterateDisplayRows + frame.questWatchListOffset + frame.dataRowOffset + if dataRowNumber > EMA:GetQuestWatchMaximumOrder() then + finishedRows = true + else + local information, amount, type, questID, childrenAreHidden, key, questTeamCount, objectiveIndex = EMA:GetQuestWatchInfoAtOrderPosition( dataRowNumber ) + + foundDataRow = true + if type == "QUEST_HEADER" then + -- In this case, children are hidden refers to itself as well. + if childrenAreHidden == true then + foundDataRow = false + frame.dataRowOffset = frame.dataRowOffset + 1 + end + end + if type == "OBJECTIVE_HEADER" then + local hideMe = false + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + if questWatchInfo.questID == questID and questWatchInfo.type == "QUEST_HEADER" then + hideMe = questWatchInfo.childrenAreHidden + break + end + end + if hideMe == true then + foundDataRow = false + frame.dataRowOffset = frame.dataRowOffset + 1 + end + end + -- If this is a character_amount type, find its parent objective header and see if its children are hidden. + if type == "CHARACTER_AMOUNT" then + local hideMe = false + for key, questWatchInfoContainer in pairs( EMA.questWatchObjectivesList ) do + local questWatchInfo = questWatchInfoContainer.info + if questWatchInfo.questID == questID and questWatchInfo.type == "OBJECTIVE_HEADER" and questWatchInfo.objectiveIndex == objectiveIndex then + hideMe = questWatchInfo.childrenAreHidden + break + end + end + if hideMe == true then + foundDataRow = false + frame.dataRowOffset = frame.dataRowOffset + 1 + end + end + end + + -- Put information and amount into columns. + local information, amount, type, questID, childrenAreHidden, key, questTeamCount, objectiveIndex = EMA:GetQuestWatchInfoAtOrderPosition( dataRowNumber ) + EMA:QuestWatcherQuestListDrawLine( frame, iterateDisplayRows, type, information, amount, childrenAreHidden, key, questTeamCount, questID ) + atLeastOneRowShowing = true + end + end + -- Adjust the scroll frame based on hidden rows. + if atLeastOneRowShowing == true then + FauxScrollFrame_Update( + frame.questWatchList.listScrollFrame, + EMA:GetQuestWatchMaximumOrder() - frame.dataRowOffset, + frame.questWatchList.rowsToDisplay, + frame.questWatchList.rowHeight + ) + end + EMA:DisplayAutoQuestPopUps() +end + + +function EMA:QuestWatcherQuestListRowClick( rowNumber, columnNumber ) + local frame = EMAQuestWatcherFrame + local key = frame.questWatchList.rows[rowNumber].key + if key ~= nil and key ~= "" then + local information, amount, type, questID, childrenAreHidden, keyStored = EMA:GetQuestWatchInfoFromKey( key ) + EMA:DebugMessage( "GetQuestWatchInfoFromKey", information, amount, type, questID, childrenAreHidden, keyStored, key ) + local questIndex = EMA:GetQuestLogIndexByName( information ) + if type == "QUEST_HEADER" then + if columnNumber == 1 then + ShowUIPanel(QuestLogFrame) + QuestLog_SetSelection( questIndex ) + end + end + if type == "OBJECTIVE_HEADER" then + if columnNumber == 1 then + EMA:ToggleChildrenAreHiddenQuestWatchInfoByKey( key ) + EMA:QuestWatcherQuestListScrollRefresh() + end + end + end +end + +function EMA.QuestWatcherQuestListRowRightClick( rowNumber, columnNumber ) + --EMA:Print("testRightClick", rowNumber, columnNumber ) + local frame = EMAQuestWatcherFrame + local key = frame.questWatchList.rows[rowNumber].key + if key ~= nil and key ~= "" then + local information, amount, type, questID, childrenAreHidden, keyStored = EMA:GetQuestWatchInfoFromKey( key ) + --EMA:Print("test", questID) + if type == "QUEST_HEADER" and columnNumber == 1 then + EMAQuestMapQuestOptionsDropDown.questID = questID + EMAQuestMapQuestOptionsDropDown.questText = information + ToggleDropDownMenu(1, nil, EMAQuestMapQuestOptionsDropDown, "cursor", 6, -6) + end + end +end + +function EMA.QuestWatcherQuestListRowOnEnter( rowNumber, columnNumber ) + +end + + +function EMA.QuestWatcherQuestListRowOnLeave() + GameTooltip:Hide() +end + +function EMAQuestMapQuestOptionsDropDown_Initialize(self) + CloseDropDownMenus() + local questID = EMAQuestMapQuestOptionsDropDown.questID + local questText = EMAQuestMapQuestOptionsDropDown.questText + if (questID ~= 0 ) then + local questLogIndex = GetQuestLogIndexByID(questID) + + local infoTitle = UIDropDownMenu_CreateInfo() + infoTitle.text = questText + infoTitle.isTitle = 1 + infoTitle.notCheckable = 1 + UIDropDownMenu_AddButton(infoTitle) + + local info = UIDropDownMenu_CreateInfo() + info.isNotRadio = true + info.notCheckable = true + info.text = OBJECTIVES_STOP_TRACKING + + info.func = function(_, questID) EMA:QuestMapQuestOptions_ToggleTrackQuest(questID, questText) end + info.arg1 = self.questID + info.checked = false + UIDropDownMenu_AddButton(info) + + if ( GetQuestLogPushable(questLogIndex) and IsInGroup() ) then + info.text = SHARE_QUEST + info.func = function(_, questID) EMA:QuestMapQuestOptions_ShareQuest(questID) end + info.arg1 = self.questID + UIDropDownMenu_AddButton(info) + end + info.text = ABANDON_QUEST + info.func = function(_, questID) EMA:QuestMapQuestOptions_AbandonQuest(questID, questText) end + info.arg1 = self.questID + info.disabled = nil + + UIDropDownMenu_AddButton(info) + + end +end + +function EMA:QuestMapQuestOptions_ToggleTrackQuest(questID, questText) + --EMA:Print("test", questID, questText) + EMAApi.EMAApiUnTrackQuest( questID, questText ) +end + +function EMA:QuestMapQuestOptions_ShareQuest( questID ) + local questLogIndex = GetQuestLogIndexByID(questID) + if questLogIndex then + QuestLogPushQuest(questLogIndex) + end +end + +function EMA:QuestMapQuestOptions_AbandonQuest(questID, questText) + EMAApi.EMAApiAbandonQuest(questID, questText) +end + +function EMA:UpdateQuestItemButton( rowNumber, itemName ) + if InCombatLockdown() == false then + local frame = EMAQuestWatcherFrame + frame.questWatchList.rows[rowNumber].columns[2]:SetAttribute("type1", "item") + frame.questWatchList.rows[rowNumber].columns[2]:SetAttribute( "item", itemName ) + end +end + +------------------------------------------------------------------------------------------------------------ +-- QUEST WATCH AUTO QUEST DISPLAY - MOSTLY BORROWED FROM BLIZZARD CODE +------------------------------------------------------------------------------------------------------------- + +function EMA:HasAtLeastOneAutoQuestPopup() + if #EMA.currentAutoQuestPopups == 0 then + return false + end + return true +end + +function EMA:EMAAddAutoQuestPopUp( questID, popUpType, characterName ) + if EMA.currentAutoQuestPopups[questID] == nil then + EMA.currentAutoQuestPopups[questID] = {} + end + EMA.currentAutoQuestPopups[questID][characterName] = popUpType +end + +function EMA:EMARemoveAutoQuestPopUp( questID, characterName ) + if EMA.currentAutoQuestPopups[questID] == nil then + return + end + EMA.currentAutoQuestPopups[questID][characterName] = nil + if #EMA.currentAutoQuestPopups[questID] == 0 then + table.wipe( EMA.currentAutoQuestPopups[questID] ) + EMA.currentAutoQuestPopups[questID] = nil + end +end + +function EMA:EMARemoveAllAutoQuestPopUps( questID ) + if EMA.currentAutoQuestPopups[questID] == nil then + return + end + table.wipe( EMA.currentAutoQuestPopups[questID] ) + EMA.currentAutoQuestPopups[questID] = nil +end + +function EMA:AutoQuestGetOrCreateFrame( parent, index ) + if _G["EMAWatchFrameAutoQuestPopUp"..index] then + return _G["EMAWatchFrameAutoQuestPopUp"..index] + end + local frame = CreateFrame( "SCROLLFRAME", "EMAWatchFrameAutoQuestPopUp"..index, parent ) + frame.index = index + frame:EnableMouse( true ) + local QuestName = frame:CreateFontString( "EMAWatchFrameAutoQuestPopUpQuestName"..index, "OVERLAY", "GameFontNormal" ) + QuestName:SetPoint( "TOP", frame, "TOP", 0, -12 ) + QuestName:SetTextColor( 1.00, 1.00, 1.00 ) + QuestName:SetText( "" ) + frame.QuestName = QuestName + local TopText = frame:CreateFontString( "EMAWatchFrameAutoQuestPopUpTopText"..index, "OVERLAY", "GameFontNormal" ) + TopText:SetPoint( "TOP", frame, "TOP", 0, -24 ) + TopText:SetTextColor( 1.00, 1.00, 1.00 ) + TopText:SetText( "" ) + frame.TopText = TopText + local BottomText = frame:CreateFontString( "EMAWatchFrameAutoQuestPopUpBottomText"..index, "OVERLAY", "GameFontNormal" ) + BottomText:SetPoint( "TOP", frame, "TOP", 0, -36 ) + BottomText:SetTextColor( 1.00, 1.00, 1.00 ) + BottomText:SetText( "BottomText" ) + frame.BottomText = BottomText + EMA.countAutoQuestPopUpFrames = EMA.countAutoQuestPopUpFrames + 1 + return frame +end + +function EMA:DisplayAutoQuestPopUps() + local nextAnchor + local countPopUps = 0 + local iterateQuestPopups = 01 + EMAQuestWatcherFrame.autoQuestPopupsHeight = 0 + local parentFrame = EMAQuestWatcherFrame.fieldNotifications + for questID, characterInfo in pairs( EMA.currentAutoQuestPopups ) do + local characterName, characterPopUpType, popUpType + local characterList = "" + for characterName, characterPopUpType in pairs( characterInfo ) do + --characterList = characterList..characterName.." " + characterList = characterList..( Ambiguate( characterName, "none" ) ).." " + -- TODO - hack, assuming all characters have the same sort of popup. + popUpType = characterPopUpType + end + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( GetQuestLogIndexByID( questID ) ) + if isComplete and isComplete > 0 then + isComplete = true + else + isComplete = false + end + -- If the current character does not have the quest, show the character names that do have it. + local clickToViewText = QUEST_WATCH_POPUP_CLICK_TO_VIEW + if not (title and title ~= "") then + title = characterList + clickToViewText = "" + end + local frame = EMA:AutoQuestGetOrCreateFrame( parentFrame, countPopUps + 1 ) + frame:Show() + frame:ClearAllPoints() + frame:SetParent( parentFrame ) + if isComplete == true and popUpType == "COMPLETE" then + frame.TopText:SetText( QUEST_WATCH_POPUP_CLICK_TO_COMPLETE ) + frame.BottomText:Hide() + frame:SetHeight( 32 ) + frame.type = "COMPLETED" + frame:HookScript( "OnMouseUp", function() + ShowQuestComplete( GetQuestLogIndexByID( questID ) ) + EMA:EMARemoveAllAutoQuestPopUps( questID ) + EMA:DisplayAutoQuestPopUps() + EMA:SettingsUpdateBorderStyle() + EMA:SettingsUpdateFontStyle() + end ) + elseif popUpType == "OFFER" then + frame.TopText:SetText( QUEST_WATCH_POPUP_QUEST_DISCOVERED ) + frame.BottomText:Show() + frame.BottomText:SetText( clickToViewText ) + frame:SetHeight( 48 ) + frame.type = "OFFER" + frame:HookScript( "OnMouseUp", function() + EMA:EMARemoveAllAutoQuestPopUps( questID ) + EMA:DisplayAutoQuestPopUps() + EMA:SettingsUpdateBorderStyle() + EMA:SettingsUpdateFontStyle() + end ) + end + frame:ClearAllPoints() + if nextAnchor ~= nil then + if iterateQuestPopups == 1 then + frame:SetPoint( "TOP", nextAnchor, "BOTTOM", 0, 0 ) -- -WATCHFRAME_TYPE_OFFSET + else + frame:SetPoint( "TOP", nextAnchor, "BOTTOM", 0, 0 ) + end + else + frame:SetPoint( "TOP", parentFrame, "TOP", 0, 5 ) -- -WATCHFRAME_INITIAL_OFFSET + end + frame:SetPoint( "LEFT", parentFrame, "LEFT", -20, 0 ) + frame.QuestName:SetText( title ) + frame.questId = questID + --frame:UpdateScrollChildRect() + --frame:SetVerticalScroll( floor( -9 + 0.5 ) ) + nextAnchor = frame + countPopUps = countPopUps + 1 + EMAQuestWatcherFrame.autoQuestPopupsHeight = EMAQuestWatcherFrame.autoQuestPopupsHeight + frame:GetHeight() + end + for iterateQuestPopups = countPopUps + 1, EMA.countAutoQuestPopUpFrames do + _G["EMAWatchFrameAutoQuestPopUp"..iterateQuestPopups].questId = nil + _G["EMAWatchFrameAutoQuestPopUp"..iterateQuestPopups]:Hide() + end + EMA:UpdateQuestWatcherDimensions() +end + +------------------------------------------------------------------------------------------------------------- +-- QUEST WATCH HELPERS +------------------------------------------------------------------------------------------------------------- + +function EMA:GetQuestLogIndexByName( questName ) + for iterateQuests = 1, GetNumQuestLogEntries() do + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( iterateQuests ) + if not isHeader then + if title == questName then + return iterateQuests + end + end + end + return 0 +end + +function EMA:GetQuestLogIndexByID( inQuestID ) + for iterateQuests = 1, GetNumQuestLogEntries() do + local title, level, suggestedGroup, isHeader, isCollapsed, isComplete, frequency, questID, startEvent, displayQuestID, isOnMap, hasLocalPOI, isTask, isStory = GetQuestLogTitle( iterateQuests ) + if not isHeader then + if questID == inQuestID then + return iterateQuests + end + end + end + return 0 +end + +------------------------------------------------------------------------------------------------------------- +-- COMMAND MANAGEMENT +------------------------------------------------------------------------------------------------------------- + +-- A EMA command has been recieved. +function EMA:EMAOnCommandReceived( characterName, commandName, ... ) + + if commandName == EMA.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE then + EMA:DoQuestWatchObjectiveUpdate( characterName, ... ) + end + if commandName == EMA.COMMAND_UPDATE_QUEST_WATCHER_LIST then + EMA:DoQuestWatchListUpdate( characterName, ... ) + end + if commandName == EMA.COMMAND_QUEST_WATCH_REMOVE_QUEST then + EMA:DoRemoveQuestFromWatchList( characterName, ... ) + end + if commandName == EMA.COMMAND_AUTO_QUEST_COMPLETE then + EMA:DoAutoQuestFieldComplete( characterName, ... ) + end + if commandName == EMA.COMMAND_REMOVE_AUTO_QUEST_COMPLETE then + EMA:DoRemoveAutoQuestFieldComplete( characterName, ... ) + end + if commandName == EMA.COMMAND_AUTO_QUEST_OFFER then + EMA:DoAutoQuestFieldOffer( characterName, ... ) + + end +end diff --git a/Modules/QuestWatcher.lua b/Modules/QuestWatcher.lua index cd80cac..89c1113 100644 --- a/Modules/QuestWatcher.lua +++ b/Modules/QuestWatcher.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -10,6 +10,11 @@ -- -- -- ================================================================================ -- +-- Only Load for Live +if _G.WOW_PROJECT_ID ~= _G.WOW_PROJECT_MAINLINE then + return +end + -- Create the addon using AceAddon-3.0 and embed some libraries. local EMA = LibStub( "AceAddon-3.0" ):NewAddon( "QuestWatcher", @@ -20,8 +25,6 @@ local EMA = LibStub( "AceAddon-3.0" ):NewAddon( "AceTimer-3.0" ) - - -- Load libraries. local EMAUtilities = LibStub:GetLibrary( "EbonyUtilities-1.0" ) local EMAHelperSettings = LibStub:GetLibrary( "EMAHelperSettings-1.0" ) @@ -1351,7 +1354,7 @@ function EMA:EMAQuestWatcherScenarioUpdate(useCache) local name = "Scenario:"..stageName.." "..currentStage.."/"..numStages --EMA:Print("scenarioProgressInfo", questID, name, criteriaIndex, stageDescription , amountCompleted , totalQuantity, completed ) --EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, questID, name, numCriteria, stageDescription , amountCompleted , totalQuantity, completed ) - EMA:DoQuestWatchObjectiveUpdate( EMA.CharacterName, questID, name, numCriteria, stageDescription , amountCompleted , totalQuantity, completed ) + EMA:DoQuestWatchObjectiveUpdate( EMA.characterName, questID, name, numCriteria, stageDescription , amountCompleted , totalQuantity, completed ) else --EMA:Print("ScenarioDONE", stageDescription) local questID = 1001 @@ -1484,7 +1487,7 @@ function EMA:EMAQuestWatcherWorldQuestUpdate( useCache ) local progress = GetQuestProgressBarPercent( info.questID ) local amountCompleted = tostring(progress)..L["%"] --EMA:Print("QuestPercent", title, objectiveText, amountCompleted ) - local EditedQuestName = tostring("Bonus:")..(info.title) + local EditedQuestName = tostring("Bonus: ")..(info.title) --EMA:Print("BarQuest", info.questID, name, iterateObjectives, objectiveText, amountCompleted, objectiveFinished, isComplete) if (EMA:QuestCacheUpdate( info.questID, iterateObjectives, amountCompleted, objectiveFinished ) == true) or (useCache == false) then EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, info.questID, EditedQuestName, iterateObjectives, objectiveText, amountCompleted, objectiveFinished, isComplete ) @@ -1494,7 +1497,7 @@ function EMA:EMAQuestWatcherWorldQuestUpdate( useCache ) if (EMA:QuestCacheUpdate( info.questID, iterateObjectives, amountCompleted, objectiveFinished ) == true) or (useCache == false) then --EMA:Print( "UPDATE:", "cache:", useCache, "QuestID", questID, "ObjectID", iterateObjectives ) --EMA:Print("sendingquestdata", info.title, info.questID, objectiveText, amountCompleted, finished ) - local name = tostring("Bonus:")..(info.title) + local name = tostring("Bonus: ")..(info.title) EMA:EMASendCommandToTeam( EMA.COMMAND_QUEST_WATCH_OBJECTIVE_UPDATE, info.questID, name, iterateObjectives, objectiveText, amountCompleted, objectiveFinished, isComplete ) end end diff --git a/Modules/Sell.lua b/Modules/Sell.lua index 245a86f..167c783 100644 --- a/Modules/Sell.lua +++ b/Modules/Sell.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -31,9 +31,8 @@ EMA.moduleName = "Sell" EMA.settingsDatabaseName = "SellProfileDB" EMA.chatCommand = "ema-sell" local L = LibStub( "AceLocale-3.0" ):GetLocale( "Core" ) -EMA.parentDisplayName = L["VENDER"] -EMA.moduleDisplayName = L["VENDER"] -EMA.moduleDisplayVenderName = L["VENDER_LIST_MODULE"] +EMA.parentDisplayName = L["VENDOR"] +EMA.moduleDisplayName = L["VENDOR"] -- Icon EMA.moduleIcon = "Interface\\Addons\\EMA\\Media\\SellIcon.tga" -- order @@ -55,7 +54,7 @@ EMA.settings = { globalSellList = false, autoSellItem = false, blackListItem = false, - destroyItem = false, + --destroyItem = false, -- Gray autoSellPoor = false, autoSellBoEPoor = false, @@ -73,7 +72,9 @@ EMA.settings = { autoSellBoEEpic = false, -- Toys autoSellToys = false, - autoSellMounts = false, + autoSellMounts = false, + -- 9.0.3 + alreadyWipedLists = false }, } @@ -186,22 +187,24 @@ function EMA:SettingsRefresh() EMA.settingsControl.editBoxAutoSellIlvlEpic:SetDisabled ( not EMA.db.autoSellEpic or not EMA.db.autoSellItem ) EMA.settingsControl.checkBoxAutoSellBoEEpic:SetDisabled ( not EMA.db.autoSellEpic or not EMA.db.autoSellItem ) -- Toys - EMA.settingsControl.checkBoxAutoSellToys:SetValue( EMA.db.autoSellToys ) - EMA.settingsControl.checkBoxAutoSellToys:SetDisabled ( not EMA.db.autoSellItem ) -EMA.settingsControl.checkBoxAutoSellMounts:SetValue( EMA.db.autoSellMounts ) - EMA.settingsControl.checkBoxAutoSellMounts:SetDisabled ( not EMA.db.autoSellItem ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + EMA.settingsControl.checkBoxAutoSellToys:SetValue( EMA.db.autoSellToys ) + EMA.settingsControl.checkBoxAutoSellToys:SetDisabled ( not EMA.db.autoSellItem ) + EMA.settingsControl.checkBoxAutoSellMounts:SetValue( EMA.db.autoSellMounts ) + EMA.settingsControl.checkBoxAutoSellMounts:SetDisabled ( not EMA.db.autoSellItem ) + end -- Messages. EMA.settingsControl.dropdownMessageArea:SetValue( EMA.db.messageArea ) -- list. EMA.settingsControl.listCheckBoxBoxOtherBlackListItem:SetValue( EMA.db.blackListItem ) - EMA.settingsControl.listCheckBoxBoxOtherDestroy:SetValue( EMA.db.destroyItem ) + --EMA.settingsControl.listCheckBoxBoxOtherDestroy:SetValue( EMA.db.destroyItem ) EMA.settingsControl.listEditBoxOtherTag:SetText( EMA.autoSellOtherItemTag ) EMA.settingsControl.listEditBoxOtherItem:SetDisabled( not EMA.db.autoSellItem ) EMA.settingsControl.listEditBoxOtherTag:SetDisabled( not EMA.db.autoSellItem ) EMA.settingsControl.listButtonRemove:SetDisabled( not EMA.db.autoSellItem ) EMA.settingsControl.listButtonAdd:SetDisabled( not EMA.db.autoSellItem ) EMA.settingsControl.listCheckBoxBoxOtherBlackListItem:SetDisabled( not EMA.db.autoSellItem or not EMA.db.autoSellItem ) - EMA.settingsControl.listCheckBoxBoxOtherDestroy:SetDisabled( not EMA.db.autoSellItem or not EMA.db.autoSellItem ) + --EMA.settingsControl.listCheckBoxBoxOtherDestroy:SetDisabled( not EMA.db.autoSellItem or not EMA.db.autoSellItem ) --EMA.settingsControl.listEditBoxOtherItem:RegisterForClicks( "RightButtonDown" ) @@ -314,10 +317,10 @@ local function SettingsCreateMain( top ) list.listWidth = listWidth list.rowHeight = 15 list.rowsToDisplay = 8 - list.columnsToDisplay = 4 + list.columnsToDisplay = 3 list.columnInformation = {} list.columnInformation[1] = {} - list.columnInformation[1].width = 45 + list.columnInformation[1].width = 60 list.columnInformation[1].alignment = "LEFT" list.columnInformation[2] = {} list.columnInformation[2].width = 20 @@ -325,9 +328,11 @@ local function SettingsCreateMain( top ) list.columnInformation[3] = {} list.columnInformation[3].width = 20 list.columnInformation[3].alignment = "LEFT" + --[[ list.columnInformation[4] = {} list.columnInformation[4].width = 20 list.columnInformation[4].alignment = "LEFT" + ]] list.scrollRefreshCallback = EMA.SettingslistScrollRefresh list.rowClickCallback = EMA.SettingslistRowClick EMA.settingsControl.list = list @@ -362,6 +367,7 @@ local function SettingsCreateMain( top ) EMA.SettingsToggleBlackListItem, L["BLACKLIST_ITEM_HELP"] ) + --[[ EMA.settingsControl.listCheckBoxBoxOtherDestroy = EMAHelperSettings:CreateCheckBox( EMA.settingsControl, thirdWidth, @@ -371,6 +377,7 @@ local function SettingsCreateMain( top ) EMA.SettingsToggleDestroyItem, L["DESTROY_ITEM_HELP"] ) + ]] EMA.settingsControl.listEditBoxOtherTag = EMAHelperSettings:CreateDropdown( EMA.settingsControl, dropBoxWidth, @@ -500,25 +507,27 @@ local function SettingsCreateMain( top ) ) EMA.settingsControl.editBoxAutoSellIlvlEpic:SetCallback( "OnEnterPressed", EMA.SettingsEditBoxChangedIlvlEpic ) -- Toy - movingTop = movingTop - editBoxHeight - 3 - EMA.settingsControl.checkBoxAutoSellToys = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - thirdWidth, - left, - movingTop + movingTopEdit, - L["AUTO_SELL_TOYS"], - EMA.SettingsToggleAutoSellToys, - L["AUTO_SELL_TOYS_HELP"] - ) -EMA.settingsControl.checkBoxAutoSellMounts = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - thirdWidth, - left2, - movingTop + movingTopEdit, - L["AUTO_SELL_MOUNTS"], - EMA.SettingsToggleAutoSellMounts, - L["AUTO_SELL_MOUNTS_HELP"] - ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + movingTop = movingTop - editBoxHeight - 3 + EMA.settingsControl.checkBoxAutoSellToys = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + thirdWidth, + left, + movingTop + movingTopEdit, + L["AUTO_SELL_TOYS"], + EMA.SettingsToggleAutoSellToys, + L["AUTO_SELL_TOYS_HELP"] + ) + EMA.settingsControl.checkBoxAutoSellMounts = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + thirdWidth, + left2, + movingTop + movingTopEdit, + L["AUTO_SELL_MOUNTS"], + EMA.SettingsToggleAutoSellMounts, + L["AUTO_SELL_MOUNTS_HELP"] + ) + end movingTop = movingTop - editBoxHeight - 3 EMAHelperSettings:CreateHeading( EMA.settingsControl, L["SELL"]..L[" "]..L["MESSAGES_HEADER"], movingTop, false ) movingTop = movingTop - headingHeight @@ -575,8 +584,8 @@ function EMA:SettingslistScrollRefresh() EMA.settingsControl.list.rows[iterateDisplayRows].columns[2].textString:SetTextColor( 1.0, 1.0, 1.0, 1.0 ) EMA.settingsControl.list.rows[iterateDisplayRows].columns[3].textString:SetText( "" ) EMA.settingsControl.list.rows[iterateDisplayRows].columns[3].textString:SetTextColor( 1.0, 0, 0, 1.0 ) - EMA.settingsControl.list.rows[iterateDisplayRows].columns[4].textString:SetText( "" ) - EMA.settingsControl.list.rows[iterateDisplayRows].columns[4].textString:SetTextColor( 1.0, 0, 0, 1.0 ) + --EMA.settingsControl.list.rows[iterateDisplayRows].columns[4].textString:SetText( "" ) + --EMA.settingsControl.list.rows[iterateDisplayRows].columns[4].textString:SetTextColor( 1.0, 0, 0, 1.0 ) EMA.settingsControl.list.rows[iterateDisplayRows].highlight:SetColorTexture( 0.0, 0.0, 0.0, 0.0 ) -- Get data. @@ -589,13 +598,13 @@ function EMA:SettingslistScrollRefresh() if listInformation.blackList == true then blackListText = L["ITEM_ON_BLACKLIST"] end - if listInformation.destroyItem == true then + if listInformation.destroyItem == true then destroyText = L["DESTROY_ITEM"] end EMA.settingsControl.list.rows[iterateDisplayRows].columns[1].textString:SetText( listInformation.name ) EMA.settingsControl.list.rows[iterateDisplayRows].columns[2].textString:SetText( listInformation.tag ) EMA.settingsControl.list.rows[iterateDisplayRows].columns[3].textString:SetText( blackListText ) - EMA.settingsControl.list.rows[iterateDisplayRows].columns[4].textString:SetText( destroyText ) + --EMA.settingsControl.list.rows[iterateDisplayRows].columns[4].textString:SetText( destroyText ) -- Highlight the selected row. if dataRowNumber == EMA.settingsControl.listHighlightRow then EMA.settingsControl.list.rows[iterateDisplayRows].highlight:SetColorTexture( 1.0, 1.0, 0.0, 0.5 ) @@ -745,16 +754,17 @@ function EMA:SettingsToggleBlackListItem( event, checked ) EMA:SettingsRefresh() end +--[[ function EMA:SettingsToggleDestroyItem( event, checked ) EMA.db.destroyItem = checked EMA:SettingsRefresh() end - +]] function EMA:SettingslistAddClick( event ) --EMA:Print("test", EMA.autoSellOtherItemLink, EMA.autoSellOtherItemTag ) if EMA.autoSellOtherItemLink ~= nil and EMA.autoSellOtherItemTag ~= nil then - EMA:AddOther( EMA.autoSellOtherItemLink, EMA.autoSellOtherItemTag, EMA.db.blackListItem, EMA.db.destroyItem ) + EMA:AddOther( EMA.autoSellOtherItemLink, EMA.autoSellOtherItemTag, EMA.db.blackListItem ) --, EMA.db.destroyItem ) EMA.autoSellOtherItemLink = nil EMA.settingsControl.listEditBoxOtherItem:SetText( "" ) EMA:SettingsRefresh() @@ -805,7 +815,9 @@ function EMA:OnInitialize() -- Populate the settings. EMA:SettingsRefresh() -- Initialise the popup dialogs. - InitializePopupDialogs() + InitializePopupDialogs() + -- 9.0.3 Remove DESTROY_ITEM + EMA:ClearList() end -- Called when the addon is enabled. @@ -890,7 +902,7 @@ function EMA:GetOtherAtPosition( position ) end end -function EMA:AddOther( itemLink, itemTag, blackList, destroy ) +function EMA:AddOther( itemLink, itemTag, blackList) --, destroy ) --EMA:Print( itemLink, itemTag, blackList, destroy ) -- Get some more information about the item. local name, link, quality, iLevel, reqLevel, class, subclass, maxStack, equipSlot, texture, vendorPrice = GetItemInfo( itemLink ) @@ -913,6 +925,7 @@ function EMA:AddOther( itemLink, itemTag, blackList, destroy ) end function EMA:RemoveOther() + --EMA:Print("test", EMA.settingsControl.listHighlightRow) if EMA.db.globalSellList == true then table.remove( EMA.db.global.autoSellOtherItemsListGlobal, EMA.settingsControl.listHighlightRow ) else @@ -958,7 +971,9 @@ function EMA:DoMerchantSellItems() local iLvl = C_Item.GetCurrentItemLevel( location ) local _, itemCount = GetContainerItemInfo( bagID, slotID ) local itemName, _, _, _, _, _, _, _, _, _, itemSellPrice = GetItemInfo( itemLink ) - local hasToy = PlayerHasToy(bagItemID) + if EMAPrivate.Core.isEmaClassicBccBuild == false then + local hasToy = PlayerHasToy(bagItemID) + end --EMA:Print("ItemTest", bagItemID, itemLink, itemRarity, itemType, isBop, itemRarity, iLvl, itemSellPrice) local canSell = false local canDestroy = false @@ -1041,7 +1056,7 @@ function EMA:DoMerchantSellItems() end end -- Toys - if EMA.db.autoSellToys == true then + if EMA.db.autoSellToys == true and EMAPrivate.Core.isEmaClassicBccBuild == false then if hasToy == true and isBop == true then --EMA:Print("ToyTest", hasToy, itemSellPrice ) if itemSellPrice > 0 then @@ -1050,12 +1065,11 @@ function EMA:DoMerchantSellItems() else --EMA:Print("canNotSellToy") canSell = true - canDestroy = true end end end -- Mounts - if EMA.db.autoSellMounts == true then + if EMA.db.autoSellMounts == true and EMAPrivate.Core.isEmaClassicBccBuild == false then local mountIDs = C_MountJournal.GetMountIDs() for i = 1, #mountIDs do local creatureName,mountSpellID,_,_,_,_,_,_,_,_, isCollected, mountID = C_MountJournal.GetMountInfoByID(mountIDs[i]) @@ -1069,7 +1083,6 @@ function EMA:DoMerchantSellItems() else --EMA:Print("canNotSellToy") canSell = true - canDestroy = true end end end @@ -1082,7 +1095,6 @@ function EMA:DoMerchantSellItems() itemTable = EMA.db.autoSellOtherItemsList end for position, itemInformation in pairs( itemTable ) do - if EMAApi.IsCharacterInGroup( EMA.characterName, itemInformation.tag ) == true then if EMAUtilities:DoItemLinksContainTheSameItem( itemLink, itemInformation.link ) then --EMA:Print("DataTest", itemInformation.blackList, itemInformation.destroyItem ) @@ -1090,10 +1102,6 @@ function EMA:DoMerchantSellItems() canSell = true if itemInformation.blackList == true then canSell = false - end - if itemInformation.destroyItem == true then - --canSell = false - canDestroy = true end end end @@ -1114,14 +1122,6 @@ function EMA:DoMerchantSellItems() --EMA:Print("can sell now", bagID, slotID ) EMA:ScheduleTimer("SellItem", sellCount, bagID, slotID, itemCount ) - end - else - if canDestroy == true then - if EMAUtilities:MerchantFrameIsShown() == true then - PickupContainerItem(bagID,slotID) - DeleteCursorItem() - EMA:EMASendMessageToTeam( EMA.db.messageArea, L["DELETE_ITEM"]( itemLink ), false ) - end end end end @@ -1143,7 +1143,7 @@ function EMA:SellItem( bagID, slotID, itemCount ) end -function EMA:TellTeam( count, gold ) +function EMA:TellTeam( count, gold ) --EMA:Print("tellTeam", count, gold ) if count > 0 then local formattedGoldAmount = GetCoinTextureString(gold) @@ -1156,4 +1156,26 @@ function EMA:EMAOnCommandReceived( characterName, commandName, ... ) if commandName == EMA.COMMAND_SELL_ITEM then EMA:DoSellItem( ... ) end -end \ No newline at end of file +end + +-- 9.0.3 Remove destroyItem from the tables +function EMA:ClearList() + if EMA.db.alreadyWipedLists == false then + local itemTable = EMA.db.global.autoSellOtherItemsListGlobal + local itemTableTwo = EMA.db.autoSellOtherItemsList + for position, itemInformation in pairs( itemTable ) do + if itemInformation.destroyItem == true then + table.remove( EMA.db.global.autoSellOtherItemsListGlobal, position ) + end + end + for position, itemInformation in pairs( itemTableTwo ) do + if itemInformation.destroyItem == true then + table.remove( EMA.db.autoSellOtherItemsList, position ) + end + end + EMA:SettingsRefresh() + EMA.db.alreadyWipedLists = true + end +end + +EMAApi.ClearList = EMA.ClearList \ No newline at end of file diff --git a/Modules/Sync.lua b/Modules/Sync.lua deleted file mode 100644 index 0f5fd2a..0000000 --- a/Modules/Sync.lua +++ /dev/null @@ -1,380 +0,0 @@ --- ================================================================================ -- --- EMA - ( Ebony's MultiBoxing Assistant ) -- --- Current Author: Jennifer Cally (Ebony) -- --- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- --- -- --- Some Code Used from "Jamba" that is -- --- Released under the MIT License -- --- "Jamba" Copyright 2008-2015 Michael "Jafula" Miller -- --- -- --- ================================================================================ -- - --- Create the addon using AceAddon-3.0 and embed some libraries. -local EMA = LibStub( "AceAddon-3.0" ):NewAddon( - "Sync", - "Module-1.0", - "AceConsole-3.0", - "AceEvent-3.0", - "AceHook-3.0", - "AceTimer-3.0" -) - --- Get the EMA Utilities Library. -local EMAUtilities = LibStub:GetLibrary( "EbonyUtilities-1.0" ) -local EMAHelperSettings = LibStub:GetLibrary( "EMAHelperSettings-1.0" ) - --- Constants and Locale for this module. -EMA.moduleName = "Sync" -EMA.settingsDatabaseName = "SyncProfileDB" -EMA.chatCommand = "ema-Sync" -local L = LibStub( "AceLocale-3.0" ):GetLocale( "Core" ) -EMA.parentDisplayName = L["SYNC"] -EMA.moduleDisplayName = L["SYNC"] - --- Settings - the values to store and their defaults for the settings database. -EMA.settings = { - profile = { - mountWithTeam = false, - dismountWithTeam = false, - dismountWithMaster = false, - mountInRange = false, - - --messageArea = EMAApi.DefaultMessageArea(), - warningArea = EMAApi.DefaultWarningArea() - }, -} - --- Configuration. -function EMA:GetConfiguration() - local configuration = { - name = EMA.moduleDisplayName, - handler = EMA, - type = 'group', - childGroups = "tab", - get = "EMAConfigurationGetSetting", - set = "EMAConfigurationSetSetting", - args = { - config = { - type = "input", - name = L["OPEN_CONFIG"], - desc = L["OPEN_CONFIG_HELP"], - usage = "/ema-sync config", - get = false, - set = "", - }, - push = { - type = "input", - name = L["Push Settings"], - desc = L["Push the Mount settings to all characters in the team."], - usage = "/EMA-sync push", - get = false, - set = "EMASendSettings", - order = 4, - guiHidden = true, - }, - }, - } - return configuration -end - -------------------------------------------------------------------------------------------------------------- --- Command this module sends. -------------------------------------------------------------------------------------------------------------- - -EMA.COMMAND_MOUNT_ME = "EMAMountMe" -EMA.COMMAND_MOUNT_DISMOUNT = "EMAMountDisMount" - -------------------------------------------------------------------------------------------------------------- --- Messages module sends. -------------------------------------------------------------------------------------------------------------- - - -------------------------------------------------------------------------------------------------------------- --- Addon initialization, enabling and disabling. -------------------------------------------------------------------------------------------------------------- - --- Initialise the module. -function EMA:OnInitialize() - -- Create the settings control. - EMA:SettingsCreate() - -- Initialse the EMAModule part of this module. - EMA:EMAModuleInitialize( EMA.settingsControl.widgetSettings.frame ) - -- Populate the settings. - EMA:SettingsRefresh() - -- BlizzUI Frames - EMA:CreateEMAInterFaceSyncFrame() -end - --- Called when the addon is enabled. -function EMA:OnEnable() --- EMA:RegisterEvent("PLAYER_REGEN_ENABLED") - - EMA:HookScript( InterfaceOptionsFrame, "OnShow", "InterfaceOptionsFrameOnShow" ) - EMA:RegisterMessage( EMAApi.MESSAGE_MESSAGE_AREAS_CHANGED, "OnMessageAreasChanged" ) - -end - --- Called when the addon is disabled. -function EMA:OnDisable() - -- AceHook-3.0 will tidy up the hooks for us. -end - -function EMA:SettingsCreate() - EMA.settingsControl = {} - -- Create the settings panel. - EMAHelperSettings:CreateSettings( - EMA.settingsControl, - EMA.moduleDisplayName, - EMA.parentDisplayName, - EMA.SettingsPushSettingsClick - ) - local bottomOfInfo = EMA:SettingsCreateMount( EMAHelperSettings:TopOfSettings() ) - EMA.settingsControl.widgetSettings.content:SetHeight( -bottomOfInfo ) - -- Help - local helpTable = {} - EMAHelperSettings:CreateHelp( EMA.settingsControl, helpTable, EMA:GetConfiguration() ) -end - -function EMA:SettingsPushSettingsClick( event ) - EMA:EMASendSettings() -end - -function EMA:SettingsCreateMount( top ) - local checkBoxHeight = EMAHelperSettings:GetCheckBoxHeight() - local left = EMAHelperSettings:LeftOfSettings() - local headingHeight = EMAHelperSettings:HeadingHeight() - local headingWidth = EMAHelperSettings:HeadingWidth( false ) - local dropdownHeight = EMAHelperSettings:GetDropdownHeight() - local verticalSpacing = EMAHelperSettings:GetVerticalSpacing() - local movingTop = top - EMAHelperSettings:CreateHeading( EMA.settingsControl, L["PH"], movingTop, false ) - movingTop = movingTop - headingHeight - EMA.settingsControl.checkBoxMountWithTeam = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["PH"], - EMA.SettingsToggleMountWithTeam, - L["PH"] - ) - movingTop = movingTop - headingHeight - EMA.settingsControl.checkBoxDismountWithTeam = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["PH"], - EMA.SettingsToggleDisMountWithTeam, - L["PH"] - ) - movingTop = movingTop - headingHeight - EMA.settingsControl.checkBoxDismountWithMaster = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["PH"], - EMA.SettingsToggleDisMountWithMaster, - L["PH"] - ) - movingTop = movingTop - headingHeight - EMA.settingsControl.checkBoxMountInRange = EMAHelperSettings:CreateCheckBox( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["PH"], - EMA.SettingsToggleMountInRange, - L["PH"] - ) --- DO WE NEED THIS? --- movingTop = movingTop - checkBoxHeight --- EMA.settingsControl.dropdownMessageArea = EMAHelperSettings:CreateDropdown( --- EMA.settingsControl, --- headingWidth, --- left, --- movingTop, --- L["Message Area"] --- ) --- EMA.settingsControl.dropdownMessageArea:SetList( EMAApi.MessageAreaList() ) --- EMA.settingsControl.dropdownMessageArea:SetCallback( "OnValueChanged", EMA.SettingsSetMessageArea ) - movingTop = movingTop - checkBoxHeight - EMA.settingsControl.dropdownWarningArea = EMAHelperSettings:CreateDropdown( - EMA.settingsControl, - headingWidth, - left, - movingTop, - L["Send Warning Area"] - ) - EMA.settingsControl.dropdownWarningArea:SetList( EMAApi.MessageAreaList() ) - EMA.settingsControl.dropdownWarningArea:SetCallback( "OnValueChanged", EMA.SettingsSetWarningArea ) - movingTop = movingTop - dropdownHeight - verticalSpacing - return movingTop -end - -function EMA:OnMessageAreasChanged( message ) - --EMA.settingsControl.dropdownMessageArea:SetList( EMAApi.MessageAreaList() ) - EMA.settingsControl.dropdownWarningArea:SetList( EMAApi.MessageAreaList() ) -end - -function EMA:SettingsSetWarningArea( event, value ) - EMA.db.warningArea = value - EMA:SettingsRefresh() -end - ---function EMA:SettingsSetMessageArea( event, value ) --- EMA.db.messageArea = value --- EMA:SettingsRefresh() ---end - -function EMA:SettingsToggleMountWithTeam( event, checked ) - EMA.db.mountWithTeam = checked - EMA:SettingsRefresh() -end - -function EMA:SettingsToggleDisMountWithTeam( event, checked ) - EMA.db.dismountWithTeam = checked - EMA:SettingsRefresh() -end - -function EMA:SettingsToggleDisMountWithMaster( event, checked ) - EMA.db.dismountWithMaster = checked - EMA:SettingsRefresh() -end - -function EMA:SettingsToggleMountInRange( event, checked ) - EMA.db.mountInRange = checked - EMA:SettingsRefresh() -end - --- Settings received. -function EMA:EMAOnSettingsReceived( characterName, settings ) - if characterName ~= EMA.characterName then - -- Update the settings. - EMA.db.mountWithTeam = settings.mountWithTeam - EMA.db.dismountWithTeam = settings.dismountWithTeam - EMA.db.dismountWithMaster = settings.dismountWithMaster - EMA.db.mountInRange = settings.mountInRange - EMA.db.messageArea = settings.messageArea - EMA.db.warningArea = settings.warningArea - -- Refresh the settings. - EMA:SettingsRefresh() - -- Tell the player. - EMA:Print( L["Settings received from A."]( characterName ) ) - end -end - -function EMA:BeforeEMAProfileChanged() -end - -function EMA:OnEMAProfileChanged() - EMA:SettingsRefresh() -end - -function EMA:SettingsRefresh() - EMA.settingsControl.checkBoxMountWithTeam:SetValue( EMA.db.mountWithTeam ) - EMA.settingsControl.checkBoxDismountWithTeam:SetValue( EMA.db.dismountWithTeam ) - EMA.settingsControl.checkBoxDismountWithMaster:SetValue( EMA.db.dismountWithMaster ) - EMA.settingsControl.checkBoxMountInRange:SetValue( EMA.db.mountInRange ) - --EMA.settingsControl.dropdownMessageArea:SetValue( EMA.db.messageArea ) - EMA.settingsControl.dropdownWarningArea:SetValue( EMA.db.warningArea ) - -- Set state. - --EMA.settingsControl.checkBoxMountWithTeam:SetDisabled( not EMA.db.mountWithTeam ) - EMA.settingsControl.checkBoxDismountWithTeam:SetDisabled( not EMA.db.mountWithTeam ) - EMA.settingsControl.checkBoxDismountWithMaster:SetDisabled( not EMA.db.dismountWithTeam or not EMA.db.mountWithTeam ) - EMA.settingsControl.checkBoxMountInRange:SetDisabled( not EMA.db.mountWithTeam ) -end - -------------------------------------------------------------------------------------------------------------- --- EMASync functionality. -------------------------------------------------------------------------------------------------------------- - ---Frames Buttons - -function EMA:ShowTooltip(frame, show, text) - if show then - GameTooltip:SetOwner(frame, "ANCHOR_TOP") - GameTooltip:SetPoint("TOPLEFT", frame, "TOPRIGHT", 16, 0) - GameTooltip:ClearLines() - GameTooltip:AddLine( text , 1, 0.82, 0, 1) - GameTooltip:Show() - else - GameTooltip:Hide() - end -end - - -function EMA:CreateEMAInterFaceSyncFrame() - EMAInterFaceSyncFrame = CreateFrame( "Frame", "InterFaceSyncFrame", InterfaceOptionsFrame ) - local frame = EMAInterFaceSyncFrame - frame:SetWidth( 110 ) - frame:SetHeight( 30 ) - frame:SetFrameStrata( "HIGH" ) - frame:SetToplevel( true ) - frame:SetClampedToScreen( true ) - frame:EnableMouse( true ) - frame:SetMovable( true ) - frame:ClearAllPoints() - frame:SetPoint("TOPRIGHT", InterfaceOptionsFrame, "TOPRIGHT", -5, -8 ) - --[[ - frame:SetBackdrop( { - bgFile = "Interface\\DialogFrame\\UI-DialogBox-Background", - edgeFile = "Interface\\DialogFrame\\UI-DialogBox-Border", - tile = true, tileSize = 15, edgeSize = 15, - insets = { left = 5, right = 5, top = 5, bottom = 5 } - } ) - ]] - table.insert( UISpecialFrames, "EMAInterFaceSyncFrame" ) - local syncButton = CreateFrame( "Button", "syncButton", frame, "UIPanelButtonTemplate" ) - syncButton:SetScript( "OnClick", function() EMA:DoSyncInterfaceSettings() end ) - syncButton:SetPoint( "TOPLEFT", frame, "TOPLEFT", 10 , -5) - syncButton:SetHeight( 20 ) - syncButton:SetWidth( 90 ) - syncButton:SetText( L["SYNC"] ) - syncButton:SetScript("OnEnter", function(self) EMA:ShowTooltip(syncButton, true, L["SYNC"] ) end) - syncButton:SetScript("OnLeave", function(self) GameTooltip:Hide() end) - syncButtonFrameButton = syncButton - -end - -function EMA:InterfaceOptionsFrameOnShow() - --EMA:Print("test") - -- This sorts out hooking on L or marcioMenu button - --if EMA.db.showEMAQuestLogWithWoWQuestLog == true then - if InterfaceOptionsFrame:IsVisible() then - EMA:ToggleShowSyncInterfaceFrame( true ) - else - EMA:ToggleShowSyncInterfaceFrame( false ) - end - --end -end - - -function EMA:ToggleShowSyncInterfaceFrame( show ) - if show == true then - EMAInterFaceSyncFrame:Show() - else - EMAInterFaceSyncFrame:Hide() - end -end - -function EMA:DoSyncInterfaceSettings() - EMA:Print("[PH] Button Does Nothing" ) -end - - --- COMMS - --- A EMA command has been received. -function EMA:EMAOnCommandReceived( characterName, commandName, ... ) - if characterName ~= self.characterName then - --[[ - if commandName == EMA.COMMAND_MOUNT_ME then - --EMA:Print("command") - EMA:TeamMount( characterName, ... ) - end - ]] - end -end diff --git a/Modules/Talk.lua b/Modules/Talk.lua index 9334196..8b4d95d 100644 --- a/Modules/Talk.lua +++ b/Modules/Talk.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- diff --git a/Modules/Toon.lua b/Modules/Toon.lua index c151890..22e17d7 100644 --- a/Modules/Toon.lua +++ b/Modules/Toon.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -26,6 +26,7 @@ local EMAHelperSettings = LibStub:GetLibrary( "EMAHelperSettings-1.0" ) local LibBagUtils = LibStub:GetLibrary( "LibBagUtils-1.0" ) EMA.SharedMedia = LibStub( "LibSharedMedia-3.0" ) + -- Constants and Locale for this module. EMA.moduleName = "Toon" EMA.settingsDatabaseName = "ToonProfileDB" @@ -33,7 +34,7 @@ EMA.chatCommand = "ema-toon" local L = LibStub( "AceLocale-3.0" ):GetLocale( "Core" ) EMA.parentDisplayName = L["TOON"] EMA.parentDisplayNameToon = L["TOON"] -EMA.parentDisplayNameMerchant = L["VENDER"] +EMA.parentDisplayNameMerchant = L["VENDOR"] EMA.moduleDisplayName = L["TOON"] -- Icon EMA.moduleIcon = "Interface\\Addons\\EMA\\Media\\Toon.tga" @@ -44,6 +45,10 @@ EMA.moduleOrder = 40 EMA.moduleWarningsOrder = 1 EMA.moduleRepairOrder = 1 +-- EMA key bindings. +BINDING_HEADER_TOON = L["TOON"] +BINDING_NAME_SETVIEW= L["SET_VIEW"] + -- Settings - the values to store and their defaults for the settings database. EMA.settings = { profile = { @@ -86,6 +91,8 @@ EMA.settings = { rollWithTeam = false, toggleWarMode = false, autoAcceptPartySyncRequest = false, + setViewWithoutMaster = true, + setView = 1, --Debug Suff testAlwaysOff = true }, @@ -98,13 +105,21 @@ function EMA:GetConfiguration() handler = EMA, type = 'group', args = { + SetView = { + type = "input", + name = L["SET_VIEW"], + desc = L["SET_VIEW_HELP"], + usage = "/ema-toon setview", + get = false, + set = "SetView", + }, config = { type = "input", name = L["OPEN_CONFIG"], desc = L["OPEN_CONFIG_HELP"], usage = "/ema-toon config", get = false, - set = "", + set = "", }, push = { type = "input", @@ -134,18 +149,13 @@ EMA.COMMAND_READY_CHECK = "EMAReadyCheck" EMA.COMMAND_TELE_PORT = "EMAteleport" EMA.COMMAND_LOOT_ROLL = "EMALootRoll" EMA.COMMAND_WAR_MODE = "EMAWarMode" +EMA.COMMAND_SET_VIEW = "Set View Point" ------------------------------------------------------------------------------------------------------------- -- Messages module sends. ------------------------------------------------------------------------------------------------------------- ------------------------------------------------------------------------------------------------------------- --- Variables used by module. -------------------------------------------------------------------------------------------------------------- - ---EMA.sharedInvData = {} - -------------------------------------------------------------------------------------------------------------- -- Settings Dialogs. ------------------------------------------------------------------------------------------------------------- @@ -180,16 +190,18 @@ local function SettingsCreateMerchant( top ) EMA.SettingsToggleAutoRepair, L["AUTO_REPAIR_HELP"] ) - movingTop = movingTop - checkBoxHeight - EMA.settingsControlMerchant.checkBoxAutoRepairUseGuildFunds = EMAHelperSettings:CreateCheckBox( - EMA.settingsControlMerchant, - headingWidth, - left, - movingTop, - L["REPAIR_GUILD_FUNDS"], - EMA.SettingsToggleAutoRepairUseGuildFunds, - L["REPAIR_GUILD_FUNDS_HELP"] - ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + movingTop = movingTop - checkBoxHeight + EMA.settingsControlMerchant.checkBoxAutoRepairUseGuildFunds = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlMerchant, + headingWidth, + left, + movingTop, + L["REPAIR_GUILD_FUNDS"], + EMA.SettingsToggleAutoRepairUseGuildFunds, + L["REPAIR_GUILD_FUNDS_HELP"] + ) + end movingTop = movingTop - checkBoxHeight EMA.settingsControlMerchant.dropdownMerchantArea = EMAHelperSettings:CreateDropdown( EMA.settingsControlMerchant, @@ -219,14 +231,17 @@ local function SettingsCreateToon( top ) local checkBoxHeight = EMAHelperSettings:GetCheckBoxHeight() local editBoxHeight = EMAHelperSettings:GetEditBoxHeight() local dropdownHeight = EMAHelperSettings:GetDropdownHeight() + local sliderHeight = EMAHelperSettings:GetSliderHeight() local labelHeight = EMAHelperSettings:GetLabelHeight() local left = EMAHelperSettings:LeftOfSettings() local headingHeight = EMAHelperSettings:HeadingHeight() local headingWidth = EMAHelperSettings:HeadingWidth( false ) local horizontalSpacing = EMAHelperSettings:GetHorizontalSpacing() local verticalSpacing = EMAHelperSettings:GetVerticalSpacing() + local sectionSpacing = verticalSpacing * 4 local halfWidth = (headingWidth - horizontalSpacing) / 2 local thirdWidth = (headingWidth - (horizontalSpacing * 2)) / 3 + local halfWidthSlider = (headingWidth - horizontalSpacing) / 2 local column2left = left + halfWidth local left2 = left + thirdWidth local left3 = left + (thirdWidth * 2) @@ -294,38 +309,30 @@ local function SettingsCreateToon( top ) EMA.SettingsToggleAutoAcceptSummonRequest, L["SUMMON_REQUEST_HELP"] ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + movingTop = movingTop - checkBoxHeight + EMA.settingsControlToon.checkBoxToggleWarMode = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlToon, + halfWidth, + left, + movingTop, + L["WAR_MODE"], + EMA.SettingsToggleWarMode, + L["WAR_MODE_HELP"] + ) + movingTop = movingTop - checkBoxHeight + EMA.settingsControlToon.checkBoxTogglePartySyncRequest = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlToon, + halfWidth, + left, + movingTop, + L["PARTY_SYNC"], + EMA.SettingsTogglePartySyncRequest, + L["PARTY_SYNC_HELP"] + ) + end movingTop = movingTop - checkBoxHeight - EMA.settingsControlToon.checkBoxToggleWarMode = EMAHelperSettings:CreateCheckBox( - EMA.settingsControlToon, - halfWidth, - left, - movingTop, - L["WAR_MODE"], - EMA.SettingsToggleWarMode, - L["WAR_MODE_HELP"] - ) - movingTop = movingTop - checkBoxHeight - EMA.settingsControlToon.checkBoxTogglePartySyncRequest = EMAHelperSettings:CreateCheckBox( - EMA.settingsControlToon, - halfWidth, - left, - movingTop, - L["PARTY_SYNC"], - EMA.SettingsTogglePartySyncRequest, - L["PARTY_SYNC_HELP"] - ) - movingTop = movingTop - checkBoxHeight EMAHelperSettings:CreateHeading( EMA.settingsControlToon, L["GROUPTOOLS_HEADING"], movingTop, false ) - movingTop = movingTop - headingHeight - EMA.settingsControlToon.checkBoxAutoRoleCheck = EMAHelperSettings:CreateCheckBox( - EMA.settingsControlToon, - halfWidth, - left, - movingTop, - L["ROLE_CHECKS"], - EMA.SettingsToggleAutoRoleCheck, - L["ROLE_CHECKS_HELP"] - ) movingTop = movingTop - checkBoxHeight EMA.settingsControlToon.checkBoxAcceptReadyCheck = EMAHelperSettings:CreateCheckBox( EMA.settingsControlToon, @@ -336,17 +343,29 @@ local function SettingsCreateToon( top ) EMA.SettingsToggleAcceptReadyCheck, L["READY_CHECKS_HELP"] ) - movingTop = movingTop - checkBoxHeight - EMA.settingsControlToon.checkBoxLFGTeleport = EMAHelperSettings:CreateCheckBox( - EMA.settingsControlToon, - halfWidth, - left, - movingTop, - L["LFG_Teleport"], - EMA.SettingsToggleLFGTeleport, - L["LFG_Teleport_HELP"] - ) - movingTop = movingTop - checkBoxHeight + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + movingTop = movingTop - headingHeight + EMA.settingsControlToon.checkBoxAutoRoleCheck = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlToon, + halfWidth, + left, + movingTop, + L["ROLE_CHECKS"], + EMA.SettingsToggleAutoRoleCheck, + L["ROLE_CHECKS_HELP"] + ) + movingTop = movingTop - checkBoxHeight + EMA.settingsControlToon.checkBoxLFGTeleport = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlToon, + halfWidth, + left, + movingTop, + L["LFG_Teleport"], + EMA.SettingsToggleLFGTeleport, + L["LFG_Teleport_HELP"] + ) + end + movingTop = movingTop - checkBoxHeight EMA.settingsControlToon.checkBoxLootWithTeam = EMAHelperSettings:CreateCheckBox( EMA.settingsControlToon, halfWidth, @@ -357,11 +376,30 @@ local function SettingsCreateToon( top ) L["ROLL_LOOT_HELP"] ) movingTop = movingTop - checkBoxHeight + EMAHelperSettings:CreateHeading( EMA.settingsControlToon, L["SET_VIEW_HEADER"], movingTop, false ) + movingTop = movingTop - headingHeight + EMA.settingsControlToon.checkBoxSetViewWithWithoutMaster = EMAHelperSettings:CreateCheckBox( + EMA.settingsControlToon, + halfWidth, + left, + movingTop, + L["SET_VIEW_WITHOUT_MASTER"], + EMA.SettingsToggleSetViewWihoutMaster, + L["SET_VIEW_WITHOUT_MASTER_HELP"] + ) + movingTop = movingTop - headingHeight + EMA.settingsControlToon.SliderSetView = EMAHelperSettings:CreateSlider( + EMA.settingsControlToon, + halfWidthSlider, + left, + movingTop, + L["SET_VIEW"] + ) + EMA.settingsControlToon.SliderSetView:SetSliderValues( 1, 5, 1 ) + EMA.settingsControlToon.SliderSetView:SetCallback( "OnValueChanged", EMA.SettingsChangeSetView ) + movingTop = movingTop - sliderHeight - sectionSpacing - - - - + --movingTop = movingTop - checkBoxHeight EMAHelperSettings:CreateHeading( EMA.settingsControlToon, L["MESSAGES_HEADER"], movingTop, false ) movingTop = movingTop - dropdownHeight - verticalSpacing EMA.settingsControlToon.dropdownRequestArea = EMAHelperSettings:CreateDropdown( @@ -673,15 +711,22 @@ function EMA:SettingsRefresh() EMA.settingsControlToon.checkBoxAutoDenyDuels:SetValue( EMA.db.autoDenyDuels ) EMA.settingsControlToon.checkBoxAutoAcceptSummonRequest:SetValue( EMA.db.autoAcceptSummonRequest ) EMA.settingsControlToon.checkBoxAutoDenyGuildInvites:SetValue( EMA.db.autoDenyGuildInvites ) - EMA.settingsControlToon.checkBoxAutoRoleCheck:SetValue( EMA.db.autoAcceptRoleCheck ) EMA.settingsControlToon.checkBoxAcceptReadyCheck:SetValue( EMA.db.acceptReadyCheck ) - EMA.settingsControlToon.checkBoxLFGTeleport:SetValue( EMA.db.teleportLFGWithTeam ) EMA.settingsControlToon.checkBoxLootWithTeam:SetValue( EMA.db.rollWithTeam ) - EMA.settingsControlToon.checkBoxToggleWarMode:SetValue( EMA.db.toggleWarMode ) - EMA.settingsControlToon.checkBoxTogglePartySyncRequest:SetValue( EMA.db.autoAcceptPartySyncRequest ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + EMA.settingsControlToon.checkBoxToggleWarMode:SetValue( EMA.db.toggleWarMode ) + EMA.settingsControlToon.checkBoxLFGTeleport:SetValue( EMA.db.teleportLFGWithTeam ) + EMA.settingsControlToon.checkBoxAutoRoleCheck:SetValue( EMA.db.autoAcceptRoleCheck ) + EMA.settingsControlToon.checkBoxTogglePartySyncRequest:SetValue( EMA.db.autoAcceptPartySyncRequest ) + end EMA.settingsControlToon.dropdownRequestArea:SetValue( EMA.db.requestArea ) + EMA.settingsControlToon.checkBoxSetViewWithWithoutMaster:SetValue( EMA.db.setViewWithoutMaster ) + EMA.settingsControlToon.SliderSetView:SetValue( EMA.db.setView ) + EMA.settingsControlMerchant.checkBoxAutoRepair:SetValue( EMA.db.autoRepair ) - EMA.settingsControlMerchant.checkBoxAutoRepairUseGuildFunds:SetValue( EMA.db.autoRepairUseGuildFunds ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + EMA.settingsControlMerchant.checkBoxAutoRepairUseGuildFunds:SetValue( EMA.db.autoRepairUseGuildFunds ) + end EMA.settingsControlMerchant.dropdownMerchantArea:SetValue( EMA.db.merchantArea ) -- Set state. EMA.settingsControlWarnings.editBoxHitFirstTimeMessage:SetDisabled( not EMA.db.warnHitFirstTimeCombat ) @@ -694,7 +739,9 @@ function EMA:SettingsRefresh() EMA.settingsControlWarnings.editBoxWarnWhenDurabilityDropsAmount:SetDisabled( not EMA.db.warnWhenDurabilityDropsBelowX ) EMA.settingsControlWarnings.editBoxWarnDurabilityDropsMessage:SetDisabled( not EMA.db.warnWhenDurabilityDropsBelowX ) EMA.settingsControlWarnings.editBoxWarnWhenBagsAlmostFull:SetDisabled( not EMA.db.warnWhenBagsAlmostFullAmount ) - EMA.settingsControlMerchant.checkBoxAutoRepairUseGuildFunds:SetDisabled( not EMA.db.autoRepair ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + EMA.settingsControlMerchant.checkBoxAutoRepairUseGuildFunds:SetDisabled( not EMA.db.autoRepair ) + end EMA.settingsControlWarnings.editBoxBagsFullMessage:SetDisabled( not EMA.db.warnBagsFull ) EMA.settingsControlWarnings.editBoxCCMessage:SetDisabled( not EMA.db.warnCC ) EMA.settingsControlToon.checkBoxAutoAcceptResurrectRequestOnlyFromTeam:SetDisabled( not EMA.db.autoAcceptResurrectRequest ) @@ -797,6 +844,13 @@ function EMA:EditBoxChangedBagsFullMessage( event, text ) EMA:SettingsRefresh() end +function EMA:EditBoxChangedWarnWhenBagsAlmostFull( event, text ) + local amount = tonumber( text ) + amount = EMAUtilities:FixValueToRange( amount, 0, 100 ) + EMA.db.warnWhenBagsAlmostFullAmount = amount + EMA:SettingsRefresh() +end + function EMA:SettingsToggleWarnCC( event, checked ) EMA.db.warnCC = checked EMA:SettingsRefresh() @@ -878,6 +932,16 @@ function EMA:EditBoxChangedWarnDurabilityDropsMessage( event, text ) EMA:SettingsRefresh() end +function EMA:SettingsToggleSetViewWihoutMaster( event, value ) + EMA.db.setViewWithoutMaster = value + EMA:SettingsRefresh() +end + +function EMA:SettingsChangeSetView( event, value ) + EMA.db.setView = tonumber( value ) + EMA:SettingsRefresh() +end + function EMA:SettingsSetWarningArea( event, value ) EMA.db.warningArea = value EMA:SettingsRefresh() @@ -893,12 +957,6 @@ function EMA:SettingsSetMerchantArea( event, value ) EMA:SettingsRefresh() end -function EMA:EditBoxChangedWarnWhenBagsAlmostFull( event, text ) - local amount = tonumber( text ) - amount = EMAUtilities:FixValueToRange( amount, 0, 100 ) - EMA.db.warnWhenBagsAlmostFullAmount = amount - EMA:SettingsRefresh() -end ------------------------------------------------------------------------------------------------------------- -- Addon initialization, enabling and disabling. @@ -922,6 +980,11 @@ function EMA:OnInitialize() EMA.haveBeenHit = false -- Bags full changed count. EMA.previousFreeBagSlotsCount = false + -- Key bindings. + EMASETVIEW = CreateFrame( "CheckButton", "EMASETVIEW", nil, "SecureActionButtonTemplate" ) + EMASETVIEW:SetAttribute( "type", "macro" ) + EMASETVIEW:SetAttribute( "macrotext", "/ema-toon setview" ) + EMASETVIEW:Hide() end -- Called when the addon is enabled. @@ -952,12 +1015,18 @@ function EMA:OnEnable() EMA:RegisterEvent( "BAG_UPDATE_DELAYED" ) EMA:RegisterEvent( "PLAYER_FLAGS_CHANGED", "WARMODE" ) EMA:RegisterEvent( "QUEST_SESSION_CREATED" ) + -- Initialise key bindings. + EMA.keyBindingFrame = CreateFrame( "Frame", nil, UIParent ) + EMA:RegisterEvent( "UPDATE_BINDINGS" ) + EMA:UPDATE_BINDINGS() EMA:RegisterMessage( EMAApi.MESSAGE_MESSAGE_AREAS_CHANGED, "OnMessageAreasChanged" ) EMA:RegisterMessage( EMAApi.MESSAGE_CHARACTER_ONLINE, "OnCharactersChanged" ) EMA:RegisterMessage( EMAApi.MESSAGE_CHARACTER_OFFLINE, "OnCharactersChanged" ) -- Ace Hooks EMA:SecureHook( "ConfirmReadyCheck" ) - EMA:SecureHook( "LFGTeleport" ) + if EMAPrivate.Core.isEmaClassicBuild == false then + EMA:SecureHook( "LFGTeleport" ) + end EMA:SecureHook( "RollOnLoot" ) end @@ -1001,6 +1070,8 @@ function EMA:EMAOnSettingsReceived( characterName, settings ) EMA.db.teleportLFGWithTeam = settings.teleportLFGWithTeam EMA.db.rollWithTeam = settings.rollWithTeam EMA.db.toggleWarMode = settings.toggleWarMode + EMA.db.setView = settings.setView + EMA.db.setViewWithoutMaster = settings.setViewWithoutMaster EMA.db.autoAcceptPartySyncRequest = settings.autoAcceptPartySyncRequest EMA.db.autoRepair = settings.autoRepair EMA.db.autoRepairUseGuildFunds = settings.autoRepairUseGuildFunds @@ -1326,7 +1397,7 @@ end function EMA:LFGTeleport( event, arg1, ... ) --EMA:Print("LFGtest") - if EMA.db.teleportLFGWithTeam == true then + if EMA.db.teleportLFGWithTeam == true and EMAPrivate.Core.isEmaClassicBccBuild() == false then if IsShiftKeyDown() == false then if EMA.isInternalCommand == false then if IsInLFGDungeon() == true then @@ -1340,6 +1411,7 @@ function EMA:LFGTeleport( event, arg1, ... ) end function EMA:DoLFGTeleport(port) + if EMAPrivate.Core.isEmaClassicBccBuild() == ture then return end --EMA:Print("TeleCommand", port) EMA.isInternalCommand = true if IsShiftKeyDown() == false then @@ -1393,7 +1465,7 @@ function EMA:CONFIRM_SUMMON( event, sender, location, ... ) end function EMA:WARMODE(event, ...) - if EMA.db.toggleWarMode == true then + if EMA.db.toggleWarMode == true and EMAPrivate.Core.isEmaClassicBccBuild() == false then if C_PvP.IsWarModeFeatureEnabled() == true then local isWarMode = C_PvP.IsWarModeDesired() if C_PvP.CanToggleWarMode(isWarMode) == true then @@ -1407,6 +1479,7 @@ function EMA:WARMODE(event, ...) end function EMA:DoWarMode( isWarMode ) + if EMAPrivate.Core.isEmaClassicBccBuild() == true then return end EMA.isInternalCommand = true if C_PvP.CanToggleWarMode( isWarMode ) == true and isWarMode ~= nil then --EMA:Print("testwarmode", isWarMode ) @@ -1432,11 +1505,13 @@ function EMA:MERCHANT_SHOW( event, ... ) -- At least some cost... if repairCost > 0 then -- If allowed to use guild funds, then attempt to repair using guild funds. - if EMA.db.autoRepairUseGuildFunds == true then - if IsInGuild() and CanGuildBankRepair() then - RepairAllItems( 1 ) + if EMAPrivate.Core.isEmaClassicBccBuild() == false then + if EMA.db.autoRepairUseGuildFunds == true then + if IsInGuild() and CanGuildBankRepair() then + RepairAllItems( 1 ) + end end - end + end -- After guild funds used, still need to repair? repairCost = GetRepairAllCost() -- At least some cost... @@ -1622,7 +1697,6 @@ end --Ebony CCed function EMA:LOSS_OF_CONTROL_ADDED( event, ... ) if EMA.db.warnCC == true then - ---local eventIndex = C_LossOfControl.GetNumEvents() local eventIndex = C_LossOfControl.GetActiveLossOfControlDataCount() if eventIndex > 0 then local LossOfControlData = C_LossOfControl.GetActiveLossOfControlData(eventIndex) @@ -1643,6 +1717,17 @@ function EMA:QUEST_SESSION_CREATED( event, ...) end end +function EMA:SetView() + EMA:EMASendCommandToTeam( EMA.COMMAND_SET_VIEW ) +end + +function EMA:DoSetView(characterName, ...) + if EMAApi.IsCharacterTheMaster( EMA.characterName ) == true and EMA.db.setViewWithoutMaster == true then + return + end + + SetView( EMA.db.setView);SetView( EMA.db.setView) +end -- A EMA command has been received. function EMA:EMAOnCommandReceived( characterName, commandName, ... ) @@ -1678,7 +1763,26 @@ function EMA:EMAOnCommandReceived( characterName, commandName, ... ) EMA.DoWarMode( characterName, ... ) end end + if commandName == EMA.COMMAND_SET_VIEW then + EMA.DoSetView( characterName, ... ) + end end +------------------------------------------------------------------------------------------------------------- +-- Key bindings. +------------------------------------------------------------------------------------------------------------- +function EMA:UPDATE_BINDINGS() + if InCombatLockdown() then + return + end + ClearOverrideBindings( EMA.keyBindingFrame ) + local key1, key2 = GetBindingKey( "SETVIEW" ) + if key1 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMASETVIEW" ) + end + if key2 then + SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMASETVIEW" ) + end +end --EMAApi.isInternalCommand = EMA.isInternalCommand diff --git a/Modules/Trade.lua b/Modules/Trade.lua index 3b78a28..92bfa89 100644 --- a/Modules/Trade.lua +++ b/Modules/Trade.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018-2020 Jennifer Cally -- +-- License: All Rights Reserved 2018-2022 Jennifer Calladine -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License --