SceneEditInfo.cs 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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. NDebug.Assert(!SceneEditInfo.dicPartsTypePair_.ContainsKey(key), "MPN[" + key.ToString() + "]が重複しています");
  77. if (!dictionary.ContainsKey(ccateNameType.m_eMenuCate))
  78. {
  79. dictionary.Add(ccateNameType.m_eMenuCate, 0);
  80. }
  81. SceneEditInfo.CCateNameType ccateNameType2 = ccateNameType;
  82. Dictionary<SceneEditInfo.EMenuCategory, int> dictionary2;
  83. SceneEditInfo.EMenuCategory eMenuCate;
  84. int nIdx;
  85. (dictionary2 = dictionary)[eMenuCate = ccateNameType.m_eMenuCate] = (nIdx = dictionary2[eMenuCate]) + 1;
  86. ccateNameType2.m_nIdx = nIdx;
  87. SceneEditInfo.dicPartsTypePair_.Add(key, ccateNameType);
  88. }
  89. }
  90. }
  91. }
  92. }
  93. return SceneEditInfo.dicPartsTypePair_;
  94. }
  95. }
  96. public static Dictionary<MPN, TBody.MaskMode> m_dicPartsTypeWearMode
  97. {
  98. get
  99. {
  100. if (SceneEditInfo.dicPartsTypeWearMode_ == null)
  101. {
  102. string text = "edit_mask_define.nei";
  103. SceneEditInfo.dicPartsTypeWearMode_ = new Dictionary<MPN, TBody.MaskMode>();
  104. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
  105. {
  106. using (CsvParser csvParser = new CsvParser())
  107. {
  108. bool condition = csvParser.Open(afileBase);
  109. NDebug.Assert(condition, text + "\nopen failed.");
  110. for (int i = 1; i < csvParser.max_cell_y; i++)
  111. {
  112. if (csvParser.IsCellToExistData(0, i))
  113. {
  114. int num = 0;
  115. MPN key = MPN.null_mpn;
  116. try
  117. {
  118. key = (MPN)Enum.Parse(typeof(MPN), csvParser.GetCellAsString(num++, i));
  119. }
  120. catch (Exception e)
  121. {
  122. NDebug.AssertParseError("MPN", e);
  123. }
  124. TBody.MaskMode value = TBody.MaskMode.None;
  125. try
  126. {
  127. value = (TBody.MaskMode)Enum.Parse(typeof(TBody.MaskMode), csvParser.GetCellAsString(num++, i));
  128. }
  129. catch (Exception e2)
  130. {
  131. NDebug.AssertParseError("TBody.MaskMode", e2);
  132. }
  133. NDebug.Assert(!SceneEditInfo.dicPartsTypeWearMode_.ContainsKey(key), "MPN[" + key.ToString() + "]が重複しています");
  134. SceneEditInfo.dicPartsTypeWearMode_.Add(key, value);
  135. }
  136. }
  137. }
  138. }
  139. }
  140. return SceneEditInfo.dicPartsTypeWearMode_;
  141. }
  142. }
  143. public static Dictionary<MPN, SceneEditInfo.CamToBone> m_dicPartsTypeCamera
  144. {
  145. get
  146. {
  147. if (SceneEditInfo.m_dicPartsTypeCamera_ == null)
  148. {
  149. string text = "edit_attention_point_define.nei";
  150. SceneEditInfo.m_dicPartsTypeCamera_ = new Dictionary<MPN, SceneEditInfo.CamToBone>();
  151. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
  152. {
  153. using (CsvParser csvParser = new CsvParser())
  154. {
  155. bool condition = csvParser.Open(afileBase);
  156. NDebug.Assert(condition, text + "\nopen failed.");
  157. for (int i = 1; i < csvParser.max_cell_y; i++)
  158. {
  159. if (csvParser.IsCellToExistData(0, i))
  160. {
  161. SceneEditInfo.CamToBone value = default(SceneEditInfo.CamToBone);
  162. int num = 0;
  163. MPN key = MPN.null_mpn;
  164. try
  165. {
  166. key = (MPN)Enum.Parse(typeof(MPN), csvParser.GetCellAsString(num++, i));
  167. }
  168. catch (Exception e)
  169. {
  170. NDebug.AssertParseError("MPN", e);
  171. }
  172. value.bone = csvParser.GetCellAsString(num++, i);
  173. value.angle = Parse.Vector2(csvParser.GetCellAsString(num++, i));
  174. value.distance = csvParser.GetCellAsReal(num++, i);
  175. NDebug.Assert(!SceneEditInfo.m_dicPartsTypeCamera_.ContainsKey(key), "MPN[" + key.ToString() + "]が重複しています");
  176. SceneEditInfo.m_dicPartsTypeCamera_.Add(key, value);
  177. }
  178. }
  179. }
  180. }
  181. }
  182. return SceneEditInfo.m_dicPartsTypeCamera_;
  183. }
  184. }
  185. private static Dictionary<MPN, SceneEditInfo.CCateNameType> dicPartsTypePair_;
  186. private static Dictionary<MPN, TBody.MaskMode> dicPartsTypeWearMode_;
  187. private static Dictionary<MPN, SceneEditInfo.CamToBone> m_dicPartsTypeCamera_;
  188. public enum EMenuCategory
  189. {
  190. 頭,
  191. 髪,
  192. 身体,
  193. 服装,
  194. アクセサリ,
  195. セット,
  196. プリセット,
  197. ランダム,
  198. プロフィ\u30FCル,
  199. 着衣設定
  200. }
  201. public enum ClothesState
  202. {
  203. Wear,
  204. Underwear,
  205. Nude
  206. }
  207. public struct CamToBone
  208. {
  209. public string bone;
  210. public Vector2 angle;
  211. public float distance;
  212. }
  213. public class CCateNameType
  214. {
  215. public int m_nIdx;
  216. public SceneEditInfo.CCateNameType.EType m_eType;
  217. public SceneEditInfo.EMenuCategory m_eMenuCate;
  218. public string m_ePartsType;
  219. public string m_strBtnPartsTypeName;
  220. public enum EType
  221. {
  222. Item,
  223. Set,
  224. Slider,
  225. Color
  226. }
  227. }
  228. }