Page 2 of 2

Re: Localization revert to default fails

Posted: Wed Oct 09, 2019 10:13 am
by Thistis
Hello Tony,

I think we found the issue.
When we start a new game, we delete the PlayerPrefs for deleting the save game and I think this deletes the language preferences.
Currently this works for us:

Code: Select all

if (newGame) {
			string currentLanguage = Localization.Language;
			PlayerPrefs.DeleteAll();
			DialogueManager.SetLanguage(currentLanguage);
			SetInitialRandomValues();
		}

Is this sufficient or do we have to take care that we might have to restore something else by deleting the PlayerPrefs that the Dialogue Manager needs?

All the best,
Evelyn

Re: Localization revert to default fails

Posted: Wed Oct 09, 2019 10:27 am
by Tony Li
Hi Evelyn,

Generally that's fine, but I would recommend deleting only the "Language" key:

Code: Select all

PlayerPrefs.DeleteKey("Language");
If you want to change the name of this key, you can change it on the Dialogue Manager's UILocalizationManager component. If your Dialogue Manager doesn't have a UILocalizationManager, you can add one. Otherwise, at runtime the Dialogue Manager will automatically add a default one.

You might have other assets or scripts that use PlayerPrefs, so it's safer to delete only the one key. Deleting everything won't break the Dialogue System, but it may reset some player settings. The quest tracker HUD also saves the player's current visibility setting in PlayerPrefs. If you allow the player to toggle the quest tracker's visibility, it will store the current setting in PlayerPrefs. Also, if you use the Dialogue System's Menu Framework (available on the Dialogue System Extras page), it stores settings such as music volume and subtitles toggle in PlayerPrefs.

Re: Localization revert to default fails

Posted: Wed Oct 09, 2019 6:13 pm
by Thistis
Thanks that solves our problem perfectly, thank you so much for you speedy reply and support have a nice day :)

Re: Localization revert to default fails

Posted: Wed Oct 09, 2019 8:06 pm
by Tony Li
Happy to help! :-)