ghorsington 5 years ago
parent
commit
9c28ffa54e

+ 5 - 5
Assembly-CSharp.sln

@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
 # Visual Studio 15
 VisualStudioVersion = 15.0.26228.4
 MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp\Assembly-CSharp.csproj", "{811713BE-54A8-4AB0-8663-1F98FC692F92}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Assembly-CSharp", "Assembly-CSharp\Assembly-CSharp.csproj", "{C63A29C9-1507-4CD4-8417-048311C88A82}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -11,10 +11,10 @@ Global
 		Release|Any CPU = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(ProjectConfigurationPlatforms) = postSolution
-		{811713BE-54A8-4AB0-8663-1F98FC692F92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{811713BE-54A8-4AB0-8663-1F98FC692F92}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{811713BE-54A8-4AB0-8663-1F98FC692F92}.Release|Any CPU.ActiveCfg = Release|Any CPU
-		{811713BE-54A8-4AB0-8663-1F98FC692F92}.Release|Any CPU.Build.0 = Release|Any CPU
+		{C63A29C9-1507-4CD4-8417-048311C88A82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{C63A29C9-1507-4CD4-8417-048311C88A82}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{C63A29C9-1507-4CD4-8417-048311C88A82}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{C63A29C9-1507-4CD4-8417-048311C88A82}.Release|Any CPU.Build.0 = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE

+ 1 - 1
Assembly-CSharp/Assembly-CSharp.csproj

@@ -4,7 +4,7 @@
   <PropertyGroup>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
-    <ProjectGuid>{811713BE-54A8-4AB0-8663-1F98FC692F92}</ProjectGuid>
+    <ProjectGuid>{C63A29C9-1507-4CD4-8417-048311C88A82}</ProjectGuid>
     <OutputType>Library</OutputType>
     <RootNamespace>Assembly-CSharp</RootNamespace>
     <AssemblyName>Assembly-CSharp</AssemblyName>

+ 4 - 1
Assembly-CSharp/EditItemTextureCache.cs

@@ -49,7 +49,10 @@ public class EditItemTextureCache : MonoBehaviour
 		Texture2D texture2D = null;
 		if (!this.loadTex.TryGetValue(rid, out texture2D))
 		{
-			texture2D = ImportCM.CreateTexture((!this.IsRegister(rid)) ? "notex.tex" : this.ridToFileNameDic[rid]);
+			if (this.IsRegister(rid))
+			{
+				texture2D = ImportCM.CreateTexture(this.ridToFileNameDic[rid]);
+			}
 			this.loadTex.Add(rid, texture2D);
 		}
 		return texture2D;

+ 171 - 57
Assembly-CSharp/EditMod.cs

@@ -159,24 +159,32 @@ public class EditMod : MonoBehaviour
 							value = array2[1];
 							string text5 = Path.GetDirectoryName(f_strModMenu) + "\\";
 							text5 += array2[1];
-							FileStream fileStream2 = new FileStream(text5, FileMode.Open);
-							if (fileStream2 == null)
+							try
 							{
-								NUty.WinMessageBox(NUty.GetWindowHandle(), "アイコンファイルが開けません。\n" + text5, "MOD Compile Error", 0);
-								return false;
+								FileStream fileStream2 = new FileStream(text5, FileMode.Open);
+								if (fileStream2 == null)
+								{
+									NUty.WinMessageBox(NUty.GetWindowHandle(), "アイコンファイルが開けません。\n" + text5, "MOD Compile Error", 0);
+									return false;
+								}
+								byte[] array3 = new byte[fileStream2.Length];
+								fileStream2.Read(array3, 0, (int)fileStream2.Length);
+								if (!dictionary.ContainsKey(array2[1].ToLower()))
+								{
+									dictionary.Add(array2[1].ToLower(), new EditMod.TexSet
+									{
+										nSize = (int)fileStream2.Length,
+										byData = array3
+									});
+								}
+								fileStream2.Close();
+								fileStream2.Dispose();
 							}
-							byte[] array3 = new byte[fileStream2.Length];
-							fileStream2.Read(array3, 0, (int)fileStream2.Length);
-							if (!dictionary.ContainsKey(array2[1].ToLower()))
+							catch (Exception ex2)
 							{
-								dictionary.Add(array2[1].ToLower(), new EditMod.TexSet
-								{
-									nSize = (int)fileStream2.Length,
-									byData = array3
-								});
+								NDebug.MessageBox("指定のアイコンファイルが見つかりませんでした。\n" + array2[1], "MOD Compile Error");
+								return false;
 							}
-							fileStream2.Close();
-							fileStream2.Dispose();
 						}
 						else if (array2[0] == "色セット")
 						{
@@ -191,66 +199,96 @@ public class EditMod : MonoBehaviour
 							array2[2] = array2[2].ToLower();
 							string text6 = Path.GetDirectoryName(f_strModMenu) + "\\";
 							text6 += array2[2];
-							FileStream fileStream3 = new FileStream(text6, FileMode.Open);
-							if (fileStream3 == null)
+							try
 							{
-								NUty.WinMessageBox(NUty.GetWindowHandle(), "テクスチャが開けません。\n" + text6, "MOD Compile Error", 0);
-								return false;
+								FileStream fileStream3 = new FileStream(text6, FileMode.Open);
+								if (fileStream3 == null)
+								{
+									NUty.WinMessageBox(NUty.GetWindowHandle(), "テクスチャが開けません。\n" + text6, "MOD Compile Error", 0);
+									return false;
+								}
+								byte[] array4 = new byte[fileStream3.Length];
+								fileStream3.Read(array4, 0, (int)fileStream3.Length);
+								if (!dictionary.ContainsKey(array2[2].ToLower()))
+								{
+									dictionary.Add(array2[2].ToLower(), new EditMod.TexSet
+									{
+										nSize = (int)fileStream3.Length,
+										byData = array4
+									});
+								}
+								fileStream3.Close();
+								fileStream3.Dispose();
 							}
-							byte[] array4 = new byte[fileStream3.Length];
-							fileStream3.Read(array4, 0, (int)fileStream3.Length);
-							if (!dictionary.ContainsKey(array2[2].ToLower()))
+							catch (Exception ex3)
 							{
-								dictionary.Add(array2[2].ToLower(), new EditMod.TexSet
+								array2[2] = Path.ChangeExtension(array2[2], ".tex");
+								string text7 = array2[2].ToLower();
+								if (!dictionary.ContainsKey(text7))
 								{
-									nSize = (int)fileStream3.Length,
-									byData = array4
-								});
+									dictionary.Add(text7, new EditMod.TexSet
+									{
+										nSize = EditMod.dummyImg.Length,
+										byData = EditMod.dummyImg
+									});
+									Debug.Log("画像ファイルが付近に見つからなかったので、内部のファイルシステムから呼び出すことにします。" + text7);
+								}
 							}
-							fileStream3.Close();
-							fileStream3.Dispose();
 						}
 						else if (array2[0] == "テクスチャ変更")
 						{
-							string text7 = array2[4].ToLower();
-							string text8 = Path.GetDirectoryName(f_strModMenu) + "\\";
+							string text8 = array2[4].ToLower();
+							string text9 = Path.GetDirectoryName(f_strModMenu) + "\\";
 							string[] array5;
-							if (text7.Contains("*"))
+							if (text8.Contains("*"))
 							{
-								array5 = Directory.GetFiles(text8, text7, SearchOption.AllDirectories);
+								array5 = Directory.GetFiles(text9, text8, SearchOption.AllDirectories);
 							}
 							else
 							{
 								array5 = new string[]
 								{
-									text8 + text7
+									text9 + text8
 								};
 							}
-							foreach (string text9 in array5)
+							foreach (string text10 in array5)
 							{
-								if (!File.Exists(text9))
+								try
 								{
-									NUty.WinMessageBox(NUty.GetWindowHandle(), "テクスチャが見つかりません。\n" + text9, "MOD Compile Error", 0);
-									return false;
-								}
-								FileStream fileStream4 = new FileStream(text9, FileMode.Open);
-								if (fileStream4 == null)
-								{
-									NUty.WinMessageBox(NUty.GetWindowHandle(), "テクスチャが開けません。\n" + text9, "MOD Compile Error", 0);
-									return false;
+									FileStream fileStream4 = new FileStream(text10, FileMode.Open);
+									if (fileStream4 == null)
+									{
+										NUty.WinMessageBox(NUty.GetWindowHandle(), "テクスチャが開けません。\n" + text10, "MOD Compile Error", 0);
+										return false;
+									}
+									byte[] array7 = new byte[fileStream4.Length];
+									fileStream4.Read(array7, 0, (int)fileStream4.Length);
+									if (!dictionary.ContainsKey(Path.GetFileName(text10).ToLower()))
+									{
+										dictionary.Add(Path.GetFileName(text10).ToLower(), new EditMod.TexSet
+										{
+											nSize = (int)fileStream4.Length,
+											byData = array7
+										});
+									}
+									fileStream4.Close();
+									fileStream4.Dispose();
 								}
-								byte[] array7 = new byte[fileStream4.Length];
-								fileStream4.Read(array7, 0, (int)fileStream4.Length);
-								if (!dictionary.ContainsKey(Path.GetFileName(text9).ToLower()))
+								catch (Exception ex4)
 								{
-									dictionary.Add(Path.GetFileName(text9).ToLower(), new EditMod.TexSet
+									string path = Path.GetFileName(text10);
+									path = Path.ChangeExtension(path, ".tex");
+									string text11 = text8.ToLower();
+									if (!dictionary.ContainsKey(text11))
 									{
-										nSize = (int)fileStream4.Length,
-										byData = array7
-									});
+										dictionary.Add(text11, new EditMod.TexSet
+										{
+											nSize = EditMod.dummyImg.Length,
+											byData = EditMod.dummyImg
+										});
+										Debug.Log("画像ファイルが付近に見つからなかったので、内部のファイルシステムから呼び出すことにします。" + text11);
+									}
 								}
-								fileStream4.Close();
-								fileStream4.Dispose();
 							}
 						}
 						foreach (string str in array2)
