StatusCtrl.cs 17 KB

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