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
@@ -353,6 +353,9 @@ internal static class RealtimeLogisticsInfoPanel
|
||||
var y = -5f - 35f * index;
|
||||
var itemIcon = Object.Instantiate(tipIconPrefab.gameObject, new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
||||
itemIcon.name = "icon" + index;
|
||||
var itemIconImage = itemIcon.GetComponent<Image>();
|
||||
itemIconImage.color = Color.white;
|
||||
itemIconImage.enabled = true;
|
||||
rectTrans = (RectTransform)itemIcon.transform;
|
||||
rectTrans.sizeDelta = new Vector2(30f, 30f);
|
||||
rectTrans.anchorMax = new Vector2(0f, 1f);
|
||||
@@ -362,6 +365,7 @@ internal static class RealtimeLogisticsInfoPanel
|
||||
|
||||
var sliderBg = Object.Instantiate(sliderBgPrefab.gameObject, new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
||||
sliderBg.name = "sliderBg" + index;
|
||||
sliderBg.GetComponent<Image>().enabled = true;
|
||||
rectTrans = (RectTransform)sliderBg.transform;
|
||||
rectTrans.sizeDelta = new Vector2(LogisticsConstants.StorageSliderWidth, LogisticsConstants.StorageSliderHeight);
|
||||
rectTrans.anchorMax = new Vector2(0f, 1f);
|
||||
@@ -398,7 +402,11 @@ internal static class RealtimeLogisticsInfoPanel
|
||||
var text = countText.GetComponent<Text>();
|
||||
text.fontSize = 18;
|
||||
text.text = "";
|
||||
text.color = Color.white;
|
||||
text.alignment = TextAnchor.UpperRight;
|
||||
text.fontStyle = FontStyle.Normal;
|
||||
text.horizontalOverflow = HorizontalWrapMode.Overflow;
|
||||
text.verticalOverflow = VerticalWrapMode.Overflow;
|
||||
rectTrans = (RectTransform)countText.transform;
|
||||
rectTrans.sizeDelta = new Vector2(70f, 20f);
|
||||
rectTrans.anchorMax = new Vector2(0f, 1f);
|
||||
@@ -409,7 +417,10 @@ internal static class RealtimeLogisticsInfoPanel
|
||||
|
||||
var stateLocal = Object.Instantiate(tipIconPrefab.gameObject, new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
||||
stateLocal.name = "iconLocal" + index;
|
||||
stateLocal.GetComponent<Image>().material = null;
|
||||
var stateLocalImage = stateLocal.GetComponent<Image>();
|
||||
stateLocalImage.material = null;
|
||||
stateLocalImage.color = Color.white;
|
||||
stateLocalImage.enabled = true;
|
||||
rectTrans = (RectTransform)stateLocal.transform;
|
||||
rectTrans.sizeDelta = new Vector2(16f, 16f);
|
||||
rectTrans.anchorMax = new Vector2(0f, 1f);
|
||||
@@ -418,7 +429,10 @@ internal static class RealtimeLogisticsInfoPanel
|
||||
rectTrans.anchoredPosition3D = new Vector3(102f, y, 0);
|
||||
var stateRemote = Object.Instantiate(tipIconPrefab.gameObject, new Vector3(0, 0, 0), Quaternion.identity, _tipPrefab.transform);
|
||||
stateRemote.name = "iconRemote" + index;
|
||||
stateRemote.GetComponent<Image>().material = null;
|
||||
var stateRemoteImage = stateRemote.GetComponent<Image>();
|
||||
stateRemoteImage.material = null;
|
||||
stateRemoteImage.color = Color.white;
|
||||
stateRemoteImage.enabled = true;
|
||||
rectTrans = (RectTransform)stateRemote.transform;
|
||||
rectTrans.sizeDelta = new Vector2(20f, 20f);
|
||||
rectTrans.anchorMax = new Vector2(0f, 1f);
|
||||
@@ -428,6 +442,9 @@ internal static class RealtimeLogisticsInfoPanel
|
||||
}
|
||||
|
||||
var iconPrefab = Object.Instantiate(GameObject.Find("UI Root/Overlay Canvas/In Game/Top Tips/Entity Briefs/brief-info-top/brief-info/content/icons/icon"), _tipPrefab.transform);
|
||||
var iconPrefabImage = iconPrefab.GetComponent<Image>();
|
||||
iconPrefabImage.color = Color.white;
|
||||
iconPrefabImage.enabled = true;
|
||||
Object.Destroy(iconPrefab.transform.Find("count-text").gameObject);
|
||||
Object.Destroy(iconPrefab.transform.Find("bg").gameObject);
|
||||
Object.Destroy(iconPrefab.transform.Find("inc").gameObject);
|
||||
@@ -456,6 +473,9 @@ internal static class RealtimeLogisticsInfoPanel
|
||||
text.text = "100";
|
||||
text.alignment = TextAnchor.MiddleRight;
|
||||
text.color = Color.white;
|
||||
text.fontStyle = FontStyle.Normal;
|
||||
text.horizontalOverflow = HorizontalWrapMode.Overflow;
|
||||
text.verticalOverflow = VerticalWrapMode.Overflow;
|
||||
rectTrans = (RectTransform)countText.transform;
|
||||
rectTrans.sizeDelta = new Vector2(40f, 30f);
|
||||
rectTrans.anchorMax = new Vector2(0f, 1f);
|
||||
@@ -474,6 +494,9 @@ internal static class RealtimeLogisticsInfoPanel
|
||||
text.text = "100";
|
||||
text.alignment = TextAnchor.MiddleRight;
|
||||
text.color = Color.white;
|
||||
text.fontStyle = FontStyle.Normal;
|
||||
text.horizontalOverflow = HorizontalWrapMode.Overflow;
|
||||
text.verticalOverflow = VerticalWrapMode.Overflow;
|
||||
rectTrans = (RectTransform)countText.transform;
|
||||
rectTrans.sizeDelta = new Vector2(40f, 30f);
|
||||
rectTrans.anchorMax = new Vector2(0f, 1f);
|
||||
|
||||
@@ -730,6 +730,8 @@ public class PlayerPatch : PatchImpl<PlayerPatch>
|
||||
UiTipText = Object.Instantiate(originText, originText.transform.parent);
|
||||
UiTipText.gameObject.SetActive(false);
|
||||
UiTipText.rectTransform.anchoredPosition = new Vector2(0f, 160f);
|
||||
UiTipText.color = Color.white;
|
||||
UiTipText.fontStyle = FontStyle.Normal;
|
||||
UiTipText.text = I18NKeys.AutoNavigationActive.Translate();
|
||||
}
|
||||
|
||||
|
||||
@@ -160,6 +160,12 @@ public class UIPatch : PatchImpl<UIPatch>
|
||||
var parent = uiresAmountEntry.labelText.transform.parent;
|
||||
vt.textCtrl = Object.Instantiate(uiresAmountEntry.valueText, parent);
|
||||
vt.textCtrl.font = uiresAmountEntry.labelText.font;
|
||||
vt.textCtrl.text = "";
|
||||
vt.textCtrl.color = uiresAmountEntry.normalColor;
|
||||
vt.textCtrl.alignment = TextAnchor.MiddleRight;
|
||||
vt.textCtrl.fontStyle = FontStyle.Normal;
|
||||
vt.textCtrl.horizontalOverflow = HorizontalWrapMode.Overflow;
|
||||
vt.textCtrl.verticalOverflow = VerticalWrapMode.Overflow;
|
||||
RectTransform trans = vt.textCtrl.rectTransform;
|
||||
var pos = uiresAmountEntry.rectTrans.localPosition;
|
||||
pos.x = pos.x + uiresAmountEntry.iconImage.rectTransform.localPosition.x - 25f;
|
||||
|
||||
Reference in new issue
Block a user