NLDClient-yudde/ProjectNLD/Assets/Code/Scripts/Gameplay/UI/UI_EditIntroductionControll...

93 lines
2.1 KiB
C#
Raw Normal View History

2024-10-11 16:04:28 +08:00
using Cysharp.Threading.Tasks;
2024-10-11 18:17:51 +08:00
using Framework;
2024-10-11 16:04:28 +08:00
using Gameplay;
2024-10-11 18:17:51 +08:00
using Gameplay.Net;
2024-10-11 16:04:28 +08:00
using TMPro;
using UnityEngine.UI;
using Button = UnityEngine.UI.Button;
using Image = UnityEngine.UI.Image;
public class UI_EditIntroductionController : UIWindow
{
//UI GameObj
///Auto Gen Start///
public Image Image_Bg;
public Button Button_Close;
public TMP_Text Text_Title;
public TMP_InputField InputField_Introduction;
public TMP_Text Text_Tip;
public Button Button_Confirm;
public RawImage rawImageGaussianBlurMask;
2024-10-11 19:15:56 +08:00
///Auto Gen End///
2024-10-11 16:04:28 +08:00
2024-10-11 19:15:56 +08:00
// deal with input data
public override void PreLoad(object data = null)
{
}
2024-10-11 16:04:28 +08:00
public static async UniTask<UIWindow> Open()
{
2024-10-11 19:15:56 +08:00
CommonUtils.CaptureScreenshot(); // 截取当前屏幕截图
return await UIManager.Instance.CreateAndOpenWindow(UINameConst.UI_EditIntroduction);
2024-10-11 16:04:28 +08:00
}
2024-10-11 19:15:56 +08:00
2024-10-11 16:04:28 +08:00
// Use this for initialization
public override void OnInit()
{
//bind UI GameObj
UI_EditIntroductionBinder.GetComponents(this);
2024-10-11 19:15:56 +08:00
rawImageGaussianBlurMask = GetComponent<RawImage>("GaussianBlurMask");
rawImageGaussianBlurMask.texture = CommonUtils.GetScreenTexture2D();
2024-10-11 16:04:28 +08:00
2024-10-11 19:15:56 +08:00
EventManager.Instance.Register(EventManager.EventName.PlayerInfoUpdate, OnChangeInfo);
2024-10-11 16:04:28 +08:00
2024-10-11 19:15:56 +08:00
BindButton(Button_Close, OnCloseClick);
2024-10-11 16:04:28 +08:00
BindButton(Button_Confirm, OnConfirmClick);
}
//invoke when open window
protected override void OnShowWindow(object data = null)
{
2024-10-11 19:15:56 +08:00
2024-10-11 16:04:28 +08:00
}
2024-10-11 19:15:56 +08:00
2024-10-11 16:04:28 +08:00
//invoke when reload window
protected override void OnReloadWindow(object data = null)
{
2024-10-11 19:15:56 +08:00
2024-10-11 16:04:28 +08:00
}
2024-10-11 19:15:56 +08:00
2024-10-11 16:04:28 +08:00
//invoke when close window
protected override void OnHideWindow()
{
2024-10-11 19:15:56 +08:00
2024-10-11 16:04:28 +08:00
}
2024-10-11 19:15:56 +08:00
2024-10-11 16:04:28 +08:00
//invoke when destroy
public override void OnRelease()
{
2024-10-11 19:15:56 +08:00
base.OnRelease();
2024-10-11 18:17:51 +08:00
EventManager.Instance.Unregister(EventManager.EventName.PlayerInfoUpdate, OnChangeInfo);
2024-10-11 16:04:28 +08:00
}
2024-10-11 19:15:56 +08:00
protected override void OnCloseClick()
{
base.OnCloseClick();
2024-10-11 16:04:28 +08:00
CloseWindow();
2024-10-11 19:15:56 +08:00
}
void OnConfirmClick()
{
2024-10-11 16:04:28 +08:00
DebugUtil.Log("修改个性签名:" + InputField_Introduction.text);
2024-10-11 18:17:51 +08:00
//CommonUtils.ShowMessageTips("签名系统后续开放,敬请期待!");
NetHelper.SetPlayerIntroduction(InputField_Introduction.text);
2024-10-11 19:15:56 +08:00
}
2024-10-11 18:17:51 +08:00
void OnChangeInfo()
{
CloseWindow();
}
2024-10-11 16:04:28 +08:00
}