bingo 项目提交
This commit is contained in:
@@ -0,0 +1,291 @@
|
||||
using System;
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
using FairyGUI;
|
||||
using FGUI.ACommon;
|
||||
using UnityEngine;
|
||||
using FGUI.JSettings;
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
using UnityEngine.Device;
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class SettingUI : BaseUI
|
||||
{
|
||||
private SettingUICtrl ctrl;
|
||||
private SettingModel model;
|
||||
private FGUI.G006_menu_animal.com_setting_ani ui;
|
||||
|
||||
public SettingUI(SettingUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.SettingUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "G006_menu_animal";
|
||||
uiInfo.assetName = "com_setting_ani";
|
||||
uiInfo.layerType = UILayerType.Popup;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = true;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
protected override void OnInit()
|
||||
{
|
||||
model = ModuleBoardk.Instance.GetModel(ModelConst.SettingModel) as SettingModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
GameHelper.showGameUI = true;
|
||||
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
|
||||
ui = baseUI as FGUI.G006_menu_animal.com_setting_ani;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
GameHelper.showGameUI = false;
|
||||
InitView();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDisplay(object args)
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void InitView()
|
||||
{
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
ui.switchgift.selectedIndex = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.switchgift.selectedIndex = 0;
|
||||
}
|
||||
|
||||
ui.btn_close.SetClick(OnCloseView);
|
||||
|
||||
// var menuRedeem = (btn_tap)ui.list_tab.GetChild("menu_redeem");
|
||||
// menuRedeem.cont_button.selectedIndex = btn_tap.Button_record;
|
||||
// menuRedeem.visible = GameHelper.IsGiftSwitch();
|
||||
// menuRedeem.SetClick(OnClickRedeem);
|
||||
//
|
||||
// var menuLang = (btn_tap)ui.list_tab.GetChild("menu_lang");
|
||||
//
|
||||
// menuLang.cont_button.selectedIndex = btn_tap.Button_lang;
|
||||
// menuLang.SetClick(OnClickLanguage);
|
||||
//
|
||||
// var menuPrivacy = (btn_tap)ui.list_tab.GetChild("menu_privacy");
|
||||
// menuPrivacy.cont_button.selectedIndex = btn_tap.Button_privacy;
|
||||
// menuPrivacy.SetClick(OnClickPrivacy);
|
||||
//
|
||||
// var menuUser = (btn_tap)ui.list_tab.GetChild("menu_user");
|
||||
// menuUser.cont_button.selectedIndex = btn_tap.Button_user;
|
||||
// menuUser.SetClick(OnClickTerms);
|
||||
//
|
||||
// var menuContact = (btn_tap)ui.list_tab.GetChild("menu_contact");
|
||||
// menuContact.cont_button.selectedIndex = btn_tap.Button_contact;
|
||||
// menuContact.SetClick(OnClickContact);
|
||||
|
||||
|
||||
SetName();
|
||||
|
||||
|
||||
SetUID();
|
||||
|
||||
|
||||
SetAvatar();
|
||||
|
||||
|
||||
SetVersion();
|
||||
|
||||
|
||||
|
||||
|
||||
ui.btn_edit.SetClick(OnClickAvatar);
|
||||
|
||||
ui.text_name.SetClick(OnClickProfile);
|
||||
|
||||
ui.btn_music.SetClick(OnClickSetMusic);
|
||||
|
||||
ui.btn_sound.SetClick(OnClickSoundBtn);
|
||||
|
||||
RefreshMusicUI();
|
||||
|
||||
|
||||
ui.btn_pri.btn_state.selectedIndex =1;
|
||||
ui.btn_terms.btn_state.selectedIndex =2;
|
||||
ui.btn_contact.btn_state.selectedIndex = 3;
|
||||
ui.btn_record.SetClick(() =>
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MenuUI_Close);
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.MakeupRecordUI_Open);
|
||||
});
|
||||
ui.btn_pri.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(SkinInfo.JTermUI_Open); });
|
||||
ui.btn_terms.SetClick(() => { UICtrlDispatcher.Instance.Dispatch(SkinInfo.JTermUI_Open, true); });
|
||||
ui.btn_contact.SetClick(() => { OnClickContact(); });
|
||||
}
|
||||
|
||||
|
||||
public override void OnSwitchLanguage()
|
||||
{
|
||||
base.OnSwitchLanguage();
|
||||
|
||||
SetVersion();
|
||||
|
||||
SetUID();
|
||||
|
||||
SetName();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void SetName()
|
||||
{
|
||||
GameHelper.SetName(ui.text_name);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void SetAvatar()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void SetUID()
|
||||
{
|
||||
ui.text_uid.text = $"UID:{GameHelper.GetLoginModel().uid}";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
private void SetVersion()
|
||||
{
|
||||
ui.text_version.text = $"Version:{UnityEngine.Application.version}";
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void CloseMenu(Action action = null)
|
||||
{
|
||||
CtrlCloseUI();
|
||||
action?.Invoke();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
private void OnCloseView()
|
||||
{
|
||||
CloseMenu();
|
||||
}
|
||||
|
||||
private void OnClickRedeem()
|
||||
{
|
||||
CloseMenu(() => { UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.MakeupRecordUI_Open); });
|
||||
}
|
||||
|
||||
private void OnClickLanguage()
|
||||
{
|
||||
CloseMenu();
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.LanguageWinUI_Open);
|
||||
}
|
||||
|
||||
private void OnClickAvatar()
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ProfileUI_Open);
|
||||
}
|
||||
|
||||
private void OnClickProfile()
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.ProfileUI_Open);
|
||||
}
|
||||
|
||||
private void OnClickPrivacy()
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open);
|
||||
}
|
||||
|
||||
private void OnClickTerms()
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(UICtrlMsg.PrivacyUI_Open, true);
|
||||
}
|
||||
|
||||
private void OnClickContact()
|
||||
{
|
||||
GameHelper.OpenEmail();
|
||||
}
|
||||
|
||||
private void OnClickSetMusic()
|
||||
{
|
||||
model.IsOpenMusic = !model.IsOpenMusic;
|
||||
RefreshMusicUI();
|
||||
}
|
||||
|
||||
private void OnClickSoundBtn()
|
||||
{
|
||||
model.IsOpenEffect = !model.IsOpenEffect;
|
||||
RefreshMusicUI();
|
||||
}
|
||||
|
||||
private void RefreshMusicUI()
|
||||
{
|
||||
ui.btn_music.cont_button.selectedIndex =
|
||||
model.IsOpenMusic ? 1 : 0;
|
||||
ui.btn_sound.cont_button.selectedIndex =
|
||||
model.IsOpenEffect ? 1 : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user