123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296 |
- using System;
- using System.Collections.Generic;
- using System.IO;
- using UnityEngine;
- using wf;
- public static class SceneEditInfo
- {
- public static Dictionary<string, string> m_dicSliderPartsTypeBtnName { get; private set; }
- public static Dictionary<MPN, SceneEditInfo.CCateNameType> m_dicPartsTypePair
- {
- get
- {
- if (SceneEditInfo.dicPartsTypePair_ == null)
- {
- SceneEditInfo.m_dicSliderPartsTypeBtnName = new Dictionary<string, string>();
- string text = "edit_category_define.nei";
- SceneEditInfo.dicPartsTypePair_ = new Dictionary<MPN, SceneEditInfo.CCateNameType>();
- Dictionary<SceneEditInfo.EMenuCategory, int> dictionary = new Dictionary<SceneEditInfo.EMenuCategory, int>();
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, text + "\nopen failed.");
- for (int i = 1; i < csvParser.max_cell_y; i++)
- {
- if (csvParser.IsCellToExistData(0, i))
- {
- int num = 0;
- MPN key = MPN.null_mpn;
- try
- {
- key = (MPN)Enum.Parse(typeof(MPN), csvParser.GetCellAsString(num++, i));
- }
- catch (Exception e)
- {
- NDebug.AssertParseError("MPN", e);
- }
- SceneEditInfo.CCateNameType ccateNameType = new SceneEditInfo.CCateNameType();
- ccateNameType.m_eMenuCate = SceneEditInfo.EMenuCategory.頭;
- try
- {
- ccateNameType.m_eMenuCate = (SceneEditInfo.EMenuCategory)Enum.Parse(typeof(SceneEditInfo.EMenuCategory), csvParser.GetCellAsString(num++, i));
- }
- catch (Exception e2)
- {
- NDebug.AssertParseError("EMenuCategory", e2);
- }
- ccateNameType.m_eType = SceneEditInfo.CCateNameType.EType.Item;
- try
- {
- ccateNameType.m_eType = (SceneEditInfo.CCateNameType.EType)Enum.Parse(typeof(SceneEditInfo.CCateNameType.EType), csvParser.GetCellAsString(num++, i));
- }
- catch (Exception e3)
- {
- NDebug.AssertParseError("CCateNameType.EType", e3);
- }
- ccateNameType.m_ePartsType = csvParser.GetCellAsString(num++, i);
- ccateNameType.m_strBtnPartsTypeName = csvParser.GetCellAsString(num++, i);
- if (0 <= ccateNameType.m_ePartsType.IndexOf("slider"))
- {
- string[] array = ccateNameType.m_strBtnPartsTypeName.Split(new char[]
- {
- '/'
- });
- NDebug.Assert(array.Length == 2, text + "の" + i.ToString() + "行目の表示名が不正です");
- if (!SceneEditInfo.m_dicSliderPartsTypeBtnName.ContainsKey(ccateNameType.m_ePartsType))
- {
- SceneEditInfo.m_dicSliderPartsTypeBtnName.Add(ccateNameType.m_ePartsType, array[0]);
- }
- else
- {
- NDebug.Assert(SceneEditInfo.m_dicSliderPartsTypeBtnName[ccateNameType.m_ePartsType] == array[0], text + "の" + i.ToString() + "行目の表示名が不正です");
- }
- ccateNameType.m_strBtnPartsTypeName = array[1];
- }
- bool flag = csvParser.GetCellAsString(num++, i) == "×";
- if (!flag || !Product.isPublic)
- {
- ccateNameType.m_requestNewFace = (csvParser.GetCellAsString(num++, i) == "〇");
- ccateNameType.m_requestFBFace = (csvParser.GetCellAsString(num++, i) == "〇");
- NDebug.Assert(!SceneEditInfo.dicPartsTypePair_.ContainsKey(key), "MPN[" + key.ToString() + "]が重複しています");
- if (!dictionary.ContainsKey(ccateNameType.m_eMenuCate))
- {
- dictionary.Add(ccateNameType.m_eMenuCate, 0);
- }
- SceneEditInfo.CCateNameType ccateNameType2 = ccateNameType;
- Dictionary<SceneEditInfo.EMenuCategory, int> dictionary2;
- SceneEditInfo.EMenuCategory eMenuCate;
- int nIdx;
- (dictionary2 = dictionary)[eMenuCate = ccateNameType.m_eMenuCate] = (nIdx = dictionary2[eMenuCate]) + 1;
- ccateNameType2.m_nIdx = nIdx;
- SceneEditInfo.dicPartsTypePair_.Add(key, ccateNameType);
- }
- }
- }
- }
- }
- }
- return SceneEditInfo.dicPartsTypePair_;
- }
- }
- public static Dictionary<MPN, TBody.MaskMode> m_dicPartsTypeWearMode
- {
- get
- {
- if (SceneEditInfo.dicPartsTypeWearMode_ == null)
- {
- string text = "edit_mask_define.nei";
- SceneEditInfo.dicPartsTypeWearMode_ = new Dictionary<MPN, TBody.MaskMode>();
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, text + "\nopen failed.");
- for (int i = 1; i < csvParser.max_cell_y; i++)
- {
- if (csvParser.IsCellToExistData(0, i))
- {
- int num = 0;
- MPN key = MPN.null_mpn;
- try
- {
- key = (MPN)Enum.Parse(typeof(MPN), csvParser.GetCellAsString(num++, i));
- }
- catch (Exception e)
- {
- NDebug.AssertParseError("MPN", e);
- }
- TBody.MaskMode value = TBody.MaskMode.None;
- try
- {
- value = (TBody.MaskMode)Enum.Parse(typeof(TBody.MaskMode), csvParser.GetCellAsString(num++, i));
- }
- catch (Exception e2)
- {
- NDebug.AssertParseError("TBody.MaskMode", e2);
- }
- NDebug.Assert(!SceneEditInfo.dicPartsTypeWearMode_.ContainsKey(key), "MPN[" + key.ToString() + "]が重複しています");
- SceneEditInfo.dicPartsTypeWearMode_.Add(key, value);
- }
- }
- }
- }
- }
- return SceneEditInfo.dicPartsTypeWearMode_;
- }
- }
- public static Dictionary<MPN, SceneEditInfo.CamToBone> m_dicPartsTypeCamera
- {
- get
- {
- if (SceneEditInfo.m_dicPartsTypeCamera_ == null)
- {
- string text = "edit_attention_point_define.nei";
- SceneEditInfo.m_dicPartsTypeCamera_ = new Dictionary<MPN, SceneEditInfo.CamToBone>();
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, text + "\nopen failed.");
- for (int i = 1; i < csvParser.max_cell_y; i++)
- {
- if (csvParser.IsCellToExistData(0, i))
- {
- SceneEditInfo.CamToBone value = default(SceneEditInfo.CamToBone);
- int num = 0;
- MPN key = MPN.null_mpn;
- try
- {
- key = (MPN)Enum.Parse(typeof(MPN), csvParser.GetCellAsString(num++, i));
- }
- catch (Exception e)
- {
- NDebug.AssertParseError("MPN", e);
- }
- value.bone = csvParser.GetCellAsString(num++, i);
- value.angle = Parse.Vector2(csvParser.GetCellAsString(num++, i));
- value.distance = csvParser.GetCellAsReal(num++, i);
- NDebug.Assert(!SceneEditInfo.m_dicPartsTypeCamera_.ContainsKey(key), "MPN[" + key.ToString() + "]が重複しています");
- SceneEditInfo.m_dicPartsTypeCamera_.Add(key, value);
- }
- }
- }
- }
- }
- return SceneEditInfo.m_dicPartsTypeCamera_;
- }
- }
- public static List<string> m_listCollaboCategory
- {
- get
- {
- if (SceneEditInfo.m_listCollabo_Category == null)
- {
- string text = "edit_collabo_category.nei";
- SceneEditInfo.m_listCollabo_Category = new List<string>();
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, text + "\nopen failed.");
- for (int i = 1; i < csvParser.max_cell_y; i++)
- {
- if (csvParser.IsCellToExistData(0, i))
- {
- string text2 = csvParser.GetCellAsString(0, i).Trim();
- if (!string.IsNullOrEmpty(text2))
- {
- text2 = text2.ToLower();
- if (string.IsNullOrEmpty(Path.GetExtension(text2)))
- {
- text2 += ".menu";
- }
- SceneEditInfo.m_listCollabo_Category.Add(text2);
- }
- }
- }
- }
- }
- }
- return SceneEditInfo.m_listCollabo_Category;
- }
- }
- private static Dictionary<MPN, SceneEditInfo.CCateNameType> dicPartsTypePair_;
- private static Dictionary<MPN, TBody.MaskMode> dicPartsTypeWearMode_;
- private static Dictionary<MPN, SceneEditInfo.CamToBone> m_dicPartsTypeCamera_;
- private static List<string> m_listCollabo_Category;
- public enum EMenuCategory
- {
- 頭,
- 髪,
- 身体,
- 服装,
- アクセサリ,
- セット,
- プリセット,
- ランダム,
- プロフィ\u30FCル,
- 着衣設定
- }
- public enum ClothesState
- {
- Wear,
- Underwear,
- Nude
- }
- public struct CamToBone
- {
- public string bone;
- public Vector2 angle;
- public float distance;
- }
- public class CCateNameType
- {
- public int m_nIdx;
- public SceneEditInfo.CCateNameType.EType m_eType;
- public SceneEditInfo.EMenuCategory m_eMenuCate;
- public string m_ePartsType;
- public string m_strBtnPartsTypeName;
- public bool m_requestNewFace;
- public bool m_requestFBFace;
- public enum EType
- {
- Item,
- Set,
- Slider,
- Color
- }
- }
- }
|