Hi everyone,
AC 1.69.0 + Unity 2018.4.8f1.
I'm adjusting the menus, so I made them simply in Unity UI and then linked to AC menus.
Actually I have this menu: https://drive.google.com/open?id=1jk9-lUZZnsynk35P1WUOT-DS21_R6PUM where, to change language, it's necessary to click on the name of the language (text "Language" + cycle "Language").
I'd like to change the menu as this one: https://drive.google.com/open?id=1AVy93yEyZYohbrgR_dTYpiMCH9gYDFsl where I have 2 shift buttons (right and left). Teorically I have to put a text ("Language:") + a button (Right shift) + "something" (cycle language) + a button (Left shift).
How can I make it? My problem is what have I to put on "something" and how can I link to the right and left shift buttons (so clicking I can go back and forth between languages). On the inventory tutorial it uses the slots, but, in this case where I have pratically a single slot that has to change?
Thank you very much.
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
The "shift" Buttons in e.g. the Inventory menu allow you to scroll through elements that have multiple slots. This isn't the case for Buttons and Labels, which are single-slot elements.
What you could do, though, is map your game's active language to a Global PopUp variable, and use Button elements to change that variable's value, and then the language.
Create a new Global PopUp variable, name it "Language", and give it the same values as your defined languages (including the game's original language). So that it's value is independent of save game files, set it's Link to field to Options Data.
You'll then need to use an ActionList to map this to the actual language used by your game. The Save: Set option Action can be used to change language, but only by either entering it in directly, or via an Integer parameter. We can, however, convert the PopUp variable into a parameter first.
Create a new ActionList asset and define an Integer parameter (again, name it "Language"). Set the first Action to ActionList: Set parameter. Check Change own?, set New value is to Global Variable, and select the Lanauge PopUp.
Next create a Save: Set option Action, and use this parameter to set the game's current language.
Set this ActionList's When running field to Run In Background, and assign it as your game's ActionList on start game in the Settings Manager - this will make sure the language is correctly set each time the game begins.
Back to the Menu, create a new Label element to display the current language. Set it's Label type to Global Variable and select the Language variable.
Then create your Buttons, and have them run ActionLists when clicked. Have these change the value of your PopUp variable (increase / decrease the value by 1 using Variable: Set), and then have them each run the first ActionList you made to re-link the game's active language to match the Variable's value.
Thank you very much. I'll try.
Hello Chris and sorry for the delay.
I tried and I almost succeeded: almost because I have two little issues.
Thank you very much.
These are the settings of the shift buttons (right and left): https://drive.google.com/open?id=1giqo0trSwBnt1eLFNAExCNin7GN6o4I5. The right one works well and the languages run correctly. But with the left one nothing happens, as it can't come back and the language remain the same, also in runtime eith the options Run Now. I tried to set Formula -1 and, in this case, it return to the original (variable index 0).
Ok for the default language to 1 but how can I do to make sure it's never set to 0? I have to check (Variable check) if the condition it's equal to 0 and so change the value to 1?