ProfileCtrl.cs 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using Edit;
  5. using I2.Loc;
  6. using MaidStatus;
  7. using MaidStatus.CsvData;
  8. using UnityEngine;
  9. using wf;
  10. using Yotogis;
  11. public class ProfileCtrl : MonoBehaviour
  12. {
  13. private bool m_enabledInput
  14. {
  15. get
  16. {
  17. return BaseMgr<ProfileMgr>.Instance.m_enabledInput;
  18. }
  19. }
  20. private bool m_enabledPersonalityInput
  21. {
  22. get
  23. {
  24. return BaseMgr<ProfileMgr>.Instance.m_enabledPersonalityInput;
  25. }
  26. }
  27. private int MAX_NAME_LENGTH
  28. {
  29. get
  30. {
  31. return (!Product.isEnglish) ? 8 : 11;
  32. }
  33. }
  34. public void Init(GameObject goProfilePanel, Status status)
  35. {
  36. this.m_goProfilePanel = goProfilePanel;
  37. this.m_maidStatus = status;
  38. string f_strObjName = "CharacterInfo/Name/FirstName";
  39. string f_strObjName2 = "CharacterInfo/Name/LastName";
  40. if (Product.isEnglish)
  41. {
  42. UTY.GetChildObject(base.gameObject, "CharacterInfo/Name", false).SetActive(false);
  43. UTY.GetChildObject(base.gameObject, "CharacterInfo/EnZone", false).SetActive(true);
  44. f_strObjName = "CharacterInfo/EnZone/NameZone/Name/FirstName";
  45. f_strObjName2 = "CharacterInfo/EnZone/NameZone/Name/LastName";
  46. }
  47. this.m_lContractType = UTY.GetChildObject(this.m_goProfilePanel, "ContractType/OutputField", false).GetComponent<UILabel>();
  48. GameObject childObject = UTY.GetChildObject(this.m_goProfilePanel, f_strObjName, false);
  49. this.m_inFirstName = childObject.GetComponent<UIInput>();
  50. this.m_clFirstName = childObject.GetComponent<BoxCollider>();
  51. EventDelegate.Add(this.m_inFirstName.onChange, new EventDelegate.Callback(BaseMgr<ProfileMgr>.Instance.OnChangeFirstName));
  52. GameObject childObject2 = UTY.GetChildObject(this.m_goProfilePanel, f_strObjName2, false);
  53. this.m_inLastName = childObject2.GetComponent<UIInput>();
  54. this.m_clLastName = childObject2.GetComponent<BoxCollider>();
  55. EventDelegate.Add(this.m_inLastName.onChange, new EventDelegate.Callback(BaseMgr<ProfileMgr>.Instance.OnChangeLastName));
  56. this.m_buFirstName = UTY.GetChildObject(childObject, "Random", false).GetComponent<UIButton>();
  57. EventDelegate.Add(this.m_buFirstName.onClick, delegate()
  58. {
  59. this.m_inFirstName.RemoveFocus();
  60. this.m_inFirstName.value = MaidRandomName.GetFirstName();
  61. });
  62. this.m_buLastName = UTY.GetChildObject(childObject2, "Random", false).GetComponent<UIButton>();
  63. EventDelegate.Add(this.m_buLastName.onClick, delegate()
  64. {
  65. this.m_inLastName.RemoveFocus();
  66. this.m_inLastName.value = MaidRandomName.GetLastName();
  67. });
  68. GameObject childObject3 = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/EnZone/NickNameAndAge/Name/NickName", false);
  69. this.m_inNickName = childObject3.GetComponent<UIInput>();
  70. this.m_clNickName = childObject3.GetComponent<BoxCollider>();
  71. GameObject childObject4 = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/EnZone/NickNameAndAge/Age/Age", false);
  72. this.m_inAgeInput = childObject4.GetComponent<UIInput>();
  73. this.m_clAgeInput = childObject4.GetComponent<BoxCollider>();
  74. this.m_lMaidClassName = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/MaidClass/Type", false).GetComponent<UILabel>();
  75. this.m_lMaidClassLevel = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/MaidClass/Level", false).GetComponent<UILabel>();
  76. this.m_lMaidClassExp = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/MaidClass/Exp", false).GetComponent<UILabel>();
  77. this.m_lMaidClassRequiredExp = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/MaidClass/RequiredExp", false).GetComponent<UILabel>();
  78. this.m_lYotogiClassName = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/YotogiClass/Type", false).GetComponent<UILabel>();
  79. this.m_lYotogiClassLevel = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/YotogiClass/Level", false).GetComponent<UILabel>();
  80. this.m_lYotogiClassExp = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/YotogiClass/Exp", false).GetComponent<UILabel>();
  81. this.m_lYotogiClassRequiredExp = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/YotogiClass/RequiredExp", false).GetComponent<UILabel>();
  82. this.m_lRelation = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Relation", false).GetComponent<UILabel>();
  83. this.m_lConditionText = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/ConditionText", false).GetComponent<UILabel>();
  84. this.m_lYotogiPlayCount = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/OthersPlayCount", false).GetComponent<UILabel>();
  85. this.m_lOthersPlayCount = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/YotogiPlayCount", false).GetComponent<UILabel>();
  86. this.m_lHp = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Hp", false).GetComponent<UILabel>();
  87. this.m_lLikability = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Likability", false).GetComponent<UILabel>();
  88. this.m_lMind = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Mind", false).GetComponent<UILabel>();
  89. this.m_lReception = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Reception", false).GetComponent<UILabel>();
  90. this.m_lCare = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Care", false).GetComponent<UILabel>();
  91. this.m_lStudyRate = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StudyRate", false).GetComponent<UILabel>();
  92. this.m_lTeachRate = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/TeachRate", false).GetComponent<UILabel>();
  93. GameObject childObject5 = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/Personal/PopupList", false);
  94. this.m_pPersonal = childObject5.GetComponent<UIPopupList>();
  95. this.m_lPersonal = UTY.GetChildObject(childObject5, "LabelParent/Label", false).GetComponent<UILabel>();
  96. bool flag = GameMain.Instance.CharacterMgr.status.GetFlag("オープニング終了") == 1;
  97. List<Personal.Data> allDatas = Personal.GetAllDatas(true);
  98. List<Personal.Data> list = new List<Personal.Data>();
  99. foreach (Personal.Data data in allDatas)
  100. {
  101. string a = data.uniqueName.ToLower();
  102. if (data.oldPersonal)
  103. {
  104. if (a == "pure" || a == "cool" || a == "pride")
  105. {
  106. if (GameMain.Instance.CharacterMgr.status.isAvailableTransfer)
  107. {
  108. list.Add(data);
  109. }
  110. }
  111. else if (flag)
  112. {
  113. if (data.single)
  114. {
  115. list.Add(data);
  116. }
  117. else if (!string.IsNullOrEmpty(GameMain.Instance.CMSystem.CM3D2Path) && data.compatible)
  118. {
  119. list.Add(data);
  120. }
  121. }
  122. }
  123. else
  124. {
  125. list.Add(data);
  126. }
  127. }
  128. this.m_pPersonal.items.Clear();
  129. if (Product.supportMultiLanguage)
  130. {
  131. this.m_pPersonal.isLocalized = true;
  132. ProfileCtrl.m_dicPersonal = new Dictionary<string, Personal.Data>();
  133. foreach (Personal.Data data2 in list)
  134. {
  135. string termName = data2.termName;
  136. this.m_pPersonal.items.Add(termName);
  137. ProfileCtrl.m_dicPersonal.Add(termName, data2);
  138. }
  139. }
  140. else
  141. {
  142. ProfileCtrl.m_dicPersonal = new Dictionary<string, Personal.Data>();
  143. foreach (Personal.Data data3 in list)
  144. {
  145. string drawName = data3.drawName;
  146. this.m_pPersonal.items.Add(drawName);
  147. ProfileCtrl.m_dicPersonal.Add(drawName, data3);
  148. }
  149. }
  150. EventDelegate.Add(this.m_pPersonal.onChange, delegate()
  151. {
  152. });
  153. this.m_clPersonal = childObject5.GetComponent<BoxCollider>();
  154. this.m_goPersonalSelectorIcon = UTY.GetChildObject(childObject5, "Symbol", false);
  155. GameObject childObject6 = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/SexualExperience/PopupList", false);
  156. this.m_pSexualExperience = childObject6.GetComponent<UIPopupList>();
  157. ProfileCtrl.m_dicSexualExperience = new Dictionary<string, Seikeiken>();
  158. for (int i = 0; i < Enum.GetValues(typeof(Seikeiken)).Length; i++)
  159. {
  160. Seikeiken seikeiken = (Seikeiken)i;
  161. ProfileCtrl.m_dicSexualExperience.Add(EnumConvert.GetString(seikeiken), seikeiken);
  162. }
  163. this.m_clSexualExperience = childObject6.GetComponent<BoxCollider>();
  164. this.m_goSexualExperienceSelectorIcon = UTY.GetChildObject(childObject6, "Symbol", false);
  165. this.m_lHeight = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Body/Height", false).GetComponent<UILabel>();
  166. this.m_lWeight = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Body/Weight", false).GetComponent<UILabel>();
  167. this.m_lBust = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Body/Bust/Bust", false).GetComponent<UILabel>();
  168. this.m_lCup = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Body/Bust/Cup", false).GetComponent<UILabel>();
  169. this.m_lWaist = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Body/Waist", false).GetComponent<UILabel>();
  170. this.m_lHip = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/Body/Hip", false).GetComponent<UILabel>();
  171. this.m_lCooking = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Cooking/Box", false).GetComponent<UILabel>();
  172. this.m_lDance = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Dance/Box", false).GetComponent<UILabel>();
  173. this.m_lVocal = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Vocal/Box", false).GetComponent<UILabel>();
  174. this.m_lLovely = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Lovely/Box", false).GetComponent<UILabel>();
  175. this.m_lElegance = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Elegance/Box", false).GetComponent<UILabel>();
  176. this.m_lCharm = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Charm/Box", false).GetComponent<UILabel>();
  177. this.m_lInran = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Inran/Box", false).GetComponent<UILabel>();
  178. this.m_lMValue = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/MValue/Box", false).GetComponent<UILabel>();
  179. this.m_lHentai = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Hentai/Box", false).GetComponent<UILabel>();
  180. this.m_lHousi = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/Housi/Box", false).GetComponent<UILabel>();
  181. this.m_lMaidPoint = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/MaidPoint", false).GetComponent<UILabel>();
  182. this.m_goMaidPointTitleAndFrame = UTY.GetChildObject(this.m_goProfilePanel, "CharacterInfo/ProfileBase/StatusPoints/MaidPoint/MaidPointTitleAndFrame", false);
  183. this.initMaidPointUIPosX = this.m_goMaidPointTitleAndFrame.transform.parent.localPosition.x;
  184. this.m_inFreeComment = UTY.GetChildObject(this.m_goProfilePanel, "Comment/FreeCommentWindow/FreeComment", false).GetComponent<UIInput>();
  185. EventDelegate.Add(this.m_inFreeComment.onChange, new EventDelegate.Callback(BaseMgr<ProfileMgr>.Instance.OnChangeFreeComment));
  186. this.m_lProfileComment = UTY.GetChildObject(this.m_goProfilePanel, "Comment/ProfileCommentWindow/ProfileComment", false).GetComponent<UILabel>();
  187. if (Product.supportMultiLanguage)
  188. {
  189. UILabel componentInChildren = this.m_inFreeComment.GetComponentInChildren<UILabel>();
  190. if (componentInChildren != null)
  191. {
  192. componentInChildren.spacingX = 0;
  193. }
  194. this.m_lProfileComment.spacingX = 0;
  195. }
  196. this.m_goProfileComment = UTY.GetChildObject(this.m_goProfilePanel, "Comment/ProfileCommentWindow/ProfileComment", false);
  197. this.m_goFreeComment = UTY.GetChildObject(this.m_goProfilePanel, "Comment/FreeCommentWindow/FreeComment", false);
  198. GameObject childObject7 = UTY.GetChildObject(this.m_goProfilePanel, "Comment/ProfileCommentWindow/ProfileTab", false);
  199. this.m_bProfileTab = childObject7.GetComponent<UIButton>();
  200. this.m_goProfileTabSelector = UTY.GetChildObject(childObject7, "SelectCursor", false);
  201. GameObject childObject8 = UTY.GetChildObject(this.m_goProfilePanel, "Comment/FreeCommentWindow/FreeTab", false);
  202. this.m_bFreeTab = childObject8.GetComponent<UIButton>();
  203. this.m_goFreeTabSelector = UTY.GetChildObject(childObject8, "SelectCursor", false);
  204. this.activeColor = new Color(this.m_bProfileTab.defaultColor.r, this.m_bProfileTab.defaultColor.g, this.m_bProfileTab.defaultColor.b, 1f);
  205. this.inActiveColor = this.m_bProfileTab.defaultColor;
  206. this.m_goMaidSkillParent = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/MaidSkillViewer/Contents/MaidSkillUnitParent", false);
  207. this.m_goMaidSkillViewer = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/MaidSkillViewer", false);
  208. this.m_maidSkillScrollView = UTY.GetChildObject(this.m_goMaidSkillViewer, "Contents", false).GetComponent<UIScrollView>();
  209. this.m_goCharacterParent = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/CharacterViewer/Contents/CharacterUnitParent", false);
  210. this.m_goCharacterViewer = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/CharacterViewer", false);
  211. this.m_characterScrollView = UTY.GetChildObject(this.m_goCharacterViewer, "Contents", false).GetComponent<UIScrollView>();
  212. this.m_goPropensityParent = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/PropensityViewer/Contents/CharacterUnitParent", false);
  213. this.m_goPropensityViewer = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/PropensityViewer", false);
  214. this.m_propensityScrollView = UTY.GetChildObject(this.m_goPropensityViewer, "Contents", false).GetComponent<UIScrollView>();
  215. this.m_goYotogiSkillParent = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/YotogiSkillViewer/Contents/YotogiSkillUnitParent", false);
  216. this.m_goYotogiSkillViewer = UTY.GetChildObject(this.m_goProfilePanel, "SubWindows/YotogiSkillViewer", false);
  217. this.m_yotogiSkillScrollView = UTY.GetChildObject(this.m_goYotogiSkillViewer, "Contents", false).GetComponent<UIScrollView>();
  218. this.m_dicSpriteName = new Dictionary<ProfileCtrl.LevelOfAchievement, string>
  219. {
  220. {
  221. ProfileCtrl.LevelOfAchievement.level_1,
  222. "cm3d2_edit_profile_yotogiskill_sign_batu"
  223. },
  224. {
  225. ProfileCtrl.LevelOfAchievement.level_2,
  226. "cm3d2_edit_profile_yotogiskill_sign_sankaku"
  227. },
  228. {
  229. ProfileCtrl.LevelOfAchievement.level_3,
  230. "cm3d2_edit_profile_yotogiskill_sign_maru"
  231. },
  232. {
  233. ProfileCtrl.LevelOfAchievement.level_4,
  234. "cm3d2_edit_profile_yotogiskill_sign_nijumaru"
  235. }
  236. };
  237. this.m_dicUpperBtn = new Dictionary<ProfileMgr.UpperButtonType, ProfileCtrl.UpperButton>();
  238. IEnumerator enumerator4 = Enum.GetValues(typeof(ProfileMgr.UpperButtonType)).GetEnumerator();
  239. try
  240. {
  241. while (enumerator4.MoveNext())
  242. {
  243. object obj = enumerator4.Current;
  244. ProfileMgr.UpperButtonType upperButtonType = (ProfileMgr.UpperButtonType)obj;
  245. if (upperButtonType != ProfileMgr.UpperButtonType.None)
  246. {
  247. GameObject childObject9 = UTY.GetChildObject(this.m_goProfilePanel, "UpperButton/" + upperButtonType.ToString(), false);
  248. UIButton component = childObject9.GetComponent<UIButton>();
  249. GameObject childObject10 = UTY.GetChildObject(childObject9, "SelectCursor", false);
  250. childObject10.SetActive(false);
  251. ProfileCtrl.UpperButton upperButton = new ProfileCtrl.UpperButton();
  252. upperButton.m_btnButton = component;
  253. upperButton.m_name = upperButtonType;
  254. upperButton.m_goSelectCursor = childObject10;
  255. this.m_dicUpperBtn.Add(upperButton.m_name, upperButton);
  256. }
  257. }
  258. }
  259. finally
  260. {
  261. IDisposable disposable;
  262. if ((disposable = (enumerator4 as IDisposable)) != null)
  263. {
  264. disposable.Dispose();
  265. }
  266. }
  267. this.m_dicSubViewer = new Dictionary<ProfileMgr.UpperButtonType, GameObject>
  268. {
  269. {
  270. ProfileMgr.UpperButtonType.MaidSkill,
  271. this.m_goMaidSkillViewer
  272. },
  273. {
  274. ProfileMgr.UpperButtonType.YotogiSkill,
  275. this.m_goYotogiSkillViewer
  276. },
  277. {
  278. ProfileMgr.UpperButtonType.Character,
  279. this.m_goCharacterViewer
  280. },
  281. {
  282. ProfileMgr.UpperButtonType.Propensity,
  283. this.m_goPropensityViewer
  284. }
  285. };
  286. this.initCommentWindow();
  287. this.LoadMaidParamData();
  288. this.SetEnableInput(this.m_enabledInput, this.m_enabledPersonalityInput);
  289. this.m_bInited = true;
  290. if (Product.isPublic)
  291. {
  292. UIWFPositionStore component2 = UTY.GetChildObject(base.gameObject, "Layout_public", false).GetComponent<UIWFPositionStore>();
  293. if (component2 != null)
  294. {
  295. component2.Apply();
  296. }
  297. UTY.GetChildObject(base.gameObject, "UpperButton/Character", false).GetComponent<UISprite>().width = 392;
  298. BoxCollider component3 = UTY.GetChildObject(base.gameObject, "UpperButton/Character", false).GetComponent<BoxCollider>();
  299. component3.size = new Vector3(392f, component3.size.y, 0f);
  300. }
  301. if (Product.isEnglish)
  302. {
  303. UIWFPositionStore component4 = UTY.GetChildObject(base.gameObject, "Layout_en", false).GetComponent<UIWFPositionStore>();
  304. if (component4 != null)
  305. {
  306. component4.Apply();
  307. }
  308. if (Product.isPublic)
  309. {
  310. UTY.GetChildObject(base.gameObject, "UpperButton", false).transform.localPosition = new Vector3(0f, -69f, 0f);
  311. UTY.GetChildObject(base.gameObject, "Comment", false).transform.localPosition = new Vector3(UTY.GetChildObject(base.gameObject, "Comment", false).transform.localPosition.x, -42f, 0f);
  312. }
  313. else
  314. {
  315. UTY.GetChildObject(base.gameObject, "Comment", false).transform.localPosition = new Vector3(UTY.GetChildObject(base.gameObject, "Comment", false).transform.localPosition.x, -124f, 0f);
  316. }
  317. }
  318. }
  319. private void SetEnableInput(bool enabledInput, bool enabledPersonalityInput)
  320. {
  321. this.m_inFirstName.enabled = enabledInput;
  322. this.m_inLastName.enabled = enabledInput;
  323. this.m_clFirstName.enabled = enabledInput;
  324. this.m_clLastName.enabled = enabledInput;
  325. this.m_buFirstName.gameObject.SetActive(enabledInput);
  326. this.m_buLastName.gameObject.SetActive(enabledInput);
  327. Behaviour inAgeInput = this.m_inAgeInput;
  328. this.m_clAgeInput.enabled = enabledInput;
  329. inAgeInput.enabled = enabledInput;
  330. this.m_pPersonal.enabled = enabledPersonalityInput;
  331. this.m_clPersonal.enabled = enabledPersonalityInput;
  332. this.m_goPersonalSelectorIcon.SetActive(enabledPersonalityInput);
  333. this.m_pSexualExperience.enabled = enabledInput;
  334. this.m_clSexualExperience.enabled = enabledInput;
  335. this.m_goSexualExperienceSelectorIcon.SetActive(enabledInput);
  336. if (enabledInput)
  337. {
  338. this.m_lMaidPoint.alpha = 1f;
  339. this.m_goMaidPointTitleAndFrame.SetActive(true);
  340. }
  341. else
  342. {
  343. this.m_lMaidPoint.alpha = 0f;
  344. this.m_goMaidPointTitleAndFrame.SetActive(false);
  345. }
  346. }
  347. public void SetActiveViewerAndButton(ProfileMgr.UpperButtonType btn)
  348. {
  349. this.SetActiveViewer(btn);
  350. this.SetActiveButton(btn);
  351. }
  352. public void SetActiveViewer(ProfileMgr.UpperButtonType btn)
  353. {
  354. Vector3 localPosition = this.m_goMaidPointTitleAndFrame.transform.parent.localPosition;
  355. this.m_goMaidPointTitleAndFrame.transform.parent.localPosition = new Vector3(this.initMaidPointUIPosX, localPosition.y, localPosition.z);
  356. foreach (ProfileMgr.UpperButtonType upperButtonType in this.m_dicSubViewer.Keys)
  357. {
  358. if (btn == upperButtonType)
  359. {
  360. GameObject gameObject = this.m_dicSubViewer[upperButtonType];
  361. gameObject.SetActive(true);
  362. localPosition = this.m_goMaidPointTitleAndFrame.transform.parent.localPosition;
  363. this.m_goMaidPointTitleAndFrame.transform.parent.localPosition = new Vector3(-270f, localPosition.y, localPosition.z);
  364. }
  365. else
  366. {
  367. GameObject gameObject2 = this.m_dicSubViewer[upperButtonType];
  368. gameObject2.SetActive(false);
  369. }
  370. }
  371. }
  372. private void SetActiveButton(ProfileMgr.UpperButtonType btn)
  373. {
  374. foreach (ProfileMgr.UpperButtonType upperButtonType in this.m_dicUpperBtn.Keys)
  375. {
  376. ProfileCtrl.UpperButton upperButton;
  377. if (this.m_dicUpperBtn.TryGetValue(upperButtonType, out upperButton))
  378. {
  379. if (btn == upperButtonType)
  380. {
  381. upperButton.m_btnButton.defaultColor = this.activeColor;
  382. upperButton.m_goSelectCursor.SetActive(true);
  383. }
  384. else
  385. {
  386. upperButton.m_btnButton.defaultColor = this.inActiveColor;
  387. upperButton.m_goSelectCursor.SetActive(false);
  388. }
  389. }
  390. }
  391. ProfileMgr.currentActiveBtn = btn;
  392. }
  393. private void initCommentWindow()
  394. {
  395. this.m_goProfileComment.SetActive(true);
  396. this.m_goFreeComment.SetActive(false);
  397. this.m_goProfileTabSelector.SetActive(true);
  398. this.m_goFreeTabSelector.SetActive(false);
  399. this.m_bProfileTab.defaultColor = this.activeColor;
  400. this.m_bFreeTab.defaultColor = this.inActiveColor;
  401. }
  402. public void LoadMaidParamData()
  403. {
  404. this.UpdateProfileData(false);
  405. this.m_lContractType.GetComponent<Localize>().SetTerm(this.GetContractType(this.m_maidStatus.contract));
  406. this.m_inLastName.value = this.m_maidStatus.lastName;
  407. this.m_inFirstName.value = this.m_maidStatus.firstName;
  408. this.m_inNickName.value = this.m_maidStatus.nickName;
  409. this.m_inAgeInput.value = this.m_maidStatus.age.ToString();
  410. ClassData<JobClass.Data> selectedJobClass = this.m_maidStatus.selectedJobClass;
  411. if (selectedJobClass != null)
  412. {
  413. this.m_lMaidClassName.text = selectedJobClass.data.drawName;
  414. Utility.SetLocalizeTerm(this.m_lMaidClassName, selectedJobClass.data.termName, false);
  415. this.m_lMaidClassLevel.text = selectedJobClass.level.ToString();
  416. this.m_lMaidClassExp.text = selectedJobClass.cur_exp.ToString();
  417. this.m_lMaidClassRequiredExp.text = selectedJobClass.next_exp.ToString();
  418. }
  419. ClassData<YotogiClass.Data> selectedYotogiClass = this.m_maidStatus.selectedYotogiClass;
  420. if (selectedYotogiClass != null)
  421. {
  422. this.m_lYotogiClassName.text = selectedYotogiClass.data.drawName;
  423. this.m_lYotogiClassLevel.text = selectedYotogiClass.level.ToString();
  424. this.m_lYotogiClassExp.text = selectedYotogiClass.cur_exp.ToString();
  425. this.m_lYotogiClassRequiredExp.text = selectedYotogiClass.next_exp.ToString();
  426. }
  427. this.m_lHeight.text = this.m_maidStatus.body.height.ToString();
  428. this.m_lWeight.text = this.m_maidStatus.body.weight.ToString();
  429. this.m_lBust.text = this.m_maidStatus.body.bust.ToString();
  430. this.m_lWaist.text = this.m_maidStatus.body.waist.ToString();
  431. this.m_lHip.text = this.m_maidStatus.body.hip.ToString();
  432. this.m_lCup.text = this.m_maidStatus.body.cup;
  433. this.m_lRelation.GetComponent<Localize>().SetTerm(this.GetCondition(this.m_maidStatus.relation, this.m_maidStatus.additionalRelation));
  434. this.m_lConditionText.GetComponent<UILabel>().text = this.m_maidStatus.conditionText;
  435. this.m_lConditionText.GetComponent<Localize>().SetTerm(this.m_maidStatus.conditionTermText);
  436. this.m_lYotogiPlayCount.text = this.m_maidStatus.playCountYotogi.ToString();
  437. this.m_lOthersPlayCount.text = this.m_maidStatus.playCountNightWork.ToString();
  438. this.m_lHp.text = this.m_maidStatus.maxHp.ToString();
  439. this.m_lLikability.text = this.m_maidStatus.likability.ToString();
  440. this.m_lMind.text = this.m_maidStatus.maxMind.ToString();
  441. this.m_lReception.text = this.m_maidStatus.reception.ToString();
  442. this.m_lCare.text = this.m_maidStatus.care.ToString();
  443. this.m_lStudyRate.text = this.ToPercent(this.m_maidStatus.studyRate).ToString();
  444. this.m_lTeachRate.text = this.ToPercent(this.m_maidStatus.teachRate).ToString();
  445. this.m_lCooking.text = this.m_maidStatus.cooking.ToString();
  446. this.m_lDance.text = this.m_maidStatus.dance.ToString();
  447. this.m_lVocal.text = this.m_maidStatus.vocal.ToString();
  448. this.m_lLovely.text = this.m_maidStatus.lovely.ToString();
  449. this.m_lElegance.text = this.m_maidStatus.elegance.ToString();
  450. this.m_lCharm.text = this.m_maidStatus.charm.ToString();
  451. this.m_lInran.text = this.m_maidStatus.inyoku.ToString();
  452. this.m_lMValue.text = this.m_maidStatus.mvalue.ToString();
  453. this.m_lHentai.text = this.m_maidStatus.hentai.ToString();
  454. this.m_lHousi.text = this.m_maidStatus.housi.ToString();
  455. this.m_lMaidPoint.text = SceneEdit.Instance.maidPoint.ToString();
  456. foreach (KeyValuePair<string, Personal.Data> keyValuePair in ProfileCtrl.m_dicPersonal)
  457. {
  458. if (this.m_maidStatus.personal.uniqueName == keyValuePair.Value.uniqueName)
  459. {
  460. this.m_pPersonal.value = keyValuePair.Key;
  461. break;
  462. }
  463. }
  464. this.m_pSexualExperience.value = this.GetSelectOptionNameFromSexualExpe(this.m_maidStatus.seikeiken);
  465. this.m_lProfileComment.text = this.m_maidStatus.profileComment;
  466. this.m_inFreeComment.value = this.m_maidStatus.freeComment;
  467. }
  468. public void SetLastName(string inputText)
  469. {
  470. this.m_maidStatus.lastName = this.AdjustStrLengthIfOver(inputText, this.MAX_NAME_LENGTH);
  471. }
  472. public void SetFirstName(string inputText)
  473. {
  474. this.m_maidStatus.firstName = this.AdjustStrLengthIfOver(inputText, this.MAX_NAME_LENGTH);
  475. }
  476. public void SetNickName(string inputText)
  477. {
  478. this.m_maidStatus.nickName = this.AdjustStrLengthIfOver(inputText, this.MAX_NAME_LENGTH);
  479. }
  480. public string SetAge(string inputText)
  481. {
  482. int num = Status.minAge;
  483. if (!int.TryParse(inputText, out num))
  484. {
  485. num = Status.minAge;
  486. }
  487. num = wf.Math.RoundMinMax(num, Status.minAge, Status.maxAge);
  488. this.m_maidStatus.age = num;
  489. return this.m_maidStatus.age.ToString();
  490. }
  491. public void SubmitAge()
  492. {
  493. if (this.m_inAgeInput.isSelected)
  494. {
  495. this.m_inAgeInput.RemoveFocus();
  496. }
  497. this.m_inAgeInput.value = this.m_maidStatus.age.ToString();
  498. }
  499. public void SetFreeCommnet(string inputText)
  500. {
  501. this.m_maidStatus.freeComment = this.AdjustStrLengthIfOver(inputText, 304);
  502. }
  503. public void SetPersonal(string selectValue)
  504. {
  505. Personal.Data personal;
  506. if (ProfileCtrl.m_dicPersonal.TryGetValue(selectValue, out personal))
  507. {
  508. this.m_maidStatus.SetPersonal(personal);
  509. this.m_maidStatus.additionalRelation = AdditionalRelation.Vigilance;
  510. Debug.Log(string.Concat(new object[]
  511. {
  512. "保存された性格:",
  513. this.m_maidStatus.personal,
  514. " = ",
  515. selectValue
  516. }));
  517. }
  518. }
  519. public void SetSexualExperience(string selectValue)
  520. {
  521. Seikeiken[] array = new Seikeiken[]
  522. {
  523. Seikeiken.No_No,
  524. Seikeiken.Yes_No,
  525. Seikeiken.No_Yes,
  526. Seikeiken.Yes_Yes
  527. };
  528. foreach (Seikeiken seikeiken in array)
  529. {
  530. if (EnumConvert.GetTerm(seikeiken) == selectValue)
  531. {
  532. Seikeiken initSeikeiken = Seikeiken.No_No;
  533. if (ProfileCtrl.m_dicSexualExperience.TryGetValue(EnumConvert.GetString(seikeiken), out initSeikeiken))
  534. {
  535. this.m_maidStatus.seikeiken = (this.m_maidStatus.initSeikeiken = initSeikeiken);
  536. }
  537. break;
  538. }
  539. }
  540. }
  541. private string GetSelectOptionNameFromSexualExpe(Seikeiken sexualExperience)
  542. {
  543. foreach (KeyValuePair<string, Seikeiken> keyValuePair in ProfileCtrl.m_dicSexualExperience)
  544. {
  545. if (keyValuePair.Value == sexualExperience)
  546. {
  547. return EnumConvert.GetTerm(keyValuePair.Value);
  548. }
  549. }
  550. return null;
  551. }
  552. private string GetContractType(Contract contractType)
  553. {
  554. return EnumConvert.GetTerm(contractType);
  555. }
  556. private string GetCondition(Relation relation, AdditionalRelation addRelation)
  557. {
  558. return EnumConvert.GetTerm(relation, addRelation);
  559. }
  560. private string AdjustStrLengthIfOver(string str, int length)
  561. {
  562. if (str.Length > length)
  563. {
  564. str = str.Substring(length);
  565. Debug.LogError(string.Format("入力された文字数が最大文字数を超えています。入力文字={0}, 最大文字数={1}", str, length));
  566. }
  567. return str;
  568. }
  569. private int AdjustIntIfOverRange(int value, int minNumber, int maxNumber)
  570. {
  571. if (value < minNumber)
  572. {
  573. value = minNumber;
  574. Debug.LogError(string.Format("入力された値が許容される最小値より小さいです。入力値={0}, 許容される値の範囲[{1}-{2}]", value, minNumber, maxNumber));
  575. }
  576. else if (value > maxNumber)
  577. {
  578. value = maxNumber;
  579. Debug.LogError(string.Format("入力された値が許容される最大値より大きいです。入力値={0}, 許容される値の範囲[{1}-{2}]", value, minNumber, maxNumber));
  580. }
  581. return value;
  582. }
  583. private void CheckValueRange(int value, int minNumber, int maxNumber)
  584. {
  585. if (value < minNumber || value > maxNumber)
  586. {
  587. Debug.LogError(string.Format("値が不適切です。値={0}, 許容される値の範囲[{1}-{2}]", value, minNumber, maxNumber));
  588. }
  589. }
  590. private bool CheckValueLength(string value, int length)
  591. {
  592. if (value.Length <= length)
  593. {
  594. return true;
  595. }
  596. Debug.LogError(string.Format("値の桁数が不適切です。値={0}, 許容される値の最大桁数={1}", value, length));
  597. return false;
  598. }
  599. public void ChangeCommentTab(string clickTab)
  600. {
  601. if (clickTab == ProfileMgr.CommentTab.ProfileTab.ToString())
  602. {
  603. this.m_bProfileTab.defaultColor = this.activeColor;
  604. this.m_bFreeTab.defaultColor = this.inActiveColor;
  605. this.m_goProfileComment.SetActive(true);
  606. this.m_goFreeComment.SetActive(false);
  607. this.m_goProfileTabSelector.SetActive(true);
  608. this.m_goFreeTabSelector.SetActive(false);
  609. }
  610. else if (clickTab == ProfileMgr.CommentTab.FreeTab.ToString())
  611. {
  612. this.m_bProfileTab.defaultColor = this.inActiveColor;
  613. this.m_bFreeTab.defaultColor = this.activeColor;
  614. this.m_goProfileComment.SetActive(false);
  615. this.m_goFreeComment.SetActive(true);
  616. this.m_goProfileTabSelector.SetActive(false);
  617. this.m_goFreeTabSelector.SetActive(true);
  618. }
  619. }
  620. private bool NotExist<K, V>(Dictionary<K, V> dic)
  621. {
  622. return dic == null || dic.Count == 0;
  623. }
  624. public void CreateMaidSkillViewer(Dictionary<string, ProfileCtrl.ProfileLabelUnit> dicProfileLabel)
  625. {
  626. this.m_dicProfileLabel = dicProfileLabel;
  627. this.CreateProfileItemInViewer(ProfileMgr.UpperButtonType.MaidSkill, this.m_goMaidSkillParent);
  628. this.SetActiveViewerAndButton(ProfileMgr.UpperButtonType.MaidSkill);
  629. this.AdjustTargetPosition(this.m_goMaidSkillParent, this.m_maidSkillScrollView);
  630. }
  631. public void CreateCharacterViewer(Dictionary<string, ProfileCtrl.ProfileLabelUnit> dicProfileLabel)
  632. {
  633. this.m_dicProfileLabel = dicProfileLabel;
  634. this.CreateProfileItemInViewer(ProfileMgr.UpperButtonType.Character, this.m_goCharacterParent);
  635. this.SetActiveViewerAndButton(ProfileMgr.UpperButtonType.Character);
  636. this.AdjustTargetPosition(this.m_goCharacterParent, this.m_characterScrollView);
  637. }
  638. public void CreatePropensityViewer(Dictionary<string, ProfileCtrl.ProfileLabelUnit> dicProfileLabel)
  639. {
  640. this.m_dicProfileLabel = dicProfileLabel;
  641. this.CreateProfileItemInViewer(ProfileMgr.UpperButtonType.Propensity, this.m_goPropensityParent);
  642. this.SetActiveViewerAndButton(ProfileMgr.UpperButtonType.Propensity);
  643. this.AdjustTargetPosition(this.m_goPropensityParent, this.m_propensityScrollView);
  644. }
  645. public void CreateYotogiSkill(Dictionary<string, ProfileCtrl.ProfileYotogiSkillUnit> dicYotogiSkill)
  646. {
  647. this.m_dicYotogiSkill = dicYotogiSkill;
  648. this.CreateProfileItemInViewer(ProfileMgr.UpperButtonType.YotogiSkill, this.m_goYotogiSkillParent);
  649. this.SetActiveViewerAndButton(ProfileMgr.UpperButtonType.YotogiSkill);
  650. this.AdjustTargetPosition(this.m_goYotogiSkillParent, this.m_yotogiSkillScrollView);
  651. }
  652. private void CreateProfileItemInViewer(ProfileMgr.UpperButtonType btnType, GameObject goParent)
  653. {
  654. this.ClearExistChildGameObject(goParent);
  655. GameObject gameObject = null;
  656. switch (btnType)
  657. {
  658. case ProfileMgr.UpperButtonType.MaidSkill:
  659. case ProfileMgr.UpperButtonType.Character:
  660. case ProfileMgr.UpperButtonType.Propensity:
  661. {
  662. gameObject = this.GetPrefabs(this.m_goProfileLabelUnitPrefab, "SceneEdit/Profile/Prefab/ProfileLabelUnit");
  663. List<ProfileCtrl.ProfileLabelUnit> list = new List<ProfileCtrl.ProfileLabelUnit>();
  664. foreach (KeyValuePair<string, ProfileCtrl.ProfileLabelUnit> keyValuePair in this.m_dicProfileLabel)
  665. {
  666. list.Add(keyValuePair.Value);
  667. }
  668. list.Sort((ProfileCtrl.ProfileLabelUnit a, ProfileCtrl.ProfileLabelUnit b) => int.Parse(a.m_id) - int.Parse(b.m_id));
  669. for (int i = 0; i < list.Count; i++)
  670. {
  671. GameObject gameObject2 = UnityEngine.Object.Instantiate<GameObject>(gameObject);
  672. this.SetTransformInfo(gameObject2, goParent);
  673. UILabel component = UTY.GetChildObject(gameObject2, "Parameter", false).GetComponent<UILabel>();
  674. component.text = list[i].m_parameter;
  675. Localize localize = component.gameObject.AddComponent<Localize>();
  676. if (btnType == ProfileMgr.UpperButtonType.Character)
  677. {
  678. Utility.SetLocalizeTerm(localize, "MaidStatus/特徴タイプ/" + list[i].m_parameter, false);
  679. }
  680. else if (btnType == ProfileMgr.UpperButtonType.Propensity)
  681. {
  682. Utility.SetLocalizeTerm(localize, "MaidStatus/性癖タイプ/" + list[i].m_parameter, false);
  683. }
  684. }
  685. this.m_goProfileLabelUnitPrefab = gameObject;
  686. break;
  687. }
  688. case ProfileMgr.UpperButtonType.YotogiSkill:
  689. gameObject = this.GetPrefabs(this.m_goYotogiSkillUnitPrefab, "SceneEdit/Profile/Prefab/YotogiSkillUnit");
  690. foreach (KeyValuePair<string, ProfileCtrl.ProfileYotogiSkillUnit> keyValuePair2 in this.m_dicYotogiSkill)
  691. {
  692. GameObject gameObject3 = UnityEngine.Object.Instantiate<GameObject>(gameObject);
  693. this.SetTransformInfo(gameObject3, goParent);
  694. UILabel component2 = UTY.GetChildObject(gameObject3, "Number/Value", false).GetComponent<UILabel>();
  695. component2.text = keyValuePair2.Value.m_number;
  696. UILabel component3 = UTY.GetChildObject(gameObject3, "SkillName/Value", false).GetComponent<UILabel>();
  697. component3.text = keyValuePair2.Value.m_skillName;
  698. UISprite component4 = UTY.GetChildObject(gameObject3, "LevelOfAchievement/Icon", false).GetComponent<UISprite>();
  699. component4.spriteName = this.m_dicSpriteName[keyValuePair2.Value.m_levelOfAchievement];
  700. }
  701. this.m_goYotogiSkillUnitPrefab = gameObject;
  702. break;
  703. }
  704. }
  705. private void SetTransformInfo(GameObject copyPrefabs, GameObject goParent)
  706. {
  707. copyPrefabs.transform.parent = goParent.transform;
  708. copyPrefabs.transform.localScale = Vector3.one;
  709. copyPrefabs.transform.localPosition = Vector3.zero;
  710. copyPrefabs.transform.rotation = Quaternion.identity;
  711. }
  712. private GameObject GetPrefabs(GameObject prefabs, string prefabsPath)
  713. {
  714. if (prefabs == null)
  715. {
  716. prefabs = (Resources.Load(prefabsPath) as GameObject);
  717. if (prefabs == null)
  718. {
  719. Debug.LogError(string.Format("ロードされるプレハブが見つかりませんでした。パス={0}", prefabsPath));
  720. }
  721. }
  722. return prefabs;
  723. }
  724. private void AdjustTargetPosition(GameObject go, UIScrollView scrollView)
  725. {
  726. go.GetComponent<UIGrid>().Reposition();
  727. scrollView.ResetPosition();
  728. }
  729. private void AdjustTargetPositionGridAndTable(GameObject goGrid, GameObject goTable, UIScrollView scrollView)
  730. {
  731. goGrid.GetComponent<UIGrid>().Reposition();
  732. goTable.GetComponent<UITable>().Reposition();
  733. scrollView.ResetPosition();
  734. }
  735. private void ClearExistChildGameObject(GameObject parent)
  736. {
  737. IEnumerator enumerator = parent.transform.GetEnumerator();
  738. try
  739. {
  740. while (enumerator.MoveNext())
  741. {
  742. object obj = enumerator.Current;
  743. Transform transform = (Transform)obj;
  744. UnityEngine.Object.Destroy(transform.gameObject);
  745. }
  746. }
  747. finally
  748. {
  749. IDisposable disposable;
  750. if ((disposable = (enumerator as IDisposable)) != null)
  751. {
  752. disposable.Dispose();
  753. }
  754. }
  755. parent.transform.DetachChildren();
  756. }
  757. private int ToPercent(int number)
  758. {
  759. return (int)System.Math.Floor((double)(number / 10));
  760. }
  761. public void OnDisable()
  762. {
  763. if (!this.m_bInited)
  764. {
  765. return;
  766. }
  767. this.SetFirstName(this.m_inFirstName.value);
  768. this.SetLastName(this.m_inLastName.value);
  769. this.SetNickName(this.m_inNickName.value);
  770. this.SetAge(this.m_inAgeInput.value);
  771. this.SetFreeCommnet(this.m_inFreeComment.value);
  772. }
  773. public void UpdateProfileData(bool updateYotogiSkill)
  774. {
  775. if (this.m_enabledInput)
  776. {
  777. this.m_maidStatus.mainChara = !this.m_enabledPersonalityInput;
  778. foreach (int featureId in this.m_maidStatus.features.GetKeyArray())
  779. {
  780. this.m_maidStatus.RemoveFeature(featureId);
  781. }
  782. List<Feature.Data> allDatas = Feature.GetAllDatas(true);
  783. foreach (Personal.Data.LearnFeature learnFeature in this.m_maidStatus.personal.acquisitionFeatureList)
  784. {
  785. if (learnFeature.isLearnPossible(this.m_maidStatus))
  786. {
  787. this.m_maidStatus.AddFeature(learnFeature.feature);
  788. }
  789. }
  790. AbstractClassData.ClassType classTypeFlags = AbstractClassData.ClassType.Share | AbstractClassData.ClassType.New | AbstractClassData.ClassType.Old;
  791. this.m_maidStatus.yotogiClass.Clear();
  792. foreach (YotogiClass.Data data in this.m_maidStatus.yotogiClass.GetLearnPossibleClassDatas(false, classTypeFlags))
  793. {
  794. if (GameMain.Instance.CharacterMgr.status.IsYotogiClassOpenFlag(data.id))
  795. {
  796. this.m_maidStatus.yotogiClass.Add(data.id, false, true);
  797. }
  798. }
  799. int id = this.m_maidStatus.selectedJobClass.data.id;
  800. HashSet<int> hashSet = new HashSet<int>();
  801. foreach (KeyValuePair<int, ClassData<JobClass.Data>> keyValuePair in this.m_maidStatus.jobClass.GetAllDatas())
  802. {
  803. hashSet.Add(keyValuePair.Key);
  804. }
  805. HashSet<int> hashSet2 = new HashSet<int>();
  806. foreach (JobClass.Data data2 in this.m_maidStatus.jobClass.GetLearnPossibleClassDatas(false, classTypeFlags))
  807. {
  808. if (GameMain.Instance.CharacterMgr.status.IsJobClassOpenFlag(data2.id))
  809. {
  810. hashSet2.Add(data2.id);
  811. }
  812. }
  813. HashSet<int> hashSet3 = new HashSet<int>();
  814. foreach (int item in hashSet)
  815. {
  816. if (!hashSet2.Contains(item))
  817. {
  818. hashSet3.Add(item);
  819. }
  820. }
  821. HashSet<int> hashSet4 = new HashSet<int>();
  822. foreach (int item2 in hashSet2)
  823. {
  824. if (!hashSet.Contains(item2))
  825. {
  826. hashSet4.Add(item2);
  827. }
  828. }
  829. foreach (int id2 in hashSet3)
  830. {
  831. this.m_maidStatus.jobClass.Remove(id2, true);
  832. }
  833. int num = -1;
  834. foreach (int num2 in hashSet4)
  835. {
  836. this.m_maidStatus.jobClass.Add(num2, false, true);
  837. num = ((num >= num2) ? num : num2);
  838. }
  839. if (num != -1)
  840. {
  841. this.m_maidStatus.ChangeJobClass(num);
  842. }
  843. if (updateYotogiSkill)
  844. {
  845. this.m_maidStatus.yotogiSkill.Clear();
  846. List<Skill.Data> learnPossibleSkills = Skill.GetLearnPossibleSkills(this.m_maidStatus);
  847. foreach (Skill.Data data3 in learnPossibleSkills)
  848. {
  849. this.m_maidStatus.yotogiSkill.Add(data3.id);
  850. }
  851. }
  852. this.m_maidStatus.UpdateClassBonusStatus();
  853. this.m_maidStatus.sexPlayNumberOfPeople = MaidProfile.UpdateInitPlayNumber(this.m_maidStatus.maid);
  854. }
  855. this.m_maidStatus.UpdateBodyParam();
  856. this.m_maidStatus.profileComment = MaidProfile.Create(this.m_maidStatus.maid, !this.m_enabledInput);
  857. }
  858. private Status m_maidStatus;
  859. private ProfileCtrl.ProfileAttribute m_profileAttribute;
  860. private GameObject m_goProfilePanel;
  861. private GameObject m_goProfileComment;
  862. private GameObject m_goFreeComment;
  863. private GameObject m_goProfileTabSelector;
  864. private GameObject m_goFreeTabSelector;
  865. private GameObject m_goProfileLabelUnitPrefab;
  866. private GameObject m_goYotogiSkillUnitPrefab;
  867. private GameObject m_goMaidPointTitleAndFrame;
  868. private GameObject m_goMaidSkillParent;
  869. private GameObject m_goCharacterParent;
  870. private GameObject m_goPropensityParent;
  871. private GameObject m_goYotogiSkillParent;
  872. private GameObject m_goErogenousZoneParent;
  873. private GameObject m_goMaidSkillViewer;
  874. private GameObject m_goCharacterViewer;
  875. private GameObject m_goPropensityViewer;
  876. private GameObject m_goYotogiSkillViewer;
  877. private GameObject m_goPersonalSelectorIcon;
  878. private GameObject m_goSexualExperienceSelectorIcon;
  879. private UIScrollView m_maidSkillScrollView;
  880. private UIScrollView m_characterScrollView;
  881. private UIScrollView m_propensityScrollView;
  882. private UIScrollView m_yotogiSkillScrollView;
  883. private UIScrollView m_attributeScrollView;
  884. private UILabel m_lContractType;
  885. private UILabel m_lMaidClassName;
  886. private UILabel m_lMaidClassLevel;
  887. private UILabel m_lMaidClassExp;
  888. private UILabel m_lMaidClassRequiredExp;
  889. private UILabel m_lYotogiClassName;
  890. private UILabel m_lYotogiClassLevel;
  891. private UILabel m_lYotogiClassExp;
  892. private UILabel m_lYotogiClassRequiredExp;
  893. private UILabel m_lHeight;
  894. private UILabel m_lWeight;
  895. private UILabel m_lBust;
  896. private UILabel m_lCup;
  897. private UILabel m_lWaist;
  898. private UILabel m_lHip;
  899. private UILabel m_lRelation;
  900. private UILabel m_lConditionText;
  901. private UILabel m_lYotogiPlayCount;
  902. private UILabel m_lOthersPlayCount;
  903. private UILabel m_lHp;
  904. private UILabel m_lLikability;
  905. private UILabel m_lMind;
  906. private UILabel m_lReception;
  907. private UILabel m_lCare;
  908. private UILabel m_lStudyRate;
  909. private UILabel m_lTeachRate;
  910. private UILabel m_lCooking;
  911. private UILabel m_lDance;
  912. private UILabel m_lVocal;
  913. private UILabel m_lLovely;
  914. private UILabel m_lElegance;
  915. private UILabel m_lCharm;
  916. private UILabel m_lInran;
  917. private UILabel m_lMValue;
  918. private UILabel m_lHentai;
  919. private UILabel m_lHousi;
  920. private UILabel m_lMaidPoint;
  921. private UILabel m_lProfileComment;
  922. private UIInput m_inFreeComment;
  923. private UIInput m_inFirstName;
  924. private UIInput m_inLastName;
  925. private UIInput m_inNickName;
  926. private UIInput m_inAgeInput;
  927. private UIButton m_buFirstName;
  928. private UIButton m_buLastName;
  929. private UIPopupList m_pPersonal;
  930. private UILabel m_lPersonal;
  931. private UIPopupList m_pSexualExperience;
  932. private UIButton m_bProfileTab;
  933. private UIButton m_bFreeTab;
  934. private BoxCollider m_clFirstName;
  935. private BoxCollider m_clLastName;
  936. private BoxCollider m_clNickName;
  937. private BoxCollider m_clAgeInput;
  938. private BoxCollider m_clPersonal;
  939. private BoxCollider m_clSexualExperience;
  940. private static Dictionary<string, Personal.Data> m_dicPersonal;
  941. private static Dictionary<string, Seikeiken> m_dicSexualExperience;
  942. private Dictionary<ProfileMgr.UpperButtonType, GameObject> m_dicSubViewer;
  943. private Dictionary<ProfileMgr.UpperButtonType, ProfileCtrl.UpperButton> m_dicUpperBtn;
  944. private Dictionary<string, ProfileCtrl.ProfileLabelUnit> m_dicProfileLabel;
  945. private Dictionary<string, ProfileCtrl.ProfileYotogiSkillUnit> m_dicYotogiSkill;
  946. private Dictionary<ProfileCtrl.LevelOfAchievement, string> m_dicSpriteName;
  947. private bool m_bInited;
  948. private Color activeColor;
  949. private Color inActiveColor;
  950. private const int MAX_FREE_COMMENT_LENGTH = 304;
  951. private const int MAX_EROGENOUSZONE_UNIT = 7;
  952. private const int MAX_ATTRIBUTE_UNIT = 10;
  953. private const int DENOMINATOR = 10;
  954. private const string MAID_SKILL_UNIT_PARENT_PATH = "SubWindows/MaidSkillViewer/Contents/MaidSkillUnitParent";
  955. private const string CHARACTER_UNIT_PARENT_PATH = "SubWindows/CharacterViewer/Contents/CharacterUnitParent";
  956. private const string PROPENSITY_UNIT_PARENT_PATH = "SubWindows/PropensityViewer/Contents/CharacterUnitParent";
  957. private const string YOTOGI_SKILL_UNIT_PARENT_PATH = "SubWindows/YotogiSkillViewer/Contents/YotogiSkillUnitParent";
  958. private const string ATTRIBUTE_UNIT_PARENT_PATH = "SubWindows/AttributeViewer/Contents/Attribute/AttributeUnitParent";
  959. private const string EROGENOUS_ZONE_UNIT_PARENT_PATH = "SubWindows/AttributeViewer/Contents/ErogenousZone/ErogenousZoneParent";
  960. private const string PROFILE_LABEL_UNIT_PREFAB_PATH = "SceneEdit/Profile/Prefab/ProfileLabelUnit";
  961. private const string PROFILE_YOTOGI_SKILL_UNIT_PREFAB_PATH = "SceneEdit/Profile/Prefab/YotogiSkillUnit";
  962. private const string PROFILE_ATTRIBUTE_UNIT_PREFAB_PATH = "SceneEdit/Profile/Prefab/AttributeUnit";
  963. private const string PROFILE_EROGENOUS_ZONE_UNIT_PREFAB_PATH = "SceneEdit/Profile/Prefab/ErogenousZoneUnit";
  964. private float initMaidPointUIPosX;
  965. public enum LevelOfAchievement
  966. {
  967. level_1,
  968. level_2,
  969. level_3,
  970. level_4
  971. }
  972. private class UpperButton
  973. {
  974. public ProfileMgr.UpperButtonType m_name;
  975. public GameObject m_goSelectCursor;
  976. public UIButton m_btnButton;
  977. }
  978. public class ProfileLabelUnit
  979. {
  980. public string m_id;
  981. public string m_parameter;
  982. }
  983. public class ProfileYotogiSkillUnit
  984. {
  985. public string m_id;
  986. public string m_number;
  987. public string m_skillName;
  988. public ProfileCtrl.LevelOfAchievement m_levelOfAchievement;
  989. }
  990. public class ProfileAttribute
  991. {
  992. public ProfileAttribute()
  993. {
  994. this.m_listAttributeUnitName = new List<string>();
  995. }
  996. public List<string> m_listAttributeUnitName;
  997. }
  998. public class ErogenousZoneUnit
  999. {
  1000. public string m_category;
  1001. public int m_PercentNumber;
  1002. }
  1003. }