diff --git a/myReputationClassic/myReputationClassic.lua b/myReputationClassic/myReputationClassic.lua index 4279dba..4179c9e 100755 --- a/myReputationClassic/myReputationClassic.lua +++ b/myReputationClassic/myReputationClassic.lua @@ -1,3 +1,16 @@ +-- factionIDs https://wow.gamepedia.com/FactionID +-- StandingIDs https://wow.gamepedia.com/API_TYPE_StandingId +-- +-- Unknown 0 +-- Hated -6000 to -42000 1 +-- Hostile -3000 to -5999 2 +-- Unfriendly -1 to -2999 3 +-- Neutral 0 to 2999 4 +-- Friendly 3000 to 8999 5 +-- Honored 9000 to 20999 6 +-- Revered 21000 to 41999 7 +-- Exalted 42000 to 42999 8 + ---------------------------------------------------------------------- -- Variables ---------------------------------------------------------------------- @@ -14,8 +27,8 @@ MYREP_REGEXP_INCREASED = string.gsub( FACTION_STANDING_INCREASED, "'?%%[s|d]'?", MYREP_REGEXP_INCREASED_GENERIC = string.gsub( FACTION_STANDING_INCREASED_GENERIC, "'?%%[s|d]'?", "%(.+)" ); -- Configuration Variables and their Standard Values -myReputation_Config = { }; -myReputation_DefaultConfig = { }; +myReputation_Config = {}; +myReputation_DefaultConfig = {}; myReputation_DefaultConfig.Enabled = true; myReputation_DefaultConfig.More = true; myReputation_DefaultConfig.Blizz = false; @@ -26,9 +39,9 @@ myReputation_DefaultConfig.Info = 'Text'; myReputation_DefaultConfig.Tooltip = 'Absolute'; -- Temp Variables and Arrays -myReputations = { }; -mySessionReputations = { }; -myReputation_Var = { }; +myReputations = {}; +mySessionReputations = {}; +myReputation_Var = {}; myReputation_Var.InWorld = false; -- Function Hooks @@ -224,11 +237,11 @@ function myReputation_Toggle(toggle,init) end if (not lOriginal_CFAddMessage_General) then lOriginal_CFAddMessage_General = _G["ChatFrame1"].AddMessage; - _G["ChatFrame1"].AddMessage = myReputation_CFAddMessage_Allgemein; + _G["ChatFrame1"].AddMessage = myReputation_CFAddMessage_General; end if (not lOriginal_CFAddMessage_Combat) then lOriginal_CFAddMessage_Combat = _G["ChatFrame2"].AddMessage; - _G["ChatFrame2"].AddMessage = myReputation_CFAddMessage_Kampflog; + _G["ChatFrame2"].AddMessage = myReputation_CFAddMessage_Combat; end if (ReputationDetailFrame:GetScript("OnShow") == nil) then @@ -291,7 +304,7 @@ function myReputation_ChatFrame_Change(checked,value) --Checked will always be end -- Hooked Functions -function myReputation_CFAddMessage_Allgemein(self, msg, ...) +function myReputation_CFAddMessage_General(self, msg, ...) if ( (myReputation_Config.Blizz == false) and (msg ~= nil) and @@ -304,14 +317,14 @@ function myReputation_CFAddMessage_Allgemein(self, msg, ...) ) ) then if (myReputation_Config.Debug == true) then - myReputation_RepMsg("Blizzard Meldung in Frame 1 abgefangen"); + myReputation_RepMsg("Blizzard message captured in Frame 1"); end else lOriginal_CFAddMessage_General(self, msg, ...); end end -function myReputation_CFAddMessage_Kampflog(self, msg, ...) +function myReputation_CFAddMessage_Combat(self, msg, ...) if ( (myReputation_Config.Blizz == false) and (msg ~= nil) and @@ -324,7 +337,7 @@ function myReputation_CFAddMessage_Kampflog(self, msg, ...) ) ) then if (myReputation_Config.Debug == true) then - myReputation_RepMsg("Blizzard Meldung in Frame 2 abgefangen"); + myReputation_RepMsg("Blizzard message captured in Frame 2"); end else lOriginal_CFAddMessage_Combat(self, msg, ...); @@ -402,7 +415,7 @@ function myReputation_Frame_Update_New() local i; - for i=1, NUM_FACTIONS_DISPLAYED, 1 do + for i=1, numFactions, 1 do factionIndex = factionOffset + i; factionRow = _G["ReputationBar"..i]; factionBar = _G["ReputationBar"..i.."ReputationBar"]; @@ -413,8 +426,26 @@ function myReputation_Frame_Update_New() factionStanding = _G["ReputationBar"..i.."ReputationBarFactionStanding"]; factionBackground = _G["ReputationBar"..i.."Background"]; +--[[ +TitanDebug("i: "..i); +TitanDebug("numFactions: "..numFactions); +TitanDebug("factionIndex: "..factionIndex); +--TitanDebug("factionRow: "..factionRow); +--TitanDebug("factionTitle: "..factionTitle); +TitanDebug("factionButton: "); +TitanDebug(factionButton); +TitanDebug("factionLeftLine: "); +TitanDebug(factionLeftLine); +TitanDebug("factionBottomLine: "); +TitanDebug(factionBottomLine); +TitanDebug("factionStanding: "); +TitanDebug(factionStanding); +TitanDebug("factionBackground: "); +TitanDebug(factionBackground); +]] + if (factionIndex <= numFactions) then - name, description, standingID, barMin, barMax, barValue, atWarWith, canToggleAtWar, isHeader, isCollapsed, hasRep, isWatched, isChild = GetFactionInfo(factionIndex); + name, description, standingID, barMin, barMax, barValue, atWarWith, canToggleAtWar, isHeader, isCollapsed, hasRep, isWatched, isChild, factionID = GetFactionInfo(factionIndex); factionTitle:SetText(name); local factionStandingtext = GetText("FACTION_STANDING_LABEL"..standingID, gender); @@ -424,10 +455,7 @@ function myReputation_Frame_Update_New() barValue = barValue - barMin; barMin = 0; - if ( - (not isHeader or hasRep) and - (factionStanding:GetText() ~= nil) - ) then + if ((not isHeader or hasRep) and (factionStanding ~= nil)) then local difference = 0; -- guild name was not available on login diff --git a/myReputationClassic/myReputationClassic.toc b/myReputationClassic/myReputationClassic.toc index 9e622b7..5d578b1 100755 --- a/myReputationClassic/myReputationClassic.toc +++ b/myReputationClassic/myReputationClassic.toc @@ -1,7 +1,7 @@ ## Interface: 11304 -## Title: myReputation Classic |cff00aa001.0.0.11304|r +## Title: myReputation Classic |cff00aa001.0.1.11304|r ## Author: HonorGoG of the Titan Panel Development Team -## Version: 1.0.0.11304 +## Version: 1.0.1.11304 ## SavedVariables: myReputation_Config ## Notes: Changed display of reputation window and chat messages ## X-Credits: Egris, Karmond and Larry @ Baelgun.