StatusCtrl.cs 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using wf;
  5. public class StatusCtrl : MonoBehaviour
  6. {
  7. public void Init(StatusMgr statusMgr, GameObject goStatusPanel)
  8. {
  9. this.m_mgr = statusMgr;
  10. this.m_goPanel = goStatusPanel;
  11. if (Product.isPublic)
  12. {
  13. UIWFPositionStore component = base.GetComponent<UIWFPositionStore>();
  14. if (component != null)
  15. {
  16. component.Apply();
  17. }
  18. UTY.GetChildObject(base.gameObject, "Parameter/Frame", false).GetComponent<UISprite>().height = 485;
  19. UTY.GetChildObject(base.gameObject, "BG", false).GetComponent<UISprite>().height = 664;
  20. }
  21. }
  22. private void InitViewer()
  23. {
  24. this.m_txtMaidIcon = UTY.GetChildObject(this.m_goPanel, "MaidIcon/Icon", false).GetComponent<UITexture>();
  25. GameObject childObject = UTY.GetChildObject(this.m_goPanel, "Name", false);
  26. this.m_lFirstName = UTY.GetChildObject(childObject, "FirstName", false).GetComponent<UILabel>();
  27. this.m_lLastName = UTY.GetChildObject(childObject, "LastName", false).GetComponent<UILabel>();
  28. this.m_lContractType = UTY.GetChildObject(this.m_goPanel, "Column1/ContractType/Value", false).GetComponent<UILabel>();
  29. this.m_lPersonal = UTY.GetChildObject(this.m_goPanel, "Column1/Character/Value", false).GetComponent<UILabel>();
  30. this.m_lSexualExperience = UTY.GetChildObject(this.m_goPanel, "Column1/SexExperience/Value", false).GetComponent<UILabel>();
  31. GameObject childObject2 = UTY.GetChildObject(this.m_goPanel, "Column1/MaidClass", false);
  32. this.m_lMaidClass = UTY.GetChildObject(childObject2, "Value", false).GetComponent<UILabel>();
  33. this.m_lMaidClassLevel = UTY.GetChildObject(childObject2, "Level/Value", false).GetComponent<UILabel>();
  34. this.m_lMaidClassExp = UTY.GetChildObject(childObject2, "Exp/CurrentExp/Value", false).GetComponent<UILabel>();
  35. this.m_lMaidClassRequiredExp = UTY.GetChildObject(childObject2, "Exp/RequiredExp/Value", false).GetComponent<UILabel>();
  36. GameObject childObject3 = UTY.GetChildObject(this.m_goPanel, "Column1/YotogiClass", false);
  37. this.m_lYotogiClass = UTY.GetChildObject(childObject3, "Value", false).GetComponent<UILabel>();
  38. this.m_lYotogiClassLevel = UTY.GetChildObject(childObject3, "Level/Value", false).GetComponent<UILabel>();
  39. this.m_lYotogiClassExp = UTY.GetChildObject(childObject3, "Exp/CurrentExp/Value", false).GetComponent<UILabel>();
  40. this.m_lYotogiClassRequiredExp = UTY.GetChildObject(childObject3, "Exp/RequiredExp/Value", false).GetComponent<UILabel>();
  41. GameObject childObject4 = UTY.GetChildObject(this.m_goPanel, "Column1/BodySize/Parent", false);
  42. this.m_lHeight = UTY.GetChildObject(childObject4, "Height/Value", false).GetComponent<UILabel>();
  43. this.m_lWeight = UTY.GetChildObject(childObject4, "Weight/Value", false).GetComponent<UILabel>();
  44. this.m_lBust = UTY.GetChildObject(childObject4, "Bust/Value", false).GetComponent<UILabel>();
  45. this.m_lCup = UTY.GetChildObject(childObject4, "Bust/Cup/Value", false).GetComponent<UILabel>();
  46. this.m_lWaist = UTY.GetChildObject(childObject4, "Waist/Value", false).GetComponent<UILabel>();
  47. this.m_lHip = UTY.GetChildObject(childObject4, "Hip/Value", false).GetComponent<UILabel>();
  48. GameObject childObject5 = UTY.GetChildObject(UTY.GetChildObject(this.m_goPanel, "Parameter", false), "Parent", false);
  49. this.m_lRelation = UTY.GetChildObject(childObject5, "Block1/Relation/Value", false).GetComponent<UILabel>();
  50. this.m_lConditionText = UTY.GetChildObject(childObject5, "Block1/ConditionText/Value", false).GetComponent<UILabel>();
  51. this.m_lLikability = UTY.GetChildObject(childObject5, "Block1/Likability/Value", false).GetComponent<UILabel>();
  52. this.m_lLovely = UTY.GetChildObject(childObject5, "Block2/Lovely/Value", false).GetComponent<UILabel>();
  53. this.m_lElegance = UTY.GetChildObject(childObject5, "Block2/Elegance/Value", false).GetComponent<UILabel>();
  54. this.m_lCharm = UTY.GetChildObject(childObject5, "Block2/Charm/Value", false).GetComponent<UILabel>();
  55. this.m_lCare = UTY.GetChildObject(childObject5, "Block2/Care/Value", false).GetComponent<UILabel>();
  56. this.m_lReception = UTY.GetChildObject(childObject5, "Block2/Reception/Value", false).GetComponent<UILabel>();
  57. this.m_lCooking = UTY.GetChildObject(childObject5, "Block2/Cooking/Value", false).GetComponent<UILabel>();
  58. this.m_lDance = UTY.GetChildObject(childObject5, "Block2/Dance/Value", false).GetComponent<UILabel>();
  59. this.m_lVocal = UTY.GetChildObject(childObject5, "Block2/Vocal/Value", false).GetComponent<UILabel>();
  60. this.m_lOthersPlayCount = UTY.GetChildObject(childObject5, "Block2/OthersPlayCount/Value", false).GetComponent<UILabel>();
  61. this.m_lTeachRate = UTY.GetChildObject(childObject5, "Block3/TeachRate/Value", false).GetComponent<UILabel>();
  62. this.m_lStudyRate = UTY.GetChildObject(childObject5, "Block3/StudyRate/Value", false).GetComponent<UILabel>();
  63. GameObject childObject6 = UTY.GetChildObject(this.m_goPanel, "Hparameter/Parent", false);
  64. this.m_lHp = UTY.GetChildObject(childObject6, "Hp/Value", false).GetComponent<UILabel>();
  65. this.m_lMind = UTY.GetChildObject(childObject6, "Mind/Value", false).GetComponent<UILabel>();
  66. this.m_lInran = UTY.GetChildObject(childObject6, "Inran/Value", false).GetComponent<UILabel>();
  67. this.m_lMValue = UTY.GetChildObject(childObject6, "MValue/Value", false).GetComponent<UILabel>();
  68. this.m_lHentai = UTY.GetChildObject(childObject6, "Hentai/Value", false).GetComponent<UILabel>();
  69. this.m_lHousi = UTY.GetChildObject(childObject6, "Housi/Value", false).GetComponent<UILabel>();
  70. this.m_lYotogiPlayCount = UTY.GetChildObject(childObject6, "YotogiPlayCount/Value", false).GetComponent<UILabel>();
  71. this.m_lAppeal = UTY.GetChildObject(this.m_goPanel, "Appeal/Appeal/Value", false).GetComponent<UILabel>();
  72. GameObject childObject7 = UTY.GetChildObject(this.m_goPanel, "ErogenousZone", false);
  73. this.m_lMouth = UTY.GetChildObject(childObject7, "Grid/Mouth/Value", false).GetComponent<UILabel>();
  74. this.m_lThroat = UTY.GetChildObject(childObject7, "Grid/Throat/Value", false).GetComponent<UILabel>();
  75. this.m_lNipple = UTY.GetChildObject(childObject7, "Grid/Nipple/Value", false).GetComponent<UILabel>();
  76. this.m_lClitoris = UTY.GetChildObject(childObject7, "Grid/Clitoris/Value", false).GetComponent<UILabel>();
  77. childObject7.SetActive(false);
  78. GameObject childObject8 = UTY.GetChildObject(this.m_goPanel, "Ranking", false);
  79. this.m_goldCrownIcon = UTY.GetChildObject(childObject8, "CrownIcon/Gold", false);
  80. this.m_silverCrownIcon = UTY.GetChildObject(childObject8, "CrownIcon/Silver", false);
  81. this.m_bronzeCrownIcon = UTY.GetChildObject(childObject8, "CrownIcon/Bronze", false);
  82. this.m_dicCrownIcon = new Dictionary<int, GameObject>
  83. {
  84. {
  85. 1,
  86. this.m_goldCrownIcon
  87. },
  88. {
  89. 2,
  90. this.m_silverCrownIcon
  91. },
  92. {
  93. 3,
  94. this.m_bronzeCrownIcon
  95. }
  96. };
  97. this.m_lRanking = UTY.GetChildObject(childObject8, "Value", false).GetComponent<UILabel>();
  98. GameObject childObject9 = UTY.GetChildObject(this.m_goPanel, "Evaluation/Parent", false);
  99. this.m_lAcquisitionOfClientEvaluation = UTY.GetChildObject(childObject9, "AcquisitionOfClientEvaluation/Value", false).GetComponent<UILabel>();
  100. this.m_lAcquisitionOfWorkingFunds = UTY.GetChildObject(childObject9, "AcquisitionOfWorkingFunds/Value", false).GetComponent<UILabel>();
  101. this.m_lDaysOfEmployment = UTY.GetChildObject(this.m_goPanel, "DaysOfEmployment/Value", false).GetComponent<UILabel>();
  102. if (MaidManagement.compatibilityMode)
  103. {
  104. this.m_lCooking.transform.parent.gameObject.SetActive(false);
  105. this.m_lDance.transform.parent.gameObject.SetActive(false);
  106. this.m_lVocal.transform.parent.gameObject.SetActive(false);
  107. this.m_lAppeal.transform.parent.parent.gameObject.SetActive(false);
  108. UTY.GetChildObject(childObject5, "Line2", false).transform.localPosition = new Vector3(69f, -338.3f, 0f);
  109. UTY.GetChildObject(childObject5, "Block3", false).transform.localPosition = new Vector3(0f, -369f, 0f);
  110. UTY.GetChildObject(childObject5.transform.parent.gameObject, "Frame", false).GetComponent<UISprite>().height = 460;
  111. childObject9.transform.parent.localPosition = new Vector3(-71f, -260f, 0f);
  112. childObject8.transform.localPosition = new Vector3(230f, -285f, 0f);
  113. childObject7.SetActive(true);
  114. }
  115. }
  116. public void CreateViewer(StatusCtrl.Status status)
  117. {
  118. if (!this.m_bInit)
  119. {
  120. this.InitViewer();
  121. this.m_bInit = true;
  122. }
  123. this.SetData(status);
  124. }
  125. private void SetData(StatusCtrl.Status status)
  126. {
  127. this.m_txtMaidIcon.mainTexture = status.maidIcon;
  128. this.m_lFirstName.text = status.firstName;
  129. this.m_lLastName.text = status.lastName;
  130. this.m_lContractType.text = status.contractType;
  131. this.m_lPersonal.fontSize = 22;
  132. this.m_lPersonal.text = status.personal;
  133. Utility.ResizeUILabelFontSize(this.m_lPersonal, 251);
  134. this.m_lSexualExperience.text = status.sexualExperience;
  135. this.m_lMaidClass.text = status.maidClassName;
  136. this.m_lMaidClassLevel.text = status.maidClassLevel.ToString();
  137. this.m_lMaidClassExp.text = ((status.maidClassExp >= 0) ? status.maidClassExp.ToString() : "-");
  138. this.m_lMaidClassRequiredExp.text = ((status.maidClassRequiredExp >= 0) ? status.maidClassRequiredExp.ToString() : "-");
  139. this.m_lYotogiClass.text = status.yotogiClassName;
  140. this.m_lYotogiClassLevel.text = status.yotogiClassLevel.ToString();
  141. this.m_lYotogiClassExp.text = ((status.yotogiClassExp >= 0) ? status.yotogiClassExp.ToString() : "-");
  142. this.m_lYotogiClassRequiredExp.text = ((status.yotogiClassRequiredExp >= 0) ? status.yotogiClassRequiredExp.ToString() : "-");
  143. this.m_lHeight.text = status.height.ToString();
  144. this.m_lWeight.text = status.weight.ToString();
  145. this.m_lBust.text = status.bust.ToString();
  146. this.m_lCup.text = status.cup;
  147. this.m_lWaist.text = status.waist.ToString();
  148. this.m_lHip.text = status.hip.ToString();
  149. this.m_lRelation.fontSize = 25;
  150. this.m_lRelation.text = status.relation;
  151. Utility.ResizeUILabelFontSize(this.m_lRelation, 152);
  152. this.m_lConditionText.fontSize = 25;
  153. this.m_lConditionText.text = status.conditionText;
  154. Utility.ResizeUILabelFontSize(this.m_lConditionText, 152);
  155. this.m_lHp.text = status.hp.ToString();
  156. this.m_lMind.text = status.mind.ToString();
  157. this.m_lLikability.text = status.likability.ToString();
  158. this.m_lCare.text = status.care.ToString();
  159. this.m_lReception.text = status.reception.ToString();
  160. this.m_lCooking.text = status.cooking.ToString();
  161. this.m_lDance.text = status.dance.ToString();
  162. this.m_lVocal.text = status.vocal.ToString();
  163. this.m_lAppeal.text = ((status.appeal >= 0) ? status.appeal.ToString() : "-");
  164. this.m_lStudyRate.text = ((status.studyRate >= 0) ? status.studyRate.ToString() : "-");
  165. this.m_lTeachRate.text = ((status.teachRate >= 0) ? status.teachRate.ToString() : "-");
  166. this.m_lLovely.text = status.lovely.ToString();
  167. this.m_lElegance.text = status.elegance.ToString();
  168. this.m_lCharm.text = status.charm.ToString();
  169. this.m_lInran.text = status.inran.ToString();
  170. this.m_lMValue.text = status.mValue.ToString();
  171. this.m_lHentai.text = status.hentai.ToString();
  172. this.m_lHousi.text = status.housi.ToString();
  173. this.m_lYotogiPlayCount.text = ((status.yotogiPlayCount >= 0) ? status.yotogiPlayCount.ToString() : "-");
  174. this.m_lOthersPlayCount.text = ((status.othersPlayCount >= 0) ? status.othersPlayCount.ToString() : "-");
  175. this.m_lMouth.text = status.mouth.ToString();
  176. this.m_lThroat.text = status.throat.ToString();
  177. this.m_lNipple.text = status.nipple.ToString();
  178. this.m_lClitoris.text = status.curi.ToString();
  179. this.m_lRanking.text = ScheduleCtrl.ConvertValueWhenDefault(status.ranking, "-");
  180. this.m_lAcquisitionOfClientEvaluation.text = ((status.acquisitionOfClientEvaluation >= 0L) ? status.acquisitionOfClientEvaluation.ToString() : "-");
  181. this.m_lAcquisitionOfWorkingFunds.text = ((status.acquisitionOfWorkingFunds >= 0L) ? status.acquisitionOfWorkingFunds.ToString("#,0") : "-");
  182. this.m_lDaysOfEmployment.text = status.daysOfEmployment.ToString();
  183. Utility.SetLocalizeTerm(this.m_lContractType, status.contractTypeTerm, false);
  184. Utility.SetLocalizeTerm(this.m_lPersonal, status.personalTerm, false);
  185. Utility.SetLocalizeTerm(this.m_lSexualExperience, status.sexualExperienceTerm, false);
  186. Utility.SetLocalizeTerm(this.m_lMaidClass, status.maidClassNameTerm, false);
  187. Utility.SetLocalizeTerm(this.m_lRelation, status.relationTerm, false);
  188. Utility.SetLocalizeTerm(this.m_lConditionText, status.conditionTextTerm, false);
  189. if (!Product.supportMultiLanguage)
  190. {
  191. UTY.GetChildObject(this.m_goPanel, "DaysOfEmployment/Title", false).GetComponent<UILabel>().text = "雇用日数";
  192. }
  193. this.SetCrownIcon(status.ranking);
  194. }
  195. private void SetCrownIcon(int ranking)
  196. {
  197. foreach (KeyValuePair<int, GameObject> keyValuePair in this.m_dicCrownIcon)
  198. {
  199. if (keyValuePair.Key == ranking)
  200. {
  201. keyValuePair.Value.SetActive(true);
  202. }
  203. else
  204. {
  205. keyValuePair.Value.SetActive(false);
  206. }
  207. }
  208. }
  209. public static int ToPercent(int number, int denominator)
  210. {
  211. return (int)System.Math.Floor((double)(number / denominator));
  212. }
  213. private StatusMgr m_mgr;
  214. private Dictionary<int, GameObject> m_dicCrownIcon;
  215. private GameObject m_goPanel;
  216. private GameObject m_goldCrownIcon;
  217. private GameObject m_silverCrownIcon;
  218. private GameObject m_bronzeCrownIcon;
  219. private UITexture m_txtMaidIcon;
  220. private UITexture m_txtCrownIcon;
  221. private UILabel m_lFirstName;
  222. private UILabel m_lLastName;
  223. private UILabel m_lContractType;
  224. private UILabel m_lPersonal;
  225. private UILabel m_lSexualExperience;
  226. private UILabel m_lMaidClass;
  227. private UILabel m_lMaidClassLevel;
  228. private UILabel m_lMaidClassExp;
  229. private UILabel m_lMaidClassRequiredExp;
  230. private UILabel m_lYotogiClass;
  231. private UILabel m_lYotogiClassLevel;
  232. private UILabel m_lYotogiClassExp;
  233. private UILabel m_lYotogiClassRequiredExp;
  234. private UILabel m_lHeight;
  235. private UILabel m_lWeight;
  236. private UILabel m_lBust;
  237. private UILabel m_lCup;
  238. private UILabel m_lWaist;
  239. private UILabel m_lHip;
  240. private UILabel m_lHp;
  241. private UILabel m_lMind;
  242. private UILabel m_lLikability;
  243. private UILabel m_lCare;
  244. private UILabel m_lReception;
  245. private UILabel m_lCooking;
  246. private UILabel m_lDance;
  247. private UILabel m_lVocal;
  248. private UILabel m_lAppeal;
  249. private UILabel m_lStudyRate;
  250. private UILabel m_lTeachRate;
  251. private UILabel m_lLovely;
  252. private UILabel m_lElegance;
  253. private UILabel m_lCharm;
  254. private UILabel m_lInran;
  255. private UILabel m_lMValue;
  256. private UILabel m_lHentai;
  257. private UILabel m_lHousi;
  258. private UILabel m_lRelation;
  259. private UILabel m_lConditionText;
  260. private UILabel m_lYotogiPlayCount;
  261. private UILabel m_lOthersPlayCount;
  262. private UILabel m_lMouth;
  263. private UILabel m_lThroat;
  264. private UILabel m_lNipple;
  265. private UILabel m_lClitoris;
  266. private UILabel m_lRanking;
  267. private UILabel m_lAcquisitionOfClientEvaluation;
  268. private UILabel m_lAcquisitionOfWorkingFunds;
  269. private UILabel m_lDaysOfEmployment;
  270. private bool m_bInit;
  271. private const int DENOMINATOR_10 = 10;
  272. public class Status
  273. {
  274. public int studyRate
  275. {
  276. get
  277. {
  278. return this._studyRate;
  279. }
  280. set
  281. {
  282. this._studyRate = StatusCtrl.ToPercent(value, 10);
  283. }
  284. }
  285. public int teachRate
  286. {
  287. get
  288. {
  289. return this._teachRate;
  290. }
  291. set
  292. {
  293. this._teachRate = StatusCtrl.ToPercent(value, 10);
  294. }
  295. }
  296. public int mouth
  297. {
  298. get
  299. {
  300. return this._mouth;
  301. }
  302. set
  303. {
  304. this._mouth = StatusCtrl.ToPercent(value, 10);
  305. }
  306. }
  307. public int throat
  308. {
  309. get
  310. {
  311. return this._throat;
  312. }
  313. set
  314. {
  315. this._throat = StatusCtrl.ToPercent(value, 10);
  316. }
  317. }
  318. public int nipple
  319. {
  320. get
  321. {
  322. return this._nipple;
  323. }
  324. set
  325. {
  326. this._nipple = StatusCtrl.ToPercent(value, 10);
  327. }
  328. }
  329. public int curi
  330. {
  331. get
  332. {
  333. return this._clitoris;
  334. }
  335. set
  336. {
  337. this._clitoris = StatusCtrl.ToPercent(value, 10);
  338. }
  339. }
  340. public Texture2D maidIcon;
  341. public string firstName;
  342. public string lastName;
  343. public string contractType;
  344. public string contractTypeTerm;
  345. public string personal;
  346. public string personalTerm;
  347. public string sexualExperience;
  348. public string sexualExperienceTerm;
  349. public string maidClassName;
  350. public string maidClassNameTerm;
  351. public int maidClassLevel;
  352. public int maidClassExp;
  353. public int maidClassRequiredExp;
  354. public string yotogiClassName;
  355. public int yotogiClassLevel;
  356. public int yotogiClassExp;
  357. public int yotogiClassRequiredExp;
  358. public int height;
  359. public int weight;
  360. public int bust;
  361. public string cup;
  362. public int waist;
  363. public int hip;
  364. public int hp;
  365. public int mind;
  366. public int likability;
  367. public int care;
  368. public int reception;
  369. public int cooking;
  370. public int dance;
  371. public int vocal;
  372. public int appeal;
  373. private int _studyRate;
  374. private int _teachRate;
  375. public int lovely;
  376. public int elegance;
  377. public int charm;
  378. public int inran;
  379. public int mValue;
  380. public int hentai;
  381. public int housi;
  382. public string relation;
  383. public string relationTerm;
  384. public string conditionText;
  385. public string conditionTextTerm;
  386. public int yotogiPlayCount;
  387. public int othersPlayCount;
  388. private int _mouth;
  389. private int _throat;
  390. private int _nipple;
  391. private int _clitoris;
  392. public int ranking;
  393. public Texture2D crownIcon;
  394. public long acquisitionOfClientEvaluation;
  395. public long acquisitionOfWorkingFunds;
  396. public int daysOfEmployment;
  397. }
  398. }