SceneEditInfo.cs 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. using System;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using wf;
  5. public static class SceneEditInfo
  6. {
  7. public static Dictionary<string, string> m_dicSliderPartsTypeBtnName { get; private set; }
  8. public static Dictionary<MPN, SceneEditInfo.CCateNameType> m_dicPartsTypePair
  9. {
  10. get
  11. {
  12. if (SceneEditInfo.dicPartsTypePair_ == null)
  13. {
  14. SceneEditInfo.m_dicSliderPartsTypeBtnName = new Dictionary<string, string>();
  15. string text = "edit_category_define.nei";
  16. SceneEditInfo.dicPartsTypePair_ = new Dictionary<MPN, SceneEditInfo.CCateNameType>();
  17. Dictionary<SceneEditInfo.EMenuCategory, int> dictionary = new Dictionary<SceneEditInfo.EMenuCategory, int>();
  18. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
  19. {
  20. using (CsvParser csvParser = new CsvParser())
  21. {
  22. bool condition = csvParser.Open(afileBase);
  23. NDebug.Assert(condition, text + "\nopen failed.");
  24. for (int i = 1; i < csvParser.max_cell_y; i++)
  25. {
  26. if (csvParser.IsCellToExistData(0, i))
  27. {
  28. int num = 0;
  29. MPN key = MPN.null_mpn;
  30. try
  31. {
  32. key = (MPN)Enum.Parse(typeof(MPN), csvParser.GetCellAsString(num++, i));
  33. }
  34. catch (Exception e)
  35. {
  36. NDebug.AssertParseError("MPN", e);
  37. }
  38. SceneEditInfo.CCateNameType ccateNameType = new SceneEditInfo.CCateNameType();
  39. ccateNameType.m_eMenuCate = SceneEditInfo.EMenuCategory.頭;
  40. try
  41. {
  42. ccateNameType.m_eMenuCate = (SceneEditInfo.EMenuCategory)Enum.Parse(typeof(SceneEditInfo.EMenuCategory), csvParser.GetCellAsString(num++, i));
  43. }
  44. catch (Exception e2)
  45. {
  46. NDebug.AssertParseError("EMenuCategory", e2);
  47. }
  48. ccateNameType.m_eType = SceneEditInfo.CCateNameType.EType.Item;
  49. try
  50. {
  51. ccateNameType.m_eType = (SceneEditInfo.CCateNameType.EType)Enum.Parse(typeof(SceneEditInfo.CCateNameType.EType), csvParser.GetCellAsString(num++, i));
  52. }
  53. catch (Exception e3)
  54. {
  55. NDebug.AssertParseError("CCateNameType.EType", e3);
  56. }
  57. ccateNameType.m_ePartsType = csvParser.GetCellAsString(num++, i);
  58. ccateNameType.m_strBtnPartsTypeName = csvParser.GetCellAsString(num++, i);
  59. if (0 <= ccateNameType.m_ePartsType.IndexOf("slider"))
  60. {
  61. string[] array = ccateNameType.m_strBtnPartsTypeName.Split(new char[]
  62. {
  63. '/'
  64. });
  65. NDebug.Assert(array.Length == 2, text + "の" + i.ToString() + "行目の表示名が不正です");
  66. if (!SceneEditInfo.m_dicSliderPartsTypeBtnName.ContainsKey(ccateNameType.m_ePartsType))
  67. {
  68. SceneEditInfo.m_dicSliderPartsTypeBtnName.Add(ccateNameType.m_ePartsType, array[0]);
  69. }
  70. else
  71. {
  72. NDebug.Assert(SceneEditInfo.m_dicSliderPartsTypeBtnName[ccateNameType.m_ePartsType] == array[0], text + "の" + i.ToString() + "行目の表示名が不正です");
  73. }
  74. ccateNameType.m_strBtnPartsTypeName = array[1];
  75. }
  76. bool flag = csvParser.GetCellAsString(num++, i) == "×";
  77. if (flag)
  78. {
  79. }
  80. ccateNameType.m_requestNewFace = (csvParser.GetCellAsString(num++, i) == "〇");
  81. NDebug.Assert(!SceneEditInfo.dicPartsTypePair_.ContainsKey(key), "MPN[" + key.ToString() + "]が重複しています");
  82. if (!dictionary.ContainsKey(ccateNameType.m_eMenuCate))
  83. {
  84. dictionary.Add(ccateNameType.m_eMenuCate, 0);
  85. }
  86. SceneEditInfo.CCateNameType ccateNameType2 = ccateNameType;
  87. Dictionary<SceneEditInfo.EMenuCategory, int> dictionary2;
  88. SceneEditInfo.EMenuCategory eMenuCate;
  89. int nIdx;
  90. (dictionary2 = dictionary)[eMenuCate = ccateNameType.m_eMenuCate] = (nIdx = dictionary2[eMenuCate]) + 1;
  91. ccateNameType2.m_nIdx = nIdx;
  92. SceneEditInfo.dicPartsTypePair_.Add(key, ccateNameType);
  93. }
  94. }
  95. }
  96. }
  97. }
  98. return SceneEditInfo.dicPartsTypePair_;
  99. }
  100. }
  101. public static Dictionary<MPN, TBody.MaskMode> m_dicPartsTypeWearMode
  102. {
  103. get
  104. {
  105. if (SceneEditInfo.dicPartsTypeWearMode_ == null)
  106. {
  107. string text = "edit_mask_define.nei";
  108. SceneEditInfo.dicPartsTypeWearMode_ = new Dictionary<MPN, TBody.MaskMode>();
  109. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
  110. {
  111. using (CsvParser csvParser = new CsvParser())
  112. {
  113. bool condition = csvParser.Open(afileBase);
  114. NDebug.Assert(condition, text + "\nopen failed.");
  115. for (int i = 1; i < csvParser.max_cell_y; i++)
  116. {
  117. if (csvParser.IsCellToExistData(0, i))
  118. {
  119. int num = 0;
  120. MPN key = MPN.null_mpn;
  121. try
  122. {
  123. key = (MPN)Enum.Parse(typeof(MPN), csvParser.GetCellAsString(num++, i));
  124. }
  125. catch (Exception e)
  126. {
  127. NDebug.AssertParseError("MPN", e);
  128. }
  129. TBody.MaskMode value = TBody.MaskMode.None;
  130. try
  131. {
  132. value = (TBody.MaskMode)Enum.Parse(typeof(TBody.MaskMode), csvParser.GetCellAsString(num++, i));
  133. }
  134. catch (Exception e2)
  135. {
  136. NDebug.AssertParseError("TBody.MaskMode", e2);
  137. }
  138. NDebug.Assert(!SceneEditInfo.dicPartsTypeWearMode_.ContainsKey(key), "MPN[" + key.ToString() + "]が重複しています");
  139. SceneEditInfo.dicPartsTypeWearMode_.Add(key, value);
  140. }
  141. }
  142. }
  143. }
  144. }
  145. return SceneEditInfo.dicPartsTypeWearMode_;
  146. }
  147. }
  148. public static Dictionary<MPN, SceneEditInfo.CamToBone> m_dicPartsTypeCamera
  149. {
  150. get
  151. {
  152. if (SceneEditInfo.m_dicPartsTypeCamera_ == null)
  153. {
  154. string text = "edit_attention_point_define.nei";
  155. SceneEditInfo.m_dicPartsTypeCamera_ = new Dictionary<MPN, SceneEditInfo.CamToBone>();
  156. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
  157. {
  158. using (CsvParser csvParser = new CsvParser())
  159. {
  160. bool condition = csvParser.Open(afileBase);
  161. NDebug.Assert(condition, text + "\nopen failed.");
  162. for (int i = 1; i < csvParser.max_cell_y; i++)
  163. {
  164. if (csvParser.IsCellToExistData(0, i))
  165. {
  166. SceneEditInfo.CamToBone value = default(SceneEditInfo.CamToBone);
  167. int num = 0;
  168. MPN key = MPN.null_mpn;
  169. try
  170. {
  171. key = (MPN)Enum.Parse(typeof(MPN), csvParser.GetCellAsString(num++, i));
  172. }
  173. catch (Exception e)
  174. {
  175. NDebug.AssertParseError("MPN", e);
  176. }
  177. value.bone = csvParser.GetCellAsString(num++, i);
  178. value.angle = Parse.Vector2(csvParser.GetCellAsString(num++, i));
  179. value.distance = csvParser.GetCellAsReal(num++, i);
  180. NDebug.Assert(!SceneEditInfo.m_dicPartsTypeCamera_.ContainsKey(key), "MPN[" + key.ToString() + "]が重複しています");
  181. SceneEditInfo.m_dicPartsTypeCamera_.Add(key, value);
  182. }
  183. }
  184. }
  185. }
  186. }
  187. return SceneEditInfo.m_dicPartsTypeCamera_;
  188. }
  189. }
  190. private static Dictionary<MPN, SceneEditInfo.CCateNameType> dicPartsTypePair_;
  191. private static Dictionary<MPN, TBody.MaskMode> dicPartsTypeWearMode_;
  192. private static Dictionary<MPN, SceneEditInfo.CamToBone> m_dicPartsTypeCamera_;
  193. public enum EMenuCategory
  194. {
  195. 頭,
  196. 髪,
  197. 身体,
  198. 服装,
  199. アクセサリ,
  200. セット,
  201. プリセット,
  202. ランダム,
  203. プロフィ\u30FCル,
  204. 着衣設定
  205. }
  206. public enum ClothesState
  207. {
  208. Wear,
  209. Underwear,
  210. Nude
  211. }
  212. public struct CamToBone
  213. {
  214. public string bone;
  215. public Vector2 angle;
  216. public float distance;
  217. }
  218. public class CCateNameType
  219. {
  220. public int m_nIdx;
  221. public SceneEditInfo.CCateNameType.EType m_eType;
  222. public SceneEditInfo.EMenuCategory m_eMenuCate;
  223. public string m_ePartsType;
  224. public string m_strBtnPartsTypeName;
  225. public bool m_requestNewFace;
  226. public enum EType
  227. {
  228. Item,
  229. Set,
  230. Slider,
  231. Color
  232. }
  233. }
  234. }