|
@@ -1,4 +1,5 @@
|
|
using System;
|
|
using System;
|
|
|
|
+using System.Collections;
|
|
using System.Collections.Generic;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
@@ -31,13 +32,27 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
public static readonly List<string> PoseGroupList;
|
|
public static readonly List<string> PoseGroupList;
|
|
public static readonly Dictionary<string, List<string>> PoseDict;
|
|
public static readonly Dictionary<string, List<string>> PoseDict;
|
|
public static readonly Dictionary<string, List<KeyValuePair<string, string>>> CustomPoseDict;
|
|
public static readonly Dictionary<string, List<KeyValuePair<string, string>>> CustomPoseDict;
|
|
- public static int CustomPoseGroupsIndex { get; private set; } = -1;
|
|
|
|
- public static int MyRoomCustomBGIndex { get; private set; } = -1;
|
|
|
|
public static readonly List<string> FaceBlendList;
|
|
public static readonly List<string> FaceBlendList;
|
|
public static readonly List<string> BGList;
|
|
public static readonly List<string> BGList;
|
|
public static readonly List<KeyValuePair<string, string>> MyRoomCustomBGList;
|
|
public static readonly List<KeyValuePair<string, string>> MyRoomCustomBGList;
|
|
- public static readonly List<string> DoguList;
|
|
|
|
- public static readonly List<string> OtherDoguList;
|
|
|
|
|
|
+ public static event EventHandler<MenuFilesEventArgs> MenuFilesChange;
|
|
|
|
+ public static int CustomPoseGroupsIndex { get; private set; } = -1;
|
|
|
|
+ public static int MyRoomCustomBGIndex { get; private set; } = -1;
|
|
|
|
+ public static List<string> doguCategories { get; private set; }
|
|
|
|
+ public static readonly Dictionary<string, List<string>> DoguDict;
|
|
|
|
+ public enum DoguCategory
|
|
|
|
+ {
|
|
|
|
+ Other, Mob, Desk, HandItem, BGSmall
|
|
|
|
+ }
|
|
|
|
+ public static readonly Dictionary<DoguCategory, string> customDoguCategories =
|
|
|
|
+ new Dictionary<DoguCategory, string>()
|
|
|
|
+ {
|
|
|
|
+ [DoguCategory.Other] = "other",
|
|
|
|
+ [DoguCategory.Mob] = "mob",
|
|
|
|
+ [DoguCategory.Desk] = "desk",
|
|
|
|
+ [DoguCategory.HandItem] = "handItem",
|
|
|
|
+ [DoguCategory.BGSmall] = "bgSmall"
|
|
|
|
+ };
|
|
|
|
|
|
static Constants()
|
|
static Constants()
|
|
{
|
|
{
|
|
@@ -63,8 +78,9 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
|
|
|
BGList = new List<string>();
|
|
BGList = new List<string>();
|
|
MyRoomCustomBGList = new List<KeyValuePair<string, string>>();
|
|
MyRoomCustomBGList = new List<KeyValuePair<string, string>>();
|
|
- DoguList = new List<string>();
|
|
|
|
- OtherDoguList = new List<string>();
|
|
|
|
|
|
+ // DoguList = new List<string>();
|
|
|
|
+ // OtherDoguList = new List<string>();
|
|
|
|
+ DoguDict = new Dictionary<string, List<string>>();
|
|
}
|
|
}
|
|
|
|
|
|
public static void Initialize()
|
|
public static void Initialize()
|
|
@@ -225,14 +241,95 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
|
|
|
|
public static void InitializeDogu()
|
|
public static void InitializeDogu()
|
|
{
|
|
{
|
|
|
|
+ foreach (string customCategory in customDoguCategories.Values)
|
|
|
|
+ {
|
|
|
|
+ DoguDict[customCategory] = new List<string>();
|
|
|
|
+ }
|
|
|
|
+
|
|
InitializeDeskItems();
|
|
InitializeDeskItems();
|
|
InitializePhotoBGItems();
|
|
InitializePhotoBGItems();
|
|
- // InitializeHandItems();
|
|
|
|
|
|
+ InitializeOtherDogu();
|
|
|
|
+
|
|
|
|
+ if (MenuFileUtility.MenuFilesReady) InitializeHandItems();
|
|
|
|
+ else MenuFileUtility.MenuFilesReadyChange += (s, a) => InitializeHandItems();
|
|
|
|
+
|
|
|
|
+ doguCategories = new List<string>();
|
|
|
|
+
|
|
|
|
+ foreach (KeyValuePair<string, UnityEngine.Object> keyValuePair in PhotoBGObjectData.popup_category_list)
|
|
|
|
+ {
|
|
|
|
+ string category = keyValuePair.Key;
|
|
|
|
+ if (category == "マイオブジェクト") continue;
|
|
|
|
+ doguCategories.Add(keyValuePair.Key);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ foreach (DoguCategory category in Enum.GetValues(typeof(DoguCategory)))
|
|
|
|
+ {
|
|
|
|
+ doguCategories.Add(customDoguCategories[category]);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ private static void InitializeOtherDogu()
|
|
|
|
+ {
|
|
|
|
+ DoguDict[customDoguCategories[DoguCategory.BGSmall]] = BGList;
|
|
|
|
+
|
|
|
|
+ DoguDict[customDoguCategories[DoguCategory.Mob]].AddRange(new[] {
|
|
|
|
+ "Mob_Man_Stand001", "Mob_Man_Stand002", "Mob_Man_Stand003", "Mob_Man_Sit001", "Mob_Man_Sit002",
|
|
|
|
+ "Mob_Man_Sit003", "Mob_Girl_Stand001", "Mob_Girl_Stand002", "Mob_Girl_Stand003", "Mob_Girl_Sit001",
|
|
|
|
+ "Mob_Girl_Sit002", "Mob_Girl_Sit003", "Salon:65", "Salon:63", "Salon:69"
|
|
|
|
+ });
|
|
|
|
+
|
|
|
|
+ List<string> DoguList = DoguDict[customDoguCategories[DoguCategory.Other]];
|
|
|
|
+
|
|
|
|
+ string ignoreListPath = Path.Combine(configPath, "mm_ignore_list.json");
|
|
|
|
+ string ignoreListJson = File.ReadAllText(ignoreListPath);
|
|
|
|
+ string[] ignoreList = JsonConvert.DeserializeObject<IEnumerable<string>>(ignoreListJson).ToArray();
|
|
|
|
+
|
|
|
|
+ // bg object extend
|
|
|
|
+ HashSet<string> doguHashSet = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
|
|
|
+
|
|
|
|
+ doguHashSet.UnionWith(BGList);
|
|
|
|
+ doguHashSet.UnionWith(ignoreList);
|
|
|
|
+ foreach (KeyValuePair<string, List<string>> keyValuePair in DoguDict)
|
|
|
|
+ {
|
|
|
|
+ doguHashSet.UnionWith(keyValuePair.Value);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ string[] com3d2BgList = GameUty.FileSystem.GetList("bg", AFileSystemBase.ListType.AllFile);
|
|
|
|
+ foreach (string path in com3d2BgList)
|
|
|
|
+ {
|
|
|
|
+ if (Path.GetExtension(path) == ".asset_bg" && !path.Contains("myroomcustomize"))
|
|
|
|
+ {
|
|
|
|
+ string file = Path.GetFileNameWithoutExtension(path);
|
|
|
|
+ if (!doguHashSet.Contains(file) && !file.EndsWith("_hit"))
|
|
|
|
+ {
|
|
|
|
+ DoguList.Add(file);
|
|
|
|
+ doguHashSet.Add(file);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // Get cherry picked dogu that I can't find in the game files
|
|
|
|
+ string doguExtendPath = Path.Combine(configPath, "mm_dogu_extend.json");
|
|
|
|
+ string doguExtendJson = File.ReadAllText(doguExtendPath);
|
|
|
|
+
|
|
|
|
+ DoguList.AddRange(JsonConvert.DeserializeObject<IEnumerable<string>>(doguExtendJson));
|
|
|
|
+
|
|
|
|
+ string[] cm3d2BgList = GameUty.FileSystemOld.GetList("bg", AFileSystemBase.ListType.AllFile);
|
|
|
|
+ foreach (string path in cm3d2BgList)
|
|
|
|
+ {
|
|
|
|
+ if (Path.GetExtension(path) == ".asset_bg")
|
|
|
|
+ {
|
|
|
|
+ string file = Path.GetFileNameWithoutExtension(path);
|
|
|
|
+ if (!doguHashSet.Contains(file) && !file.EndsWith("_not_optimisation"))
|
|
|
|
+ {
|
|
|
|
+ DoguList.Add(file);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
private static void InitializeDeskItems()
|
|
private static void InitializeDeskItems()
|
|
{
|
|
{
|
|
- // enabled id
|
|
|
|
HashSet<int> enabledIDs = new HashSet<int>();
|
|
HashSet<int> enabledIDs = new HashSet<int>();
|
|
CsvCommonIdManager.ReadEnabledIdList(
|
|
CsvCommonIdManager.ReadEnabledIdList(
|
|
CsvCommonIdManager.FileSystemType.Normal, true, "desk_item_enabled_id", ref enabledIDs
|
|
CsvCommonIdManager.FileSystemType.Normal, true, "desk_item_enabled_id", ref enabledIDs
|
|
@@ -241,11 +338,7 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
CsvCommonIdManager.FileSystemType.Old, true, "desk_item_enabled_id", ref enabledIDs
|
|
CsvCommonIdManager.FileSystemType.Old, true, "desk_item_enabled_id", ref enabledIDs
|
|
);
|
|
);
|
|
|
|
|
|
- List<string> com3d2DeskDogu = new List<string>(new[] {
|
|
|
|
- "Mob_Man_Stand001", "Mob_Man_Stand002", "Mob_Man_Stand003", "Mob_Man_Sit001", "Mob_Man_Sit002",
|
|
|
|
- "Mob_Man_Sit003", "Mob_Girl_Stand001", "Mob_Girl_Stand002", "Mob_Girl_Stand003", "Mob_Girl_Sit001",
|
|
|
|
- "Mob_Girl_Sit002", "Mob_Girl_Sit003", "Salon:65", "Salon:63", "Salon:69"
|
|
|
|
- });
|
|
|
|
|
|
+ List<string> com3d2DeskDogu = DoguDict[customDoguCategories[DoguCategory.Desk]];
|
|
|
|
|
|
Action<AFileSystemBase> GetDeskItems = fs =>
|
|
Action<AFileSystemBase> GetDeskItems = fs =>
|
|
{
|
|
{
|
|
@@ -279,9 +372,6 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
};
|
|
};
|
|
|
|
|
|
GetDeskItems(GameUty.FileSystem);
|
|
GetDeskItems(GameUty.FileSystem);
|
|
- // GetDeskItems(GameUty.FileSystemOld);
|
|
|
|
-
|
|
|
|
- OtherDoguList.AddRange(com3d2DeskDogu);
|
|
|
|
}
|
|
}
|
|
|
|
|
|
private static void InitializePhotoBGItems()
|
|
private static void InitializePhotoBGItems()
|
|
@@ -289,104 +379,96 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
PhotoBGObjectData.Create();
|
|
PhotoBGObjectData.Create();
|
|
List<PhotoBGObjectData> photoBGObjectList = PhotoBGObjectData.data;
|
|
List<PhotoBGObjectData> photoBGObjectList = PhotoBGObjectData.data;
|
|
|
|
|
|
- List<string> particleList = new List<string>();
|
|
|
|
|
|
+ List<string> doguCategories = new List<string>();
|
|
|
|
+ HashSet<string> addedCategories = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
|
|
|
|
|
- List<string> doguPrefabList = new List<string>();
|
|
|
|
- List<string> doguAssetList = new List<string>();
|
|
|
|
- List<string> directFileList = new List<string>();
|
|
|
|
-
|
|
|
|
- foreach (PhotoBGObjectData photoBgObject in photoBGObjectList)
|
|
|
|
|
|
+ foreach (PhotoBGObjectData photoBGObject in photoBGObjectList)
|
|
{
|
|
{
|
|
- if (!string.IsNullOrEmpty(photoBgObject.create_prefab_name))
|
|
|
|
|
|
+ string category = photoBGObject.category;
|
|
|
|
+
|
|
|
|
+ if (!addedCategories.Contains(category))
|
|
|
|
+ {
|
|
|
|
+ addedCategories.Add(category);
|
|
|
|
+ doguCategories.Add(category);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!DoguDict.ContainsKey(category))
|
|
{
|
|
{
|
|
- List<string> list = photoBgObject.category == "パーティクル"
|
|
|
|
- ? particleList
|
|
|
|
- : doguPrefabList;
|
|
|
|
- list.Add(photoBgObject.create_prefab_name);
|
|
|
|
|
|
+ DoguDict[category] = new List<string>();
|
|
}
|
|
}
|
|
- else if (!string.IsNullOrEmpty(photoBgObject.create_asset_bundle_name))
|
|
|
|
|
|
+
|
|
|
|
+ string dogu = String.Empty;
|
|
|
|
+ if (!string.IsNullOrEmpty(photoBGObject.create_prefab_name))
|
|
{
|
|
{
|
|
- doguAssetList.Add(photoBgObject.create_asset_bundle_name);
|
|
|
|
|
|
+ dogu = photoBGObject.create_prefab_name;
|
|
}
|
|
}
|
|
- else if (!string.IsNullOrEmpty(photoBgObject.direct_file))
|
|
|
|
|
|
+ else if (!string.IsNullOrEmpty(photoBGObject.create_asset_bundle_name))
|
|
{
|
|
{
|
|
- directFileList.Add(photoBgObject.direct_file);
|
|
|
|
|
|
+ dogu = photoBGObject.create_asset_bundle_name;
|
|
|
|
+ }
|
|
|
|
+ else if (!string.IsNullOrEmpty(photoBGObject.direct_file))
|
|
|
|
+ {
|
|
|
|
+ dogu = photoBGObject.direct_file;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!string.IsNullOrEmpty(dogu))
|
|
|
|
+ {
|
|
|
|
+ DoguDict[category].Add(dogu);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- OtherDoguList.AddRange(new[] {
|
|
|
|
|
|
+ DoguDict["パーティクル"].AddRange(new[] {
|
|
"Particle/pLineY", "Particle/pLineP02", "Particle/pHeart01",
|
|
"Particle/pLineY", "Particle/pLineP02", "Particle/pHeart01",
|
|
"Particle/pLine_act2", "Particle/pstarY_act2"
|
|
"Particle/pLine_act2", "Particle/pstarY_act2"
|
|
});
|
|
});
|
|
|
|
+ }
|
|
|
|
|
|
- OtherDoguList.AddRange(particleList);
|
|
|
|
-
|
|
|
|
- DoguList.AddRange(doguPrefabList);
|
|
|
|
- DoguList.AddRange(doguAssetList);
|
|
|
|
- DoguList.AddRange(directFileList);
|
|
|
|
|
|
+ private static void InitializeHandItems()
|
|
|
|
+ {
|
|
|
|
+ MenuDataBase menuDataBase = GameMain.Instance.MenuDataBase;
|
|
|
|
|
|
string ignoreListPath = Path.Combine(configPath, "mm_ignore_list.json");
|
|
string ignoreListPath = Path.Combine(configPath, "mm_ignore_list.json");
|
|
string ignoreListJson = File.ReadAllText(ignoreListPath);
|
|
string ignoreListJson = File.ReadAllText(ignoreListPath);
|
|
string[] ignoreList = JsonConvert.DeserializeObject<IEnumerable<string>>(ignoreListJson).ToArray();
|
|
string[] ignoreList = JsonConvert.DeserializeObject<IEnumerable<string>>(ignoreListJson).ToArray();
|
|
|
|
|
|
- // bg object extend
|
|
|
|
HashSet<string> doguHashSet = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
|
HashSet<string> doguHashSet = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
|
- foreach (string bg in BGList)
|
|
|
|
- {
|
|
|
|
- doguHashSet.Add(bg);
|
|
|
|
- }
|
|
|
|
- foreach (string bg in ignoreList)
|
|
|
|
- {
|
|
|
|
- doguHashSet.Add(bg);
|
|
|
|
- }
|
|
|
|
- foreach (string dogu in DoguList)
|
|
|
|
- {
|
|
|
|
- doguHashSet.Add(dogu);
|
|
|
|
- }
|
|
|
|
- foreach (string dogu in OtherDoguList)
|
|
|
|
- {
|
|
|
|
- doguHashSet.Add(dogu);
|
|
|
|
- }
|
|
|
|
|
|
|
|
- string[] com3d2BgList = GameUty.FileSystem.GetList("bg", AFileSystemBase.ListType.AllFile);
|
|
|
|
- foreach (string path in com3d2BgList)
|
|
|
|
|
|
+ doguHashSet.UnionWith(BGList);
|
|
|
|
+ doguHashSet.UnionWith(ignoreList);
|
|
|
|
+ foreach (KeyValuePair<string, List<string>> keyValuePair in DoguDict)
|
|
{
|
|
{
|
|
- if (Path.GetExtension(path) == ".asset_bg" && !path.Contains("myroomcustomize"))
|
|
|
|
- {
|
|
|
|
- string file = Path.GetFileNameWithoutExtension(path);
|
|
|
|
- if (!doguHashSet.Contains(file) && !file.EndsWith("_hit"))
|
|
|
|
- {
|
|
|
|
- DoguList.Add(file);
|
|
|
|
- doguHashSet.Add(file);
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ doguHashSet.UnionWith(keyValuePair.Value);
|
|
}
|
|
}
|
|
|
|
|
|
- // Get cherry picked dogu that I can't find in the game files
|
|
|
|
- string doguExtendPath = Path.Combine(configPath, "mm_dogu_extend.json");
|
|
|
|
- string doguExtendJson = File.ReadAllText(doguExtendPath);
|
|
|
|
-
|
|
|
|
- DoguList.AddRange(JsonConvert.DeserializeObject<IEnumerable<string>>(doguExtendJson));
|
|
|
|
|
|
+ string category = customDoguCategories[DoguCategory.HandItem];
|
|
|
|
|
|
- string[] cm3d2BgList = GameUty.FileSystemOld.GetList("bg", AFileSystemBase.ListType.AllFile);
|
|
|
|
- foreach (string path in cm3d2BgList)
|
|
|
|
|
|
+ for (int i = 0; i < menuDataBase.GetDataSize(); i++)
|
|
{
|
|
{
|
|
- if (Path.GetExtension(path) == ".asset_bg")
|
|
|
|
|
|
+ menuDataBase.SetIndex(i);
|
|
|
|
+ MPN mpn = (MPN)menuDataBase.GetCategoryMpn();
|
|
|
|
+ if (mpn == MPN.handitem)
|
|
{
|
|
{
|
|
- string file = Path.GetFileNameWithoutExtension(path);
|
|
|
|
- if (!doguHashSet.Contains(file) && !file.EndsWith("_not_optimisation"))
|
|
|
|
|
|
+ string menuFileName = menuDataBase.GetMenuFileName();
|
|
|
|
+ if (menuDataBase.GetBoDelOnly() || menuFileName.EndsWith("_del.menu")) continue;
|
|
|
|
+
|
|
|
|
+ string handItemAsOdogu = Utility.HandItemToOdogu(menuFileName);
|
|
|
|
+ string isolatedHandItem = menuFileName.Substring(menuFileName.IndexOf('_') + 1);
|
|
|
|
+
|
|
|
|
+ if (!doguHashSet.Contains(handItemAsOdogu) && !doguHashSet.Contains(isolatedHandItem))
|
|
{
|
|
{
|
|
- DoguList.Add(file);
|
|
|
|
|
|
+ doguHashSet.Add(isolatedHandItem);
|
|
|
|
+ DoguDict[category].Add(menuFileName);
|
|
|
|
+
|
|
|
|
+ // Check for a half deck of cards to add the full deck as well
|
|
|
|
+ if (menuFileName == "handitemd_cards_i_.menu")
|
|
|
|
+ {
|
|
|
|
+ DoguDict[category].Add("handiteml_cards_i_.menu");
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
|
|
- private static void InitializeHandItems()
|
|
|
|
- {
|
|
|
|
- List<string> handItems = new List<string>(
|
|
|
|
- GameUty.MenuFiles.Where(menu => menu.StartsWith("handiteml") || menu.StartsWith("handitemr"))
|
|
|
|
- );
|
|
|
|
|
|
+ OnMenuFilesChange(MenuFilesEventArgs.HandItems);
|
|
}
|
|
}
|
|
|
|
|
|
private static CsvParser OpenCsvParser(string nei, AFileSystemBase fs)
|
|
private static CsvParser OpenCsvParser(string nei, AFileSystemBase fs)
|
|
@@ -416,10 +498,31 @@ namespace COM3D2.MeidoPhotoStudio.Plugin
|
|
File.WriteAllLines(Path.Combine(configPath, name), list.ToArray());
|
|
File.WriteAllLines(Path.Combine(configPath, name), list.ToArray());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private static void OnMenuFilesChange(MenuFilesEventArgs args)
|
|
|
|
+ {
|
|
|
|
+ MenuFilesChange?.Invoke(null, args);
|
|
|
|
+ }
|
|
|
|
+
|
|
private class SerializePoseList
|
|
private class SerializePoseList
|
|
{
|
|
{
|
|
public string UIName { get; set; }
|
|
public string UIName { get; set; }
|
|
public List<string> PoseList { get; set; }
|
|
public List<string> PoseList { get; set; }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public class MenuFilesEventArgs : EventArgs
|
|
|
|
+ {
|
|
|
|
+ public EventType Type { get; }
|
|
|
|
+ public enum EventType
|
|
|
|
+ {
|
|
|
|
+ HandItems, MenuFiles
|
|
|
|
+ }
|
|
|
|
+ public static MenuFilesEventArgs HandItems => new MenuFilesEventArgs(EventType.HandItems);
|
|
|
|
+ public static MenuFilesEventArgs MenuFiles => new MenuFilesEventArgs(EventType.MenuFiles);
|
|
|
|
+
|
|
|
|
+ public MenuFilesEventArgs(EventType type)
|
|
|
|
+ {
|
|
|
|
+ this.Type = type;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|