Thread Tools Display Modes
12-18-22, 02:54 AM   #1
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
Is really possible that ...

Hi all,

I am confused.
Is it really possible that the blizzard codes save the affixes names of the runs in m+ in the LOCALE language and not in a code or in a GLOBAL string ?!

I try to explain better.

Lua Code:
  1. local mapIDs = {
  2.    [165] = { "GROUND",      "Shadowmoon Burial Grounds" },
  3.    [200] = { "HoV",         "Halls of Valor" },
  4.    [210] = { "COURT",       "Court of Stars" },
  5.    [2]   = { "JADE",        "Temple of the Jade Serpent" },    
  6.    [399] = { "RUBY",        "Ruby Life Pools" },
  7.    [400] = { "NOKH",        "The Nokhud Offensive" },
  8.    [401] = { "AZURE",       "The Azure Vault" },
  9.    [402] = { "ALGE",        "Algeth'ar Academy" },
  10. }
  11.  
  12. for mapID in pairs(mapIDs) do
  13.    local affix, score = C_MythicPlus.GetSeasonBestAffixScoreInfoForMap(mapID)
  14.    if score then
  15.       for i,t in ipairs(affix) do
  16.          print(C_ChallengeMode.GetMapUIInfo(mapID) .. " | " .. t.name .. " | score=" .. t.score)
  17.       end
  18.    end
  19. end

This simple code runs and prints the best run (score) with current affix.
This is the first week of the season and it is a Fortified week so I got something like:



The problem is Fortified appear because my LOCALE is enUS but if I switch language on itIT I get:
"Fortified" = "Potenziamento"

and if I have to make some choice in my addon on the fact the record are Fortified or Tyrannical I am in big trouble if I dont have the right locale at least for one of them ...

In example If I want to create 2 columns for Fortified or Tyrannical runs and I try to check them using something like:

Lua Code:
  1. if t.name == L["Fortified"] then localpos = 3 else localpos = 4 end

and it fails if I dont have the right LOCALE somewhere defined.

I.e, the runs are all Fortified but not having the LOCALE for deDE the if fails and they are put in the Tyrannical column :


I have fixed a little bit installed all the languages and then run the game once for locale and get the translation of Fortified for the configured language.

Lua Code:
  1. if LOCALE == "enUS" then
  2.     -- The EU English game client also
  3.     -- uses the US English locale code.
  4. return end
  5.  
  6. if LOCALE == "esES" or LOCALE == "esMX" then
  7.     L["Fortified"]                      = "Reforzado"
  8. return end
  9.  
  10. if LOCALE == "ptBR" then
  11.     L["Fortified"]                      = "Fortificada"
  12. return end
  13.  
  14. if LOCALE == "frFR" then
  15.     L["Fortified"]                      = "Fortifié"
  16. return end
  17.  
  18. if LOCALE == "deDE" then
  19.     L["Fortified"]                      = "Verstärkt"
  20. return end
  21.  
  22. if LOCALE == "itIT" then   
  23.     L["Fortified"]     
  24. ... etc etc

Now I'd like to ask if there is here some one that know if there is a better solution to solve this iussue in a more elegant way because I really didnt find it :/

Thanks all ...
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote
12-20-22, 12:57 AM   #2
SDPhantom
A Pyroguard Emberseer
 
SDPhantom's Avatar
AddOn Author - Click to view addons
Join Date: Jul 2006
Posts: 2,326
It looks like there are some functions that give an AffixID. Perhaps you can use C_ChallengeMode.GetAffixInfo() to build a reverse lookup table and store by that ID?

I seriously doubt the raw data the client gets from the server has the affixes sent as locale-dependent strings. It's more likely the API function does the localization itself rather than relying on the UI to do it.
__________________
WoWInterface AddOns
"All I want is a pretty girl, a decent meal, and the right to shoot lightning at fools."
-Anders (Dragon Age: Origins - Awakening)
  Reply With Quote
12-20-22, 10:48 PM   #3
gmarco
An Onyxian Warder
 
gmarco's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2009
Posts: 362
SDPhantom,

thanks so much it is really what I am looking for.
I think the subject of the thread should be "Is really possible that I am so blind or dumb ?"

I really have search here and there for hours how to do this and I dont realize I had the solution so near.
The problem was that I didn't know anything about affixID and so I was a little bit confused. But once I investigated there, everything is became easy



and the code in the addon is now:

Lua Code:
  1. if t.name == C_ChallengeMode.GetAffixInfo(10) then localpos = 3 else localpos = 4 end

Now it should works as expected.
Thanks so much again.
__________________
This is Unix-Land. In quiet nights, you can hear the Windows machines reboot.
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Is really possible that ...


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off