mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-02-04 18:22:18 +08:00
UXAssist: Work in progress
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UXAssist.Common;
|
||||
|
||||
namespace UXAssist.UI;
|
||||
|
||||
@@ -20,7 +18,7 @@ public class MyConfigWindow : MyWindowWithTabs
|
||||
public override void _OnCreate()
|
||||
{
|
||||
_windowTrans = GetComponent<RectTransform>();
|
||||
_windowTrans.sizeDelta = new Vector2(680f, 420f);
|
||||
_windowTrans.sizeDelta = new Vector2(700f, 472f);
|
||||
|
||||
OnUICreated?.Invoke(this, _windowTrans);
|
||||
SetCurrentTab(0);
|
||||
|
||||
@@ -218,7 +218,7 @@ public class MyWindowWithTabs : MyWindow
|
||||
return true;
|
||||
}
|
||||
|
||||
public RectTransform AddTab(float x, int index, RectTransform parent, string label)
|
||||
private RectTransform AddTabInternal(float x, int index, RectTransform parent, string label)
|
||||
{
|
||||
var tab = new GameObject();
|
||||
var tabRect = tab.AddComponent<RectTransform>();
|
||||
@@ -229,7 +229,7 @@ public class MyWindowWithTabs : MyWindow
|
||||
var btn = Instantiate(src);
|
||||
var btnRect = Util.NormalizeRectWithTopLeft(btn, x, 54f, parent);
|
||||
btn.name = "tab-btn-" + index;
|
||||
btnRect.sizeDelta = new Vector2(100f, 24f);
|
||||
btnRect.sizeDelta = new Vector2(105f, 24f);
|
||||
btn.transform.Find("frame").gameObject.SetActive(false);
|
||||
if (btn.transitions.Length >= 3)
|
||||
{
|
||||
@@ -254,8 +254,8 @@ public class MyWindowWithTabs : MyWindow
|
||||
|
||||
public RectTransform AddTab(RectTransform parent, string label)
|
||||
{
|
||||
var result = AddTab(_tabX, _tabs.Count, parent, label);
|
||||
_tabX += 100f;
|
||||
var result = AddTabInternal(_tabX, _tabs.Count, parent, label);
|
||||
_tabX += 105f;
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user