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 void SetDetail(GameWebAPI.RespDataMA_TitleMaster.TitleM titleMaster, bool owned, bool equiped, Action <TitleListItem> touchEvent) { this.titleId = int.Parse(titleMaster.titleId); this.owned = owned; this.equiped = equiped; this.onSelectTitle = touchEvent; this.equipedIcon.SetActive(this.equiped); TitleDataMng.SetTitleIcon(titleMaster.titleId, base.GetComponent <UITexture>()); if (!this.owned) { base.GetComponent <UITexture>().color = Util.convertColor(109f, 109f, 109f, 255f); } }
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); }
public static string GetImagePath(GameWebAPI.RespDataMA_TitleMaster.TitleM titleM) { return("HonorificThumbnail/" + titleM.img); }
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); }