Merge branch 'master' into leonard
| | |
| | | if (!AssetVersionUtility.hasDownLoadFullAsset)
|
| | | {
|
| | | InGameDownLoad.Instance.inGameDownLoadAllow = true;
|
| | | InGameDownLoad.Instance.TryDownLoad(false);
|
| | | InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.None);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | //-------------------------------------------------------- |
| | | // [Author]: 第二世界 |
| | | // [ Date ]: Wednesday, July 25, 2018 |
| | | //-------------------------------------------------------- |
| | | |
| | | using UnityEngine; |
| | | using System; |
| | | |
| | | namespace TableConfig { |
| | | |
| | | |
| | | //--------------------------------------------------------
|
| | | // [Author]: 第二世界
|
| | | // [ Date ]: Tuesday, August 14, 2018
|
| | | //--------------------------------------------------------
|
| | |
|
| | | using UnityEngine;
|
| | | using System;
|
| | |
|
| | | namespace TableConfig {
|
| | |
|
| | | |
| | | public partial class OrderInfoConfig : ConfigBase {
|
| | |
|
| | | public int id { get ; private set ; }
|
| | | public string OrderInfo { get ; private set; }
|
| | | public string AppId { get ; private set; }
|
| | | public float PayRMBNum { get ; private set; }
|
| | | public int CTGID { get ; private set ; }
|
| | | |
| | |
|
| | | public override string getKey()
|
| | | {
|
| | | return OrderInfo.ToString();
|
| | | } |
| | | |
| | | public override void Parse() { |
| | | return id.ToString();
|
| | | }
|
| | |
|
| | | public override void Parse() {
|
| | | try
|
| | | {
|
| | | OrderInfo = rawContents[0].Trim();
|
| | | id=IsNumeric(rawContents[0]) ? int.Parse(rawContents[0]):0; |
| | |
|
| | | AppId = rawContents[1].Trim();
|
| | | OrderInfo = rawContents[1].Trim();
|
| | |
|
| | | PayRMBNum=IsNumeric(rawContents[2]) ? float.Parse(rawContents[2]):0; |
| | | AppId = rawContents[2].Trim();
|
| | |
|
| | | CTGID=IsNumeric(rawContents[3]) ? int.Parse(rawContents[3]):0; |
| | | PayRMBNum=IsNumeric(rawContents[3]) ? float.Parse(rawContents[3]):0; |
| | | |
| | | CTGID=IsNumeric(rawContents[4]) ? int.Parse(rawContents[4]):0; |
| | | }
|
| | | catch (Exception ex)
|
| | | {
|
| | | DebugEx.Log(ex);
|
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | }
|
| | | }
|
| | | |
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
| | | fileFormatVersion: 2 |
| | | guid: bee6d9037f4c5c648a1108ce8fd8a626 |
| | | timeCreated: 1532505359 |
| | | timeCreated: 1534236780 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | |
| | | #region 极光推送相关
|
| | | public void GeTui_SendLocalMessage(JsonData jsonData)
|
| | | {
|
| | | DebugEx.Log("GeTui_SendLocalMessage:" + jsonData["id"]);
|
| | | // ------ 举例 ------
|
| | | // JsonData _params = new JsonData ();
|
| | | // _params ["code"] = 2005;
|
| | |
| | |
|
| | | public void GeTui_RemoveLocalMessage(string id)
|
| | | {
|
| | | DebugEx.Log("GeTui_RemoveLocalMessage:" + id);
|
| | | #if !UNITY_EDITOR
|
| | | m_Json.Clear();
|
| | | m_Json["code"] = CodeU2A.JPushRemoveLocalMessage;
|
| | |
| | |
|
| | | if (!assetVersion.IsPriorAsset())
|
| | | {
|
| | | InGameDownLoad.Instance.TryDownLoad(true);
|
| | | InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.Whole);
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
| | |
|
| | | if (!AssetVersionUtility.hasDownLoadFullAsset)
|
| | | {
|
| | | InGameDownLoad.Instance.TryDownLoad(false);
|
| | | InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.None);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | if (!AssetVersionUtility.hasDownLoadFullAsset)
|
| | | {
|
| | | InGameDownLoad.Instance.TryDownLoad(false);
|
| | | InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.None);
|
| | | }
|
| | |
|
| | | //屏蔽职业特效预先加载逻,以减少不必要的内存损耗和获得更快的场景切换速度,资源压缩使用LZ4才行。
|
| | |
| | |
|
| | | public bool inGameDownLoadAllow = false;
|
| | |
|
| | | bool m_DominantDownLoadStarted = false;
|
| | | public bool dominantDownLoadStarted {
|
| | | get { return m_DominantDownLoadStarted; }
|
| | | private set {
|
| | | if (m_DominantDownLoadStarted != value)
|
| | | {
|
| | | m_DominantDownLoadStarted = value;
|
| | | if (dominantDownLoadEvent != null)
|
| | | {
|
| | | dominantDownLoadEvent();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | |
| | | public float progress {
|
| | | get {
|
| | |
| | | int downLoadedCountRecord = 0;//已经下载完成的资源包数量 |
| | | |
| | | public event Action<State> downLoadStateChangeEvent;
|
| | | public event Action dominantDownLoadEvent;
|
| | | public event Action<Dominant> dominantDownLoadEvent;
|
| | |
|
| | | Action onDownLoadOk;
|
| | |
|
| | | Dominant m_DominantState = Dominant.None;
|
| | | public Dominant dominantState {
|
| | | get { return m_DominantState; }
|
| | | private set {
|
| | | if (m_DominantState != value)
|
| | | {
|
| | | m_DominantState = value;
|
| | | if (dominantDownLoadEvent != null)
|
| | | {
|
| | | dominantDownLoadEvent(m_DominantState);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | State m_State = State.None;
|
| | | public State state {
|
| | |
| | | GameNetSystem.Instance.SendInfo(send);
|
| | | } |
| | | |
| | | public void TryDownLoad(bool _force)
|
| | | public void TryDownLoad(Dominant _dominant)
|
| | | {
|
| | | if (!inGameDownLoadAllow)
|
| | | {
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (_force)
|
| | | if (_dominant < dominantState)
|
| | | {
|
| | | if (!dominantDownLoadStarted)
|
| | | {
|
| | | backGroundDownLoadSizeRecord = RemoteFile.TotalDownloadedSize;
|
| | | downLoadedCountRecord = okCount;
|
| | |
|
| | | dominantDownLoadStarted = true;
|
| | | Pause();
|
| | | state = State.Prepared;
|
| | | }
|
| | |
|
| | | WindowCenter.Instance.Open<InGameDownLoadWin>();
|
| | | return;
|
| | | }
|
| | | else
|
| | |
|
| | | switch (_dominant)
|
| | | {
|
| | | if (InGameDownTestUtility.enable)
|
| | | {
|
| | | if (InGameDownTestUtility.isWifi)
|
| | | case Dominant.None:
|
| | | if (InGameDownTestUtility.enable)
|
| | | {
|
| | | StartDownLoad();
|
| | | if (InGameDownTestUtility.isWifi)
|
| | | {
|
| | | StartDownLoad();
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork)
|
| | | else
|
| | | {
|
| | | StartDownLoad();
|
| | | if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork)
|
| | | {
|
| | | StartDownLoad();
|
| | | }
|
| | | }
|
| | | }
|
| | | break;
|
| | | case Dominant.Half:
|
| | | if (dominantState == Dominant.None)
|
| | | {
|
| | | backGroundDownLoadSizeRecord = RemoteFile.TotalDownloadedSize;
|
| | | downLoadedCountRecord = okCount;
|
| | | state = State.Prepared;
|
| | | }
|
| | | StartDownLoad();
|
| | | dominantState = Dominant.Half;
|
| | | break;
|
| | | case Dominant.Whole:
|
| | | if (dominantState == Dominant.None)
|
| | | {
|
| | | backGroundDownLoadSizeRecord = RemoteFile.TotalDownloadedSize;
|
| | | downLoadedCountRecord = okCount;
|
| | | Pause();
|
| | | state = State.Prepared;
|
| | | }
|
| | | else if (dominantState == Dominant.Half)
|
| | | {
|
| | | Pause();
|
| | | state = State.Prepared;
|
| | | }
|
| | |
|
| | | dominantState = Dominant.Whole;
|
| | | WindowCenter.Instance.Open<InGameDownLoadWin>();
|
| | | break;
|
| | | }
|
| | |
|
| | | } |
| | |
| | |
|
| | | if (!hasReward)
|
| | | {
|
| | | if (!dominantDownLoadStarted)
|
| | | if (dominantState == Dominant.None)
|
| | | {
|
| | | RequestDownLoadReward(false);
|
| | | state = State.Completed;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | Clock netSwitchClock;
|
| | | NetworkReachability m_NetworkReachability = NetworkReachability.NotReachable; |
| | | NetworkReachability networkReachability {
|
| | | get { return m_NetworkReachability; }
|
| | |
| | | {
|
| | | m_NetworkReachability = value;
|
| | |
|
| | | if (!dominantDownLoadStarted)
|
| | | if (dominantState != Dominant.Whole)
|
| | | {
|
| | | switch (m_NetworkReachability)
|
| | | {
|
| | | case NetworkReachability.ReachableViaCarrierDataNetwork:
|
| | | Pause();
|
| | | var endTime = DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond * 10);
|
| | | Clock.Create(endTime, () =>
|
| | | var endTime = DateTime.Now + new TimeSpan(TimeSpan.TicksPerSecond * 3);
|
| | | if (netSwitchClock != null)
|
| | | {
|
| | | if (CheckDominantDownLoad())
|
| | | {
|
| | | TryDownLoad(true);
|
| | | }
|
| | | });
|
| | | netSwitchClock.Stop();
|
| | | }
|
| | | netSwitchClock = Clock.Create(endTime, () =>
|
| | | {
|
| | | if (CheckDominantDownLoad())
|
| | | {
|
| | | TryDownLoad(Dominant.Whole);
|
| | | }
|
| | | });
|
| | | break;
|
| | | case NetworkReachability.ReachableViaLocalAreaNetwork:
|
| | | TryDownLoad(false);
|
| | | TryDownLoad(Dominant.None);
|
| | | break;
|
| | | default:
|
| | | break;
|
| | |
| | | {
|
| | | m_SimulateWifi = value;
|
| | |
|
| | | if (!dominantDownLoadStarted)
|
| | | if (dominantState != Dominant.Whole)
|
| | | {
|
| | | if (m_SimulateWifi)
|
| | | {
|
| | | TryDownLoad(false);
|
| | | TryDownLoad(Dominant.None);
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | if (CheckDominantDownLoad())
|
| | | {
|
| | | TryDownLoad(true);
|
| | | TryDownLoad(Dominant.Whole);
|
| | | }
|
| | | });
|
| | | }
|
| | |
| | |
|
| | | public bool CheckDominantDownLoad()
|
| | | {
|
| | | if (tasks == null || tasks.Count == 0 || isDone || dominantDownLoadStarted || NewBieCenter.Instance.inGuiding)
|
| | | if (tasks == null || tasks.Count == 0 || isDone || dominantState == Dominant.Whole || NewBieCenter.Instance.inGuiding)
|
| | | {
|
| | | return false;
|
| | | }
|
| | |
| | | {
|
| | | if (CheckDominantDownLoad())
|
| | | {
|
| | | TryDownLoad(true);
|
| | | TryDownLoad(Dominant.Whole);
|
| | | }
|
| | | }
|
| | | break;
|
| | |
| | | {
|
| | | if (CheckDominantDownLoad())
|
| | | {
|
| | | TryDownLoad(true);
|
| | | TryDownLoad(Dominant.Whole);
|
| | | }
|
| | | }
|
| | | } |
| | |
| | | Pause,
|
| | | Award,
|
| | | Completed,
|
| | | }
|
| | |
|
| | | public enum Dominant
|
| | | {
|
| | | None = 0,
|
| | | Half = 1,
|
| | | Whole = 2,
|
| | | } |
| | | |
| | | } |
| | |
| | |
|
| | | private void Awake()
|
| | | {
|
| | | if (InGameDownLoad.Instance.dominantDownLoadStarted
|
| | | if (InGameDownLoad.Instance.dominantState != InGameDownLoad.Dominant.None
|
| | | && InGameDownLoad.Instance.state != InGameDownLoad.State.Completed)
|
| | | {
|
| | | this.gameObject.SetActive(true);
|
| | |
| | | }
|
| | |
|
| | | InGameDownLoad.Instance.downLoadStateChangeEvent += OnDownLoadStateChange;
|
| | | InGameDownLoad.Instance.dominantDownLoadEvent += OnDominantDownLoadStarted;
|
| | | InGameDownLoad.Instance.dominantDownLoadEvent += OnDownLoadDominantStateChange;
|
| | | m_ViewDownLoad.AddListener(OpenInGameDownloadWin);
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | m_ViewDownLoad.RemoveAllListeners();
|
| | | InGameDownLoad.Instance.downLoadStateChangeEvent -= OnDownLoadStateChange;
|
| | | InGameDownLoad.Instance.dominantDownLoadEvent -= OnDominantDownLoadStarted;
|
| | | InGameDownLoad.Instance.dominantDownLoadEvent -= OnDownLoadDominantStateChange;
|
| | | }
|
| | |
|
| | | private void OnDominantDownLoadStarted()
|
| | | private void OnDownLoadDominantStateChange(InGameDownLoad.Dominant _dominant)
|
| | | {
|
| | | UpdateDownLoadProgress();
|
| | | this.gameObject.SetActive(InGameDownLoad.Instance.dominantDownLoadStarted);
|
| | | this.gameObject.SetActive(InGameDownLoad.Instance.dominantState != InGameDownLoad.Dominant.None);
|
| | | }
|
| | |
|
| | | private void OnDownLoadStateChange(InGameDownLoad.State _step)
|
| | |
| | | case InGameDownLoad.State.None:
|
| | | case InGameDownLoad.State.Prepared:
|
| | | case InGameDownLoad.State.DownLoad:
|
| | | if (InGameDownLoad.Instance.dominantDownLoadStarted)
|
| | | if (InGameDownLoad.Instance.dominantState != InGameDownLoad.Dominant.None)
|
| | | {
|
| | | UpdateDownLoadProgress();
|
| | | this.gameObject.SetActive(true);
|
| | |
| | | case InGameDownLoad.State.None:
|
| | | case InGameDownLoad.State.Pause:
|
| | | case InGameDownLoad.State.Prepared:
|
| | | InGameDownLoad.Instance.TryDownLoad(true);
|
| | | WindowCenter.Instance.Open<InGameDownLoadWin>();
|
| | | break;
|
| | | case InGameDownLoad.State.Award:
|
| | | WindowCenter.Instance.Open<InGameDownLoadWin>();
|
| | |
| | | [SerializeField] Text nameText;
|
| | | [SerializeField] Image moneyIcon;
|
| | | [SerializeField] Text moneyCntText;
|
| | | [SerializeField] Button buyBtn;
|
| | | [SerializeField] Button shopCellBtn;
|
| | | [SerializeField] Image sellOutImg;
|
| | |
|
| | |
| | | int addBuyCnt = 0;
|
| | | bool isLimitBuy = BuyItemPopModel.Instance.CheckIsLimitBuyCnt(storeConfig, out canBuyCnt, out addBuyCnt);
|
| | | sellOutImg.gameObject.SetActive(false);
|
| | | buyBtn.gameObject.SetActive(true);
|
| | | if (canBuyCnt > 0)
|
| | | {
|
| | | itemCell.countText.gameObject.SetActive(true);
|
| | |
| | | {
|
| | | itemCell.countText.text = StringUtility.Contact(UIHelper.GetTextColorByItemColor(TextColType.Red, remainNum.ToString()),
|
| | | "/" + canBuyCnt.ToString());
|
| | | buyBtn.gameObject.SetActive(false);
|
| | | sellOutImg.gameObject.SetActive(true);
|
| | | }
|
| | | }
|
| | |
| | | , "", null, ItemTipChildType.Buy);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | | });
|
| | | buyBtn.RemoveAllListeners();
|
| | | buyBtn.AddListener(() => { ClickBuyBtn(storeConfig); });
|
| | | }
|
| | |
|
| | | private void ClickBuyBtn(StoreConfig storeConfig)
|
| | |
| | | using System; |
| | | using TableConfig; |
| | | |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class BossRebornModel : Model
|
| | | {
|
| | | int m_BossRebornIntegral = 0;
|
| | | public int bossRebornIntegral {
|
| | | get { return m_BossRebornIntegral; }
|
| | | set {
|
| | | if (m_BossRebornIntegral != value)
|
| | | {
|
| | | m_BossRebornIntegral = value;
|
| | | if (bossRebornIntergralEvent != null)
|
| | | {
|
| | | bossRebornIntergralEvent();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | int m_BossRebornInderalTotal = 0;
|
| | | public int bossRebornIndegralTotal {
|
| | | get { return m_BossRebornInderalTotal; }
|
| | | set { m_BossRebornInderalTotal = value; }
|
| | | }
|
| | |
|
| | | public int surplusSecond { get { return OperationTimeHepler.Instance.GetOperationSurplusTime(Operation.BossReborn); } }
|
| | |
|
| | | public event Action bossRebornIntergralEvent;
|
| | | public event Action<int> bossTaskStateChangeEvent;
|
| | | Dictionary<int, BossRebornTask> bossRebornTasks = new Dictionary<int, BossRebornTask>();
|
| | |
|
| | | const int bossRebornPointId = 20909;
|
| | | public Redpoint bossRebornPoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, bossRebornPointId);
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | ParseConfig();
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | | {
|
| | | }
|
| | |
|
| | | public bool IsOpen()
|
| | | {
|
| | | return OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.BossReborn);
|
| | | }
|
| | |
|
| | | public void UpdateTaskBaseInfos(HAB04_tagMCBossRebornInfo.tagMCBossRebornTaskInfo[] _tasks)
|
| | | {
|
| | | foreach (var task in _tasks)
|
| | | {
|
| | | if (bossRebornTasks.ContainsKey(task.TaskID))
|
| | | {
|
| | | bossRebornTasks[task.TaskID].UpdateActivityBaseData(task);
|
| | | }
|
| | | else
|
| | | {
|
| | | bossRebornTasks[task.TaskID] = new BossRebornTask(task);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public List<BossRebornTask> GetTasks()
|
| | | {
|
| | | return new List<BossRebornTask>(bossRebornTasks.Values);
|
| | | }
|
| | |
|
| | | public BossRebornTask GetTaskData(int _id)
|
| | | {
|
| | | if (!bossRebornTasks.ContainsKey(_id))
|
| | | {
|
| | | bossRebornTasks[_id] = new BossRebornTask(_id);
|
| | | }
|
| | |
|
| | | return bossRebornTasks[_id];
|
| | | }
|
| | |
|
| | | public void RequestTaskReward(int _id)
|
| | | {
|
| | | var sendInfo = new CA504_tagCMPlayerGetReward();
|
| | | sendInfo.RewardType = (int)GotServerRewardType.Def_RewardType_BossReborn;
|
| | | sendInfo.DataEx = (uint)_id;
|
| | | sendInfo.DataExStrLen = 0;
|
| | | sendInfo.DataExStr = string.Empty;
|
| | | GameNetSystem.Instance.SendInfo(sendInfo);
|
| | | }
|
| | |
|
| | | public void UpdateTaskData(HAB03_tagMCBossRebornPlayerInfo _serverInfo)
|
| | | {
|
| | | foreach (var info in _serverInfo.DataList)
|
| | | {
|
| | | var id = info.ActID;
|
| | | var data = GetTaskData(id);
|
| | | var oldState = data.GetState();
|
| | | data.UpdateActivityData(info.CurTimes, info.GotTimes);
|
| | | var newState = data.GetState();
|
| | |
|
| | | if (oldState != newState && bossTaskStateChangeEvent != null)
|
| | | {
|
| | | bossTaskStateChangeEvent(id);
|
| | | }
|
| | | }
|
| | |
|
| | | UpdateRedpoint();
|
| | | }
|
| | |
|
| | | private void UpdateRedpoint()
|
| | | {
|
| | | if (!IsOpen())
|
| | | {
|
| | | bossRebornPoint.state = RedPointState.None;
|
| | | }
|
| | | else
|
| | | {
|
| | | var rewardable = false;
|
| | | foreach (var task in bossRebornTasks.Values)
|
| | | {
|
| | | if (task.GetState() == BossRebornTask.State.Rewardable)
|
| | | {
|
| | | rewardable = true;
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | bossRebornPoint.state = rewardable ? RedPointState.Simple : RedPointState.None;
|
| | | }
|
| | | }
|
| | |
|
| | | private void ParseConfig()
|
| | | {
|
| | | var keys = ConfigManager.Instance.GetAllKeys<BossRebornConfig>();
|
| | | foreach (var key in keys)
|
| | | {
|
| | | var id = int.Parse(key);
|
| | | bossRebornTasks[id] = new BossRebornTask(id);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | | namespace Snxxz.UI |
| | | { |
| | | public class BossRebornModel : Model, IOpenServerActivity |
| | | { |
| | | int m_BossRebornIntegral = 0; |
| | | public int bossRebornIntegral { |
| | | get { return m_BossRebornIntegral; } |
| | | set { |
| | | if (m_BossRebornIntegral != value) |
| | | { |
| | | m_BossRebornIntegral = value; |
| | | if (bossRebornIntergralEvent != null) |
| | | { |
| | | bossRebornIntergralEvent(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | int m_BossRebornInderalTotal = 0; |
| | | public int bossRebornIndegralTotal { |
| | | get { return m_BossRebornInderalTotal; } |
| | | set { m_BossRebornInderalTotal = value; } |
| | | } |
| | | |
| | | public int surplusSecond { get { return OperationTimeHepler.Instance.GetOperationSurplusTime(Operation.BossReborn); } } |
| | | |
| | | public bool priorityOpen |
| | | { |
| | | get |
| | | { |
| | | return bossRebornPoint.state == RedPointState.Simple; |
| | | } |
| | | } |
| | | |
| | | public event Action bossRebornIntergralEvent; |
| | | public event Action<int> bossTaskStateChangeEvent; |
| | | public event Action<int> onStateUpate; |
| | | |
| | | Dictionary<int, BossRebornTask> bossRebornTasks = new Dictionary<int, BossRebornTask>(); |
| | | |
| | | const int bossRebornPointId = 20909; |
| | | public Redpoint bossRebornPoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, bossRebornPointId); |
| | | |
| | | public override void Init() |
| | | { |
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent; |
| | | OpenServerActivityCenter.Instance.Register(9, this); |
| | | } |
| | | |
| | | public override void UnInit() |
| | | { |
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent; |
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent; |
| | | } |
| | | |
| | | private void OperationEndEvent(Operation type, int state) |
| | | { |
| | | if (type == Operation.BossReborn&&state==0) |
| | | { |
| | | if (onStateUpate != null) |
| | | { |
| | | onStateUpate(9); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private void OperationStartEvent(Operation type, int state) |
| | | { |
| | | if (type == Operation.BossReborn && state == 0) |
| | | { |
| | | if (onStateUpate != null) |
| | | { |
| | | onStateUpate(9); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public bool IsOpen |
| | | { |
| | | get |
| | | { |
| | | return OperationTimeHepler.Instance.SatisfyOpenCondition(Operation.BossReborn); |
| | | } |
| | | } |
| | | |
| | | public void UpdateTaskBaseInfos(HAB04_tagMCBossRebornInfo.tagMCBossRebornTaskInfo[] _tasks) |
| | | { |
| | | foreach (var task in _tasks) |
| | | { |
| | | if (bossRebornTasks.ContainsKey(task.TaskID)) |
| | | { |
| | | bossRebornTasks[task.TaskID].UpdateActivityBaseData(task); |
| | | } |
| | | else |
| | | { |
| | | bossRebornTasks[task.TaskID] = new BossRebornTask(task); |
| | | } |
| | | } |
| | | } |
| | | |
| | | public List<BossRebornTask> GetTasks() |
| | | { |
| | | return new List<BossRebornTask>(bossRebornTasks.Values); |
| | | } |
| | | |
| | | public BossRebornTask GetTaskData(int _id) |
| | | { |
| | | if (!bossRebornTasks.ContainsKey(_id)) |
| | | { |
| | | bossRebornTasks[_id] = new BossRebornTask(_id); |
| | | } |
| | | |
| | | return bossRebornTasks[_id]; |
| | | } |
| | | |
| | | public void RequestTaskReward(int _id) |
| | | { |
| | | var sendInfo = new CA504_tagCMPlayerGetReward(); |
| | | sendInfo.RewardType = (int)GotServerRewardType.Def_RewardType_BossReborn; |
| | | sendInfo.DataEx = (uint)_id; |
| | | sendInfo.DataExStrLen = 0; |
| | | sendInfo.DataExStr = string.Empty; |
| | | GameNetSystem.Instance.SendInfo(sendInfo); |
| | | } |
| | | |
| | | public void UpdateTaskData(HAB03_tagMCBossRebornPlayerInfo _serverInfo) |
| | | { |
| | | foreach (var info in _serverInfo.DataList) |
| | | { |
| | | var id = info.ActID; |
| | | var data = GetTaskData(id); |
| | | var oldState = data.GetState(); |
| | | data.UpdateActivityData(info.CurTimes, info.GotTimes); |
| | | var newState = data.GetState(); |
| | | |
| | | if (oldState != newState && bossTaskStateChangeEvent != null) |
| | | { |
| | | bossTaskStateChangeEvent(id); |
| | | } |
| | | } |
| | | |
| | | UpdateRedpoint(); |
| | | } |
| | | |
| | | private void UpdateRedpoint() |
| | | { |
| | | if (!IsOpen) |
| | | { |
| | | bossRebornPoint.state = RedPointState.None; |
| | | } |
| | | else |
| | | { |
| | | var rewardable = false; |
| | | foreach (var task in bossRebornTasks.Values) |
| | | { |
| | | if (task.GetState() == BossRebornTask.State.Rewardable) |
| | | { |
| | | rewardable = true; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | bossRebornPoint.state = rewardable ? RedPointState.Simple : RedPointState.None; |
| | | } |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | |
| | | [SerializeField] RectTransform m_ContainerPractice;
|
| | | [SerializeField] Button m_GotoRealm;
|
| | | [SerializeField] Slider m_PracticePointSlider;
|
| | | [SerializeField] RectTransform m_RealmContainer; |
| | | [SerializeField] RectTransform m_RealmContainer;
|
| | | [SerializeField] Text m_RealmStateDescription;
|
| | | [SerializeField] Image m_Realm;
|
| | | [SerializeField] Image m_RealmState;
|
| | | [SerializeField] Text m_PracticePoint;
|
| | | [SerializeField] Text m_PractivePointNeed;
|
| | | [SerializeField] Text m_GotoRealmLevelUpHint;
|
| | |
| | |
|
| | | private void UpdatePraceticePoint(bool _rightNow)
|
| | | {
|
| | | var isMaxRealm = realmModel.realmMaxLevel == PlayerDatas.Instance.baseData.realmLevel;
|
| | | var realmConfig = ConfigManager.Instance.GetTemplate<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
|
| | | var pointNeed = realmConfig.NeedPoint;
|
| | | var pointOwn = PlayerDatas.Instance.extersion.realmPoint;
|
| | |
|
| | | m_RealmContainer.gameObject.SetActive(realmConfig != null && realmConfig.Lv > 0);
|
| | | if (realmConfig != null && realmConfig.Lv > 0)
|
| | | if (isMaxRealm)
|
| | | {
|
| | | m_Realm.SetSprite(realmConfig.Img);
|
| | | m_GotoRealmLevelUpHint.gameObject.SetActive(false);
|
| | | realmConfig = ConfigManager.Instance.GetTemplate<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel);
|
| | | m_RealmStateDescription.text = Language.Get("DailyquestHighestRealm");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_GotoRealmLevelUpHint.gameObject.SetActive(true);
|
| | | if (pointOwn >= pointNeed)
|
| | | {
|
| | | m_GotoRealmLevelUpHint.text = Language.Get("DailyquestRealm2");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_GotoRealmLevelUpHint.text = Language.Get("RealmCollecting", pointNeed - pointOwn);
|
| | | }
|
| | | m_RealmStateDescription.text = Language.Get("DailyquestNextRealm");
|
| | | }
|
| | |
|
| | | var nextRealmConfig = ConfigManager.Instance.GetTemplate<RealmConfig>(PlayerDatas.Instance.baseData.realmLevel + (isMaxRealm ? 0 : 1));
|
| | | m_RealmContainer.gameObject.SetActive(nextRealmConfig != null && nextRealmConfig.Lv > 0);
|
| | | if (nextRealmConfig != null && nextRealmConfig.Lv > 0)
|
| | | {
|
| | | m_Realm.SetSprite(nextRealmConfig.Img);
|
| | | }
|
| | |
|
| | | m_PractivePointNeed.text = StringUtility.Contact("/", pointNeed);
|
| | |
| | | StartCoroutine(Co_PointIncreasePerformance(new PointPerformance() { startPoint = piontBuf, endPoint = pointOwn }));
|
| | | piontBuf = pointOwn;
|
| | | }
|
| | |
|
| | | if (pointOwn >= pointNeed)
|
| | | {
|
| | | m_GotoRealmLevelUpHint.text = Language.Get("DailyquestRealm2");
|
| | | m_RealmState.SetSprite("JJ_TB_1");
|
| | | }
|
| | | else
|
| | | {
|
| | | m_GotoRealmLevelUpHint.text = Language.Get("RealmCollecting", pointNeed - pointOwn);
|
| | | m_RealmState.SetSprite("JJ_TB_2");
|
| | | }
|
| | |
|
| | | //switch (PlayerDatas.Instance.realm.prensentRealmState)
|
| | | //{
|
| | | // case PlayerRealmData.RealmState.Collecting:
|
| | | // if (pointOwn >= pointNeed)
|
| | | // {
|
| | | // m_GotoRealmLevelUpHint.text = Language.Get("DailyquestRealm2");
|
| | | // }
|
| | | // else
|
| | | // {
|
| | | // m_GotoRealmLevelUpHint.text = Language.Get("RealmCollecting", pointNeed - pointOwn);
|
| | | // }
|
| | | // m_RealmState.SetSprite("JJ_TB_1");
|
| | | // break;
|
| | | // //case PlayerRealmData.RealmState.Dungeon:
|
| | | // // m_GotoRealmLevelUpHint.text = Language.Get("DailyquestRealm3");
|
| | | // // m_RealmState.SetSprite("JJ_TB_2");
|
| | | // // break;
|
| | | // //case PlayerRealmData.RealmState.LevelUp:
|
| | | // // m_GotoRealmLevelUpHint.text = Language.Get("DailyquestRealm4");
|
| | | // // m_RealmState.SetSprite("JJ_TB_3");
|
| | | // // break;
|
| | | //}
|
| | |
|
| | | }
|
| | |
|
| | |
| | | set { m_DungeonResult = value; }
|
| | | }
|
| | |
|
| | | public int dungeonCoinInspireCount
|
| | | {
|
| | | public int dungeonCoinInspireCount {
|
| | | get; private set;
|
| | | }
|
| | |
|
| | | public int dungeonJadeInspireCount
|
| | | {
|
| | | public int dungeonJadeInspireCount {
|
| | | get; private set;
|
| | | }
|
| | |
|
| | |
| | | updateDungeonEnterCD();
|
| | | }
|
| | |
|
| | | public void UpdateDugeonInspireLv(int coinInspireLv,int jadeInpsireLv)
|
| | | public void UpdateDugeonInspireLv(int coinInspireLv, int jadeInpsireLv)
|
| | | {
|
| | | dungeonCoinInspireCount = coinInspireLv;
|
| | | dungeonJadeInspireCount = jadeInpsireLv;
|
| | |
| | |
|
| | | if (!assetVersion.IsPriorAsset())
|
| | | {
|
| | | InGameDownLoad.Instance.TryDownLoad(true);
|
| | | InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.Whole);
|
| | | return;
|
| | | }
|
| | | }
|
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | | using System;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class TrialExchangeBehaviour : MonoBehaviour
|
| | | {
|
| | | [SerializeField] ItemCell m_Item;
|
| | | [SerializeField] Text m_Description;
|
| | | [SerializeField] ItemBehaviour m_Token;
|
| | | [SerializeField] Button m_Exchange;
|
| | | [SerializeField] Image m_Redpoint;
|
| | | TrialDungeonModel model { get { return ModelCenter.Instance.GetModel<TrialDungeonModel>(); } }
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | |
|
| | | int trialExchangeId = 0;
|
| | | private void Awake()
|
| | | {
|
| | | m_Exchange.AddListener(Exchange);
|
| | | }
|
| | |
|
| | | private void Exchange()
|
| | | {
|
| | | if (trialExchangeId != 0)
|
| | | {
|
| | | int error = 0;
|
| | | if (!model.TrialSendExchange(trialExchangeId, out error))
|
| | | {
|
| | | if (error == 1)
|
| | | {
|
| | | var config = ConfigManager.Instance.GetTemplate<TrialExchangeConfig>(trialExchangeId);
|
| | | if (config != null)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(config.tokenId);
|
| | | }
|
| | | }
|
| | | model.ProcessTrialError(error);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void Display(int id)
|
| | | {
|
| | | trialExchangeId = id;
|
| | | var config = ConfigManager.Instance.GetTemplate<TrialExchangeConfig>(id);
|
| | | if (config == null)
|
| | | {
|
| | | trialExchangeId = 0;
|
| | | return;
|
| | | }
|
| | | m_Item.cellBtn.RemoveAllListeners();
|
| | | m_Item.gameObject.SetActive(true);
|
| | | ItemCellModel cellModel = new ItemCellModel(config.exchangeItemID, true, (ulong)config.exchangeItemCount, config.exchangeItemIsBind);
|
| | | m_Item.Init(cellModel);
|
| | | m_Item.cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(config.exchangeItemID, true, (ulong)config.exchangeItemCount, -1, config.exchangeItemIsBind);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | | });
|
| | | m_Description.text = config.description;
|
| | | m_Token.SetItem(config.tokenId, config.tokenCount);
|
| | | var count = model.GetTrialTokenCount(config.tokenId);
|
| | | m_Token.count.color = UIHelper.GetUIColor(count >= config.tokenCount ? TextColType.Green : TextColType.Red, true);
|
| | |
|
| | | m_Redpoint.gameObject.SetActive(count >= config.tokenCount
|
| | | && dailyQuestModel.trialExchangeRedpoint.state == RedPointState.Simple);
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2
|
| | | guid: 9ebb65b796d3424439f2dff414553268
|
| | | timeCreated: 1533181655
|
| | | licenseType: Pro
|
| | | MonoImporter:
|
| | | serializedVersion: 2
|
| | | defaultReferences: []
|
| | | executionOrder: 0
|
| | | icon: {instanceID: 0}
|
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | | using TableConfig;
|
| | | using System;
|
| | |
|
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class TrialExchangeCell : CellView
|
| | | {
|
| | | [SerializeField] ItemCell m_Item;
|
| | | [SerializeField] Text m_Description;
|
| | | [SerializeField] ItemBehaviour m_Token;
|
| | | [SerializeField] Button m_Exchange;
|
| | | [SerializeField] Image m_Redpoint;
|
| | | [SerializeField] TrialExchangeBehaviour[] m_TrialExchanges;
|
| | |
|
| | | TrialDungeonModel model { get { return ModelCenter.Instance.GetModel<TrialDungeonModel>(); } }
|
| | | DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
|
| | |
|
| | | int trialExchangeId = 0;
|
| | | private void Awake()
|
| | | public void Display(int _class, int _line)
|
| | | {
|
| | | m_Exchange.AddListener(Exchange);
|
| | | }
|
| | |
|
| | | private void Exchange()
|
| | | {
|
| | | if (trialExchangeId != 0)
|
| | | List<TrialExchangeConfig> list;
|
| | | if (!model.TryGetTrialExchanges(_class, out list))
|
| | | {
|
| | | int error = 0;
|
| | | if (!model.TrialSendExchange(trialExchangeId, out error))
|
| | | {
|
| | | if (error == 1)
|
| | | {
|
| | | var config = ConfigManager.Instance.GetTemplate<TrialExchangeConfig>(trialExchangeId);
|
| | | if (config != null)
|
| | | {
|
| | | ModelCenter.Instance.GetModel<GetItemPathModel>().SetChinItemModel(config.tokenId);
|
| | | }
|
| | | }
|
| | | model.ProcessTrialError(error);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public void Display(int id)
|
| | | {
|
| | | trialExchangeId = id;
|
| | | var config = ConfigManager.Instance.GetTemplate<TrialExchangeConfig>(id);
|
| | | if (config == null)
|
| | | {
|
| | | trialExchangeId = 0;
|
| | | return;
|
| | | }
|
| | | m_Item.cellBtn.RemoveAllListeners();
|
| | | m_Item.gameObject.SetActive(true);
|
| | | ItemCellModel cellModel = new ItemCellModel(config.exchangeItemID, true, (ulong)config.exchangeItemCount, config.exchangeItemIsBind);
|
| | | m_Item.Init(cellModel);
|
| | | m_Item.cellBtn.AddListener(() =>
|
| | | for (int i = 0; i < m_TrialExchanges.Length; i++)
|
| | | {
|
| | | ItemAttrData itemAttrData = new ItemAttrData(config.exchangeItemID, true, (ulong)config.exchangeItemCount, -1, config.exchangeItemIsBind);
|
| | | ModelCenter.Instance.GetModel<ItemTipsModel>().SetItemTipsModel(itemAttrData);
|
| | | });
|
| | | m_Description.text = config.description;
|
| | | m_Token.SetItem(config.tokenId, config.tokenCount);
|
| | |
|
| | | var count = model.GetTrialTokenCount(config.tokenId);
|
| | | m_Redpoint.gameObject.SetActive(count >= config.tokenCount
|
| | | && dailyQuestModel.trialExchangeRedpoint.state == RedPointState.Simple);
|
| | | var index = _line * 4 + i;
|
| | | if (index < list.Count)
|
| | | {
|
| | | m_TrialExchanges[i].gameObject.SetActive(true);
|
| | | m_TrialExchanges[i].Display(list[index].id);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_TrialExchanges[i].gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | } |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 9ebb65b796d3424439f2dff414553268 |
| | | timeCreated: 1533181655 |
| | | guid: 5c0805e8cad6c2e44bbd30aaaff7008f |
| | | timeCreated: 1534302392 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| New file |
| | |
| | | using System.Collections; |
| | | using System.Collections.Generic; |
| | | using UnityEngine; |
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class TrialExchangeTitleCell : CellView
|
| | | {
|
| | | [SerializeField] Image m_BackGround;
|
| | | [SerializeField] Text m_Title;
|
| | |
|
| | | public void Display(int _class)
|
| | | {
|
| | | m_Title.text = Language.Get("TrialExchangeTitle", _class);
|
| | | }
|
| | | }
|
| | | } |
| | | |
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 62d21c0bcc1b7ad4e8528d2bfb9f7b91 |
| | | timeCreated: 1534303452 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | | #endregion
|
| | | private void OnRefreshCell(ScrollerDataType type, CellView cell)
|
| | | {
|
| | | TrialExchangeCell trialExchangeCell = cell as TrialExchangeCell;
|
| | | trialExchangeCell.Display(cell.index);
|
| | | switch (type)
|
| | | {
|
| | | case ScrollerDataType.Header:
|
| | | var _class = cell.index / 100;
|
| | | var _line = cell.index % 100;
|
| | | TrialExchangeCell trialExchangeCell = cell as TrialExchangeCell;
|
| | | trialExchangeCell.Display(_class, _line);
|
| | | break;
|
| | | case ScrollerDataType.Normal:
|
| | | TrialExchangeTitleCell trialExchangeTitleCell = cell as TrialExchangeTitleCell;
|
| | | trialExchangeTitleCell.Display(cell.index);
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private void SelectClassUp()
|
| | |
| | | m_Controller.Refresh();
|
| | | if (model.selectEquipClass == 1)
|
| | | {
|
| | | var configs = ConfigManager.Instance.GetAllValues<TrialExchangeConfig>();
|
| | | for (int i = 0; i < configs.Count; i++)
|
| | | var trialClasses = model.GetTotalClass();
|
| | | for (int i = 0; i < trialClasses.Count; i++)
|
| | | {
|
| | | m_Controller.AddCell(ScrollerDataType.Header, configs[i].id);
|
| | | List<TrialExchangeConfig> list;
|
| | | if (model.TryGetTrialExchanges(trialClasses[i], out list))
|
| | | {
|
| | | m_Controller.AddCell(ScrollerDataType.Normal, trialClasses[i]);
|
| | | var line = Mathf.CeilToInt((float)list.Count / 4);
|
| | | for (int k = 0; k < line; k++)
|
| | | {
|
| | | m_Controller.AddCell(ScrollerDataType.Header, trialClasses[i] * 100 + k);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | |
| | | List<TrialExchangeConfig> list;
|
| | | if (model.TryGetTrialExchanges(model.selectEquipClass, out list))
|
| | | {
|
| | | for (int i = 0; i < list.Count; i++)
|
| | | var line = Mathf.CeilToInt((float)list.Count / 4);
|
| | | for (int i = 0; i < line; i++)
|
| | | {
|
| | | m_Controller.AddCell(ScrollerDataType.Header, list[i].id);
|
| | | m_Controller.AddCell(ScrollerDataType.Header, model.selectEquipClass * 100 + i);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | protected override void OnActived()
|
| | | {
|
| | | base.OnActived();
|
| | | if(xBModel.bestXBRed.state == RedPointState.Simple)
|
| | | if(!WindowJumpMgr.Instance.IsJumpState && functionOrder == 0)
|
| | | {
|
| | | functionOrder = bestXBTitle.order;
|
| | | }
|
| | | else if(xBModel.runeXBRed.state == RedPointState.Simple)
|
| | | {
|
| | | functionOrder = runeXBTitle.order;
|
| | | }
|
| | | else if(xBModel.xbStoreRed.state == RedPointState.Simple)
|
| | | {
|
| | | functionOrder = xbStoreTitle.order;
|
| | | }
|
| | | else if(xBModel.xbWarehouseRed.state == RedPointState.Simple)
|
| | | {
|
| | | functionOrder = xbWarehouseTitle.order;
|
| | | if (xBModel.bestXBRed.state == RedPointState.Simple)
|
| | | {
|
| | | functionOrder = bestXBTitle.order;
|
| | | }
|
| | | else if (xBModel.runeXBRed.state == RedPointState.Simple)
|
| | | {
|
| | | functionOrder = runeXBTitle.order;
|
| | | }
|
| | | else if (xBModel.xbStoreRed.state == RedPointState.Simple)
|
| | | {
|
| | | functionOrder = xbStoreTitle.order;
|
| | | }
|
| | | else if (xBModel.xbWarehouseRed.state == RedPointState.Simple)
|
| | | {
|
| | | functionOrder = xbWarehouseTitle.order;
|
| | | }
|
| | | }
|
| | | titleGroup.TriggerByOrder(functionOrder);
|
| | | }
|
| | |
| | | playerPack.GetSelectDevourList();
|
| | | gridCtrl.m_Scorller.RefreshActiveCellViews();
|
| | | RefreshGeMatProgress();
|
| | | RefreshDecomPreviewAttr();
|
| | | if (playerPack.getItems != null && playerPack.getItems.Length > 0)
|
| | | {
|
| | | WindowCenter.Instance.Open<DecomposeGetItemWin>();
|
| | |
| | | ItemModel itemModel = realDevourlist[i];
|
| | | if (itemModel.chinItemModel.EquipPlace == 0)
|
| | | {
|
| | | curExp = playerPack.GetItemCountByID(PackType.rptItem, itemModel.itemId) * itemModel.chinItemModel.EffectValueA1;
|
| | | curExp = itemModel.itemInfo.ItemCount * itemModel.chinItemModel.EffectValueA1;
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | {
|
| | | bottomPart.gameObject.SetActive(false);
|
| | | StartCoroutine(SetScrollSize());
|
| | | DebugEx.Log("分支测试");
|
| | | }
|
| | |
|
| | | IEnumerator SetScrollSize()
|
| | |
| | | if (sendItemModel == null) return;
|
| | |
|
| | | sendItemConfig = ConfigManager.Instance.GetTemplate<ItemConfig>(sendItemModel.itemInfo.ItemID);
|
| | | if(sendItemConfig.JobLimit / 100 != PlayerDatas.Instance.baseData.Job)
|
| | | if(sendItemConfig.JobLimit != 0 && sendItemConfig.JobLimit / 100 != PlayerDatas.Instance.baseData.Job)
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("GeRen_lhs_31379");
|
| | | return;
|
| | |
| | | nameText.text = itemConfig.ItemName;
|
| | | ItemCellModel cellModel = new ItemCellModel(id, false, (ulong)BoxModel.selectDict[id]);
|
| | | itemBaisc.Init(cellModel);
|
| | | haveCntText.text = playerPack.GetItemCountByID(PackType.rptItem, id).ToString();
|
| | | int haveCnt = playerPack.GetItemCountByID(PackType.rptItem, id);
|
| | | if(haveCnt <= 0)
|
| | | {
|
| | | haveCnt = ModelCenter.Instance.GetModel<RuneModel>().GetRuneCountById(id);
|
| | | }
|
| | | haveCntText.text = haveCnt.ToString();
|
| | | SetIsChoose(false);
|
| | | }
|
| | |
|
| | |
| | | TimeUtility.OnServerOpenDayRefresh += OnStepServerDay;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChange;
|
| | | hostModel.TreasureFindHostCompleteAct += TreasureFindHostCompleteAct;
|
| | | osGiftModel.OnOSGiftStateChange += OnOSGiftStateChange;
|
| | | RedpointCenter.Instance.redpointValueChangeEvent += UpdateRedpoint;
|
| | | OpenServerActivityCenter.Instance.openServerActivityStateChange += OpenServerActivityStateChange;
|
| | | OperationTimeHepler.Instance.operationStartEvent += operationStartEvent;
|
| | |
| | | StopIEnumerator();
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChange;
|
| | | hostModel.TreasureFindHostCompleteAct -= TreasureFindHostCompleteAct;
|
| | | osGiftModel.OnOSGiftStateChange -= OnOSGiftStateChange;
|
| | | TimeUtility.OnServerOpenDayRefresh -= OnStepServerDay;
|
| | | OpenServerActivityCenter.Instance.openServerActivityStateChange -= OpenServerActivityStateChange;
|
| | | RedpointCenter.Instance.redpointValueChangeEvent -= UpdateRedpoint;
|
| | |
| | | }
|
| | | CoroutineMgr.Instance.MainHighTipCdTimeEvent += OnMainHighTipCdTime;
|
| | | FunctionUnlockFlyObjectTarget.IsPlayerUiEffect += IsPlayerUiEffect;
|
| | | osGiftModel.OnOSGiftStateChange += CheckOSGift;
|
| | | storeModel.StoreFuncOpenAct += OnStoreFuncOpen;
|
| | | OpenServerActivityCenter.Instance.openServerActivityStateChange += OpenServerActivityStateChange;
|
| | | }
|
| | |
| | | FunctionUnlockFlyObjectTarget.IsPlayerUiEffect -= IsPlayerUiEffect;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChange;
|
| | | storeModel.StoreFuncOpenAct -= OnStoreFuncOpen;
|
| | | osGiftModel.OnOSGiftStateChange -= CheckOSGift;
|
| | | OpenServerActivityCenter.Instance.openServerActivityStateChange -= OpenServerActivityStateChange;
|
| | | CoroutineMgr.Instance.OnMainStopCorUP();
|
| | | m_HighSettingFadeInFadeOut.Unit();
|
| | |
| | |
|
| | | private void OSGiftBtn()
|
| | | {
|
| | | if (osGiftModel.giftGetNotify)
|
| | | {
|
| | | osGiftModel.giftGetNotify = false;
|
| | | }
|
| | | WindowCenter.Instance.Open<OpenServerGiftWin>();
|
| | | //WindowCenter.Instance.Open<OpenServerGiftWin>();
|
| | | }
|
| | |
|
| | | void RuneTaButton()//符印塔
|
| | |
| | | void OnCliCkLimitedTimePBtn()//限时礼包
|
| | | {
|
| | | WindowCenter.Instance.Close<MainInterfaceWin>();
|
| | | WindowCenter.Instance.Open<LimitedTimePackageWin>();
|
| | | WindowCenter.Instance.Open<OpenServerActivityWin>(false,7);
|
| | | }
|
| | |
|
| | | void OnClickElfFestivalBtn()
|
| | |
| | | {
|
| | | if (InGameDownLoad.Instance.CheckDominantDownLoad())
|
| | | {
|
| | | InGameDownLoad.Instance.TryDownLoad(true);
|
| | | if (Application.internetReachability == NetworkReachability.ReachableViaLocalAreaNetwork)
|
| | | {
|
| | | InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.Half);
|
| | | }
|
| | | else
|
| | | {
|
| | | InGameDownLoad.Instance.TryDownLoad(InGameDownLoad.Dominant.Whole);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChange;
|
| | | hostModel.TreasureFindHostCompleteAct += TreasureFindHostCompleteAct;
|
| | | osGiftModel.OnOSGiftStateChange += OnOSGiftStateChange;
|
| | | RedpointCenter.Instance.redpointValueChangeEvent += UpdateRedpoint;
|
| | | TimeUtility.OnServerOpenDayRefresh += OnStepServerDay;
|
| | | OpenServerActivityCenter.Instance.openServerActivityStateChange += OpenServerActivityStateChange;
|
| | |
| | | {
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent -= OnFuncStateChange;
|
| | | hostModel.TreasureFindHostCompleteAct -= TreasureFindHostCompleteAct;
|
| | | osGiftModel.OnOSGiftStateChange -= OnOSGiftStateChange;
|
| | | RedpointCenter.Instance.redpointValueChangeEvent -= UpdateRedpoint;
|
| | | TimeUtility.OnServerOpenDayRefresh -= OnStepServerDay;
|
| | | OpenServerActivityCenter.Instance.openServerActivityStateChange -= OpenServerActivityStateChange;
|
| | |
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class FlashSaleModel : Model, IPlayerLoginOk, IBeforePlayerDataInitialize
|
| | | public class FlashSaleModel : Model, IPlayerLoginOk, IBeforePlayerDataInitialize, IOpenServerActivity
|
| | | {
|
| | | StoreModel storeModel { get { return ModelCenter.Instance.GetModel<StoreModel>(); } }
|
| | | public override void Init()
|
| | |
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
|
| | | TimeMgr.Instance.OnDayEvent += OnDayEvent;
|
| | | OpenServerActivityCenter.Instance.Register(4, this);
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | if (type == Operation.FlashSale && state == 0)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(4);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (type == Operation.FlashSale && state == 0)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(4);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | OperationBase operationBase;
|
| | | OperationTimeHepler.Instance.TryGetOperationTime(Operation.FlashSale, out operationBase);
|
| | | return operationBase != null && operationBase.SatisfyOpenCondition() && operationBase.InAdvanceTime(TimeUtility.ServerNow);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return flashSaleRedpoint.state == RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | }
|
| | |
|
| | | public Redpoint flashSaleRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20904);
|
| | |
|
| | | public event Action<int> onStateUpate;
|
| | |
|
| | | private void UpdateRedpoint()
|
| | | {
|
| | | flashSaleRedpoint.state = RedPointState.None;
|
| | |
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class ImpactRankModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | public class ImpactRankModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity
|
| | | {
|
| | | public override void Init()
|
| | | {
|
| | |
| | | PlayerDatas.Instance.rank.OnRefreshRank += OnRefreshRank;
|
| | | TimeUtility.OnServerOpenDayRefresh += OnServerOpenDayRefresh;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | OpenServerActivityCenter.Instance.Register(0, this);
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | if (_id == 125)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(0);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | #region 协议
|
| | | public event Action OnAwardGetEvent;
|
| | | public event Action<int> onStateUpate;
|
| | |
|
| | | private Dictionary<int, OpenServerPlayerData> impactAwardGetDict = new Dictionary<int, OpenServerPlayerData>();
|
| | | public void UpdateGetState(HAB17_tagMCOpenServerCampaignAwardList _package)
|
| | | {
|
| | |
| | | {
|
| | | var _redpoint = m_Redpoints[_type];
|
| | | _redpoint.state = RedPointState.None;
|
| | | if (IsMissImpactRank(_type) || !IsActivityClose(_type))
|
| | | bool _locked = IsLock(_type);
|
| | | if (IsMissImpactRank(_type) || _locked)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | else
|
| | | else if (IsActivityClose(_type))
|
| | | {
|
| | | var _start = (_cfg as OSCBillRankAwardConfig).RankA;
|
| | | var _end = (_cfg as OSCBillRankAwardConfig).RankB;
|
| | |
| | |
|
| | | #region 主界面特效
|
| | | public bool OSCEffectOpen { get; set; }
|
| | |
|
| | | public bool IsOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return TimeUtility.OpenDay < openServerActivityDays && FuncOpen.Instance.IsFuncOpen(125);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | var state = impactRankRedpoint.state;
|
| | | return state == RedPointState.Simple || state == RedPointState.GetReward;
|
| | | }
|
| | | }
|
| | | #endregion
|
| | | }
|
| | |
|
| | | public class OpenServerActivityCenter : Singleton<OpenServerActivityCenter>
|
| | | {
|
| | | ImpactRankModel impactRankModel { get { return ModelCenter.Instance.GetModel<ImpactRankModel>(); } }
|
| | | OSRedEnvelopeModel envelopeModel { get { return ModelCenter.Instance.GetModel<OSRedEnvelopeModel>(); } }
|
| | | OSTimeLimitGiftModel timeLimitGiftModel { get { return ModelCenter.Instance.GetModel<OSTimeLimitGiftModel>(); } }
|
| | | FlashSaleModel flashSaleModel { get { return ModelCenter.Instance.GetModel<FlashSaleModel>(); } }
|
| | |
|
| | | ConsumeRebateModel consumeRebateModel { get { return ModelCenter.Instance.GetModel<ConsumeRebateModel>(); } }
|
| | |
|
| | | MultipleExpModel multipleExpModel { get { return ModelCenter.Instance.GetModel<MultipleExpModel>(); } }
|
| | | BossRebornModel bossRebornModel { get { return ModelCenter.Instance.GetModel<BossRebornModel>(); } }
|
| | |
|
| | | MultipleRealmPointModel multipleRealmModel { get { return ModelCenter.Instance.GetModel<MultipleRealmPointModel>(); } }
|
| | |
|
| | | public event Action openServerActivityStateChange;
|
| | |
|
| | | Dictionary<int, IOpenServerActivity> openServerActivitys = new Dictionary<int, IOpenServerActivity>();
|
| | |
|
| | | public OpenServerActivityCenter()
|
| | | {
|
| | | TimeUtility.OnServerOpenDayRefresh += OnServerOpenDayRefresh;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
|
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
|
| | | }
|
| | |
|
| | | private void OperationAdvanceEvent(Operation type)
|
| | | public void Register(int funcOrder, IOpenServerActivity activity)
|
| | | {
|
| | | if (type == Operation.FlashSale)
|
| | | if (!openServerActivitys.ContainsKey(funcOrder))
|
| | | {
|
| | | if (openServerActivityStateChange != null)
|
| | | {
|
| | | openServerActivityStateChange();
|
| | | }
|
| | | openServerActivitys.Add(funcOrder, activity);
|
| | | activity.onStateUpate += OnStateUpate;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OperationEndEvent(Operation type, int state)
|
| | | private void OnStateUpate(int _order)
|
| | | {
|
| | | if ((type == Operation.FlashSale || type == Operation.BossReborn
|
| | | || type == Operation.ConsumeRebate || type == Operation.GiftPackage
|
| | | || type == Operation.MultipRealmPoint)
|
| | | && state == 0)
|
| | | if (openServerActivityStateChange != null)
|
| | | {
|
| | | if (openServerActivityStateChange != null)
|
| | | {
|
| | | openServerActivityStateChange();
|
| | | }
|
| | | }
|
| | | if ((type == Operation.MultipleExp)
|
| | | && state == 1)
|
| | | {
|
| | | if (openServerActivityStateChange != null)
|
| | | {
|
| | | openServerActivityStateChange();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OperationStartEvent(Operation type, int state)
|
| | | {
|
| | | if ((type == Operation.FlashSale || type == Operation.BossReborn
|
| | | || type == Operation.ConsumeRebate || type == Operation.GiftPackage
|
| | | || type == Operation.MultipRealmPoint)
|
| | | && state == 0)
|
| | | {
|
| | | if (openServerActivityStateChange != null)
|
| | | {
|
| | | openServerActivityStateChange();
|
| | | }
|
| | | }
|
| | | if ((type == Operation.MultipleExp)
|
| | | && state == 1)
|
| | | {
|
| | | if (openServerActivityStateChange != null)
|
| | | {
|
| | | openServerActivityStateChange();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OnFuncStateChangeEvent(int _id)
|
| | | {
|
| | | if (_id == 125 || _id == (int)FuncOpenEnum.OpenServerRedEnvelope
|
| | | || _id == 132)
|
| | | {
|
| | | if (openServerActivityStateChange != null)
|
| | | {
|
| | | openServerActivityStateChange();
|
| | | }
|
| | | openServerActivityStateChange();
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public bool IsAnyActivityOpen(out int _functionOrder)
|
| | | {
|
| | | _functionOrder = 0;
|
| | | if (IsImpactRankOpen())
|
| | | foreach (var _order in openServerActivitys.Keys)
|
| | | {
|
| | | _functionOrder = 0;
|
| | | return true;
|
| | | }
|
| | | if (IsConsumeRebateOpen())
|
| | | {
|
| | | _functionOrder = 1;
|
| | | return true;
|
| | | }
|
| | | if (IsRedEnvelopeOpen())
|
| | | {
|
| | | _functionOrder = 2;
|
| | | return true;
|
| | | }
|
| | | if (IsTimeLimitGiftOpen())
|
| | | {
|
| | | _functionOrder = 3;
|
| | | return true;
|
| | | }
|
| | | if (IsFlashSaleOpen())
|
| | | {
|
| | | _functionOrder = 4;
|
| | | return true;
|
| | | }
|
| | | if (IsMultipleExpOpen())
|
| | | {
|
| | | _functionOrder = 5;
|
| | | return true;
|
| | | }
|
| | | if (IsMultipleRealmOpen())
|
| | | {
|
| | | _functionOrder = 8;
|
| | | return true;
|
| | | }
|
| | |
|
| | | if (IsBossRebornOpen())
|
| | | {
|
| | | _functionOrder = 9;
|
| | | return true;
|
| | | if (openServerActivitys[_order].IsOpen)
|
| | | {
|
| | | _functionOrder = _order;
|
| | | return true;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsImpactRankOpen()
|
| | | public bool IsActivityOpen(int _funcOrder)
|
| | | {
|
| | | return TimeUtility.OpenDay < impactRankModel.openServerActivityDays && FuncOpen.Instance.IsFuncOpen(125);
|
| | | if (openServerActivitys.ContainsKey(_funcOrder))
|
| | | {
|
| | | return openServerActivitys[_funcOrder].IsOpen;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public bool IsRedEnvelopeOpen()
|
| | | public bool IsPriorityOpenOpen(int _funcOrder)
|
| | | {
|
| | | return TimeUtility.OpenDay < envelopeModel.openDays && FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.OpenServerRedEnvelope);
|
| | | }
|
| | |
|
| | | public bool IsTimeLimitGiftOpen()
|
| | | {
|
| | | return TimeUtility.CreateDays <= timeLimitGiftModel.openDays && FuncOpen.Instance.IsFuncOpen(132);
|
| | | }
|
| | |
|
| | | public bool IsFlashSaleOpen()
|
| | | {
|
| | | return flashSaleModel.IsOpen || flashSaleModel.InAdvanceOpen;
|
| | | }
|
| | |
|
| | | public bool IsConsumeRebateOpen()
|
| | | {
|
| | | return consumeRebateModel.IsOpen;
|
| | | }
|
| | |
|
| | | public bool IsMultipleExpOpen()
|
| | | {
|
| | | return multipleExpModel.Open();
|
| | | }
|
| | |
|
| | | public bool IsMultipleRealmOpen()
|
| | | {
|
| | | return multipleRealmModel.IsOpen;
|
| | | if (openServerActivitys.ContainsKey(_funcOrder))
|
| | | {
|
| | | return openServerActivitys[_funcOrder].priorityOpen;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | public void ProcessErrorTip()
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsBossRebornOpen()
|
| | | {
|
| | | return bossRebornModel.IsOpen();
|
| | | }
|
| | | public interface IOpenServerActivity
|
| | | {
|
| | | bool IsOpen { get; }
|
| | | bool priorityOpen { get; }
|
| | |
|
| | | event Action<int> onStateUpate;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | _cell.unCompleteImg.gameObject.SetActive(false);
|
| | | _cell.hasGetImg.gameObject.SetActive(false);
|
| | | _cell.effect.gameObject.SetActive(false);
|
| | | if (model.IsMissImpactRank(model.presentSelectType))
|
| | | ImpactRankModel.OpenServerPlayerData _playerData;
|
| | | var _hasData = model.TryGetOpenServerPlayerData(model.presentSelectType, out _playerData);
|
| | | if (model.IsMissImpactRank(model.presentSelectType) || model.IsLock(model.presentSelectType))
|
| | | {
|
| | | _cell.unCompleteImg.gameObject.SetActive(true);
|
| | | }
|
| | | else if (model.IsActivityClose(model.presentSelectType))
|
| | | else if (_cfg is OSCBillTagAwardConfig)
|
| | | {
|
| | | ImpactRankModel.OpenServerPlayerData _playerData;
|
| | | var _hasData = model.TryGetOpenServerPlayerData(model.presentSelectType, out _playerData);
|
| | | if (!_hasData)
|
| | | {
|
| | | _cell.unCompleteImg.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_cfg is OSCBillTagAwardConfig)
|
| | | var _index = model.GetBillIndex(model.presentSelectType, _cell.index);
|
| | | if (_playerData.IsTagGet(model.GetTagIndex(model.presentSelectType, _index)))
|
| | | {
|
| | | var _index = model.GetBillIndex(model.presentSelectType, _cell.index);
|
| | | if (_playerData.IsTagGet(model.GetTagIndex(model.presentSelectType, _index)))
|
| | | {
|
| | | _cell.hasGetImg.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | var _complete = _playerData.value >= (_cfg as OSCBillTagAwardConfig).Condition;
|
| | | _cell.unCompleteImg.gameObject.SetActive(!_complete);
|
| | | _cell.getBtn.gameObject.SetActive(_complete);
|
| | | _cell.effect.gameObject.SetActive(_complete);
|
| | | }
|
| | | _cell.hasGetImg.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | var _complete = _playerData.value >= (_cfg as OSCBillTagAwardConfig).Condition;
|
| | | _cell.unCompleteImg.gameObject.SetActive(!_complete);
|
| | | _cell.getBtn.gameObject.SetActive(_complete);
|
| | | _cell.effect.gameObject.SetActive(_complete);
|
| | | }
|
| | | }
|
| | | }
|
| | | else if (model.IsActivityClose(model.presentSelectType))
|
| | | {
|
| | | if (!_hasData)
|
| | | {
|
| | | _cell.unCompleteImg.gameObject.SetActive(true);
|
| | | }
|
| | | else
|
| | | {
|
| | | if (_cfg is OSCBillRankAwardConfig)
|
| | | {
|
| | | var _start = (_cfg as OSCBillRankAwardConfig).RankA;
|
| | | var _end = (_cfg as OSCBillRankAwardConfig).RankB;
|
| | | var _rank = PlayerDatas.Instance.rank.GetSelfRank((int)model.GetRankType(model.presentSelectType));
|
| | |
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class OSGiftModel : Model, IPlayerLoginOk, IBeforePlayerDataInitialize
|
| | | public class OSGiftModel : Model, IPlayerLoginOk, IBeforePlayerDataInitialize, IOpenServerActivity
|
| | | {
|
| | | public override void Init()
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | storeModel.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
|
| | | vipModel.firstChargeRewardEvent += firstChargeRewardEvent;
|
| | | vipModel.firstChargeRewardEvent += FirstChargeRewardEvent;
|
| | | OpenServerActivityCenter.Instance.Register(6, this);
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | activate = CheckActivate();
|
| | | if (OnOSGiftStateChange != null)
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | OnOSGiftStateChange();
|
| | | onStateUpate(6);
|
| | | }
|
| | | }
|
| | |
|
| | | public event Action OnOSGiftStateChange;
|
| | | public event Action<int> onStateUpate;
|
| | |
|
| | | public bool activate { get; private set; }
|
| | |
|
| | |
| | | {
|
| | | m_GiftGetNotify = value;
|
| | | OSGiftRedpoint.state = value ? RedPointState.Simple : RedPointState.None;
|
| | | if (OnOSGiftStateChange != null)
|
| | | {
|
| | | OnOSGiftStateChange();
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | VipModel vipModel { get { return ModelCenter.Instance.GetModel<VipModel>(); } }
|
| | |
|
| | | public bool CheckOpen()
|
| | | public bool IsOpen
|
| | | {
|
| | | if (!login)
|
| | | get
|
| | | {
|
| | | return false;
|
| | | return CheckActivate();
|
| | | }
|
| | | login = false;
|
| | | if (!PreFightMission.Instance.IsFinished()
|
| | | || DayRemind.Instance.GetDayRemind(DayRemind.OSGIFT_TIP) || PlayerDatas.Instance.baseData.coinPointTotal == 0
|
| | | || !ModelCenter.Instance.GetModel<VipModel>().firstChargeRewardGet)
|
| | | }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return false;
|
| | | return OSGiftRedpoint.state == RedPointState.Simple;
|
| | | }
|
| | | var _list = StoreConfig.GetTypeStoreModel((int)StoreFunc.OSGift);
|
| | | for (int i = 0; i < _list.Count; i++)
|
| | | {
|
| | | var _limit = storeModel.GetBuyShopLimit((uint)_list[i].ID);
|
| | | if (_limit == null || _limit.BuyCnt < _list[i].PurchaseNumber[0])
|
| | | {
|
| | | if (!WindowCenter.Instance.CheckOpen<OpenServerGiftWin>())
|
| | | {
|
| | | DayRemind.Instance.SetDayRemind(DayRemind.OSGIFT_TIP, true);
|
| | | WindowCenter.Instance.Open<OpenServerGiftWin>();
|
| | | return true;
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|
| | | private void RefreshBuyShopLimitEvent()
|
| | |
| | | if (activate != _activate)
|
| | | {
|
| | | activate = _activate;
|
| | | if (OnOSGiftStateChange != null)
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | OnOSGiftStateChange();
|
| | | onStateUpate(6);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void firstChargeRewardEvent()
|
| | | private void FirstChargeRewardEvent()
|
| | | {
|
| | | bool _activate = CheckActivate();
|
| | | if (activate != _activate)
|
| | | {
|
| | | activate = _activate;
|
| | | if (OnOSGiftStateChange != null)
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | OnOSGiftStateChange();
|
| | | onStateUpate(6);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | if (_type == PlayerDataRefresh.ChangeCoinPointTotal && activate != _activate)
|
| | | {
|
| | | activate = _activate;
|
| | | if (OnOSGiftStateChange != null)
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | OnOSGiftStateChange();
|
| | | onStateUpate(6);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private bool login = false;
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | giftGetNotify = false;
|
| | | if (!(StageManager.Instance.CurrentStage is DungeonStage))
|
| | | {
|
| | | login = true;
|
| | | }
|
| | | else
|
| | | {
|
| | | login = false;
|
| | | }
|
| | | }
|
| | |
|
| | | public Redpoint OSGiftRedpoint = new Redpoint(2, 36);
|
| | | public Redpoint OSGiftRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20906);
|
| | | }
|
| | | } |
| | | |
| | |
| | | using TableConfig;
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class OSRedEnvelopeModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | public class OSRedEnvelopeModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity
|
| | | {
|
| | | AchievementModel m_AchievementModel;
|
| | | AchievementModel achieveModel
|
| | |
| | | envelopeModel.EnvelopeUpdateEvent += EnvelopeUpdateEvent;
|
| | | envelopeModel.EnvelopeDelEvent += EnvelopeUpdateEvent;
|
| | | envelopeModel.EnvelopeGetEvent += EnvelopeGetEvent;
|
| | | OpenServerActivityCenter.Instance.Register(2, this);
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | if (OSRedEnvelopeUpdateEvent != null)
|
| | | {
|
| | | OSRedEnvelopeUpdateEvent();
|
| | | }
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(2);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | public int totalJadeGet { get; private set; }
|
| | | public int getEnvelopeTimes { get; private set; }
|
| | |
|
| | | public bool IsOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return TimeUtility.OpenDay < openDays && FuncOpen.Instance.IsFuncOpen((int)FuncOpenEnum.OpenServerRedEnvelope);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_RedAchieveRedpoint.state == RedPointState.Simple
|
| | | || m_OpenServerGetRedpin.state == RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | | public event Action OSRedEnvelopeInfoEnvent;
|
| | | public event Action<int> onStateUpate;
|
| | |
|
| | | public void UpdateOSRedEnvelope(HAB24_tagMCOpenServerRedPacketInfo _pak)
|
| | | {
|
| | | totalJadeGet = (int)_pak.MoneyNum;
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | OSTimeLimitGiftModel m_OSTimeLimitGiftModel;
|
| | | OSTimeLimitGiftModel timeLimitGiftModel {
|
| | | get {
|
| | | return m_OSTimeLimitGiftModel ?? (m_OSTimeLimitGiftModel = ModelCenter.Instance.GetModel<OSTimeLimitGiftModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | FlashSaleModel flashSaleModel { get { return ModelCenter.Instance.GetModel<FlashSaleModel>(); } }
|
| | |
|
| | | ConsumeRebateModel consumeRebateModel { get { return ModelCenter.Instance.GetModel<ConsumeRebateModel>(); } }
|
| | |
|
| | | MultipleExpModel multipleExpModel { get { return ModelCenter.Instance.GetModel<MultipleExpModel>(); } }
|
| | |
|
| | | MultipleRealmPointModel multipleRealmPointModel { get { return ModelCenter.Instance.GetModel<MultipleRealmPointModel>(); } }
|
| | | BossRebornModel bossRebornModel { get { return ModelCenter.Instance.GetModel<BossRebornModel>(); } }
|
| | |
|
| | | List<int> openActivitys = new List<int>();
|
| | | List<int> activityReds = new List<int>();
|
| | | List<int> priorityActivitys = new List<int>();
|
| | | List<int> alreadyOpenActivitys = new List<int>();
|
| | |
|
| | | protected override void BindController()
|
| | |
| | | {
|
| | | TimeUtility.OnServerOpenDayRefresh += OnStepServerDayEvent;
|
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent;
|
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
|
| | | OpenServerActivityCenter.Instance.openServerActivityStateChange += OpenServerActivityStateChange;
|
| | | for (int i = 0; i < m_SortArray.Count; i++)
|
| | | {
|
| | | m_ActivitySpreadDict[m_SortArray[i]] = false;
|
| | |
| | |
|
| | | protected override void OnActived()
|
| | | {
|
| | | if (functionOrder == 1)
|
| | | if (alreadyOpenActivitys.Count == 0)
|
| | | {
|
| | | functionOrder = 0;
|
| | | CloseImmediately();
|
| | | return;
|
| | | }
|
| | | if (functionOrder == 0 && !WindowJumpMgr.Instance.IsJumpState)
|
| | | {
|
| | |
| | | }
|
| | | else
|
| | | {
|
| | | if (!alreadyOpenActivitys.Contains(functionOrder))
|
| | | {
|
| | | functionOrder = GetDefaultSelect();
|
| | | }
|
| | | for (int i = 0; i < m_SortArray.Count; i++)
|
| | | {
|
| | | m_ActivitySpreadDict[m_SortArray[i]] = m_SortArray[i] == functionOrder;
|
| | |
| | | {
|
| | | TimeUtility.OnServerOpenDayRefresh -= OnStepServerDayEvent;
|
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent;
|
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent;
|
| | | OpenServerActivityCenter.Instance.openServerActivityStateChange -= OpenServerActivityStateChange;
|
| | | CloseOtherWin();
|
| | | WindowCenter.Instance.Open<MainInterfaceWin>();
|
| | | impactRankModel.gotoImpactRankType = 0;
|
| | |
| | | int GetDefaultSelect()
|
| | | {
|
| | | openActivitys.Clear();
|
| | | activityReds.Clear();
|
| | | if (OpenServerActivityCenter.Instance.IsTimeLimitGiftOpen())
|
| | | {
|
| | | openActivitys.Add(3);
|
| | | if (timeLimitGiftModel.redpoint.state == RedPointState.Simple)
|
| | | {
|
| | | activityReds.Add(3);
|
| | | }
|
| | | }
|
| | | if (OpenServerActivityCenter.Instance.IsFlashSaleOpen())
|
| | | {
|
| | | openActivitys.Add(4);
|
| | | if (flashSaleModel.flashSaleRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | activityReds.Add(4);
|
| | | }
|
| | | }
|
| | | if (OpenServerActivityCenter.Instance.IsImpactRankOpen())
|
| | | {
|
| | | openActivitys.Add(0);
|
| | | if (impactRankModel.HasRedpoint())
|
| | | {
|
| | | activityReds.Add(0);
|
| | | }
|
| | | }
|
| | | if (OpenServerActivityCenter.Instance.IsRedEnvelopeOpen())
|
| | | {
|
| | | openActivitys.Add(2);
|
| | | if (envelopeModel.m_RedAchieveRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | activityReds.Add(2);
|
| | | envelopeModel.selectType = 1;
|
| | | }
|
| | | else if (envelopeModel.m_OpenServerGetRedpin.state == RedPointState.Simple)
|
| | | {
|
| | | activityReds.Add(2);
|
| | | envelopeModel.selectType = 2;
|
| | | }
|
| | | }
|
| | | if (OpenServerActivityCenter.Instance.IsConsumeRebateOpen())
|
| | | {
|
| | | openActivitys.Add(1);
|
| | | if (consumeRebateModel.consumeRebateRedpoint.state == RedPointState.Simple)
|
| | | {
|
| | | activityReds.Add(1);
|
| | | }
|
| | | }
|
| | | if (OpenServerActivityCenter.Instance.IsBossRebornOpen())
|
| | | {
|
| | | openActivitys.Add(9);
|
| | | if (bossRebornModel.bossRebornPoint.state == RedPointState.Simple)
|
| | | {
|
| | | activityReds.Add(9);
|
| | | }
|
| | | }
|
| | | priorityActivitys.Clear();
|
| | |
|
| | | if (OpenServerActivityCenter.Instance.IsMultipleExpOpen())
|
| | | for (int i = 0; i < m_SortArray.Count; i++)
|
| | | {
|
| | | openActivitys.Add(5);
|
| | | if (multipleExpModel.multipleExpRedpoint.state == RedPointState.Simple)
|
| | | if (OpenServerActivityCenter.Instance.IsActivityOpen(m_SortArray[i]))
|
| | | {
|
| | | activityReds.Add(5);
|
| | | openActivitys.Add(m_SortArray[i]);
|
| | | if (OpenServerActivityCenter.Instance.IsPriorityOpenOpen(m_SortArray[i]))
|
| | | {
|
| | | priorityActivitys.Add(m_SortArray[i]);
|
| | |
|
| | | switch (m_SortArray[i])
|
| | | {
|
| | | case 2:
|
| | | envelopeModel.selectType = envelopeModel.m_RedAchieveRedpoint.state == RedPointState.Simple ? 1 : 2;
|
| | | break;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | | if (OpenServerActivityCenter.Instance.IsMultipleRealmOpen())
|
| | | if (priorityActivitys.Count > 0)
|
| | | {
|
| | | openActivitys.Add(8);
|
| | | if (multipleRealmPointModel.multipleRed.state == RedPointState.Simple)
|
| | | {
|
| | | activityReds.Add(8);
|
| | | }
|
| | | }
|
| | | if (activityReds.Count > 0)
|
| | | {
|
| | | activityReds.Sort(Compare);
|
| | | return activityReds[0];
|
| | | priorityActivitys.Sort(Compare);
|
| | | return priorityActivitys[0];
|
| | | }
|
| | | else
|
| | | {
|
| | |
| | | void CheckAlreadyOpen()
|
| | | {
|
| | | alreadyOpenActivitys.Clear();
|
| | | if (OpenServerActivityCenter.Instance.IsTimeLimitGiftOpen())
|
| | | for (int i = 0; i < m_SortArray.Count; i++)
|
| | | {
|
| | | alreadyOpenActivitys.Add(3);
|
| | | }
|
| | | if (OpenServerActivityCenter.Instance.IsFlashSaleOpen())
|
| | | {
|
| | | alreadyOpenActivitys.Add(4);
|
| | | }
|
| | | if (OpenServerActivityCenter.Instance.IsImpactRankOpen())
|
| | | {
|
| | | alreadyOpenActivitys.Add(0);
|
| | | }
|
| | | if (OpenServerActivityCenter.Instance.IsRedEnvelopeOpen())
|
| | | {
|
| | | alreadyOpenActivitys.Add(2);
|
| | | }
|
| | | if (OpenServerActivityCenter.Instance.IsConsumeRebateOpen())
|
| | | {
|
| | | alreadyOpenActivitys.Add(1);
|
| | | }
|
| | | if (OpenServerActivityCenter.Instance.IsMultipleExpOpen())
|
| | | {
|
| | | alreadyOpenActivitys.Add(5);
|
| | | }
|
| | | if (OpenServerActivityCenter.Instance.IsMultipleRealmOpen())
|
| | | {
|
| | | alreadyOpenActivitys.Add(8);
|
| | | }
|
| | |
|
| | | if (OpenServerActivityCenter.Instance.IsBossRebornOpen())
|
| | | {
|
| | | alreadyOpenActivitys.Add(9);
|
| | | if (OpenServerActivityCenter.Instance.IsActivityOpen(m_SortArray[i]))
|
| | | {
|
| | | alreadyOpenActivitys.Add(m_SortArray[i]);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Normal, sort * 100 + _type);
|
| | | }
|
| | | break;
|
| | | case 1:
|
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Header, sort);
|
| | | continue;
|
| | | case 2:
|
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Header, sort);
|
| | | if (!m_ActivitySpreadDict[sort])
|
| | |
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Normal, sort * 100 + 1);
|
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Normal, sort * 100 + 2);
|
| | | break;
|
| | | case 3:
|
| | | case 4:
|
| | | case 5:
|
| | | case 8:
|
| | | case 9:
|
| | | default:
|
| | | m_ActivityCtrl.AddCell(ScrollerDataType.Header, sort);
|
| | | break;
|
| | | }
|
| | |
| | | WindowCenter.Instance.Open<MultipleExpWin>(true);
|
| | | }
|
| | | break;
|
| | | case 6:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<OpenServerGiftWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<OpenServerGiftWin>(true);
|
| | | }
|
| | | break;
|
| | | case 7:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | | WindowCenter.Instance.OpenWithoutAnimation<LimitedTimePackageWin>();
|
| | | }
|
| | | else
|
| | | {
|
| | | WindowCenter.Instance.Open<LimitedTimePackageWin>(true);
|
| | | }
|
| | | break;
|
| | | case 8:
|
| | | if (windowState == WindowState.Opened)
|
| | | {
|
| | |
| | | WindowCenter.Instance.CloseImmediately<MultipleExpWin>();
|
| | | WindowCenter.Instance.CloseImmediately<NPracticePointWin>();
|
| | | WindowCenter.Instance.CloseImmediately<BossRebornWin>();
|
| | | WindowCenter.Instance.CloseImmediately<OpenServerGiftWin>();
|
| | | WindowCenter.Instance.CloseImmediately<LimitedTimePackageWin>();
|
| | | }
|
| | |
|
| | | private int Compare(int x, int y)
|
| | |
| | |
|
| | | private void OperationTimeUpdateEvent(Operation type)
|
| | | {
|
| | | if (type == Operation.MultipleExp)
|
| | | if (type == Operation.MultipleExp || type == Operation.MultipRealmPoint)
|
| | | {
|
| | | m_ActivityCtrl.m_Scorller.RefreshActiveCellViews();
|
| | | }
|
| | | }
|
| | |
|
| | | private void OperationStartEvent(Operation type, int state)
|
| | | private void OpenServerActivityStateChange()
|
| | | {
|
| | | switch (type)
|
| | | bool _update = false;
|
| | | for (int i = 0; i < m_SortArray.Count; i++)
|
| | | {
|
| | | case Operation.MultipleExp:
|
| | | if (state == 1 && !alreadyOpenActivitys.Contains(5))
|
| | | {
|
| | | alreadyOpenActivitys.Add(5);
|
| | | UpdateFunctionBtns();
|
| | | }
|
| | | break;
|
| | | case Operation.ConsumeRebate:
|
| | | if (state == 0 && !alreadyOpenActivitys.Contains(1))
|
| | | {
|
| | | alreadyOpenActivitys.Add(1);
|
| | | UpdateFunctionBtns();
|
| | | }
|
| | | break;
|
| | | case Operation.FlashSale:
|
| | | if (state == 0 && !alreadyOpenActivitys.Contains(4))
|
| | | {
|
| | | alreadyOpenActivitys.Add(4);
|
| | | UpdateFunctionBtns();
|
| | | }
|
| | | break;
|
| | | case Operation.BossReborn:
|
| | | if (state == 0 && !alreadyOpenActivitys.Contains(9))
|
| | | {
|
| | | alreadyOpenActivitys.Add(9);
|
| | | UpdateFunctionBtns();
|
| | | }
|
| | | break;
|
| | | case Operation.GiftPackage:
|
| | | break;
|
| | | case Operation.MultipRealmPoint:
|
| | | if (state == 0 && !alreadyOpenActivitys.Contains(8))
|
| | | {
|
| | | alreadyOpenActivitys.Add(8);
|
| | | UpdateFunctionBtns();
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private void OperationAdvanceEvent(Operation type)
|
| | | {
|
| | | if (type == Operation.FlashSale)
|
| | | {
|
| | | if (!alreadyOpenActivitys.Contains(4))
|
| | | if (OpenServerActivityCenter.Instance.IsActivityOpen(m_SortArray[i])
|
| | | && !alreadyOpenActivitys.Contains(m_SortArray[i]))
|
| | | {
|
| | | alreadyOpenActivitys.Add(4);
|
| | | UpdateFunctionBtns();
|
| | | alreadyOpenActivitys.Add(m_SortArray[i]);
|
| | | _update = true;
|
| | | }
|
| | | }
|
| | | if (_update)
|
| | | {
|
| | | UpdateFunctionBtns();
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | WindowCenter.Instance.windowAfterOpenEvent += WindowAfterOpenEvent;
|
| | | WindowCenter.Instance.windowAfterCloseEvent += windowAfterCloseEvent;
|
| | |
|
| | | ModelCenter.Instance.GetModel<OSGiftModel>().giftGetNotify = false;
|
| | | model.RefreshBuyShopLimitEvent += RefreshBuyShopLimitEvent;
|
| | |
|
| | | Display();
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public int GetRuneCountById(int _itemId)
|
| | | {
|
| | | var count = 0;
|
| | | foreach (var _rune in runePackData.Values)
|
| | | {
|
| | | if (_rune.id == _itemId)
|
| | | {
|
| | | count += 1;
|
| | | }
|
| | | }
|
| | | return count;
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | ///得到所有的解锁符印Id
|
| | | /// </summary>
|
| | |
| | | {
|
| | | SetRankStartPushInfo();
|
| | | SetRankEndPushInfo();
|
| | | RemovePushByActiveClose(PushInfoType.RankStart);
|
| | | RemovePushByActiveClose(PushInfoType.RankEnd);
|
| | | }
|
| | |
|
| | | private void SetRankStartPushInfo()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | private void RemovePushByActiveClose(PushInfoType type)
|
| | | {
|
| | | switch (type)
|
| | | {
|
| | | case PushInfoType.RankStart:
|
| | | for (int i = 0; i < rankTypelist.Count; i++)
|
| | | {
|
| | | int rankStartId = WholePeopleRankStart + rankTypelist[i];
|
| | | if (impactRank.IsActivityClose(rankTypelist[i]))
|
| | | {
|
| | | RemovePushInfo(rankStartId);
|
| | | }
|
| | | }
|
| | | break;
|
| | | case PushInfoType.RankEnd:
|
| | | for (int i = 0; i < rankTypelist.Count; i++)
|
| | | {
|
| | | int rankEndId = WholePeopleRankEnd + rankTypelist[i];
|
| | | if (impactRank.IsActivityClose(rankTypelist[i]))
|
| | | {
|
| | | RemovePushInfo(rankEndId);
|
| | | }
|
| | | }
|
| | | break;
|
| | | }
|
| | | }
|
| | |
|
| | | private void RemovePushByTime(PushInfoType type,int time)
|
| | | {
|
| | | int remainHour = time - TimeUtility.ServerNow.Hour;
|
| | |
| | | for (int i = 0; i < rankTypelist.Count; i++)
|
| | | {
|
| | | int rankStartId = WholePeopleRankStart + rankTypelist[i];
|
| | | if (impactRank.IsActivityClose(rankTypelist[i]))
|
| | | {
|
| | | RemovePushInfo(rankStartId);
|
| | | }
|
| | | else
|
| | | if (!impactRank.IsActivityClose(rankTypelist[i]))
|
| | | {
|
| | | int day = impactRank.GetOpenDay(rankTypelist[i]);
|
| | | if (day <= 0 && remainSecond <= 120)
|
| | |
| | | for (int i = 0; i < rankTypelist.Count; i++)
|
| | | {
|
| | | int rankEndId = WholePeopleRankEnd + rankTypelist[i];
|
| | | if (impactRank.IsActivityClose(rankTypelist[i]))
|
| | | {
|
| | | RemovePushInfo(rankEndId);
|
| | | }
|
| | | else
|
| | | if (!impactRank.IsActivityClose(rankTypelist[i]))
|
| | | {
|
| | | int day = impactRank.GetSurplusDay(rankTypelist[i]);
|
| | | if (day <= 1 && remainSecond <= 120)
|
| | |
| | | for (int i = 0; i < switchBtnLength; i++)
|
| | | {
|
| | | bool isOpen = MathUtility.GetBitValue(setting.OnoffBit, (ushort)i);
|
| | | DebugEx.Log("SetServerPushModel:" + i + "bool:" + isOpen);
|
| | | pushSetDict.Add(i, isOpen);
|
| | | }
|
| | | AnalysisFreeTime(setting.TimeStr);
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void RemoveActivityPushByKey(int dailyId, string pushKey)
|
| | | {
|
| | | if(pushAtcivityKeyDict[dailyId].Contains(pushKey))
|
| | | {
|
| | | SDKUtility.Instance.GeTui_RemoveLocalMessage(pushKey);
|
| | | }
|
| | | }
|
| | |
|
| | | public void AddActivityPush(int dailyId)
|
| | | {
|
| | | var config = ConfigManager.Instance.GetTemplate<DailyQuestConfig>(dailyId);
|
| | |
| | | SDKUtility.Instance.GeTui_SendLocalMessage(pushNotifylist[j]);
|
| | | }
|
| | | }
|
| | |
|
| | |
|
| | | public List<JsonData> GetPushJsonData(int dailyId)
|
| | | {
|
| | |
| | | _params["subtitle"] = "";// 副标题
|
| | | _params["content"] = content;// 具体内容
|
| | | _params["badge"] = -1;// 角标
|
| | |
|
| | | // 以下为决定应该多久后弹出此通知
|
| | | System.TimeSpan ts = System.DateTime.UtcNow - new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
|
| | | long ret = System.Convert.ToInt64(ts.TotalSeconds) + pushNotifyTimelist[i];// 表示3秒后
|
| | |
| | | float minuteOffset = (hourMinutes[i].hourBegin * 60 + hourMinutes[i].minuteBegin) - minutes;
|
| | | if (minuteOffset <= 2 && minuteOffset > 0)
|
| | | {
|
| | | RemoveActivityPush(dailyId);
|
| | | }
|
| | | else if (minuteOffset < 0 && minuteOffset >= -2)
|
| | | {
|
| | | AddActivityPush(dailyId);
|
| | | string key = StringUtility.Contact(dailyId, dayOfWeek, hourMinutes[i].hourBegin);
|
| | | RemoveActivityPushByKey(dailyId,key);
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | {
|
| | | if (model.myTeam.iamCaptainer)
|
| | | {
|
| | | if (model.myTeam.iamCaptainer)
|
| | | {
|
| | | model.RecordHeroAI();
|
| | | }
|
| | | GroupDungeonChallengeProcessor.Instance.GroupChallengeDungeon(model.myTeam.mission.mapId, model.myTeam.mission.mapEx, false);
|
| | | }
|
| | | else
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public bool autoHandupRecord = false;
|
| | | public int moveToNPCRecord = 0;
|
| | | public void RecordHeroAI()
|
| | | {
|
| | | autoHandupRecord = PlayerDatas.Instance.hero.aiHandler.IsAuto();
|
| | | moveToNPCRecord = MapTransferUtility.Instance.NpcID;
|
| | | }
|
| | |
|
| | | public void ClearHeroAIRecord()
|
| | | {
|
| | | autoHandupRecord = false;
|
| | | moveToNPCRecord = 0;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | float timer = 0f;
|
| | |
|
| | | bool alreadyAutoPrepare = false;
|
| | |
|
| | | bool autoHandupRecord = false;
|
| | | int moveToNPCRecord = 0;
|
| | | bool rejectManual = false;
|
| | |
|
| | | TeamModel model { get { return ModelCenter.Instance.GetModel<TeamModel>(); } }
|
| | |
| | | protected override void OnPreOpen()
|
| | | {
|
| | | rejectManual = false;
|
| | | autoHandupRecord = PlayerDatas.Instance.hero.aiHandler.IsAuto();
|
| | | moveToNPCRecord = MapTransferUtility.Instance.NpcID;
|
| | | if (!model.myTeam.iamCaptainer)
|
| | | {
|
| | | model.RecordHeroAI();
|
| | | }
|
| | |
|
| | | PlayerDatas.Instance.hero.Behaviour.StopHandupAI();
|
| | | MapTransferUtility.Instance.Clear();
|
| | |
| | | {
|
| | | if (rejectManual || model.teamPrepare.isError || model.teamPrepare.IsReject())
|
| | | {
|
| | | if (autoHandupRecord)
|
| | | if (model.autoHandupRecord)
|
| | | {
|
| | | if (PlayerDatas.Instance.hero != null)
|
| | | {
|
| | | PlayerDatas.Instance.hero.Behaviour.StartHandupAI();
|
| | | }
|
| | |
|
| | | autoHandupRecord = false;
|
| | | }
|
| | |
|
| | | if (moveToNPCRecord != 0)
|
| | | if (model.moveToNPCRecord != 0)
|
| | | {
|
| | | MapTransferUtility.Instance.MoveToNPC(moveToNPCRecord);
|
| | | moveToNPCRecord = 0;
|
| | | MapTransferUtility.Instance.MoveToNPC(model.moveToNPCRecord);
|
| | | }
|
| | | }
|
| | |
|
| | | model.ClearHeroAIRecord();
|
| | | model.memberPrepareStateChangeEvent -= ShowPrepareStates;
|
| | | }
|
| | |
|
| | |
| | |
|
| | | int Compare(int x, int y)
|
| | | {
|
| | | Treasure treasure_x;
|
| | | Treasure treasure_y;
|
| | | if (model.TryGetTreasure(x, out treasure_x) && model.TryGetTreasure(y, out treasure_y))
|
| | | {
|
| | | var stage_x = treasure_x.treasureStages[treasure_x.StageCount - 1];
|
| | | var stage_y = treasure_y.treasureStages[treasure_y.StageCount - 1];
|
| | | bool awaking_x = PlayerDatas.Instance.baseData.LV >= stage_x.limitLevel && !treasure_x.IsMaxStage();
|
| | | bool awaking_y = PlayerDatas.Instance.baseData.LV >= stage_y.limitLevel && !treasure_y.IsMaxStage();
|
| | | if (awaking_x != awaking_y)
|
| | | {
|
| | | return -awaking_x.CompareTo(awaking_y);
|
| | | }
|
| | | bool awoke_x = treasure_x.IsMaxStage();
|
| | | bool awoke_y = treasure_y.IsMaxStage();
|
| | | if (awoke_x != awoke_y)
|
| | | {
|
| | | return -awoke_x.CompareTo(awoke_y);
|
| | | }
|
| | | }
|
| | | //Treasure treasure_x;
|
| | | //Treasure treasure_y;
|
| | | //if (model.TryGetTreasure(x, out treasure_x) && model.TryGetTreasure(y, out treasure_y))
|
| | | //{
|
| | | // var stage_x = treasure_x.treasureStages[treasure_x.StageCount - 1];
|
| | | // var stage_y = treasure_y.treasureStages[treasure_y.StageCount - 1];
|
| | | // bool awaking_x = PlayerDatas.Instance.baseData.LV >= stage_x.limitLevel && !treasure_x.IsMaxStage();
|
| | | // bool awaking_y = PlayerDatas.Instance.baseData.LV >= stage_y.limitLevel && !treasure_y.IsMaxStage();
|
| | | // if (awaking_x != awaking_y)
|
| | | // {
|
| | | // return -awaking_x.CompareTo(awaking_y);
|
| | | // }
|
| | | // bool awoke_x = treasure_x.IsMaxStage();
|
| | | // bool awoke_y = treasure_y.IsMaxStage();
|
| | | // if (awoke_x != awoke_y)
|
| | | // {
|
| | | // return -awoke_x.CompareTo(awoke_y);
|
| | | // }
|
| | | //}
|
| | | return x.CompareTo(y);
|
| | | }
|
| | |
|
| | |
| | | using TableConfig;
|
| | | using UnityEngine;
|
| | |
|
| | | public class LimitedTimePackageItemClassModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk
|
| | | public class LimitedTimePackageItemClassModel : Model, IBeforePlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity
|
| | | {
|
| | | public Dictionary<int, int> DicBuyPackage = new Dictionary<int, int>();
|
| | | public event Action UpdateLimitedTimePackageItem;
|
| | | public event Action<int> onStateUpate;
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
|
| | | OpenServerActivityCenter.Instance.Register(7, this);
|
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
|
| | | }
|
| | |
|
| | | |
| | |
|
| | | public bool IsShowPanel = false;
|
| | |
|
| | | public bool IsOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return IsExpired();
|
| | | }
|
| | | }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return false;
|
| | | }
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | IsShowPanel = false;
|
| | |
| | | if (arg1 == Operation.GiftPackage)
|
| | | {
|
| | | IsShowTip();
|
| | | if (arg2 == 0 && onStateUpate != null)
|
| | | {
|
| | | onStateUpate(7);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OperationEndEvent(Operation arg1, int arg2)
|
| | | {
|
| | | if (arg1 == Operation.GiftPackage && arg2 == 0)
|
| | | {
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(7);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | {
|
| | | UpdateLimitedTimePackageItem();
|
| | | }
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(7);
|
| | | }
|
| | | }
|
| | | public void OpenFreePlat(string Title, float RMBNum, string OrderInfo)
|
| | | {
|
| | |
| | | using UnityEngine;
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class OSTimeLimitGiftModel : Model, IPlayerLoginOk, IBeforePlayerDataInitialize
|
| | | public class OSTimeLimitGiftModel : Model, IPlayerLoginOk, IBeforePlayerDataInitialize, IOpenServerActivity
|
| | | {
|
| | | Dictionary<int, List<StoreConfig>> m_OSTimeLimitGifts = new Dictionary<int, List<StoreConfig>>();
|
| | |
|
| | |
| | | public Redpoint redpoint { get; private set; }
|
| | |
|
| | | StoreModel m_StoreModel;
|
| | |
|
| | | public event Action<int> onStateUpate;
|
| | |
|
| | | StoreModel storeModel
|
| | | {
|
| | | get
|
| | | {
|
| | | return m_StoreModel ?? (m_StoreModel = ModelCenter.Instance.GetModel<StoreModel>());
|
| | | }
|
| | | }
|
| | |
|
| | | public bool IsOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return TimeUtility.CreateDays <= openDays && FuncOpen.Instance.IsFuncOpen(132);
|
| | | }
|
| | | }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return redpoint.state == RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | TimeUtility.OnCreateRoleTimeRefresh += OnCreateRoleTimeRefresh;
|
| | | storeModel.RefreshBuyShopLimitEvent += UpdateRedpoint;
|
| | | FuncOpen.Instance.OnFuncStateChangeEvent += OnFuncStateChangeEvent;
|
| | | OpenServerActivityCenter.Instance.Register(3, this);
|
| | | }
|
| | |
|
| | | public override void UnInit()
|
| | |
| | | if (_id == 132)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(3);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | var _specialIndex = _list.FindIndex((x) =>
|
| | | {
|
| | | var config = ConfigManager.Instance.GetTemplate<CTGConfig>(x);
|
| | | return config.PayType == 3;
|
| | | return config != null && config.PayType == 3;
|
| | | });
|
| | | m_SpecialRechargeBtn.gameObject.SetActive(_specialIndex != -1 && PlayerDatas.Instance.baseData.VIPLv >= GeneralConfig.Instance.supremeRechargeVipLv);
|
| | | }
|
| | |
| | | var _specialIndex = _list.FindIndex((x) =>
|
| | | {
|
| | | var config = ConfigManager.Instance.GetTemplate<CTGConfig>(x);
|
| | | return config.PayType == 3;
|
| | | return config != null && config.PayType == 3;
|
| | | });
|
| | | if (_specialIndex != -1)
|
| | | {
|
| | |
| | | var _specialIndex = list.FindIndex((x) =>
|
| | | {
|
| | | var config = ConfigManager.Instance.GetTemplate<CTGConfig>(x);
|
| | | return config.PayType == 3;
|
| | | return config != null && config.PayType == 3;
|
| | | });
|
| | | if (_specialIndex != -1)
|
| | | {
|
| | |
| | | var _specialIndex = list.FindIndex((x) =>
|
| | | {
|
| | | var config = ConfigManager.Instance.GetTemplate<CTGConfig>(x);
|
| | | return config.PayType == 3;
|
| | | return config != null && config.PayType == 3;
|
| | | });
|
| | | if (_specialIndex != -1)
|
| | | {
|
| | |
| | | using UnityEngine; |
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class ConsumeRebateModel : Model, IPlayerLoginOk, IBeforePlayerDataInitialize
|
| | | public class ConsumeRebateModel : Model, IPlayerLoginOk, IBeforePlayerDataInitialize, IOpenServerActivity
|
| | | {
|
| | | public event Action consumeRebateUpdateEvent;
|
| | | public event Action<int> onStateUpate;
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | PlayerDatas.Instance.PlayerDataRefreshInfoEvent += PlayerDataRefreshInfoEvent;
|
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
|
| | | GlobalTimeEvent.Instance.secondEvent += SecondEvent;
|
| | | OpenServerActivityCenter.Instance.Register(1, this);
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | public int costTotal { get; private set; }
|
| | |
|
| | | private uint consumeGotRecord { get; set; }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return consumeRebateRedpoint.state == RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | | int rebateOpenDayIndex = -1;
|
| | |
|
| | |
| | | if (type == Operation.ConsumeRebate && state == 0)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(1);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | if (type == Operation.ConsumeRebate && state == 0)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(1);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | using UnityEngine;
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class MultipleExpModel : Model, IPlayerLoginOk, IBeforePlayerDataInitialize
|
| | | public class MultipleExpModel : Model, IPlayerLoginOk, IBeforePlayerDataInitialize, IOpenServerActivity
|
| | | {
|
| | | private bool showTip = false;
|
| | | private bool todayRemind = false;
|
| | | public override void Init()
|
| | | {
|
| | | OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
|
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeUpdateEvent;
|
| | | WindowCenter.Instance.windowAfterOpenEvent += WindowAfterOpenEvent;
|
| | | StageManager.Instance.onStageLoadFinish += OnStageLoadFinish;
|
| | |
|
| | | OpenServerActivityCenter.Instance.Register(5, this);
|
| | | }
|
| | |
|
| | | private void OnStageLoadFinish()
|
| | |
| | | public override void UnInit()
|
| | | {
|
| | | OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent;
|
| | | OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
|
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeUpdateEvent;
|
| | | WindowCenter.Instance.windowAfterOpenEvent -= WindowAfterOpenEvent;
|
| | | }
|
| | |
| | | if (type == Operation.MultipleExp && state == 1)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(5);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | private void OperationEndEvent(Operation type, int state)
|
| | | {
|
| | | if (type == Operation.MultipleExp && state == 1)
|
| | | {
|
| | | UpdateRedpoint();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(5);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | |
| | |
|
| | | public Redpoint multipleExpRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20905);
|
| | |
|
| | | public event Action<int> onStateUpate;
|
| | |
|
| | | public bool IsOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return Open();
|
| | | }
|
| | | }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return multipleExpRedpoint.state == RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | | public void SetDayRemind()
|
| | | {
|
| | | if (multipleExpRedpoint.state == RedPointState.Simple)
|
| | |
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class MultipleRealmPointModel : Model,IBeforePlayerDataInitialize,IAfterPlayerDataInitialize,IPlayerLoginOk
|
| | | public class MultipleRealmPointModel : Model, IBeforePlayerDataInitialize, IAfterPlayerDataInitialize, IPlayerLoginOk, IOpenServerActivity
|
| | | {
|
| | | public Redpoint multipleRed = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20908);
|
| | | public string LocalRecord_Key = "MultipleRealmRecord";
|
| | | bool isNewDay = false;
|
| | |
|
| | | public event Action<int> onStateUpate;
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | | OpenServerActivityCenter.Instance.Register(8, this);
|
| | |
|
| | | }
|
| | |
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public bool priorityOpen
|
| | | {
|
| | | get
|
| | | {
|
| | | return multipleRed.state == RedPointState.Simple;
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshOperationClose(Operation type)
|
| | | {
|
| | | if (type != Operation.MultipRealmPoint) return;
|
| | | CheckShowRed();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(8);
|
| | | }
|
| | | }
|
| | |
|
| | | private void RefreshOperationState(Operation type, int arg2)
|
| | | {
|
| | | if (type != Operation.MultipRealmPoint) return;
|
| | | CheckShowRed();
|
| | | if (onStateUpate != null)
|
| | | {
|
| | | onStateUpate(8);
|
| | | }
|
| | | }
|
| | |
|
| | | public void CheckShowRed(bool isClick = false)
|
| | |
| | | [SerializeField] Text remainTimeText;
|
| | | [SerializeField] Button gotoBtn;
|
| | | [SerializeField] Image multipleRealmImg;
|
| | | [SerializeField] Image multipleRealmImg2;
|
| | | [SerializeField] Text activeRuleText;
|
| | | OperationBase operation;
|
| | | MultipleRealmPointModel multipleRealm { get { return ModelCenter.Instance.GetModel<MultipleRealmPointModel>(); } }
|
| | |
| | | if (GeneralConfig.Instance.multipleRealmImgDict.ContainsKey(multipleRealm))
|
| | | {
|
| | | multipleRealmImg.SetSprite(GeneralConfig.Instance.multipleRealmImgDict[multipleRealm]);
|
| | | multipleRealmImg2.SetSprite(GeneralConfig.Instance.multipleRealmImgDict[multipleRealm]);
|
| | | }
|
| | | activeRuleText.text = Language.Get("MultipleXXDRemind", Language.Get(StringUtility.Contact("Num_CHS_",multipleRealm)));
|
| | | }
|
| | |
| | | break;
|
| | |
|
| | | case JumpUIType.OSTimeLimitGift:
|
| | | if (!OpenServerActivityCenter.Instance.IsTimeLimitGiftOpen())
|
| | | if (!OpenServerActivityCenter.Instance.IsActivityOpen(3))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("ActiveOutTime");
|
| | | return;
|