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:
64
UXAssist/UI/MyConfigWindow.cs
Normal file
64
UXAssist/UI/MyConfigWindow.cs
Normal file
@@ -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