ProfileCtrl.cs 44 KB

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