@@ -288,15 +326,15 @@ public class EditMod : MonoBehaviour
 			binaryWriter.Write(keyValuePair.Value.byData.Length);
 			binaryWriter.Write(keyValuePair.Value.byData);
 		}
-		string text10 = Path.GetDirectoryName(f_strModMenu) + "\\_compiled\\";
-		Directory.CreateDirectory(text10);
-		text10 += Path.GetFileNameWithoutExtension(f_strModMenu);
-		text10 += ".mod";
-		File.WriteAllBytes(text10, memoryStream.ToArray());
+		string text12 = Path.GetDirectoryName(f_strModMenu) + "\\_compiled\\";
+		Directory.CreateDirectory(text12);
+		text12 += Path.GetFileNameWithoutExtension(f_strModMenu);
+		text12 += ".mod";
+		File.WriteAllBytes(text12, memoryStream.ToArray());
 		memoryStream.Close();
 		memoryStream.Dispose();
 		memoryStream = null;
-		NUty.WinMessageBox(NUty.GetWindowHandle(), "MODコンパイル完了\n" + text10, "MOD Compile Completed", 0);
+		NUty.WinMessageBox(NUty.GetWindowHandle(), "MODコンパイル完了\n" + text12, "MOD Compile Completed", 0);
 		return true;
 	}
 
