SceneEditInfo.cs 8.9 KB

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