StatusCtrl.cs 16 KB

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