mirror of
https://github.com/All-Of-Us-Mods/MiraAPI.git
synced 2026-10-19 15:51:48 +00:00
Translate local setting buttons
This commit is contained in:
1 parent
48aff163f9
commit
a3ed901a18
2 files changed
+12
No files matched your search
@@ -29,6 +29,8 @@ public class LocalSettingsButton(string text, Action onClick)
|
||||
/// </summary>
|
||||
public LocalSettingsTab? Tab { get; internal set; }
|
||||
|
||||
private TextMeshPro _btnText { get; set; }
|
||||
|
||||
internal GameObject CreateButton(ToggleButtonBehaviour toggle, Transform parent, ref float offset, ref int order, bool last)
|
||||
{
|
||||
var button = Object.Instantiate(toggle, parent).GetComponent<PassiveButton>();
|
||||
@@ -53,6 +55,7 @@ public class LocalSettingsButton(string text, Action onClick)
|
||||
}
|
||||
|
||||
tmp.text = Text.Translate();
|
||||
_btnText = tmp;
|
||||
button.name = Text;
|
||||
button.OnClick = new UnityEngine.UI.Button.ButtonClickedEvent();
|
||||
rollover.OutColor = Tab!.TabAppearance.ButtonColor;
|
||||
@@ -75,4 +78,9 @@ public class LocalSettingsButton(string text, Action onClick)
|
||||
|
||||
return button.gameObject;
|
||||
}
|
||||
|
||||
public void RefreshButton()
|
||||
{
|
||||
_btnText.text = Text.Translate();
|
||||
}
|
||||
}
|
||||
@@ -89,6 +89,10 @@ public abstract class LocalSettingsTab(ConfigFile config)
|
||||
{
|
||||
setting.RefreshOption();
|
||||
}
|
||||
foreach (var button in Buttons)
|
||||
{
|
||||
button.RefreshButton();
|
||||
}
|
||||
|
||||
foreach (var label in Labels)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user