From f81a8edf33c289255b2f53231dc6d56f96763021 Mon Sep 17 00:00:00 2001 From: Jennifer Date: Sun, 22 Sep 2019 12:32:12 +0100 Subject: [PATCH] 121020 --- CHANGELOG.txt | 22 + Core/Team-Classic.lua | 4 +- EMA-Classic.toc | 2 +- Locales/Classic-Core-Locale-enUS.lua | 33 +- Modules/DisplayTeam-Classic.lua | 28 +- Modules/Information-Classic.lua | 763 +++++++--------------------------- Modules/Modules-Classic.xml | 2 +- Modules/Purchase-Classic.lua | 10 +- Modules/Toon-Classic.lua | 123 +----- 9 files changed, 204 insertions(+), 783 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 17f2a1d..b3354df 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,28 @@ ChangeLogs: --------------------------- +EMA Version: v1.13.2-Release-v0.6(121020) +Game Version: 1.13.2 +Release Date: 22/9/2019 + +## Information + -- Can show current Team Members: + - Gold + - Durability + - BagSpace + +## Team + -- Fixed Issue #20 + +## DisplayTeam + -- Fixed Issue #22 + +##Toon + -- Cleaned Up Old Bfa Code + --Fixed Issue #13 + +--------------------------- + EMA Version: v1.13.2-Release-v0.5(121019) Game Version: 1.13.2 Release Date: 14/9/2019 diff --git a/Core/Team-Classic.lua b/Core/Team-Classic.lua index f6b6ef0..132fe32 100644 --- a/Core/Team-Classic.lua +++ b/Core/Team-Classic.lua @@ -1349,8 +1349,8 @@ function EMA:PARTY_INVITE_REQUEST( event, inviter, ... ) -- Accept an invite from friends? if EMA.db.inviteAcceptFriends == true then -- Iterate each friend; searching for the inviter in the friends list. - for friendIndex = 1, GetNumFriends() do - local friendName = GetFriendInfo( friendIndex ) + for friendIndex = 1, C_FriendList.GetNumOnlineFriends() do + local _, _, _, _, friendName = C_FriendList.GetFriendInfoByIndex( friendIndex ) -- Inviter found in friends list, allow the invite to be accepted. if inviter == friendName then acceptInvite = true diff --git a/EMA-Classic.toc b/EMA-Classic.toc index a40b9fe..f58943a 100644 --- a/EMA-Classic.toc +++ b/EMA-Classic.toc @@ -2,7 +2,7 @@ ## Title: EMA-Classic ## Notes: Ebony's MultiBoxing Assistant Classic ## Author: Jennifer Calladine 'Ebony' -## Version: v1.13.2-Release-v0.5(121019) +## Version: v1.13.2-Release-v0.6(121020) ## SavedVariables: CoreProfileDB, CommunicationsProfileDB, TeamProfileDB, TagProfileDB, MessageProfileDB, CurrProfileDB, DisplayTeamProfileDB, FollowProfileDB, GuildProfileDB, InteractionProfileDB, ItemUseProfileDB, PurchaseProfileDB, QuestProfileDB, QuestWatcherProfileDB, SellProfileDB, TalkProfileDB, ToonProfileDB, TradeProfileDB, MailProfileDB, ISBoxerProfileDB #Libs diff --git a/Locales/Classic-Core-Locale-enUS.lua b/Locales/Classic-Core-Locale-enUS.lua index 9cf9f71..b98e303 100644 --- a/Locales/Classic-Core-Locale-enUS.lua +++ b/Locales/Classic-Core-Locale-enUS.lua @@ -108,7 +108,7 @@ L["DISPLAY"] = "Display" L["ITEM_USE"] = "Item Use" L["VENDER_LIST_MODULE"] = "Sell List" L["INTERACTION"] = "Interaction" -L["CURRENCY"] = "Currency" +L["CURRENCY"] = "Information" L["TOON"] = "Toon" L["FOLLOW"] = "Follow" L["PURCHASE"] = "Purchase" @@ -458,27 +458,32 @@ L["I_AM_UNABLE_TO_FLY_TO_A"] = function( nodename ) return string.format( "I Am Unable To Fly To %s.", nodename ) end -------------------------- --- Currency Locale -L["EMA_CURRENCY"] = "Currency" -L["SHOW_CURRENCY"] = "Show Currency" -L["SHOW_CURRENCY_HELP"] = "Show The Currency Frame Window." -L["HIDE_CURRENCY"] = "Hide Currency" -L["HIDE_CURRENCY_HELP"] = "Hide The Currency Values For All Members In The Team." -L["CURRENCY_HEADER"] = "Currency Selection To Show On Frame" +-- Information Locale +L["EMA_CURRENCY"] = "Information" +L["SHOW_CURRENCY"] = "Show Information" +L["SHOW_CURRENCY_HELP"] = "Show The Information Frame Window." +L["HIDE_CURRENCY"] = "Hide Information" +L["HIDE_CURRENCY_HELP"] = "Hide The Information Values For All Members In The Team." +L["CURRENCY_HEADER"] = "Information Selection To Show On Frame" L["GOLD"] = "Gold" L["GOLD_HELP"] = "Shows The Minion's Gold" L["GOLD_GB"] = "Include Gold In Guild Bank" L["GOLD_GB_HELP"] = "Show Gold In Guild Bank\n(This Does Not Update Unless You Visit The Guildbank)" -L["CURR_STARTUP"] = "Open Currency List On Start Up" -L["CURR_STARTUP_HELP"] = "Open Currency List On Start Up.\nThe Master Only)" -L["LOCK_CURR_LIST"] = "Lock The Currency List Frame" -L["LOCK_CURR_LIST_HELP"] = "Locks The Currency List Frame And Enables Mouse Click-Through" +L["CURR_STARTUP"] = "Open Information List On Start Up" +L["CURR_STARTUP_HELP"] = "Open Information List On Start Up.\nThe Master Only)" +L["LOCK_CURR_LIST"] = "Lock The Information List Frame" +L["LOCK_CURR_LIST_HELP"] = "Locks The Information List Frame And Enables Mouse Click-Through" L["SPACE_FOR_NAME"] = "Space For Name" L["SPACE_FOR_GOLD"] = "Space For Gold" -L["SPACE_FOR_POINTS"] = "Space For Points" +L["BAG_SPACE_HELP"] = "Shows The Characters Current Bag Space" +L["DURR"] = "Durability" +L["DURR_HELP"] = "Shows The Character Durability " + + +L["SPACE_FOR_POINTS"] = "Space For Other" L["SPACE_BETWEEN_VALUES"] = "Space Between Values" L["TOTAL"] = "Total" -L["CURR"] = "Curr" +L["CURR"] = "Info" -------------------------- diff --git a/Modules/DisplayTeam-Classic.lua b/Modules/DisplayTeam-Classic.lua index ec288b4..0168745 100644 --- a/Modules/DisplayTeam-Classic.lua +++ b/Modules/DisplayTeam-Classic.lua @@ -631,7 +631,6 @@ function EMA:CreateEMATeamStatusBar( characterName, parentFrame ) healthBarText:SetAllPoints() healthBarText.playerHealth = 100 healthBarText.playerMaxHealth = 100 - healthBarText.inComingHeal = 0 characterStatusBar["healthBarText"] = healthBarText EMA:UpdateHealthStatus( characterName, nil, nil ) @@ -2449,42 +2448,40 @@ function EMA:SendHealthStatusUpdateCommand(unit) --EMA:Print("itsme", unit) local playerHealth = UnitHealth( unit ) local playerMaxHealth = UnitHealthMax( unit ) - -- local inComingHeal = UnitGetIncomingHeals( unit ) local _, class = UnitClass ("player") if EMA.db.showTeamListOnMasterOnly == true then --EMA:Print( "SendHealthStatusUpdateCommand TO Master!" ) - EMA:EMASendCommandToMaster( EMA.COMMAND_HEALTH_STATUS_UPDATE, playerHealth, playerMaxHealth, inComingHeal, class ) + EMA:EMASendCommandToMaster( EMA.COMMAND_HEALTH_STATUS_UPDATE, playerHealth, playerMaxHealth, class ) else --EMA:Print( "SendHealthStatusUpdateCommand TO Team!" ) - EMA:EMASendCommandToTeam( EMA.COMMAND_HEALTH_STATUS_UPDATE, playerHealth, playerMaxHealth, inComingHeal, class ) + EMA:EMASendCommandToTeam( EMA.COMMAND_HEALTH_STATUS_UPDATE, playerHealth, playerMaxHealth, class ) end end else local playerHealth = UnitHealth( unit ) local playerMaxHealth = UnitHealthMax( unit ) - -- local inComingHeal = UnitGetIncomingHeals( unit ) local characterName, characterRealm = UnitName( unit ) local _, class = UnitClass ( unit ) local character = EMAUtilities:AddRealmToNameIfNotNil( characterName, characterRealm ) --EMA:Print("HeathStats", character, playerHealth, playerMaxHealth) - EMA:UpdateHealthStatus( character, playerHealth, playerMaxHealth, inComingHeal, class) + EMA:UpdateHealthStatus( character, playerHealth, playerMaxHealth, class) end end end -function EMA:ProcessUpdateHealthStatusMessage( characterName, playerHealth, playerMaxHealth, inComingHeal, class ) - EMA:UpdateHealthStatus( characterName, playerHealth, playerMaxHealth, inComingHeal, class) +function EMA:ProcessUpdateHealthStatusMessage( characterName, playerHealth, playerMaxHealth, class ) + EMA:UpdateHealthStatus( characterName, playerHealth, playerMaxHealth, class) end function EMA:SettingsUpdateHealthAll() for characterName, characterStatusBar in pairs( EMA.characterStatusBar ) do - EMA:UpdateHealthStatus( characterName, nil, nil, nil, nil ) + EMA:UpdateHealthStatus( characterName, nil, nil, nil ) end end -function EMA:UpdateHealthStatus( characterName, playerHealth, playerMaxHealth, inComingHeal, class ) - --EMA:Print("testUpdate", characterName, playerHealth, playerMaxHealth, inComingHeal, class ) +function EMA:UpdateHealthStatus( characterName, playerHealth, playerMaxHealth, class ) + --EMA:Print("testUpdate", characterName, playerHealth, playerMaxHealth, class ) if characterName == nil then return end @@ -2511,24 +2508,15 @@ function EMA:UpdateHealthStatus( characterName, playerHealth, playerMaxHealth, i end if playerMaxHealth == nil then playerMaxHealth = healthBarText.playerMaxHealth - end - if inComingHeal == nil then - inComingHeal = healthBarText.inComingHeal end healthBarText.playerHealth = playerHealth healthBarText.playerMaxHealth = playerMaxHealth - healthBarText.inComingHeal = inComingHeal -- Set statusBar healthBar:SetMinMaxValues( 0, tonumber( playerMaxHealth ) ) healthBar:SetValue( tonumber( playerHealth ) ) healthIncomingBar:SetMinMaxValues( 0, tonumber( playerMaxHealth ) ) healthIncomingBar:SetValue( tonumber( playerHealth ) ) - if inComingHeal > 0 then --- EMA:Print("incomingHeal", inComingHeal) - healthIncomingBar:SetValue( tonumber( playerHealth + inComingHeal ) ) - healthIncomingBar:SetStatusBarColor( 0, 1, 0, 1 ) - end local text = "" if UnitIsDeadOrGhost(Ambiguate( characterName, "none" ) ) == true then --EMA:Print("dead", characterName) diff --git a/Modules/Information-Classic.lua b/Modules/Information-Classic.lua index 58bcd59..b0e50cc 100644 --- a/Modules/Information-Classic.lua +++ b/Modules/Information-Classic.lua @@ -41,61 +41,11 @@ EMA.globalCurrencyFramePrefix = "EMAToonCurrencyListFrame" EMA.currTypes = {} EMA.simpleCurrList = {} --- Currency Identifiers. To add you own just add a new line at the bottom of this part --- http://www.wowhead.com/currencies --- Old Stuff ---EMA.currTypes.DalaranJewelcraftingToken = 61 -EMA.currTypes.ChampionsSeal = 241 ---EMA.currTypes.IllustriousJewelcraftersToken = 361 -EMA.currTypes.TolBaradCommendation = 391 -EMA.currTypes.LesserCharmOfGoodFortune = 738 -EMA.currTypes.ElderCharmOfGoodFortune = 697 -EMA.currTypes.MoguRuneOfFate = 752 -EMA.currTypes.WarforgedSeal = 776 -EMA.currTypes.BloodyCoin = 789 -EMA.currTypes.TimelessCoin = 777 ---WoD Currency -EMA.currTypes.GarrisonResources = 824 -EMA.currTypes.TemperedFate = 994 -EMA.currTypes.ApexisCrystal = 823 -EMA.currTypes.Darkmoon = 515 -EMA.currTypes.Oil = 1101 -EMA.currTypes.InevitableFate = 1129 -EMA.currTypes.TimeWalker = 1166 -EMA.currTypes.Valor = 1191 ---Legion Currency -EMA.currTypes.OrderResources = 1220 -EMA.currTypes.AncientMana = 1155 -EMA.currTypes.NetherShard = 1226 -EMA.currTypes.SealofBrokenFate = 1273 -EMA.currTypes.ShadowyCoins = 1154 -EMA.currTypes.SightlessEye = 1149 -EMA.currTypes.TimeWornArtifact = 1268 -EMA.currTypes.CuriousCoin = 1275 ---7.2 -EMA.currTypes.LegionfallWarSupplies = 1342 ---7.2.5 -EMA.currTypes.CoinsOfAir = 1416 ---7.3 -EMA.currTypes.WakeningEssence = 1533 -EMA.currTypes.VeiledArgunite = 1508 ---8.0 -EMA.currTypes.WarResources = 1560 -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 -------------------------------------------------------------- function EMA:CurrencyIconAndName( id ) - local fullName, amount, icon, earnedThisWeek, weeklyMax, totalMax, isDiscovered, quality = GetCurrencyInfo(id) - local currName = strconcat(" |T"..icon..":20|t", L[" "]..fullName) +-- local fullName, amount, icon, earnedThisWeek, weeklyMax, totalMax, isDiscovered, quality = GetCurrencyInfo(id) +-- local currName = strconcat(" |T"..icon..":20|t", L[" "]..fullName) return currName end @@ -104,20 +54,9 @@ end EMA.settings = { profile = { currGold = true, - currGoldInGuildBank = false, - -- Currency default's - CcurrTypeOne = EMA.currTypes.OrderResources, - CcurrTypeOneName = EMA:CurrencyIconAndName(EMA.currTypes.WarResources), - CcurrTypeTwo = EMA.currTypes.AncientMana, - CcurrTypeTwoName = EMA:CurrencyIconAndName(EMA.currTypes.WarSupplies), - CcurrTypeThree = EMA.currTypes.TimeWalker, - CcurrTypeThreeName = EMA:CurrencyIconAndName(EMA.currTypes.TimeWalker), - CcurrTypeFour = EMA.currTypes.SightlessEye, - CcurrTypeFourName = EMA:CurrencyIconAndName(EMA.currTypes.SealofWartornFate), - CcurrTypeFive = 1, - CcurrTypeFiveName = "", - CcurrTypeSix = 1, - CcurrTypeSixName = "", + bagSpace = true, + charDurr = true, + currencyFrameAlpha = 1.0, currencyFramePoint = "CENTER", currencyFrameRelativePoint = "CENTER", @@ -273,77 +212,28 @@ function EMA:SettingsCreateCurrency( top ) L["GOLD_HELP"] ) movingTop = movingTop - checkBoxHeight - EMA.settingsControl.checkBoxCurrencyGoldInGuildBank = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl.checkBoxCurrencyBagSpace = EMAHelperSettings:CreateCheckBox( EMA.settingsControl, headingWidth, left, movingTop, - L["GOLD_GB"], - EMA.SettingsToggleCurrencyGoldInGuildBank, - L["GOLD_GB_HELP"] - ) - --Currency One & Two - movingTop = movingTop - checkBoxHeight - EMA.settingsControl.editBoxCurrencyTypeOneID = EMAHelperSettings:CreateDropdown( - EMA.settingsControl, - halfWidth, - left + indent, - movingTop, - L["CURRENCY"]..L[" "]..L["1"] - ) - EMA.settingsControl.editBoxCurrencyTypeOneID:SetList( EMA.CurrDropDownBox() ) - EMA.settingsControl.editBoxCurrencyTypeOneID:SetCallback( "OnValueChanged", EMA.EditBoxChangedCurrencyTypeOneID) - EMA.settingsControl.editBoxCurrencyTypeTwoID = EMAHelperSettings:CreateDropdown( - EMA.settingsControl, - halfWidth, - right + indent, - movingTop, - L["CURRENCY"]..L[" "]..L["2"] + L["BAG_SPACE"], + EMA.SettingsToggleCurrencyBagSpace, + L["BAG_SPACE_HELP"] ) - EMA.settingsControl.editBoxCurrencyTypeTwoID:SetList( EMA.CurrDropDownBox() ) - EMA.settingsControl.editBoxCurrencyTypeTwoID:SetCallback( "OnValueChanged", EMA.EditBoxChangedCurrencyTypeTwoID) - --Currency Three & Four - movingTop = movingTop - dropdownHeight - EMA.settingsControl.editBoxCurrencyTypeThreeID = EMAHelperSettings:CreateDropdown( - EMA.settingsControl, - halfWidth, - left + indent, - movingTop, - L["CURRENCY"]..L[" "]..L["3"] - ) - EMA.settingsControl.editBoxCurrencyTypeThreeID:SetList( EMA.CurrDropDownBox() ) - EMA.settingsControl.editBoxCurrencyTypeThreeID:SetCallback( "OnValueChanged", EMA.EditBoxChangedCurrencyTypeThreeID) - EMA.settingsControl.editBoxCurrencyTypeFourID = EMAHelperSettings:CreateDropdown( - EMA.settingsControl, - halfWidth, - right + indent, - movingTop, - L["CURRENCY"]..L[" "]..L["4"] - ) - EMA.settingsControl.editBoxCurrencyTypeFourID:SetList( EMA.CurrDropDownBox() ) - EMA.settingsControl.editBoxCurrencyTypeFourID:SetCallback( "OnValueChanged", EMA.EditBoxChangedCurrencyTypeFourID) - --Currency Five & Six - movingTop = movingTop - dropdownHeight - EMA.settingsControl.editBoxCurrencyTypeFiveID = EMAHelperSettings:CreateDropdown( - EMA.settingsControl, - halfWidth, - left + indent, - movingTop, - L["CURRENCY"]..L[" "]..L["5"] - ) - EMA.settingsControl.editBoxCurrencyTypeFiveID:SetList( EMA.CurrDropDownBox() ) - EMA.settingsControl.editBoxCurrencyTypeFiveID:SetCallback( "OnValueChanged", EMA.EditBoxChangedCurrencyTypeFiveID) - EMA.settingsControl.editBoxCurrencyTypeSixID = EMAHelperSettings:CreateDropdown( - EMA.settingsControl, - halfWidth, - right + indent, - movingTop, - L["CURRENCY"]..L[" "]..L["6"] + movingTop = movingTop - checkBoxHeight + EMA.settingsControl.checkBoxCurrencyCharDurr = EMAHelperSettings:CreateCheckBox( + EMA.settingsControl, + headingWidth, + left, + movingTop, + L["DURR"], + EMA.SettingsToggleCurrencyCharDurr, + L["DURR_HELP"] ) - EMA.settingsControl.editBoxCurrencyTypeSixID:SetList( EMA.CurrDropDownBox() ) - EMA.settingsControl.editBoxCurrencyTypeSixID:SetCallback( "OnValueChanged", EMA.EditBoxChangedCurrencyTypeSixID) + movingTop = movingTop - checkBoxHeight + -- Other Stuff - movingTop = movingTop - dropdownHeight EMA.settingsControl.currencyButtonShowList = EMAHelperSettings:CreateButton( EMA.settingsControl, headingWidth, @@ -511,14 +401,9 @@ end function EMA:SettingsRefresh() EMA.settingsControl.checkBoxCurrencyGold:SetValue( EMA.db.currGold ) - EMA.settingsControl.checkBoxCurrencyGoldInGuildBank:SetValue( EMA.db.currGoldInGuildBank ) - EMA.settingsControl.checkBoxCurrencyGoldInGuildBank:SetDisabled( not EMA.db.currGold ) - EMA.settingsControl.editBoxCurrencyTypeOneID:SetValue( EMA.db.CcurrTypeOne ) - EMA.settingsControl.editBoxCurrencyTypeTwoID:SetValue ( EMA.db.CcurrTypeTwo ) - EMA.settingsControl.editBoxCurrencyTypeThreeID:SetValue ( EMA.db.CcurrTypeThree ) - EMA.settingsControl.editBoxCurrencyTypeFourID:SetValue ( EMA.db.CcurrTypeFour ) - EMA.settingsControl.editBoxCurrencyTypeFiveID:SetValue ( EMA.db.CcurrTypeFive ) - EMA.settingsControl.editBoxCurrencyTypeSixID:SetValue ( EMA.db.CcurrTypeSix ) + 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 ) @@ -540,7 +425,7 @@ function EMA:SettingsRefresh() EMA:SettingsUpdateFontStyle() EMA:CurrencyUpdateWindowLock() EMAToonCurrencyListFrame:SetScale( EMA.db.currencyScale ) - EMA:UpdateHendingText() +---???? EMA:UpdateHendingText() EMA:CurrencyListSetHeight() end end @@ -554,60 +439,15 @@ function EMA:SettingsToggleCurrencyGold( event, checked ) EMA:SettingsRefresh() end -function EMA:SettingsToggleCurrencyGoldInGuildBank( event, checked ) - EMA.db.currGoldInGuildBank = checked - EMA:SettingsRefresh() -end - -function EMA:EditBoxChangedCurrencyTypeOneID( event, value ) - local currName, id = EMA:MatchCurrValue(value) - EMA.db.CcurrTypeOne = id - EMA.db.CcurrTypeOneName = currName - EMA:EMAToonRequestCurrency() - EMA:SettingsRefresh() -end - -function EMA:EditBoxChangedCurrencyTypeTwoID( event, value ) - local currName, id = EMA:MatchCurrValue(value) - EMA.db.CcurrTypeTwo = id - EMA.db.CcurrTypeTwoName = currName - EMA:EMAToonRequestCurrency() - EMA:SettingsRefresh() -end - -function EMA:EditBoxChangedCurrencyTypeThreeID( event, value ) - local currName, id = EMA:MatchCurrValue(value) - EMA.db.CcurrTypeThree = id - EMA.db.CcurrTypeThreeName = currName - EMA:EMAToonRequestCurrency() - EMA:SettingsRefresh() -end - -function EMA:EditBoxChangedCurrencyTypeFourID( event, value ) - local currName, id = EMA:MatchCurrValue(value) - EMA.db.CcurrTypeFour = id - EMA.db.CcurrTypeFourName = currName - EMA:EMAToonRequestCurrency() - EMA:SettingsRefresh() -end - -function EMA:EditBoxChangedCurrencyTypeFiveID( event, value ) - local currName, id = EMA:MatchCurrValue(value) - - EMA.db.CcurrTypeFive = id - EMA.db.CcurrTypeFiveName = currName - EMA:EMAToonRequestCurrency() +function EMA:SettingsToggleCurrencyBagSpace( event, checked ) + EMA.db.bagSpace = checked EMA:SettingsRefresh() -end +end -function EMA:EditBoxChangedCurrencyTypeSixID( event, value ) - --EMA:Print("test", value) - local currName, id = EMA:MatchCurrValue(value) - EMA.db.CcurrTypeSix = id - EMA.db.CcurrTypeSixName = currName - EMA:EMAToonRequestCurrency() +function EMA:SettingsToggleCurrencyCharDurr( event, checked ) + EMA.db.charDurr = checked EMA:SettingsRefresh() -end +end function EMA:SettingsToggleCurrencyOpenStartUpMaster( event, checked ) EMA.db.currOpenStartUpMaster = checked @@ -712,7 +552,7 @@ function EMA:OnEnable() --EMA:RegisterMessage( EMAApi.MESSAGE_MESSAGE_AREAS_CHANGED, "OnMessageAreasChanged" ) if EMA.db.currOpenStartUpMaster == true then if EMAApi.IsCharacterTheMaster( self.characterName ) == true then - EMA:ScheduleTimer( "EMAToonRequestCurrency", 20 ) + EMA:ScheduleTimer( "EMAToonRequestCurrency", 5 ) end end end @@ -726,19 +566,9 @@ function EMA:EMAOnSettingsReceived( characterName, settings ) if characterName ~= EMA.characterName then -- Update the settings. EMA.db.currGold = settings.currGold - EMA.db.currGoldInGuildBank = settings.currGoldInGuildBank - EMA.db.CcurrTypeOne = settings.CcurrTypeOne - EMA.db.CcurrTypeOneName = settings.CcurrTypeOneName - EMA.db.CcurrTypeTwo = settings.CcurrTypeTwo - EMA.db.CcurrTypeTwoName = settings.CcurrTypeTwoName - EMA.db.CcurrTypeThree = settings.CcurrTypeThree - EMA.db.CcurrTypeThreeName = settings.CcurrTypeThreeName - EMA.db.CcurrTypeFour = settings.CcurrTypeFour - EMA.db.CcurrTypeFourName = settings.CcurrTypeFourName - EMA.db.CcurrTypeFive = settings.CcurrTypeFive - EMA.db.CcurrTypeFiveName = settings.CcurrTypeFiveName - EMA.db.CcurrTypeSix = settings.CcurrTypeSix - EMA.db.CcurrTypeSixName = settings.CcurrTypeSixName + 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 @@ -770,45 +600,6 @@ function EMA:EMAOnSettingsReceived( characterName, settings ) end end -function pairsByKeys (t, f) - local a = {} - for n in pairs(t) do table.insert(a, n) end - table.sort(a, f) - local i = 0 -- iterator variable - local iter = function () -- iterator function - i = i + 1 - if a[i] == nil then return nil - else return a[i], t[a[i]] - end - end - return iter -end - -function EMA:CurrDropDownBox() - for name, id in pairs( EMA.currTypes ) do - --EMA:Print("test", name, id) - local currName = EMA:CurrencyIconAndName( id ) - EMA.simpleCurrList[id] = currName - end - EMA.simpleCurrList[0] = "" - table.sort(EMA.simpleCurrList, function(a,b) return a 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 @@ -1529,7 +1078,7 @@ function EMA:DoSendCurrency( characterName, dummyValue ) end function EMA:DoShowToonsCurrency( characterName, currencyValues ) - --EMA.Print("DoShowCurrency", characterName, currencyValues.currTypeOne, currencyValues.currMaxTypeOne ) + --EMA.Print("DoShowCurrency", characterName, EMA.currentCurrencyValues.currGold ) local parentFrame = EMAToonCurrencyListFrame -- Get (or create and get) the character information. local currencyFrameCharacterInfo = EMA.currencyFrameCharacterInfo[characterName] @@ -1548,58 +1097,28 @@ function EMA:DoShowToonsCurrency( characterName, currencyValues ) currencyFrameCharacterInfo.GoldText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.characterNameText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.GoldText:SetTextColor( r, g, b, a ) - if currencyValues.currTypeOne == currencyValues.currMaxTypeOne and currencyValues.currTypeOne > 0 then + + if currencyValues.bagSpace == 0 then --EMA:Print("SetRed") - currencyFrameCharacterInfo.TypeOneText:SetTextColor( r, v, v, a ) + currencyFrameCharacterInfo.BagSpaceText:SetTextColor( r, v, v, a ) else --EMA:Print("SetWhite") - currencyFrameCharacterInfo.TypeOneText:SetTextColor( r, g, b, a ) + currencyFrameCharacterInfo.BagSpaceText:SetTextColor( r, g, b, a ) end - - if currencyValues.currTypeTwo == currencyValues.currMaxTypeTwo and currencyValues.currTypeTwo > 0 then - currencyFrameCharacterInfo.TypeTwoText:SetTextColor( r, v, v, a ) + if currencyValues.durability == "0" then + currencyFrameCharacterInfo.CharDurrText:SetTextColor( r, v, v, a ) else - currencyFrameCharacterInfo.TypeTwoText:SetTextColor( r, g, b, a ) - end - if currencyValues.currTypeThree == currencyValues.currMaxTypeThree and currencyValues.currTypeThree > 0 then - currencyFrameCharacterInfo.TypeThreeText:SetTextColor( r, v, v, a ) - else - currencyFrameCharacterInfo.TypeThreeText:SetTextColor( r, g, b, a ) - end - - if currencyValues.currTypeFour == currencyValues.currMaxTypeFour and currencyValues.currTypeFour > 0 then - currencyFrameCharacterInfo.TypeFourText:SetTextColor( r, v, v, a ) - else - currencyFrameCharacterInfo.TypeFourText:SetTextColor( r, g, b, a ) - end - - if currencyValues.currTypeFive == currencyValues.currMaxTypeFive and currencyValues.currTypeFive > 0 then - currencyFrameCharacterInfo.TypeFiveText:SetTextColor( r, v, v, a ) - else - currencyFrameCharacterInfo.TypeFiveText:SetTextColor( r, g, b, a ) - end + --EMA:Print("SetWhite") + currencyFrameCharacterInfo.CharDurrText:SetTextColor( r, g, b, a ) + end - if currencyValues.currTypeSix == currencyValues.currMaxTypeSix and currencyValues.currTypeSix > 0 then - currencyFrameCharacterInfo.TypeSixText:SetTextColor( r, v, v, a ) - else - currencyFrameCharacterInfo.TypeSixText:SetTextColor( r, g, b, a ) - end currencyFrameCharacterInfo.GoldText:SetText( EMAUtilities:FormatMoneyString( currencyValues.currGold ) ) - --currencyFrameCharacterInfo.GoldText:SetText( GetCoinTextureString( currencyValues.currGold ) ) - currencyFrameCharacterInfo.TypeOneText:SetText( currencyValues.currTypeOne ) - currencyFrameCharacterInfo.TypeTwoText:SetText( currencyValues.currTypeTwo ) - currencyFrameCharacterInfo.TypeThreeText:SetText( currencyValues.currTypeThree ) - currencyFrameCharacterInfo.TypeFourText:SetText( currencyValues.currTypeFour ) - currencyFrameCharacterInfo.TypeFiveText:SetText( currencyValues.currTypeFive ) - currencyFrameCharacterInfo.TypeSixText:SetText( currencyValues.currTypeSix ) + 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 ) ) - --parentFrame.TotalGoldText:SetText( GetCoinTextureString( EMA.currencyTotalGold ) ) - if IsInGuild() then - parentFrame.TotalGoldGuildText:SetText( EMAUtilities:FormatMoneyString( GetGuildBankMoney() ) ) - --parentFrame.TotalGoldGuildText:SetText( GetCoinTextureString( GetGuildBankMoney() ) ) - end -- Update width of currency list. EMA:CurrencyListSetColumnWidth() EMAToonCurrencyListFrame:Show() diff --git a/Modules/Modules-Classic.xml b/Modules/Modules-Classic.xml index 846ddfe..52b56dc 100644 --- a/Modules/Modules-Classic.xml +++ b/Modules/Modules-Classic.xml @@ -26,7 +26,7 @@