mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
fix(UXAssist): reset cloned UI state
This commit is contained in:
1 parent
f611f2f9b3
commit
574919f1f0
21 files changed
+308
-58
No files matched your search
@@ -77,6 +77,12 @@ internal static class MenuButtonUI
|
||||
var parent = src.transform.parent;
|
||||
var btn = GameObject.Instantiate(src, parent);
|
||||
btn.name = "button-uxassist-config";
|
||||
btn.button.enabled = true;
|
||||
btn.button.interactable = true;
|
||||
btn.text.color = Color.white;
|
||||
btn.text.fontStyle = FontStyle.Normal;
|
||||
btn.selectBg.color = new Color(1f, 1f, 1f, 0f);
|
||||
btn.selectBar.color = new Color(1f, 1f, 1f, 0f);
|
||||
var l = btn.text.GetComponent<Localizer>();
|
||||
if (l != null)
|
||||
{
|
||||
@@ -103,10 +109,13 @@ internal static class MenuButtonUI
|
||||
_buttonOnPlanetGlobe = b.gameObject;
|
||||
var rect = (RectTransform)_buttonOnPlanetGlobe.transform;
|
||||
var btn = _buttonOnPlanetGlobe.GetComponent<UIButton>();
|
||||
global::UXAssist.UI.Util.ResetButton(btn);
|
||||
var img = _buttonOnPlanetGlobe.transform.Find("button-2/icon")?.GetComponent<Image>();
|
||||
if (img != null)
|
||||
{
|
||||
img.sprite = icon;
|
||||
img.color = Color.white;
|
||||
img.enabled = icon != null;
|
||||
}
|
||||
|
||||
if (_buttonOnPlanetGlobe != null && btn != null)
|
||||
|
||||
Reference in new issue
Block a user