@@ -340,6 +378,82 @@ public class EditMod : MonoBehaviour
 
 	private string m_strOutFileName = string.Empty;
 
+	public static readonly byte[] dummyImg = new byte[]
+	{
+		137,
+		80,
+		78,
+		71,
+		13,
+		10,
+		26,
+		10,
+		0,
+		0,
+		0,
+		13,
+		73,
+		72,
+		68,
+		82,
+		0,
+		0,
+		0,
+		1,
+		0,
+		0,
+		0,
+		1,
+		8,
+		2,
+		0,
+		0,
+		0,
+		144,
+		119,
+		83,
+		222,
+		0,
+		0,
+		0,
+		12,
+		73,
+		68,
+		65,
+		84,
+		8,
+		153,
+		99,
+		248,
+		byte.MaxValue,
+		byte.MaxValue,
+		63,
+		0,
+		5,
+		254,
+		2,
+		254,
+		88,
+		242,
+		107,
+		14,
+		0,
+		0,
+		0,
+		0,
+		73,
+		69,
+		78,
+		68,
+		174,
+		66,
+		96,
+		130,
+		110,
+		101,
+		105
+	};
+
 	private bool bPush;
 
 	private enum MOD_MODE

+ 8 - 2
Assembly-CSharp/Maid.cs

@@ -901,7 +901,8 @@ public class Maid : MonoBehaviour
 							MPN.eye_hi_r,
 							MPN.eyewhite,
 							MPN.nose,
