diff --git a/GameData/000_TexturesUnlimited/Plugins/TexturesUnlimited.dll b/GameData/000_TexturesUnlimited/Plugins/TexturesUnlimited.dll index 613df85..cf03b15 100644 Binary files a/GameData/000_TexturesUnlimited/Plugins/TexturesUnlimited.dll and b/GameData/000_TexturesUnlimited/Plugins/TexturesUnlimited.dll differ diff --git a/GameData/000_TexturesUnlimited/TU-Icon.png b/GameData/000_TexturesUnlimited/TU-Icon.png new file mode 100644 index 0000000..f94ac80 Binary files /dev/null and b/GameData/000_TexturesUnlimited/TU-Icon.png differ diff --git a/Plugin/SSTUTools/KSPShaderTools/Addon/TexturesUnlimitedDebug.cs b/Plugin/SSTUTools/KSPShaderTools/Addon/TexturesUnlimitedDebug.cs index 07db512..01546eb 100644 --- a/Plugin/SSTUTools/KSPShaderTools/Addon/TexturesUnlimitedDebug.cs +++ b/Plugin/SSTUTools/KSPShaderTools/Addon/TexturesUnlimitedDebug.cs @@ -20,12 +20,11 @@ public class TexturesUnlimitedDebug : MonoBehaviour public void Awake() { debug = TUGameSettings.Debug; - Texture2D tex; if (debugAppButton == null && debug)//static reference; track if the button was EVER created, as KSP keeps them even if the addon is destroyed { //TODO create an icon for TU debug App-Launcher button //create a new button - tex = GameDatabase.Instance.GetTexture("Squad/PartList/SimpleIcons/RDIcon_fuelSystems-highPerformance", false); + Texture2D tex = GameDatabase.Instance.GetTexture("000_TexturesUnlimited/TU-Icon", false); debugAppButton = ApplicationLauncher.Instance.AddModApplication(debugGuiEnable, debugGuiDisable, null, null, null, null, ApplicationLauncher.AppScenes.FLIGHT | ApplicationLauncher.AppScenes.SPH | ApplicationLauncher.AppScenes.VAB, tex); } else if (debugAppButton != null && debug) @@ -34,7 +33,7 @@ public void Awake() debugAppButton.onTrue = debugGuiEnable; debugAppButton.onFalse = debugGuiDisable; } - else//button not null, but not debug mode; needs to be removed + else if (debugAppButton != null)//button not null, but not debug mode; needs to be removed { ApplicationLauncher.Instance.RemoveModApplication(debugAppButton); } diff --git a/Plugin/SSTUTools/KSPShaderTools/Module/TUPartVariant.cs b/Plugin/SSTUTools/KSPShaderTools/Module/TUPartVariant.cs index 3bdd56e..38b133f 100644 --- a/Plugin/SSTUTools/KSPShaderTools/Module/TUPartVariant.cs +++ b/Plugin/SSTUTools/KSPShaderTools/Module/TUPartVariant.cs @@ -32,6 +32,12 @@ public class TUPartVariant : PartModule, IRecolorable //if setup to interact with stock fairing module [KSPField] public bool stockFairing = false; + + [KSPField] + public int moduleIndex = 0; + + [KSPField] + public string sectionName = "Stock Variant"; private RecoloringData[] customColors; @@ -176,7 +182,18 @@ private void editorDefaultVariantApplied(AvailablePart part, PartVariant variant private TextureSet getSet(PartVariant variant) { - string setName = variant.GetExtraInfoValue("textureSet"); + string keyName = "textureSet"; + //if module index greater than zero, always append index number to the key lookup + if (moduleIndex > 0) + { + keyName = keyName + moduleIndex.ToString(); + } + string setName = variant.GetExtraInfoValue(keyName); + //if module index ==0, and initial name lookup failed, attempt by appending key-name with '0' + if (moduleIndex == 0 && string.IsNullOrEmpty(setName)) + { + setName = variant.GetExtraInfoValue(keyName + "0"); + } TextureSet set = null; if (!string.IsNullOrEmpty(setName)) { @@ -271,7 +288,7 @@ private void applyConfig(Transform root, TextureSet set, bool useSetColors, bool public string[] getSectionNames() { - return new string[] { "Stock Variant" }; + return new string[] { sectionName }; } public RecoloringData[] getSectionColors(string name)