Search the Community
Showing results for tags 'category'.
-
Hello everyone. I'm making my owm mods called Modern Naval Weapon System, in due to too many parts it contains, I would like to give it a Category for itself when people go into the VAB/SHP. How can I know where to start? Or where can I find some references? THX
-
Ok I'm trying to create a custom category module with no success. Could someone please tell me what I'm doing wrong here, as it seems to me it should be working but nothing is happening can't even get the Debug.Log("") to show anything in the log. using KSP.IO; using RUI.Icons.Selectable; using UnityEngine; using static KSP.UI.Screens.PartCategorizer; namespace NextStarIndustries { [KSPAddon(KSPAddon.Startup.EditorAny, false)] public class NSICategoryModule : MonoBehaviour { public void Start() { GameEvents.onGUIEditorToolbarReady.Add(NSICategory); Debug.Log("Category Started"); } private void NSICategory() { //Loading Textures Texture2D unselected = new Texture2D(32, 32); Texture2D selected = new Texture2D(32, 32); Texture2D nuclear = new Texture2D(32, 32); Texture2D conventional = new Texture2D(32, 32); Texture2D rd = new Texture2D(32, 32); Texture2D probe = new Texture2D(32, 32); Texture2D engine = new Texture2D(32, 32); unselected.LoadImage(File.ReadAllBytes<NSICategoryModule>("GameData/BDArmory Weapons Extension/textures/NSIIcon")); selected.LoadImage(File.ReadAllBytes<NSICategoryModule>("GameData/BDArmory Weapons Extension/textures/NSIIconActive")); nuclear.LoadImage(File.ReadAllBytes<NSICategoryModule>("GameData/BDArmory Weapons Extension/textures/NSIIconNW")); conventional.LoadImage(File.ReadAllBytes<NSICategoryModule>("GameData/BDArmory Weapons Extension/textures/NSIIconCW")); rd.LoadImage(File.ReadAllBytes<NSICategoryModule>("GameData/BDArmory Weapons Extension/textures/NSIIconRD")); probe.LoadImage(File.ReadAllBytes<NSICategoryModule>("GameData/Squad/PartList/SimpleIcons/R&D_node_icon_advunmanned")); engine.LoadImage(File.ReadAllBytes<NSICategoryModule>("GameData/Squad/PartList/SimpleIcons/R&D_node_icon_advancedmotors")); Debug.Log("Textures Loaded"); Icon NSIIcon = new Icon("NSI", selected, unselected); //Defining NSIIcon Icon NSIIconNW = new Icon("Nuclear Weapons", nuclear, nuclear); //Defining NSIIconNW Icon NSIIconCW = new Icon("Conventional Weapons", conventional, conventional); //Defining NSIIconCW Icon NSIIconRD = new Icon("R&D Parts", rd, rd); //Defining NSIIconRD Icon NSIIconProbe = new Icon("Probes", probe, probe); //Defining NSIIconProbes Icon NSIIconEngine = new Icon("Engines", engine, engine); //Defining NSIIconEngines Category NSI = AddCustomFilter("Next Star Industries", "NSI", NSIIcon, Color.white); //filters for All NSI Parts, Nuclear Weapons, Conventional Weapons, R&D, Probes, and Engines AddCustomSubcategoryFilter(NSI, "All NSI Parts", "All NSI Parts", NSIIcon, All => All.manufacturer == "Next Star Industries"); AddCustomSubcategoryFilter(NSI, "Nuclear", "Nuclear Weapons", NSIIconNW, NW => NW.description.Contains("Nuclear") && NW.manufacturer == "Next Star Industries"); AddCustomSubcategoryFilter(NSI, "Conventional", "Conventional Weapons", NSIIconCW, CW => CW.description.Contains("Conventional") && CW.manufacturer == "Next Star Industries"); AddCustomSubcategoryFilter(NSI, "R&D", "R&D Parts", NSIIconRD, RD => RD.description.Contains("R&D") && RD.manufacturer == "Next Star Industries"); AddCustomSubcategoryFilter(NSI, "Probes", "NSI Probes", NSIIconProbe, Probe => Probe.description.Contains("Probe") && Probe.manufacturer == "Next Star Industries"); AddCustomSubcategoryFilter(NSI, "Engines", "NSI Engines", NSIIconEngine, Engine => Engine.description.Contains("Engine") && Engine.manufacturer == "Next Start Industries"); } } }