1
0
mirror of https://github.com/soarqin/DSP_Mods_TO.git synced 2025-12-12 01:23:31 +08:00

add XianTu

This commit is contained in:
2024-05-03 00:28:53 +08:00
parent 13e9a200b5
commit 8f5585081d
74 changed files with 2532 additions and 4589 deletions

47
XianTu/XianTuPlugin.cs Normal file
View File

@@ -0,0 +1,47 @@
using AssetsLoader;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using UnityEngine;
using XianTu.Scripts.DataController;
using XianTu.UI;
namespace XianTu
{
[BepInPlugin("me.GammaChineYov.plugin.Dyson.XianTu", "XianTu", "1.0.5")]
internal class XianTuPlugin : BaseUnityPlugin
{
private static KeyCode HotKey => _hotKey.Value;
private void Awake()
{
_logger = Logger;
_hotKey = Config.Bind("config", "HotKey", KeyCode.F2, "显示UI的快捷键");
var abload = ABLoader.LoadFromEmbeddedAssets("xiantu");
Singleton<LoadManager>.Instance.SetLoader(abload);
Singleton<LoadManager>.Instance.AddLoader(new EmbeddedFileLoad());
UIManager = new UIManager();
UIManager.SetActive(false);
UIManager.PanelManager.Push("BlueTuPatchUI");
new BlueTuController();
_logger.LogInfo("仙图加载完毕");
}
public UIManager UIManager { get; set; }
private void Update()
{
var keyDown = Input.GetKeyDown(HotKey);
if (keyDown)
{
UIManager.SetActive(!UIManager.ActiveSelf);
}
}
private static ManualLogSource _logger;
private static ConfigEntry<KeyCode> _hotKey;
}
}