protected string GetDescription(GameWebAPI.RespDataCP_Campaign.CampaignType cpmType, float rate) { return(CampaignUtil.GetDescription(cpmType, rate, this.useLongDescription)); }
private void MakeData() { int chipFactoryCT = this.GetFacilityCount(25); if (this.TrainingMenuPartsDataL != null) { for (int i = 0; i < this.TrainingMenuPartsDataL.Count; i++) { GUIListPartsTrainingMenu.PartsData partsData = this.TrainingMenuPartsDataL[i]; partsData.strCampaign = string.Empty; partsData.isInfo = false; partsData.isNew = false; partsData.labelCol = this.buttonTextColor; partsData.LRCol = this.buttonParenthesesColor; int num = 0; string strTitle = partsData.strTitle; switch (strTitle) { case "MealTitle": { GameWebAPI.RespDataCP_Campaign.CampaignInfo campaignInfo = DataMng.Instance().GetCampaignInfo(GameWebAPI.RespDataCP_Campaign.CampaignType.MeatExpUp); if (campaignInfo != null) { num++; } if (num > 1) { partsData.strCampaign = StringMaster.GetString("Campaign"); } else if (num == 1 && campaignInfo != null) { partsData.strCampaign = CampaignUtil.GetDescription(GameWebAPI.RespDataCP_Campaign.CampaignType.MeatExpUp, float.Parse(campaignInfo.rate), true); } partsData.actCallBack = delegate() { CMD_BaseSelect.BaseType = CMD_BaseSelect.BASE_TYPE.MEAL; GUIMain.ShowCommonDialog(null, "CMD_BaseSelect", null); }; break; } case "ReinforcementTitle": { GameWebAPI.RespDataCP_Campaign.CampaignInfo campaignInfo = DataMng.Instance().GetCampaignInfo(GameWebAPI.RespDataCP_Campaign.CampaignType.TrainExpUp); if (campaignInfo != null) { num++; } GameWebAPI.RespDataCP_Campaign.CampaignInfo campaignInfo2 = DataMng.Instance().GetCampaignInfo(GameWebAPI.RespDataCP_Campaign.CampaignType.TrainCostDown); if (campaignInfo2 != null) { num++; } GameWebAPI.RespDataCP_Campaign.CampaignInfo campaignInfo3 = DataMng.Instance().GetCampaignInfo(GameWebAPI.RespDataCP_Campaign.CampaignType.TrainLuckUp); if (campaignInfo3 != null) { num++; } if (num > 1) { partsData.strCampaign = StringMaster.GetString("Campaign"); } else if (num == 1) { if (campaignInfo != null) { partsData.strCampaign = CampaignUtil.GetDescription(GameWebAPI.RespDataCP_Campaign.CampaignType.TrainExpUp, float.Parse(campaignInfo.rate), true); } if (campaignInfo2 != null) { partsData.strCampaign = CampaignUtil.GetDescription(GameWebAPI.RespDataCP_Campaign.CampaignType.TrainCostDown, float.Parse(campaignInfo2.rate), true); } if (campaignInfo3 != null) { partsData.strCampaign = CampaignUtil.GetDescription(GameWebAPI.RespDataCP_Campaign.CampaignType.TrainLuckUp, float.Parse(campaignInfo3.rate), true); } } partsData.actCallBack = delegate() { GUIMain.ShowCommonDialog(null, "CMD_ReinforcementTOP", null); }; break; } case "SuccessionTitle": TrainingMenuButtonSuccession.SetButtonInfo(partsData, this.buttonDisableColor); break; case "ArousalTitle": TrainingMenuButtonResistance.SetButtonInfo(partsData, this.buttonDisableColor); break; case "LaboratoryTitle": partsData.actCallBack = delegate() { GUIMain.ShowCommonDialog(null, "CMD_Laboratory", null); }; break; case "MedalInheritTitle": { GameWebAPI.RespDataCP_Campaign.CampaignInfo campaignInfo = DataMng.Instance().GetCampaignInfo(GameWebAPI.RespDataCP_Campaign.CampaignType.MedalTakeOverUp); if (campaignInfo != null) { num++; } if (num > 1) { partsData.strCampaign = StringMaster.GetString("Campaign"); } else if (num == 1 && campaignInfo != null) { partsData.strCampaign = CampaignUtil.GetDescription(GameWebAPI.RespDataCP_Campaign.CampaignType.MedalTakeOverUp, float.Parse(campaignInfo.rate), true); } partsData.actCallBack = delegate() { GUIMain.ShowCommonDialog(null, "CMD_MedalInherit", null); }; break; } case "ChipSphereTitle": if (chipFactoryCT <= 0) { partsData.col = this.buttonDisableColor; partsData.labelCol = this.buttonDisableColor; partsData.LRCol = this.buttonDisableColor; } partsData.actCallBack = delegate() { if (chipFactoryCT > 0) { CMD_BaseSelect.BaseType = CMD_BaseSelect.BASE_TYPE.CHIP; CMD_BaseSelect.ElementType = CMD_BaseSelect.ELEMENT_TYPE.BASE; GUIMain.ShowCommonDialog(null, "CMD_BaseSelect", null); } else { CMD_ModalMessage cmd_ModalMessage = GUIMain.ShowCommonDialog(null, "CMD_ModalMessage", null) as CMD_ModalMessage; cmd_ModalMessage.Title = StringMaster.GetString("ChipFactoryMissingAlertTitle"); cmd_ModalMessage.Info = StringMaster.GetString("ChipFactoryMissingAlertInfo-1"); } }; break; case "ChipReinforceTitle": if (chipFactoryCT <= 0) { partsData.col = this.buttonDisableColor; partsData.labelCol = this.buttonDisableColor; partsData.LRCol = this.buttonDisableColor; } partsData.actCallBack = delegate() { if (chipFactoryCT > 0) { CMD_ChipReinforcement.Create(null); } else { CMD_ModalMessage cmd_ModalMessage = GUIMain.ShowCommonDialog(null, "CMD_ModalMessage", null) as CMD_ModalMessage; cmd_ModalMessage.Title = StringMaster.GetString("ChipFactoryMissingAlertTitle"); cmd_ModalMessage.Info = StringMaster.GetString("ChipFactoryMissingAlertInfo-2"); } }; break; case "VersionUpTitle": partsData.actCallBack = delegate() { GUIMain.ShowCommonDialog(null, "CMD_VersionUP", null); }; break; } if (string.Empty != partsData.strCampaign) { partsData.isInfo = true; } } } }