public void SetupDetail(int userChipId, GameWebAPI.RespDataMA_ChipM.Chip chipData) { this.isOpened = true; this.SetupOnlyDetailParams(userChipId, chipData); this.frameSprite.spriteName = "Chip_Sphere_Thumbnail_ON"; NGUITools.SetActiveSelf(this.chargesGO, false); NGUITools.SetActiveSelf(this.lookGO, false); NGUITools.SetActiveSelf(this.chipNameLabel.gameObject, true); NGUITools.SetActiveSelf(this.chipDescriptLabel.gameObject, true); this.chipNameLabel.text = this.myParameter.chipName; this.chipDescriptLabel.text = this.myParameter.chipDetail; NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, chipData.GetIconPath(), false, null); NGUITools.SetActiveSelf(this.rankSprite.gameObject, true); this.rankSprite.spriteName = ChipTools.GetRankPath(chipData.rank); }
private void SetupIcon(GameWebAPI.RespDataMA_ChipM.Chip chipMainData) { NGUITools.SetActiveSelf(this.thumbnailTexture.gameObject, true); NGUIUtil.ChangeUITextureFromFileASync(this.thumbnailTexture, chipMainData.GetIconPath(), false, null); if (this.rareSprite != null) { this.rareSprite.spriteName = ChipTools.GetRankPath(chipMainData.rank); NGUITools.SetActiveSelf(this.rareSprite.gameObject, true); } if (this.noChipLabel != null) { NGUITools.SetActiveSelf(this.noChipLabel.gameObject, false); } if (this.chipNameLabel != null) { NGUITools.SetActiveSelf(this.chipNameLabel.gameObject, true); this.chipNameLabel.text = chipMainData.name; } }
public void SetupDetail(ChipSphereIconButton.Parameter parameter) { switch (parameter.menuType) { case CMD_ChipSphere.MenuType.Empty: NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, "ChipThumbnail/Chip_Empty", false, null); NGUITools.SetActiveSelf(this.chipTexture.gameObject, true); NGUITools.SetActiveSelf(this.chipNameLabel.gameObject, false); NGUITools.SetActiveSelf(this.rareSprite.gameObject, false); NGUITools.SetActiveSelf(this.chipLookTexture.gameObject, false); NGUITools.SetActiveSelf(this.lookGO, false); this.messageLabel.text = StringMaster.GetString("ChipInstalling-03"); this.buttonLabel.text = StringMaster.GetString("ChipInstalling-04"); this.chipNameLabel.color = Color.white; this.myMenuType = parameter.menuType; this.buttonSprite.spriteName = "Common02_Btn_Green"; this.buttonCollider.enabled = true; this.buttonLabel.color = Color.white; this.buttonLabel.effectColor = this.defaultButtonLabelEffectColor; break; case CMD_ChipSphere.MenuType.Extendable: { NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, "ChipThumbnail/Chip_NotOpen", true, null); NGUITools.SetActiveSelf(this.lookGO, true); NGUITools.SetActiveSelf(this.rareSprite.gameObject, false); NGUITools.SetActiveSelf(this.chipNameLabel.gameObject, true); NGUITools.SetActiveSelf(this.chipLookTexture.gameObject, false); NGUITools.SetActiveSelf(this.chipTexture.gameObject, true); int itemCount = parameter.itemCount; this.chipNameLabel.text = string.Format("×{0}", itemCount); this.buttonLabel.text = StringMaster.GetString("ChipInstalling-08"); global::Debug.LogFormat("{0} >= {1}, isOpened:{2}", new object[] { this.extendItemCount, itemCount, parameter.isOpened }); bool flag = this.extendItemCount >= itemCount; if (flag) { this.chipNameLabel.color = Color.white; } else { this.chipNameLabel.color = Color.red; } if (flag && parameter.isExtendable) { this.messageLabel.text = StringMaster.GetString("ChipInstalling-07"); this.buttonSprite.spriteName = "Common02_Btn_Green"; this.buttonCollider.enabled = true; this.buttonLabel.color = Color.white; this.buttonLabel.effectColor = this.defaultButtonLabelEffectColor; } else { this.messageLabel.text = StringMaster.GetString("ChipInstalling-11"); this.buttonSprite.spriteName = "Common02_Btn_Gray"; this.buttonCollider.enabled = false; this.buttonLabel.color = ConstValue.DEACTIVE_BUTTON_LABEL; this.buttonLabel.effectColor = ConstValue.DEACTIVE_BUTTON_LABEL; } this.myMenuType = parameter.menuType; break; } case CMD_ChipSphere.MenuType.NotYet: { this.chipNameLabel.text = parameter.chipName; NGUITools.SetActiveSelf(this.rareSprite.gameObject, false); string text = string.Format(StringMaster.GetString("ChipInstalling-10"), parameter.chipDetail); this.messageLabel.text = text; break; } case CMD_ChipSphere.MenuType.Detail: { this.chipNameLabel.text = parameter.chipName; this.messageLabel.text = parameter.chipDetail; NGUIUtil.ChangeUITextureFromFileASync(this.chipTexture, parameter.chipIconPath, false, null); NGUITools.SetActiveSelf(this.chipTexture.gameObject, true); this.rareSprite.spriteName = ChipTools.GetRankPath(parameter.chipRank); NGUITools.SetActiveSelf(this.rareSprite.gameObject, true); this.buttonSprite.spriteName = "Common02_Btn_Red"; this.buttonCollider.enabled = true; this.buttonLabel.color = Color.white; this.buttonLabel.effectColor = this.defaultButtonLabelEffectColor; GameWebAPI.RespDataMA_ChipM.Chip chipEnhancedData = ChipDataMng.GetChipEnhancedData(parameter.ConvertChipId()); if (chipEnhancedData != null) { if (this.reinforcementButtonSprite != null) { this.reinforcementButtonSprite.spriteName = "Common02_Btn_Green"; } if (this.reinforcementButtonCollider != null) { this.reinforcementButtonCollider.enabled = true; } if (this.reinforcementButtonLabel != null) { this.reinforcementButtonLabel.color = Color.white; } if (this.buttonLabel != null) { this.buttonLabel.effectColor = this.defaultReinforcementButtonLabelEffectColor; } } else { if (this.reinforcementButtonSprite != null) { this.reinforcementButtonSprite.spriteName = "Common02_Btn_Gray"; } if (this.reinforcementButtonCollider != null) { this.reinforcementButtonCollider.enabled = false; } if (this.reinforcementButtonLabel != null) { this.reinforcementButtonLabel.color = ConstValue.DEACTIVE_BUTTON_LABEL; } if (this.buttonLabel != null) { this.buttonLabel.effectColor = ConstValue.DEACTIVE_BUTTON_LABEL; } } break; } } }
public void SetRankSprite(string rank) { this.rankSprite.spriteName = ChipTools.GetRankPath(rank); }