private void RecvWingComposeRes(short state, WingComposeRes msg = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } WingManager.wingInfoDict.set_Item(msg.wingInfo.cfgId, msg.wingInfo); WingUpgradeUI wingUpgradeUI = UIManagerControl.Instance.GetUIIfExist("WingUpgradeUI") as WingUpgradeUI; if (wingUpgradeUI != null) { wingUpgradeUI.PlayActiveSuccess(); wingUpgradeUI.Refresh(); } WingSelectUI wingSelectUI = UIManagerControl.Instance.GetUIIfExist("WingSelectUI") as WingSelectUI; if (wingSelectUI != null) { wingSelectUI.PlayActiveSuccess(msg.wingInfo.cfgId); } WingUI wingUI = UIManagerControl.Instance.GetUIIfExist("WingUI") as WingUI; if (wingUI != null) { wingUI.CheckBadge(); } ActorUI actorUI = UIManagerControl.Instance.GetUIIfExist("ActorUI") as ActorUI; if (actorUI != null) { actorUI.CheckBadge(); } }
public static bool IsWingExpire(int wingId) { if (!WingSelectUI.IsTimeLimitWing(wingId)) { return(false); } int num = WingSelectUI.ToTimeStamp(TimeManager.Instance.PreciseServerTime); return(num >= WingManager.wingInfoDict.get_Item(wingId).overdueUtc); }
public static string GetWingRemainTime(int wingId) { int num = WingSelectUI.ToTimeStamp(TimeManager.Instance.PreciseServerTime); int num2 = Mathf.Max(WingManager.wingInfoDict.get_Item(wingId).overdueUtc - num, 0); int num3 = num2 / 3600; int num4 = num2 % 3600 / 60; return(string.Concat(new object[] { num3, "小时", num4, "分后消失" })); }
public void RefreshWing(wings dataWings) { this.wingId = dataWings.id; base.get_transform().set_name(dataWings.id.ToString()); this.ResetAll(); this.PlayCanActiveSpine(); wings wingInfo = WingManager.GetWingInfo(this.wingId); this.m_lblWingName.set_text(TextColorMgr.GetColorByQuality(wingInfo.name, wingInfo.color)); ResourceManager.SetSprite(this.m_spWingIcon, GameDataUtils.GetIcon(wingInfo.icon)); if (WingManager.GetWingLv(this.wingId) == 0) { ImageColorMgr.SetImageColor(this.m_spWingIcon, true); int key = wingInfo.activation.get_Item(0).key; int value = wingInfo.activation.get_Item(0).value; long num = BackpackManager.Instance.OnGetGoodCount(key); int icon = DataReader <Items> .Get(key).icon; ResourceManager.SetSprite(this.m_spimgIcon, GameDataUtils.GetItemIcon(key)); this.m_spimgIcon.SetNativeSize(); this.m_activeRequire.get_gameObject().SetActive(true); this.m_lblProgress.set_text(num + "/" + value); float num2 = Mathf.Clamp01((float)num / (float)value); this.m_imgProgress.set_sizeDelta(new Vector2(180f * num2, 18.9f)); if (WingSelectUI.IsTimeLimitWing(this.wingId)) { this.m_imgTimeLimit.get_gameObject().SetActive(true); } } else { ImageColorMgr.SetImageColor(this.m_spBackground, false); ImageColorMgr.SetImageColor(this.m_spWingIcon, false); if (this.wingId == EntityWorld.Instance.EntSelf.Decorations.wingId) { this.m_imgHighlight.get_gameObject().SetActive(true); } if (WingSelectUI.IsTimeLimitWing(this.wingId)) { this.m_imgTimeLimit.get_gameObject().SetActive(true); this.m_txtTimeLimit.get_gameObject().SetActive(true); this.m_txtTimeLimit.set_text(WingSelectUI.GetWingRemainTime(this.wingId)); } } }
private void SortWingList() { this.m_listDataWings = WingManager.GetSelectWingInfos(); this.m_listDataWings.Sort(delegate(wings a, wings b) { int wingLv = WingManager.GetWingLv(a.id); int wingLv2 = WingManager.GetWingLv(b.id); if (wingLv != wingLv2) { return(-wingLv.CompareTo(wingLv2)); } bool flag = WingSelectUI.IsTimeLimitWing(a.id); bool flag2 = WingSelectUI.IsTimeLimitWing(b.id); if (flag != flag2) { return(-flag.CompareTo(flag2)); } return(a.id.CompareTo(b.id)); }); }
protected void OnEquipWing(int wingId, int wingLv, bool isHidden) { WingUI.wingIdLast = wingId; WingUI wingUI = UIManagerControl.Instance.GetUIIfExist("WingUI") as WingUI; if (wingUI != null) { wingUI.Refresh(); } WingUpgradeUI wingUpgradeUI = UIManagerControl.Instance.GetUIIfExist("WingUpgradeUI") as WingUpgradeUI; if (wingUpgradeUI != null) { wingUpgradeUI.Refresh(); } WingSelectUI wingSelectUI = UIManagerControl.Instance.GetUIIfExist("WingSelectUI") as WingSelectUI; if (wingSelectUI != null) { wingSelectUI.RefreshWings(); } }
private void OnWingInfoChangeNty(short state, WingInfoChangeNty msg = null) { if (state != 0) { StateManager.Instance.StateShow(state, 0); return; } int cfgId = msg.wingInfo.cfgId; WingManager.wingInfoDict.set_Item(cfgId, msg.wingInfo); if (WingManager.wingInfoDict.get_Item(cfgId).overdueUtc == -1) { WingManager.wingInfoDict.Remove(cfgId); wings wingInfo = WingManager.GetWingInfo(cfgId); string text = string.Format(GameDataUtils.GetChineseContent(237031, false), wingInfo.name); UIManagerControl.Instance.ShowToastText(text, 2f, 2f); } WingSelectUI wingSelectUI = UIManagerControl.Instance.GetUIIfExist("WingSelectUI") as WingSelectUI; if (wingSelectUI != null) { wingSelectUI.RefreshWings(); } }
protected override void ReleaseSelf(bool destroy) { WingSelectUI.Instance = null; base.ReleaseSelf(true); }
private void Awake() { WingSelectUI.Instance = this; base.AwakeBase(BindingContext.BindingContextMode.MonoBinding, false); }