|
@@ -3,41 +3,42 @@ using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Linq;
|
|
using System.Xml.Linq;
|
|
using System.Xml.Linq;
|
|
|
|
+
|
|
using MyRoomCustom;
|
|
using MyRoomCustom;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json;
|
|
using UnityEngine;
|
|
using UnityEngine;
|
|
using wf;
|
|
using wf;
|
|
|
|
+
|
|
using static MeidoPhotoStudio.Plugin.MenuFileUtility;
|
|
using static MeidoPhotoStudio.Plugin.MenuFileUtility;
|
|
|
|
|
|
namespace MeidoPhotoStudio.Plugin;
|
|
namespace MeidoPhotoStudio.Plugin;
|
|
|
|
|
|
public static class Constants
|
|
public static class Constants
|
|
{
|
|
{
|
|
- public enum Window { Call, Pose, Face, BG, BG2, Main, Message, Save, SaveModal, Settings }
|
|
|
|
- public enum Scene { Daily = 3, Edit = 5 }
|
|
|
|
- public enum DoguCategory { Other, Mob, Desk, HandItem, BGSmall }
|
|
|
|
-
|
|
|
|
- public const string customPoseDirectory = "Custom Poses";
|
|
|
|
- public const string customHandDirectory = "Hand Presets";
|
|
|
|
- public const string customFaceDirectory = "Face Presets";
|
|
|
|
- public const string sceneDirectory = "Scenes";
|
|
|
|
- public const string kankyoDirectory = "Environments";
|
|
|
|
- public const string configDirectory = "MeidoPhotoStudio";
|
|
|
|
- public const string translationDirectory = "Translations";
|
|
|
|
- public const string databaseDirectory = "Database";
|
|
|
|
-
|
|
|
|
- public static readonly string customPosePath;
|
|
|
|
- public static readonly string customHandPath;
|
|
|
|
- public static readonly string customFacePath;
|
|
|
|
- public static readonly string scenesPath;
|
|
|
|
- public static readonly string kankyoPath;
|
|
|
|
- public static readonly string configPath;
|
|
|
|
- public static readonly string databasePath;
|
|
|
|
- public static readonly int mainWindowID = 765;
|
|
|
|
- public static readonly int messageWindowID = 961;
|
|
|
|
- public static readonly int sceneManagerWindowID = 876;
|
|
|
|
- public static readonly int sceneManagerModalID = 283;
|
|
|
|
- public static readonly int dropdownWindowID = 777;
|
|
|
|
|
|
+ public const string CustomPoseDirectory = "Custom Poses";
|
|
|
|
+ public const string CustomHandDirectory = "Hand Presets";
|
|
|
|
+ public const string CustomFaceDirectory = "Face Presets";
|
|
|
|
+ public const string SceneDirectory = "Scenes";
|
|
|
|
+ public const string KankyoDirectory = "Environments";
|
|
|
|
+ public const string ConfigDirectory = "MeidoPhotoStudio";
|
|
|
|
+ public const string TranslationDirectory = "Translations";
|
|
|
|
+ public const string DatabaseDirectory = "Database";
|
|
|
|
+
|
|
|
|
+ public static readonly string CustomPosePath;
|
|
|
|
+ public static readonly string CustomHandPath;
|
|
|
|
+ public static readonly string CustomFacePath;
|
|
|
|
+ public static readonly string ScenesPath;
|
|
|
|
+ public static readonly string KankyoPath;
|
|
|
|
+ public static readonly string ConfigPath;
|
|
|
|
+ public static readonly string DatabasePath;
|
|
|
|
+
|
|
|
|
+ // TODO: Some of these IDs aren't used to use them or drop them.
|
|
|
|
+ public static readonly int MainWindowID = 765;
|
|
|
|
+ public static readonly int MessageWindowID = 961;
|
|
|
|
+ public static readonly int SceneManagerWindowID = 876;
|
|
|
|
+ public static readonly int SceneManagerModalID = 283;
|
|
|
|
+ public static readonly int DropdownWindowID = 777;
|
|
|
|
+
|
|
public static readonly List<string> PoseGroupList = new();
|
|
public static readonly List<string> PoseGroupList = new();
|
|
public static readonly Dictionary<string, List<string>> PoseDict = new();
|
|
public static readonly Dictionary<string, List<string>> PoseDict = new();
|
|
public static readonly List<string> CustomPoseGroupList = new();
|
|
public static readonly List<string> CustomPoseGroupList = new();
|
|
@@ -56,52 +57,89 @@ public static class Constants
|
|
public static readonly Dictionary<string, List<MyRoomItem>> MyRoomPropDict = new();
|
|
public static readonly Dictionary<string, List<MyRoomItem>> MyRoomPropDict = new();
|
|
public static readonly Dictionary<string, List<ModItem>> ModPropDict =
|
|
public static readonly Dictionary<string, List<ModItem>> ModPropDict =
|
|
new(StringComparer.InvariantCultureIgnoreCase);
|
|
new(StringComparer.InvariantCultureIgnoreCase);
|
|
|
|
+
|
|
public static readonly List<string> SceneDirectoryList = new();
|
|
public static readonly List<string> SceneDirectoryList = new();
|
|
public static readonly List<string> KankyoDirectoryList = new();
|
|
public static readonly List<string> KankyoDirectoryList = new();
|
|
public static readonly List<MpnAttachProp> MpnAttachPropList = new();
|
|
public static readonly List<MpnAttachProp> MpnAttachPropList = new();
|
|
- public static readonly Dictionary<DoguCategory, string> customDoguCategories =
|
|
|
|
|
|
+ public static readonly Dictionary<DoguCategory, string> CustomDoguCategories =
|
|
new()
|
|
new()
|
|
{
|
|
{
|
|
[DoguCategory.Other] = "other",
|
|
[DoguCategory.Other] = "other",
|
|
[DoguCategory.Mob] = "mob",
|
|
[DoguCategory.Mob] = "mob",
|
|
[DoguCategory.Desk] = "desk",
|
|
[DoguCategory.Desk] = "desk",
|
|
[DoguCategory.HandItem] = "handItem",
|
|
[DoguCategory.HandItem] = "handItem",
|
|
- [DoguCategory.BGSmall] = "bgSmall"
|
|
|
|
|
|
+ [DoguCategory.BGSmall] = "bgSmall",
|
|
};
|
|
};
|
|
|
|
|
|
- public static int MyRoomCustomBGIndex { get; private set; } = -1;
|
|
|
|
- public static bool HandItemsInitialized { get; private set; }
|
|
|
|
- public static bool MpnAttachInitialized { get; private set; }
|
|
|
|
- public static bool MenuFilesInitialized { get; private set; }
|
|
|
|
- public static event EventHandler<MenuFilesEventArgs> MenuFilesChange;
|
|
|
|
- public static event EventHandler<PresetChangeEventArgs> CustomPoseChange;
|
|
|
|
- public static event EventHandler<PresetChangeEventArgs> CustomHandChange;
|
|
|
|
- public static event EventHandler<PresetChangeEventArgs> CustomFaceChange;
|
|
|
|
-
|
|
|
|
private static bool beginHandItemInit;
|
|
private static bool beginHandItemInit;
|
|
private static bool beginMpnAttachInit;
|
|
private static bool beginMpnAttachInit;
|
|
|
|
|
|
static Constants()
|
|
static Constants()
|
|
{
|
|
{
|
|
- configPath = Path.Combine(BepInEx.Paths.ConfigPath, configDirectory);
|
|
|
|
|
|
+ ConfigPath = Path.Combine(BepInEx.Paths.ConfigPath, ConfigDirectory);
|
|
|
|
|
|
- var presetPath = Path.Combine(configPath, "Presets");
|
|
|
|
|
|
+ var presetPath = Path.Combine(ConfigPath, "Presets");
|
|
|
|
|
|
- customPosePath = Path.Combine(presetPath, customPoseDirectory);
|
|
|
|
- customHandPath = Path.Combine(presetPath, customHandDirectory);
|
|
|
|
- customFacePath = Path.Combine(presetPath, customFaceDirectory);
|
|
|
|
- scenesPath = Path.Combine(configPath, sceneDirectory);
|
|
|
|
- kankyoPath = Path.Combine(configPath, kankyoDirectory);
|
|
|
|
- databasePath = Path.Combine(configPath, databaseDirectory);
|
|
|
|
|
|
+ CustomPosePath = Path.Combine(presetPath, CustomPoseDirectory);
|
|
|
|
+ CustomHandPath = Path.Combine(presetPath, CustomHandDirectory);
|
|
|
|
+ CustomFacePath = Path.Combine(presetPath, CustomFaceDirectory);
|
|
|
|
+ ScenesPath = Path.Combine(ConfigPath, SceneDirectory);
|
|
|
|
+ KankyoPath = Path.Combine(ConfigPath, KankyoDirectory);
|
|
|
|
+ DatabasePath = Path.Combine(ConfigPath, DatabaseDirectory);
|
|
|
|
|
|
var directories =
|
|
var directories =
|
|
- new[] { customPosePath, customHandPath, scenesPath, kankyoPath, configPath, customFacePath, databasePath };
|
|
|
|
|
|
+ new[] { CustomPosePath, CustomHandPath, ScenesPath, KankyoPath, ConfigPath, CustomFacePath, DatabasePath };
|
|
|
|
|
|
foreach (var directory in directories)
|
|
foreach (var directory in directories)
|
|
if (!Directory.Exists(directory))
|
|
if (!Directory.Exists(directory))
|
|
Directory.CreateDirectory(directory);
|
|
Directory.CreateDirectory(directory);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public static event EventHandler<MenuFilesEventArgs> MenuFilesChange;
|
|
|
|
+
|
|
|
|
+ public static event EventHandler<PresetChangeEventArgs> CustomPoseChange;
|
|
|
|
+
|
|
|
|
+ public static event EventHandler<PresetChangeEventArgs> CustomHandChange;
|
|
|
|
+
|
|
|
|
+ public static event EventHandler<PresetChangeEventArgs> CustomFaceChange;
|
|
|
|
+
|
|
|
|
+ public enum Window
|
|
|
|
+ {
|
|
|
|
+ Call,
|
|
|
|
+ Pose,
|
|
|
|
+ Face,
|
|
|
|
+ BG,
|
|
|
|
+ BG2,
|
|
|
|
+ Main,
|
|
|
|
+ Message,
|
|
|
|
+ Save,
|
|
|
|
+ SaveModal,
|
|
|
|
+ Settings,
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public enum Scene
|
|
|
|
+ {
|
|
|
|
+ Daily = 3,
|
|
|
|
+ Edit = 5,
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public enum DoguCategory
|
|
|
|
+ {
|
|
|
|
+ Other,
|
|
|
|
+ Mob,
|
|
|
|
+ Desk,
|
|
|
|
+ HandItem,
|
|
|
|
+ BGSmall,
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public static int MyRoomCustomBGIndex { get; private set; } = -1;
|
|
|
|
+
|
|
|
|
+ public static bool HandItemsInitialized { get; private set; }
|
|
|
|
+
|
|
|
|
+ public static bool MpnAttachInitialized { get; private set; }
|
|
|
|
+
|
|
|
|
+ public static bool MenuFilesInitialized { get; private set; }
|
|
|
|
+
|
|
public static void Initialize()
|
|
public static void Initialize()
|
|
{
|
|
{
|
|
InitializeSceneDirectories();
|
|
InitializeSceneDirectories();
|
|
@@ -123,10 +161,10 @@ public static class Constants
|
|
if (string.IsNullOrEmpty(filename))
|
|
if (string.IsNullOrEmpty(filename))
|
|
filename = "face_preset";
|
|
filename = "face_preset";
|
|
|
|
|
|
- if (directory.Equals(customFaceDirectory, StringComparison.InvariantCultureIgnoreCase))
|
|
|
|
|
|
+ if (directory.Equals(CustomFaceDirectory, StringComparison.InvariantCultureIgnoreCase))
|
|
directory = string.Empty;
|
|
directory = string.Empty;
|
|
|
|
|
|
- directory = Path.Combine(customFacePath, directory);
|
|
|
|
|
|
+ directory = Path.Combine(CustomFacePath, directory);
|
|
|
|
|
|
if (!Directory.Exists(directory))
|
|
if (!Directory.Exists(directory))
|
|
Directory.CreateDirectory(directory);
|
|
Directory.CreateDirectory(directory);
|
|
@@ -138,7 +176,7 @@ public static class Constants
|
|
|
|
|
|
fullPath = Path.GetFullPath($"{fullPath}.xml");
|
|
fullPath = Path.GetFullPath($"{fullPath}.xml");
|
|
|
|
|
|
- if (!fullPath.StartsWith(customFacePath))
|
|
|
|
|
|
+ if (!fullPath.StartsWith(CustomFacePath))
|
|
{
|
|
{
|
|
Utility.LogError($"Could not save face preset! Path is invalid: '{fullPath}'");
|
|
Utility.LogError($"Could not save face preset! Path is invalid: '{fullPath}'");
|
|
|
|
|
|
@@ -153,25 +191,25 @@ public static class Constants
|
|
var fullDocument = new XDocument(
|
|
var fullDocument = new XDocument(
|
|
new XDeclaration("1.0", "utf-8", "true"),
|
|
new XDeclaration("1.0", "utf-8", "true"),
|
|
new XComment("MeidoPhotoStudio Face Preset"),
|
|
new XComment("MeidoPhotoStudio Face Preset"),
|
|
- rootElement
|
|
|
|
- );
|
|
|
|
|
|
+ rootElement);
|
|
|
|
|
|
fullDocument.Save(fullPath);
|
|
fullDocument.Save(fullPath);
|
|
|
|
|
|
var fileInfo = new FileInfo(fullPath);
|
|
var fileInfo = new FileInfo(fullPath);
|
|
var category = fileInfo.Directory.Name;
|
|
var category = fileInfo.Directory.Name;
|
|
var faceGroup = CustomFaceGroupList.Find(
|
|
var faceGroup = CustomFaceGroupList.Find(
|
|
- group => string.Equals(category, group, StringComparison.InvariantCultureIgnoreCase)
|
|
|
|
- );
|
|
|
|
|
|
+ group => string.Equals(category, group, StringComparison.InvariantCultureIgnoreCase));
|
|
|
|
|
|
if (string.IsNullOrEmpty(faceGroup))
|
|
if (string.IsNullOrEmpty(faceGroup))
|
|
{
|
|
{
|
|
CustomFaceGroupList.Add(category);
|
|
CustomFaceGroupList.Add(category);
|
|
CustomFaceDict[category] = new();
|
|
CustomFaceDict[category] = new();
|
|
- CustomFaceGroupList.Sort((a, b) => KeepAtTop(a, b, customFaceDirectory));
|
|
|
|
|
|
+ CustomFaceGroupList.Sort((a, b) => KeepAtTop(a, b, CustomFaceDirectory));
|
|
}
|
|
}
|
|
else
|
|
else
|
|
|
|
+ {
|
|
category = faceGroup;
|
|
category = faceGroup;
|
|
|
|
+ }
|
|
|
|
|
|
CustomFaceDict[category].Add(fullPath);
|
|
CustomFaceDict[category].Add(fullPath);
|
|
CustomFaceDict[category].Sort(WindowsLogicalComparer.StrCmpLogicalW);
|
|
CustomFaceDict[category].Sort(WindowsLogicalComparer.StrCmpLogicalW);
|
|
@@ -182,17 +220,16 @@ public static class Constants
|
|
public static void AddPose(byte[] anmBinary, string filename, string directory)
|
|
public static void AddPose(byte[] anmBinary, string filename, string directory)
|
|
{
|
|
{
|
|
// TODO: Consider writing a file system monitor
|
|
// TODO: Consider writing a file system monitor
|
|
-
|
|
|
|
filename = Utility.SanitizePathPortion(filename);
|
|
filename = Utility.SanitizePathPortion(filename);
|
|
directory = Utility.SanitizePathPortion(directory);
|
|
directory = Utility.SanitizePathPortion(directory);
|
|
|
|
|
|
if (string.IsNullOrEmpty(filename))
|
|
if (string.IsNullOrEmpty(filename))
|
|
filename = "custom_pose";
|
|
filename = "custom_pose";
|
|
|
|
|
|
- if (directory.Equals(customPoseDirectory, StringComparison.InvariantCultureIgnoreCase))
|
|
|
|
|
|
+ if (directory.Equals(CustomPoseDirectory, StringComparison.InvariantCultureIgnoreCase))
|
|
directory = string.Empty;
|
|
directory = string.Empty;
|
|
|
|
|
|
- directory = Path.Combine(customPosePath, directory);
|
|
|
|
|
|
+ directory = Path.Combine(CustomPosePath, directory);
|
|
|
|
|
|
if (!Directory.Exists(directory))
|
|
if (!Directory.Exists(directory))
|
|
Directory.CreateDirectory(directory);
|
|
Directory.CreateDirectory(directory);
|
|
@@ -204,7 +241,7 @@ public static class Constants
|
|
|
|
|
|
fullPath = Path.GetFullPath($"{fullPath}.anm");
|
|
fullPath = Path.GetFullPath($"{fullPath}.anm");
|
|
|
|
|
|
- if (!fullPath.StartsWith(customPosePath))
|
|
|
|
|
|
+ if (!fullPath.StartsWith(CustomPosePath))
|
|
{
|
|
{
|
|
Utility.LogError($"Could not save pose! Path is invalid: '{fullPath}'");
|
|
Utility.LogError($"Could not save pose! Path is invalid: '{fullPath}'");
|
|
|
|
|
|
@@ -217,17 +254,18 @@ public static class Constants
|
|
|
|
|
|
var category = fileInfo.Directory.Name;
|
|
var category = fileInfo.Directory.Name;
|
|
var poseGroup = CustomPoseGroupList.Find(
|
|
var poseGroup = CustomPoseGroupList.Find(
|
|
- group => string.Equals(category, group, StringComparison.InvariantCultureIgnoreCase)
|
|
|
|
- );
|
|
|
|
|
|
+ group => string.Equals(category, group, StringComparison.InvariantCultureIgnoreCase));
|
|
|
|
|
|
if (string.IsNullOrEmpty(poseGroup))
|
|
if (string.IsNullOrEmpty(poseGroup))
|
|
{
|
|
{
|
|
CustomPoseGroupList.Add(category);
|
|
CustomPoseGroupList.Add(category);
|
|
CustomPoseDict[category] = new();
|
|
CustomPoseDict[category] = new();
|
|
- CustomPoseGroupList.Sort((a, b) => KeepAtTop(a, b, customPoseDirectory));
|
|
|
|
|
|
+ CustomPoseGroupList.Sort((a, b) => KeepAtTop(a, b, CustomPoseDirectory));
|
|
}
|
|
}
|
|
else
|
|
else
|
|
|
|
+ {
|
|
category = poseGroup;
|
|
category = poseGroup;
|
|
|
|
+ }
|
|
|
|
|
|
CustomPoseDict[category].Add(fullPath);
|
|
CustomPoseDict[category].Add(fullPath);
|
|
CustomPoseDict[category].Sort(WindowsLogicalComparer.StrCmpLogicalW);
|
|
CustomPoseDict[category].Sort(WindowsLogicalComparer.StrCmpLogicalW);
|
|
@@ -243,10 +281,10 @@ public static class Constants
|
|
if (string.IsNullOrEmpty(filename))
|
|
if (string.IsNullOrEmpty(filename))
|
|
filename = "custom_hand";
|
|
filename = "custom_hand";
|
|
|
|
|
|
- if (directory.Equals(customHandDirectory, StringComparison.InvariantCultureIgnoreCase))
|
|
|
|
|
|
+ if (directory.Equals(CustomHandDirectory, StringComparison.InvariantCultureIgnoreCase))
|
|
directory = string.Empty;
|
|
directory = string.Empty;
|
|
|
|
|
|
- directory = Path.Combine(customHandPath, directory);
|
|
|
|
|
|
+ directory = Path.Combine(CustomHandPath, directory);
|
|
|
|
|
|
if (!Directory.Exists(directory))
|
|
if (!Directory.Exists(directory))
|
|
Directory.CreateDirectory(directory);
|
|
Directory.CreateDirectory(directory);
|
|
@@ -258,7 +296,7 @@ public static class Constants
|
|
|
|
|
|
fullPath = Path.GetFullPath($"{fullPath}.xml");
|
|
fullPath = Path.GetFullPath($"{fullPath}.xml");
|
|
|
|
|
|
- if (!fullPath.StartsWith(customHandPath))
|
|
|
|
|
|
+ if (!fullPath.StartsWith(CustomHandPath))
|
|
{
|
|
{
|
|
Utility.LogError($"Could not save hand! Path is invalid: '{fullPath}'");
|
|
Utility.LogError($"Could not save hand! Path is invalid: '{fullPath}'");
|
|
|
|
|
|
@@ -274,26 +312,25 @@ public static class Constants
|
|
"FingerData",
|
|
"FingerData",
|
|
new XElement("GameVersion", gameVersion),
|
|
new XElement("GameVersion", gameVersion),
|
|
new XElement("RightData", right),
|
|
new XElement("RightData", right),
|
|
- new XElement("BinaryData", Convert.ToBase64String(handBinary))
|
|
|
|
- )
|
|
|
|
- );
|
|
|
|
|
|
+ new XElement("BinaryData", Convert.ToBase64String(handBinary))));
|
|
|
|
|
|
finalXml.Save(fullPath);
|
|
finalXml.Save(fullPath);
|
|
|
|
|
|
var fileInfo = new FileInfo(fullPath);
|
|
var fileInfo = new FileInfo(fullPath);
|
|
var category = fileInfo.Directory.Name;
|
|
var category = fileInfo.Directory.Name;
|
|
var handGroup = CustomHandGroupList.Find(
|
|
var handGroup = CustomHandGroupList.Find(
|
|
- group => string.Equals(category, group, StringComparison.InvariantCultureIgnoreCase)
|
|
|
|
- );
|
|
|
|
|
|
+ group => string.Equals(category, group, StringComparison.InvariantCultureIgnoreCase));
|
|
|
|
|
|
if (string.IsNullOrEmpty(handGroup))
|
|
if (string.IsNullOrEmpty(handGroup))
|
|
{
|
|
{
|
|
CustomHandGroupList.Add(category);
|
|
CustomHandGroupList.Add(category);
|
|
CustomHandDict[category] = new();
|
|
CustomHandDict[category] = new();
|
|
- CustomHandGroupList.Sort((a, b) => KeepAtTop(a, b, customHandDirectory));
|
|
|
|
|
|
+ CustomHandGroupList.Sort((a, b) => KeepAtTop(a, b, CustomHandDirectory));
|
|
}
|
|
}
|
|
else
|
|
else
|
|
|
|
+ {
|
|
category = handGroup;
|
|
category = handGroup;
|
|
|
|
+ }
|
|
|
|
|
|
CustomHandDict[category].Add(fullPath);
|
|
CustomHandDict[category].Add(fullPath);
|
|
CustomHandDict[category].Sort(WindowsLogicalComparer.StrCmpLogicalW);
|
|
CustomHandDict[category].Sort(WindowsLogicalComparer.StrCmpLogicalW);
|
|
@@ -304,29 +341,29 @@ public static class Constants
|
|
public static void InitializeSceneDirectories()
|
|
public static void InitializeSceneDirectories()
|
|
{
|
|
{
|
|
SceneDirectoryList.Clear();
|
|
SceneDirectoryList.Clear();
|
|
- SceneDirectoryList.Add(sceneDirectory);
|
|
|
|
|
|
+ SceneDirectoryList.Add(SceneDirectory);
|
|
|
|
|
|
- foreach (var directory in Directory.GetDirectories(scenesPath))
|
|
|
|
|
|
+ foreach (var directory in Directory.GetDirectories(ScenesPath))
|
|
SceneDirectoryList.Add(new DirectoryInfo(directory).Name);
|
|
SceneDirectoryList.Add(new DirectoryInfo(directory).Name);
|
|
|
|
|
|
- SceneDirectoryList.Sort((a, b) => KeepAtTop(a, b, sceneDirectory));
|
|
|
|
|
|
+ SceneDirectoryList.Sort((a, b) => KeepAtTop(a, b, SceneDirectory));
|
|
}
|
|
}
|
|
|
|
|
|
public static void InitializeKankyoDirectories()
|
|
public static void InitializeKankyoDirectories()
|
|
{
|
|
{
|
|
KankyoDirectoryList.Clear();
|
|
KankyoDirectoryList.Clear();
|
|
- KankyoDirectoryList.Add(kankyoDirectory);
|
|
|
|
|
|
+ KankyoDirectoryList.Add(KankyoDirectory);
|
|
|
|
|
|
- foreach (var directory in Directory.GetDirectories(kankyoPath))
|
|
|
|
|
|
+ foreach (var directory in Directory.GetDirectories(KankyoPath))
|
|
KankyoDirectoryList.Add(new DirectoryInfo(directory).Name);
|
|
KankyoDirectoryList.Add(new DirectoryInfo(directory).Name);
|
|
|
|
|
|
- KankyoDirectoryList.Sort((a, b) => KeepAtTop(a, b, kankyoDirectory));
|
|
|
|
|
|
+ KankyoDirectoryList.Sort((a, b) => KeepAtTop(a, b, KankyoDirectory));
|
|
}
|
|
}
|
|
|
|
|
|
public static void InitializePoses()
|
|
public static void InitializePoses()
|
|
{
|
|
{
|
|
// Load Poses
|
|
// Load Poses
|
|
- var poseListPath = Path.Combine(databasePath, "mm_pose_list.json");
|
|
|
|
|
|
+ var poseListPath = Path.Combine(DatabasePath, "mm_pose_list.json");
|
|
|
|
|
|
try
|
|
try
|
|
{
|
|
{
|
|
@@ -378,15 +415,16 @@ public static class Constants
|
|
continue;
|
|
continue;
|
|
|
|
|
|
if (file.StartsWith("edit_"))
|
|
if (file.StartsWith("edit_"))
|
|
|
|
+ {
|
|
PoseDict["normal"].Add(file);
|
|
PoseDict["normal"].Add(file);
|
|
|
|
+ }
|
|
else if (file is not ("dance_cm3d2_001_zoukin" or "dance_cm3d2_001_mop" or "aruki_1_idougo_f"
|
|
else if (file is not ("dance_cm3d2_001_zoukin" or "dance_cm3d2_001_mop" or "aruki_1_idougo_f"
|
|
or "sleep2" or "stand_akire2") && !file.EndsWith("_3_") && !file.EndsWith("_5_")
|
|
or "sleep2" or "stand_akire2") && !file.EndsWith("_3_") && !file.EndsWith("_5_")
|
|
&& !file.StartsWith("vr_") && !file.StartsWith("dance_mc") && !file.Contains("_kubi_")
|
|
&& !file.StartsWith("vr_") && !file.StartsWith("dance_mc") && !file.Contains("_kubi_")
|
|
&& !file.Contains("a01_") && !file.Contains("b01_") && !file.Contains("b02_")
|
|
&& !file.Contains("a01_") && !file.Contains("b01_") && !file.Contains("b02_")
|
|
&& !file.EndsWith("_m2") && !file.EndsWith("_m2_once_") && !file.StartsWith("h_")
|
|
&& !file.EndsWith("_m2") && !file.EndsWith("_m2_once_") && !file.StartsWith("h_")
|
|
&& !file.StartsWith("event_") && !file.StartsWith("man_") && !file.EndsWith("_m")
|
|
&& !file.StartsWith("event_") && !file.StartsWith("man_") && !file.EndsWith("_m")
|
|
- && !file.Contains("_m_") && !file.Contains("_man_")
|
|
|
|
- )
|
|
|
|
|
|
+ && !file.Contains("_m_") && !file.Contains("_man_"))
|
|
{
|
|
{
|
|
if (path.Contains(@"\sex\"))
|
|
if (path.Contains(@"\sex\"))
|
|
PoseDict["ero2"].Add(file);
|
|
PoseDict["ero2"].Add(file);
|
|
@@ -403,7 +441,9 @@ public static class Constants
|
|
PoseGroupList.Add(category);
|
|
PoseGroupList.Add(category);
|
|
}
|
|
}
|
|
else
|
|
else
|
|
|
|
+ {
|
|
PoseDict.Remove(category);
|
|
PoseDict.Remove(category);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -427,15 +467,15 @@ public static class Constants
|
|
CustomPoseGroupList.Clear();
|
|
CustomPoseGroupList.Clear();
|
|
CustomPoseDict.Clear();
|
|
CustomPoseDict.Clear();
|
|
|
|
|
|
- CustomPoseGroupList.Add(customPoseDirectory);
|
|
|
|
- CustomPoseDict[customPoseDirectory] = new();
|
|
|
|
|
|
+ CustomPoseGroupList.Add(CustomPoseDirectory);
|
|
|
|
+ CustomPoseDict[CustomPoseDirectory] = new();
|
|
|
|
|
|
- GetPoses(customPosePath);
|
|
|
|
|
|
+ GetPoses(CustomPosePath);
|
|
|
|
|
|
- foreach (var directory in Directory.GetDirectories(customPosePath))
|
|
|
|
|
|
+ foreach (var directory in Directory.GetDirectories(CustomPosePath))
|
|
GetPoses(directory);
|
|
GetPoses(directory);
|
|
|
|
|
|
- CustomPoseGroupList.Sort((a, b) => KeepAtTop(a, b, customPoseDirectory));
|
|
|
|
|
|
+ CustomPoseGroupList.Sort((a, b) => KeepAtTop(a, b, CustomPoseDirectory));
|
|
|
|
|
|
CustomPoseChange?.Invoke(null, PresetChangeEventArgs.Empty);
|
|
CustomPoseChange?.Invoke(null, PresetChangeEventArgs.Empty);
|
|
|
|
|
|
@@ -449,7 +489,7 @@ public static class Constants
|
|
|
|
|
|
var poseGroupName = new DirectoryInfo(directory).Name;
|
|
var poseGroupName = new DirectoryInfo(directory).Name;
|
|
|
|
|
|
- if (poseGroupName is not customPoseDirectory)
|
|
|
|
|
|
+ if (poseGroupName is not CustomPoseDirectory)
|
|
CustomPoseGroupList.Add(poseGroupName);
|
|
CustomPoseGroupList.Add(poseGroupName);
|
|
|
|
|
|
CustomPoseDict[poseGroupName] = poseList.ToList();
|
|
CustomPoseDict[poseGroupName] = poseList.ToList();
|
|
@@ -462,15 +502,15 @@ public static class Constants
|
|
CustomHandGroupList.Clear();
|
|
CustomHandGroupList.Clear();
|
|
CustomHandDict.Clear();
|
|
CustomHandDict.Clear();
|
|
|
|
|
|
- CustomHandGroupList.Add(customHandDirectory);
|
|
|
|
- CustomHandDict[customHandDirectory] = new();
|
|
|
|
|
|
+ CustomHandGroupList.Add(CustomHandDirectory);
|
|
|
|
+ CustomHandDict[CustomHandDirectory] = new();
|
|
|
|
|
|
- GetPresets(customHandPath);
|
|
|
|
|
|
+ GetPresets(CustomHandPath);
|
|
|
|
|
|
- foreach (var directory in Directory.GetDirectories(customHandPath))
|
|
|
|
|
|
+ foreach (var directory in Directory.GetDirectories(CustomHandPath))
|
|
GetPresets(directory);
|
|
GetPresets(directory);
|
|
|
|
|
|
- CustomHandGroupList.Sort((a, b) => KeepAtTop(a, b, customHandDirectory));
|
|
|
|
|
|
+ CustomHandGroupList.Sort((a, b) => KeepAtTop(a, b, CustomHandDirectory));
|
|
|
|
|
|
CustomHandChange?.Invoke(null, PresetChangeEventArgs.Empty);
|
|
CustomHandChange?.Invoke(null, PresetChangeEventArgs.Empty);
|
|
|
|
|
|
@@ -484,7 +524,7 @@ public static class Constants
|
|
|
|
|
|
var presetCategory = new DirectoryInfo(directory).Name;
|
|
var presetCategory = new DirectoryInfo(directory).Name;
|
|
|
|
|
|
- if (presetCategory is not customHandDirectory)
|
|
|
|
|
|
+ if (presetCategory is not CustomHandDirectory)
|
|
CustomHandGroupList.Add(presetCategory);
|
|
CustomHandGroupList.Add(presetCategory);
|
|
|
|
|
|
CustomHandDict[presetCategory] = presetList.ToList();
|
|
CustomHandDict[presetCategory] = presetList.ToList();
|
|
@@ -509,15 +549,15 @@ public static class Constants
|
|
CustomFaceGroupList.Clear();
|
|
CustomFaceGroupList.Clear();
|
|
CustomFaceDict.Clear();
|
|
CustomFaceDict.Clear();
|
|
|
|
|
|
- CustomFaceGroupList.Add(customFaceDirectory);
|
|
|
|
- CustomFaceDict[customFaceDirectory] = new();
|
|
|
|
|
|
+ CustomFaceGroupList.Add(CustomFaceDirectory);
|
|
|
|
+ CustomFaceDict[CustomFaceDirectory] = new();
|
|
|
|
|
|
- GetFacePresets(customFacePath);
|
|
|
|
|
|
+ GetFacePresets(CustomFacePath);
|
|
|
|
|
|
- foreach (var directory in Directory.GetDirectories(customFacePath))
|
|
|
|
|
|
+ foreach (var directory in Directory.GetDirectories(CustomFacePath))
|
|
GetFacePresets(directory);
|
|
GetFacePresets(directory);
|
|
|
|
|
|
- CustomFaceGroupList.Sort((a, b) => KeepAtTop(a, b, customFaceDirectory));
|
|
|
|
|
|
+ CustomFaceGroupList.Sort((a, b) => KeepAtTop(a, b, CustomFaceDirectory));
|
|
|
|
|
|
CustomFaceChange?.Invoke(null, PresetChangeEventArgs.Empty);
|
|
CustomFaceChange?.Invoke(null, PresetChangeEventArgs.Empty);
|
|
|
|
|
|
@@ -531,7 +571,7 @@ public static class Constants
|
|
|
|
|
|
var faceGroupName = new DirectoryInfo(directory).Name;
|
|
var faceGroupName = new DirectoryInfo(directory).Name;
|
|
|
|
|
|
- if (faceGroupName is not customFaceDirectory)
|
|
|
|
|
|
+ if (faceGroupName is not CustomFaceDirectory)
|
|
CustomFaceGroupList.Add(faceGroupName);
|
|
CustomFaceGroupList.Add(faceGroupName);
|
|
|
|
|
|
CustomFaceDict[faceGroupName] = presetList.ToList();
|
|
CustomFaceDict[faceGroupName] = presetList.ToList();
|
|
@@ -582,7 +622,7 @@ public static class Constants
|
|
|
|
|
|
public static void InitializeDogu()
|
|
public static void InitializeDogu()
|
|
{
|
|
{
|
|
- foreach (var customCategory in customDoguCategories.Values)
|
|
|
|
|
|
+ foreach (var customCategory in CustomDoguCategories.Values)
|
|
DoguDict[customCategory] = new();
|
|
DoguDict[customCategory] = new();
|
|
|
|
|
|
InitializeDeskItems();
|
|
InitializeDeskItems();
|
|
@@ -599,7 +639,7 @@ public static class Constants
|
|
}
|
|
}
|
|
|
|
|
|
foreach (DoguCategory category in Enum.GetValues(typeof(DoguCategory)))
|
|
foreach (DoguCategory category in Enum.GetValues(typeof(DoguCategory)))
|
|
- DoguCategories.Add(customDoguCategories[category]);
|
|
|
|
|
|
+ DoguCategories.Add(CustomDoguCategories[category]);
|
|
}
|
|
}
|
|
|
|
|
|
public static List<ModItem> GetModPropList(string category)
|
|
public static List<ModItem> GetModPropList(string category)
|
|
@@ -678,17 +718,16 @@ public static class Constants
|
|
|
|
|
|
private static void InitializeOtherDogu()
|
|
private static void InitializeOtherDogu()
|
|
{
|
|
{
|
|
- DoguDict[customDoguCategories[DoguCategory.BGSmall]] = BGList;
|
|
|
|
- DoguDict[customDoguCategories[DoguCategory.Mob]].AddRange(
|
|
|
|
|
|
+ DoguDict[CustomDoguCategories[DoguCategory.BGSmall]] = BGList;
|
|
|
|
+ DoguDict[CustomDoguCategories[DoguCategory.Mob]].AddRange(
|
|
new[]
|
|
new[]
|
|
{
|
|
{
|
|
"Mob_Man_Stand001", "Mob_Man_Stand002", "Mob_Man_Stand003", "Mob_Man_Sit001", "Mob_Man_Sit002",
|
|
"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_Man_Sit003", "Mob_Girl_Stand001", "Mob_Girl_Stand002", "Mob_Girl_Stand003", "Mob_Girl_Sit001",
|
|
- "Mob_Girl_Sit002", "Mob_Girl_Sit003"
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
|
|
+ "Mob_Girl_Sit002", "Mob_Girl_Sit003",
|
|
|
|
+ });
|
|
|
|
|
|
- var DoguList = DoguDict[customDoguCategories[DoguCategory.Other]];
|
|
|
|
|
|
+ var otherDoguList = DoguDict[CustomDoguCategories[DoguCategory.Other]];
|
|
|
|
|
|
// bg object extend
|
|
// bg object extend
|
|
var doguHashSet = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
|
var doguHashSet = new HashSet<string>(StringComparer.InvariantCultureIgnoreCase);
|
|
@@ -697,7 +736,7 @@ public static class Constants
|
|
|
|
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- var ignoreListPath = Path.Combine(databasePath, "bg_ignore_list.json");
|
|
|
|
|
|
+ var ignoreListPath = Path.Combine(DatabasePath, "bg_ignore_list.json");
|
|
var ignoreListJson = File.ReadAllText(ignoreListPath);
|
|
var ignoreListJson = File.ReadAllText(ignoreListPath);
|
|
var ignoreList = JsonConvert.DeserializeObject<string[]>(ignoreListJson);
|
|
var ignoreList = JsonConvert.DeserializeObject<string[]>(ignoreListJson);
|
|
|
|
|
|
@@ -707,7 +746,10 @@ public static class Constants
|
|
{
|
|
{
|
|
Utility.LogWarning($"Could not open ignored BG database because {e.Message}");
|
|
Utility.LogWarning($"Could not open ignored BG database because {e.Message}");
|
|
}
|
|
}
|
|
- catch { }
|
|
|
|
|
|
+ catch
|
|
|
|
+ {
|
|
|
|
+ // Ignored.
|
|
|
|
+ }
|
|
|
|
|
|
foreach (var doguList in DoguDict.Values)
|
|
foreach (var doguList in DoguDict.Values)
|
|
doguHashSet.UnionWith(doguList);
|
|
doguHashSet.UnionWith(doguList);
|
|
@@ -722,17 +764,17 @@ public static class Constants
|
|
if (doguHashSet.Contains(file) || file.EndsWith("_hit"))
|
|
if (doguHashSet.Contains(file) || file.EndsWith("_hit"))
|
|
continue;
|
|
continue;
|
|
|
|
|
|
- DoguList.Add(file);
|
|
|
|
|
|
+ otherDoguList.Add(file);
|
|
doguHashSet.Add(file);
|
|
doguHashSet.Add(file);
|
|
}
|
|
}
|
|
|
|
|
|
// Get cherry picked dogu that I can't find in the game files
|
|
// Get cherry picked dogu that I can't find in the game files
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- var doguExtendPath = Path.Combine(databasePath, "extra_dogu.json");
|
|
|
|
|
|
+ var doguExtendPath = Path.Combine(DatabasePath, "extra_dogu.json");
|
|
var doguExtendJson = File.ReadAllText(doguExtendPath);
|
|
var doguExtendJson = File.ReadAllText(doguExtendPath);
|
|
|
|
|
|
- DoguList.AddRange(JsonConvert.DeserializeObject<IEnumerable<string>>(doguExtendJson));
|
|
|
|
|
|
+ otherDoguList.AddRange(JsonConvert.DeserializeObject<IEnumerable<string>>(doguExtendJson));
|
|
}
|
|
}
|
|
catch (IOException e)
|
|
catch (IOException e)
|
|
{
|
|
{
|
|
@@ -751,7 +793,7 @@ public static class Constants
|
|
var file = Path.GetFileNameWithoutExtension(path);
|
|
var file = Path.GetFileNameWithoutExtension(path);
|
|
|
|
|
|
if (!doguHashSet.Contains(file) && !file.EndsWith("_not_optimisation"))
|
|
if (!doguHashSet.Contains(file) && !file.EndsWith("_not_optimisation"))
|
|
- DoguList.Add(file);
|
|
|
|
|
|
+ otherDoguList.Add(file);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -760,14 +802,12 @@ public static class Constants
|
|
var enabledIDs = new HashSet<int>();
|
|
var 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);
|
|
|
|
|
|
CsvCommonIdManager.ReadEnabledIdList(
|
|
CsvCommonIdManager.ReadEnabledIdList(
|
|
- CsvCommonIdManager.FileSystemType.Old, true, "desk_item_enabled_id", ref enabledIDs
|
|
|
|
- );
|
|
|
|
|
|
+ CsvCommonIdManager.FileSystemType.Old, true, "desk_item_enabled_id", ref enabledIDs);
|
|
|
|
|
|
- var com3d2DeskDogu = DoguDict[customDoguCategories[DoguCategory.Desk]];
|
|
|
|
|
|
+ var com3d2DeskDogu = DoguDict[CustomDoguCategories[DoguCategory.Desk]];
|
|
|
|
|
|
GetDeskItems(GameUty.FileSystem);
|
|
GetDeskItems(GameUty.FileSystem);
|
|
|
|
|
|
@@ -837,9 +877,8 @@ public static class Constants
|
|
new[]
|
|
new[]
|
|
{
|
|
{
|
|
"Particle/pLineY", "Particle/pLineP02", "Particle/pHeart01",
|
|
"Particle/pLineY", "Particle/pLineP02", "Particle/pHeart01",
|
|
- "Particle/pLine_act2", "Particle/pstarY_act2"
|
|
|
|
- }
|
|
|
|
- );
|
|
|
|
|
|
+ "Particle/pLine_act2", "Particle/pstarY_act3",
|
|
|
|
+ });
|
|
}
|
|
}
|
|
|
|
|
|
private static void InitializeHandItems()
|
|
private static void InitializeHandItems()
|
|
@@ -865,7 +904,7 @@ public static class Constants
|
|
|
|
|
|
try
|
|
try
|
|
{
|
|
{
|
|
- var ignoreListPath = Path.Combine(databasePath, "bg_ignore_list.json");
|
|
|
|
|
|
+ var ignoreListPath = Path.Combine(DatabasePath, "bg_ignore_list.json");
|
|
var ignoreListJson = File.ReadAllText(ignoreListPath);
|
|
var ignoreListJson = File.ReadAllText(ignoreListPath);
|
|
var ignoreList = JsonConvert.DeserializeObject<string[]>(ignoreListJson);
|
|
var ignoreList = JsonConvert.DeserializeObject<string[]>(ignoreListJson);
|
|
|
|
|
|
@@ -883,7 +922,7 @@ public static class Constants
|
|
foreach (var doguList in DoguDict.Values)
|
|
foreach (var doguList in DoguDict.Values)
|
|
doguHashSet.UnionWith(doguList);
|
|
doguHashSet.UnionWith(doguList);
|
|
|
|
|
|
- var category = customDoguCategories[DoguCategory.HandItem];
|
|
|
|
|
|
+ var category = CustomDoguCategories[DoguCategory.HandItem];
|
|
|
|
|
|
for (var i = 0; i < menuDataBase.GetDataSize(); i++)
|
|
for (var i = 0; i < menuDataBase.GetDataSize(); i++)
|
|
{
|
|
{
|
|
@@ -1024,7 +1063,9 @@ public static class Constants
|
|
ModItem modItem;
|
|
ModItem modItem;
|
|
|
|
|
|
if (cache.Has(modMenuFile))
|
|
if (cache.Has(modMenuFile))
|
|
|
|
+ {
|
|
modItem = cache[modMenuFile];
|
|
modItem = cache[modMenuFile];
|
|
|
|
+ }
|
|
else
|
|
else
|
|
{
|
|
{
|
|
modItem = ModItem.Mod(modMenuFile);
|
|
modItem = ModItem.Mod(modMenuFile);
|
|
@@ -1067,7 +1108,10 @@ public static class Constants
|
|
|
|
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
- catch { }
|
|
|
|
|
|
+ catch
|
|
|
|
+ {
|
|
|
|
+ // Ignored.
|
|
|
|
+ }
|
|
|
|
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -1092,41 +1136,7 @@ public static class Constants
|
|
private class SerializePoseList
|
|
private class SerializePoseList
|
|
{
|
|
{
|
|
public string UIName { get; set; }
|
|
public string UIName { get; set; }
|
|
- public List<string> PoseList { get; set; }
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-public class MenuFilesEventArgs : EventArgs
|
|
|
|
-{
|
|
|
|
- public enum EventType { HandItems, MenuFiles, MpnAttach }
|
|
|
|
-
|
|
|
|
- public EventType Type { get; }
|
|
|
|
|
|
|
|
- public MenuFilesEventArgs(EventType type) =>
|
|
|
|
- Type = type;
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-public class PresetChangeEventArgs : EventArgs
|
|
|
|
-{
|
|
|
|
- public static new PresetChangeEventArgs Empty { get; } = new(string.Empty, string.Empty);
|
|
|
|
- public string Category { get; }
|
|
|
|
- public string Path { get; }
|
|
|
|
-
|
|
|
|
- public PresetChangeEventArgs(string path, string category)
|
|
|
|
- {
|
|
|
|
- Path = path;
|
|
|
|
- Category = category;
|
|
|
|
- }
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-public readonly struct MpnAttachProp
|
|
|
|
-{
|
|
|
|
- public MPN Tag { get; }
|
|
|
|
- public string MenuFile { get; }
|
|
|
|
-
|
|
|
|
- public MpnAttachProp(MPN tag, string menuFile)
|
|
|
|
- {
|
|
|
|
- Tag = tag;
|
|
|
|
- MenuFile = menuFile;
|
|
|
|
|
|
+ public List<string> PoseList { get; set; }
|
|
}
|
|
}
|
|
}
|
|
}
|