提交项目
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class SmailCtrl : BaseCtrl
|
||||
{
|
||||
public static SmailCtrl Instance { get; private set; }
|
||||
|
||||
private SmailModel model;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
Instance = this;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
Instance = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07cd2e900f724ba285bc98eb133e8e23
|
||||
timeCreated: 1680079505
|
||||
@@ -0,0 +1,27 @@
|
||||
using BingoBrain.Core;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class SmailModel : BaseModel
|
||||
{
|
||||
public decimal show101;
|
||||
|
||||
public decimal show102;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnReset()
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7be290bd6d564172a9a2489d8cedf4e3
|
||||
timeCreated: 1680079505
|
||||
@@ -0,0 +1,145 @@
|
||||
using System;
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class SmailUI : BaseUI
|
||||
{
|
||||
private SmailUICtrl ctrl;
|
||||
private SmailModel model;
|
||||
public FGUI.ACommon.com_currency ui;
|
||||
|
||||
public SmailUI(SmailUICtrl ctrl) : base(ctrl)
|
||||
{
|
||||
uiName = UIConst.SmailUI;
|
||||
this.ctrl = ctrl;
|
||||
}
|
||||
|
||||
protected override void SetUIInfo(UIInfo uiInfo)
|
||||
{
|
||||
uiInfo.packageName = "ACommon";
|
||||
uiInfo.assetName = "com_currency";
|
||||
uiInfo.layerType = UILayerType.Top;
|
||||
uiInfo.isNeedOpenAnim = false;
|
||||
uiInfo.isNeedCloseAnim = false;
|
||||
uiInfo.isNeedUIMask = false;
|
||||
}
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
model = ModuleBoardk.GetModel(ModelConst.SmailModel) as SmailModel;
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
ui?.FadeOut();
|
||||
}
|
||||
|
||||
protected override void OnBind()
|
||||
{
|
||||
ui = baseUI as FGUI.ACommon.com_currency;
|
||||
}
|
||||
|
||||
protected override void OnOpenBefore(object args)
|
||||
{
|
||||
InitData();
|
||||
InitView();
|
||||
}
|
||||
|
||||
protected override void OnOpen(object args)
|
||||
{
|
||||
ui?.FadeIn();
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void InitData()
|
||||
{
|
||||
model.show101 = GameHelper.Get101();
|
||||
model.show102 = GameHelper.Get102();
|
||||
}
|
||||
|
||||
private void InitView()
|
||||
{
|
||||
Set101();
|
||||
Set102();
|
||||
SetName();
|
||||
ui.settings.SetClick(OnClickSetting);
|
||||
ui.com_avatar.loader_flag.visible = false;
|
||||
if (GameHelper.IsGiftSwitch()) ui.btn_cash.gift.selectedIndex = 1;
|
||||
if (GameHelper.IsGiftSwitch())
|
||||
{
|
||||
// ui.visible = false;
|
||||
// ui.x -= 250;
|
||||
}
|
||||
if (Screen.safeArea.y != 0)
|
||||
{
|
||||
ui.top_group.y = -90;
|
||||
}
|
||||
ui.btn_coin.SetClick(() =>
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.MainTab, 1);
|
||||
});
|
||||
ui.btn_cash.SetClick(() =>
|
||||
{
|
||||
GameDispatcher.Instance.Dispatch(BingoInfo.MainTab, 1);
|
||||
});
|
||||
}
|
||||
|
||||
private void OnClickSetting()
|
||||
{
|
||||
UICtrlDispatcher.Instance.Dispatch(SkinInfo.JThinkUI_Open);
|
||||
}
|
||||
|
||||
public void OnUpdate101(object obj = null)
|
||||
{
|
||||
if (obj != null)
|
||||
{
|
||||
var changeValue = (decimal)obj;
|
||||
model.show101 += changeValue;
|
||||
model.show101 = Math.Round(model.show101, 2);
|
||||
Set101(model.show101.ToString("N"));
|
||||
}
|
||||
}
|
||||
|
||||
public void Set101(string c101 = null)
|
||||
{
|
||||
if (c101 == null)
|
||||
{
|
||||
c101 = GameHelper.Get101().ToString("N0");
|
||||
}
|
||||
|
||||
ui.btn_coin.title = $"{c101}";
|
||||
}
|
||||
|
||||
public void OnUpdate102(object obj = null)
|
||||
{
|
||||
if (obj != null)
|
||||
{
|
||||
var changeValue = (decimal)obj;
|
||||
model.show102 += changeValue;
|
||||
model.show102 = Math.Round(model.show102, 2);
|
||||
Set102(model.show102.ToString("N"));
|
||||
}
|
||||
}
|
||||
|
||||
public void Set102(string c102 = null)
|
||||
{
|
||||
if (c102 == null)
|
||||
{
|
||||
c102 = GameHelper.Get102().ToString("N");
|
||||
}
|
||||
|
||||
ui.btn_cash.title = $"{c102}";
|
||||
}
|
||||
|
||||
private void SetName()
|
||||
{
|
||||
GameHelper.SetName(ui.com_avatar.text_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4dcbed9a83954d0ba8aaee322bf0f467
|
||||
timeCreated: 1680079505
|
||||
@@ -0,0 +1,110 @@
|
||||
using BingoBrain.Core;
|
||||
using BingoBrain.HotFix;
|
||||
|
||||
namespace BingoBrain
|
||||
{
|
||||
public class SmailUICtrl : BaseUICtrl
|
||||
{
|
||||
private SmailUI ui;
|
||||
private SmailModel model;
|
||||
|
||||
private uint openUIMsg = SkinInfo.SmailUI_Open;
|
||||
private uint closeUIMsg = SkinInfo.SmailUI_Close;
|
||||
|
||||
#region 生命周期
|
||||
|
||||
protected override void OnInit()
|
||||
{
|
||||
model = ModuleBoardk.GetModel(ModelConst.SmailModel) as SmailModel;
|
||||
}
|
||||
|
||||
protected override void OnDispose()
|
||||
{
|
||||
}
|
||||
|
||||
public override void OpenUI(object args = null)
|
||||
{
|
||||
if (ui == null)
|
||||
{
|
||||
ui = new SmailUI(this);
|
||||
ui.Open(args);
|
||||
}
|
||||
}
|
||||
|
||||
public override void CloseUI(object args = null)
|
||||
{
|
||||
if (ui != null && !ui.isClose)
|
||||
{
|
||||
ui.Close();
|
||||
}
|
||||
|
||||
ui = null;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region 消息
|
||||
|
||||
public override uint GetOpenUIMsg(string uiName)
|
||||
{
|
||||
return openUIMsg;
|
||||
}
|
||||
|
||||
public override uint GetCloseUIMsg(string uiName)
|
||||
{
|
||||
return closeUIMsg;
|
||||
}
|
||||
|
||||
protected override void AddListener()
|
||||
{
|
||||
uiCtrlDispatcher.AddListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.AddListener(closeUIMsg, CloseUI);
|
||||
GameDispatcher.Instance.AddListener(BingoInfo.Update101, OnUpdate101);
|
||||
GameDispatcher.Instance.AddListener(BingoInfo.Update101Completed, OnUpdate101Completed);
|
||||
GameDispatcher.Instance.AddListener(BingoInfo.Update102, OnUpdate102);
|
||||
GameDispatcher.Instance.AddListener(BingoInfo.Update102Completed, OnUpdate102Completed);
|
||||
}
|
||||
|
||||
protected override void RemoveListener()
|
||||
{
|
||||
uiCtrlDispatcher.RemoveListener(openUIMsg, OpenUI);
|
||||
uiCtrlDispatcher.RemoveListener(closeUIMsg, CloseUI);
|
||||
GameDispatcher.Instance.RemoveListener(BingoInfo.Update101, OnUpdate101);
|
||||
GameDispatcher.Instance.RemoveListener(BingoInfo.Update101Completed, OnUpdate101Completed);
|
||||
GameDispatcher.Instance.AddListener(BingoInfo.Update102, OnUpdate102);
|
||||
GameDispatcher.Instance.AddListener(BingoInfo.Update102Completed, OnUpdate102Completed);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void OnUpdate101(object args)
|
||||
{
|
||||
ui?.OnUpdate101(args);
|
||||
}
|
||||
|
||||
private void OnUpdate101Completed(object obj = null)
|
||||
{
|
||||
if (!PreferencesMgr.Instance.IsShowRewardFly101)
|
||||
{
|
||||
var value = PreferencesMgr.Instance.Currency101;
|
||||
model.show101 = value;
|
||||
ui?.Set101();
|
||||
}
|
||||
}
|
||||
|
||||
private void OnUpdate102(object args)
|
||||
{
|
||||
ui?.OnUpdate102(args);
|
||||
}
|
||||
|
||||
private void OnUpdate102Completed(object obj = null)
|
||||
{
|
||||
if (!PreferencesMgr.Instance.IsShowRewardFly102)
|
||||
{
|
||||
var value = PreferencesMgr.Instance.Currency102;
|
||||
model.show102 = value;
|
||||
ui?.Set102();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 29d0707f16ce412d8e9dd45c6f6cc7ca
|
||||
timeCreated: 1680079505
|
||||
Reference in New Issue
Block a user