|
@@ -94,9 +94,8 @@ public static class Constants
|
|
|
kankyoPath = Path.Combine(configPath, kankyoDirectory);
|
|
|
databasePath = Path.Combine(configPath, databaseDirectory);
|
|
|
|
|
|
- var directories = new[] {
|
|
|
- customPosePath, customHandPath, scenesPath, kankyoPath, configPath, customFacePath, databasePath
|
|
|
- };
|
|
|
+ var directories =
|
|
|
+ new[] { customPosePath, customHandPath, scenesPath, kankyoPath, configPath, customFacePath, databasePath };
|
|
|
|
|
|
foreach (var directory in directories)
|
|
|
if (!Directory.Exists(directory))
|
|
@@ -268,9 +267,11 @@ public static class Constants
|
|
|
|
|
|
// TODO: This does not actually do what I think it does.
|
|
|
var gameVersion = Misc.GAME_VERSION; // get game version from user's Assembly-CSharp
|
|
|
- var finalXml = new XDocument(new XDeclaration("1.0", "utf-8", "true"),
|
|
|
+ var finalXml = new XDocument(
|
|
|
+ new XDeclaration("1.0", "utf-8", "true"),
|
|
|
new XComment("CM3D2 FingerData"),
|
|
|
- new XElement("FingerData",
|
|
|
+ new XElement(
|
|
|
+ "FingerData",
|
|
|
new XElement("GameVersion", gameVersion),
|
|
|
new XElement("RightData", right),
|
|
|
new XElement("BinaryData", Convert.ToBase64String(handBinary))
|
|
@@ -324,15 +325,6 @@ public static class Constants
|
|
|
|
|
|
public static void InitializePoses()
|
|
|
{
|
|
|
- static void AddDefaultPose()
|
|
|
- {
|
|
|
- if (!PoseDict.ContainsKey("normal"))
|
|
|
- PoseDict["normal"] = new() { "maid_stand01" };
|
|
|
-
|
|
|
- if (!PoseGroupList.Contains("normal"))
|
|
|
- PoseGroupList.Insert(0, "normal");
|
|
|
- }
|
|
|
-
|
|
|
// Load Poses
|
|
|
var poseListPath = Path.Combine(databasePath, "mm_pose_list.json");
|
|
|
|
|
@@ -377,29 +369,29 @@ public static class Constants
|
|
|
// TODO: Try to group these poses into more than "normal2" and "ero2"
|
|
|
foreach (var path in com3d2MotionList)
|
|
|
{
|
|
|
- if (Path.GetExtension(path) is ".anm")
|
|
|
- {
|
|
|
- var file = Path.GetFileNameWithoutExtension(path);
|
|
|
+ if (Path.GetExtension(path) is not ".anm")
|
|
|
+ continue;
|
|
|
|
|
|
- if (!poseSet.Contains(file))
|
|
|
- {
|
|
|
- if (file.StartsWith("edit_"))
|
|
|
- PoseDict["normal"].Add(file);
|
|
|
- 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_")
|
|
|
- && !file.StartsWith("vr_") && !file.StartsWith("dance_mc") && !file.Contains("_kubi_")
|
|
|
- && !file.Contains("a01_") && !file.Contains("b01_") && !file.Contains("b02_")
|
|
|
- && !file.EndsWith("_m2") && !file.EndsWith("_m2_once_") && !file.StartsWith("h_")
|
|
|
- && !file.StartsWith("event_") && !file.StartsWith("man_") && !file.EndsWith("_m")
|
|
|
- && !file.Contains("_m_") && !file.Contains("_man_")
|
|
|
- )
|
|
|
- {
|
|
|
- if (path.Contains(@"\sex\"))
|
|
|
- PoseDict["ero2"].Add(file);
|
|
|
- else
|
|
|
- PoseDict["normal2"].Add(file);
|
|
|
- }
|
|
|
- }
|
|
|
+ var file = Path.GetFileNameWithoutExtension(path);
|
|
|
+
|
|
|
+ if (poseSet.Contains(file))
|
|
|
+ continue;
|
|
|
+
|
|
|
+ if (file.StartsWith("edit_"))
|
|
|
+ PoseDict["normal"].Add(file);
|
|
|
+ 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_")
|
|
|
+ && !file.StartsWith("vr_") && !file.StartsWith("dance_mc") && !file.Contains("_kubi_")
|
|
|
+ && !file.Contains("a01_") && !file.Contains("b01_") && !file.Contains("b02_")
|
|
|
+ && !file.EndsWith("_m2") && !file.EndsWith("_m2_once_") && !file.StartsWith("h_")
|
|
|
+ && !file.StartsWith("event_") && !file.StartsWith("man_") && !file.EndsWith("_m")
|
|
|
+ && !file.Contains("_m_") && !file.Contains("_man_")
|
|
|
+ )
|
|
|
+ {
|
|
|
+ if (path.Contains(@"\sex\"))
|
|
|
+ PoseDict["ero2"].Add(file);
|
|
|
+ else
|
|
|
+ PoseDict["normal2"].Add(file);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -416,27 +408,19 @@ public static class Constants
|
|
|
}
|
|
|
|
|
|
InitializeCustomPoses();
|
|
|
- }
|
|
|
|
|
|
- public static void InitializeCustomPoses()
|
|
|
- {
|
|
|
- static void GetPoses(string directory)
|
|
|
+ static void AddDefaultPose()
|
|
|
{
|
|
|
- var poseList = Directory.GetFiles(directory)
|
|
|
- .Where(file => Path.GetExtension(file) is ".anm");
|
|
|
-
|
|
|
- if (poseList.Any())
|
|
|
- {
|
|
|
- var poseGroupName = new DirectoryInfo(directory).Name;
|
|
|
-
|
|
|
- if (poseGroupName != customPoseDirectory)
|
|
|
- CustomPoseGroupList.Add(poseGroupName);
|
|
|
+ if (!PoseDict.ContainsKey("normal"))
|
|
|
+ PoseDict["normal"] = new() { "maid_stand01" };
|
|
|
|
|
|
- CustomPoseDict[poseGroupName] = poseList.ToList();
|
|
|
- CustomPoseDict[poseGroupName].Sort(WindowsLogicalComparer.StrCmpLogicalW);
|
|
|
- }
|
|
|
+ if (!PoseGroupList.Contains("normal"))
|
|
|
+ PoseGroupList.Insert(0, "normal");
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
+ public static void InitializeCustomPoses()
|
|
|
+ {
|
|
|
CustomPoseGroupList.Clear();
|
|
|
CustomPoseDict.Clear();
|
|
|
|
|
@@ -451,26 +435,27 @@ public static class Constants
|
|
|
CustomPoseGroupList.Sort((a, b) => KeepAtTop(a, b, customPoseDirectory));
|
|
|
|
|
|
CustomPoseChange?.Invoke(null, PresetChangeEventArgs.Empty);
|
|
|
- }
|
|
|
|
|
|
- public static void InitializeHandPresets()
|
|
|
- {
|
|
|
- static void GetPresets(string directory)
|
|
|
+ static void GetPoses(string directory)
|
|
|
{
|
|
|
- var presetList = Directory.GetFiles(directory)
|
|
|
- .Where(file => Path.GetExtension(file) is ".xml");
|
|
|
+ var poseList = Directory.GetFiles(directory)
|
|
|
+ .Where(file => Path.GetExtension(file) is ".anm");
|
|
|
|
|
|
- if (presetList.Any())
|
|
|
+ if (poseList.Any())
|
|
|
{
|
|
|
- var presetCategory = new DirectoryInfo(directory).Name;
|
|
|
+ var poseGroupName = new DirectoryInfo(directory).Name;
|
|
|
|
|
|
- if (presetCategory != customHandDirectory)
|
|
|
- CustomHandGroupList.Add(presetCategory);
|
|
|
+ if (poseGroupName != customPoseDirectory)
|
|
|
+ CustomPoseGroupList.Add(poseGroupName);
|
|
|
|
|
|
- CustomHandDict[presetCategory] = presetList.ToList();
|
|
|
- CustomHandDict[presetCategory].Sort(WindowsLogicalComparer.StrCmpLogicalW);
|
|
|
+ CustomPoseDict[poseGroupName] = poseList.ToList();
|
|
|
+ CustomPoseDict[poseGroupName].Sort(WindowsLogicalComparer.StrCmpLogicalW);
|
|
|
}
|
|
|
}
|
|
|
+ }
|
|
|
+
|
|
|
+ public static void InitializeHandPresets()
|
|
|
+ {
|
|
|
|
|
|
CustomHandGroupList.Clear();
|
|
|
CustomHandDict.Clear();
|
|
@@ -486,6 +471,23 @@ public static class Constants
|
|
|
CustomHandGroupList.Sort((a, b) => KeepAtTop(a, b, customHandDirectory));
|
|
|
|
|
|
CustomHandChange?.Invoke(null, PresetChangeEventArgs.Empty);
|
|
|
+
|
|
|
+ static void GetPresets(string directory)
|
|
|
+ {
|
|
|
+ var presetList = Directory.GetFiles(directory)
|
|
|
+ .Where(file => Path.GetExtension(file) is ".xml");
|
|
|
+
|
|
|
+ if (!presetList.Any())
|
|
|
+ return;
|
|
|
+
|
|
|
+ var presetCategory = new DirectoryInfo(directory).Name;
|
|
|
+
|
|
|
+ if (presetCategory != customHandDirectory)
|
|
|
+ CustomHandGroupList.Add(presetCategory);
|
|
|
+
|
|
|
+ CustomHandDict[presetCategory] = presetList.ToList();
|
|
|
+ CustomHandDict[presetCategory].Sort(WindowsLogicalComparer.StrCmpLogicalW);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public static void InitializeFaceBlends()
|
|
@@ -502,6 +504,21 @@ public static class Constants
|
|
|
|
|
|
public static void InitializeCustomFaceBlends()
|
|
|
{
|
|
|
+ CustomFaceGroupList.Clear();
|
|
|
+ CustomFaceDict.Clear();
|
|
|
+
|
|
|
+ CustomFaceGroupList.Add(customFaceDirectory);
|
|
|
+ CustomFaceDict[customFaceDirectory] = new();
|
|
|
+
|
|
|
+ GetFacePresets(customFacePath);
|
|
|
+
|
|
|
+ foreach (var directory in Directory.GetDirectories(customFacePath))
|
|
|
+ GetFacePresets(directory);
|
|
|
+
|
|
|
+ CustomFaceGroupList.Sort((a, b) => KeepAtTop(a, b, customFaceDirectory));
|
|
|
+
|
|
|
+ CustomFaceChange?.Invoke(null, PresetChangeEventArgs.Empty);
|
|
|
+
|
|
|
static void GetFacePresets(string directory)
|
|
|
{
|
|
|
IEnumerable<string> presetList = Directory.GetFiles(directory)
|
|
@@ -518,21 +535,6 @@ public static class Constants
|
|
|
CustomFaceDict[faceGroupName].Sort(WindowsLogicalComparer.StrCmpLogicalW);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- CustomFaceGroupList.Clear();
|
|
|
- CustomFaceDict.Clear();
|
|
|
-
|
|
|
- CustomFaceGroupList.Add(customFaceDirectory);
|
|
|
- CustomFaceDict[customFaceDirectory] = new();
|
|
|
-
|
|
|
- GetFacePresets(customFacePath);
|
|
|
-
|
|
|
- foreach (var directory in Directory.GetDirectories(customFacePath))
|
|
|
- GetFacePresets(directory);
|
|
|
-
|
|
|
- CustomFaceGroupList.Sort((a, b) => KeepAtTop(a, b, customFaceDirectory));
|
|
|
-
|
|
|
- CustomFaceChange?.Invoke(null, PresetChangeEventArgs.Empty);
|
|
|
}
|
|
|
|
|
|
public static void InitializeBGs()
|
|
@@ -543,12 +545,12 @@ public static class Constants
|
|
|
// COM3D2 BGs
|
|
|
foreach (var bgData in PhotoBGData.data)
|
|
|
{
|
|
|
- if (!string.IsNullOrEmpty(bgData.create_prefab_name))
|
|
|
- {
|
|
|
- var bg = bgData.create_prefab_name;
|
|
|
+ if (string.IsNullOrEmpty(bgData.create_prefab_name))
|
|
|
+ continue;
|
|
|
|
|
|
- BGList.Add(bg);
|
|
|
- }
|
|
|
+ var bg = bgData.create_prefab_name;
|
|
|
+
|
|
|
+ BGList.Add(bg);
|
|
|
}
|
|
|
|
|
|
// CM3D2 BGs
|
|
@@ -558,12 +560,12 @@ public static class Constants
|
|
|
|
|
|
for (var cell_y = 1; cell_y < csvParser.max_cell_y; cell_y++)
|
|
|
{
|
|
|
- if (csvParser.IsCellToExistData(3, cell_y))
|
|
|
- {
|
|
|
- var bg = csvParser.GetCellAsString(3, cell_y);
|
|
|
+ if (!csvParser.IsCellToExistData(3, cell_y))
|
|
|
+ continue;
|
|
|
|
|
|
- BGList.Add(bg);
|
|
|
- }
|
|
|
+ var bg = csvParser.GetCellAsString(3, cell_y);
|
|
|
+
|
|
|
+ BGList.Add(bg);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -603,6 +605,7 @@ public static class Constants
|
|
|
if (!PropManager.ModItemsOnly && !MenuFilesReady)
|
|
|
{
|
|
|
Utility.LogMessage("Menu files are not ready yet");
|
|
|
+
|
|
|
return null;
|
|
|
}
|
|
|
|
|
@@ -630,37 +633,39 @@ public static class Constants
|
|
|
|
|
|
selectedList.RemoveAll(item =>
|
|
|
{
|
|
|
- if (item.Icon == null)
|
|
|
+ if (item.Icon != null)
|
|
|
+ return false;
|
|
|
+
|
|
|
+ Texture2D icon;
|
|
|
+ var iconFile = item.IconFile;
|
|
|
+
|
|
|
+ if (string.IsNullOrEmpty(iconFile))
|
|
|
{
|
|
|
- Texture2D icon;
|
|
|
- var iconFile = item.IconFile;
|
|
|
+ Utility.LogWarning($"Could not find icon '{iconFile}' for menu '{item.MenuFile}");
|
|
|
|
|
|
- if (string.IsNullOrEmpty(iconFile))
|
|
|
- {
|
|
|
- Utility.LogWarning($"Could not find icon '{iconFile}' for menu '{item.MenuFile}");
|
|
|
- return true;
|
|
|
- }
|
|
|
+ return true;
|
|
|
+ }
|
|
|
|
|
|
+ try
|
|
|
+ {
|
|
|
+ icon = ImportCM.CreateTexture(iconFile);
|
|
|
+ }
|
|
|
+ catch
|
|
|
+ {
|
|
|
try
|
|
|
{
|
|
|
- icon = ImportCM.CreateTexture(iconFile);
|
|
|
+ icon = ImportCM.CreateTexture($"tex\\{iconFile}");
|
|
|
}
|
|
|
catch
|
|
|
{
|
|
|
- try
|
|
|
- {
|
|
|
- icon = ImportCM.CreateTexture($"tex\\{iconFile}");
|
|
|
- }
|
|
|
- catch
|
|
|
- {
|
|
|
- Utility.LogWarning($"Could not load '{iconFile}' for menu '{item.MenuFile}");
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
+ Utility.LogWarning($"Could not load '{iconFile}' for menu '{item.MenuFile}");
|
|
|
|
|
|
- item.Icon = icon;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
+ item.Icon = icon;
|
|
|
+
|
|
|
return false;
|
|
|
});
|
|
|
}
|
|
@@ -671,11 +676,14 @@ public static class Constants
|
|
|
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"
|
|
|
- });
|
|
|
+ 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"
|
|
|
+ }
|
|
|
+ );
|
|
|
|
|
|
var DoguList = DoguDict[customDoguCategories[DoguCategory.Other]];
|
|
|
|
|
@@ -703,16 +711,16 @@ public static class Constants
|
|
|
|
|
|
foreach (var path in GameUty.FileSystem.GetList("bg", AFileSystemBase.ListType.AllFile))
|
|
|
{
|
|
|
- if (Path.GetExtension(path) is ".asset_bg" && !path.Contains("myroomcustomize"))
|
|
|
- {
|
|
|
- var file = Path.GetFileNameWithoutExtension(path);
|
|
|
+ if (Path.GetExtension(path) is not ".asset_bg" || path.Contains("myroomcustomize"))
|
|
|
+ continue;
|
|
|
|
|
|
- if (!doguHashSet.Contains(file) && !file.EndsWith("_hit"))
|
|
|
- {
|
|
|
- DoguList.Add(file);
|
|
|
- doguHashSet.Add(file);
|
|
|
- }
|
|
|
- }
|
|
|
+ var file = Path.GetFileNameWithoutExtension(path);
|
|
|
+
|
|
|
+ if (doguHashSet.Contains(file) || file.EndsWith("_hit"))
|
|
|
+ continue;
|
|
|
+
|
|
|
+ DoguList.Add(file);
|
|
|
+ doguHashSet.Add(file);
|
|
|
}
|
|
|
|
|
|
// Get cherry picked dogu that I can't find in the game files
|
|
@@ -734,13 +742,13 @@ public static class Constants
|
|
|
|
|
|
foreach (var path in GameUty.FileSystemOld.GetList("bg", AFileSystemBase.ListType.AllFile))
|
|
|
{
|
|
|
- if (Path.GetExtension(path) is ".asset_bg")
|
|
|
- {
|
|
|
- var file = Path.GetFileNameWithoutExtension(path);
|
|
|
+ if (Path.GetExtension(path) is not ".asset_bg")
|
|
|
+ continue;
|
|
|
|
|
|
- if (!doguHashSet.Contains(file) && !file.EndsWith("_not_optimisation"))
|
|
|
- DoguList.Add(file);
|
|
|
- }
|
|
|
+ var file = Path.GetFileNameWithoutExtension(path);
|
|
|
+
|
|
|
+ if (!doguHashSet.Contains(file) && !file.EndsWith("_not_optimisation"))
|
|
|
+ DoguList.Add(file);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -751,6 +759,7 @@ public static class Constants
|
|
|
CsvCommonIdManager.ReadEnabledIdList(
|
|
|
CsvCommonIdManager.FileSystemType.Normal, true, "desk_item_enabled_id", ref enabledIDs
|
|
|
);
|
|
|
+
|
|
|
CsvCommonIdManager.ReadEnabledIdList(
|
|
|
CsvCommonIdManager.FileSystemType.Old, true, "desk_item_enabled_id", ref enabledIDs
|
|
|
);
|
|
@@ -763,23 +772,23 @@ public static class Constants
|
|
|
|
|
|
for (var cell_y = 1; cell_y < csvParser.max_cell_y; cell_y++)
|
|
|
{
|
|
|
- if (csvParser.IsCellToExistData(0, cell_y))
|
|
|
- {
|
|
|
- var cell = csvParser.GetCellAsInteger(0, cell_y);
|
|
|
+ if (!csvParser.IsCellToExistData(0, cell_y))
|
|
|
+ continue;
|
|
|
|
|
|
- if (enabledIDs.Contains(cell))
|
|
|
- {
|
|
|
- var dogu = string.Empty;
|
|
|
+ var cell = csvParser.GetCellAsInteger(0, cell_y);
|
|
|
|
|
|
- if (csvParser.IsCellToExistData(3, cell_y))
|
|
|
- dogu = csvParser.GetCellAsString(3, cell_y);
|
|
|
- else if (csvParser.IsCellToExistData(4, cell_y))
|
|
|
- dogu = csvParser.GetCellAsString(4, cell_y);
|
|
|
+ if (!enabledIDs.Contains(cell))
|
|
|
+ continue;
|
|
|
|
|
|
- if (!string.IsNullOrEmpty(dogu))
|
|
|
- com3d2DeskDogu.Add(dogu);
|
|
|
- }
|
|
|
- }
|
|
|
+ var dogu = string.Empty;
|
|
|
+
|
|
|
+ if (csvParser.IsCellToExistData(3, cell_y))
|
|
|
+ dogu = csvParser.GetCellAsString(3, cell_y);
|
|
|
+ else if (csvParser.IsCellToExistData(4, cell_y))
|
|
|
+ dogu = csvParser.GetCellAsString(4, cell_y);
|
|
|
+
|
|
|
+ if (!string.IsNullOrEmpty(dogu))
|
|
|
+ com3d2DeskDogu.Add(dogu);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -821,10 +830,13 @@ public static class Constants
|
|
|
DoguDict[category].Add(dogu);
|
|
|
}
|
|
|
|
|
|
- DoguDict["パーティクル"].AddRange(new[] {
|
|
|
- "Particle/pLineY", "Particle/pLineP02", "Particle/pHeart01",
|
|
|
- "Particle/pLine_act2", "Particle/pstarY_act2"
|
|
|
- });
|
|
|
+ DoguDict["パーティクル"].AddRange(
|
|
|
+ new[]
|
|
|
+ {
|
|
|
+ "Particle/pLineY", "Particle/pLineP02", "Particle/pHeart01",
|
|
|
+ "Particle/pLine_act2", "Particle/pstarY_act2"
|
|
|
+ }
|
|
|
+ );
|
|
|
}
|
|
|
|
|
|
private static void InitializeHandItems()
|
|
@@ -874,26 +886,26 @@ public static class Constants
|
|
|
{
|
|
|
menuDataBase.SetIndex(i);
|
|
|
|
|
|
- if ((MPN)menuDataBase.GetCategoryMpn() is MPN.handitem)
|
|
|
- {
|
|
|
- var menuFileName = menuDataBase.GetMenuFileName();
|
|
|
+ if ((MPN)menuDataBase.GetCategoryMpn() is not MPN.handitem)
|
|
|
+ continue;
|
|
|
|
|
|
- if (menuDataBase.GetBoDelOnly() || menuFileName.EndsWith("_del.menu"))
|
|
|
- continue;
|
|
|
+ var menuFileName = menuDataBase.GetMenuFileName();
|
|
|
|
|
|
- var handItemAsOdogu = Utility.HandItemToOdogu(menuFileName);
|
|
|
- var isolatedHandItem = menuFileName.Substring(menuFileName.IndexOf('_') + 1);
|
|
|
+ if (menuDataBase.GetBoDelOnly() || menuFileName.EndsWith("_del.menu"))
|
|
|
+ continue;
|
|
|
|
|
|
- if (!doguHashSet.Contains(handItemAsOdogu) && !doguHashSet.Contains(isolatedHandItem))
|
|
|
- {
|
|
|
- doguHashSet.Add(isolatedHandItem);
|
|
|
- DoguDict[category].Add(menuFileName);
|
|
|
+ var handItemAsOdogu = Utility.HandItemToOdogu(menuFileName);
|
|
|
+ var isolatedHandItem = menuFileName.Substring(menuFileName.IndexOf('_') + 1);
|
|
|
|
|
|
- // Check for a half deck of cards to add the full deck as well
|
|
|
- if (menuFileName is "handitemd_cards_i_.menu")
|
|
|
- DoguDict[category].Add("handiteml_cards_i_.menu");
|
|
|
- }
|
|
|
- }
|
|
|
+ if (doguHashSet.Contains(handItemAsOdogu) || doguHashSet.Contains(isolatedHandItem))
|
|
|
+ continue;
|
|
|
+
|
|
|
+ doguHashSet.Add(isolatedHandItem);
|
|
|
+ DoguDict[category].Add(menuFileName);
|
|
|
+
|
|
|
+ // Check for a half deck of cards to add the full deck as well
|
|
|
+ if (menuFileName is "handitemd_cards_i_.menu")
|
|
|
+ DoguDict[category].Add("handiteml_cards_i_.menu");
|
|
|
}
|
|
|
|
|
|
HandItemsInitialized = true;
|
|
@@ -947,14 +959,15 @@ public static class Constants
|
|
|
var myRoomData = PlacementData.GetAllDatas(false);
|
|
|
|
|
|
myRoomData.Sort((a, b) =>
|
|
|
- {
|
|
|
- var res = a.categoryID.CompareTo(b.categoryID);
|
|
|
+ {
|
|
|
+ var res = a.categoryID.CompareTo(b.categoryID);
|
|
|
|
|
|
- if (res is 0)
|
|
|
- res = a.ID.CompareTo(b.ID);
|
|
|
+ if (res is 0)
|
|
|
+ res = a.ID.CompareTo(b.ID);
|
|
|
|
|
|
- return res;
|
|
|
- });
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ );
|
|
|
|
|
|
foreach (var data in myRoomData)
|
|
|
{
|
|
@@ -1030,16 +1043,18 @@ public static class Constants
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- if (fs.IsExistentFile(nei))
|
|
|
- {
|
|
|
- var file = fs.FileOpen(nei);
|
|
|
- var csvParser = new CsvParser();
|
|
|
+ if (!fs.IsExistentFile(nei))
|
|
|
+ return null;
|
|
|
|
|
|
- if (csvParser.Open(file))
|
|
|
- return csvParser;
|
|
|
+ var file = fs.FileOpen(nei);
|
|
|
+ var csvParser = new CsvParser();
|
|
|
|
|
|
- file?.Dispose();
|
|
|
- }
|
|
|
+ if (csvParser.Open(file))
|
|
|
+ return csvParser;
|
|
|
+
|
|
|
+ file?.Dispose();
|
|
|
+
|
|
|
+ return null;
|
|
|
}
|
|
|
catch { }
|
|
|
|