| System/OpenServerActivity/FlashRushToBuyModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/OpenServerActivity/FlashSaleItemCell.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/OpenServerActivity/ImpactRankModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/OpenServerActivity/OpenServerActivityNotifyModel.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/OpenServerActivity/OpenServerActivityWin.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| System/WindowBase/ModelCenter.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
System/OpenServerActivity/FlashRushToBuyModel.cs
@@ -15,8 +15,7 @@ OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent; OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent; OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent; TimeMgr.Instance.OnDayEvent += OnDayEvent; OpenServerActivityCenter.Instance.Register(4, this); OpenServerActivityCenter.Instance.Register((int)OpenServerActivityCenter.OSActivityType.FlashRushToBuy, this); } public void OnBeforePlayerDataInitialize() @@ -25,10 +24,6 @@ public void OnPlayerLoginOk() { if(!WindowCenter.Instance.IsOpen<OpenServerActivityNotifyWin>()) { WindowCenter.Instance.Open<OpenServerActivityNotifyWin>(); } //UpdateRedpoint(); } @@ -37,7 +32,6 @@ OperationTimeHepler.Instance.operationStartEvent -= OperationStartEvent; OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent; OperationTimeHepler.Instance.operationAdvanceEvent -= OperationAdvanceEvent; TimeMgr.Instance.OnDayEvent -= OnDayEvent; } public bool IsOpen @@ -307,7 +301,7 @@ UpdateRedpoint(); if (onStateUpate != null) { onStateUpate(4); onStateUpate((int)OpenServerActivityCenter.OSActivityType.FlashRushToBuy); } } } @@ -318,7 +312,7 @@ { if (onStateUpate != null) { onStateUpate(4); onStateUpate((int)OpenServerActivityCenter.OSActivityType.FlashRushToBuy); } } } @@ -330,7 +324,7 @@ UpdateRedpoint(); if (onStateUpate != null) { onStateUpate(4); onStateUpate((int)OpenServerActivityCenter.OSActivityType.FlashRushToBuy); } } } @@ -344,126 +338,18 @@ { if (flashSaleRedpoint.state == RedPointState.Simple) { DayRemind.Instance.SetDayRemind(DayRemind.FLASHSALE_REDPOINT, true); // DayRemind.Instance.SetDayRemind(DayRemind.FLASHSALE_REDPOINT, true); UpdateRedpoint(); } } public void SendBuyFlashSale(OperationFlashSale.FlashSaleGift gift) { OperationBase operationBase; if (OperationTimeHepler.Instance.TryGetOperationTime(Operation.FlashSale, out operationBase)) { OperationFlashSale operation = operationBase as OperationFlashSale; if (operation.InAdvanceTime(TimeUtility.ServerNow)) { var seconds = operation.GetSecondsBeforeStart(TimeUtility.ServerNow); SysNotifyMgr.Instance.ShowTip("FlashSaleAdvanceLimit", TimeUtility.SecondsToHMS(seconds)); return; } if (!operation.InTime(TimeUtility.ServerNow)) { SysNotifyMgr.Instance.ShowTip("ActiveOutTime"); return; } if (!gift.Equals(default(OperationFlashSale.FlashSaleGift))) { var buyInfo = storeModel.GetBuyShopLimit((uint)gift.id); var buyCount = 0; if (buyInfo != null) { buyCount = buyInfo.BuyCnt; } if (buyCount >= gift.limitNum) { return; } if (UIHelper.GetMoneyCnt(gift.moneyType) < (ulong)gift.moneyNumber) { switch (gift.moneyType) { case 1: if (VersionConfig.Get().isBanShu) { SysNotifyMgr.Instance.ShowTip("GoldErr"); return; } WindowCenter.Instance.Open<RechargeTipWin>(); break; default: SysNotifyMgr.Instance.ShowTip("LackMoney", gift.moneyType); break; } return; } if (gift.moneyType == 1) { ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("OSTimeLimitGiftConfirm", gift.moneyNumber), (bool isOk) => { if (isOk) { C0803_tagCBuyItemList pak = new C0803_tagCBuyItemList(); pak.NPCID = 0; pak.BuyItemIndex = (ushort)gift.id; pak.BuyCount = 1; GameNetSystem.Instance.SendInfo(pak); } }); } else { C0803_tagCBuyItemList pak = new C0803_tagCBuyItemList(); pak.NPCID = 0; pak.BuyItemIndex = (ushort)gift.id; pak.BuyCount = 1; GameNetSystem.Instance.SendInfo(pak); } } } else { SysNotifyMgr.Instance.ShowTip("ActiveOutTime"); } } public bool HasNotBuyGift() { OperationBase operationBase; OperationTimeHepler.Instance.TryGetOperationTime(Operation.FlashSale, out operationBase); if (operationBase != null && operationBase.InTime(TimeUtility.ServerNow)) { OperationFlashSale operation = operationBase as OperationFlashSale; OperationFlashSale.FlashSale flashShop; if (operation.TryGetFlashSale(TimeUtility.ServerNow, out flashShop)) { for (int i = 0; i < flashShop.gifts.Length; i++) { var gift = flashShop.gifts[i]; var buyInfo = storeModel.GetBuyShopLimit((uint)gift.id); if (buyInfo == null || buyInfo.BuyCnt < gift.limitNum) { return true; } } } } return false; } public Redpoint flashSaleRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20904); public Redpoint flashSaleRedpoint = new Redpoint(MainRedDot.REDPOINT_OPENSERVER, 20914); public event Action<int> onStateUpate; private void UpdateRedpoint() { flashSaleRedpoint.state = RedPointState.None; if (IsOpen && HasNotBuyGift() && !DayRemind.Instance.GetDayRemind(DayRemind.FLASHSALE_REDPOINT)) { flashSaleRedpoint.state = RedPointState.Simple; } } public enum FlashRushToBuySate System/OpenServerActivity/FlashSaleItemCell.cs
@@ -26,7 +26,7 @@ ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } } OperationFlashRushToBuy.FlashSaleItem saleItem; int buyState = -1; private void OnEnable() { battleModel.RefreshGameRecInfoAct += UpdateFullServerBuy; @@ -95,7 +95,7 @@ flashSaleBtn.RemoveAllListeners(); var operation = rushToBuyModel.GetOperationFlashRushToBuy(); int seconds = 0; int buyState = operation.GetBuyTimeState(TimeUtility.ServerNow,rushToBuyModel.presentFlashShop.dayIndex, buyState = operation.GetBuyTimeState(TimeUtility.ServerNow,rushToBuyModel.presentFlashShop.dayIndex, rushToBuyModel.presentFlashShop.timeIndex,out seconds); switch(buyState) @@ -147,32 +147,39 @@ /// <returns></returns> private int GetSellSate(out int fullRemainNum) { fullRemainNum = 0; var buyInfo = storeModel.GetBuyShopLimit((uint)saleItem.shopId); var buyCount = 0; var fullServerInfo = rushToBuyModel.GetFullServerInfo(); fullRemainNum = 0; if (fullServerInfo != null && fullServerInfo.Value1 == saleItem.shopId) if(buyState != -1) { fullRemainNum = saleItem.fullServerLimitNum - fullServerInfo.Value2; if (fullServerInfo != null && fullServerInfo.Value1 == saleItem.shopId) { fullRemainNum = saleItem.fullServerLimitNum - fullServerInfo.Value2; } else { fullRemainNum = saleItem.fullServerLimitNum; } if (buyInfo != null) { buyCount = buyInfo.BuyCnt; } if (buyCount >= saleItem.limitNum) { return 1; } if (fullRemainNum <= 0) { return 2; } } else { fullRemainNum = saleItem.fullServerLimitNum; } if (buyInfo != null) { buyCount = buyInfo.BuyCnt; } if(buyCount >= saleItem.limitNum) { return 1; } if (fullRemainNum <= 0) { return 2; } return 0; } } System/OpenServerActivity/ImpactRankModel.cs
@@ -786,6 +786,8 @@ FairyLeagueNotice, [Header("骑宠争夺预告")] FairyGrabBossNotice, [Header("限时抢购")] FlashRushToBuy, } } System/OpenServerActivity/OpenServerActivityNotifyModel.cs
@@ -21,6 +21,7 @@ OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent; OperationTimeHepler.Instance.operationTimeUpdateEvent -= OperationTimeEvent; OperationTimeHepler.Instance.operationServerCloseEvent -= OperationServerCloseEvent; NewBieCenter.Instance.guideCompletedEvent -= GuideCompletedEvent; } public void OnPlayerLoginOk() @@ -29,8 +30,13 @@ OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent; OperationTimeHepler.Instance.operationTimeUpdateEvent += OperationTimeEvent; OperationTimeHepler.Instance.operationServerCloseEvent += OperationServerCloseEvent; NewBieCenter.Instance.guideCompletedEvent += GuideCompletedEvent; GlobalTimeEvent.Instance.minuteEvent += UpdateMinute; SetFlashRushToBuyNotify(); if (!WindowCenter.Instance.IsOpen<OpenServerActivityNotifyWin>()) { WindowCenter.Instance.Open<OpenServerActivityNotifyWin>(); } } public override void UnInit() @@ -147,12 +153,20 @@ break; } } private void GuideCompletedEvent(int id) { SetFlashRushToBuyNotify(); } #region 限时抢购 public event Action UpdateFlashRushToBuyEvent; FlashRushToBuyModel rushToBuyModel { get { return ModelCenter.Instance.GetModel<FlashRushToBuyModel>(); } } public List<OperationFlashRushToBuy.FlashSaleShop> flashSaleShops = new List<OperationFlashRushToBuy.FlashSaleShop>(); public void SetFlashRushToBuyNotify() { if (NewBieCenter.Instance.inGuiding) return; OperationFlashRushToBuy.FlashSaleShop saleShop = null; bool isPush = rushToBuyModel.CheckIsPush(out saleShop); if(isPush && !flashSaleShops.Contains(saleShop)) System/OpenServerActivity/OpenServerActivityWin.cs
@@ -574,6 +574,16 @@ WindowCenter.Instance.Open<FairyGrabBossNoticeWin>(true); } break; case 14: if (windowState == WindowState.Opened) { WindowCenter.Instance.OpenWithoutAnimation<FlashRushToBuyWin>(); } else { WindowCenter.Instance.Open<FlashRushToBuyWin>(true); } break; } } @@ -609,6 +619,7 @@ WindowCenter.Instance.CloseImmediately<VipInvestWin>(); WindowCenter.Instance.CloseImmediately<FairyLeagueNoticeWin>(); WindowCenter.Instance.CloseImmediately<FairyGrabBossNoticeWin>(); WindowCenter.Instance.CloseImmediately<FlashRushToBuyWin>(); } private int Compare(int order_x, int order_y) System/WindowBase/ModelCenter.cs
@@ -197,6 +197,7 @@ RegisterModel<AwardExchangeModel>(); RegisterModel<WheelOfFortuneModel>(); RegisterModel<FlashRushToBuyModel>(); RegisterModel<OpenServerActivityNotifyModel>(); inited = true; }