From 567d5350b9da5b2cf5b3f856dcd0bd8bbfe1d183 Mon Sep 17 00:00:00 2001 From: nomeu Date: Sun, 12 May 2013 16:43:04 +0900 Subject: [PATCH] refactor. rename vars. --- FormMaterial.cs | 8 ++++---- TSOGenerator.cs | 28 ++++++++++++++-------------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/FormMaterial.cs b/FormMaterial.cs index 946e569..65e7b01 100644 --- a/FormMaterial.cs +++ b/FormMaterial.cs @@ -25,8 +25,8 @@ namespace Tso2MqoGui { ListViewItem item = lvMaterials.Items.Add(mat_info.Name); item.Tag = mat_info; - item.SubItems.Add(mat_info.DiffuseTexture ?? ""); - item.SubItems.Add(mat_info.ShadowTexture ?? ""); + item.SubItems.Add(mat_info.ColorTexture ?? ""); + item.SubItems.Add(mat_info.ShadeTexture ?? ""); item.SubItems.Add(mat_info.ShaderFile ?? ""); } } @@ -90,10 +90,10 @@ namespace Tso2MqoGui switch (e.ChangedItem.PropertyDescriptor.Name) { - case "DiffuseTexture": + case "ColorTexture": item.SubItems[1].Text = e.ChangedItem.Value.ToString(); break; - case "ShadowTexture": + case "ShadeTexture": item.SubItems[2].Text = e.ChangedItem.Value.ToString(); break; case "ShaderFile": diff --git a/TSOGenerator.cs b/TSOGenerator.cs index d7e378c..f250162 100644 --- a/TSOGenerator.cs +++ b/TSOGenerator.cs @@ -83,15 +83,15 @@ namespace Tso2MqoGui foreach (MaterialInfo i in materials.Values) { - string name = Path.GetFileNameWithoutExtension(i.DiffuseTexture); + string name = Path.GetFileNameWithoutExtension(i.ColorTexture); if (!textures.ContainsKey(name)) - textures.Add(name, new TextureInfo(name, i.DiffuseTexture)); + textures.Add(name, new TextureInfo(name, i.ColorTexture)); - name = Path.GetFileNameWithoutExtension(i.ShadowTexture); + name = Path.GetFileNameWithoutExtension(i.ShadeTexture); if (!textures.ContainsKey(name)) - textures.Add(name, new TextureInfo(name, i.ShadowTexture)); + textures.Add(name, new TextureInfo(name, i.ShadeTexture)); } return true; @@ -799,14 +799,14 @@ namespace Tso2MqoGui { string name; string shader; - string diffuse; - string shadow; + string color_tex; + string shade_tex; //public Dictionary parameters; public MaterialInfo(string path, MqoMaterial mat, ImportMaterialInfo import_mat_info) { name = mat.name; - diffuse = mat.tex; + color_tex = mat.tex; if (import_mat_info != null) { @@ -820,7 +820,7 @@ namespace Tso2MqoGui file = Path.Combine(path, import_mat_info.ShadeTex.File); if (File.Exists(file)) - shadow = file; + shade_tex = file; } } } @@ -830,8 +830,8 @@ namespace Tso2MqoGui get { return File.Exists(shader) - && File.Exists(diffuse) - && File.Exists(shadow); + && File.Exists(color_tex) + && File.Exists(shade_tex); } } @@ -840,8 +840,8 @@ namespace Tso2MqoGui TSOMaterialCode code = TSOMaterialCode.GenerateFromFile(shader); List line = new List(); - code.SetValue("ColorTex", Path.GetFileNameWithoutExtension(diffuse)); - code.SetValue("ShadeTex", Path.GetFileNameWithoutExtension(shadow)); + code.SetValue("ColorTex", Path.GetFileNameWithoutExtension(color_tex)); + code.SetValue("ShadeTex", Path.GetFileNameWithoutExtension(shade_tex)); foreach (KeyValuePair i in code) line.Add(i.Value.ToString()); @@ -857,10 +857,10 @@ namespace Tso2MqoGui [Editor(typeof(FileNameEditor), typeof(UITypeEditor))] [DisplayNameAttribute("テクスチャ:カラー")] - public string DiffuseTexture { get { return diffuse; } set { diffuse = value; } } + public string ColorTexture { get { return color_tex; } set { color_tex = value; } } [Editor(typeof(FileNameEditor), typeof(UITypeEditor))] [DisplayNameAttribute("テクスチャ:シェーティング")] - public string ShadowTexture { get { return shadow; } set { shadow = value; } } + public string ShadeTexture { get { return shade_tex; } set { shade_tex = value; } } } } \ No newline at end of file -- 2.11.0