MultipleMaids.Config.cs 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130
  1. using ExIni;
  2. namespace CM3D2.MultipleMaids.Plugin
  3. {
  4. public partial class MultipleMaids
  5. {
  6. public void Preference()
  7. {
  8. if (isPref)
  9. {
  10. return;
  11. }
  12. isPref = true;
  13. if (Preferences["config"]["hair_setting"].Value == "true")
  14. {
  15. isKamiyure = true;
  16. IniKey iniKey1 = Preferences["config"]["hair_radius"];
  17. IniKey iniKey2 = Preferences["config"]["hair_elasticity"];
  18. kamiyure2 = float.Parse(Preferences["config"]["hair_damping"].Value);
  19. kamiyure3 = float.Parse(iniKey2.Value);
  20. kamiyure4 = float.Parse(iniKey1.Value);
  21. }
  22. else
  23. {
  24. isKamiyure = false;
  25. kamiyure2 = 0.6f;
  26. kamiyure3 = 1f;
  27. kamiyure4 = 0.02f;
  28. }
  29. if (Preferences["config"]["skirt_setting"].Value == "true")
  30. {
  31. isSkirtyure = true;
  32. IniKey iniKey1 = Preferences["config"]["skirt_radius"];
  33. IniKey iniKey2 = Preferences["config"]["skirt_elasticity"];
  34. skirtyure2 = float.Parse(Preferences["config"]["skirt_damping"].Value);
  35. skirtyure3 = float.Parse(iniKey2.Value);
  36. skirtyure4 = float.Parse(iniKey1.Value);
  37. }
  38. else
  39. {
  40. isSkirtyure = false;
  41. skirtyure2 = 0.1f;
  42. skirtyure3 = 0.05f;
  43. skirtyure4 = 0.1f;
  44. }
  45. IniKey iniKey3 = Preferences["config"]["vr_scroll"];
  46. if (iniKey3.Value == "false")
  47. {
  48. isVRScroll = false;
  49. }
  50. else if (iniKey3.Value != "true")
  51. {
  52. Preferences["config"]["vr_scroll"].Value = "true";
  53. SaveConfig();
  54. }
  55. if (Preferences["config"]["shift_f7"].Value == "true")
  56. {
  57. isF7S = true;
  58. }
  59. if (Preferences["config"]["shift_f8"].Value == "false")
  60. {
  61. isVR2 = false;
  62. }
  63. IniKey iniKey4 = Preferences["config"]["ik_all"];
  64. if (iniKey4.Value == "true")
  65. {
  66. isIKAll = true;
  67. for (int index = 0; index < maxMaidCnt; ++index)
  68. {
  69. isIK[index] = true;
  70. }
  71. }
  72. else if (iniKey4.Value != "false")
  73. {
  74. Preferences["config"]["ik_all"].Value = "true";
  75. SaveConfig();
  76. isIKAll = true;
  77. for (int index = 0; index < maxMaidCnt; ++index)
  78. {
  79. isIK[index] = true;
  80. }
  81. }
  82. IniKey modsOnlyKey = Preferences["config"]["mods_only"];
  83. if (modsOnlyKey.Value == "true")
  84. {
  85. modItemsOnly = true;
  86. modItemsToggle = true;
  87. }
  88. else if (modsOnlyKey.Value != "false")
  89. {
  90. Preferences["config"]["mods_only"].Value = "false";
  91. SaveConfig();
  92. modItemsOnly = false;
  93. }
  94. if (!int.TryParse(Preferences["config"]["scene_max"].Value, out maxPage))
  95. {
  96. maxPage = 100;
  97. Preferences["config"]["scene_max"].Value = "100";
  98. SaveConfig();
  99. }
  100. if (!int.TryParse(Preferences["config"]["kankyo_max"].Value, out kankyoMax))
  101. {
  102. kankyoMax = 20;
  103. Preferences["config"]["kankyo_max"].Value = "20";
  104. SaveConfig();
  105. }
  106. for (int index = 0; index < kankyoMax; ++index)
  107. {
  108. IniKey iniKey1 = Preferences["kankyo"]["kankyo" + (index + 1)];
  109. if (iniKey1.Value == null || iniKey1.Value == "")
  110. {
  111. Preferences["kankyo"]["kankyo" + (index + 1)].Value = "環境" + (index + 1);
  112. SaveConfig();
  113. }
  114. }
  115. maxPage /= 10;
  116. }
  117. }
  118. }