From aeb34523e5f32d72ba14939a393e27fa9aa6dd2b Mon Sep 17 00:00:00 2001 From: Jennifer Date: Thu, 16 May 2019 15:03:36 +0100 Subject: [PATCH] v2.0(108) --- .pkgmeta | 5 + Bindings.xml | 2 +- CHANGELOG.txt | 139 +++++++++--- Core/Communications.lua | 9 +- Core/Core.lua | 121 ++++++++-- Core/Message.lua | 12 +- Core/Module.lua | 68 ++++-- Core/Tag.lua | 20 +- Core/Team.lua | 34 +-- EMA.toc | 6 +- EbonyUtilities.lua | 15 +- Embeds.xml | 2 +- GUI/AceGUIContainer-EMATreeGroup.lua | 4 +- GUI/AceGUIContainer-EMAWindow.lua | 2 +- GUI/AceGUIWidget-EMAContinueLabel.lua | 2 +- GUI/AceGUIWidget-EMANormalLabel.lua | 2 +- GUI/EMAHelperSettings.lua | 2 +- LICENSE | 30 ++- Libs/AceAddon-3.0/AceAddon-3.0.lua | 35 +-- Libs/AceBucket-3.0/AceBucket-3.0.lua | 41 +--- .../AceConfigDialog-3.0/AceConfigDialog-3.0.lua | 97 +++----- .../AceConfigRegistry-3.0.lua | 3 +- Libs/AceDB-3.0/AceDB-3.0.lua | 8 +- Libs/AceDBOptions-3.0/AceDBOptions-3.0.lua | 4 +- Libs/AceGUI-3.0/AceGUI-3.0.lua | 45 +--- Libs/AceGUI-3.0/widgets/AceGUIContainer-Frame.lua | 10 +- .../widgets/AceGUIContainer-ScrollFrame.lua | 21 +- .../widgets/AceGUIContainer-TabGroup.lua | 1 - .../widgets/AceGUIContainer-TreeGroup.lua | 13 +- Libs/AceGUI-3.0/widgets/AceGUIContainer-Window.lua | 24 +- Libs/AceGUI-3.0/widgets/AceGUIWidget-CheckBox.lua | 40 ++-- .../widgets/AceGUIWidget-ColorPicker.lua | 10 +- .../widgets/AceGUIWidget-DropDown-Items.lua | 8 +- Libs/AceGUI-3.0/widgets/AceGUIWidget-Heading.lua | 4 +- Libs/AceGUI-3.0/widgets/AceGUIWidget-Icon.lua | 2 +- .../widgets/AceGUIWidget-InteractiveLabel.lua | 7 - Libs/AceGUI-3.0/widgets/AceGUIWidget-Label.lua | 15 +- Libs/AceGUI-3.0/widgets/AceGUIWidget-Slider.lua | 3 +- Libs/EMALibActionButton-1.0.lua | 4 +- Locales/Core-Locale-deDE.lua | 3 +- Locales/Core-Locale-enUS.lua | 53 +++-- Locales/Locales.xml | 2 +- Modules/Bank.lua | 12 +- Modules/DisplayTeam.lua | 16 +- Modules/Follow.lua | 34 +-- Modules/Guild.lua | 113 ++++++++-- Modules/ISBoxer.lua | 10 +- Modules/Information.lua | 21 +- Modules/Interaction.lua | 83 +++++-- Modules/ItemUse.lua | 26 ++- Modules/LDBBar.lua | 2 +- Modules/Mail.lua | 135 ++++++++--- Modules/Modules.xml | 2 +- Modules/Purchase.lua | 109 +++++++-- Modules/Quest.lua | 12 +- Modules/QuestWatcher.lua | 25 ++- Modules/Sell.lua | 237 ++++++++++++++++---- Modules/Sync.lua | 12 +- Modules/Talk.lua | 12 +- Modules/Toon.lua | 12 +- Modules/Trade.lua | 88 +++++++- bitbucket-pipelines.yml | 8 - 62 files changed, 1315 insertions(+), 582 deletions(-) create mode 100644 .pkgmeta delete mode 100644 bitbucket-pipelines.yml diff --git a/.pkgmeta b/.pkgmeta new file mode 100644 index 0000000..d0a1d4f --- /dev/null +++ b/.pkgmeta @@ -0,0 +1,5 @@ +package-as: EMA + +manual-changelog: CHANGELOG.txt + +enable-nolib-creation: no \ No newline at end of file diff --git a/Bindings.xml b/Bindings.xml index 8f2fb71..26ef301 100644 --- a/Bindings.xml +++ b/Bindings.xml @@ -1,7 +1,7 @@ diff --git a/Modules/Bank.lua b/Modules/Bank.lua index eb0283b..bdf7649 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 Jennifer Cally -- +-- License: All Rights Reserved 2018-2019 Jennifer Cally -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -68,11 +68,19 @@ function EMA:GetConfiguration() get = "EMAConfigurationGetSetting", set = "EMAConfigurationSetSetting", args = { + config = { + type = "input", + name = L["OPEN_CONFIG"], + desc = L["OPEN_CONFIG_HELP"], + usage = "/ema-bank config", + get = false, + set = "", + }, push = { type = "input", name = L["PUSH_SETTINGS"], desc = L["PUSH_ALL_SETTINGS"], - usage = "/EMA-Bank push", + usage = "/ema-Bank push", get = false, set = "EMASendSettings", guiHidden = true, diff --git a/Modules/DisplayTeam.lua b/Modules/DisplayTeam.lua index 576917c..b84af82 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 Jennifer Cally -- +-- License: All Rights Reserved 2018-2019 Jennifer Cally -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -129,11 +129,19 @@ function EMA:GetConfiguration() get = "EMAConfigurationGetSetting", set = "EMAConfigurationSetSetting", args = { + config = { + type = "input", + name = L["OPEN_CONFIG"], + desc = L["OPEN_CONFIG_HELP"], + usage = "/ema-display config", + get = false, + set = "", + }, push = { type = "input", name = L["PUSH_SETTINGS"], desc = L["PUSH_SETTINGS_INFO"], - usage = "/EMA-display-team push", + usage = "/ema-display-team push", get = false, set = "EMASendSettings", }, @@ -141,7 +149,7 @@ function EMA:GetConfiguration() type = "input", name = L["HIDE_TEAM_DISPLAY"], desc = L["HIDE_TEAM_DISPLAY_HELP"], - usage = "/EMA-display-team hide", + usage = "/ema-display-team hide", get = false, set = "HideTeamListCommand", }, @@ -149,7 +157,7 @@ function EMA:GetConfiguration() type = "input", name = L["SHOW_TEAM_DISPLAY"], desc = L["SHOW_TEAM_DISPLAY_HELP"], - usage = "/EMA-display-team show", + usage = "/ema-display-team show", get = false, set = "ShowTeamListCommand", }, diff --git a/Modules/Follow.lua b/Modules/Follow.lua index 8af39b7..5830884 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 Jennifer Cally -- +-- License: All Rights Reserved 2018-2019 Jennifer Cally -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -80,11 +80,19 @@ function EMA:GetConfiguration() get = "EMAConfigurationGetSetting", set = "EMAConfigurationSetSetting", args = { + config = { + type = "input", + name = L["OPEN_CONFIG"], + desc = L["OPEN_CONFIG_HELP"], + usage = "/ema-team config", + get = false, + set = "", + }, push = { type = "input", name = L["PUSH_SETTINGS"], desc = L["PUSH_SETTINGS_INFO"], - usage = "/EMA-follow push", + usage = "/ema-follow push", get = false, set = "EMASendSettings", }, @@ -92,7 +100,7 @@ function EMA:GetConfiguration() type = "input", name = L["FOLLOW_MASTER"], desc = L["FOLLOW_MASTER_HELP"], - usage = "/EMA-follow master ", + usage = "/ema-follow master ", get = false, set = "FollowMasterCommand", }, @@ -100,7 +108,7 @@ function EMA:GetConfiguration() type = "input", name = L["FOLLOW_TARGET"], desc = L["FOLLOW_TARGET_HELP"], - usage = "/EMA-follow target ", + usage = "/ema-follow target ", get = false, set = "FollowTargetCommand", }, @@ -108,13 +116,13 @@ function EMA:GetConfiguration() type = "input", name = L["FOLLOW_AFTER_COMBAT"], desc = L["FOLLOW_AFTER_COMBAT_HELP"], - usage = "/EMA-follow aftercombat ", + usage = "/ema-follow aftercombat ", }, strobeOn = { type = "input", name = L["FOLLOW_STROBING"], desc = L["FOLLOW_STROBING_HELP"], - usage = "/EMA-follow strobeon ", + usage = "/ema-follow strobeon ", get = false, set = "FollowStrobeOnCommand", }, @@ -122,7 +130,7 @@ function EMA:GetConfiguration() type = "input", name = L["FOLLOW_STROBING_ME"], desc = L["FOLLOW_STROBING_ME_HELP"], - usage = "/EMA-follow strobeonme ", + usage = "/ema-follow strobeonme ", get = false, set = "FollowStrobeOnMeCommand", }, @@ -130,7 +138,7 @@ function EMA:GetConfiguration() type = "input", name = L["FOLLOW_STROBING_END"], desc = L["FOLLOW_STROBING_END_HELP"], - usage = "/EMA-follow strobeoff ", + usage = "/ema-follow strobeoff ", get = false, set = "FollowStrobeOffCommand", }, @@ -138,7 +146,7 @@ function EMA:GetConfiguration() type = "input", name = L["FOLLOW_SET_MASTER"], desc = L["FOLLOW_SET_MASTER_HELP"], - usage = "/EMA-follow setmaster ", + usage = "/ema-follow setmaster ", get = false, set = "CommandSetFollowMaster", }, @@ -146,7 +154,7 @@ function EMA:GetConfiguration() type = "input", name = L["TRAIN"], desc = L["TRAIN_HELP"], - usage = "/EMA-follow train ", + usage = "/ema-follow train ", get = false, set = "CommandFollowTrain", }, @@ -154,7 +162,7 @@ function EMA:GetConfiguration() type = "input", name = L["FOLLOW_ME"], desc = L["FOLLOW_ME_HELP"], - usage = "/EMA-follow me ", + usage = "/ema-follow me ", get = false, set = "CommandFollowMe", }, @@ -162,7 +170,7 @@ function EMA:GetConfiguration() type = "input", name = L["SNW"], desc = L["SNW_HELP"], - usage = "/EMA-follow snw", + usage = "/ema-follow snw", get = false, set = "SuppressNextFollowWarningCommand", }, @@ -649,7 +657,7 @@ function EMA:UPDATE_BINDINGS() if key2 then SetOverrideBindingClick( EMA.keyBindingFrame, false, key2, "EMAFollowSecureButtonFollowStrobeOff" ) end - local key1, key2 = GetBindingKey( "FOLLOWTEAIN" ) + local key1, key2 = GetBindingKey( "FOLLOWTEAIN" ) if key1 then SetOverrideBindingClick( EMA.keyBindingFrame, false, key1, "EMAFollowSecureButtonFollowTrain" ) end diff --git a/Modules/Guild.lua b/Modules/Guild.lua index 093c71c..6cc9206 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 Jennifer Cally -- +-- License: All Rights Reserved 2018-2019 Jennifer Cally -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -41,9 +41,15 @@ EMA.moduleOrder = 20 -- Settings - the values to store and their defaults for the settings database. EMA.settings = { + global = { + ['**'] = { + autoGuildItemsListGlobal = {}, + }, + }, profile = { messageArea = EMAApi.DefaultMessageArea(), showEMAGuildWindow = false, + globalGuildList = false, blackListItem = false, guildBoEItems = false, autoGuildBankTabBoE = "1", @@ -51,7 +57,7 @@ EMA.settings = { autoBoEItemTag = EMAApi.AllGroup(), guildCRItems = false, autoGuildBankTabCR = "1", - autoCRItemTag = EMAApi.AllGroup(), + autoGuildCRItemTag = EMAApi.AllGroup(), autoGuildItemsList = {}, adjustMoneyWithGuildBank = false, goldAmountToKeepOnToon = 250, @@ -68,15 +74,31 @@ function EMA:GetConfiguration() get = "EMAConfigurationGetSetting", set = "EMAConfigurationSetSetting", args = { + config = { + type = "input", + name = L["OPEN_CONFIG"], + desc = L["OPEN_CONFIG_HELP"], + usage = "/ema-guild config", + get = false, + set = "", + }, push = { type = "input", name = L["PUSH_SETTINGS"], desc = L["PUSH_ALL_SETTINGS"], - usage = "/EMA-Guild push", + usage = "/ema-guild push", get = false, set = "EMASendSettings", guiHidden = true, }, + copy = { + type = "input", + name = L["COPY"], + desc = L["COPY_HELP"], + usage = "/ema-guild copy", + get = false, + set = "CopyListCommmand", + }, }, } return configuration @@ -216,13 +238,22 @@ function EMA:SettingsCreateGuild( top ) movingTop = movingTop - headingHeight EMA.settingsControl.checkBoxShowEMAGuildWindow = EMAHelperSettings:CreateCheckBox( EMA.settingsControl, - headingWidth, - left2, + halfWidth, + left, movingTop, L["GUILD_LIST"], EMA.SettingsToggleShowEMAGuildWindow, L["GUILD_LIST_HELP"] ) + EMA.settingsControl.checkBoxGlobalGuildList = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + halfWidth, + left3, + movingTop, + L["GLOBAL_LIST"], + EMA.SettingsToggleGlobalGuildList, + L["GLOBAL_SETTINGS_LIST_HELP"] + ) movingTop = movingTop - checkBoxHeight EMA.settingsControl.GuildItemsHighlightRow = 1 EMA.settingsControl.GuildItemsOffset = 1 @@ -547,7 +578,7 @@ function EMA:GBTabDropDownListCR (event, value ) if value == " " or value == nil then return end - EMA.db.autoGuildBankTabCR = value + EMA.db.autoGuildBankTabCR = tonumber(value) EMA:SettingsRefresh() end @@ -558,7 +589,7 @@ function EMA:GroupListDropDownListCR (event, value ) end for index, groupName in ipairs( EMAApi.GroupList() ) do if index == value then - EMA.db.autoCRItemTag = groupName + EMA.db.autoGuildCRItemTag = groupName break end end @@ -580,6 +611,11 @@ function EMA:SettingsSetMessageArea( event, value ) EMA:SettingsRefresh() end +function EMA:SettingsToggleGlobalGuildList( event, checked ) + EMA.db.globalGuildList = checked + EMA:SettingsRefresh() +end + function EMA:SettingsToggleShowEMAGuildWindow( event, checked ) EMA.db.showEMAGuildWindow = checked EMA:SettingsRefresh() @@ -603,20 +639,29 @@ function EMA:EditBoxChangedGoldAmountToLeaveOnToon( event, text ) EMA:SettingsRefresh() end +function EMA:CopyListCommmand() + EMA:Print("Copying Local List To Global List") + EMA.db.global.autoGuildItemsListGlobal = EMAUtilities:CopyTable( EMA.db.autoGuildItemsList ) + EMA:SettingsRefresh() +end + + -- Settings received. function EMA:EMAOnSettingsReceived( characterName, settings ) if characterName ~= EMA.characterName then -- Update the settings. EMA.db.messageArea = settings.messageArea EMA.db.showEMAGuildWindow = settings.showEMAGuildWindow + EMA.db.globalGuildList = settings.globalGuildList EMA.db.guildTagName = settings.guildTagName EMA.db.guildBoEItems = settings.guildBoEItems EMA.db.autoGuildBankTabBoE = settings.autoGuildBankTabBoE EMA.db.autoBoEItemTag = settings.autoBoEItemTag EMA.db.guildCRItems = settings.guildCRItems EMA.db.autoGuildBankTabCR = settings.autoGuildBankTabCR - EMA.db.autoCRItemTag = settings.autoCRItemTag + EMA.db.autoGuildCRItemTag = settings.autoGuildCRItemTag EMA.db.autoGuildItemsList = EMAUtilities:CopyTable( settings.autoGuildItemsList ) + EMA.db.global.autoGuildItemsListGlobal = EMAUtilities:CopyTable( settings.global.autoGuildItemsListGlobal ) EMA.db.adjustMoneyWithGuildBank = settings.adjustMoneyWithGuildBank EMA.db.goldAmountToKeepOnToon = settings.goldAmountToKeepOnToon -- Refresh the settings. @@ -635,6 +680,9 @@ end function EMA:SettingsRefresh() EMA.settingsControl.checkBoxShowEMAGuildWindow:SetValue( EMA.db.showEMAGuildWindow ) + -- global CheckBox + EMA.settingsControl.checkBoxGlobalGuildList:SetValue( EMA.db.globalGuildList ) + EMA.settingsControl.checkBoxGlobalGuildList:SetDisabled( not EMA.db.showEMAGuildWindow ) EMA.settingsControl.GuildItemsEditBoxGuildTag:SetText( EMA.db.guildTagName ) EMA.settingsControl.checkBoxGuildBoEItems:SetValue( EMA.db.guildBoEItems ) EMA.settingsControl.listCheckBoxBoxOtherBlackListItem:SetValue( EMA.db.blackListItem ) @@ -642,7 +690,7 @@ function EMA:SettingsRefresh() EMA.settingsControl.guildTradeBoEItemsTagBoE:SetText( EMA.db.autoBoEItemTag ) EMA.settingsControl.checkBoxGuildCRItems:SetValue( EMA.db.guildCRItems ) EMA.settingsControl.tabNumListDropDownListCR:SetText( EMA.db.autoGuildBankTabCR ) - EMA.settingsControl.guildTradeCRItemsTagCR:SetText( EMA.db.autoCRItemTag ) + EMA.settingsControl.guildTradeCRItemsTagCR:SetText( EMA.db.autoGuildCRItemTag ) EMA.settingsControl.dropdownMessageArea:SetValue( EMA.db.messageArea ) EMA.settingsControl.checkBoxAdjustMoneyOnToonViaGuildBank:SetValue( EMA.db.adjustMoneyWithGuildBank ) EMA.settingsControl.editBoxGoldAmountToLeaveOnToon:SetText( tostring( EMA.db.goldAmountToKeepOnToon ) ) @@ -676,11 +724,19 @@ end ------------------------------------------------------------------------------------------------------------- function EMA:GetGuildItemsMaxPosition() - return #EMA.db.autoGuildItemsList + if EMA.db.globalGuildList == true then + return #EMA.db.global.autoGuildItemsListGlobal + else + return #EMA.db.autoGuildItemsList + end end function EMA:GetGuildItemsAtPosition( position ) - return EMA.db.autoGuildItemsList[position] + if EMA.db.globalGuildList == true then + return EMA.db.global.autoGuildItemsListGlobal[position] + else + return EMA.db.autoGuildItemsList[position] + end end function EMA:AddItem( itemLink, GBTab, itemTag, blackList ) @@ -695,14 +751,22 @@ function EMA:AddItem( itemLink, GBTab, itemTag, blackList ) itemInformation.GBTab = GBTab itemInformation.tag = itemTag itemInformation.blackList = blackList + if EMA.db.globalGuildList == true then + table.insert( EMA.db.global.autoGuildItemsListGlobal, itemInformation ) + else table.insert( EMA.db.autoGuildItemsList, itemInformation ) - EMA:SettingsRefresh() - EMA:SettingsGuildItemsRowClick( 1, 1 ) + end + EMA:SettingsRefresh() + EMA:SettingsGuildItemsRowClick( 1, 1 ) end end function EMA:RemoveItem() - table.remove( EMA.db.autoGuildItemsList, EMA.settingsControl.GuildItemsHighlightRow ) + if EMA.db.globalGuildList == true then + table.remove( EMA.db.global.autoGuildItemsListGlobal, EMA.settingsControl.listHighlightRow ) + else + table.remove( EMA.db.autoGuildItemsList, EMA.settingsControl.GuildItemsHighlightRow ) + end EMA:SettingsRefresh() EMA:SettingsGuildItemsRowClick( EMA.settingsControl.GuildItemsHighlightRow - 1, 1 ) end @@ -717,7 +781,7 @@ function EMA:GUILDBANKFRAME_OPENED() end function EMA:AddAllToGuildBank() - local delay = 1 + local delay = 0 for bagID = 0, NUM_BAG_SLOTS do for slotID = 1,GetContainerNumSlots( bagID ),1 do --EMA:Print( "Bags OK. checking", itemLink ) @@ -747,15 +811,21 @@ function EMA:AddAllToGuildBank() end if EMA.db.guildCRItems == true then if isCraftingReagent == true then - if EMAApi.IsCharacterInGroup( EMA.characterName, EMA.db.autoCRItemTag ) == true then + if EMAApi.IsCharacterInGroup( EMA.characterName, EMA.db.autoGuildCRItemTag ) == true then if isBop == false then canPlace = true - bankTab = EMA.db.autoGuildBankTabCR + bankTab = EMA.db.autoGuildBankTabCR end end end end - for position, itemInformation in pairs( EMA.db.autoGuildItemsList ) do + + if EMA.db.globalGuildList == true then + itemTable = EMA.db.global.autoGuildItemsListGlobal + else + itemTable = EMA.db.autoGuildItemsList + end + for position, itemInformation in pairs( itemTable ) do if EMAUtilities:DoItemLinksContainTheSameItem( itemLink, itemInformation.link ) then if EMAApi.IsCharacterInGroup( EMA.characterName, itemInformation.tag ) == true then --EMA:Print("DataTest", itemInformation.link, itemInformation.blackList ) @@ -768,8 +838,9 @@ function EMA:AddAllToGuildBank() end end end + -- EMA:Print("tester", canPlace, bankTab, itemLink, "a", bagID, slotID ) if canPlace == true and bankTab ~= 0 then - delay = delay + 3 + delay = delay + 1 EMA:ScheduleTimer("PlaceItemInGuildBank", delay , bagID, slotID, bankTab ) end end @@ -794,10 +865,10 @@ function EMA:PlaceItemInGuildBank(bagID, slotID, tab) for slot = 1, MAX_GUILDBANK_SLOTS_PER_TAB or 98 do local texture, count, locked = GetGuildBankItemInfo(tab, slot) if not locked then - PickupContainerItem( bagID ,slotID ) + --PickupContainerItem( bagID ,slotID ) UseContainerItem( bagID ,slotID ) end - end + end end end end diff --git a/Modules/ISBoxer.lua b/Modules/ISBoxer.lua index 347d3ae..c8e0440 100644 --- a/Modules/ISBoxer.lua +++ b/Modules/ISBoxer.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018 Jennifer Cally -- +-- License: All Rights Reserved 2018-2019 Jennifer Cally -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -59,6 +59,14 @@ function EMA:GetConfiguration() 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"], diff --git a/Modules/Information.lua b/Modules/Information.lua index 43a8b4a..d41e940 100644 --- a/Modules/Information.lua +++ b/Modules/Information.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018 Jennifer Cally -- +-- License: All Rights Reserved 2018-2019 Jennifer Cally -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -85,6 +85,11 @@ EMA.currTypes.RichAzeriteFragment = 1565 EMA.currTypes.SeafarersDubloon = 1710 EMA.currTypes.SealofWartornFate = 1580 EMA.currTypes.WarSupplies = 1587 +--8.1 +EMA.currTypes.SeventhLegionService = 1717 +EMA.currTypes.HonorboundService = 1716 +EMA.currTypes.TitanResiduum = 1718 + -------------------------------------- End of edit -------------------------------------------------------------- @@ -150,11 +155,19 @@ function EMA:GetConfiguration() 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-curr show", + usage = "ema-information show", get = false, set = "EMAToonRequestCurrency", }, @@ -162,7 +175,7 @@ function EMA:GetConfiguration() type = "input", name = L["HIDE_CURRENCY"], desc = L["HIDE_CURRENCY_HELP"], - usage = "/EMA-curr hide", + usage = "ema-information hide", get = false, set = "EMAToonHideCurrency", }, @@ -170,7 +183,7 @@ function EMA:GetConfiguration() type = "input", name = L["PUSH_ALL_SETTINGS"], desc = L["PUSH_SETTINGS_INFO"], - usage = "/EMA-curr push", + usage = "ema-information push", get = false, set = "EMASendSettings", }, diff --git a/Modules/Interaction.lua b/Modules/Interaction.lua index d7a184b..d89321a 100644 --- a/Modules/Interaction.lua +++ b/Modules/Interaction.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018 Jennifer Cally -- +-- License: All Rights Reserved 2018-2019 Jennifer Cally -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -51,7 +51,8 @@ EMA.settings = { --Loot autoLoot = false, tellBoERare = false, - tellBoEEpic = false, + tellBoEEpic = false, + tellBoEMount = false, messageArea = EMAApi.DefaultMessageArea(), warningArea = EMAApi.DefaultWarningArea() }, @@ -67,11 +68,19 @@ function EMA:GetConfiguration() get = "EMAConfigurationGetSetting", set = "EMAConfigurationSetSetting", args = { + config = { + type = "input", + name = L["OPEN_CONFIG"], + desc = L["OPEN_CONFIG_HELP"], + usage = "/ema-interaction config", + get = false, + set = "", + }, push = { type = "input", name = L["PUSH_SETTINGS"], desc = L["PUSH_SETTINGS_INFO"], - usage = "/EMA-interaction push", + usage = "/ema-interaction push", get = false, set = "EMASendSettings", order = 4, @@ -290,6 +299,16 @@ function EMA:SettingsCreateTaxi( top ) 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"] + ) movingTop = movingTop - sliderHeight - verticalSpacing EMA.settingsControl.dropdownMessageArea = EMAHelperSettings:CreateDropdown( EMA.settingsControl, @@ -380,6 +399,11 @@ function EMA:SettingsToggleTellBoEEpic( event, checked ) EMA:SettingsRefresh() end +function EMA:SettingsToggleTellBoEMount( event, checked ) + EMA.db.tellBoEMount = checked + EMA:SettingsRefresh() +end + -- Settings received. function EMA:EMAOnSettingsReceived( characterName, settings ) if characterName ~= EMA.characterName then @@ -396,7 +420,7 @@ function EMA:EMAOnSettingsReceived( characterName, settings ) EMA.db.autoLoot = settings.autoLoot EMA.db.tellBoERare = settings.tellBoERare EMA.db.tellBoEEpic = settings.tellBoEEpic - + EMA.db.tellBoEMount = settings.tellBoEMount EMA.db.messageArea = settings.messageArea EMA.db.warningArea = settings.warningArea -- Refresh the settings. @@ -426,6 +450,7 @@ function EMA:SettingsRefresh() 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 ) @@ -720,19 +745,21 @@ function EMA:doLoot( tries ) local _, name, _, _, lootQuality, locked = GetLootSlotInfo(slot) --EMA:Print("items", slot, locked, name, tries) if locked ~= nil and ( not locked ) then + --DEBUG + --EMA:ScheduleTimer( "TellTeamEpicBoE", 1 , "Minion of Grumpus") + -- if EMA.db.tellBoERare == true then if lootQuality == 3 then EMA:ScheduleTimer( "TellTeamEpicBoE", 1 , name) end end - if EMA.db.tellBoEEpic == true then + if EMA.db.tellBoEEpic == true or EMA.db.tellBoEMount == true then if lootQuality == 4 then EMA:ScheduleTimer( "TellTeamEpicBoE", 1 , name) end - end + end ---EMA:Print("canLoot", "slot", slot, "name", name ) LootSlot(slot) - numloot = GetNumLootItems() end end @@ -749,7 +776,7 @@ end function EMA:doLootLoop( tries ) --EMA:Print("loop", tries) - EMA:ScheduleTimer("doLoot", 0.5, tries ) + EMA:ScheduleTimer("doLoot", 0.6, tries ) end function EMA:EnableAutoLoot() @@ -766,11 +793,12 @@ function EMA:TellTeamEpicBoE( name ) for bagID = 0, NUM_BAG_SLOTS do for slotID = 1,GetContainerNumSlots( bagID ),1 do --EMA:Print( "Bags OK. checking", itemLink ) + local rarity = nil local item = Item:CreateFromBagAndSlot(bagID, slotID) if ( item ) then local bagItemName = item:GetItemName() - if ( bagItemName ) then - if bagItemName == name then + if ( bagItemName ) then + if bagItemName == name then --EMA:Print("test", bagItemName) local location = item:GetItemLocation() local itemLink = item:GetItemLink() @@ -781,16 +809,31 @@ function EMA:TellTeamEpicBoE( name ) --EMA:Print("loottest", itemLink, itemRarity , itemType ) if isBop == false then --EMA:Print("test", isBop ) - local rarity = nil - if itemRarity == 4 then - rarity = L["EPIC"] - else - rarity = L["RARE"] - end - --EMA:Print("I have looted a Epic BOE Item: ", rarity, itemName ) - EMA:EMASendMessageToTeam( EMA.db.messageArea, L["I_HAVE_LOOTED_X_Y_ITEM"]( rarity, itemLink ), false ) - end - end + if itemRarity == 4 then + rarity = L["EPIC"] + else + rarity = L["RARE"] + end + end + else + if EMA.db.tellBoEMount == true then + if isBop == false then + local mountIDs = C_MountJournal.GetMountIDs() + for i = 1, #mountIDs do + local creatureName, mountSpellID,_,_,_,_,_,_,_,_, isCollected, mountID = C_MountJournal.GetMountInfoByID(mountIDs[i]) + --EMA:Print("test2", itemLink) + if name == creatureName then + --EMA:Print("FoundAMount", bagItemName) + rarity = L["MOUNT"] + 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 ) + end + end end end end diff --git a/Modules/ItemUse.lua b/Modules/ItemUse.lua index d14facf..d65bc20 100644 --- a/Modules/ItemUse.lua +++ b/Modules/ItemUse.lua @@ -2,7 +2,7 @@ -- EMA - ( Ebony's MultiBoxing Assistant ) -- -- Current Author: Jennifer Cally (Ebony) -- -- -- --- License: All Rights Reserved 2018 Jennifer Cally -- +-- License: All Rights Reserved 2018-2019 Jennifer Cally -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -109,11 +109,19 @@ function EMA:GetConfiguration() handler = EMA, type = 'group', args = { + config = { + type = "input", + name = L["OPEN_CONFIG"], + desc = L["OPEN_CONFIG_HELP"], + usage = "/ema-team config", + get = false, + set = "", + }, push = { type = "input", name = L["PUSH_SETTINGS"], desc = L["PUSH_SETTINGS_INFO"], - usage = "/EMA-item-use push", + usage = "/ema-item-use push", get = false, set = "EMASendSettings", }, @@ -121,7 +129,7 @@ function EMA:GetConfiguration() type = "input", name = L["HIDE_ITEM_BAR"], desc = L["HIDE_ITEM_BAR_HELP"], - usage = "/EMA-item-use hide", + usage = "/ema-item-use hide", get = false, set = "HideItemUseCommand", }, @@ -129,7 +137,7 @@ function EMA:GetConfiguration() type = "input", name = L["SHOW_ITEM_BAR"], desc = L["SHOW_ITEM_BAR_HELP"], - usage = "/EMA-item-use show", + usage = "/ema-item-use show", get = false, set = "ShowItemUseCommand", }, @@ -137,7 +145,7 @@ function EMA:GetConfiguration() type = "input", name = L["CLEAR_ITEM_BAR"], desc = L["CLEAR_ITEM_BAR_HELP"], - usage = "/EMA-item-use clear", + usage = "/ema-item-use clear", get = false, set = "ClearItemUseCommand", }, @@ -361,10 +369,12 @@ function EMA:UpdateQuestItemsInBar() local kind = itemInfo.kind local action = itemInfo.action if kind == "item" then - local itemLink,_,_,_,_,questItem = GetItemInfo( action ) + --local itemLink,_,_,_,_,questItem = GetItemInfo( action ) + --local text, text2 = EMAUtilities:TooltipScaner( action ) + local _, _, _, _, _, _ , _, _, _, _, _, _, _, bindType = GetItemInfo( action ) local canUse = GetItemSpell( action ) - --EMA:Print("Checking Item...", itemLink, action, questItem ) - if ( canUse ) and questItem == QUEST then + --EMA:Print("Checking Item...", action, canUse, "a", bindType ) + if ( canUse ) and ( bindType == 4 ) then local IsInInventory = EMA:IsInInventory( action ) if IsInInventory == false then --EMA:Print("NOT IN BAGS", IsInInventory, action) diff --git a/Modules/LDBBar.lua b/Modules/LDBBar.lua index a0a40d1..3eb7351 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 Jennifer Cally -- +-- License: All Rights Reserved 2018-2019 Jennifer Cally -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- diff --git a/Modules/Mail.lua b/Modules/Mail.lua index 2a139f9..b4e6dff 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 Jennifer Cally -- +-- License: All Rights Reserved 2018-2019 Jennifer Cally -- -- -- -- Some Code Used from "Jamba" that is -- -- Released under the MIT License -- @@ -41,9 +41,15 @@ EMA.moduleOrder = 20 -- Settings - the values to store and their defaults for the settings database. EMA.settings = { + global = { + ['**'] = { + autoMailItemsListGlobal = {}, + }, + }, profile = { messageArea = EMAApi.DefaultMessageArea(), showEMAMailWindow = false, + globalMailList = false, blackListItem = false, MailBoEItems = false, autoMailToonNameBoE = "", @@ -71,15 +77,31 @@ function EMA:GetConfiguration() get = "EMAConfigurationGetSetting", set = "EMAConfigurationSetSetting", args = { + config = { + type = "input", + name = L["OPEN_CONFIG"], + desc = L["OPEN_CONFIG_HELP"], + usage = "/ema-mail config", + get = false, + set = "", + }, push = { type = "input", name = L["PUSH_SETTINGS"], desc = L["PUSH_ALL_SETTINGS"], - usage = "/EMA-Mail push", + usage = "/ema-mail push", get = false, set = "EMASendSettings", guiHidden = true, }, + copy = { + type = "input", + name = L["COPY"], + desc = L["COPY_HELP"], + usage = "/ema-mail copy", + get = false, + set = "CopyListCommmand", + }, }, } return configuration @@ -198,13 +220,22 @@ function EMA:SettingsCreateMail( top ) movingTop = movingTop - headingHeight EMA.settingsControl.checkBoxShowEMAMailWindow = EMAHelperSettings:CreateCheckBox( EMA.settingsControl, - headingWidth, - left2, + halfWidth, + left, movingTop, L["MAIL_LIST"], EMA.SettingsToggleShowEMAMailWindow, L["MAIL_LIST_HELP"] ) + EMA.settingsControl.checkBoxGlobalMailList = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + halfWidth, + left3, + movingTop, + L["GLOBAL_LIST"], + EMA.SettingsToggleGlobalMailList, + L["GLOBAL_SETTINGS_LIST_HELP"] + ) movingTop = movingTop - checkBoxHeight EMA.settingsControl.MailItemsHighlightRow = 1 EMA.settingsControl.MailItemsOffset = 1 @@ -592,6 +623,11 @@ function EMA:SettingsToggleShowEMAMailWindow( event, checked ) EMA:SettingsRefresh() end +function EMA:SettingsToggleGlobalMailList( event, checked ) + EMA.db.globalMailList = checked + EMA:SettingsRefresh() +end + -- Gold Stuff! function EMA:SettingsToggleAdjustMoneyOnToonViaMail( event, checked ) @@ -630,6 +666,11 @@ function EMA:EditMailToonNameGold (event, value ) EMA:SettingsRefresh() end +function EMA:CopyListCommmand() + EMA:Print("Copying Local List To Global List") + EMA.db.global.autoMailItemsListGlobal = EMAUtilities:CopyTable( EMA.db.autoMailItemsList ) + EMA:SettingsRefresh() +end -- Settings received. function EMA:EMAOnSettingsReceived( characterName, settings ) @@ -637,6 +678,7 @@ function EMA:EMAOnSettingsReceived( characterName, settings ) -- Update the settings. EMA.db.messageArea = settings.messageArea EMA.db.showEMAMailWindow = settings.showEMAMailWindow + EMA.db.globalMailList = settings.globalMailList EMA.db.MailTagName = settings.MailTagName EMA.db.MailBoEItems = settings.MailBoEItems EMA.db.autoMailToonNameBoE = settings.autoMailToonNameBoE @@ -645,6 +687,7 @@ function EMA:EMAOnSettingsReceived( characterName, settings ) EMA.db.autoMailToonNameCR = settings.autoMailToonNameCR EMA.db.autoCRItemTag = settings.autoCRItemTag EMA.db.autoMailItemsList = EMAUtilities:CopyTable( settings.autoMailItemsList ) + EMA.db.global.autoMailItemsListGlobal = EMAUtilities:CopyTable( settings.global.autoMailItemsListGlobal ) EMA.db.adjustMoneyWithMail = settings.adjustMoneyWithMail EMA.db.goldAmountToKeepOnToon = settings.goldAmountToKeepOnToon EMA.db.autoMailToonNameGold = settings.autoMailToonNameGold @@ -665,6 +708,9 @@ end function EMA:SettingsRefresh() EMA.settingsControl.checkBoxShowEMAMailWindow:SetValue( EMA.db.showEMAMailWindow ) +-- global CheckBox + EMA.settingsControl.checkBoxGlobalMailList:SetValue( EMA.db.globalMailList ) + EMA.settingsControl.checkBoxGlobalMailList:SetDisabled( not EMA.db.showEMAMailWindow ) EMA.settingsControl.MailItemsEditBoxMailTag:SetText( EMA.db.MailTagName ) EMA.settingsControl.listCheckBoxBoxOtherBlackListItem:SetValue( EMA.db.blackListItem ) EMA.settingsControl.checkBoxMailBoEItems:SetValue( EMA.db.MailBoEItems ) @@ -712,11 +758,19 @@ end ------------------------------------------------------------------------------------------------------------- function EMA:GetMailItemsMaxPosition() - return #EMA.db.autoMailItemsList + if EMA.db.globalMailList == true then + return #EMA.db.global.autoMailItemsListGlobal + else + return #EMA.db.autoMailItemsList + end end function EMA:GetMailItemsAtPosition( position ) - return EMA.db.autoMailItemsList[position] + if EMA.db.globalMailList == true then + return EMA.db.global.autoMailItemsListGlobal[position] + else + return EMA.db.autoMailItemsList[position] + end end function EMA:AddItem( itemLink, GBTab, itemTag, blackList ) @@ -731,14 +785,22 @@ function EMA:AddItem( itemLink, GBTab, itemTag, blackList ) itemInformation.GBTab = GBTab itemInformation.tag = itemTag itemInformation.blackList = blackList + if EMA.db.globalMailList == true then + table.insert( EMA.db.global.autoMailItemsListGlobal, itemInformation ) + else table.insert( EMA.db.autoMailItemsList, itemInformation ) - EMA:SettingsRefresh() - EMA:SettingsMailItemsRowClick( 1, 1 ) + end + EMA:SettingsRefresh() + EMA:SettingsMailItemsRowClick( 1, 1 ) end end function EMA:RemoveItem() - table.remove( EMA.db.autoMailItemsList, EMA.settingsControl.MailItemsHighlightRow ) + if EMA.db.globalMailList == true then + table.remove( EMA.db.global.autoMailItemsListGlobal, EMA.settingsControl.listHighlightRow ) + else + table.remove( EMA.db.autoMailItemsList, EMA.settingsControl.MailItemsHighlightRow ) + end EMA:SettingsRefresh() EMA:SettingsMailItemsRowClick( EMA.settingsControl.MailItemsHighlightRow - 1, 1 ) end @@ -754,8 +816,7 @@ function EMA:MAIL_SHOW(event, ...) end end if EMA.db.adjustMoneyWithMail == true and EMA.db.showEMAMailWindow == true then - EMA:ScheduleTimer( "AddGoldToMailBox", 0.1 ) - -- AddGoldToMailBox() + EMA:ScheduleTimer( "AddGoldToMailBox", 0.3 ) end end @@ -810,7 +871,12 @@ function EMA:AddAllToMailBox() end end end - for position, itemInformation in pairs( EMA.db.autoMailItemsList ) do + if EMA.db.globalMailList == true then + itemTable = EMA.db.global.autoMailItemsListGlobal + else + itemTable = EMA.db.autoMailItemsList + end + for position, itemInformation in pairs( itemTable ) do if EMAUtilities:DoItemLinksContainTheSameItem( itemLink, itemInformation.link ) then if EMAApi.IsCharacterInGroup( EMA.characterName, itemInformation.tag ) == true then --EMA:Print("DataTest", itemInformation.link, itemInformation.blackList ) @@ -841,13 +907,18 @@ function EMA:AddAllToMailBox() end end end - EMA:ScheduleTimer( "DoSendMail", 0.8, nil ) + EMA:ScheduleTimer( "DoSendMail", 1, nil ) end function EMA:MAIL_SEND_SUCCESS( event, ... ) --EMA:Print("try sendMail Again") - if EMA.ShiftkeyDown == false and EMA.Count < 1 then - EMA:ScheduleTimer( "AddAllToMailBox", 1, nil ) + if EMA.db.showEMAMailWindow == true then + if EMA.ShiftkeyDown == false and EMA.Count < 1 then + EMA:ScheduleTimer( "AddAllToMailBox", 1, nil ) + end + end + if EMA.db.adjustMoneyWithMail == true and EMA.db.showEMAMailWindow == true then + EMA:ScheduleTimer( "AddGoldToMailBox", 2 ) end end @@ -882,18 +953,24 @@ function EMA:AddGoldToMailBox() if moneyToDepositOrWithdraw > 0 and HasSendMailItem("1") == false then local currentMailToon = SendMailNameEditBox:GetText() local characterName = EMAUtilities:AddRealmToNameIfMissing( toonName ) - if toonName == currentMailToon or currentMailToon == "" and characterName ~= EMA.characterName then - if EMAApi.IsCharacterInGroup( EMA.characterName, EMA.db.autoMailMoneyTag ) == true then - local gold, silver, copper = EMAUtilities:MoneyString( moneyToDepositOrWithdraw ) - local coinText = GetCoinText( moneyToDepositOrWithdraw ) - --EMA:Print("Send", "gold", gold, "silver", silver, "copper", copper ) - SendMailSubjectEditBox:SetText( (L["SENT_AUTO_MAILER_GOLD"](coinText) ) ) - SendMailNameEditBox:SetText( toonName ) - SendMailMoneyGold:SetText(gold) - SendMailMoneySilver:SetText(silver) - SendMailMoneyCopper:SetText(copper) - EMA:ScheduleTimer( "DoSendMail", 0.8, true ) - end - end - end + if MailFrame:IsVisible() == true then + --EMA:Print("blizzardFarme") + if toonName == currentMailToon or currentMailToon == "" and characterName ~= EMA.characterName then + if EMAApi.IsCharacterInGroup( EMA.characterName, EMA.db.autoMailMoneyTag ) == true then + local gold, silver, copper = EMAUtilities:MoneyString( moneyToDepositOrWithdraw ) + local coinText = GetCoinText( moneyToDepositOrWithdraw ) + --EMA:Print("Send", "gold", gold, "silver", silver, "copper", copper ) + MailFrameTab_OnClick(nil, "2") + SendMailSubjectEditBox:SetText( (L["SENT_AUTO_MAILER_GOLD"](coinText) ) ) + SendMailNameEditBox:SetText( toonName ) + SendMailMoneyGold:SetText(gold) + SendMailMoneySilver:SetText(silver) + SendMailMoneyCopper:SetText(copper) + EMA:ScheduleTimer( "DoSendMail", 1, true ) + end + end + else + EMA:Print("[PH] Can Only Mail From BlizzardUI Mail Frame!") + end + end end \ No newline at end of file diff --git a/Modules/Modules.xml b/Modules/Modules.xml index 60007ce..8c3ab38 100644 --- a/Modules/Modules.xml +++ b/Modules/Modules.xml @@ -1,7 +1,7 @@