public void OnSelectTitle(TitleListItem titleItem) { GameWebAPI.RespDataMA_TitleMaster.TitleM titleM = TitleDataMng.GetDictionaryTitleM()[titleItem.GetTitleId()]; this.titleName.text = titleM.name; this.titleDetail.text = titleM.detail; TitleDataMng.SetTitleIcon(titleM.titleId, this.titleIcon); if (titleItem.GetEquiped() || !titleItem.GetOwned()) { this.equipBtn.GetComponent <UISprite>().spriteName = "Common02_Btn_Gray"; this.equipBtnLbl.color = ConstValue.DEACTIVE_BUTTON_LABEL; this.equipBtn.GetComponent <BoxCollider>().enabled = false; } else { this.equipBtn.GetComponent <UISprite>().spriteName = "Common02_Btn_Green"; this.equipBtnLbl.color = Color.white; this.equipBtn.GetComponent <BoxCollider>().enabled = true; } if (titleItem.GetEquiped()) { this.titleNameLbl.text = StringMaster.GetString("CurrentUserTitle"); } else { this.titleNameLbl.text = StringMaster.GetString("SelectedUserTitle"); } this.currentSelectedTitleId = titleItem.GetTitleId(); }
public static void SetTitleIcon(string titleId, UITexture targetTex) { if (titleId != null) { GameWebAPI.RespDataMA_TitleMaster.TitleM titleM = TitleDataMng.GetDictionaryTitleM()[int.Parse(titleId)]; if (titleM != null) { string imagePath = TitleDataMng.GetImagePath(titleM); TitleIconCacheBuffer.Instance().LoadAndCacheObj(imagePath, delegate(UnityEngine.Object obj) { if (obj != null) { Texture2D mainTexture = obj as Texture2D; targetTex.mainTexture = mainTexture; } }); } } }
private static string GetAssetValueName(int assetCategoryId, string assetValue) { string result = string.Empty; switch (assetCategoryId) { case 14: { GameWebAPI.RespDataMA_GetSoulM.SoulM soulMasterBySoulId = VersionUpMaterialData.GetSoulMasterBySoulId(assetValue); if (soulMasterBySoulId != null) { result = soulMasterBySoulId.soulName; } break; } default: if (assetCategoryId != 1) { if (assetCategoryId == 6) { GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(assetValue); if (itemM != null) { result = itemM.name; } } } else { GameWebAPI.RespDataMA_GetMonsterMS.MonsterM simple = MonsterMaster.GetMonsterMasterByMonsterId(assetValue).Simple; if (simple != null) { GameWebAPI.RespDataMA_GetMonsterMG.MonsterM group = MonsterMaster.GetMonsterMasterByMonsterGroupId(simple.monsterGroupId).Group; if (group != null) { result = group.monsterName; } } } break; case 16: { FacilityKeyM facilityKeyMaster = FarmDataManager.GetFacilityKeyMaster(assetValue); if (facilityKeyMaster != null) { result = facilityKeyMaster.facilityKeyName; } break; } case 17: { int chipId = int.Parse(assetValue); GameWebAPI.RespDataMA_ChipM.Chip chipMaster = ChipDataMng.GetChipMaster(chipId); if (chipMaster != null) { result = chipMaster.name; } break; } case 18: { GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => assetValue == x.dungeonTicketId); if (dungeonTicketM != null) { result = dungeonTicketM.name; } break; } case 19: { GameWebAPI.RespDataMA_TitleMaster.TitleM titleM = TitleDataMng.GetDictionaryTitleM()[int.Parse(assetValue)]; if (titleM != null) { result = titleM.name; } break; } } return(result); }
private string GetPresentName(GameWebAPI.RespDataMA_GetAssetCategoryM.AssetCategoryM masterAssetCategory, string objectId) { string result = StringMaster.GetString("Present-10"); if (masterAssetCategory != null) { result = masterAssetCategory.assetTitle; } MasterDataMng.AssetCategory assetCategory = (MasterDataMng.AssetCategory)masterAssetCategory.assetCategoryId.ToInt32(); switch (assetCategory) { case MasterDataMng.AssetCategory.FACILITY_KEY: { FacilityKeyM facilityKeyMaster = FarmDataManager.GetFacilityKeyMaster(objectId); if (facilityKeyMaster != null) { result = facilityKeyMaster.facilityKeyName; } break; } default: if (assetCategory != MasterDataMng.AssetCategory.MONSTER) { if (assetCategory == MasterDataMng.AssetCategory.ITEM) { GameWebAPI.RespDataMA_GetItemM.ItemM itemM = MasterDataMng.Instance().RespDataMA_ItemM.GetItemM(objectId); if (itemM != null) { result = itemM.name; } } } else { GameWebAPI.RespDataMA_GetMonsterMS.MonsterM simple = MonsterMaster.GetMonsterMasterByMonsterId(objectId).Simple; if (simple != null) { GameWebAPI.RespDataMA_GetMonsterMG.MonsterM group = MonsterMaster.GetMonsterMasterByMonsterGroupId(simple.monsterGroupId).Group; if (group != null) { result = group.monsterName; } } } break; case MasterDataMng.AssetCategory.DUNGEON_TICKET: { GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM dungeonTicketM = MasterDataMng.Instance().RespDataMA_DungeonTicketMaster.dungeonTicketM.FirstOrDefault((GameWebAPI.RespDataMA_DungeonTicketMaster.DungeonTicketM x) => objectId == x.dungeonTicketId); if (dungeonTicketM != null) { result = dungeonTicketM.name; } break; } case MasterDataMng.AssetCategory.TITLE: { GameWebAPI.RespDataMA_TitleMaster.TitleM titleM = TitleDataMng.GetDictionaryTitleM()[int.Parse(objectId)]; if (titleM != null) { result = titleM.name; } break; } } return(result); }
public void SetDetail(GameWebAPI.RespDataMS_MissionInfoLogic.Result.Mission missionInfo, Action <MissionItem> touchEvent) { this.rewardTagLabel.text = StringMaster.GetString("Mission-09"); this.arTagLabel.text = StringMaster.GetString("Mission-05"); int.TryParse(missionInfo.detail.missionId, out this.missionId); this.missionCategoryId = missionInfo.missionCategoryId; this.lastStepFlg = missionInfo.lastStepFlg; int categoryId = int.Parse(this.missionCategoryId); this.onPushedButton = touchEvent; int missionType = -1; int.TryParse(missionInfo.displayGroup, out missionType); int status = missionInfo.status; this.SetButton(status, missionType, categoryId); int num = 0; foreach (GameWebAPI.RespDataMS_MissionInfoLogic.Result.Mission.Reward reward2 in missionInfo.reward) { if (reward2.viewFlg == "1") { num++; } } if (num > 1) { this.rewardDetaildButton.SetActive(true); this.hiddenRewardNum.text = string.Format(StringMaster.GetString("MissionRewardHiddenNum"), num - 1); } else { this.rewardDetaildButton.SetActive(false); this.hiddenRewardNum.text = null; } this.tblBtnLayout.Reposition(); this.rightBlackPlate.SetActive(true); this.conditionTitle.text = missionInfo.detail.missionDetail; string text = string.Empty; int num2 = 0; string text2 = string.Empty; string text3 = string.Empty; GameWebAPI.RespDataMS_MissionInfoLogic.Result.Mission.Reward[] reward3 = missionInfo.reward; foreach (GameWebAPI.RespDataMS_MissionInfoLogic.Result.Mission.Reward reward4 in reward3) { if (reward4.viewFlg == "1") { int.TryParse(reward4.assetCategoryId, out num2); text = DataMng.Instance().GetAssetTitle(reward4.assetCategoryId, reward4.assetValue); text2 = reward4.assetValue; text3 = reward4.assetNum; break; } } AppCoroutine.Start(this.csItem.SetItemWithWaitASync(num2.ToString(), text2, text3, false, delegate { }), false); if (num2 == 19) { GameWebAPI.RespDataMA_TitleMaster.TitleM titleM; TitleDataMng.GetDictionaryTitleM().TryGetValue(int.Parse(text2), out titleM); this.lbRewardDetail.text = ((titleM == null) ? StringMaster.GetString("AlertDataErrorTitle") : titleM.name); this.lbRewardDetail.gameObject.SetActive(true); this.GoOperatorMsg.SetActive(false); this.quantity.gameObject.SetActive(false); } else { this.quantity.text = ((!(this.rewardIcon.spriteName == "Common02_Icon_Chip")) ? text3 : StringFormat.Cluster(text3)); this.lbRewardDetail.gameObject.SetActive(false); this.GoOperatorMsg.SetActive(true); this.quantity.gameObject.SetActive(true); } int num3 = 0; string missionValue = missionInfo.detail.missionValue; int.TryParse(missionValue, out num3); int num4 = Mathf.Clamp(missionInfo.nowValue, 0, num3); if (status != 2) { if (num3 != 0) { this.achievementRate.text = string.Format(StringMaster.GetString("SystemFraction"), num4, missionValue); } else { this.achievementRate.text = StringMaster.GetString("SystemNoneHyphen"); } this.achievementRate.spacingX = 0; this.achievementRate.color = Label.NOT_COMPLETE_COLOR; } else { this.achievementRate.text = StringMaster.GetString("Mission-06"); this.achievementRate.spacingX = -1; this.achievementRate.color = Label.COMPLETE_COLOR; } }