ProfileCtrl.cs 44 KB

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