-							MPN.facegloss
+							MPN.facegloss,
+							MPN.lip
 						};
 						foreach (MPN mpn in array)
 						{
@@ -935,6 +936,8 @@ public class Maid : MonoBehaviour
 							}
 						}
 						this.GetProp(MPN.lip).boDut = true;
+						this.GetProp(MPN.nose).boDut = true;
+						this.GetProp(MPN.facegloss).boDut = true;
 					}
 					break;
 				}
@@ -1040,7 +1043,8 @@ public class Maid : MonoBehaviour
 							MPN.eye_hi_r,
 							MPN.eyewhite,
 							MPN.nose,
-							MPN.facegloss
+							MPN.facegloss,
+							MPN.lip
 						};
 						foreach (MPN mpn in array)
 						{
@@ -1074,6 +1078,8 @@ public class Maid : MonoBehaviour
 							}
 						}
 						this.GetProp(MPN.lip).boDut = true;
+						this.GetProp(MPN.nose).boDut = true;
+						this.GetProp(MPN.facegloss).boDut = true;
 					}
 				}
 			}

+ 4 - 4
Assembly-CSharp/Menu.cs

@@ -1325,10 +1325,10 @@ public class Menu : MonoBehaviour
 			string slotname = string.Empty;
 			TBodySkin tbodySkin = null;
 			Material material = null;
+			int num3 = 0;
 			string text9;
 			while ((text9 = stringReader.ReadLine()) != null)
 			{
-				int num3 = 0;
 				string[] array = text9.Split(new char[]
 				{
 					'\t',
@@ -1403,12 +1403,12 @@ public class Menu : MonoBehaviour
 							NDebug.Assert("無限色IDがありません。" + text10, false);
 						}
 					}
-					num3 = int.Parse(array[2]);
+					int matno = int.Parse(array[2]);
 					if (mp != null && mp.idx == 61)
 					{
-						num3 = 7;
+						matno = 7;
 					}
-					maid.body0.ChangeTex(array[1], num3, array[3], array[4].ToLower(), dictionary, parts_COLOR);
+					maid.body0.ChangeTex(array[1], matno, array[3], array[4].ToLower(), dictionary, parts_COLOR);
 					if (parts_COLOR != MaidParts.PARTS_COLOR.NONE)
 					{
 						maid.Parts.SetPartsColor(parts_COLOR, maid.Parts.GetPartsColor(parts_COLOR));

+ 1 - 0
Assembly-CSharp/SceneNPCEdit/EditCharacterDatabase.cs

@@ -153,6 +153,7 @@ namespace SceneNPCEdit
 						if (!string.IsNullOrEmpty(cellAsString3))
 						{
 							List<CharacterMgr.NpcData> list = new List<CharacterMgr.NpcData>();
+							list.Add(this.npcData);
 							foreach (string text in cellAsString3.Split(new char[]
 							{
 								'|'

+ 11 - 3
Assembly-CSharp/TBody.cs

@@ -1044,7 +1044,15 @@ public class TBody : MonoBehaviour
 				Debug.LogError("MOD:テクスチャの変更:" + filename + "は見つかりませんでした。");
 				return;
 			}
-			textureResource = new TextureResource(2, 2, TextureFormat.ARGB32, null, dicModTexData[filename]);
+			byte[] array = dicModTexData[filename];
+			if (array.Length == EditMod.dummyImg.Length && array[EditMod.dummyImg.Length - 1] == 105 && array[EditMod.dummyImg.Length - 2] == 101 && array[EditMod.dummyImg.Length - 3] == 110)
+			{
+				textureResource = ImportCM.LoadTexture(GameUty.FileSystem, filename, false);
+			}
+			else
+			{
+				textureResource = new TextureResource(2, 2, TextureFormat.ARGB32, null, array);
+			}
 		}
 		else
 		{
@@ -1068,7 +1076,7 @@ public class TBody : MonoBehaviour
 					catch (Exception ex)
 					{
 						NDebug.Assert("テクスチャの変更に失敗しました。以前のテクスチャを破棄できませんでした。" + ex.Message, false);
-						goto IL_4AE;
+						goto IL_513;
 					}
 					this.MulTexRemove(slotname, matno, prop_name, -1);
 					if (texture == null)
@@ -1142,7 +1150,7 @@ public class TBody : MonoBehaviour
 					}), false);
 				}
 			}
-			IL_4AE:;
+			IL_513:;
 		}
 	}