private void CalculateUI() { CmpAccessory cmpAccessory = this.chaCtrl.cmpAccessory[this.SNo]; if (Object.op_Equality((Object)null, (Object)cmpAccessory)) { return; } if (!cmpAccessory.typeHair) { for (int index = 0; index < this.ssGloss.Length; ++index) { this.ssGloss[index].SetSliderValue(this.nowAcs.parts[this.SNo].colorInfo[index].glossPower); } for (int index = 0; index < this.ssMetallic.Length; ++index) { this.ssMetallic[index].SetSliderValue(this.nowAcs.parts[this.SNo].colorInfo[index].metallicPower); } } else { this.ssHairSmoothness.SetSliderValue(this.nowAcs.parts[this.SNo].colorInfo[0].smoothnessPower); this.ssHairMetallic.SetSliderValue(this.nowAcs.parts[this.SNo].colorInfo[0].metallicPower); } }
private static void ProcessForSkinnedAccessory(ChaControl chaControl, CmpAccessory accessory, int slotId) { if (accessory == null) { #if DEBUG throw new Exception($"Failed to find corrent accessory slot {slotId}."); #endif return; } var gameObject = accessory.gameObject; if (gameObject == null) { #if DEBUG throw new Exception($"Unable to find GameObject from the CmpAccessory Component {slotId}!"); #endif return; } var skinnedAccessory = gameObject.GetComponent <SkinnedAccessory>(); if (skinnedAccessory == null) { #if DEBUG throw new Exception($"Unable to find Skinned Accesory. {slotId}"); #endif return; } skinnedAccessory.Merge(chaControl); }
public void SetDefaultColor() { CmpAccessory cmpAccessory = this.chaCtrl.cmpAccessory[this.SNo]; if (Object.op_Equality((Object)null, (Object)cmpAccessory) || cmpAccessory.typeHair) { return; } this.chaCtrl.SetAccessoryDefaultColor(this.SNo); for (int index = 0; index < 4; ++index) { byte[] numArray = MessagePackSerializer.Serialize <ChaFileAccessory.PartsInfo.ColorInfo>((M0)this.nowAcs.parts[this.SNo].colorInfo[index]); this.orgAcs.parts[this.SNo].colorInfo[index] = (ChaFileAccessory.PartsInfo.ColorInfo)MessagePackSerializer.Deserialize <ChaFileAccessory.PartsInfo.ColorInfo>(numArray); } }
public static ChaControl GetOwningChaControl(this CmpAccessory accessoryComponent) { return(accessoryComponent.GetComponentInParent <ChaControl>()); }
public static int GetAccessoryIndex(this CmpAccessory accessoryComponent) { var chaControl = GetOwningChaControl(accessoryComponent); return(_getChaAccessoryCmpIndex(chaControl, accessoryComponent)); }
public override void UpdateCustomUI() { if (this.backSNo != this.SNo) { this.UpdateAcsList(-1); for (int _correctNo = 0; _correctNo < this.acCorrect.Length; ++_correctNo) { this.acCorrect[_correctNo].Initialize(this.SNo, _correctNo); } this.backSNo = this.SNo; } else if (this.customBase.forceUpdateAcsList) { this.UpdateAcsList(-1); this.customBase.forceUpdateAcsList = false; } this.customBase.showAcsControllerAll = this.customBase.chaCtrl.IsAccessory(this.SNo); if (!this.mainMenu.IsSelectAccessory()) { this.customBase.showAcsControllerAll = false; } base.UpdateCustomUI(); this.CalculateUI(); int num1 = this.nowAcs.parts[this.SNo].type - 350; for (int index = 0; index < this.tglType.Length; ++index) { this.tglType[index].SetIsOnWithoutCallback(num1 == index); } CmpAccessory cmpAccessory = this.chaCtrl.cmpAccessory[this.SNo]; bool flag = false; if (Object.op_Inequality((Object)null, (Object)cmpAccessory)) { flag = cmpAccessory.typeHair; } if (flag) { this.csHairBaseColor.SetColor(this.nowAcs.parts[this.SNo].colorInfo[0].color); this.csHairTopColor.SetColor(this.nowAcs.parts[this.SNo].colorInfo[1].color); this.csHairUnderColor.SetColor(this.nowAcs.parts[this.SNo].colorInfo[2].color); this.csHairSpecular.SetColor(this.nowAcs.parts[this.SNo].colorInfo[3].color); } else { for (int index = 0; index < this.csColor.Length; ++index) { this.csColor[index].SetColor(this.nowAcs.parts[this.SNo].colorInfo[index].color); } } this.sscAcs.SetToggleID(this.nowAcs.parts[this.SNo].id); int num2 = ChaAccessoryDefine.GetAccessoryParentInt(this.nowAcs.parts[this.SNo].parentKey) - 1; if (0 <= num2) { for (int index = 0; index < this.tglParent.Length; ++index) { this.tglParent[index].SetIsOnWithoutCallback(num2 == index); } } this.tglNoShake.SetIsOnWithoutCallback(this.nowAcs.parts[this.SNo].noShake); bool[] flagArray = new bool[2]; if (Object.op_Inequality((Object)null, (Object)this.chaCtrl.cmpAccessory[this.SNo])) { if (Object.op_Inequality((Object)null, (Object)this.chaCtrl.cmpAccessory[this.SNo].trfMove01)) { flagArray[0] = true; } if (Object.op_Inequality((Object)null, (Object)this.chaCtrl.cmpAccessory[this.SNo].trfMove02)) { flagArray[1] = true; } } for (int index = 0; index < this.acCorrect.Length; ++index) { ((Component)this.acCorrect[index]).get_gameObject().SetActiveIfDifferent(flagArray[index]); this.acCorrect[index].UpdateCustomUI(); this.customBase.showAcsController[index] = flagArray[index]; } this.RestrictAcsMenu(); if (!Object.op_Inequality((Object)null, (Object)this.titleText)) { return; } this.titleText.set_text(string.Format("{0:00} {1}", (object)(this.SNo + 1), (object)this.chaCtrl.lstCtrl.GetListInfo((ChaListDefine.CategoryNo) this.nowAcs.parts[this.SNo].type, this.nowAcs.parts[this.SNo].id).Name)); }
public void RestrictAcsMenu() { if (this.nowAcs.parts[this.SNo].type == 350) { if (Object.op_Implicit((Object)this.objAcsSelect)) { this.objAcsSelect.SetActiveIfDifferent(false); } this.ShowOrHideTab(false, 1, 2, 3, 4); } else { CmpAccessory cmpAccessory = this.chaCtrl.cmpAccessory[this.SNo]; if (Object.op_Equality((Object)null, (Object)cmpAccessory)) { return; } if (Object.op_Inequality((Object)null, (Object)this.objAcsSelect)) { this.objAcsSelect.SetActiveIfDifferent(true); } this.ShowOrHideTab(true, 1, 2, 3, 4); if (cmpAccessory.typeHair) { this.ShowOrHideTab(false, 1); } else { if (!cmpAccessory.useColor01 && !cmpAccessory.useColor02 && !cmpAccessory.useColor03 && (cmpAccessory.rendAlpha == null || cmpAccessory.rendAlpha.Length == 0)) { this.ShowOrHideTab(false, 1); } this.ShowOrHideTab(false, 2); } if (!cmpAccessory.typeHair) { int num1 = 1; if (Object.op_Inequality((Object)null, (Object)this.objColorGrp[0])) { this.objColorGrp[0].SetActiveIfDifferent(cmpAccessory.useColor01); } if (Object.op_Inequality((Object)null, (Object)this.objColorGrp[1])) { this.objColorGrp[1].SetActiveIfDifferent(cmpAccessory.useColor02); } if (Object.op_Inequality((Object)null, (Object)this.objColorGrp[2])) { this.objColorGrp[2].SetActiveIfDifferent(cmpAccessory.useColor03); } if (Object.op_Inequality((Object)null, (Object)this.objColorGrp[3])) { this.objColorGrp[3].SetActiveIfDifferent(cmpAccessory.rendAlpha != null && 0 != cmpAccessory.rendAlpha.Length); } if (Object.op_Inequality((Object)null, (Object)this.textColorTitle[0]) && cmpAccessory.useColor01) { this.textColorTitle[0].set_text(string.Format("{0}{1}", (object)"カラー", (object)num1++)); } if (Object.op_Inequality((Object)null, (Object)this.textColorTitle[1]) && cmpAccessory.useColor02) { this.textColorTitle[1].set_text(string.Format("{0}{1}", (object)"カラー", (object)num1++)); } if (Object.op_Inequality((Object)null, (Object)this.textColorTitle[2]) && cmpAccessory.useColor03) { this.textColorTitle[2].set_text(string.Format("{0}{1}", (object)"カラー", (object)num1++)); } if (!Object.op_Inequality((Object)null, (Object)this.textColorTitle[3]) || cmpAccessory.rendAlpha == null || cmpAccessory.rendAlpha.Length == 0) { return; } Text text = this.textColorTitle[3]; int num2 = num1; int num3 = num2 + 1; string str = string.Format("{0}{1}", (object)"カラー", (object)num2); text.set_text(str); } else { if (Object.op_Inequality((Object)null, (Object)this.csHairTopColor)) { ((Component)this.csHairTopColor).get_gameObject().SetActiveIfDifferent(cmpAccessory.useColor02); } if (!Object.op_Inequality((Object)null, (Object)this.csHairUnderColor)) { return; } ((Component)this.csHairUnderColor).get_gameObject().SetActiveIfDifferent(cmpAccessory.useColor03); } } }