private void OnClickStartMatch(CUIEvent uiEvt) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); if (masterRoleInfo != null) { CUseableContainer useableContainer = masterRoleInfo.GetUseableContainer(enCONTAINER_TYPE.ITEM); if (CUICommonSystem.IsMatchOpened(RES_BATTLE_MAP_TYPE.RES_BATTLE_MAP_TYPE_REWARDMATCH, this.m_selectMapID)) { int num = useableContainer.GetUseableStackCount(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, this.m_selectMapRes.dwConsumPayItemID) + useableContainer.GetUseableStackCount(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, this.m_selectMapRes.dwConsumFreeItemID); int dwCousumItemNum = (int)this.m_selectMapRes.dwCousumItemNum; if (num >= dwCousumItemNum) { this.SendBeginMatchReq(); } else { int bCount = dwCousumItemNum - num; CUseable useable = CUseableManager.CreateUseable(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, this.m_selectMapRes.dwConsumPayItemID, bCount); if (useable != null) { int num4 = (int)(useable.GetBuyPrice((RES_SHOPBUY_COINTYPE)this.m_selectMapRes.bCoinType) * bCount); enPayType payType = CMallSystem.ResBuyTypeToPayType(this.m_selectMapRes.bCoinType); 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); } } } else { Singleton <CUIManager> .instance.OpenTips("Union_Battle_Tips4", true, 1f, null, new object[0]); } } }
private void initSecondFormWidget() { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(UNION_ENTRY_SECOND_PATH); if (form != null) { GameObject widget = form.GetWidget(0); GameObject btn = form.GetWidget(1); GameObject obj4 = form.GetWidget(2); if (((widget != null) && (btn != null)) && (obj4 != null)) { uint[] numArray = new uint[10]; bool[] flagArray = new bool[10]; uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Union_1"), out numArray[0]); uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Union_2"), out numArray[1]); flagArray[0] = CUICommonSystem.IsMatchOpened(RES_BATTLE_MAP_TYPE.RES_BATTLE_MAP_TYPE_REWARDMATCH, numArray[0]); flagArray[1] = CUICommonSystem.IsMatchOpened(RES_BATTLE_MAP_TYPE.RES_BATTLE_MAP_TYPE_REWARDMATCH, numArray[1]); widget.GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag = 0; btn.GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag = 1; obj4.GetComponent <CUIMiniEventScript>().m_onClickEventParams.tag = 2; widget.GetComponent <CUIMiniEventScript>().m_onClickEventParams.tagUInt = numArray[0]; btn.GetComponent <CUIMiniEventScript>().m_onClickEventParams.tagUInt = numArray[1]; widget.GetComponent <CUIMiniEventScript>().m_onClickEventParams.commonBool = flagArray[0]; btn.GetComponent <CUIMiniEventScript>().m_onClickEventParams.commonBool = flagArray[1]; widget.transform.FindChild("Lock").gameObject.CustomSetActive(!flagArray[0]); btn.transform.FindChild("Lock").gameObject.CustomSetActive(!flagArray[1]); this.ShowCountDownTime(widget, flagArray[0]); this.ShowCountDownTime(btn, flagArray[1]); widget.transform.FindChild("Desc/MapNameTxt").GetComponent <Text>().text = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(widget.GetComponent <CUIMiniEventScript>().m_onClickEventParams.tagUInt).stLevelCommonInfo.szName; btn.transform.FindChild("Desc/MapNameTxt").GetComponent <Text>().text = GameDataMgr.uinionBattleLevelDatabin.GetDataByKey(btn.GetComponent <CUIMiniEventScript>().m_onClickEventParams.tagUInt).stLevelCommonInfo.szName; if (CSysDynamicBlock.bLobbyEntryBlocked && (obj4 != null)) { obj4.CustomSetActive(false); } } } }
public void initWidget() { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CUnionBattleRankSystem.UNION_RANK_PATH); if (form != null) { this.m_CurSelRankType = enUnionRankType.enRankType_None; this.m_CurSelRankMatchType = enUnionRankMatchType.enRankMatchType_None; this.m_CurSelRankItemIndex = -1; this.m_CurSelMapId = 0u; CUIListScript component = form.GetWidget(2).GetComponent <CUIListScript>(); int unionBattleMapCount = CUnionBattleEntrySystem.GetUnionBattleMapCount(); component.SetElementAmount(unionBattleMapCount); int num = 0; for (int i = 0; i < unionBattleMapCount; i++) { ResRewardMatchLevelInfo unionBattleMapInfoByIndex = CUnionBattleEntrySystem.GetUnionBattleMapInfoByIndex(i); if (CUICommonSystem.IsMatchOpened(5, unionBattleMapInfoByIndex.dwMapId)) { CUIListElementScript elemenet = component.GetElemenet(num); if (elemenet != null) { CUIEventScript component2 = elemenet.GetComponent <CUIEventScript>(); elemenet.transform.FindChild("Text").GetComponent <Text>().text = unionBattleMapInfoByIndex.szMatchName; component2.m_onClickEventParams.tagUInt = unionBattleMapInfoByIndex.dwMapId; component2.m_onClickEventParams.commonUInt32Param1 = unionBattleMapInfoByIndex.dwMatchType; } num++; } } if (num != unionBattleMapCount) { component.SetElementAmount(num); } } }