68 lines
1.4 KiB
C#
68 lines
1.4 KiB
C#
using TH1_Core.Events;
|
||
using TH1_Core.Managers;
|
||
using TH1_UI.Controller.Base;
|
||
using TH1_UI.View.Outside;
|
||
using UnityEngine;
|
||
|
||
namespace TH1_UI.Controller.Outside
|
||
{
|
||
/// <summary>
|
||
/// Mod 管理界面 - Controller 层空架子
|
||
/// 由 ShowUIOutsideMod 事件触发打开(典型来源:UIOutsideMenuSettingPanel 的 ManageButton)
|
||
/// </summary>
|
||
public class UIOutsideModController : ViewController<UIOutsideModView>
|
||
{
|
||
public UIOutsideModController() { }
|
||
|
||
private ShowUIOutsideMod _evt;
|
||
|
||
protected override void RegisterEventCallback()
|
||
{
|
||
base.RegisterEventCallback();
|
||
if (WindowScript != null)
|
||
{
|
||
WindowScript.OnBtnCloseClick += _OnBtnCloseClick;
|
||
}
|
||
}
|
||
|
||
protected override void UnregisterEventCallback()
|
||
{
|
||
if (WindowScript != null)
|
||
{
|
||
WindowScript.OnBtnCloseClick -= _OnBtnCloseClick;
|
||
}
|
||
base.UnregisterEventCallback();
|
||
}
|
||
|
||
protected override void OnOpen()
|
||
{
|
||
base.OnOpen();
|
||
if (_openParameter is ShowUIOutsideMod evt)
|
||
{
|
||
_evt = evt;
|
||
if (WindowScript != null)
|
||
{
|
||
WindowScript.SetContent(evt);
|
||
}
|
||
}
|
||
else
|
||
{
|
||
Debug.LogWarning("[UIOutsideModController] Opened without valid parameters.");
|
||
}
|
||
}
|
||
|
||
void _OnBtnCloseClick()
|
||
{
|
||
// 关闭 Mod 面板后回到主菜单
|
||
EventManager.Publish(new ShowUIOutsideMenu());
|
||
Close();
|
||
}
|
||
|
||
public override bool Close()
|
||
{
|
||
WindowScript?.OnCloseView();
|
||
return base.Close();
|
||
}
|
||
}
|
||
}
|