public void TryUpgradeRelics(int relicsID) { DRelics db = ReadCfgRelics.GetDataById(relicsID); if (db == null) { GTItemHelper.ShowTip("非法物品"); return; } XRelics relics = DataDBSRelics.GetDataById(relicsID); if (relics == null) { GTItemHelper.ShowTip("非法物品"); return; } if (relics.Level == db.LevelRequireExp.Length) { GTItemHelper.ShowTip("已升到最大等级,无法继续升级"); return; } for (int i = 0; i < 3; i++) { if (RelicsModule.Instance.GetExp(relics, i + 1) < db.LevelRequireExp[relics.Level]) { GTItemHelper.ShowTip("神器未获得足够的充能"); return; } } ReqUpgradeRelics req = new ReqUpgradeRelics(); req.RelicsID = relicsID; NetworkManager.Instance.Send(MessageID.MSG_REQ_UPGRADE_RELICS, req); }
private void OnBagCellClick(GameObject go) { GTAudioManager.Instance.PlayEffectAudio(GTAudioKey.SOUND_UI_CLICK); int pos = go.name.ToInt32(); GTItemHelper.ShowItemDialogByBagType(mShow, pos); }
public void TryChargeRelics(int relicsID, int index) { DRelics db = ReadCfgRelics.GetDataById(relicsID); if (db == null) { GTItemHelper.ShowTip("非法物品"); return; } if (index > 3 || index < 1) { GTItemHelper.ShowTip("非法索引" + index.ToString()); return; } XRelics relics = DataDBSRelics.GetDataById(relicsID); if (relics != null) { if (RelicsModule.Instance.GetExp(relics, index) >= db.LevelRequireExp[relics.Level]) { GTItemHelper.ShowTip("你不能对此充能了"); return; } } if (GTItemHelper.CheckItemEnongh(db.ArtificeCostID[index - 1], 1) == false) { return; } ReqChargeRelics req = new ReqChargeRelics(); req.RelicsID = relicsID; req.Index = index; NetworkManager.Instance.Send(MessageID.MSG_REQ_CHARGE_RELICS, req); }
private void CreateItems() { Dictionary <int, DRelics> dict = ReadCfgRelics.Dict; Dictionary <int, DRelics> .Enumerator em = dict.GetEnumerator(); int i = 0; while (em.MoveNext()) { GameObject go = NGUITools.AddChild(cardTrans.gameObject, cardTemp); DRelics db = em.Current.Value; go.name = i.ToString(); go.SetActive(true); RelicsCard tab = new RelicsCard(); tab.btn = go; tab.trans = go.transform; tab.name = go.transform.Find("Name").GetComponent <UILabel>(); tab.progressBar = go.transform.Find("ProgressBar").GetComponent <UISlider>(); tab.progress = go.transform.Find("ProgressBar/Num").GetComponent <UILabel>(); tab.icon = go.transform.Find("Texture").GetComponent <UITexture>(); tab.id = em.Current.Key; tab.name.text = db.Name; tab.progressBar.value = 0; tab.progress.text = "0%"; GTItemHelper.ShowTexture(tab.icon, db.Icon); mMoveList.Add(i); mCards.Add(tab); i++; } em.Dispose(); }
private void OnUpdateBranchTask() { string format = GTItemHelper.GetText("[00ffff]【支线】[-]{0}"); string content = GTItemHelper.GetText("没有发现新任务"); mTaskContentType2.text = GTTools.Format(format, content); }
public void ShowViewByPos(EPosType posType, int pos) { this.mPos = pos; this.mPosType = posType; ShowDress(posType == EPosType.RoleEquip); XEquip equip = GTDataManager.Instance.GetEquipDataByPos(mPosType, mPos); if (equip == null) { return; } int itemID = equip.Id; ShowBaseView(itemID); equipFightValue.text = GTTools.Format("战斗力 {0}", GTAttrHelper.GetFightValue(equip)); equipAdvanceLevel.text = MLEquip.Instance.GetEquipAdvanceNameByLevel(equip.AdvanceLevel); Dictionary <EAttr, int> propertys = GTAttrHelper.GetPropertys(equip); title3.text = GTTools.Format("装备星级 {0}", equip.StarLevel); title2.text = GTTools.Format("进阶等级 {0}", equip.AdvanceLevel); title1.text = GTTools.Format("强化等级 {0}", equip.StrengthenLevel); GTItemHelper.ShowPropertyText(this.equipPropertys, propertys, true); GTItemHelper.ShowEquipStrengthText(text1, itemID, equip.StrengthenLevel); GTItemHelper.ShowEquipAdvanceText(text2, itemID, equip.AdvanceLevel); GTItemHelper.ShowEquipStarText(text3, itemID, equip.StarLevel); }
public void TryUpStarEquip(XEquip equip) { if (EquipModule.Instance.IsFullStarLevel(equip)) { GTItemHelper.ShowTip("装备星级已满"); return; } DEquip equipDB = ReadCfgEquip.GetDataById(equip.Id); int starID = equipDB.Quality * 1000 + equip.StarLevel + 1; DEquipStar db = ReadCfgEquipStar.GetDataById(starID); if (!GTItemHelper.CheckItemEnongh(db.CostMoneyId, db.CostMoneyNum)) { return; } if (!GTItemHelper.CheckItemEnongh(db.CostItemId, db.CostItemNum)) { return; } ReqUpStarEquip req = new ReqUpStarEquip(); req.TarEquip = equip; NetworkManager.Instance.Send <ReqUpStarEquip>(MessageID.MSG_REQ_UPSTAR_EQUIP, req); }
public void TryStrengthGem(XGem gem, List <XItem> list) { if (MLGem.Instance.IsFullStrengthenLevel(gem)) { GTItemHelper.ShowTip("宝石强化等级已满"); return; } if (list.Count == 0) { GTItemHelper.ShowTip("请添加升级材料"); return; } int exp = MLGem.Instance.GetExpByStrengthMatList(list); if (GTItemHelper.CheckItemEnongh(1, exp) == false) { return; } ReqStrengthGem req = new ReqStrengthGem(); req.TarGem = gem; req.UseItems.AddRange(list); NetworkManager.Instance.Send <ReqStrengthGem>(MessageID.MSG_REQ_STRENGTHEN_GEM, req); }
public bool CheckCopy(ECopyType copyType, int chapter, int copyID) { int key = (int)copyType; DWorld db = ReadCfgWorld.GetDataById(chapter); if (DataDBSRaid.ContainsKey(key)) { XRaid raid = DataDBSRaid.GetDataById(key); if (chapter > raid.MaxChapter) { if (chapter != raid.MaxChapter + 1) { GTItemHelper.ShowTip(string.Format("章节超出限制:{0}/{1}", chapter, raid.MaxChapter)); return(false); } if (copyID != db.Copys[0]) { GTItemHelper.ShowTip("非法CopyID" + copyID); return(false); } } else if (chapter == raid.MaxChapter) { if (copyID > raid.MaxCopyId + 1) { GTItemHelper.ShowTip("非法CopyID" + copyID); return(false); } } } return(true); }
public void ShowInfoByPos(EPosType posType, int pos) { this.mPos = pos; this.mPosType = posType; bool isDress = (posType == EPosType.RoleGem); ShowDress(isDress); XGem gem = GTDataManager.Instance.GetGemDataByPos(posType, pos); int itemID = gem.Id; DGem gemDB = ReadCfgGem.GetDataById(itemID); gemLevel.text = GTTools.Format("等级 {0}", gem.StrengthenLevel); gemFightValue.text = GTTools.Format("战斗力 {0}", AttrHelper.GetFightValue(gem)); ShowBaseView(itemID); GTItemHelper.ShowGemPropertyText(gemPropertys, itemID, gem.StrengthenLevel); DGemSuit suitDB = ReadCfgGemSuit.GetDataById(gemDB.Suit); int activeSuitNum = isDress ? GemModule.Instance.GetActiveSameSuitsCountByPos(pos) : 0; bool hasSuit = ReadCfgGemSuit.ContainsKey(gemDB.Suit); if (hasSuit) { ShowHasSuit(gemDB); ShowSuitPropertysView(activeSuitNum, suitDB); ShowSameSuitGemsView(gemDB.Id); } else { ShowNoSuit(); } }
private void ShowAwardItemsView() { DCopy copyDB = ReadCfgCopy.GetDataById(mCopyID); int awardID = copyDB.AwardId; List <KStruct> list = AwardModule.Instance.GetAwardDataByID(awardID); if (list == null) { return; } for (int i = 0; i < items.Count; i++) { ItemAward tab = items[i]; if (i < items.Count) { KStruct data = list[i]; tab.itemBtn.SetActive(true); GTItemHelper.ShowItemTexture(tab.itemTexture, data.Id); GTItemHelper.ShowItemQuality(tab.itemQuality, data.Id); GTItemHelper.ShowItemChip(tab.itemChip, data.Id); UIEventListener.Get(tab.itemBtn).onClick = delegate(GameObject go) { GTItemHelper.ShowItemDialogById(data.Id); }; } else { tab.itemBtn.SetActive(false); } } }
private void ShowBaseView(int itemID) { gemType.text = GemModule.Instance.GetGemTypeName(itemID); GTItemHelper.ShowItemName(gemName, itemID); GTItemHelper.ShowItemTexture(gemTexture, itemID); GTItemHelper.ShowItemQuality(gemQuality, itemID); }
private void OnAck_RoleLoginAck(MessageRecv obj) { System.IO.MemoryStream ms = new System.IO.MemoryStream(obj.Data); RoleLoginAck ack = Serializer.Deserialize <RoleLoginAck>(ms); if (GTItemHelper.ShowNetworkError(ack.RetCode) == false) { return; } GTGlobal.CurPlayerCarrerID = ack.Carrer; GTGlobal.CurPlayerGUID = ack.RoleID; for (int i = 0; i < ack.Action.Count; i++) { int num = (int)ack.Action[i]; int id = i + 101; DataDBSAction.Update(id, new XAction() { Id = id, Num = num }); } GTDataTimer.Instance.Init(); GTWorld.Instance.EnterGuide(); GTWorld.Instance.Bie.UseGuide = GTLauncher.Instance.UseGuide; GTEventCenter.FireEvent(GTEventID.TYPE_LOGIN_ROLELOGIN); }
private void OnAck_SelectServer(MessageRecv obj) { System.IO.MemoryStream ms = new System.IO.MemoryStream(obj.Data); SelectServerAck ack = Serializer.Deserialize <SelectServerAck>(ms); if (GTItemHelper.ShowNetworkError(ack.RetCode) == false) { return; } GTEventCenter.FireEvent(GTEventID.TYPE_LOGIN_SELECTSERVER); if (GTGlobal.IsAlong) { GTLauncher.Instance.LoadScene(GTCopyKey.SCENE_Role); } else { NetworkManager.Instance.Close(); NetworkManager.Instance.ConnectGameServer(ack.ServerAddr, ack.ServerPort, () => { RoleListReq req = new RoleListReq(); req.AccountID = MLLogin.Instance.LastAccountID; req.LoginCode = ack.LoginCode; NetworkManager.Instance.Send(MessageID.MSG_ROLE_LIST_REQ, req); }); } }
private void ShowContentView2() { Dictionary <int, DSkillTalent> dict = ReadCfgSkillTalent.Dict; Dictionary <int, DSkillTalent> .Enumerator em = dict.GetEnumerator(); XCharacter role = RoleModule.Instance.GetCurPlayer(); ECarrer carrer = ReadCfgActor.GetDataById(role.Id).Carrer; int[] activeArray = new int[mTalents.Count]; for (int i = 0; i < mTalents.Count; i++) { ItemTalent tab = mTalents[i]; tab.talentLevel.text = DSkillTalent.TALENT_LEVELS[i].ToString(); GTItemHelper.ShowImageBlack(tab.talentLevelBack, role.Level < DSkillTalent.TALENT_LEVELS[i]); activeArray[i] = 0; } while (em.MoveNext()) { if (carrer != em.Current.Value.Carrer) { continue; } DSkillTalent db = em.Current.Value; int layer = em.Current.Value.Layer; int i = db.Pos - 1; ItemTalent tab = mTalents[layer - 1]; GTItemHelper.ShowTexture(tab.talentIcons[i], db.Icon); tab.talentNames[i].text = db.Name.ToString(); tab.talentHighLights[i].SetActive(activeArray[layer - 1] == db.Pos); } em.Dispose(); }
public void TryReceiveReward(ECopyType copyType, int chapter, int awardIndex) { if (awardIndex < 0 || awardIndex > 2) { GTItemHelper.ShowTip("非法AwardIndex" + awardIndex); return; } int rewardState = RaidModule.Instance.GetChapterRewardStateByAwardIndex(chapter, awardIndex); switch (rewardState) { case ERewardState.NOT_RECEIVE: GTItemHelper.ShowTip("未达成条件"); return; case ERewardState.HAS_RECEIVE: GTItemHelper.ShowTip("奖励已领取"); return; } DWorld chapterDB = ReadCfgWorld.GetDataById(chapter); DAward awardDB = ReadCfgAward.GetDataById(chapterDB.Awards[awardIndex]); if (GTItemHelper.CheckBagFull(awardDB.MaxDropNum)) { return; } ReqGetChapterAward req = new ReqGetChapterAward(); req.CopyType = (int)copyType; req.Chapter = chapter; req.Index = awardIndex; NetworkManager.Instance.Send <ReqGetChapterAward>(MessageID.MSG_REQ_GET_CHAPTERAWARD, req); }
private void ShowView() { mEquipStrengthen.Show(mCurEquipFunc == EquipFunc.STRENGTHEN); mEquipAdvance.Show(mCurEquipFunc == EquipFunc.ADVANCE); mEquipStar.Show(mCurEquipFunc == EquipFunc.EQUIPSTAR); switch (mCurEquipFunc) { case EquipFunc.STRENGTHEN: currFuncName.text = "装备强化"; ShowStrengthenView(); break; case EquipFunc.ADVANCE: currFuncName.text = "装备进阶"; ShowAdvanceView(); break; case EquipFunc.EQUIPSTAR: currFuncName.text = "装备升星"; ShowEquipStarView(); break; } labMoneyNum1.text = GTDataManager.Instance.GetItemCountById(1).ToString(); labMoneyNum2.text = GTDataManager.Instance.GetItemCountById(2).ToString(); GTItemHelper.ShowItemTexture(moneyTexture1, 1); GTItemHelper.ShowItemTexture(moneyTexture2, 2); }
private void ShowGemPropertyView() { labPropertys.text = string.Empty; Dictionary <EAttr, int> propertys = AttrHelper.GetAllGemPropertysByIndex(mCurIndex); GTItemHelper.ShowPropertyText(labPropertys, propertys, false); }
private void ShowTaskState(ETaskState state) { switch (state) { case ETaskState.QUEST_DOING: btnGoto.SetActive(true); btnReceive.SetActive(false); break; case ETaskState.QUEST_CANSUBMIT: btnGoto.SetActive(false); btnReceive.SetActive(true); GTItemHelper.ShowImageBlack(btnReceive.GetComponent <UISprite>(), false); break; case ETaskState.QUEST_HASSUBMIT: btnGoto.SetActive(false); btnReceive.SetActive(true); GTItemHelper.ShowImageBlack(btnReceive.GetComponent <UISprite>(), true); break; default: btnGoto.SetActive(false); btnReceive.SetActive(false); break; } }
private void OnEquipCellClick(GameObject go) { GTAudioManager.Instance.PlayEffectAudio(GTAudioKey.SOUND_UI_CLICK); int pos = go.name.ToInt32(); GTItemHelper.ShowItemDialogByPosType(EPosType.RoleEquip, pos); }
private void OnInitItem(Transform trans, int index) { int id = index + 1; DAdventure db = ReadCfgAdventure.GetDataById(id); trans.Find("Name").GetComponent <UILabel>().text = db.Name; trans.Find("Icon").GetComponent <UISprite>().spriteName = db.Icon; if (db.Times <= 0) { trans.Find("Times").GetComponent <UILabel>().text = string.Empty; } else { string localString = GTItemHelper.GetText("次数:{0}/{1}"); trans.Find("Times").GetComponent <UILabel>().text = GTTools.Format(localString, db.Times, db.Times); } UIEventListener.Get(trans.gameObject).onClick = delegate(GameObject go) { GTAudioManager.Instance.PlayEffectAudio(GTAudioKey.SOUND_UI_CLICK); if (mCurAdventureIndex == index) { return; } this.mCurAdventureIndex = index; ShowSelect(mCurAdventureIndex); }; ShowSelect(index); }
private void OnGemItemClick(GameObject go) { GTAudioManager.Instance.PlayEffectAudio(GTAudioKey.SOUND_UI_CLICK); int targetPos = go.name.ToInt32(); int pos = GemModule.Instance.GetDressGemPosByIndexAndTargetPos(mCurIndex, targetPos); GTItemHelper.ShowItemDialogByPosType(EPosType.RoleGem, pos); }
private void PlayFailBottomTween() { mRecover.SetActive(true); btnQuit.SetActive(true); btnRecover.SetActive(true); mRecoverCostNum.text = GTDefine.RECOVER_COST_ITEM_NUM.ToString(); GTItemHelper.ShowItemTexture(mRecoverCostTexture, GTDefine.RECOVER_COST_ITEM_ID); }
private void ShowBaseView(int itemID) { equipStep.text = MLEquip.Instance.GetEquipStepByID(itemID); equipSuit.text = MLEquip.Instance.GetEquipSuitNameByID(itemID); equipEquipType.text = MLEquip.Instance.GetEquipTypeNameByID(itemID); GTItemHelper.ShowItemTexture(equipTexture, itemID); GTItemHelper.ShowItemQuality(equipQuality, itemID); GTItemHelper.ShowItemName(equipName, itemID); }
private void ShowAdvanceView() { XEquip equip = GTDataManager.Instance.GetEquipDataByPos(mPosType, mPos); if (equip == null) { return; } int itemID = equip.Id; if (EquipModule.Instance.IsFullStarLevel(equip)) { return; } GTItemHelper.ShowItemTexture(mEquipAdvance.nowEquipTexture, itemID); GTItemHelper.ShowItemQuality(mEquipAdvance.nowEquipQuality, itemID); GTItemHelper.ShowItemName(mEquipAdvance.nowEquipName, itemID); GTItemHelper.ShowItemTexture(mEquipAdvance.nexEquipTexture, itemID); GTItemHelper.ShowItemQuality(mEquipAdvance.nexEquipQuality, itemID); GTItemHelper.ShowItemName(mEquipAdvance.nexEquipName, itemID); Dictionary <EAttr, int> nowPropertys = AttrHelper.GetPropertys(equip); XEquip nexEquip = new XEquip(); GTTools.Copy(nexEquip, equip); nexEquip.AdvanceLevel++; Dictionary <EAttr, int> nexPropertys = AttrHelper.GetPropertys(nexEquip); GTItemHelper.ShowPropertyText(mEquipAdvance.nowEquipPropertys, nowPropertys, false); GTItemHelper.ShowPropertyText(mEquipAdvance.nexEquipPropertys, nexPropertys, false); mEquipAdvance.nowEquipFightValue.text = AttrHelper.GetFightValue(nowPropertys).ToString(); mEquipAdvance.nexEquipFightValue.text = AttrHelper.GetFightValue(nexPropertys).ToString(); DEquip equipDB = ReadCfgEquip.GetDataById(itemID); DEquipAdvanceCost db = ReadCfgEquipAdvanceCost.GetDataById(equipDB.Quality * 1000 + equip.AdvanceLevel + 1); int hasItemNum = GTDataManager.Instance.GetItemCountById(db.CostItemId); GTItemHelper.ShowItemTexture(mEquipAdvance.costItemTexture, db.CostItemId); GTItemHelper.ShowPriceText(mEquipAdvance.costItemNum, hasItemNum, db.CostItemNum); GTItemHelper.ShowItemQuality(mEquipAdvance.costItemQuality, itemID); if (db.CostEquipNum > 0) { mEquipAdvance.costEquipBtn.SetActive(true); GTItemHelper.ShowItemTexture(mEquipAdvance.costEquipTexture, itemID); GTItemHelper.ShowItemQuality(mEquipAdvance.costEquipQuality, itemID); int hasSameEquipNum = EquipModule.Instance.GetBagSameEquipList(equip).Count; GTItemHelper.ShowPriceText(mEquipAdvance.costEquipNum, hasSameEquipNum, db.CostEquipNum); } else { mEquipAdvance.costEquipBtn.SetActive(false); } GTItemHelper.ShowItemTexture(mEquipAdvance.costMoneyTexture, db.CostMoneyId); GTItemHelper.ShowItemNum(mEquipAdvance.costMoneyNum, db.CostMoneyNum); GTItemHelper.ShowEquipAdvanceText(mEquipAdvance.advanceText, itemID, equip.AdvanceLevel); }
public void Show(bool isPass) { Color color = isPass ? Color.white : Color.black; GTItemHelper.ShowImageBlack(icon, !isPass); for (int i = 0; i < stars.Length; i++) { stars[i].color = color; } }
private void OnUpgradeClick(GameObject go) { GTAudioManager.Instance.PlayEffectAudio(GTAudioKey.SOUND_UI_CLICK); if (mItems.Count == 0) { GTItemHelper.ShowTip("请添加食物"); return; } PetService.Instance.TryUpgradePet(mCurPetID, mItems); }
private void ShowView() { DActor db = ReadCfgActor.GetDataById(mSelectMountID); if (db == null) { return; } GTItemHelper.ShowItemName(mountName, db.Quality, db.Name); }
public void ShowInfo(int pos) { XItem item = DataDBSBagItem.GetDataById(pos); GTItemHelper.ShowItemName(itemName, item.Id); GTItemHelper.ShowItemTexture(itemTexture, item.Id); GTItemHelper.ShowItemQuality(itemQuality, item.Id); mItemPos = pos; mMaxUseCount = GTDataManager.Instance.GetItemCountById(item.Id); SetCurrCount(1); }
private void ShowView() { ItemMount tab = mMountItems[mSelectIndex]; DActor db = ReadCfgActor.GetDataById(tab.id); mMountSpeed.text = db.RSpeed.ToPoint(); GTItemHelper.ShowItemQuality(mMountQuality, db.Quality); XCharacter role = RoleModule.Instance.GetCurPlayer(); btnFight.SetActive(role.Mount != tab.id); }