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<b end) - table.concat(EMA.simpleCurrList, ", ") - return EMA.simpleCurrList -end - - -function EMA:MatchCurrValue(value) - if value == 0 then - return "", 0 - end - for name, id in pairs( EMA.currTypes ) do - local currName = EMA:CurrencyIconAndName( id ) - if value == id then - return currName, id - end - end -end - function EMA:CreateEMAToonCurrencyListFrame() -- The frame. local frame = CreateFrame( "Frame", "EMAToonCurrencyListWindowFrame", UIParent ) @@ -885,66 +676,27 @@ function EMA:CreateEMAToonCurrencyListFrame() frameGoldText:SetJustifyH( "CENTER" ) frame.GoldText = frameGoldText left = left + spacing - -- Set the TypeOne font string. - local frameTypeOne = EMA.globalCurrencyFramePrefix.."TitleTypeOne" - local frameTypeOneText = parentFrame:CreateFontString( frameTypeOne.."Text", "OVERLAY", "GameFontNormal" ) - frameTypeOneText:SetText( L["CURR"]..L["1"] ) - frameTypeOneText:SetTextColor( r, g, b, a ) - frameTypeOneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTypeOneText:SetWidth( width ) - frameTypeOneText:SetJustifyH( "CENTER" ) - frame.TypeOneText = frameTypeOneText - left = left + spacing - -- Set the TypeTwo font string. - local frameTypeTwo = EMA.globalCurrencyFramePrefix.."TitleTypeTwo" - local frameTypeTwoText = parentFrame:CreateFontString( frameTypeTwo.."Text", "OVERLAY", "GameFontNormal" ) - frameTypeTwoText:SetText( L["CURR"]..L["2"] ) - frameTypeTwoText:SetTextColor( r, g, b, a ) - frameTypeTwoText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTypeTwoText:SetWidth( width ) - frameTypeTwoText:SetJustifyH( "CENTER" ) - frame.TypeTwoText = frameTypeTwoText - left = left + spacing - -- Set the TypeThree font string. - local frameTypeThree = EMA.globalCurrencyFramePrefix.."TitleTypeThree" - local frameTypeThreeText = parentFrame:CreateFontString( frameTypeThree.."Text", "OVERLAY", "GameFontNormal" ) - frameTypeThreeText:SetText( L["CURR"]..L["3"] ) - frameTypeThreeText:SetTextColor( r, g, b, a ) - frameTypeThreeText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTypeThreeText:SetWidth( width ) - frameTypeThreeText:SetJustifyH( "CENTER" ) - frame.TypeThreeText = frameTypeThreeText - left = left + spacing - -- Set the TypeFour font string. - local frameTypeFour = EMA.globalCurrencyFramePrefix.."TitleTypeFour" - local frameTypeFourText = parentFrame:CreateFontString( frameTypeFour.."Text", "OVERLAY", "GameFontNormal" ) - frameTypeFourText:SetText( L["CURR"]..L["4"] ) - frameTypeFourText:SetTextColor( r, g, b, a ) - frameTypeFourText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTypeFourText:SetWidth( width ) - frameTypeFourText:SetJustifyH( "CENTER" ) - frame.TypeFourText = frameTypeFourText + -- 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 TypeFive font string. - local frameTypeFive = EMA.globalCurrencyFramePrefix.."TitleTypeFive" - local frameTypeFiveText = parentFrame:CreateFontString( frameTypeFive.."Text", "OVERLAY", "GameFontNormal" ) - frameTypeFiveText:SetText( L["CURR"]..L["5"] ) - frameTypeFiveText:SetTextColor( r, g, b, a ) - frameTypeFiveText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTypeFiveText:SetWidth( width ) - frameTypeFiveText:SetJustifyH( "CENTER" ) - frame.TypeFiveText = frameTypeFiveText - left = left + spacing - -- Set the TypeSix font string. - local frameTypeSix = EMA.globalCurrencyFramePrefix.."TitleTypeSix" - local frameTypeSixText = parentFrame:CreateFontString( frameTypeSix.."Text", "OVERLAY", "GameFontNormal" ) - frameTypeSixText:SetText( L["CURR"]..L["6"] ) - frameTypeSixText:SetTextColor( r, g, b, a ) - frameTypeSixText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTypeSixText:SetWidth( width ) - frameTypeSixText:SetJustifyH( "CENTER" ) - frame.TypeSixText = frameTypeSixText + -- Set the BagSpace 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 @@ -957,15 +709,6 @@ function EMA:CreateEMAToonCurrencyListFrame() frameTotalGoldTitleText:SetJustifyH( "LEFT" ) frame.TotalGoldTitleText = frameTotalGoldTitleText - local frameTotalGoldGuildTitle = EMA.globalCurrencyFramePrefix.."TitleTotalGoldGuild" - local frameTotalGoldGuildTitleText = parentFrame:CreateFontString( frameTotalGoldGuildTitle.."Text", "OVERLAY", "GameFontNormal" ) - frameTotalGoldGuildTitleText:SetText( L["GUILD"] ) - frameTotalGoldGuildTitleText:SetTextColor( r, g, b, a ) - frameTotalGoldGuildTitleText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTotalGoldGuildTitleText:SetWidth( width ) - frameTotalGoldGuildTitleText:SetJustifyH( "LEFT" ) - frame.TotalGoldGuildTitleText = frameTotalGoldGuildTitleText - local frameTotalGold = EMA.globalCurrencyFramePrefix.."TotalGold" local frameTotalGoldText = parentFrame:CreateFontString( frameTotalGold.."Text", "OVERLAY", "GameFontNormal" ) frameTotalGoldText:SetText( "0" ) @@ -974,15 +717,6 @@ function EMA:CreateEMAToonCurrencyListFrame() frameTotalGoldText:SetWidth( width ) frameTotalGoldText:SetJustifyH( "RIGHT" ) frame.TotalGoldText = frameTotalGoldText - - local frameTotalGoldGuild = EMA.globalCurrencyFramePrefix.."TotalGoldGuild" - local frameTotalGoldGuildText = parentFrame:CreateFontString( frameTotalGoldGuild.."Text", "OVERLAY", "GameFontNormal" ) - frameTotalGoldGuildText:SetText( "0" ) - frameTotalGoldGuildText:SetTextColor( r, g, b, a ) - frameTotalGoldGuildText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTotalGoldGuildText:SetWidth( width ) - frameTotalGoldGuildText:SetJustifyH( "RIGHT" ) - frame.TotalGoldGuildText = frameTotalGoldGuildText -- Set frame width. frame:SetWidth( left + 10 ) @@ -1017,48 +751,8 @@ function EMA:CreateEMAToonCurrencyListFrame() EMA:SettingsUpdateFontStyle() EMAToonCurrencyListFrame:Hide() EMA.currencyListFrameCreated = true - EMA:UpdateHendingText() - EMA:CurrencyListSetHeight() -end -function EMA:UpdateHendingText() - local parentFrame = EMAToonCurrencyListFrame - -- Type One - local name, amount, icon, earnedThisWeek, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo( EMA.db.CcurrTypeOne ) - if icon ~= nil then - local iconTextureString = strconcat(" |T"..icon..":20|t") - parentFrame.TypeOneText:SetText( iconTextureString ) - end - -- Type Two - local name, amount, icon, earnedThisWeek, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo( EMA.db.CcurrTypeTwo ) - if icon ~= nil then - local iconTextureString = strconcat(" |T"..icon..":20|t") - parentFrame.TypeTwoText:SetText( iconTextureString ) - end - -- Type Three - local name, amount, icon, earnedThisWeek, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo( EMA.db.CcurrTypeThree ) - if icon ~= nil then - local iconTextureString = strconcat(" |T"..icon..":20|t") - parentFrame.TypeThreeText:SetText( iconTextureString ) - end - -- Type Four - local name, amount, icon, earnedThisWeek, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo( EMA.db.CcurrTypeFour ) - if icon ~= nil then - local iconTextureString = strconcat(" |T"..icon..":20|t") - parentFrame.TypeFourText:SetText( iconTextureString ) - end - -- Type Five - local name, amount, icon, earnedThisWeek, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo( EMA.db.CcurrTypeFive ) - if icon ~= nil then - local iconTextureString = strconcat(" |T"..icon..":20|t") - parentFrame.TypeFiveText:SetText( iconTextureString ) - end - -- Type six - local name, amount, icon, earnedThisWeek, weeklyMax, totalMax, isDiscovered = GetCurrencyInfo( EMA.db.CcurrTypeSix ) - if icon ~= nil then - local iconTextureString = strconcat(" |T"..icon..":20|t") - parentFrame.TypeSixText:SetText( iconTextureString ) - end + EMA:CurrencyListSetHeight() end function EMA:CurrencyUpdateWindowLock() @@ -1081,7 +775,7 @@ function EMA:SettingsUpdateBorderStyle() } ) 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:ClearAllPoints() frame:SetAlpha( EMA.db.currencyFrameAlpha ) frame:SetPoint( EMA.db.currencyFramePoint, UIParent, EMA.db.currencyFrameRelativePoint, EMA.db.currencyFrameXOffset, EMA.db.currencyFrameYOffset ) end @@ -1093,21 +787,14 @@ function EMA:SettingsUpdateFontStyle() frame.titleName:SetFont( textFont , textSize , "OUTLINE") frame.characterNameText:SetFont( textFont , textSize , "OUTLINE") frame.GoldText:SetFont( textFont , textSize , "OUTLINE") - frame.TotalGoldGuildTitleText:SetFont( textFont , textSize , "OUTLINE") - frame.TotalGoldGuildText:SetFont( textFont , textSize , "OUTLINE") - frame.TotalGoldText:SetFont( textFont , textSize , "OUTLINE") - frame.TotalGoldTitleText: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.characterNameText:SetFont( textFont , textSize , "OUTLINE") currencyFrameCharacterInfo.GoldText:SetFont( textFont , textSize , "OUTLINE") - currencyFrameCharacterInfo.TypeOneText:SetFont( textFont , textSize , "OUTLINE") - currencyFrameCharacterInfo.TypeTwoText:SetFont( textFont , textSize , "OUTLINE") - currencyFrameCharacterInfo.TypeThreeText:SetFont( textFont , textSize , "OUTLINE") - currencyFrameCharacterInfo.TypeFourText:SetFont( textFont , textSize , "OUTLINE") - currencyFrameCharacterInfo.TypeFiveText:SetFont( textFont , textSize , "OUTLINE") - currencyFrameCharacterInfo.TypeSixText:SetFont( textFont , textSize , "OUTLINE") + currencyFrameCharacterInfo.BagSpaceText:SetFont( textFont , textSize , "OUTLINE") + currencyFrameCharacterInfo.CharDurrText:SetFont( textFont , textSize , "OUTLINE") end end @@ -1116,13 +803,8 @@ function EMA:CurrencyListSetHeight() local additionalLines = 0 local addHeight = 0 if EMA.db.currGold == true then - if EMA.db.currGoldInGuildBank == true then - additionalLines = 2 - addHeight = 7 - else - additionalLines = 1 - addHeight = 5 - end + additionalLines = 1 + addHeight = 5 end EMAToonCurrencyListFrame:SetHeight( 56 + (( EMAApi.GetTeamListMaximumOrderOnline() + additionalLines) * 15) + addHeight ) end @@ -1152,60 +834,24 @@ function EMA:CurrencyListSetColumnWidth() parentFrame.GoldText:Hide() haveGold = 0 end - if EMA.db.CcurrTypeOneName == "" then - parentFrame.TypeOneText:Hide() - else - parentFrame.TypeOneText:SetWidth( pointsWidth ) - parentFrame.TypeOneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.TypeOneText:Show() - end - if EMA.db.CcurrTypeTwoName == "" then - parentFrame.TypeTwoText:Hide() - else - parentFrame.TypeTwoText:SetWidth( pointsWidth ) - parentFrame.TypeTwoText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.TypeTwoText:Show() - end - if EMA.db.CcurrTypeThreeName == "" then - parentFrame.TypeThreeText:Hide() - else - parentFrame.TypeThreeText:SetWidth( pointsWidth ) - parentFrame.TypeThreeText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) + if EMA.db.bagSpace == true then + parentFrame.BagSpaceText:SetWidth( goldWidth ) + parentFrame.BagSpaceText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) left = left + pointsWidth + spacingWidth numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.TypeThreeText:Show() + parentFrame.BagSpaceText:Show() + else + parentFrame.BagSpaceText:Hide() end - if EMA.db.CcurrTypeFourName == "" then - parentFrame.TypeFourText:Hide() - else - parentFrame.TypeFourText:SetWidth( pointsWidth ) - parentFrame.TypeFourText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.TypeFourText:Show() - end - if EMA.db.CcurrTypeFiveName == "" then - parentFrame.TypeFiveText:Hide() - else - parentFrame.TypeFiveText:SetWidth( pointsWidth ) - parentFrame.TypeFiveText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) + if EMA.db.charDurr == true then + parentFrame.CharDurrText:SetWidth( goldWidth ) + parentFrame.CharDurrText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) left = left + pointsWidth + spacingWidth numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.TypeFiveText:Show() - end - if EMA.db.CcurrTypeSixName == "" then - parentFrame.TypeSixText:Hide() + parentFrame.CharDurrText:Show() else - parentFrame.TypeSixText:SetWidth( pointsWidth ) - parentFrame.TypeSixText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, headingRowTopPoint ) - left = left + pointsWidth + spacingWidth - numberOfPointsColumns = numberOfPointsColumns + 1 - parentFrame.TypeSixText:Show() - end + parentFrame.CharDurrText:Hide() + end -- Character rows. for characterName, currencyFrameCharacterInfo in pairs( EMA.currencyFrameCharacterInfo ) do if EMAPrivate.Team.GetCharacterOnlineStatus (characterName) == true then @@ -1222,55 +868,22 @@ function EMA:CurrencyListSetColumnWidth() else currencyFrameCharacterInfo.GoldText:Hide() end - if EMA.db.CcurrTypeOneName == "" then - currencyFrameCharacterInfo.TypeOneText:Hide() - else - currencyFrameCharacterInfo.TypeOneText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.TypeOneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.TypeOneText:Show() - end - if EMA.db.CcurrTypeTwoName == "" then - currencyFrameCharacterInfo.TypeTwoText:Hide() - else - currencyFrameCharacterInfo.TypeTwoText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.TypeTwoText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) + if EMA.db.bagSpace == true then + currencyFrameCharacterInfo.BagSpaceText:SetWidth( pointsWidth ) + currencyFrameCharacterInfo.BagSpaceText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.TypeTwoText:Show() - end - if EMA.db.CcurrTypeThreeName == "" then - currencyFrameCharacterInfo.TypeThreeText:Hide() + currencyFrameCharacterInfo.BagSpaceText:Show() else - currencyFrameCharacterInfo.TypeThreeText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.TypeThreeText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.TypeThreeText:Show() - end - if EMA.db.CcurrTypeFourName == "" then - currencyFrameCharacterInfo.TypeFourText:Hide() - else - currencyFrameCharacterInfo.TypeFourText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.TypeFourText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.TypeFourText:Show() + currencyFrameCharacterInfo.BagSpaceText:Hide() end - if EMA.db.CcurrTypeFiveName == "" then - currencyFrameCharacterInfo.TypeFiveText:Hide() - else - currencyFrameCharacterInfo.TypeFiveText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.TypeFiveText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) + if EMA.db.charDurr == true then + currencyFrameCharacterInfo.CharDurrText:SetWidth( pointsWidth ) + currencyFrameCharacterInfo.CharDurrText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.TypeFiveText:Show() - + currencyFrameCharacterInfo.CharDurrText:Show() + else + currencyFrameCharacterInfo.CharDurrText:Hide() end - if EMA.db.CcurrTypeSixName == "" then - currencyFrameCharacterInfo.TypeSixText:Hide() - else - currencyFrameCharacterInfo.TypeSixText:SetWidth( pointsWidth ) - currencyFrameCharacterInfo.TypeSixText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, characterRowTopPoint ) - left = left + pointsWidth + spacingWidth - currencyFrameCharacterInfo.TypeSixText:Show() - end end end -- Parent frame width and title. @@ -1305,24 +918,9 @@ function EMA:CurrencyListSetColumnWidth() -- Total Gold. local nameLeft = frameHorizontalSpacing local goldLeft = frameHorizontalSpacing + nameWidth + spacingWidth - --local guildTop = -35 - ((EMAApi.GetTeamListMaximumOrder() + 1) * 15) - 5 - --local goldTop = -35 - ((EMAApi.GetTeamListMaximumOrder() + 1) * 15) - 7 local guildTop = -35 - ((EMAApi.GetTeamListMaximumOrderOnline() + 1) * 15) - 5 local goldTop = -35 - ((EMAApi.GetTeamListMaximumOrderOnline() + 1) * 15) - 7 if EMA.db.currGold == true then - if EMA.db.currGoldInGuildBank == true then - parentFrame.TotalGoldGuildTitleText:SetWidth( nameWidth ) - parentFrame.TotalGoldGuildTitleText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", nameLeft, guildTop ) - parentFrame.TotalGoldGuildTitleText:Show() - parentFrame.TotalGoldGuildText:SetWidth( goldWidth ) - parentFrame.TotalGoldGuildText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", goldLeft, guildTop ) - parentFrame.TotalGoldGuildText:Show() - --goldTop = -35 - ((EMAApi.GetTeamListMaximumOrder() + 2) * 15) - 5 - goldTop = -35 - ((EMAApi.GetTeamListMaximumOrderOnline() + 2) * 15) - 5 - else - parentFrame.TotalGoldGuildTitleText:Hide() - parentFrame.TotalGoldGuildText:Hide() - end parentFrame.TotalGoldTitleText:SetWidth( nameWidth ) parentFrame.TotalGoldTitleText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", nameLeft, goldTop ) parentFrame.TotalGoldTitleText:Show() @@ -1332,8 +930,6 @@ function EMA:CurrencyListSetColumnWidth() else parentFrame.TotalGoldTitleText:Hide() parentFrame.TotalGoldText:Hide() - parentFrame.TotalGoldGuildTitleText:Hide() - parentFrame.TotalGoldGuildText:Hide() end end @@ -1384,67 +980,27 @@ function EMA:CreateEMACurrencyFrameInfo( characterName, parentFrame ) frameGoldText:SetWidth( width ) frameGoldText:SetJustifyH( "RIGHT" ) currencyFrameCharacterInfo.GoldText = frameGoldText - left = left + spacing - -- Set the TypeOne font string. - local frameTypeOne = EMA.globalCurrencyFramePrefix.."TypeOne" - local frameTypeOneText = parentFrame:CreateFontString( frameTypeOne.."Text", "OVERLAY", "GameFontNormal" ) - frameTypeOneText:SetText( "0" ) - frameTypeOneText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameTypeOneText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTypeOneText:SetWidth( width ) - frameTypeOneText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.TypeOneText = frameTypeOneText - left = left + spacing - -- Set the TypeTwo font string. - local frameTypeTwo = EMA.globalCurrencyFramePrefix.."TypeTwo" - local frameTypeTwoText = parentFrame:CreateFontString( frameTypeTwo.."Text", "OVERLAY", "GameFontNormal" ) - frameTypeTwoText:SetText( "0" ) - frameTypeTwoText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameTypeTwoText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTypeTwoText:SetWidth( width ) - frameTypeTwoText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.TypeTwoText = frameTypeTwoText left = left + spacing - -- Set the TypeThree font string. - local frameTypeThree = EMA.globalCurrencyFramePrefix.."TypeThree" - local frameTypeThreeText = parentFrame:CreateFontString( frameTypeThree.."Text", "OVERLAY", "GameFontNormal" ) - frameTypeThreeText:SetText( "0" ) - frameTypeThreeText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameTypeThreeText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTypeThreeText:SetWidth( width ) - frameTypeThreeText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.TypeThreeText = frameTypeThreeText - left = left + spacing - -- Set the TypeFour font string. - local frameTypeFour = EMA.globalCurrencyFramePrefix.."TypeFour" - local frameTypeFourText = parentFrame:CreateFontString( frameTypeFour.."Text", "OVERLAY", "GameFontNormal" ) - frameTypeFourText:SetText( "0" ) - frameTypeFourText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameTypeFourText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTypeFourText:SetWidth( width ) - frameTypeFourText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.TypeFourText = frameTypeFourText - left = left + spacing - -- Set the TypeFive font string. - local frameTypeFive = EMA.globalCurrencyFramePrefix.."TypeFive" - local frameTypeFiveText = parentFrame:CreateFontString( frameTypeFive.."Text", "OVERLAY", "GameFontNormal" ) - frameTypeFiveText:SetText( "0" ) - frameTypeFiveText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameTypeFiveText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTypeFiveText:SetWidth( width ) - frameTypeFiveText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.TypeFiveText = frameTypeFiveText - left = left + spacing - -- Set the TypeSix font string. - local frameTypeSix = EMA.globalCurrencyFramePrefix.."TypeSix" - local frameTypeSixText = parentFrame:CreateFontString( frameTypeSix.."Text", "OVERLAY", "GameFontNormal" ) - frameTypeSixText:SetText( "0" ) - frameTypeSixText:SetTextColor( 1.00, 1.00, 1.00, 1.00 ) - frameTypeSixText:SetPoint( "TOPLEFT", parentFrame, "TOPLEFT", left, top ) - frameTypeSixText:SetWidth( width ) - frameTypeSixText:SetJustifyH( "CENTER" ) - currencyFrameCharacterInfo.TypeSixText = frameTypeSixText + -- 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 @@ -1474,30 +1030,17 @@ function EMA:EMAToonRequestCurrency() --EMA.Print("offlineRemove", characterName ) currencyFrameCharacterInfo.characterNameText:Hide() currencyFrameCharacterInfo.GoldText:Hide() - currencyFrameCharacterInfo.TypeOneText:Hide() - currencyFrameCharacterInfo.TypeTwoText:Hide() - currencyFrameCharacterInfo.TypeThreeText:Hide() - currencyFrameCharacterInfo.TypeFourText:Hide() - currencyFrameCharacterInfo.TypeFiveText:Hide() - currencyFrameCharacterInfo.TypeSixText:Hide() + currencyFrameCharacterInfo.BagSpaceText:Hide() + currencyFrameCharacterInfo.CharDurrText:Hide() else currencyFrameCharacterInfo.characterNameText:Show() - currencyFrameCharacterInfo.GoldText:SetTextColor( r, g, b, a ) currencyFrameCharacterInfo.characterNameText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.TypeOneText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.TypeTwoText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.TypeThreeText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.TypeFourText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.TypeFiveText:SetTextColor( r, g, b, a ) - currencyFrameCharacterInfo.TypeSixText: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 - if EMA.db.currGoldInGuildBank == true then - if IsInGuild() then - EMA.currencyTotalGold = GetGuildBankMoney() - end - end EMA:EMASendCommandToTeam( EMA.COMMAND_REQUEST_CURRENCY, "" ) EMA.SettingsRefresh() @@ -1508,20 +1051,26 @@ function EMA:DoSendCurrency( characterName, dummyValue ) if EMAApi.GetCharacterOnlineStatus ( characterName ) == true then table.wipe( EMA.currentCurrencyValues ) EMA.currentCurrencyValues.currGold = GetMoney() - -- CurrencyValues - EMA.currentCurrencyValues.currTypeOne = select( 2, GetCurrencyInfo( EMA.db.CcurrTypeOne ) ) - EMA.currentCurrencyValues.currTypeTwo = select( 2, GetCurrencyInfo( EMA.db.CcurrTypeTwo ) ) - EMA.currentCurrencyValues.currTypeThree = select( 2, GetCurrencyInfo( EMA.db.CcurrTypeThree ) ) - EMA.currentCurrencyValues.currTypeFour = select( 2, GetCurrencyInfo( EMA.db.CcurrTypeFour ) ) - EMA.currentCurrencyValues.currTypeFive = select( 2, GetCurrencyInfo( EMA.db.CcurrTypeFive ) ) - EMA.currentCurrencyValues.currTypeSix = select( 2, GetCurrencyInfo( EMA.db.CcurrTypeSix ) ) - -- Max CurrencyValues - EMA.currentCurrencyValues.currMaxTypeOne = select( 6, GetCurrencyInfo( EMA.db.CcurrTypeOne ) ) - EMA.currentCurrencyValues.currMaxTypeTwo = select( 6, GetCurrencyInfo( EMA.db.CcurrTypeTwo ) ) - EMA.currentCurrencyValues.currMaxTypeThree = select( 6, GetCurrencyInfo( EMA.db.CcurrTypeThree ) ) - EMA.currentCurrencyValues.currMaxTypeFour = select( 6, GetCurrencyInfo( EMA.db.CcurrTypeFour ) ) - EMA.currentCurrencyValues.currMaxTypeFive = select( 6, GetCurrencyInfo( EMA.db.CcurrTypeFive ) ) - EMA.currentCurrencyValues.currMaxTypeSix = select( 6, GetCurrencyInfo( EMA.db.CcurrTypeSix ) ) + -- 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 @@ -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 @@ <Script file="QuestWatcher-Classic.lua" /> <Script file="DisplayTeam-Classic.lua" /> -<!-- <Script file="Information-Classic.lua" /> --> + <Script file="Information-Classic.lua" /> <Script file="ItemUse-Classic.lua" /> <Script file="ISBoxer-Classic.lua" /> <Script file="LDBBar.lua" /> diff --git a/Modules/Purchase-Classic.lua b/Modules/Purchase-Classic.lua index 71dfb04..32a6bf5 100644 --- a/Modules/Purchase-Classic.lua +++ b/Modules/Purchase-Classic.lua @@ -580,8 +580,10 @@ function EMA:DoMerchantAutoBuy() -- Does the merchant have the item in stock? local itemIndexMerchant = EMA:DoesMerchantHaveItemInStock( itemLink ) if itemIndexMerchant ~= nil then + --EMA:Print("inStock", itemIndexMerchant) -- Yes, item is in stock, how many does the character need? local amountNeeded = EMA:GetAmountNeededForItemTopUp( itemLink, maxItemAmount ) + --EMA:Print("test", amountNeeded ) -- Need more than 0 items, buy them. if amountNeeded > 0 then -- Attempt to buy the items. @@ -627,6 +629,7 @@ function EMA:DoesMerchantHaveItemInStock( itemLink ) -- Yes, get the item name. local itemNameMerchant = GetItemInfo( merchantItemLink ) if itemNameMerchant == itemNameToFind then + --EMA:Print("test", itemNameMerchant, itemLink, itemNameToFind ) indexOfItemToFind = merchantIndex break end @@ -696,12 +699,15 @@ function EMA:BuyItemFromMerchant( itemIndexMerchant, amountToBuy ) costToBuy = actualAmountToBuy * price moneyAvailable = GetMoney() if moneyAvailable < costToBuy then + --EMA:Print("NO MONEY", moneyAvailable , costToBuy ) notEnoughMoney = true end -- Is there enough free space for this item in the characters bags? --TODO - need to find items family type and compare to each container. - local numFreeSlots, numTotalSlots = LibBagUtils:CountSlots("BAGS", 0) - if numFreeSlots == 0 then + --local numFreeSlots, numTotalSlots = LibBagUtils:CountSlots("BAGS", 0) + local numFreeSlots = CalculateTotalNumberOfFreeBagSlots() + --EMA:Print("testbagspace", numFreeSlots ) + if numFreeSlots == 0 then noFreeBagSpace = true end -- Buy from the merchant, if there is a valid amount to buy and the character has enough money. diff --git a/Modules/Toon-Classic.lua b/Modules/Toon-Classic.lua index 7c3df1d..8bd375c 100644 --- a/Modules/Toon-Classic.lua +++ b/Modules/Toon-Classic.lua @@ -76,11 +76,8 @@ EMA.settings = { autoRepair = false, merchantArea = EMAApi.DefaultMessageArea(), autoAcceptRoleCheck = false, - enterLFGWithTeam = false, acceptReadyCheck = false, - teleportLFGWithTeam = false, rollWithTeam = false, - toggleWarMode = false, --Debug Suff testAlwaysOff = true }, @@ -279,30 +276,9 @@ local function SettingsCreateToon( top ) EMA.SettingsToggleAutoAcceptSummonRequest, L["SUMMON_REQUEST_HELP"] ) - 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 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, halfWidth, @@ -313,16 +289,6 @@ local function SettingsCreateToon( top ) 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 EMA.settingsControlToon.checkBoxLootWithTeam = EMAHelperSettings:CreateCheckBox( EMA.settingsControlToon, halfWidth, @@ -632,11 +598,8 @@ 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.dropdownRequestArea:SetValue( EMA.db.requestArea ) EMA.settingsControlMerchant.checkBoxAutoRepair:SetValue( EMA.db.autoRepair ) EMA.settingsControlMerchant.dropdownMerchantArea:SetValue( EMA.db.merchantArea ) @@ -696,30 +659,18 @@ function EMA:SettingsToggleAcceptDeathRequests( event, checked ) EMA:SettingsRefresh() end -function EMA:SettingsToggleAutoRoleCheck( event, checked ) - EMA.db.autoAcceptRoleCheck = checked - EMA:SettingsRefresh() -end function EMA:SettingsToggleAcceptReadyCheck( event, checked ) EMA.db.acceptReadyCheck = checked EMA:SettingsRefresh() end -function EMA:SettingsToggleLFGTeleport( event, checked ) - EMA.db.teleportLFGWithTeam = checked - EMA:SettingsRefresh() -end function EMA:SettingsToggleLootWithTeam( event, checked ) EMA.db.rollWithTeam = checked EMA:SettingsRefresh() end -function EMA:SettingsToggleWarMode(event, checked ) - EMA.db.toggleWarMode = checked - EMA:SettingsRefresh() -end -- Warnings Toggles @@ -888,7 +839,6 @@ function EMA:OnEnable() EMA:RegisterEvent("LOSS_OF_CONTROL_ADDED") EMA:RegisterEvent( "UI_ERROR_MESSAGE", "BAGS_FULL" ) EMA:RegisterEvent( "BAG_UPDATE_DELAYED" ) - EMA:RegisterEvent( "PLAYER_FLAGS_CHANGED", "WARMODE" ) EMA:RegisterMessage( EMAApi.MESSAGE_MESSAGE_AREAS_CHANGED, "OnMessageAreasChanged" ) EMA:RegisterMessage( EMAApi.MESSAGE_CHARACTER_ONLINE, "OnCharactersChanged" ) EMA:RegisterMessage( EMAApi.MESSAGE_CHARACTER_OFFLINE, "OnCharactersChanged" ) @@ -933,12 +883,8 @@ function EMA:EMAOnSettingsReceived( characterName, settings ) EMA.db.autoDenyDuels = settings.autoDenyDuels EMA.db.autoAcceptSummonRequest = settings.autoAcceptSummonRequest EMA.db.autoDenyGuildInvites = settings.autoDenyGuildInvites - EMA.db.autoAcceptRoleCheck = settings.autoAcceptRoleCheck - EMA.db.enterLFGWithTeam = settings.enterLFGWithTeam EMA.db.acceptReadyCheck = settings.acceptReadyCheck - EMA.db.teleportLFGWithTeam = settings.teleportLFGWithTeam EMA.db.rollWithTeam = settings.rollWithTeam - EMA.db.toggleWarMode = settings.toggleWarMode EMA.db.autoRepair = settings.autoRepair EMA.db.warningArea = settings.warningArea EMA.db.requestArea = settings.requestArea @@ -968,9 +914,10 @@ end function EMA:GUILD_INVITE_REQUEST( event, inviter, guild, ... ) if EMA.db.autoDenyGuildInvites == true then DeclineGuild() - GuildInviteFrame:Hide() + StaticPopup_Hide( "GUILD_INVITE" ) EMA:EMASendMessageToTeam( EMA.db.requestArea, L["REFUSED_GUILD_INVITE"]( guild, inviter ), false ) end + end function EMA:DUEL_REQUESTED( event, challenger, ... ) @@ -1260,40 +1207,6 @@ function EMA:AmReadyCheck( ready ) EMA.isInternalCommand = false end -function EMA:LFGTeleport( event, arg1, ... ) - --EMA:Print("LFGtest") - if EMA.db.teleportLFGWithTeam == true then - if IsShiftKeyDown() == false then - if EMA.isInternalCommand == false then - if IsInLFGDungeon() == true then - EMA:EMASendCommandToTeam( EMA.COMMAND_TELE_PORT, true ) - else - EMA:EMASendCommandToTeam( EMA.COMMAND_TELE_PORT, false ) - end - end - end - end -end - -function EMA:DoLFGTeleport(port) - --EMA:Print("TeleCommand", port) - EMA.isInternalCommand = true - if IsShiftKeyDown() == false then - if port == true then - LFGTeleport(1) - else - LFGTeleport() - end - end - EMA.isInternalCommand = false -end - -function EMA:LFG_ROLE_CHECK_SHOW( event, ... ) - if EMA.db.autoAcceptRoleCheck == true then - --EMA:Print("testPopup?") - CompleteLFGRoleCheck("ture") - end -end function EMA:RollOnLoot(id, rollType, ...) --EMA:Print("lootTest", id, rollType) @@ -1328,30 +1241,6 @@ function EMA:CONFIRM_SUMMON( event, sender, location, ... ) end end -function EMA:WARMODE(event, ...) - if EMA.db.toggleWarMode == false then - return - end - if C_PvP.IsWarModeFeatureEnabled() == true then - local isWarMode = C_PvP.IsWarModeDesired() - if C_PvP.CanToggleWarMode(isWarMode) == true then - --EMA:Print("Send", isWarMode, EMA.isInternalCommand ) - if EMA.isInternalCommand == false then - EMA:EMASendCommandToTeam( EMA.COMMAND_WAR_MODE, isWarMode ) - EMA.isInternalCommand = true - end - end - end -end - -function EMA:DoWarMode( isWarMode ) - --EMA:Print("testwarmode", isWarMode ) - EMA.isInternalCommand = true - if C_PvP.CanToggleWarMode( isWarMode ) == true and isWarMode ~= nil then - C_PvP.SetWarModeDesired( isWarMode ) - end - EMA.isInternalCommand = false -end function EMA:MERCHANT_SHOW( event, ... ) -- Does the user want to auto repair? @@ -1535,7 +1424,6 @@ function EMA:ResetBagFull() EMA:CancelAllTimers() end ---Ebony CCed function EMA:LOSS_OF_CONTROL_ADDED( event, ... ) if EMA.db.warnCC == true then local eventIndex = C_LossOfControl.GetNumEvents() @@ -1588,11 +1476,4 @@ function EMA:EMAOnCommandReceived( characterName, commandName, ... ) EMA.DoLootRoll( characterName, ... ) end end - if commandName == EMA.COMMAND_WAR_MODE then - if characterName == self.characterName then - EMA.isInternalCommand = false - else - EMA.DoWarMode( characterName, ... ) - end - end end