ProfileCtrl.cs 43 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167
  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. if (SceneEdit.Instance != null && (SceneEdit.Instance.modeType == SceneEdit.ModeType.OriginalChara || SceneEdit.Instance.modeType == SceneEdit.ModeType.MainChara))
  510. {
  511. this.m_maidStatus.additionalRelation = AdditionalRelation.Vigilance;
  512. }
  513. Debug.Log(string.Concat(new object[]
  514. {
  515. "保存された性格:",
  516. this.m_maidStatus.personal,
  517. " = ",
  518. selectValue
  519. }));
  520. }
  521. }
  522. public void SetSexualExperience(string selectValue)
  523. {
  524. Seikeiken[] array = new Seikeiken[]
  525. {
  526. Seikeiken.No_No,
  527. Seikeiken.Yes_No,
  528. Seikeiken.No_Yes,
  529. Seikeiken.Yes_Yes
  530. };
  531. foreach (Seikeiken seikeiken in array)
  532. {
  533. if (EnumConvert.GetTerm(seikeiken) == selectValue)
  534. {
  535. Seikeiken initSeikeiken = Seikeiken.No_No;
  536. if (ProfileCtrl.m_dicSexualExperience.TryGetValue(EnumConvert.GetString(seikeiken), out initSeikeiken))
  537. {
  538. this.m_maidStatus.seikeiken = (this.m_maidStatus.initSeikeiken = initSeikeiken);
  539. }
  540. break;
  541. }
  542. }
  543. }
  544. private string GetSelectOptionNameFromSexualExpe(Seikeiken sexualExperience)
  545. {
  546. foreach (KeyValuePair<string, Seikeiken> keyValuePair in ProfileCtrl.m_dicSexualExperience)
  547. {
  548. if (keyValuePair.Value == sexualExperience)
  549. {
  550. return EnumConvert.GetTerm(keyValuePair.Value);
  551. }
  552. }
  553. return null;
  554. }
  555. private string GetContractType(Contract contractType)
  556. {
  557. return EnumConvert.GetTerm(contractType);
  558. }
  559. private string GetCondition(Relation relation, AdditionalRelation addRelation)
  560. {
  561. return EnumConvert.GetTerm(relation, addRelation);
  562. }
  563. private string AdjustStrLengthIfOver(string str, int length)
  564. {
  565. if (str.Length > length)
  566. {
  567. str = str.Substring(length);
  568. Debug.LogError(string.Format("入力された文字数が最大文字数を超えています。入力文字={0}, 最大文字数={1}", str, length));
  569. }
  570. return str;
  571. }
  572. private int AdjustIntIfOverRange(int value, int minNumber, int maxNumber)
  573. {
  574. if (value < minNumber)
  575. {
  576. value = minNumber;
  577. Debug.LogError(string.Format("入力された値が許容される最小値より小さいです。入力値={0}, 許容される値の範囲[{1}-{2}]", value, minNumber, maxNumber));
  578. }
  579. else if (value > maxNumber)
  580. {
  581. value = maxNumber;
  582. Debug.LogError(string.Format("入力された値が許容される最大値より大きいです。入力値={0}, 許容される値の範囲[{1}-{2}]", value, minNumber, maxNumber));
  583. }
  584. return value;
  585. }
  586. private void CheckValueRange(int value, int minNumber, int maxNumber)
  587. {
  588. if (value < minNumber || value > maxNumber)
  589. {
  590. Debug.LogError(string.Format("値が不適切です。値={0}, 許容される値の範囲[{1}-{2}]", value, minNumber, maxNumber));
  591. }
  592. }
  593. private bool CheckValueLength(string value, int length)
  594. {
  595. if (value.Length <= length)
  596. {
  597. return true;
  598. }
  599. Debug.LogError(string.Format("値の桁数が不適切です。値={0}, 許容される値の最大桁数={1}", value, length));
  600. return false;
  601. }
  602. public void ChangeCommentTab(string clickTab)
  603. {
  604. if (clickTab == ProfileMgr.CommentTab.ProfileTab.ToString())
  605. {
  606. this.m_bProfileTab.defaultColor = this.activeColor;
  607. this.m_bFreeTab.defaultColor = this.inActiveColor;
  608. this.m_goProfileComment.SetActive(true);
  609. this.m_goFreeComment.SetActive(false);
  610. this.m_goProfileTabSelector.SetActive(true);
  611. this.m_goFreeTabSelector.SetActive(false);
  612. }
  613. else if (clickTab == ProfileMgr.CommentTab.FreeTab.ToString())
  614. {
  615. this.m_bProfileTab.defaultColor = this.inActiveColor;
  616. this.m_bFreeTab.defaultColor = this.activeColor;
  617. this.m_goProfileComment.SetActive(false);
  618. this.m_goFreeComment.SetActive(true);
  619. this.m_goProfileTabSelector.SetActive(false);
  620. this.m_goFreeTabSelector.SetActive(true);
  621. }
  622. }
  623. private bool NotExist<K, V>(Dictionary<K, V> dic)
  624. {
  625. return dic == null || dic.Count == 0;
  626. }
  627. public void CreateMaidSkillViewer(Dictionary<string, ProfileCtrl.ProfileLabelUnit> dicProfileLabel)
  628. {
  629. this.m_dicProfileLabel = dicProfileLabel;
  630. this.CreateProfileItemInViewer(ProfileMgr.UpperButtonType.MaidSkill, this.m_goMaidSkillParent);
  631. this.SetActiveViewerAndButton(ProfileMgr.UpperButtonType.MaidSkill);
  632. this.AdjustTargetPosition(this.m_goMaidSkillParent, this.m_maidSkillScrollView);
  633. }
  634. public void CreateCharacterViewer(Dictionary<string, ProfileCtrl.ProfileLabelUnit> dicProfileLabel)
  635. {
  636. this.m_dicProfileLabel = dicProfileLabel;
  637. this.CreateProfileItemInViewer(ProfileMgr.UpperButtonType.Character, this.m_goCharacterParent);
  638. this.SetActiveViewerAndButton(ProfileMgr.UpperButtonType.Character);
  639. this.AdjustTargetPosition(this.m_goCharacterParent, this.m_characterScrollView);
  640. }
  641. public void CreatePropensityViewer(Dictionary<string, ProfileCtrl.ProfileLabelUnit> dicProfileLabel)
  642. {
  643. this.m_dicProfileLabel = dicProfileLabel;
  644. this.CreateProfileItemInViewer(ProfileMgr.UpperButtonType.Propensity, this.m_goPropensityParent);
  645. this.SetActiveViewerAndButton(ProfileMgr.UpperButtonType.Propensity);
  646. this.AdjustTargetPosition(this.m_goPropensityParent, this.m_propensityScrollView);
  647. }
  648. public void CreateYotogiSkill(Dictionary<string, ProfileCtrl.ProfileYotogiSkillUnit> dicYotogiSkill)
  649. {
  650. this.m_dicYotogiSkill = dicYotogiSkill;
  651. this.CreateProfileItemInViewer(ProfileMgr.UpperButtonType.YotogiSkill, this.m_goYotogiSkillParent);
  652. this.SetActiveViewerAndButton(ProfileMgr.UpperButtonType.YotogiSkill);
  653. this.AdjustTargetPosition(this.m_goYotogiSkillParent, this.m_yotogiSkillScrollView);
  654. }
  655. private void CreateProfileItemInViewer(ProfileMgr.UpperButtonType btnType, GameObject goParent)
  656. {
  657. this.ClearExistChildGameObject(goParent);
  658. GameObject gameObject = null;
  659. switch (btnType)
  660. {
  661. case ProfileMgr.UpperButtonType.MaidSkill:
  662. case ProfileMgr.UpperButtonType.Character:
  663. case ProfileMgr.UpperButtonType.Propensity:
  664. {
  665. gameObject = this.GetPrefabs(this.m_goProfileLabelUnitPrefab, "SceneEdit/Profile/Prefab/ProfileLabelUnit");
  666. List<ProfileCtrl.ProfileLabelUnit> list = new List<ProfileCtrl.ProfileLabelUnit>();
  667. foreach (KeyValuePair<string, ProfileCtrl.ProfileLabelUnit> keyValuePair in this.m_dicProfileLabel)
  668. {
  669. list.Add(keyValuePair.Value);
  670. }
  671. list.Sort((ProfileCtrl.ProfileLabelUnit a, ProfileCtrl.ProfileLabelUnit b) => int.Parse(a.m_id) - int.Parse(b.m_id));
  672. for (int i = 0; i < list.Count; i++)
  673. {
  674. GameObject gameObject2 = UnityEngine.Object.Instantiate<GameObject>(gameObject);
  675. this.SetTransformInfo(gameObject2, goParent);
  676. UILabel component = UTY.GetChildObject(gameObject2, "Parameter", false).GetComponent<UILabel>();
  677. component.text = list[i].m_parameter;
  678. Localize localize = component.gameObject.AddComponent<Localize>();
  679. if (btnType == ProfileMgr.UpperButtonType.Character)
  680. {
  681. Utility.SetLocalizeTerm(localize, "MaidStatus/特徴タイプ/" + list[i].m_parameter, false);
  682. }
  683. else if (btnType == ProfileMgr.UpperButtonType.Propensity)
  684. {
  685. Utility.SetLocalizeTerm(localize, "MaidStatus/性癖タイプ/" + list[i].m_parameter, false);
  686. }
  687. }
  688. this.m_goProfileLabelUnitPrefab = gameObject;
  689. break;
  690. }
  691. case ProfileMgr.UpperButtonType.YotogiSkill:
  692. gameObject = this.GetPrefabs(this.m_goYotogiSkillUnitPrefab, "SceneEdit/Profile/Prefab/YotogiSkillUnit");
  693. foreach (KeyValuePair<string, ProfileCtrl.ProfileYotogiSkillUnit> keyValuePair2 in this.m_dicYotogiSkill)
  694. {
  695. GameObject gameObject3 = UnityEngine.Object.Instantiate<GameObject>(gameObject);
  696. this.SetTransformInfo(gameObject3, goParent);
  697. UILabel component2 = UTY.GetChildObject(gameObject3, "Number/Value", false).GetComponent<UILabel>();
  698. component2.text = keyValuePair2.Value.m_number;
  699. UILabel component3 = UTY.GetChildObject(gameObject3, "SkillName/Value", false).GetComponent<UILabel>();
  700. component3.text = keyValuePair2.Value.m_skillName;
  701. UISprite component4 = UTY.GetChildObject(gameObject3, "LevelOfAchievement/Icon", false).GetComponent<UISprite>();
  702. component4.spriteName = this.m_dicSpriteName[keyValuePair2.Value.m_levelOfAchievement];
  703. }
  704. this.m_goYotogiSkillUnitPrefab = gameObject;
  705. break;
  706. }
  707. }
  708. private void SetTransformInfo(GameObject copyPrefabs, GameObject goParent)
  709. {
  710. copyPrefabs.transform.parent = goParent.transform;
  711. copyPrefabs.transform.localScale = Vector3.one;
  712. copyPrefabs.transform.localPosition = Vector3.zero;
  713. copyPrefabs.transform.rotation = Quaternion.identity;
  714. }
  715. private GameObject GetPrefabs(GameObject prefabs, string prefabsPath)
  716. {
  717. if (prefabs == null)
  718. {
  719. prefabs = (Resources.Load(prefabsPath) as GameObject);
  720. if (prefabs == null)
  721. {
  722. Debug.LogError(string.Format("ロードされるプレハブが見つかりませんでした。パス={0}", prefabsPath));
  723. }
  724. }
  725. return prefabs;
  726. }
  727. private void AdjustTargetPosition(GameObject go, UIScrollView scrollView)
  728. {
  729. go.GetComponent<UIGrid>().Reposition();
  730. scrollView.ResetPosition();
  731. }
  732. private void AdjustTargetPositionGridAndTable(GameObject goGrid, GameObject goTable, UIScrollView scrollView)
  733. {
  734. goGrid.GetComponent<UIGrid>().Reposition();
  735. goTable.GetComponent<UITable>().Reposition();
  736. scrollView.ResetPosition();
  737. }
  738. private void ClearExistChildGameObject(GameObject parent)
  739. {
  740. IEnumerator enumerator = parent.transform.GetEnumerator();
  741. try
  742. {
  743. while (enumerator.MoveNext())
  744. {
  745. object obj = enumerator.Current;
  746. Transform transform = (Transform)obj;
  747. UnityEngine.Object.Destroy(transform.gameObject);
  748. }
  749. }
  750. finally
  751. {
  752. IDisposable disposable;
  753. if ((disposable = (enumerator as IDisposable)) != null)
  754. {
  755. disposable.Dispose();
  756. }
  757. }
  758. parent.transform.DetachChildren();
  759. }
  760. private int ToPercent(int number)
  761. {
  762. return (int)System.Math.Floor((double)(number / 10));
  763. }
  764. public void OnDisable()
  765. {
  766. if (!this.m_bInited)
  767. {
  768. return;
  769. }
  770. this.SetFirstName(this.m_inFirstName.value);
  771. this.SetLastName(this.m_inLastName.value);
  772. this.SetNickName(this.m_inNickName.value);
  773. this.SetAge(this.m_inAgeInput.value);
  774. this.SetFreeCommnet(this.m_inFreeComment.value);
  775. }
  776. public void UpdateProfileData(bool updateYotogiSkill)
  777. {
  778. if (this.m_enabledInput)
  779. {
  780. this.m_maidStatus.mainChara = !this.m_enabledPersonalityInput;
  781. foreach (int featureId in this.m_maidStatus.features.GetKeyArray())
  782. {
  783. this.m_maidStatus.RemoveFeature(featureId);
  784. }
  785. List<Feature.Data> allDatas = Feature.GetAllDatas(true);
  786. foreach (Personal.Data.LearnFeature learnFeature in this.m_maidStatus.personal.acquisitionFeatureList)
  787. {
  788. if (learnFeature.isLearnPossible(this.m_maidStatus))
  789. {
  790. this.m_maidStatus.AddFeature(learnFeature.feature);
  791. }
  792. }
  793. AbstractClassData.ClassType classTypeFlags = AbstractClassData.ClassType.Share | AbstractClassData.ClassType.New | AbstractClassData.ClassType.Old;
  794. this.m_maidStatus.yotogiClass.Clear();
  795. foreach (YotogiClass.Data data in this.m_maidStatus.yotogiClass.GetLearnPossibleClassDatas(false, classTypeFlags))
  796. {
  797. if (GameMain.Instance.CharacterMgr.status.IsYotogiClassOpenFlag(data.id))
  798. {
  799. this.m_maidStatus.yotogiClass.Add(data.id, false, true);
  800. }
  801. }
  802. int id = this.m_maidStatus.selectedJobClass.data.id;
  803. HashSet<int> hashSet = new HashSet<int>();
  804. foreach (KeyValuePair<int, ClassData<JobClass.Data>> keyValuePair in this.m_maidStatus.jobClass.GetAllDatas())
  805. {
  806. hashSet.Add(keyValuePair.Key);
  807. }
  808. HashSet<int> hashSet2 = new HashSet<int>();
  809. foreach (JobClass.Data data2 in this.m_maidStatus.jobClass.GetLearnPossibleClassDatas(false, classTypeFlags))
  810. {
  811. if (GameMain.Instance.CharacterMgr.status.IsJobClassOpenFlag(data2.id))
  812. {
  813. hashSet2.Add(data2.id);
  814. }
  815. }
  816. HashSet<int> hashSet3 = new HashSet<int>();
  817. foreach (int item in hashSet)
  818. {
  819. if (!hashSet2.Contains(item))
  820. {
  821. hashSet3.Add(item);
  822. }
  823. }
  824. HashSet<int> hashSet4 = new HashSet<int>();
  825. foreach (int item2 in hashSet2)
  826. {
  827. if (!hashSet.Contains(item2))
  828. {
  829. hashSet4.Add(item2);
  830. }
  831. }
  832. foreach (int id2 in hashSet3)
  833. {
  834. this.m_maidStatus.jobClass.Remove(id2, true);
  835. }
  836. int num = -1;
  837. foreach (int num2 in hashSet4)
  838. {
  839. this.m_maidStatus.jobClass.Add(num2, false, true);
  840. num = ((num >= num2) ? num : num2);
  841. }
  842. if (num != -1)
  843. {
  844. this.m_maidStatus.ChangeJobClass(num);
  845. }
  846. if (updateYotogiSkill)
  847. {
  848. this.m_maidStatus.yotogiSkill.Clear();
  849. List<Skill.Data> learnPossibleSkills = Skill.GetLearnPossibleSkills(this.m_maidStatus);
  850. foreach (Skill.Data data3 in learnPossibleSkills)
  851. {
  852. this.m_maidStatus.yotogiSkill.Add(data3.id);
  853. }
  854. }
  855. this.m_maidStatus.UpdateClassBonusStatus();
  856. this.m_maidStatus.sexPlayNumberOfPeople = MaidProfile.UpdateInitPlayNumber(this.m_maidStatus.maid);
  857. }
  858. this.m_maidStatus.UpdateBodyParam();
  859. this.m_maidStatus.profileComment = MaidProfile.Create(this.m_maidStatus.maid, !this.m_enabledInput);
  860. }
  861. private Status m_maidStatus;
  862. private ProfileCtrl.ProfileAttribute m_profileAttribute;
  863. private GameObject m_goProfilePanel;
  864. private GameObject m_goProfileComment;
  865. private GameObject m_goFreeComment;
  866. private GameObject m_goProfileTabSelector;
  867. private GameObject m_goFreeTabSelector;
  868. private GameObject m_goProfileLabelUnitPrefab;
  869. private GameObject m_goYotogiSkillUnitPrefab;
  870. private GameObject m_goMaidPointTitleAndFrame;
  871. private GameObject m_goMaidSkillParent;
  872. private GameObject m_goCharacterParent;
  873. private GameObject m_goPropensityParent;
  874. private GameObject m_goYotogiSkillParent;
  875. private GameObject m_goErogenousZoneParent;
  876. private GameObject m_goMaidSkillViewer;
  877. private GameObject m_goCharacterViewer;
  878. private GameObject m_goPropensityViewer;
  879. private GameObject m_goYotogiSkillViewer;
  880. private GameObject m_goPersonalSelectorIcon;
  881. private GameObject m_goSexualExperienceSelectorIcon;
  882. private UIScrollView m_maidSkillScrollView;
  883. private UIScrollView m_characterScrollView;
  884. private UIScrollView m_propensityScrollView;
  885. private UIScrollView m_yotogiSkillScrollView;
  886. private UIScrollView m_attributeScrollView;
  887. private UILabel m_lContractType;
  888. private UILabel m_lMaidClassName;
  889. private UILabel m_lMaidClassLevel;
  890. private UILabel m_lMaidClassExp;
  891. private UILabel m_lMaidClassRequiredExp;
  892. private UILabel m_lYotogiClassName;
  893. private UILabel m_lYotogiClassLevel;
  894. private UILabel m_lYotogiClassExp;
  895. private UILabel m_lYotogiClassRequiredExp;
  896. private UILabel m_lHeight;
  897. private UILabel m_lWeight;
  898. private UILabel m_lBust;
  899. private UILabel m_lCup;
  900. private UILabel m_lWaist;
  901. private UILabel m_lHip;
  902. private UILabel m_lRelation;
  903. private UILabel m_lConditionText;
  904. private UILabel m_lYotogiPlayCount;
  905. private UILabel m_lOthersPlayCount;
  906. private UILabel m_lHp;
  907. private UILabel m_lLikability;
  908. private UILabel m_lMind;
  909. private UILabel m_lReception;
  910. private UILabel m_lCare;
  911. private UILabel m_lStudyRate;
  912. private UILabel m_lTeachRate;
  913. private UILabel m_lCooking;
  914. private UILabel m_lDance;
  915. private UILabel m_lVocal;
  916. private UILabel m_lLovely;
  917. private UILabel m_lElegance;
  918. private UILabel m_lCharm;
  919. private UILabel m_lInran;
  920. private UILabel m_lMValue;
  921. private UILabel m_lHentai;
  922. private UILabel m_lHousi;
  923. private UILabel m_lMaidPoint;
  924. private UILabel m_lProfileComment;
  925. private UIInput m_inFreeComment;
  926. private UIInput m_inFirstName;
  927. private UIInput m_inLastName;
  928. private UIInput m_inNickName;
  929. private UIInput m_inAgeInput;
  930. private UIButton m_buFirstName;
  931. private UIButton m_buLastName;
  932. private UIPopupList m_pPersonal;
  933. private UILabel m_lPersonal;
  934. private UIPopupList m_pSexualExperience;
  935. private UIButton m_bProfileTab;
  936. private UIButton m_bFreeTab;
  937. private BoxCollider m_clFirstName;
  938. private BoxCollider m_clLastName;
  939. private BoxCollider m_clNickName;
  940. private BoxCollider m_clAgeInput;
  941. private BoxCollider m_clPersonal;
  942. private BoxCollider m_clSexualExperience;
  943. private static Dictionary<string, Personal.Data> m_dicPersonal;
  944. private static Dictionary<string, Seikeiken> m_dicSexualExperience;
  945. private Dictionary<ProfileMgr.UpperButtonType, GameObject> m_dicSubViewer;
  946. private Dictionary<ProfileMgr.UpperButtonType, ProfileCtrl.UpperButton> m_dicUpperBtn;
  947. private Dictionary<string, ProfileCtrl.ProfileLabelUnit> m_dicProfileLabel;
  948. private Dictionary<string, ProfileCtrl.ProfileYotogiSkillUnit> m_dicYotogiSkill;
  949. private Dictionary<ProfileCtrl.LevelOfAchievement, string> m_dicSpriteName;
  950. private bool m_bInited;
  951. private Color activeColor;
  952. private Color inActiveColor;
  953. private const int MAX_FREE_COMMENT_LENGTH = 304;
  954. private const int MAX_EROGENOUSZONE_UNIT = 7;
  955. private const int MAX_ATTRIBUTE_UNIT = 10;
  956. private const int DENOMINATOR = 10;
  957. private const string MAID_SKILL_UNIT_PARENT_PATH = "SubWindows/MaidSkillViewer/Contents/MaidSkillUnitParent";
  958. private const string CHARACTER_UNIT_PARENT_PATH = "SubWindows/CharacterViewer/Contents/CharacterUnitParent";
  959. private const string PROPENSITY_UNIT_PARENT_PATH = "SubWindows/PropensityViewer/Contents/CharacterUnitParent";
  960. private const string YOTOGI_SKILL_UNIT_PARENT_PATH = "SubWindows/YotogiSkillViewer/Contents/YotogiSkillUnitParent";
  961. private const string ATTRIBUTE_UNIT_PARENT_PATH = "SubWindows/AttributeViewer/Contents/Attribute/AttributeUnitParent";
  962. private const string EROGENOUS_ZONE_UNIT_PARENT_PATH = "SubWindows/AttributeViewer/Contents/ErogenousZone/ErogenousZoneParent";
  963. private const string PROFILE_LABEL_UNIT_PREFAB_PATH = "SceneEdit/Profile/Prefab/ProfileLabelUnit";
  964. private const string PROFILE_YOTOGI_SKILL_UNIT_PREFAB_PATH = "SceneEdit/Profile/Prefab/YotogiSkillUnit";
  965. private const string PROFILE_ATTRIBUTE_UNIT_PREFAB_PATH = "SceneEdit/Profile/Prefab/AttributeUnit";
  966. private const string PROFILE_EROGENOUS_ZONE_UNIT_PREFAB_PATH = "SceneEdit/Profile/Prefab/ErogenousZoneUnit";
  967. private float initMaidPointUIPosX;
  968. public enum LevelOfAchievement
  969. {
  970. level_1,
  971. level_2,
  972. level_3,
  973. level_4
  974. }
  975. private class UpperButton
  976. {
  977. public ProfileMgr.UpperButtonType m_name;
  978. public GameObject m_goSelectCursor;
  979. public UIButton m_btnButton;
  980. }
  981. public class ProfileLabelUnit
  982. {
  983. public string m_id;
  984. public string m_parameter;
  985. }
  986. public class ProfileYotogiSkillUnit
  987. {
  988. public string m_id;
  989. public string m_number;
  990. public string m_skillName;
  991. public ProfileCtrl.LevelOfAchievement m_levelOfAchievement;
  992. }
  993. public class ProfileAttribute
  994. {
  995. public ProfileAttribute()
  996. {
  997. this.m_listAttributeUnitName = new List<string>();
  998. }
  999. public List<string> m_listAttributeUnitName;
  1000. }
  1001. public class ErogenousZoneUnit
  1002. {
  1003. public string m_category;
  1004. public int m_PercentNumber;
  1005. }
  1006. }