Total RP 3

Total RP 3

4M Downloads

Language setting is not being saved across loading screens

MortonSaltMug opened this issue ยท 6 comments

commented

Describe the bug
When setting the option in TRP3 to remember the last language used, it seems the language is defaulting back to the "common" language of the faction. Using /reload manually will update the change and set the appropriate language, but any time the client goes through an automatic load screen (instance portals, mage portals, etc) it seems to disregard this setting completely and just default to the common language.

To Reproduce
Steps to reproduce the behaviour:

  1. Using a non-human, non-orc character with a secondary language. (I have chosen Night Elf)
  2. Set your language in TRP3 to your race-specific language.
  3. Check that the language was updated with:
     /dump ChatFrame1EditBox.language
     /dump ChatFrame1EditBox.languageID
  1. Use a portal (Such as the portal to Hellfire Peninsula) or an instance portal (Such as Stormwind Stockades).
  2. Re-check the language setting with the above /dump commands.

Expected behaviour
The language setting -should- save across this transition, but it apparently gets overwritten by Blizzard. Perhaps Blizzard is defaulting to these common languages to cut down on race-specific chat confusion? I think this is the case at least for instances. Though, the language should be preserved across an overworld load from Hellfire Peninsula to Mage Tower portals (and others).

The language setting -is- honored correctly when doing a /reload though.

Screenshots or error message
Dump output:
---- Using the /reload command manually

Dump: value=ChatFrame1EditBox.language 
[1]="Darnassian"
Dump: value=ChatFrame1EditBox.languageID 
[1]=2 

---- After using a mage portal/instance portal

Dump: value=ChatFrame1EditBox.language 
[1]="Common" 
Dump: value=ChatFrame1EditBox.languageID 
[1]=7

Version of the add-on:
Total RP 3 1.4.6 (Build 59)

Did you try having Total RP 3 as the only enabled addon and everything else (especially something like ElvUI) disabled?
Yes

Additional Info
If requested, I can probably capture some video recording to visually showcase the issue.

commented

The issue seems to come from Blizzard as I'm seeing the language revert back to the default one without Total RP3 enabled. The "Remember last language used" might need to get carried over on loading screen as well if necessary.

commented

Yea, digging a little into the code of languages.lua...

	if Configuration.getValue(TRP3_API.ADVANCED_SETTINGS_KEYS.REMEMBER_LAST_LANGUAGE_USED) then
		-- We have to wait a little for everything to be fully loaded before trying to restore previously selected language
		C_Timer.After(1, function()
			setLanguage(getCharacterPreviouslySelectedLanguage());
		end)

Seems like maybe just tweaking that 'wait time' might be the fix for it.

commented

No, this code is run on loading the addon only. It would need to be run after a loading screen as well to fix this behaviour.

commented

Yea, I see that now. Tested it out with a print() debug and it didn't print on a zone transition load, but did with a manual /reload.

Oh well. Not sure if this would be considered a bug, or just intended behavior on behalf of the AddOn. I'll leave it up to you guys to classify or close :)

commented

Since most people are used to the game not resetting the language for every loading screen, I think it would be fair to have Total RP 3 fix that. I think we should have a workaround for this with an option to disable the workaround in the advanced settings.

commented

In my testing I wrote a small function and registered it to the "LOADING_SCREEN_DISABLED" event and that seems to be working just fine for setting the language appropriately. It seems like PLAYER_ENTERING_WORLD has been bumped around on the AddOn load process or something weird. I tried just registering with PLAYER_ENTERING_WORLD and it would get overwritten by whatever voodoo magic Blizzard is throwing between events.

I'll report back if I find out any more info that might provide useful.