using System; using System.Collections; using System.Collections.Generic; using Edit; using I2.Loc; using MaidStatus; using MaidStatus.CsvData; using scoutmode; using UnityEngine; using wf; using Yotogis; public class ProfileCtrl : MonoBehaviour { private bool m_enabledInput { get { return BaseMgr.Instance.m_enabledInput; } } private bool m_enabledPersonalityInput { get { return BaseMgr.Instance.m_enabledPersonalityInput; } } private int MAX_NAME_LENGTH { get { return (!Product.isEnglish) ? 8 : 11; } } public void Init(GameObject goProfilePanel, Status status) { this.m_goProfilePanel = goProfilePanel; this.m_maidStatus = status; string f_strObjName = "CharacterInfo/Name/FirstName"; string f_strObjName2 = "CharacterInfo/Name/LastName"; if (Product.isEnglish) { UTY.GetChildObject(base.gameObject, "CharacterInfo/Name", false).SetActive(false); UTY.GetChildObject(base.gameObject, "CharacterInfo/EnZone", false).SetActive(true); f_strObjName = "CharacterInfo/EnZone/NameZone/Name/FirstName"; f_strObjName2 = "CharacterInfo/EnZone/NameZone/Name/LastName"; } this.m_lContractType = UTY.GetChildObject(this.m_goProfilePanel, "ContractType/OutputField", false).GetComponent(); GameObject childObject = UTY.GetChildObject(this.m_goProfilePanel, f_strObjName, false); this.m_inFirstName = childObject.GetComponent(); this.m_clFirstName = childObject.GetComponent(); EventDelegate.Add(this.m_inFirstName.onChange, new EventDelegate.Callback(BaseMgr.Instance.OnChangeFirstName)); GameObject childObject2 = UTY.GetChildObject(this.m_goProfilePanel, f_strObjName2, false); this.m_inLastName = childObject2.GetComponent(); this.m_clLastName = childObject2.GetComponent(); EventDelegate.Add(this.m_inLastName.onChange, new EventDelegate.Callback(BaseMgr.Instance.OnChangeLastName)); this.m_buFirstName = UTY.GetChildObject(childObject, "Random", false).GetComponent(); EventDelegate.Add(this.m_buFirstName.onClick, delegate() { this.m_inFirstName.RemoveFocus(); this.m_inFirstName.value = MaidRandomName.GetFirstName(); }); this.m_buLastName = UTY.GetChildObject(childObject2, "Random", false).GetComponent(); EventDelegate.Add(this.m_buLastName.onClick, delegate() { this.m_inLastName.RemoveFocus(); this.m_inLastName.value = MaidRandomName.GetLastName(); }); GameObject childObject3 = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/EnZone/NickNameAndAge/Name/NickName", false); this.m_inNickName = childObject3.GetComponent(); this.m_clNickName = childObject3.GetComponent(); GameObject childObject4 = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/EnZone/NickNameAndAge/Age/Age", false); this.m_inAgeInput = childObject4.GetComponent(); this.m_clAgeInput = childObject4.GetComponent(); this.m_lMaidClassName = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/MaidClass/Type", false).GetComponent(); this.m_lMaidClassLevel = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/MaidClass/Level", false).GetComponent(); this.m_lMaidClassExp = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/MaidClass/Exp", false).GetComponent(); this.m_lMaidClassRequiredExp = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/MaidClass/RequiredExp", false).GetComponent(); this.m_lYotogiClassName = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/YotogiClass/Type", false).GetComponent(); this.m_lYotogiClassLevel = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/YotogiClass/Level", false).GetComponent(); this.m_lYotogiClassExp = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/YotogiClass/Exp", false).GetComponent(); this.m_lYotogiClassRequiredExp = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/YotogiClass/RequiredExp", false).GetComponent(); this.m_lRelation = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Relation", false).GetComponent(); this.m_lConditionText = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/ConditionText", false).GetComponent(); this.m_lYotogiPlayCount = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/OthersPlayCount", false).GetComponent(); this.m_lOthersPlayCount = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/YotogiPlayCount", false).GetComponent(); this.m_lHp = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Hp", false).GetComponent(); this.m_lLikability = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Likability", false).GetComponent(); this.m_lMind = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Mind", false).GetComponent(); this.m_lReception = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Reception", false).GetComponent(); this.m_lCare = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Care", false).GetComponent(); this.m_lStudyRate = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StudyRate", false).GetComponent(); this.m_lTeachRate = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/TeachRate", false).GetComponent(); GameObject childObject5 = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/Personal/PopupList", false); this.m_pPersonal = childObject5.GetComponent(); this.m_lPersonal = UTY.GetChildObject(childObject5, "LabelParent/Label", false).GetComponent(); bool flag = true; flag = (GameMain.Instance.CharacterMgr.status.GetFlag("オープニング終了") == 1); List allDatas = Personal.GetAllDatas(true); List list = new List(); foreach (Personal.Data data in allDatas) { if (SceneEdit.Instance.modeType != SceneEdit.ModeType.ScoutChara || LockData.personalEnabledIdList.Contains(data.uniqueName)) { string a = data.uniqueName.ToLower(); if (data.oldPersonal) { if (a == "pure" || a == "cool" || a == "pride") { if (GameMain.Instance.CharacterMgr.status.isAvailableTransfer) { list.Add(data); } } else if (flag) { if (data.single) { list.Add(data); } else if (!string.IsNullOrEmpty(GameMain.Instance.CMSystem.CM3D2Path) && data.compatible) { list.Add(data); } } } else { list.Add(data); } } } this.m_pPersonal.items.Clear(); if (Product.supportMultiLanguage) { this.m_pPersonal.isLocalized = true; ProfileCtrl.m_dicPersonal = new Dictionary(); foreach (Personal.Data data2 in list) { string termName = data2.termName; this.m_pPersonal.items.Add(termName); ProfileCtrl.m_dicPersonal.Add(termName, data2); } } else { ProfileCtrl.m_dicPersonal = new Dictionary(); foreach (Personal.Data data3 in list) { string drawName = data3.drawName; this.m_pPersonal.items.Add(drawName); ProfileCtrl.m_dicPersonal.Add(drawName, data3); } } EventDelegate.Add(this.m_pPersonal.onChange, delegate() { }); this.m_clPersonal = childObject5.GetComponent(); this.m_goPersonalSelectorIcon = UTY.GetChildObject(childObject5, "Symbol", false); GameObject childObject6 = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/SexualExperience/PopupList", false); this.m_pSexualExperience = childObject6.GetComponent(); ProfileCtrl.m_dicSexualExperience = new Dictionary(); for (int i = 0; i < Enum.GetValues(typeof(Seikeiken)).Length; i++) { Seikeiken seikeiken = (Seikeiken)i; ProfileCtrl.m_dicSexualExperience.Add(EnumConvert.GetString(seikeiken), seikeiken); } this.m_clSexualExperience = childObject6.GetComponent(); this.m_goSexualExperienceSelectorIcon = UTY.GetChildObject(childObject6, "Symbol", false); this.m_lHeight = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Body/Height", false).GetComponent(); this.m_lWeight = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Body/Weight", false).GetComponent(); this.m_lBust = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Body/Bust/Bust", false).GetComponent(); this.m_lCup = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Body/Bust/Cup", false).GetComponent(); this.m_lWaist = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Body/Waist", false).GetComponent(); this.m_lHip = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Body/Hip", false).GetComponent(); this.m_lCooking = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Cooking/Box", false).GetComponent(); this.m_lDance = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Dance/Box", false).GetComponent(); this.m_lVocal = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Vocal/Box", false).GetComponent(); this.m_lLovely = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Lovely/Box", false).GetComponent(); this.m_lElegance = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Elegance/Box", false).GetComponent(); this.m_lCharm = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Charm/Box", false).GetComponent(); this.m_lInran = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Inran/Box", false).GetComponent(); this.m_lMValue = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/MValue/Box", false).GetComponent(); this.m_lHentai = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Hentai/Box", false).GetComponent(); this.m_lHousi = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Housi/Box", false).GetComponent(); this.m_lMaidPoint = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/MaidPoint", false).GetComponent(); this.m_goMaidPointTitleAndFrame = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/MaidPoint/MaidPointTitleAndFrame", false); this.initMaidPointUIPosX = this.m_goMaidPointTitleAndFrame.transform.parent.localPosition.x; this.m_inFreeComment = UTY.GetChildObject(this.m_goProfilePanel, "Comment/FreeCommentWindow/FreeComment", false).GetComponent(); EventDelegate.Add(this.m_inFreeComment.onChange, new EventDelegate.Callback(BaseMgr.Instance.OnChangeFreeComment)); this.m_lProfileComment = UTY.GetChildObject(this.m_goProfilePanel, "Comment/ProfileCommentWindow/ProfileComment", false).GetComponent(); if (Product.supportMultiLanguage) { UILabel componentInChildren = this.m_inFreeComment.GetComponentInChildren(); if (componentInChildren != null) { componentInChildren.spacingX = 0; } this.m_lProfileComment.spacingX = 0; } this.m_goProfileComment = UTY.GetChildObject(this.m_goProfilePanel, "Comment/ProfileCommentWindow/ProfileComment", false); this.m_goFreeComment = UTY.GetChildObject(this.m_goProfilePanel, "Comment/FreeCommentWindow/FreeComment", false); GameObject childObject7 = UTY.GetChildObject(this.m_goProfilePanel, "Comment/ProfileCommentWindow/ProfileTab", false); this.m_bProfileTab = childObject7.GetComponent(); this.m_goProfileTabSelector = UTY.GetChildObject(childObject7, "SelectCursor", false); GameObject childObject8 = UTY.GetChildObject(this.m_goProfilePanel, "Comment/FreeCommentWindow/FreeTab", false); this.m_bFreeTab = childObject8.GetComponent(); this.m_goFreeTabSelector = UTY.GetChildObject(childObject8, "SelectCursor", false); this.activeColor = new Color(this.m_bProfileTab.defaultColor.r, this.m_bProfileTab.defaultColor.g, this.m_bProfileTab.defaultColor.b, 1f); this.inActiveColor = this.m_bProfileTab.defaultColor; this.m_goMaidSkillParent = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/MaidSkillViewer/Contents/MaidSkillUnitParent", false); this.m_goMaidSkillViewer = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/MaidSkillViewer", false); this.m_maidSkillScrollView = UTY.GetChildObject(this.m_goMaidSkillViewer, "Contents", false).GetComponent(); this.m_goCharacterParent = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/CharacterViewer/Contents/CharacterUnitParent", false); this.m_goCharacterViewer = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/CharacterViewer", false); this.m_characterScrollView = UTY.GetChildObject(this.m_goCharacterViewer, "Contents", false).GetComponent(); this.m_goPropensityParent = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/PropensityViewer/Contents/CharacterUnitParent", false); this.m_goPropensityViewer = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/PropensityViewer", false); this.m_propensityScrollView = UTY.GetChildObject(this.m_goPropensityViewer, "Contents", false).GetComponent(); this.m_goYotogiSkillParent = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/YotogiSkillViewer/Contents/YotogiSkillUnitParent", false); this.m_goYotogiSkillViewer = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/YotogiSkillViewer", false); this.m_yotogiSkillScrollView = UTY.GetChildObject(this.m_goYotogiSkillViewer, "Contents", false).GetComponent(); this.m_dicSpriteName = new Dictionary { { ProfileCtrl.LevelOfAchievement.level_1, "cm3d2_edit_profile_yotogiskill_sign_batu" }, { ProfileCtrl.LevelOfAchievement.level_2, "cm3d2_edit_profile_yotogiskill_sign_sankaku" }, { ProfileCtrl.LevelOfAchievement.level_3, "cm3d2_edit_profile_yotogiskill_sign_maru" }, { ProfileCtrl.LevelOfAchievement.level_4, "cm3d2_edit_profile_yotogiskill_sign_nijumaru" } }; this.m_dicUpperBtn = new Dictionary(); IEnumerator enumerator4 = Enum.GetValues(typeof(ProfileMgr.UpperButtonType)).GetEnumerator(); try { while (enumerator4.MoveNext()) { object obj = enumerator4.Current; ProfileMgr.UpperButtonType upperButtonType = (ProfileMgr.UpperButtonType)obj; if (upperButtonType != ProfileMgr.UpperButtonType.None) { GameObject childObject9 = UTY.GetChildObject(this.m_goProfilePanel, "UpperButton/" + upperButtonType.ToString(), false); UIButton component = childObject9.GetComponent(); GameObject childObject10 = UTY.GetChildObject(childObject9, "SelectCursor", false); childObject10.SetActive(false); ProfileCtrl.UpperButton upperButton = new ProfileCtrl.UpperButton(); upperButton.m_btnButton = component; upperButton.m_name = upperButtonType; upperButton.m_goSelectCursor = childObject10; this.m_dicUpperBtn.Add(upperButton.m_name, upperButton); } } } finally { IDisposable disposable; if ((disposable = (enumerator4 as IDisposable)) != null) { disposable.Dispose(); } } this.m_dicSubViewer = new Dictionary { { ProfileMgr.UpperButtonType.MaidSkill, this.m_goMaidSkillViewer }, { ProfileMgr.UpperButtonType.YotogiSkill, this.m_goYotogiSkillViewer }, { ProfileMgr.UpperButtonType.Character, this.m_goCharacterViewer }, { ProfileMgr.UpperButtonType.Propensity, this.m_goPropensityViewer } }; this.initCommentWindow(); this.LoadMaidParamData(); this.SetEnableInput(this.m_enabledInput, this.m_enabledPersonalityInput); this.m_bInited = true; if (Product.isPublic) { UIWFPositionStore component2 = UTY.GetChildObject(base.gameObject, "Layout_public", false).GetComponent(); if (component2 != null) { component2.Apply(); } UTY.GetChildObject(base.gameObject, "UpperButton/Character", false).GetComponent().width = 392; BoxCollider component3 = UTY.GetChildObject(base.gameObject, "UpperButton/Character", false).GetComponent(); component3.size = new Vector3(392f, component3.size.y, 0f); } if (Product.isEnglish) { UIWFPositionStore component4 = UTY.GetChildObject(base.gameObject, "Layout_en", false).GetComponent(); if (component4 != null) { component4.Apply(); } if (Product.isPublic) { UTY.GetChildObject(base.gameObject, "UpperButton", false).transform.localPosition = new Vector3(0f, -69f, 0f); UTY.GetChildObject(base.gameObject, "Comment", false).transform.localPosition = new Vector3(UTY.GetChildObject(base.gameObject, "Comment", false).transform.localPosition.x, -42f, 0f); } else { UTY.GetChildObject(base.gameObject, "Comment", false).transform.localPosition = new Vector3(UTY.GetChildObject(base.gameObject, "Comment", false).transform.localPosition.x, -124f, 0f); } } } private void SetEnableInput(bool enabledInput, bool enabledPersonalityInput) { this.m_inFirstName.enabled = enabledInput; this.m_inLastName.enabled = enabledInput; this.m_clFirstName.enabled = enabledInput; this.m_clLastName.enabled = enabledInput; this.m_buFirstName.gameObject.SetActive(enabledInput); this.m_buLastName.gameObject.SetActive(enabledInput); Behaviour inAgeInput = this.m_inAgeInput; this.m_clAgeInput.enabled = enabledInput; inAgeInput.enabled = enabledInput; this.m_pPersonal.enabled = enabledPersonalityInput; this.m_clPersonal.enabled = enabledPersonalityInput; this.m_goPersonalSelectorIcon.SetActive(enabledPersonalityInput); this.m_pSexualExperience.enabled = enabledInput; this.m_clSexualExperience.enabled = enabledInput; this.m_goSexualExperienceSelectorIcon.SetActive(enabledInput); if (enabledInput) { this.m_lMaidPoint.alpha = 1f; this.m_goMaidPointTitleAndFrame.SetActive(true); } else { this.m_lMaidPoint.alpha = 0f; this.m_goMaidPointTitleAndFrame.SetActive(false); } } public void SetActiveViewerAndButton(ProfileMgr.UpperButtonType btn) { this.SetActiveViewer(btn); this.SetActiveButton(btn); } public void SetActiveViewer(ProfileMgr.UpperButtonType btn) { Vector3 localPosition = this.m_goMaidPointTitleAndFrame.transform.parent.localPosition; this.m_goMaidPointTitleAndFrame.transform.parent.localPosition = new Vector3(this.initMaidPointUIPosX, localPosition.y, localPosition.z); foreach (ProfileMgr.UpperButtonType upperButtonType in this.m_dicSubViewer.Keys) { if (btn == upperButtonType) { GameObject gameObject = this.m_dicSubViewer[upperButtonType]; gameObject.SetActive(true); localPosition = this.m_goMaidPointTitleAndFrame.transform.parent.localPosition; this.m_goMaidPointTitleAndFrame.transform.parent.localPosition = new Vector3(-270f, localPosition.y, localPosition.z); } else { GameObject gameObject2 = this.m_dicSubViewer[upperButtonType]; gameObject2.SetActive(false); } } } private void SetActiveButton(ProfileMgr.UpperButtonType btn) { foreach (ProfileMgr.UpperButtonType upperButtonType in this.m_dicUpperBtn.Keys) { ProfileCtrl.UpperButton upperButton; if (this.m_dicUpperBtn.TryGetValue(upperButtonType, out upperButton)) { if (btn == upperButtonType) { upperButton.m_btnButton.defaultColor = this.activeColor; upperButton.m_goSelectCursor.SetActive(true); } else { upperButton.m_btnButton.defaultColor = this.inActiveColor; upperButton.m_goSelectCursor.SetActive(false); } } } ProfileMgr.currentActiveBtn = btn; } private void initCommentWindow() { this.m_goProfileComment.SetActive(true); this.m_goFreeComment.SetActive(false); this.m_goProfileTabSelector.SetActive(true); this.m_goFreeTabSelector.SetActive(false); this.m_bProfileTab.defaultColor = this.activeColor; this.m_bFreeTab.defaultColor = this.inActiveColor; } public void LoadMaidParamData() { this.UpdateProfileData(false); this.m_lContractType.GetComponent().SetTerm(this.GetContractType(this.m_maidStatus.contract)); this.m_inLastName.value = this.m_maidStatus.lastName; this.m_inFirstName.value = this.m_maidStatus.firstName; this.m_inNickName.value = this.m_maidStatus.nickName; this.m_inAgeInput.value = this.m_maidStatus.age.ToString(); ClassData selectedJobClass = this.m_maidStatus.selectedJobClass; if (selectedJobClass != null) { this.m_lMaidClassName.text = selectedJobClass.data.drawName; Utility.SetLocalizeTerm(this.m_lMaidClassName, selectedJobClass.data.termName, false); this.m_lMaidClassLevel.text = selectedJobClass.level.ToString(); this.m_lMaidClassExp.text = selectedJobClass.cur_exp.ToString(); this.m_lMaidClassRequiredExp.text = selectedJobClass.next_exp.ToString(); } ClassData selectedYotogiClass = this.m_maidStatus.selectedYotogiClass; if (selectedYotogiClass != null) { this.m_lYotogiClassName.text = selectedYotogiClass.data.drawName; this.m_lYotogiClassLevel.text = selectedYotogiClass.level.ToString(); this.m_lYotogiClassExp.text = selectedYotogiClass.cur_exp.ToString(); this.m_lYotogiClassRequiredExp.text = selectedYotogiClass.next_exp.ToString(); } this.m_lHeight.text = this.m_maidStatus.body.height.ToString(); this.m_lWeight.text = this.m_maidStatus.body.weight.ToString(); this.m_lBust.text = this.m_maidStatus.body.bust.ToString(); this.m_lWaist.text = this.m_maidStatus.body.waist.ToString(); this.m_lHip.text = this.m_maidStatus.body.hip.ToString(); this.m_lCup.text = this.m_maidStatus.body.cup; this.m_lRelation.GetComponent().SetTerm(this.GetCondition(this.m_maidStatus.relation, this.m_maidStatus.additionalRelation, this.m_maidStatus.specialRelation)); this.m_lConditionText.GetComponent().text = this.m_maidStatus.conditionText; this.m_lConditionText.GetComponent().SetTerm(this.m_maidStatus.conditionTermText); this.m_lYotogiPlayCount.text = this.m_maidStatus.playCountYotogi.ToString(); this.m_lOthersPlayCount.text = this.m_maidStatus.playCountNightWork.ToString(); this.m_lHp.text = this.m_maidStatus.maxHp.ToString(); this.m_lLikability.text = this.m_maidStatus.likability.ToString(); this.m_lMind.text = this.m_maidStatus.maxMind.ToString(); this.m_lReception.text = this.m_maidStatus.reception.ToString(); this.m_lCare.text = this.m_maidStatus.care.ToString(); this.m_lStudyRate.text = this.ToPercent(this.m_maidStatus.studyRate).ToString(); this.m_lTeachRate.text = this.ToPercent(this.m_maidStatus.teachRate).ToString(); this.m_lCooking.text = this.m_maidStatus.cooking.ToString(); this.m_lDance.text = this.m_maidStatus.dance.ToString(); this.m_lVocal.text = this.m_maidStatus.vocal.ToString(); this.m_lLovely.text = this.m_maidStatus.lovely.ToString(); this.m_lElegance.text = this.m_maidStatus.elegance.ToString(); this.m_lCharm.text = this.m_maidStatus.charm.ToString(); this.m_lInran.text = this.m_maidStatus.inyoku.ToString(); this.m_lMValue.text = this.m_maidStatus.mvalue.ToString(); this.m_lHentai.text = this.m_maidStatus.hentai.ToString(); this.m_lHousi.text = this.m_maidStatus.housi.ToString(); this.m_lMaidPoint.text = SceneEdit.Instance.maidPoint.ToString(); foreach (KeyValuePair keyValuePair in ProfileCtrl.m_dicPersonal) { if (this.m_maidStatus.personal.uniqueName == keyValuePair.Value.uniqueName) { this.m_pPersonal.value = keyValuePair.Key; break; } } this.m_pSexualExperience.value = this.GetSelectOptionNameFromSexualExpe(this.m_maidStatus.seikeiken); this.m_lProfileComment.text = this.m_maidStatus.profileComment; this.m_inFreeComment.value = this.m_maidStatus.freeComment; } public void SetLastName(string inputText) { this.m_maidStatus.lastName = this.AdjustStrLengthIfOver(inputText, this.MAX_NAME_LENGTH); } public void SetFirstName(string inputText) { this.m_maidStatus.firstName = this.AdjustStrLengthIfOver(inputText, this.MAX_NAME_LENGTH); } public void SetNickName(string inputText) { this.m_maidStatus.nickName = this.AdjustStrLengthIfOver(inputText, this.MAX_NAME_LENGTH); } public string SetAge(string inputText) { int num = Status.minAge; if (!int.TryParse(inputText, out num)) { num = Status.minAge; } num = wf.Math.RoundMinMax(num, Status.minAge, Status.maxAge); this.m_maidStatus.age = num; return this.m_maidStatus.age.ToString(); } public void SubmitAge() { if (this.m_inAgeInput.isSelected) { this.m_inAgeInput.RemoveFocus(); } this.m_inAgeInput.value = this.m_maidStatus.age.ToString(); } public void SetFreeCommnet(string inputText) { this.m_maidStatus.freeComment = this.AdjustStrLengthIfOver(inputText, 304); } public void SetPersonal(string selectValue) { Personal.Data personal; if (ProfileCtrl.m_dicPersonal.TryGetValue(selectValue, out personal)) { this.m_maidStatus.SetPersonal(personal); if (SceneEdit.Instance != null && (SceneEdit.Instance.modeType == SceneEdit.ModeType.OriginalChara || SceneEdit.Instance.modeType == SceneEdit.ModeType.MainChara || SceneEdit.Instance.modeType == SceneEdit.ModeType.ScoutChara)) { this.m_maidStatus.additionalRelation = AdditionalRelation.Vigilance; } Debug.Log(string.Concat(new object[] { "保存された性格:", this.m_maidStatus.personal, " = ", selectValue })); } } public void SetSexualExperience(string selectValue) { Seikeiken[] array = new Seikeiken[] { Seikeiken.No_No, Seikeiken.Yes_No, Seikeiken.No_Yes, Seikeiken.Yes_Yes }; foreach (Seikeiken seikeiken in array) { if (EnumConvert.GetTerm(seikeiken) == selectValue) { Seikeiken seikeiken2 = Seikeiken.No_No; if (ProfileCtrl.m_dicSexualExperience.TryGetValue(EnumConvert.GetString(seikeiken), out seikeiken2)) { if (this.m_enabledInput) { this.m_maidStatus.seikeiken = (this.m_maidStatus.initSeikeiken = seikeiken2); } else { this.m_maidStatus.seikeiken = seikeiken2; } } break; } } } private string GetSelectOptionNameFromSexualExpe(Seikeiken sexualExperience) { foreach (KeyValuePair keyValuePair in ProfileCtrl.m_dicSexualExperience) { if (keyValuePair.Value == sexualExperience) { return EnumConvert.GetTerm(keyValuePair.Value); } } return null; } private string GetContractType(Contract contractType) { return EnumConvert.GetTerm(contractType); } private string GetCondition(Relation relation, AdditionalRelation addRelation, SpecialRelation specialRelation) { return EnumConvert.GetTerm(relation, addRelation, specialRelation); } private string AdjustStrLengthIfOver(string str, int length) { if (str.Length > length) { str = str.Substring(length); Debug.LogError(string.Format("入力された文字数が最大文字数を超えています。入力文字={0}, 最大文字数={1}", str, length)); } return str; } private int AdjustIntIfOverRange(int value, int minNumber, int maxNumber) { if (value < minNumber) { value = minNumber; Debug.LogError(string.Format("入力された値が許容される最小値より小さいです。入力値={0}, 許容される値の範囲[{1}-{2}]", value, minNumber, maxNumber)); } else if (value > maxNumber) { value = maxNumber; Debug.LogError(string.Format("入力された値が許容される最大値より大きいです。入力値={0}, 許容される値の範囲[{1}-{2}]", value, minNumber, maxNumber)); } return value; } private void CheckValueRange(int value, int minNumber, int maxNumber) { if (value < minNumber || value > maxNumber) { Debug.LogError(string.Format("値が不適切です。値={0}, 許容される値の範囲[{1}-{2}]", value, minNumber, maxNumber)); } } private bool CheckValueLength(string value, int length) { if (value.Length <= length) { return true; } Debug.LogError(string.Format("値の桁数が不適切です。値={0}, 許容される値の最大桁数={1}", value, length)); return false; } public void ChangeCommentTab(string clickTab) { if (clickTab == ProfileMgr.CommentTab.ProfileTab.ToString()) { this.m_bProfileTab.defaultColor = this.activeColor; this.m_bFreeTab.defaultColor = this.inActiveColor; this.m_goProfileComment.SetActive(true); this.m_goFreeComment.SetActive(false); this.m_goProfileTabSelector.SetActive(true); this.m_goFreeTabSelector.SetActive(false); } else if (clickTab == ProfileMgr.CommentTab.FreeTab.ToString()) { this.m_bProfileTab.defaultColor = this.inActiveColor; this.m_bFreeTab.defaultColor = this.activeColor; this.m_goProfileComment.SetActive(false); this.m_goFreeComment.SetActive(true); this.m_goProfileTabSelector.SetActive(false); this.m_goFreeTabSelector.SetActive(true); } } private bool NotExist(Dictionary dic) { return dic == null || dic.Count == 0; } public void CreateMaidSkillViewer(Dictionary dicProfileLabel) { this.m_dicProfileLabel = dicProfileLabel; this.CreateProfileItemInViewer(ProfileMgr.UpperButtonType.MaidSkill, this.m_goMaidSkillParent); this.SetActiveViewerAndButton(ProfileMgr.UpperButtonType.MaidSkill); this.AdjustTargetPosition(this.m_goMaidSkillParent, this.m_maidSkillScrollView); } public void CreateCharacterViewer(Dictionary dicProfileLabel) { this.m_dicProfileLabel = dicProfileLabel; this.CreateProfileItemInViewer(ProfileMgr.UpperButtonType.Character, this.m_goCharacterParent); this.SetActiveViewerAndButton(ProfileMgr.UpperButtonType.Character); this.AdjustTargetPosition(this.m_goCharacterParent, this.m_characterScrollView); } public void CreatePropensityViewer(Dictionary dicProfileLabel) { this.m_dicProfileLabel = dicProfileLabel; this.CreateProfileItemInViewer(ProfileMgr.UpperButtonType.Propensity, this.m_goPropensityParent); this.SetActiveViewerAndButton(ProfileMgr.UpperButtonType.Propensity); this.AdjustTargetPosition(this.m_goPropensityParent, this.m_propensityScrollView); } public void CreateYotogiSkill(Dictionary dicYotogiSkill) { this.m_dicYotogiSkill = dicYotogiSkill; this.CreateProfileItemInViewer(ProfileMgr.UpperButtonType.YotogiSkill, this.m_goYotogiSkillParent); this.SetActiveViewerAndButton(ProfileMgr.UpperButtonType.YotogiSkill); this.AdjustTargetPosition(this.m_goYotogiSkillParent, this.m_yotogiSkillScrollView); } private void CreateProfileItemInViewer(ProfileMgr.UpperButtonType btnType, GameObject goParent) { this.ClearExistChildGameObject(goParent); GameObject gameObject = null; switch (btnType) { case ProfileMgr.UpperButtonType.MaidSkill: case ProfileMgr.UpperButtonType.Character: case ProfileMgr.UpperButtonType.Propensity: { gameObject = this.GetPrefabs(this.m_goProfileLabelUnitPrefab, "SceneEdit/Profile/Prefab/ProfileLabelUnit"); List list = new List(); foreach (KeyValuePair keyValuePair in this.m_dicProfileLabel) { list.Add(keyValuePair.Value); } list.Sort((ProfileCtrl.ProfileLabelUnit a, ProfileCtrl.ProfileLabelUnit b) => int.Parse(a.m_id) - int.Parse(b.m_id)); for (int i = 0; i < list.Count; i++) { GameObject gameObject2 = UnityEngine.Object.Instantiate(gameObject); this.SetTransformInfo(gameObject2, goParent); UILabel component = UTY.GetChildObject(gameObject2, "Parameter", false).GetComponent(); component.text = list[i].m_parameter; Localize localize = component.gameObject.AddComponent(); if (btnType == ProfileMgr.UpperButtonType.Character) { Utility.SetLocalizeTerm(localize, "MaidStatus/特徴タイプ/" + list[i].m_parameter, false); } else if (btnType == ProfileMgr.UpperButtonType.Propensity) { Utility.SetLocalizeTerm(localize, "MaidStatus/性癖タイプ/" + list[i].m_parameter, false); } } this.m_goProfileLabelUnitPrefab = gameObject; break; } case ProfileMgr.UpperButtonType.YotogiSkill: gameObject = this.GetPrefabs(this.m_goYotogiSkillUnitPrefab, "SceneEdit/Profile/Prefab/YotogiSkillUnit"); foreach (KeyValuePair keyValuePair2 in this.m_dicYotogiSkill) { GameObject gameObject3 = UnityEngine.Object.Instantiate(gameObject); this.SetTransformInfo(gameObject3, goParent); UILabel component2 = UTY.GetChildObject(gameObject3, "Number/Value", false).GetComponent(); component2.text = keyValuePair2.Value.m_number; UILabel component3 = UTY.GetChildObject(gameObject3, "SkillName/Value", false).GetComponent(); component3.text = keyValuePair2.Value.m_skillName; UISprite component4 = UTY.GetChildObject(gameObject3, "LevelOfAchievement/Icon", false).GetComponent(); component4.spriteName = this.m_dicSpriteName[keyValuePair2.Value.m_levelOfAchievement]; } this.m_goYotogiSkillUnitPrefab = gameObject; break; } } private void SetTransformInfo(GameObject copyPrefabs, GameObject goParent) { copyPrefabs.transform.parent = goParent.transform; copyPrefabs.transform.localScale = Vector3.one; copyPrefabs.transform.localPosition = Vector3.zero; copyPrefabs.transform.rotation = Quaternion.identity; } private GameObject GetPrefabs(GameObject prefabs, string prefabsPath) { if (prefabs == null) { prefabs = (Resources.Load(prefabsPath) as GameObject); if (prefabs == null) { Debug.LogError(string.Format("ロードされるプレハブが見つかりませんでした。パス={0}", prefabsPath)); } } return prefabs; } private void AdjustTargetPosition(GameObject go, UIScrollView scrollView) { go.GetComponent().Reposition(); scrollView.ResetPosition(); } private void AdjustTargetPositionGridAndTable(GameObject goGrid, GameObject goTable, UIScrollView scrollView) { goGrid.GetComponent().Reposition(); goTable.GetComponent().Reposition(); scrollView.ResetPosition(); } private void ClearExistChildGameObject(GameObject parent) { IEnumerator enumerator = parent.transform.GetEnumerator(); try { while (enumerator.MoveNext()) { object obj = enumerator.Current; Transform transform = (Transform)obj; UnityEngine.Object.Destroy(transform.gameObject); } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } parent.transform.DetachChildren(); } private int ToPercent(int number) { return (int)System.Math.Floor((double)(number / 10)); } public void OnDisable() { if (!this.m_bInited) { return; } this.SetFirstName(this.m_inFirstName.value); this.SetLastName(this.m_inLastName.value); this.SetNickName(this.m_inNickName.value); this.SetAge(this.m_inAgeInput.value); this.SetFreeCommnet(this.m_inFreeComment.value); } public void UpdateProfileData(bool updateYotogiSkill) { if (this.m_enabledInput) { this.m_maidStatus.mainChara = !this.m_enabledPersonalityInput; foreach (int featureId in this.m_maidStatus.features.GetKeyArray()) { this.m_maidStatus.RemoveFeature(featureId); } List allDatas = Feature.GetAllDatas(true); foreach (Personal.Data.LearnFeature learnFeature in this.m_maidStatus.personal.acquisitionFeatureList) { if (learnFeature.isLearnPossible(this.m_maidStatus)) { this.m_maidStatus.AddFeature(learnFeature.feature); } } AbstractClassData.ClassType classTypeFlags = AbstractClassData.ClassType.Share | AbstractClassData.ClassType.New | AbstractClassData.ClassType.Old; this.m_maidStatus.yotogiClass.Clear(); foreach (YotogiClass.Data data in this.m_maidStatus.yotogiClass.GetLearnPossibleClassDatas(false, classTypeFlags)) { if (GameMain.Instance.CharacterMgr.status.IsYotogiClassOpenFlag(data.id)) { this.m_maidStatus.yotogiClass.Add(data.id, false, true); } } int id = this.m_maidStatus.selectedJobClass.data.id; HashSet hashSet = new HashSet(); foreach (KeyValuePair> keyValuePair in this.m_maidStatus.jobClass.GetAllDatas()) { hashSet.Add(keyValuePair.Key); } HashSet hashSet2 = new HashSet(); foreach (JobClass.Data data2 in this.m_maidStatus.jobClass.GetLearnPossibleClassDatas(false, classTypeFlags)) { if (GameMain.Instance.CharacterMgr.status.IsJobClassOpenFlag(data2.id)) { hashSet2.Add(data2.id); } } HashSet hashSet3 = new HashSet(); foreach (int item in hashSet) { if (!hashSet2.Contains(item)) { hashSet3.Add(item); } } HashSet hashSet4 = new HashSet(); foreach (int item2 in hashSet2) { if (!hashSet.Contains(item2)) { hashSet4.Add(item2); } } foreach (int id2 in hashSet3) { this.m_maidStatus.jobClass.Remove(id2, true); } int num = -1; foreach (int num2 in hashSet4) { this.m_maidStatus.jobClass.Add(num2, false, true); num = ((num >= num2) ? num : num2); } if (num != -1) { this.m_maidStatus.ChangeJobClass(num); } if (updateYotogiSkill) { this.m_maidStatus.yotogiSkill.Clear(); List learnPossibleSkills = Skill.GetLearnPossibleSkills(this.m_maidStatus); foreach (Skill.Data data3 in learnPossibleSkills) { this.m_maidStatus.yotogiSkill.Add(data3.id); } } this.m_maidStatus.UpdateClassBonusStatus(); this.m_maidStatus.sexPlayNumberOfPeople = MaidProfile.UpdateInitPlayNumber(this.m_maidStatus.maid); } this.m_maidStatus.UpdateBodyParam(); this.m_maidStatus.profileComment = MaidProfile.Create(this.m_maidStatus.maid, !this.m_enabledInput); } private Status m_maidStatus; private ProfileCtrl.ProfileAttribute m_profileAttribute; private GameObject m_goProfilePanel; private GameObject m_goProfileComment; private GameObject m_goFreeComment; private GameObject m_goProfileTabSelector; private GameObject m_goFreeTabSelector; private GameObject m_goProfileLabelUnitPrefab; private GameObject m_goYotogiSkillUnitPrefab; private GameObject m_goMaidPointTitleAndFrame; private GameObject m_goMaidSkillParent; private GameObject m_goCharacterParent; private GameObject m_goPropensityParent; private GameObject m_goYotogiSkillParent; private GameObject m_goErogenousZoneParent; private GameObject m_goMaidSkillViewer; private GameObject m_goCharacterViewer; private GameObject m_goPropensityViewer; private GameObject m_goYotogiSkillViewer; private GameObject m_goPersonalSelectorIcon; private GameObject m_goSexualExperienceSelectorIcon; private UIScrollView m_maidSkillScrollView; private UIScrollView m_characterScrollView; private UIScrollView m_propensityScrollView; private UIScrollView m_yotogiSkillScrollView; private UIScrollView m_attributeScrollView; private UILabel m_lContractType; private UILabel m_lMaidClassName; private UILabel m_lMaidClassLevel; private UILabel m_lMaidClassExp; private UILabel m_lMaidClassRequiredExp; private UILabel m_lYotogiClassName; private UILabel m_lYotogiClassLevel; private UILabel m_lYotogiClassExp; private UILabel m_lYotogiClassRequiredExp; private UILabel m_lHeight; private UILabel m_lWeight; private UILabel m_lBust; private UILabel m_lCup; private UILabel m_lWaist; private UILabel m_lHip; private UILabel m_lRelation; private UILabel m_lConditionText; private UILabel m_lYotogiPlayCount; private UILabel m_lOthersPlayCount; private UILabel m_lHp; private UILabel m_lLikability; private UILabel m_lMind; private UILabel m_lReception; private UILabel m_lCare; private UILabel m_lStudyRate; private UILabel m_lTeachRate; private UILabel m_lCooking; private UILabel m_lDance; private UILabel m_lVocal; private UILabel m_lLovely; private UILabel m_lElegance; private UILabel m_lCharm; private UILabel m_lInran; private UILabel m_lMValue; private UILabel m_lHentai; private UILabel m_lHousi; private UILabel m_lMaidPoint; private UILabel m_lProfileComment; private UIInput m_inFreeComment; private UIInput m_inFirstName; private UIInput m_inLastName; private UIInput m_inNickName; private UIInput m_inAgeInput; private UIButton m_buFirstName; private UIButton m_buLastName; private UIPopupList m_pPersonal; private UILabel m_lPersonal; private UIPopupList m_pSexualExperience; private UIButton m_bProfileTab; private UIButton m_bFreeTab; private BoxCollider m_clFirstName; private BoxCollider m_clLastName; private BoxCollider m_clNickName; private BoxCollider m_clAgeInput; private BoxCollider m_clPersonal; private BoxCollider m_clSexualExperience; private static Dictionary m_dicPersonal; private static Dictionary m_dicSexualExperience; private Dictionary m_dicSubViewer; private Dictionary m_dicUpperBtn; private Dictionary m_dicProfileLabel; private Dictionary m_dicYotogiSkill; private Dictionary m_dicSpriteName; private bool m_bInited; private Color activeColor; private Color inActiveColor; private const int MAX_FREE_COMMENT_LENGTH = 304; private const int MAX_EROGENOUSZONE_UNIT = 7; private const int MAX_ATTRIBUTE_UNIT = 10; private const int DENOMINATOR = 10; private const string MAID_SKILL_UNIT_PARENT_PATH = "SubWindows/MaidSkillViewer/Contents/MaidSkillUnitParent"; private const string CHARACTER_UNIT_PARENT_PATH = "SubWindows/CharacterViewer/Contents/CharacterUnitParent"; private const string PROPENSITY_UNIT_PARENT_PATH = "SubWindows/PropensityViewer/Contents/CharacterUnitParent"; private const string YOTOGI_SKILL_UNIT_PARENT_PATH = "SubWindows/YotogiSkillViewer/Contents/YotogiSkillUnitParent"; private const string ATTRIBUTE_UNIT_PARENT_PATH = "SubWindows/AttributeViewer/Contents/Attribute/AttributeUnitParent"; private const string EROGENOUS_ZONE_UNIT_PARENT_PATH = "SubWindows/AttributeViewer/Contents/ErogenousZone/ErogenousZoneParent"; private const string PROFILE_LABEL_UNIT_PREFAB_PATH = "SceneEdit/Profile/Prefab/ProfileLabelUnit"; private const string PROFILE_YOTOGI_SKILL_UNIT_PREFAB_PATH = "SceneEdit/Profile/Prefab/YotogiSkillUnit"; private const string PROFILE_ATTRIBUTE_UNIT_PREFAB_PATH = "SceneEdit/Profile/Prefab/AttributeUnit"; private const string PROFILE_EROGENOUS_ZONE_UNIT_PREFAB_PATH = "SceneEdit/Profile/Prefab/ErogenousZoneUnit"; private float initMaidPointUIPosX; public enum LevelOfAchievement { level_1, level_2, level_3, level_4 } private class UpperButton { public ProfileMgr.UpperButtonType m_name; public GameObject m_goSelectCursor; public UIButton m_btnButton; } public class ProfileLabelUnit { public string m_id; public string m_parameter; } public class ProfileYotogiSkillUnit { public string m_id; public string m_number; public string m_skillName; public ProfileCtrl.LevelOfAchievement m_levelOfAchievement; } public class ProfileAttribute { public ProfileAttribute() { this.m_listAttributeUnitName = new List(); } public List m_listAttributeUnitName; } public class ErogenousZoneUnit { public string m_category; public int m_PercentNumber; } }