void AddTrainingStart() { if (m_TrainingLevel >= GlobeVar.TRAININGLEVEL_MAX) { GUIData.AddNotifyData("#{5505}", true); return; } Tab_TrainingBook tabTraining = TableManager.GetTrainingBookByID(m_TrainingLevel, 0); if (tabTraining == null) { return; } if (Singleton <ObjManager> .Instance.MainPlayer == null) { return; } if (Singleton <ObjManager> .Instance.MainPlayer.BaseAttr.Level < tabTraining.LimitLevel) { GUIData.AddNotifyData(StrDictionary.GetClientDictionaryString("#{5507}", tabTraining.LimitLevel)); return; } if (m_TrainingExp >= m_TrainingMax) { GUIData.AddNotifyData("#{5536}", true); return; } m_AddTraining = true; m_MinusTraining = false; }
/// <summary> /// 请求获取物品 /// </summary> public void OnReceiveClick() { if (GameManager.gameManager.PlayerDataPool.m_ActivityRewardIndex <= 0) { // GUIData.AddNotifyData("#{5137}"); return; } int curIndex = GameManager.gameManager.PlayerDataPool.m_ActivityRewardIndex; if (!GameManager.gameManager.PlayerDataPool.OnActivityRewardTable.ContainsKey(curIndex)) { return; } ActivityRewardData rewardData = GameManager.gameManager.PlayerDataPool.OnActivityRewardTable[curIndex]; //获取当前物品状态 if (rewardData.State == AcitivityRewardState.EXPIRED) //已过期状态 { string fortip = StrDictionary.GetClientDictionaryString("#{4703}", rewardData.BindYuanbao); MessageBoxLogic.OpenOKCancelBox(fortip, "", SendRewardClick, null); } else if (rewardData.State == AcitivityRewardState.RECEIVE) { CG_RECEIVE_ACTIVITYREWARD msg = (CG_RECEIVE_ACTIVITYREWARD)PacketDistributed.CreatePacket(MessageID.PACKET_CG_RECEIVE_ACTIVITYREWARD); msg.SetRewardIndex(curIndex); msg.SetIsreplacement(0); msg.SendPacket(); } }
/// <summary> /// 选择好宝宝 /// </summary> public void OnPartnerChooseOKClick(Fellow fellow) { m_BabyFellowBuffer = fellow; if (m_BabyFellowBuffer.ProcreateCount <= 0) { GUIData.AddNotifyData("#{10337}"); return; } if (m_BabyFellowBuffer.Called) { GUIData.AddNotifyData("#{10344}"); return; } m_BabyFellow = m_BabyFellowBuffer; m_FellowIndex = m_FellowIndexBuffer; UpdateChooseFellowModel(); m_PartnerChooseWindow.SetActive(false); m_PushPartnerButton.SetActive(false); m_PlayerTips.SetActive(false); m_OpButtons.SetActive(true); m_LookForBreedingButton.GetComponent <UIImageButton>().isEnabled = true; }
/// <summary> /// 点击添加宝宝 /// </summary> void OnChoosePartnerClick() { NewPlayerGuidLogic.CloseWindow(); FellowContainer container = GameManager.gameManager.PlayerDataPool.FellowContainer; if (container == null) { return; } List <Fellow> babylist = FellowTool.FellowCanBreedingFilter(container); //List<Fellow> babylist = FellowTool.FellowBabyFilter(container); if (babylist.Count <= 0) { GUIData.AddNotifyData("#{10330}"); return; } m_FellowIndexBuffer = m_FellowIndex; m_PartnerChooseWindow.SetActive(true); ShowChooseBabyFellow(babylist); }
void OnRebirthOKClick() { if (m_FellowBuffer == null) { return; } if (false == m_FellowBuffer.IsValid()) { return; } if (m_FellowBuffer.Called) { GUIData.AddNotifyData("#{10325}"); return; } CG_FELLOW_REBIRTH pak = (CG_FELLOW_REBIRTH)PacketDistributed.CreatePacket(MessageID.PACKET_CG_FELLOW_REBIRTH); pak.SetGuid(m_FellowBuffer.Guid); pak.SendPacket(); rebirthFellowGuid = m_FellowBuffer.Guid; OnRebirthCancelClick(); }
void OnRestaurantClick(GameObject value) { if (!GameManager.gameManager.PlayerDataPool.IsServerFlagOpen(SERVER_FLAGS_ENUM.FLAG_KEJIYUAN)) { GUIData.AddNotifyData("#{10830}"); return; } bool bRet = GameManager.gameManager.PlayerDataPool.CommonData.GetCommondFlag((int)USER_COMMONFLAG.CF_RESTAURANTFUNCTION_OPENFLAG); if (bRet == false) { GUIData.AddNotifyData("#{10830}"); return; } // if (GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Level < (int)GameDefine_Globe.NEWBUTTON_LEVEL.FARM) // { // GUIData.AddNotifyData("#{10830}"); // return; // } NewPlayerGuidLogic.CloseWindow(); if (m_NewButton != null && m_NewButton == value) { StopNewButtonEffect(); } RestaurantController.OpenWindow(true); }
void OnLockBreedingClick() { if (m_BabyFellow == null) { GUIData.AddNotifyData("#{10331}"); return; } if (false == GameManager.gameManager.PlayerDataPool.IsHaveTeam() || GameManager.gameManager.PlayerDataPool.TeamInfo.GetTeamMemberCount() != 2) { GUIData.AddNotifyData("#{10333}"); return; } if (m_LockBreeding) { return; } //发包同步 CG_FELLOW_BREEDING_LOCK pak = (CG_FELLOW_BREEDING_LOCK)PacketDistributed.CreatePacket(MessageID.PACKET_CG_FELLOW_BREEDING_LOCK); pak.SetGuid(m_BabyFellow.Guid); pak.SendPacket(); }
void OnOkClick() { OnInputSubmit(); if (!GameManager.gameManager.PlayerDataPool.IsServerFlagOpen(SERVER_FLAGS_ENUM.FLAG_LOVERFLOWER)) { GUIData.AddNotifyData("#{5138}"); return; } if (m_LabelName.text == null || m_FriendGuid == 0) { GUIData.AddNotifyData("#{5087}"); return; } if (GameManager.gameManager.PlayerDataPool.BackPack.GetBindItemCountByDataId(RoseDataId1) == 0 || m_curNum > GameManager.gameManager.PlayerDataPool.BackPack.GetBindItemCountByDataId(RoseDataId1)) { GUIData.AddNotifyData("#{5074}"); return; } CG_ASK_USEROSE userose = (CG_ASK_USEROSE)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_USEROSE); userose.SetType(1); userose.SetSendGuild(m_FriendGuid); userose.SetNumber(m_curNum); userose.SendPacket(); OnCloseWindow(); }
// 全部结账 void OnBillingAllClick() { if (null == m_curRestaurant) { return; } bool bCanBilling = false; foreach (RestaurantData.DeskInfo curDesk in m_curRestaurant.m_Desks) { if (curDesk.m_IsActive && curDesk.m_DestState == RestaurantData.DeskState.WaitBilling) { bCanBilling = true; break; } } if (!bCanBilling) { // 没有可以结账的餐桌 GUIData.AddNotifyData("#{1980}"); return; } CG_RESTAURANT_BILLINGALL packet = (CG_RESTAURANT_BILLINGALL)PacketDistributed.CreatePacket(MessageID.PACKET_CG_RESTAURANT_BILLINGALL); packet.None = 0; if (!m_bSelfData) { packet.FriendGuid = RestaurantData.m_FriendRestaurantInfo.m_FrinedGuid; } packet.SendPacket(); }
void onSelectOneRoleItem(int index) { if (index == 2)//弓箭手 { GUIData.AddNotifyData("#{10012}"); return; } if (IsClickSelectRole == true) { return; } IsClickSelectRole = true; NGUITools.SetActive(bgButton1Obj, false); NGUITools.SetActive(bgButton2Obj, true); tweenPlayer.tweenGroup = 1; tweenPlayer.Play(true); //Debug.Log("curselectinde " + index); // NGUITools.SetActive(m_FirstStepObj, false); m_CurRoleIndex = index; SetRoleProfessional(m_CurRoleIndex); FreshNewName(); Invoke("ShowNextStep", 0.7f); }
public uint Execute(PacketDistributed ipacket) { GC_NOTICE packet = (GC_NOTICE)ipacket; if (null == packet) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } if (packet.HasNotice) { bool IsFilterRepeat = false; if (packet.HasFilterRepeat) { IsFilterRepeat = packet.FilterRepeat == 1? true:false; } GUIData.AddNotifyData(packet.Notice, IsFilterRepeat); if (packet.Notice == "#{2129}") { UIManager.CloseUI(UIInfo.RankRoot); } } return((uint)PACKET_EXE.PACKET_EXE_CONTINUE); }
void OnActiveDesk() { if (null == m_curDestData) { LogModule.ErrorLog("OnActiveDesk:: m_curDestData is null"); return; } if (null == m_curTabDesk) { LogModule.ErrorLog("OnActiveDesk:: m_curTabDesk is null"); return; } int nCostValue = m_curTabDesk.OpenConditionValue; int nPlayerYuanBao = GameManager.gameManager.PlayerDataPool.Money.GetMoney_YuanBao(); int nPlayerBindYuanBao = GameManager.gameManager.PlayerDataPool.Money.GetMoney_YuanBaoBind(); int nTotalYuanBao = nPlayerBindYuanBao + nPlayerYuanBao; if (nTotalYuanBao < nCostValue) { GUIData.AddNotifyData("#{1018}"); return; } CG_RESTAURANT_ACTIVEDESK packet = (CG_RESTAURANT_ACTIVEDESK)PacketDistributed.CreatePacket(MessageID.PACKET_CG_RESTAURANT_ACTIVEDESK); packet.SetDeskIndex(m_curDeskIndex); packet.SendPacket(); }
void OnBiographyClick() { GUIData.AddNotifyData("#{10830}"); return; //if (!m_Demo30) UIManager.ShowUI(UIInfo.Biography); }
public uint Execute(PacketDistributed ipacket) { GC_PLAY_YANHUA packet = (GC_PLAY_YANHUA)ipacket; if (null == packet) { return((uint)PACKET_EXE.PACKET_EXE_ERROR); } int nEffectID = packet.Effectid; if (BackCamerControll.Instance() != null) { BackCamerControll.Instance().PlaySceneEffect(nEffectID); } Tab_CommonItem TabItem = TableManager.GetCommonItemByID(packet.Itemid, 0); if (TabItem != null) { string strMsg = StrDictionary.GetClientDictionaryString("#{3050}", packet.Username, TabItem.Name); GUIData.AddNotifyData(strMsg); } //enter your logic return((uint)PACKET_EXE.PACKET_EXE_CONTINUE); }
void OnClickJoinGuildBtn() { if (null == Singleton <ObjManager> .GetInstance().MainPlayer) { return; } if (GameManager.gameManager.PlayerDataPool.GuildInfo.PreserveGuildGuid.Count >= GlobeVar.GUILD_PLAYERRESERVE_MAX) { GUIData.AddNotifyData("#{10384}"); return; } if (!m_canBeJoined) { if (m_applyListIsFull) { Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{3180}"); return; } Singleton <ObjManager> .GetInstance().MainPlayer.SendNoticMsg(false, "#{1774}"); return; } //玩家等级判断 if (Singleton <ObjManager> .GetInstance().MainPlayer.BaseAttr.Level < GlobeVar.JOIN_GUILD_LEVEL) { GUIData.AddNotifyData("#{1780}"); //你的人物等级不足20级,无法创建帮会 return; } MessageBoxLogic.OpenOKCancelBox(StrDictionary.GetClientDictionaryString("#{10383}", GameManager.gameManager.PlayerDataPool.GuildInfo.PreserveGuildGuid.Count), "", ReqJoinGuildOK); }
// 帮主开启按钮 void ButtonOpen() { if (!GameManager.gameManager.PlayerDataPool.IsHaveGuild()) { return; } Guild info = GameManager.gameManager.PlayerDataPool.GuildInfo; GuildMember mainPlayerGuildInfo = info.GetMainPlayerGuildInfo(); if (false == mainPlayerGuildInfo.IsValid()) { return; } if (false == info.IsHaveAuthority(mainPlayerGuildInfo.Job, (int)GameDefine_Globe.GUILD_ROUTINE.GUILD_ROUTINE_OPEN_ACTIVITY)) { return; } if (info.GuildLevel < 2) { GUIData.AddNotifyData("#{3938}"); return; } CG_ASSIGN_PAOSHANG_TIME assignpak = (CG_ASSIGN_PAOSHANG_TIME)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASSIGN_PAOSHANG_TIME); assignpak.Nopara = 0; assignpak.SendPacket(); }
public void OnClickDream() { if (m_CurClickItemId != GlobeVar.INVALID_ID) { // GameManager.gameManager.FlyWingMananger.DreamFlyWing(m_CurClickItemId); if (!isHasDreamFlyWing(m_CurClickItemId)) { GUIData.AddNotifyData("#{11043}"); return; } if (GameManager.gameManager.FlyWingMananger.CurDreamFlyWingId == m_CurClickItemId) { CG_ASK_EQUIPFLYWING PACK = (CG_ASK_EQUIPFLYWING)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_EQUIPFLYWING); PACK.SetFlyWingType((int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_CANCEL_DREAM); PACK.SendPacket(); } else { CG_ASK_EQUIPFLYWING PACK = (CG_ASK_EQUIPFLYWING)PacketDistributed.CreatePacket(MessageID.PACKET_CG_ASK_EQUIPFLYWING); PACK.SetFlyWingType((int)GlobeVar.FLY_SOCKET_TYPE.FLY_SOCKET_DREAM); PACK.SetFlyWingId1(m_CurClickItemId); PACK.SendPacket(); } } }
// 全部上菜 void OnServingAllClick() { //Singleton<ObjManager>.GetInstance().MainPlayer.ReqViewOtherPlayer(Singleton<ObjManager>.GetInstance().MainPlayer.GUID, OtherRoleViewLogic.OPEN_TYPE.OPEN_TYPE_LASTSPEAKER); if (!m_bSelfData) { GUIData.AddNotifyData("#{2017}"); return; } m_curOperationDesk = null; bool isAvailable = false; for (int i = 0; i < m_Desks.Length; i++) { if (m_Desks[i].GetComponent <RestaurantDesk>().IsAvailable()) { isAvailable = true; break; } } if (!isAvailable) { GUIData.AddNotifyData("#{11379}"); return; } if (m_FoodWindow != null) { m_FoodWindow.SetActive(true); m_FoodWindow.GetComponent <RestaurantFoodWindow>().FilterFood(false); } }
void ShowBuySuitDialog(GameObject go) { if (!GameManager.gameManager.PlayerDataPool.IsServerFlagOpen(SERVER_FLAGS_ENUM.FLAG_FLYWING) && m_CurTab == (int)FashionType.TYPE_WING) { GUIData.AddNotifyData("#{10830}"); return; } Tab_FashionData tabFashionData = TableManager.GetFashionDataByID(m_curChooseFashion, 0); if (tabFashionData != null) { if (tabFashionData.FashionType == (int)FashionType.TYPE_WING) { if (!GameManager.gameManager.PlayerDataPool.CommonData.GetCommondFlag((int)USER_COMMONFLAG.CF_OPEN_FLYWING)) { GUIData.AddNotifyData("#{10830}"); return; } } } //if (GameManager.gameManager.PlayerDataPool.MainPlayerBaseAttr.Level < 45 && m_CurTab == (int)FashionType.TYPE_WING) //{ // GUIData.AddNotifyData("#{10830}"); // return; //} lblBuyTitle.text = StrDictionary.GetClientDictionaryString("#{11132}"); lblBuyDesc.text = StrDictionary.GetClientDictionaryString("#{11131}", mCurFashion.Name); buyOptions.ChangeTab("Op1"); lblBuyCost.text = mCurFashion.PriceWeek.ToString(); buySuitDialog.SetActive(true); }
/// <summary> /// 打开选择学习技能书界面 /// </summary> /// <param name="go"></param> void OpenChooseSkillBookDialog(GameObject go) { Utils.CleanGrid(m_SkillChooseGrid); List <Tab_CabalFellowElementSkillBook> FellowSkillBookList = GameManager.gameManager.PlayerDataPool.BackPack.GetSkillLearnBooksByElementType(m_Fellow.ElementAttr); if (FellowSkillBookList.Count <= 0) { GUIData.AddNotifyData("#{11500}"); return; } //选择技能书界面 m_SkillChooseWindow.SetActive(true); int index = 0; //foreach (Tab_CabalFellowElementSkillBook book in GameManager.gameManager.PlayerDataPool.BackPack.GetSkillLearnBooksByElementType(m_Fellow.ElementAttr)) foreach (Tab_CabalFellowElementSkillBook book in FellowSkillBookList) { if (m_Fellow.IsHaveSkillId(book.SkillId)) { continue; } Tab_CabalFellowElementSkill tabSkill = TableManager.GetCabalFellowElementSkillByID(book.SkillId, 0); if (tabSkill == null) { continue; } Tab_SkillEx tabSkillEx = TableManager.GetSkillExByID(book.SkillId, 0); if (tabSkillEx == null) { continue; } Tab_SkillBase tabBase = TableManager.GetSkillBaseByID(tabSkillEx.BaseId, 0); if (tabBase == null) { continue; } string itemName = index < 10 ? "0" + index.ToString() : index.ToString(); GameObject SkillItem = Utils.BindObjToParent(m_SkillChooseItem, m_SkillChooseGrid, itemName); if (SkillItem != null && SkillItem.GetComponent <PartnerSkillChooseItemLogic>() != null) { SkillItem.GetComponent <PartnerSkillChooseItemLogic>().Init(book); } index += 1; } if (m_SkillChooseGrid.GetComponent <UIGrid>() != null) { m_SkillChooseGrid.GetComponent <UIGrid>().Reposition(); } if (PartnerFrameLogic.Instance().NewPlayerGuideFlag_Step == 4) { PartnerFrameLogic.Instance().NewPlayerGuide(5); } }
// 全部上菜完成 void OnFinishServingAllClick() { if (!m_bSelfData) { GUIData.AddNotifyData("#{2017}"); return; } if (null == m_curRestaurant) { return; } // 超出当日完成次数上限 int nTodayFinishNum = GameManager.gameManager.PlayerDataPool.CommonData.GetCommonData((int)Games.UserCommonData.USER_COMMONDATA.CD_RESTAURANT_FINISHFOOD_NUM); if (nTodayFinishNum >= RestaurantData.FinishFoodMax) { MessageBoxLogic.OpenOKBox(1563, 1000); return; } bool bHavePreDesk = false; int nCostYuanBao = 0; for (int i = 0; i < m_curRestaurant.m_Desks.Length; i++) { if (m_curRestaurant.m_Desks[i].m_DestState != RestaurantData.DeskState.PrepareFood) { continue; } int nFoodID = m_curRestaurant.m_Desks[i].m_FoodID; Tab_RestaurantFood curTableFood = TableManager.GetRestaurantFoodByID(nFoodID, 0); if (null == curTableFood) { LogModule.ErrorLog("OnFinishServingAllClick:: curTableFood is null FoodID =" + nFoodID.ToString()); continue; } bHavePreDesk = true; int nCurDestCostYuanBao = 0; int nLeftTenMinues = m_curRestaurant.m_Desks[i].GetFoodLeftTime() / 600; if (m_curRestaurant.m_Desks[i].GetFoodLeftTime() % 600 != 0) { nLeftTenMinues = nLeftTenMinues + 1; } if (nLeftTenMinues <= 0) { nLeftTenMinues = 1; } nCurDestCostYuanBao = nLeftTenMinues * curTableFood.CostYuanBao; nCostYuanBao = nCostYuanBao + nCurDestCostYuanBao; } if (false == bHavePreDesk) { MessageBoxLogic.OpenOKBox(2381, 1000); return; } MessageBoxLogic.OpenCostBox(GCGame.Utils.GetDicByID(11362), null, GCGame.Utils.GetDicByID(11361), GCGame.Utils.GetDicByID(11363), "qian3", "X" + nCostYuanBao, OnFinishServingAll); }
void FinishPrepareDesk() { if (null == RestaurantController.Instance()) { LogModule.ErrorLog("FinishPrepareDesk::RestaurantController.Instance() is null "); return; } if (!RestaurantController.Instance().SelfData) { GUIData.AddNotifyData("#{2017}"); return; } if (null == m_curDestData) { LogModule.ErrorLog("FinishPrepareDesk:: m_curDestData is null"); return; } int nTodayFinishNum = GameManager.gameManager.PlayerDataPool.CommonData.GetCommonData((int)Games.UserCommonData.USER_COMMONDATA.CD_RESTAURANT_FINISHFOOD_NUM); if (nTodayFinishNum >= RestaurantData.FinishFoodMax) { MessageBoxLogic.OpenOKBox(1563, 1000); return; } if (null == m_curDestData) { LogModule.ErrorLog("FinishPrepareDesk:: m_curDestData is null"); return; } Tab_RestaurantFood curTableFood = TableManager.GetRestaurantFoodByID(m_curDestData.m_FoodID, 0); if (null == curTableFood) { LogModule.ErrorLog("FinishPrepareDesk:: curTableFood is null"); return; } int nCostYuanBao = 0; int nLeftTenMinues = m_curDestData.GetFoodLeftTime() / 600; if (m_curDestData.GetFoodLeftTime() % 600 != 0) { nLeftTenMinues = nLeftTenMinues + 1; } if (nLeftTenMinues <= 0) { nLeftTenMinues = 1; } nCostYuanBao = nLeftTenMinues * curTableFood.CostYuanBao; //string strTip = StrDictionary.GetClientDictionaryString("#{2339}", (int)nCostYuanBao); //string strTitle = StrDictionary.GetClientDictionaryString("#{1000}"); //MessageBoxLogic.OpenOKCancelBox(strTip, strTitle, OnFinishPrepareDesk, null); MessageBoxLogic.OpenCostBox(Utils.GetDicByID(11362), null, Utils.GetDicByID(11361), Utils.GetDicByID(11363), "qian3", "X" + nCostYuanBao, OnFinishPrepareDesk); }
void OnChangeOKClick() { if (null == Singleton <ObjManager> .GetInstance().MainPlayer) { return; } if (m_NoticeInput == null) { return; } if (false == GameManager.gameManager.PlayerDataPool.IsHaveGuild()) { return; } Guild info = GameManager.gameManager.PlayerDataPool.GuildInfo; GuildMember mainPlayerGuildInfo = info.GetMainPlayerGuildInfo(); if (false == mainPlayerGuildInfo.IsValid()) { return; } if (false == info.IsHaveAuthority(mainPlayerGuildInfo.Job, (int)GameDefine_Globe.GUILD_ROUTINE.GUILD_ROUTINE_CHANGE_NOTICE)) { GUIData.AddNotifyData("#{2513}"); return; } string szNoticeContent = m_NoticeInput.value; if (szNoticeContent.Length <= 0) { GUIData.AddNotifyData("#{10455}"); return; } if (Encoding.UTF8.GetBytes(szNoticeContent).Length > GlobeVar.MAX_GUILD_NOTICE) { GUIData.AddNotifyData("#{10366}"); return; } if (null != Utils.GetStrFilter(szNoticeContent, (int)GameDefine_Globe.STRFILTER_TYPE.STRFILTER_NAME)) { GUIData.AddNotifyData("#{1278}"); return; } Singleton <ObjManager> .GetInstance().MainPlayer.ReqChangeGuildDeclaration(szNoticeContent); gameObject.SetActive(false); }
void OnClickWing() { if (!GameManager.gameManager.PlayerDataPool.IsServerFlagOpen(SERVER_FLAGS_ENUM.FLAG_FLYWING) || !GameManager.gameManager.PlayerDataPool.CommonData.GetCommondFlag((int)USER_COMMONFLAG.CF_OPEN_FLYWING)) { GUIData.AddNotifyData("#{10830}"); return; } UIManager.ShowUI(UIInfo.FlyWingRoot); }
/// <summary> /// 寻找配对 /// </summary> void OnLookForFriendClick() { if (m_BabyFellow == null) { GUIData.AddNotifyData("#{10331}"); return; } m_PublishConfirmDialog.SetDate(m_BabyFellow); m_PublishConfirmDialog.gameObject.SetActive(true); }
void Buy() { if (m_LeftCount <= 0) { GUIData.AddNotifyData("#{10519}"); return; } NumChooseController.OpenWindow(1, m_LeftCount, StrDictionary.GetClientDictionaryString("#{2837}"), MsgBoxBuyGuildItemOK, 1); }
/// <summary> /// // 打开准备食物界面,只有自己酒楼才有此功能 /// </summary> /// <param name="curDesk"></param> public void OpenFoodWindow(RestaurantDesk curDesk) { if (!m_bSelfData) { GUIData.AddNotifyData("#{2017}"); return; } m_curOperationDesk = curDesk; if (m_FoodWindow != null) { m_FoodWindow.SetActive(true); } }
public void _Update() { if (m_RealPvpBlock == GlobeVar.INVALID_ID) { return; } _clearGrid(); m_PvpItemLogic.gameObject.SetActive(true); m_GridItemList.transform.parent.gameObject.SetActive(true); int count = 0; int page = 0; for (int i = 0; i < TableManager.GetPvpShop().Count; ++i) { Tab_PvpShop tab = TableManager.GetPvpShopByID(i, 0); if (tab != null && tab.Block == m_RealPvpBlock) { if (m_PvpItemLogic != null) { Tab_CommonItem Tab_CommonItem = TableManager.GetCommonItemByID(tab.ItemId, 0); if (Tab_CommonItem != null) { if (GameManager.gameManager.PlayerDataPool.PvpShopItemBuyNum.ContainsKey(tab.ItemId)) { count += 1; GameObject obj = Utils.BindObjToParent(m_PvpItemLogic.gameObject, m_GridItemList.gameObject, tab.Index.ToString()); obj.GetComponent <pvpItemLogic>().setPvpItemData(Tab_CommonItem.Name, tab.ItemCount, tab.MoneyCount, Tab_CommonItem.Icon, GameManager.gameManager.PlayerDataPool.PvpShopItemBuyNum[tab.ItemId], tab.Index, m_RealPvpBlock, Tab_CommonItem.Quality); } } } } if (count >= 6 || (count > 0 && i + 1 >= TableManager.GetPvpShop().Count)) { page += 1; GameObject temObj = Utils.BindObjToParent(m_GridItemList.transform.parent.gameObject, m_GridRoot.gameObject, page.ToString()); Utils.CleanGrid(m_GridItemList.gameObject); count = 0; } } m_PvpItemLogic.gameObject.SetActive(false); m_GridItemList.transform.parent.gameObject.SetActive(false); m_GridRoot.repositionNow = true; m_GridRoot.GetComponent <UICenterOnChild>().onCenterFinished = SetPagNum; m_GridRoot.GetComponent <UICenterOnChild>().Recenter(); GUIData.AddNotifyData("#{2135}"); }
/// <summary> /// /// </summary> /// <param name="item"></param> public void OnSelectSwordsManItem(SwordsManItem item) { SwordsManContainer Container = GameManager.gameManager.PlayerDataPool.GetSwordsManContainer(m_PackType); if (Container == null) { return; } SwordsMan oSwordsMan = Container.GetSwordsManByGuid(m_SwordsManGuid); if (oSwordsMan == null) { return; } if (item == null) { return; } if (item.m_oSwordsMan == null) { return; } if (item.m_oSwordsMan.Quality > oSwordsMan.Quality) { GUIData.AddNotifyData("#{2497}"); return; } if (item.m_oSwordsMan.Locked) { return; } if (item.m_oSwordsMan.Guid != oSwordsMan.Guid) { item.OnSelectSwordsMan(); if (item.IsSelect()) { m_nEatExp += item.m_oSwordsMan.GetEatExp(); } else { m_nEatExp -= item.m_oSwordsMan.GetEatExp(); } ShowSwordsManExp(); } else { GUIData.AddNotifyData("#{2557}"); } }
void MsgBoxBuyGuildItemOK(int nCurNum) { //nCurNum数量判断 if (nCurNum < 1 || nCurNum > m_LeftCount) { return; } //判断帮会GUID if (false == GameManager.gameManager.PlayerDataPool.IsHaveGuild()) { return; } //背包判断 if (GameManager.gameManager.PlayerDataPool.BackPack.GetCanContainerSize() <= 0) { Singleton <ObjManager> .Instance.MainPlayer.SendNoticMsg(false, "#{1903}"); return; } //判断个人公会积分是否够 int nRealCost = m_nPrice * nCurNum; if (nRealCost > 0) { int nGuildDKP = GameManager.gameManager.PlayerDataPool.GuildDKP; if (nRealCost > nGuildDKP) { //个人公会积分,返回 GUIData.AddNotifyData("#{2465}"); return; } } else { //可能溢出,直接返回 return; } //发送购买消息包 CG_BUY_GUILDGOODS msg = (CG_BUY_GUILDGOODS)PacketDistributed.CreatePacket(MessageID.PACKET_CG_BUY_GUILDGOODS); msg.GoodID = m_GoodsId; msg.BuyNum = nCurNum; msg.GoodIndex = m_GoodsIndex; msg.SendPacket(); }