public void OnTouchChipIcon(ChipSphereIconButton.Parameter parameter, bool doAnimationOff = true) { if (this.selectedChipParameter == parameter) { if (this.myMenuType == CMD_ChipSphere.MenuType.Empty || this.myMenuType == CMD_ChipSphere.MenuType.Detail) { this.HideLoopAnim(); this.ShowAttachPage(doAnimationOff); } return; } if (this.isTouchGuard) { return; } this.HideLoopAnim(); this.selectedChipParameter = parameter; if (!parameter.IsEmpty()) { this.currentUserChipList = ChipDataMng.GetUserChip(parameter.userChipId); } else { this.currentUserChipList = null; } this.chipSphereIconButtons[this.oldButtonIndex].SetUnChoose(); this.chipSphereIconButtons[parameter.buttonNo - 1].SetChoose(); this.oldButtonIndex = parameter.buttonNo - 1; this.myMenuType = parameter.menuType; if (!this.onceAnimFlag) { this.onceAnimFlag = true; this.ChangeStatusRoot(parameter); } else { this.cachedParameter = parameter; this.isTouchGuard = true; this.MoveAnim(); } }
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; } } }
private ChipSphereIconButton.Parameter CreateParameter(int myGrowStep, int myArousal, int buttonNo) { int type = 0; CMD_ChipSphere.MenuType menuType = CMD_ChipSphere.MenuType.Empty; string chipName = string.Empty; string chipDetail = string.Empty; int userChipId = 0; int itemCount = 0; GameWebAPI.RespDataCS_MonsterSlotInfoListLogic.Manage slotStatus = CMD_ChipSphere.DataChg.GetChipEquip().GetSlotStatus(); int num = slotStatus.maxSlotNum + slotStatus.extraSlotNum; if (buttonNo == 1) { if (MonsterGrowStepData.IsRipeScope(myGrowStep) || MonsterGrowStepData.IsPerfectScope(myGrowStep) || MonsterGrowStepData.IsUltimateScope(myGrowStep)) { menuType = CMD_ChipSphere.MenuType.Empty; } else { menuType = CMD_ChipSphere.MenuType.NotYet; string growStepName = MonsterGrowStepData.GetGrowStepName(5.ToString()); chipName = growStepName; string @string = StringMaster.GetString("ChipInstallingEvolutionInfo"); chipDetail = string.Format(@string, growStepName); } } else if (buttonNo == 2) { if (MonsterGrowStepData.IsPerfectScope(myGrowStep) || MonsterGrowStepData.IsUltimateScope(myGrowStep)) { menuType = CMD_ChipSphere.MenuType.Empty; } else { menuType = CMD_ChipSphere.MenuType.NotYet; string growStepName2 = MonsterGrowStepData.GetGrowStepName(6.ToString()); chipName = growStepName2; string string2 = StringMaster.GetString("ChipInstallingEvolutionInfo"); chipDetail = string.Format(string2, growStepName2); } } else if (buttonNo == 3) { if (MonsterGrowStepData.IsUltimateScope(myGrowStep)) { menuType = CMD_ChipSphere.MenuType.Empty; } else { menuType = CMD_ChipSphere.MenuType.NotYet; string growStepName3 = MonsterGrowStepData.GetGrowStepName(7.ToString()); chipName = growStepName3; string string3 = StringMaster.GetString("ChipInstallingEvolutionInfo"); chipDetail = string.Format(string3, growStepName3); this.chipSphereLines.OpenMiddleToLeftUp(ChipSphereLines.LineType.None); } } else if (buttonNo == 4) { if (myArousal >= 2) { menuType = CMD_ChipSphere.MenuType.Empty; } else { menuType = CMD_ChipSphere.MenuType.NotYet; string string4 = StringMaster.GetString("CharaStatus-23"); chipName = string.Format("{0}{1}", string4, 2); chipDetail = string4; this.chipSphereLines.OpenMiddleToRightDown(ChipSphereLines.LineType.None); } } else if (buttonNo == 5) { if (myArousal >= 4) { menuType = CMD_ChipSphere.MenuType.Empty; } else { menuType = CMD_ChipSphere.MenuType.NotYet; string string5 = StringMaster.GetString("CharaStatus-23"); chipName = string.Format("{0}{1}", string5, 4); chipDetail = string5; this.chipSphereLines.OpenMiddleToRightUp(ChipSphereLines.LineType.None); } } else if (buttonNo >= 6) { type = 1; itemCount = ConstValue.CHIP_EXTEND_SLOT_NEEDS[buttonNo - 6]; if (buttonNo <= num) { menuType = CMD_ChipSphere.MenuType.Empty; } else { menuType = CMD_ChipSphere.MenuType.Extendable; } } if (CMD_ChipSphere.DataChg.GetSlotEquip() == null) { global::Debug.Log("装着はありません."); } else { foreach (GameWebAPI.RespDataCS_MonsterSlotInfoListLogic.Equip equip in CMD_ChipSphere.DataChg.GetSlotEquip()) { int num2 = ChipTools.ConvertToButtonNo(equip); if (buttonNo == num2) { menuType = CMD_ChipSphere.MenuType.Detail; userChipId = equip.userChipId; break; } } } return(new ChipSphereIconButton.Parameter { type = type, buttonNo = buttonNo, menuType = menuType, itemCount = itemCount, chipName = chipName, chipDetail = chipDetail, userChipId = userChipId }); }