AutoShoesHide.cs 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace COM3D2.PropMyItem.Plugin
  5. {
  6. // Token: 0x02000002 RID: 2
  7. public class AutoShoesHide
  8. {
  9. // Token: 0x06000001 RID: 1 RVA: 0x00002050 File Offset: 0x00000250
  10. public AutoShoesHide()
  11. {
  12. this.checkMPNs = new MPN[]
  13. {
  14. MPN.acchat,
  15. MPN.headset,
  16. MPN.wear,
  17. MPN.skirt,
  18. MPN.onepiece,
  19. MPN.mizugi,
  20. MPN.bra,
  21. MPN.panz,
  22. MPN.stkg
  23. };
  24. }
  25. // Token: 0x06000002 RID: 2 RVA: 0x000020A8 File Offset: 0x000002A8
  26. public void Update()
  27. {
  28. try
  29. {
  30. if (UserConfig.Instance.IsAutoShoesHide)
  31. {
  32. List<Maid> visibleMaidList = CommonUtil.GetVisibleMaidList();
  33. if (visibleMaidList.Count != 0)
  34. {
  35. string bgname = GameMain.Instance.BgMgr.GetBGName();
  36. if (!(this._lastBGName == bgname) || this._lastMaidCount != visibleMaidList.Count)
  37. {
  38. if (Config.Instance.TargetBGList.Contains(bgname, StringComparer.OrdinalIgnoreCase))
  39. {
  40. using (List<Maid>.Enumerator enumerator = visibleMaidList.GetEnumerator())
  41. {
  42. while (enumerator.MoveNext())
  43. {
  44. Maid maid = enumerator.Current;
  45. if (maid.IsAllProcPropBusy)
  46. {
  47. return;
  48. }
  49. if (maid.GetProp(MPN.shoes).strTempFileName != "_i_shoes_del.menu")
  50. {
  51. Menu.SetMaidItemTemp(maid, "_i_shoes_del.menu", true);
  52. maid.AllProcProp();
  53. }
  54. }
  55. goto IL_184;
  56. }
  57. }
  58. foreach (Maid maid2 in visibleMaidList)
  59. {
  60. if (maid2.IsAllProcPropBusy)
  61. {
  62. return;
  63. }
  64. bool flag = true;
  65. foreach (MPN mpn in this.checkMPNs)
  66. {
  67. MaidProp prop = maid2.GetProp(mpn);
  68. if (prop.strFileName == prop.strTempFileName)
  69. {
  70. flag = false;
  71. break;
  72. }
  73. }
  74. if (flag && maid2.GetProp(MPN.shoes).strTempFileName == "_i_shoes_del.menu")
  75. {
  76. maid2.ResetProp(MPN.shoes, false);
  77. maid2.AllProcProp();
  78. }
  79. }
  80. IL_184:
  81. this._lastBGName = bgname;
  82. this._lastMaidCount = visibleMaidList.Count;
  83. }
  84. }
  85. }
  86. }
  87. catch (Exception)
  88. {
  89. }
  90. }
  91. // Token: 0x04000001 RID: 1
  92. private string _lastBGName = string.Empty;
  93. // Token: 0x04000002 RID: 2
  94. private int _lastMaidCount;
  95. // Token: 0x04000003 RID: 3
  96. private MPN[] checkMPNs;
  97. // Token: 0x0200000F RID: 15
  98. public class PropFileName
  99. {
  100. // Token: 0x0600006A RID: 106 RVA: 0x000085DC File Offset: 0x000067DC
  101. public PropFileName(int rid, string filename, string tmpFileName)
  102. {
  103. this.FileNameRID = rid;
  104. this.FileName = filename;
  105. this.TempFileName = tmpFileName;
  106. }
  107. // Token: 0x0400006D RID: 109
  108. public int FileNameRID;
  109. // Token: 0x0400006E RID: 110
  110. public string FileName;
  111. // Token: 0x0400006F RID: 111
  112. public string TempFileName;
  113. }
  114. }
  115. }