72 lines
2.0 KiB
C#
72 lines
2.0 KiB
C#
using TH1_Core.Events;
|
|
using TH1_Core.Managers;
|
|
using TH1_UI.Controller.Base;
|
|
using TH1_UI.View.Global;
|
|
|
|
namespace TH1_UI.Controller.Global
|
|
{
|
|
public class UIGlobalSettingController : ViewController<UIGlobalSettingView>
|
|
{
|
|
public UIGlobalSettingController() { }
|
|
|
|
protected override void RegisterEventCallback()
|
|
{
|
|
base.RegisterEventCallback();
|
|
if (WindowScript == null) return;
|
|
|
|
WindowScript.OnBtnCloseClick += _OnBtnCloseClick;
|
|
WindowScript.OnBtnRepairRendererClick += _OnBtnRepairRendererClick;
|
|
WindowScript.OnBtnBugReportClick += _OnBtnBugReportClick;
|
|
WindowScript.OnBtnManageLanguageClick += _OnBtnManageLanguageClick;
|
|
}
|
|
|
|
protected override void UnregisterEventCallback()
|
|
{
|
|
if (WindowScript != null)
|
|
{
|
|
WindowScript.OnBtnCloseClick = null;
|
|
WindowScript.OnBtnRepairRendererClick = null;
|
|
WindowScript.OnBtnBugReportClick = null;
|
|
WindowScript.OnBtnManageLanguageClick = null;
|
|
}
|
|
|
|
base.UnregisterEventCallback();
|
|
}
|
|
|
|
protected override void OnOpen()
|
|
{
|
|
base.OnOpen();
|
|
var context = _openParameter is UIGlobalSettingContext settingContext
|
|
? settingContext
|
|
: UIGlobalSettingContext.OutsideMenu;
|
|
WindowScript?.SetContent(context);
|
|
}
|
|
|
|
public override bool Close()
|
|
{
|
|
WindowScript?.CloseView();
|
|
return base.Close();
|
|
}
|
|
|
|
private void _OnBtnCloseClick()
|
|
{
|
|
Close();
|
|
}
|
|
|
|
private void _OnBtnRepairRendererClick()
|
|
{
|
|
TH1Renderer.MapRenderer.Instance?.RepairAllRenderers();
|
|
}
|
|
|
|
private void _OnBtnBugReportClick()
|
|
{
|
|
EventManager.Publish(new ShowUIGlobalBugReport());
|
|
}
|
|
|
|
private void _OnBtnManageLanguageClick()
|
|
{
|
|
EventManager.Publish(new ShowUIOutsideMod());
|
|
}
|
|
}
|
|
}
|