private void OnVideoDelete(CUIEvent cuiEvent) { int srcWidgetIndexInBelongedList = cuiEvent.m_srcWidgetIndexInBelongedList; stUIEventParams par = new stUIEventParams { tag = srcWidgetIndexInBelongedList }; Singleton <CUIManager> .instance.OpenMessageBoxWithCancel(Singleton <CTextManager> .instance.GetText("OB_Desc_7"), enUIEventID.OB_Video_Delete_Confirm, enUIEventID.None, par, false); }
private void OnJumpToMishu(CUIEvent uiEvent) { Singleton <CUIManager> .GetInstance().CloseForm(CSymbolMakeController.s_symbolTransformPath); stUIEventParams par = default(stUIEventParams); par.tag = 3; Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Task_OpenForm, par); }
public static void SetPveHeroItemData(CUIFormScript formScript, GameObject listItem, IHeroData data) { if (listItem == null || data == null) { return; } bool bPlayerOwn = data.bPlayerOwn; Transform transform = listItem.transform; Transform transform2 = transform.Find("heroProficiencyImg"); Transform transform3 = transform.Find("heroProficiencyBgImg"); CUICommonSystem.SetHeroProficiencyIconImage(formScript, transform2.gameObject, (int)data.proficiencyLV); CUICommonSystem.SetHeroProficiencyBgImage(formScript, transform3.gameObject, (int)data.proficiencyLV, false); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null) { transform3.GetComponent <Image>().set_color(masterRoleInfo.IsHaveHero(data.cfgID, true) ? Color.white : CUIUtility.s_Color_GrayShader); transform2.GetComponent <Image>().set_color(masterRoleInfo.IsHaveHero(data.cfgID, true) ? Color.white : CUIUtility.s_Color_GrayShader); } bool flag = false; bool flag2 = false; if (masterRoleInfo != null) { flag = masterRoleInfo.IsFreeHero(data.cfgID); flag2 = masterRoleInfo.IsCreditFreeHero(data.cfgID); bool flag3 = masterRoleInfo.IsValidExperienceHero(data.cfgID); CUICommonSystem.SetHeroItemImage(formScript, listItem, masterRoleInfo.GetHeroSkinPic(data.cfgID), enHeroHeadType.enBust, !bPlayerOwn && !flag && !flag3, true); } GameObject gameObject = transform.Find("profession").gameObject; CUICommonSystem.SetHeroJob(formScript, gameObject, (enHeroJobType)data.heroType); Text component = transform.Find("heroNameText").GetComponent <Text>(); component.set_text(data.heroName); Transform transform4 = transform.Find("TxtFree"); Transform transform5 = transform.Find("TxtCreditFree"); if (transform4 != null) { transform4.gameObject.CustomSetActive(flag && !flag2); } if (transform5 != null) { transform5.gameObject.CustomSetActive(flag2); } GameObject gameObject2 = transform.Find("imgExperienceMark").gameObject; gameObject2.CustomSetActive(data.IsValidExperienceHero()); CUIEventScript component2 = listItem.GetComponent <CUIEventScript>(); stUIEventParams eventParams = default(stUIEventParams); eventParams.openHeroFormPar.heroId = data.cfgID; eventParams.openHeroFormPar.openSrc = enHeroFormOpenSrc.HeroListClick; component2.SetUIEvent(enUIEventType.Click, enUIEventID.HeroInfo_OpenForm, eventParams); }
private void On_IntimacyRela_Delete_Relation(CUIEvent uievent) { stUIEventParams par = default(stUIEventParams); par.commonUInt64Param1 = uievent.m_eventParams.commonUInt64Param1; par.tagUInt = uievent.m_eventParams.tagUInt; string text = Singleton <CTextManager> .instance.GetText("Delete_Relation_Tips"); Singleton <CUIManager> .instance.OpenMessageBoxWithCancel(text, enUIEventID.IntimacyRela_Delete_Relation_OK, enUIEventID.None, par, false); }
public void OnFactoryProductClick(CUIEvent uiEvent) { ListView <CMallFactoryShopController.ShopProduct> products = Singleton <CMallFactoryShopController> .GetInstance().GetProducts(); if (products == null) { stUIEventParams par = default(stUIEventParams); par.tag = 1; Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mall_Open_Factory_Shop_Tab, par); return; } if (uiEvent.m_eventParams.tag < 0 || uiEvent.m_eventParams.tag >= products.Count) { Singleton <CUIManager> .GetInstance().OpenMessageBox("internal error: out of index range.", false); return; } CMallFactoryShopController.ShopProduct shopProduct = products[uiEvent.m_eventParams.tag]; if (!shopProduct.CanBuy()) { return; } if (shopProduct.Type == COM_ITEM_TYPE.COM_OBJTYPE_HERO || shopProduct.Type == COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN) { CUIEvent cUIEvent = new CUIEvent(); cUIEvent.m_eventID = enUIEventID.Mall_Boutique_Factory_Product_Confirm_Buy; cUIEvent.m_eventParams.commonUInt64Param1 = (ulong)shopProduct.Key; cUIEvent.m_eventParams.commonUInt32Param1 = 1u; Singleton <CMallFactoryShopController> .GetInstance().BuyShopProduct(shopProduct, 1u, false, cUIEvent); } else { CUseableContainer useableContainer = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM); CUseable useableByBaseID = useableContainer.GetUseableByBaseID(shopProduct.Type, shopProduct.ID); uint num = 0u; if (shopProduct.LimitCount > 0u) { num = shopProduct.LimitCount - shopProduct.BoughtCount; } if (useableByBaseID != null) { uint num2 = (uint)(useableByBaseID.m_stackMax - useableByBaseID.m_stackCount); if (num2 < num || num == 0u) { num = num2; } } CUIEvent cUIEvent2 = new CUIEvent(); cUIEvent2.m_eventID = enUIEventID.Mall_Boutique_Factory_Product_Confirm_Buy; cUIEvent2.m_eventParams.commonUInt64Param1 = (ulong)shopProduct.Key; BuyPickDialog.Show(shopProduct.Type, shopProduct.ID, shopProduct.CoinType, shopProduct.RealDiscount, num, new BuyPickDialog.OnConfirmBuyDelegate(Singleton <CMallFactoryShopController> .GetInstance().BuyShopProduct), shopProduct, null, cUIEvent2); } }
public void OnFactoryProductClick(CUIEvent uiEvent) { ListView <CMallFactoryShopController.ShopProduct> products = Singleton <CMallFactoryShopController> .GetInstance().GetProducts(); if (products == null) { stUIEventParams par = new stUIEventParams { tag = 1 }; Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.Mall_Open_Factory_Shop_Tab, par); } else if ((uiEvent.m_eventParams.tag < 0) || (uiEvent.m_eventParams.tag >= products.Count)) { Singleton <CUIManager> .GetInstance().OpenMessageBox("internal error: out of index range.", false); } else { CMallFactoryShopController.ShopProduct shopProduct = products[uiEvent.m_eventParams.tag]; if (shopProduct.CanBuy()) { if ((shopProduct.Type == COM_ITEM_TYPE.COM_OBJTYPE_HERO) || (shopProduct.Type == COM_ITEM_TYPE.COM_OBJTYPE_HEROSKIN)) { CUIEvent event2 = new CUIEvent { m_eventID = enUIEventID.Mall_Boutique_Factory_Product_Confirm_Buy }; event2.m_eventParams.commonUInt64Param1 = shopProduct.Key; event2.m_eventParams.commonUInt32Param1 = 1; Singleton <CMallFactoryShopController> .GetInstance().BuyShopProduct(shopProduct, 1, false, event2); } else { CUseable useableByBaseID = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM).GetUseableByBaseID(shopProduct.Type, shopProduct.ID); uint maxCount = 0; if (shopProduct.LimitCount > 0) { maxCount = shopProduct.LimitCount - shopProduct.BoughtCount; } if (useableByBaseID != null) { uint num2 = (uint)(useableByBaseID.m_stackMax - useableByBaseID.m_stackCount); if ((num2 < maxCount) || (maxCount == 0)) { maxCount = num2; } } CUIEvent uieventPars = new CUIEvent { m_eventID = enUIEventID.Mall_Boutique_Factory_Product_Confirm_Buy }; uieventPars.m_eventParams.commonUInt64Param1 = shopProduct.Key; BuyPickDialog.Show(shopProduct.Type, shopProduct.ID, shopProduct.CoinType, shopProduct.RealDiscount, maxCount, new BuyPickDialog.OnConfirmBuyDelegate(Singleton <CMallFactoryShopController> .GetInstance().BuyShopProduct), shopProduct, null, uieventPars); } } } }
private void SetAchievementAwardTipsEvent(CUIEventScript eventScript, CUseable useable) { stUIEventParams eventParams = new stUIEventParams { iconUseable = useable, tag = 0 }; eventScript.SetUIEvent(enUIEventType.Down, enUIEventID.Tips_ItemInfoOpen, eventParams); eventScript.SetUIEvent(enUIEventType.HoldEnd, enUIEventID.Tips_ItemInfoClose, eventParams); eventScript.SetUIEvent(enUIEventType.Click, enUIEventID.Tips_ItemInfoClose, eventParams); eventScript.SetUIEvent(enUIEventType.DragEnd, enUIEventID.Tips_ItemInfoClose, eventParams); }
private void OnBuyTiketClick(CUIEvent uiEvt) { CUIEvent uieventPars = new CUIEvent(); stUIEventParams @params = new stUIEventParams { tagUInt = this.m_selectMapRes.dwConsumPayItemID, tag = this.m_selectMapRes.bCoinType }; uieventPars.m_srcFormScript = uiEvt.m_srcFormScript; uieventPars.m_srcWidget = uiEvt.m_srcWidget; uieventPars.m_eventParams = @params; BuyPickDialog.Show(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, @params.tagUInt, (RES_SHOPBUY_COINTYPE)@params.tag, 100, 0x63, null, null, new BuyPickDialog.OnConfirmBuyCommonDelegate(this.OnBuyPickDialogConfirm), uieventPars); }
private void OnShowGiveFriendSkin(uint heroId, uint skinId, uint price) { ResHeroSkin heroSkin = CSkinInfo.GetHeroSkin(heroId, skinId); if (heroSkin == null) { return; } CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(string.Format("{0}{1}", "UGUI/Form/System/", "Mall/Form_GiveHeroSkin_3D.prefab"), false, true); Text component = cUIFormScript.transform.Find("Panel/skinNameText").GetComponent <Text>(); component.set_text(heroSkin.szSkinName); GameObject gameObject = cUIFormScript.transform.Find("Panel/Panel_Prop/List_Prop").gameObject; CSkinInfo.GetHeroSkinProp(heroId, skinId, ref CHeroInfoSystem2.s_propArr, ref CHeroInfoSystem2.s_propPctArr, ref CHeroInfoSystem2.s_propImgArr); CUICommonSystem.SetListProp(gameObject, ref CHeroInfoSystem2.s_propArr, ref CHeroInfoSystem2.s_propPctArr); Text component2 = cUIFormScript.transform.Find("Panel/pricePanel/priceText").GetComponent <Text>(); component2.set_text(price.ToString()); CUIEventScript component3 = cUIFormScript.transform.Find("Panel/BtnGroup/buyButton").gameObject.GetComponent <CUIEventScript>(); stUIEventParams eventParams = default(stUIEventParams); eventParams.heroSkinParam.heroId = heroId; eventParams.heroSkinParam.skinId = skinId; eventParams.heroSkinParam.isCanCharge = true; eventParams.commonUInt64Param1 = this._curFriendUid; eventParams.commonBool = this._curFriendIsSns; eventParams.commonUInt32Param1 = this._curWorldId; component3.SetUIEvent(enUIEventType.Click, enUIEventID.HeroSkin_OpenBuyHeroSkinForFriend, eventParams); CUI3DImageScript component4 = cUIFormScript.transform.Find("Panel/3DImage").gameObject.GetComponent <CUI3DImageScript>(); ObjNameData heroPrefabPath = CUICommonSystem.GetHeroPrefabPath(heroId, (int)skinId, true); GameObject gameObject2 = component4.AddGameObject(heroPrefabPath.ObjectName, false, false); if (gameObject2 != null) { if (heroPrefabPath.ActorInfo != null) { gameObject2.transform.localScale = new Vector3(heroPrefabPath.ActorInfo.LobbyScale, heroPrefabPath.ActorInfo.LobbyScale, heroPrefabPath.ActorInfo.LobbyScale); } DynamicShadow.EnableDynamicShow(component4.gameObject, true); CHeroAnimaSystem instance = Singleton <CHeroAnimaSystem> .GetInstance(); instance.Set3DModel(gameObject2); instance.InitAnimatList(); instance.InitAnimatSoundList(heroId, skinId); instance.OnModePlayAnima("Come"); } }
public void RefreshBuyDianQuanPanel() { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_buyDianQuanFormPath); if (form != null) { DatabinTable <ResCouponsBuyInfo, uint> androidDianQuanBuyInfo = null; androidDianQuanBuyInfo = GameDataMgr.androidDianQuanBuyInfo; int index = 0; this.dianQuanBuyInfoList.Clear(); androidDianQuanBuyInfo.Accept(x => this.dianQuanBuyInfoList.Add(x)); this.SortDianQuanInfoList(); CUIListScript component = form.transform.Find("pnlBg/pnlBody/List").GetComponent <CUIListScript>(); component.SetElementAmount(this.dianQuanBuyInfoList.Count); for (index = 0; index < this.dianQuanBuyInfoList.Count; index++) { ResCouponsBuyInfo info = this.dianQuanBuyInfoList[index]; CUIListElementScript elemenet = component.GetElemenet(index); Image image = elemenet.transform.Find("imgIcon").GetComponent <Image>(); string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_Purchase_Dir, StringHelper.UTF8BytesToString(ref info.szImgPath)); image.SetSprite(prefabPath, form, true, false, false); elemenet.transform.Find("diamondCntText").GetComponent <Text>().text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Pay_DianQuan_Cnt"), info.dwBuyCount); GameObject gameObject = elemenet.transform.Find("buyPanel/buyBtn").gameObject; gameObject.transform.Find("Text").GetComponent <Text>().text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Pay_DianQuan_Price"), info.dwBuyPrice); GameObject obj3 = elemenet.transform.Find("additionPanel").gameObject; obj3.CustomSetActive(false); GameObject obj4 = elemenet.transform.Find("pnlRecommend").gameObject; if ((info.bFirstGift > 0) && !this.IsDianQuanHaveFirstPay(info.dwID)) { obj4.CustomSetActive(true); obj4.transform.Find("txtDiscount").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Pay_First_Pay_Double"); } else { if (info.dwExtraGiftCnt > 0) { obj3.CustomSetActive(true); obj3.transform.Find("Text").GetComponent <Text>().text = string.Format(Singleton <CTextManager> .GetInstance().GetText("Pay_Gift_Diamond_Cnt"), info.dwExtraGiftCnt); } obj4.CustomSetActive(false); } CUIEventScript script4 = gameObject.GetComponent <CUIEventScript>(); stUIEventParams eventParams = new stUIEventParams(); eventParams.dianQuanBuyPar.giftId = (int)info.dwID; eventParams.dianQuanBuyPar.dianQuanCnt = (int)info.dwBuyCount; script4.SetUIEvent(enUIEventType.Click, enUIEventID.Pay_ClickDianQuanGift, eventParams); } } }
public void openTaskPanel(CUIEvent uiEvent) { if (!this.bPanelOpen) { this.taskPanel.CustomSetActive(true); this.arrowIcon.CustomSetActive(true); } stUIEventParams eventParams = default(stUIEventParams); eventParams.tag = ((!this.bPanelOpen) ? 6 : 5); this.taskPanel.GetComponent <CUIAnimatorScript>().SetUIEvent(enAnimatorEventType.AnimatorEnd, enUIEventID.Battle_TaskPanel_SlideEnd, eventParams); this.taskPanel.GetComponent <Animator>().Play((!this.bPanelOpen) ? "Form_Battle_EvalPlanel_in" : "Form_Battle_EvalPlanel_out"); this.arrowIcon.GetComponent <Animator>().Play((!this.bPanelOpen) ? "Form_Battle_EvalPlanel_in2" : "Form_Battle_EvalPlanel_out2"); this.bPanelOpen = !this.bPanelOpen; }
private static void GotoHeroSelectPage() { bInFakeConfirm = false; RealPlayerConfirmNum = 0; FakePlayerConfirmNum = 0; Singleton <LobbyLogic> .GetInstance().inMultiRoom = false; stUIEventParams par = new stUIEventParams { heroSelectGameType = enSelectHeroType.enPVE_Computer }; Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.HeroSelect_OpenForm, par); Singleton <CTimerManager> .GetInstance().RemoveTimer(new CTimer.OnTimeUpHandler(CFakePvPHelper.OnConfirmTimout)); }
public void Play_UnLock_Animation(RES_SPECIALFUNCUNLOCK_TYPE type) { string str = string.Empty; RES_SPECIALFUNCUNLOCK_TYPE res_specialfuncunlock_type = type; switch (res_specialfuncunlock_type) { case RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_UNION: str = "SocialBtn"; break; case RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_TASK: str = "TaskBtn"; break; case RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_HERO: str = "HeroBtn"; break; case RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_BAG: str = "BagBtn"; break; case RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_FRIEND: str = "FriendBtn"; break; case RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_ADDEDSKILL: str = "AddedSkillBtn"; break; default: if (res_specialfuncunlock_type == RES_SPECIALFUNCUNLOCK_TYPE.RES_SPECIALFUNCUNLOCKTYPE_SYMBOL) { str = "SymbolBtn"; } break; } if (!string.IsNullOrEmpty(str)) { stUIEventParams eventParams = new stUIEventParams { tag = (int)type }; this.animatorScript.SetUIEvent(enAnimatorEventType.AnimatorEnd, enUIEventID.Lobby_UnlockAnimation_End, eventParams); this.animatorScript.PlayAnimator(str); Singleton <CSoundManager> .instance.PostEvent("UI_hall_system_unlock", null); } }
public static void OnGetInvited(CSPkg msg) { if (!Singleton <SettlementSystem> .GetInstance().IsExistSettleForm()) { string str = StringHelper.UTF8BytesToString(ref msg.stPkgData.stInviteJoinGameReq.szInviterName); COMDT_TEAM_BASE stTeamDetail = msg.stPkgData.stInviteJoinGameReq.stInviteDetail.stTeamDetail; string inviteType = GetInviteType(msg.stPkgData.stInviteJoinGameReq.bInviteType, (stTeamDetail != null) ? stTeamDetail.bMapType : ((byte)0)); stUIEventParams par = new stUIEventParams { tag = msg.stPkgData.stInviteJoinGameReq.bIndex, tagStr = str }; int result = 15; int.TryParse(Singleton <CTextManager> .instance.GetText("MessageBox_Close_Time"), out result); Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancelAndAutoClose(string.Format(Singleton <CTextManager> .GetInstance().GetText("PVP_Invite_Tip"), str, inviteType), enUIEventID.Invite_AcceptInvite, enUIEventID.Invite_RejectInvite, par, false, result, enUIEventID.Invite_AddToMsgCenter); } }
private static void SetMopupTenEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum) { Button component = Mopup.GetComponent <Button>(); CUIEventScript component2 = component.gameObject.GetComponent <CUIEventScript>(); stUIEventParams onClickEventParams = default(stUIEventParams); bool isEnable; if (difficulty == 1) { Text componetInChild = Utility.GetComponetInChild <Text>(Mopup, "Text"); componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", new string[] { "10" }); isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL && CAdventureView.isVip()); onClickEventParams.tag = 10; component2.m_onClickEventParams = onClickEventParams; } else { if (difficulty != 2) { DebugHelper.Assert(false, "Invalid difficulty -- {0}", new object[] { difficulty }); return; } Text componetInChild2 = Utility.GetComponetInChild <Text>(Mopup, "Text"); if (LeftPlayNum > 0) { componetInChild2.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", new string[] { LeftPlayNum.ToString() }); } else { componetInChild2.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Can_Not_Sweep"); } isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL && CAdventureView.isVip() && LeftPlayNum > 0); onClickEventParams.tag = LeftPlayNum; component2.m_onClickEventParams = onClickEventParams; } CUICommonSystem.SetButtonEnable(component, isEnable, true, true); }
private bool CheckNameChangeCardCount() { int nameChangeHaveItemCount = this.GetNameChangeHaveItemCount(this.m_curChangeType); int nameChangeCostItemCount = this.GetNameChangeCostItemCount(this.m_curChangeType); if (nameChangeHaveItemCount < nameChangeCostItemCount) { if (CSysDynamicBlock.bLobbyEntryBlocked) { string text = Singleton <CTextManager> .GetInstance().GetText("NameChange_ErrorItemNotEnough"); Singleton <CUIManager> .GetInstance().OpenMessageBox(text, false); } else { uint nameChangeCardShopProductKey = this.GetNameChangeCardShopProductKey(this.m_curChangeType); CMallFactoryShopController.ShopProduct product = Singleton <CMallFactoryShopController> .GetInstance().GetProduct(nameChangeCardShopProductKey); if (product == null) { DebugHelper.Assert(false, "错误的特卖商品ID"); return(false); } ResPropInfo dataByKey = GameDataMgr.itemDatabin.GetDataByKey(product.ID); if (dataByKey == null) { DebugHelper.Assert(false, "错误的商品ID"); return(false); } CUseable cUseable = CUseableManager.CreateUseable(product.Type, 0uL, product.ID, (int)product.LimitCount, 0); uint num = product.ConvertWithRealDiscount(cUseable.GetBuyPrice(product.CoinType)); int num2 = nameChangeCostItemCount - nameChangeHaveItemCount; string text2 = Singleton <CTextManager> .GetInstance().GetText("NameChange_GuideToMall", new string[] { num2.ToString(), dataByKey.szName, ((long)num2 * (long)((ulong)num)).ToString() }); stUIEventParams par = default(stUIEventParams); par.tag = num2; Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(text2, enUIEventID.NameChange_GuideToMall, enUIEventID.None, par, false); } return(false); } return(true); }
private void OnBreakExcessSymbolClick(CUIEvent uiEvent) { CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(s_symbolBreakPath, false, true); if (script != null) { for (int i = 0; i < this.m_breakSymbolList.Length; i++) { this.m_breakSymbolList[i].Clear(); } this.m_breakLevelMask = 0; Transform transform = script.transform.Find("Panel_SymbolBreak/Panel_Content"); for (int j = 0; j < s_maxSymbolBreakLevel; j++) { GameObject gameObject = transform.Find(string.Format("breakElement{0}", j)).gameObject; Transform transform2 = gameObject.transform.Find("OnBreakBtn"); Transform transform3 = gameObject.transform.Find("OnBreakBtn/Checkmark"); Transform transform4 = gameObject.transform.Find("detailButton"); if ((transform2 != null) && (transform3 != null)) { transform3.gameObject.CustomSetActive(false); CUIEventScript component = transform2.GetComponent <CUIEventScript>(); if (component != null) { stUIEventParams eventParams = new stUIEventParams { tag = j }; component.SetUIEvent(enUIEventType.Click, enUIEventID.SymbolMake_SelectBreakLvlItem, eventParams); } } if (transform4 != null) { transform4.gameObject.CustomSetActive(false); CUIEventScript script3 = transform4.GetComponent <CUIEventScript>(); if (script3 != null) { stUIEventParams params2 = new stUIEventParams { tag = j }; script3.SetUIEvent(enUIEventType.Click, enUIEventID.Symbol_OpenBreakDetailForm, params2); } } } this.RefreshSymbolBreakForm(); } }
private void ShowMonthWeekCardExpireTips(CTask task, bool isMonthCard) { uint num = (!isMonthCard) ? Singleton <CTaskSys> .get_instance().weekCardExpireTime : Singleton <CTaskSys> .get_instance().monthCardExpireTime; uint currentUTCTime = (uint)CRoleInfo.GetCurrentUTCTime(); int num2 = Mathf.CeilToInt(((num <= currentUTCTime) ? 0f : (num - currentUTCTime)) / 86400f); if (task.m_taskState == 3 && num2 > 0) { num2--; } if (isMonthCard) { ResGlobalInfo resGlobalInfo = null; if (GameDataMgr.svr2CltCfgDict.TryGetValue(22u, ref resGlobalInfo)) { stUIEventParams param = default(stUIEventParams); param.tag2 = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(292u).dwConfValue; if (num2 == 0) { Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(Singleton <CTextManager> .GetInstance().GetText("MonthCardExpireTips2"), enUIEventID.Mall_Open_Factory_Shop_Tab, enUIEventID.None, param, "立即续费", "暂不续费", false); } else if ((long)num2 <= (long)((ulong)resGlobalInfo.dwConfValue)) { Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(Singleton <CTextManager> .GetInstance().GetText("MonthCardExpireTips1"), enUIEventID.Mall_Open_Factory_Shop_Tab, enUIEventID.None, param, "立即续费", "暂不续费", false); } } } else { ResGlobalInfo resGlobalInfo2 = null; if (GameDataMgr.svr2CltCfgDict.TryGetValue(23u, ref resGlobalInfo2)) { stUIEventParams param2 = default(stUIEventParams); param2.tag2 = (int)GameDataMgr.globalInfoDatabin.GetDataByKey(293u).dwConfValue; if (num2 == 0) { Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(Singleton <CTextManager> .GetInstance().GetText("WeekCardExpireTips2"), enUIEventID.Mall_Open_Factory_Shop_Tab, enUIEventID.None, param2, "立即续费", "暂不续费", false); } else if ((long)num2 <= (long)((ulong)resGlobalInfo2.dwConfValue)) { Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(Singleton <CTextManager> .GetInstance().GetText("WeekCardExpireTips1"), enUIEventID.Mall_Open_Factory_Shop_Tab, enUIEventID.None, param2, "立即续费", "暂不续费", false); } } } }
private void OnClickExchange(CUIEvent uiEvent) { if (this._elementList != null) { int num = (int)uiEvent.m_eventParams.commonUInt32Param1; if ((num >= 0) && (num < this._elementList.Count)) { ResDT_Item_Info stResItemInfo = this._elementList[num].phase.Config.stResItemInfo; CUseable useable = CUseableManager.CreateUseable((COM_ITEM_TYPE)stResItemInfo.wItemType, stResItemInfo.dwItemID, 1); string str = (useable != null) ? useable.m_name : string.Empty; stUIEventParams par = new stUIEventParams { commonUInt32Param1 = (uint)num }; Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(string.Format(Singleton <CTextManager> .GetInstance().GetText("confirmExchange"), str), enUIEventID.Activity_ExchangeConfirm, enUIEventID.None, par, false); } } }
private void On_Burn_Challenge(CUIEvent uievent) { CSDT_SINGLE_GAME_OF_BURNING reportInfo = BurnExpeditionUT.Create_CSDT_SINGLE_GAME_OF_BURNING(this.model.curSelect_LevelIndex); ResLevelCfgInfo info = BurnExpeditionUT.Get_LevelConfigInfo(Singleton <BurnExpeditionController> .instance.model.curSelect_LevelIndex); DebugHelper.Assert(info != null); if (info != null) { byte iHeroNum = (byte)info.iHeroNum; uint dwBattleListID = info.dwBattleListID; Singleton <CHeroSelectSystem> .GetInstance().SetPVEDataWithBurnExpedition(iHeroNum, dwBattleListID, reportInfo, StringHelper.UTF8BytesToString(ref info.szName)); stUIEventParams par = new stUIEventParams { heroSelectGameType = enSelectHeroType.enBurning }; Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(enUIEventID.HeroSelect_OpenForm, par); } }
private void OnClickExchangeCountSelectReady(CUIEvent uiEvent) { if (this._elementList != null) { uint commonUInt32Param = uiEvent.m_eventParams.commonUInt32Param1; int commonUInt16Param = (int)uiEvent.m_eventParams.commonUInt16Param1; if (commonUInt16Param >= 0 && commonUInt16Param < this._elementList.Count) { uint dwResItemID = this._elementList[commonUInt16Param].phase.Config.dwResItemID; CUseable cUseable = CUseableManager.CreateUseable((COM_ITEM_TYPE)this._elementList[commonUInt16Param].phase.Config.wResItemType, this._elementList[commonUInt16Param].phase.Config.dwResItemID, 1); string text = (cUseable == null) ? string.Empty : cUseable.m_name; stUIEventParams par = default(stUIEventParams); par.commonUInt16Param1 = (ushort)commonUInt16Param; this._elementList[commonUInt16Param].phase.SetExchangeCountOnce((int)commonUInt32Param); Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(string.Format(Singleton <CTextManager> .GetInstance().GetText("confirmExchange"), commonUInt32Param, text), enUIEventID.Activity_PtExchangeConfirm, enUIEventID.None, par, false); } } }
private void OnClickExchangeCountSelectReady(CUIEvent uiEvent) { if (this._elementList != null) { uint commonUInt32Param = uiEvent.m_eventParams.commonUInt32Param1; int commonUInt16Param = (int)uiEvent.m_eventParams.commonUInt16Param1; if (commonUInt16Param >= 0 && commonUInt16Param < this._elementList.get_Count()) { ResDT_Item_Info stResItemInfo = this._elementList.get_Item(commonUInt16Param).phase.Config.stResItemInfo; CUseable cUseable = CUseableManager.CreateUseable(stResItemInfo.wItemType, stResItemInfo.dwItemID, 1); string text = (cUseable != null) ? cUseable.m_name : string.Empty; stUIEventParams par = default(stUIEventParams); par.commonUInt16Param1 = (ushort)commonUInt16Param; this._elementList.get_Item(commonUInt16Param).phase.SetExchangeCountOnce((int)commonUInt32Param); Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(string.Format(Singleton <CTextManager> .GetInstance().GetText("confirmExchange"), commonUInt32Param, text), enUIEventID.Activity_ExchangeConfirm, enUIEventID.None, par, false); } } }
private void OnBuyPickDialogConfirm(CUIEvent uiEvent, uint count) { int bCount = (int)count; uint tagUInt = uiEvent.m_eventParams.tagUInt; int tag = uiEvent.m_eventParams.tag; CUseable useable = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, tagUInt, bCount); if (useable != null) { int num4 = (int)(useable.GetBuyPrice((RES_SHOPBUY_COINTYPE)tag) * bCount); enPayType payType = CMallSystem.ResBuyTypeToPayType(tag); stUIEventParams confirmEventParams = new stUIEventParams { tag = bCount }; string[] args = new string[] { bCount.ToString(), useable.m_name }; CMallSystem.TryToPay(enPayPurpose.Buy, Singleton <CTextManager> .GetInstance().GetText("Union_Battle_Tips5", args), payType, (uint)num4, enUIEventID.Union_Battle_ConfirmBuyItem, ref confirmEventParams, enUIEventID.None, true, true); } }
public static void On_Send_FriendPower(CSPkg msg) { Singleton <CUIManager> .GetInstance().CloseSendMsgAlert(); SCPKG_CMD_DONATE_FRIEND_POINT stFriendDonatePointRsp = msg.stPkgData.stFriendDonatePointRsp; if (stFriendDonatePointRsp.dwResult == 0) { UT.Check_AddHeartCD(stFriendDonatePointRsp.stUin, (COM_FRIEND_TYPE)stFriendDonatePointRsp.bFriendType); Singleton <EventRouter> .GetInstance().BroadCastEvent("Friend_FriendList_Refresh"); Singleton <EventRouter> .GetInstance().BroadCastEvent <SCPKG_CMD_DONATE_FRIEND_POINT>("Friend_Send_Coin_Done", stFriendDonatePointRsp); if (Singleton <CFriendContoller> .instance.model.IsSnsFriend(stFriendDonatePointRsp.stUin.ullUid, stFriendDonatePointRsp.stUin.dwLogicWorldId)) { COMDT_FRIEND_INFO info = Singleton <CFriendContoller> .instance.model.GetInfo(CFriendModel.FriendType.SNS, stFriendDonatePointRsp.stUin); if (info != null) { string str = Utility.UTF8Convert(info.szOpenId); if (!string.IsNullOrEmpty(str) && !CFriendModel.IsOnSnsSwitch(info.dwRefuseFriendBits, COM_REFUSE_TYPE.COM_REFUSE_TYPE_DONOTE_AND_REC)) { string text = Singleton <CTextManager> .instance.GetText("Common_Sns_Tips_3"); string confirmStr = Singleton <CTextManager> .instance.GetText("Common_Sns_Tips_5"); string cancelStr = Singleton <CTextManager> .instance.GetText("Common_Sns_Tips_4"); stUIEventParams param = new stUIEventParams(); param.snsFriendEventParams.openId = str; Singleton <CUIManager> .instance.OpenMessageBoxWithCancel(text, enUIEventID.Friend_Share_SendCoin, enUIEventID.None, param, confirmStr, cancelStr, false); return; } } } Singleton <CUIManager> .GetInstance().OpenTips(UT.GetText("Friend_Tips_SendHeartOK"), false, 1.5f, null, new object[0]); } else { Singleton <CUIManager> .GetInstance().OpenTips(UT.ErrorCode_String(stFriendDonatePointRsp.dwResult), false, 1.5f, null, new object[0]); } }
public void SwitchToSymbolMakePanel(CUIEvent uiEvent) { this.ClearSymbolMakeData(); this.RefreshSymbolMakeForm(); CSymbolSystem.RefreshSymbolCntText(); CUseable useable = CUseableManager.CreateVirtualUseable(enVirtualItemType.enSymbolCoin, 0); stUIEventParams eventParams = new stUIEventParams { iconUseable = useable, tag = 3 }; CUIEventScript component = uiEvent.m_srcFormScript.GetWidget(8).GetComponent <CUIEventScript>(); if (component != null) { component.SetUIEvent(enUIEventType.Down, enUIEventID.Tips_ItemInfoOpen, eventParams); component.SetUIEvent(enUIEventType.HoldEnd, enUIEventID.Tips_ItemInfoClose, eventParams); component.SetUIEvent(enUIEventType.Click, enUIEventID.Tips_ItemInfoClose, eventParams); component.SetUIEvent(enUIEventType.DragEnd, enUIEventID.Tips_ItemInfoClose, eventParams); } }
public static void SetPveHeroItemData(CUIFormScript formScript, GameObject listItem, IHeroData data) { if ((listItem != null) && (data != null)) { bool bPlayerOwn = data.bPlayerOwn; Transform transform = listItem.transform; Transform transform2 = transform.Find("heroProficiencyImg"); Transform transform3 = transform.Find("heroProficiencyBgImg"); CUICommonSystem.SetHeroProficiencyIconImage(formScript, transform2.gameObject, data.proficiencyLV); CUICommonSystem.SetHeroProficiencyBgImage(formScript, transform3.gameObject, data.proficiencyLV, false); CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo != null) { transform3.GetComponent <Image>().color = !masterRoleInfo.IsHaveHero(data.cfgID, true) ? CUIUtility.s_Color_GrayShader : Color.white; transform2.GetComponent <Image>().color = !masterRoleInfo.IsHaveHero(data.cfgID, true) ? CUIUtility.s_Color_GrayShader : Color.white; } bool bActive = false; bool flag3 = false; if (masterRoleInfo != null) { bActive = masterRoleInfo.IsFreeHero(data.cfgID); flag3 = masterRoleInfo.IsValidExperienceHero(data.cfgID); CUICommonSystem.SetHeroItemImage(formScript, listItem, masterRoleInfo.GetHeroSkinPic(data.cfgID), enHeroHeadType.enBust, (!bPlayerOwn && !bActive) && !flag3); } GameObject gameObject = transform.Find("profession").gameObject; CUICommonSystem.SetHeroJob(formScript, gameObject, (enHeroJobType)data.heroType); transform.Find("heroNameText").GetComponent <Text>().text = data.heroName; Transform transform4 = transform.Find("TxtFree"); if (transform4 != null) { transform4.gameObject.CustomSetActive(bActive); } transform.Find("imgExperienceMark").gameObject.CustomSetActive(data.IsValidExperienceHero()); CUIEventScript component = listItem.GetComponent <CUIEventScript>(); stUIEventParams eventParams = new stUIEventParams(); eventParams.openHeroFormPar.heroId = data.cfgID; eventParams.openHeroFormPar.openSrc = enHeroFormOpenSrc.HeroListClick; component.SetUIEvent(enUIEventType.Click, enUIEventID.HeroInfo_OpenForm, eventParams); } }
public static void OnHeroItemEnable(CUIEvent uiEvent, ResHeroCfgInfo heroCfgInfo) { if ((heroCfgInfo != null) && (uiEvent.m_srcWidget != null)) { GameObject item = Utility.FindChild(uiEvent.m_srcWidget, "heroItemCell"); if (item != null) { CUICommonSystem.SetHeroItemImage(uiEvent.m_srcFormScript, item, heroCfgInfo.szImagePath, enHeroHeadType.enIcon, false); CUIEventScript component = item.GetComponent <CUIEventScript>(); if (component != null) { stUIEventParams eventParams = new stUIEventParams { heroId = heroCfgInfo.dwCfgID }; component.SetUIEvent(enUIEventType.Click, enUIEventID.Ranking_HeroChg_Hero_Click, eventParams); } Utility.FindChild(item, "TxtFree").CustomSetActive(false); Utility.FindChild(item, "equipedPanel").CustomSetActive(false); } } }
private static void SetMopupTenEnable(GameObject Mopup, byte StarBitsMask, RES_LEVEL_DIFFICULTY_TYPE difficulty, int LeftPlayNum) { Button component = Mopup.GetComponent <Button>(); bool isEnable = false; CUIEventScript script = component.gameObject.GetComponent <CUIEventScript>(); stUIEventParams @params = new stUIEventParams(); if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NORMAL) { string[] args = new string[] { "10" }; Utility.GetComponetInChild <Text>(Mopup, "Text").text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", args); isEnable = (CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL) && isVip(); @params.tag = 10; script.m_onClickEventParams = @params; } else if (difficulty == RES_LEVEL_DIFFICULTY_TYPE.RES_LEVEL_DIFFICULTY_TYPE_NIGHTMARE) { Text componetInChild = Utility.GetComponetInChild <Text>(Mopup, "Text"); if (LeftPlayNum > 0) { string[] textArray2 = new string[] { LeftPlayNum.ToString() }; componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Sweep_Number", textArray2); } else { componetInChild.text = Singleton <CTextManager> .GetInstance().GetText("PVE_Level_Can_Not_Sweep"); } isEnable = ((CAdventureSys.GetStarNum(StarBitsMask) == CAdventureSys.STAR_PER_LEVEL) && isVip()) && (LeftPlayNum > 0); @params.tag = LeftPlayNum; script.m_onClickEventParams = @params; } else { object[] inParameters = new object[] { difficulty }; DebugHelper.Assert(false, "Invalid difficulty -- {0}", inParameters); return; } CUICommonSystem.SetButtonEnable(component, isEnable, true, true); }
private void onQualitySettingAccept(CUIEvent uiEvent) { stUIEventParams eventParams = uiEvent.m_eventParams; switch (eventParams.tag) { case 2: GameSettings.ModelLOD = this.m_SliderModelLOD.MaxValue - eventParams.tag2; break; case 3: GameSettings.ParticleLOD = this.m_SliderModelLOD.MaxValue - eventParams.tag2; break; case 5: GameSettings.EnableOutline = eventParams.tag2 != 0; break; } PlayerPrefs.SetInt("degrade", 0); PlayerPrefs.Save(); Singleton <ApolloHelper> .GetInstance().ApolloRepoertEvent("Force_Modify_Quality", null, true); }
public static void SetAddNodeActive(GameObject addnode, CFriendModel.FriendType friendType, bool ifGrey = false) { if (addnode != null) { addnode.CustomSetActive(true); Transform transform = addnode.transform.Find("add_btn"); if (transform != null) { GameObject gameObject = transform.gameObject; if (gameObject != null) { gameObject.CustomSetActive(!ifGrey); stUIEventParams eventParams = default(stUIEventParams); eventParams.tag = (int)friendType; CUIEventScript component = gameObject.GetComponent <CUIEventScript>(); if (component != null) { component.SetUIEvent(enUIEventType.Click, enUIEventID.Friend_RequestBeFriend, eventParams); } } } } }