mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2026-11-19 17:05:20 +08:00
UXAssist: Work in progress
This commit is contained in:
1 parent
a3b95073b8
commit
41f2103c11
19 files changed
+740
-287
No files matched your search
@@ -0,0 +1,64 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
using UXAssist.Common;
|
||||
|
||||
namespace UXAssist.UI;
|
||||
|
||||
public class MyConfigWindow : MyWindowWithTabs
|
||||
{
|
||||
public static Action<MyConfigWindow, RectTransform> OnUICreated;
|
||||
public static Action OnUpdateUI;
|
||||
|
||||
private RectTransform _windowTrans;
|
||||
|
||||
public static MyConfigWindow CreateInstance()
|
||||
{
|
||||
return MyWindowManager.CreateWindow<MyConfigWindow>("UXAConfigWindow", "UXAssist Config");
|
||||
}
|
||||
|
||||
public override void _OnCreate()
|
||||
{
|
||||
_windowTrans = GetComponent<RectTransform>();
|
||||
_windowTrans.sizeDelta = new Vector2(680f, 420f);
|
||||
|
||||
OnUICreated?.Invoke(this, _windowTrans);
|
||||
SetCurrentTab(0);
|
||||
OnUpdateUI?.Invoke();
|
||||
}
|
||||
|
||||
public override void _OnDestroy()
|
||||
{
|
||||
}
|
||||
|
||||
public override bool _OnInit()
|
||||
{
|
||||
_windowTrans.anchoredPosition = new Vector2(0, 0);
|
||||
return true;
|
||||
}
|
||||
|
||||
public override void _OnFree()
|
||||
{
|
||||
}
|
||||
|
||||
public override void _OnOpen()
|
||||
{
|
||||
}
|
||||
|
||||
public override void _OnClose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void _OnUpdate()
|
||||
{
|
||||
base._OnUpdate();
|
||||
if (VFInput.escape && !VFInput.inputing)
|
||||
{
|
||||
VFInput.UseEscape();
|
||||
_Close();
|
||||
return;
|
||||
}
|
||||
|
||||
OnUpdateUI?.Invoke();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user