Hi,
I had a little problem with the Localize UI component when loading a game. For the items, I have an "Item_Container" which is a prefab. When the game is loaded, a Custom Saver runs a function that instantiates all the Items saved. When I run the game and load a save file, the items instantiate correctly, but the name and description appear with their Text Table name instead of the localized text. But If I go back to the Main menu and load the game again, the items appear correctly with their localized name.
At first, I thought this was a problem about trying to access the table before it was loaded, but this problem persists even if I wait for the scene to be completely loaded to instantiate the items.
Finally, if the player gets a new Item during gameplay the problem is the same. If the game was loaded for the first time, the new items do not have localized text. But if the game was loaded for a second time the items have their localized text correctly.
As always, thanks in advance.
Localize UI when loading game
Re: Localize UI when loading game
Hi,
What version of the Dialogue System are you using? Can you back up your project, update to the current version (2.2.42 as of this reply), and check if the issue still persists?
How are you setting the items' names and descriptions?
What version of the Dialogue System are you using? Can you back up your project, update to the current version (2.2.42 as of this reply), and check if the issue still persists?
How are you setting the items' names and descriptions?
Re: Localize UI when loading game
Hi Tony,
I updated the DS to 2.2.42, I was using 2.2.38 and the problem still persists. I have a prefab, that includes the Name and Description on TMPRO components. In each TMPRO I added a Localice UI component.
When I instantiate an Item container on the Menu, I take the name and desc from scriptableobjects, which are referenced through and ID.
Finally,on the SO I set the name and desc with the tag on the Text Table.
As extra information, I set the debug to info and noticed that when openning the "items tab" this message appears on the console.
I understand that for some reason, the localize UI of each item container looks for the tag that I set on the container prefab, not on the actual tag of the instantiated item container. And again this is fixed If I go back to main menu and load again, but if I load from within the maingame scene the problem persists.
I updated the DS to 2.2.42, I was using 2.2.38 and the problem still persists. I have a prefab, that includes the Name and Description on TMPRO components. In each TMPRO I added a Localice UI component.
When I instantiate an Item container on the Menu, I take the name and desc from scriptableobjects, which are referenced through and ID.
Finally,on the SO I set the name and desc with the tag on the Text Table.
As extra information, I set the debug to info and noticed that when openning the "items tab" this message appears on the console.
I understand that for some reason, the localize UI of each item container looks for the tag that I set on the container prefab, not on the actual tag of the instantiated item container. And again this is fixed If I go back to main menu and load again, but if I load from within the maingame scene the problem persists.
Re: Localize UI when loading game
Hi,
Try:
Try:
Code: Select all
public void LoadItem(ItemsSO item)
{
itemName.text = DialogueManager.GetLocalizedText(item.itemName);
itemDescription = DialogueManager.GetLocalizedText(item.itemDescription);
...
}
Re: Localize UI when loading game
Hi!
The problem is solved. Thanks!
The problem is solved. Thanks!
Re: Localize UI when loading game
Glad to help!