Пример #1
0
        protected void OnGUI()
        {
            string             resourcename = FNResourceManager.FNRESOURCE_MEGAJOULES;
            Vessel             vessel       = FlightGlobals.ActiveVessel;
            ORSResourceManager mega_manager = null;

            if (vessel != null)
            {
                if (FNResourceOvermanager.getResourceOvermanagerForResource(resourcename).hasManagerForVessel(vessel) && !hide_button)
                {
                    mega_manager = FNResourceOvermanager.getResourceOvermanagerForResource(resourcename).getManagerForVessel(vessel);
                    if (mega_manager.getPartModule() != null)
                    {
                        mega_manager.OnGUI();

                        GUILayout.BeginArea(button_position);
                        if (GUILayout.Button(guibuttontexture))
                        {
                            mega_manager.showWindow();
                        }
                        GUILayout.EndArea();
                    }
                }
            }
        }
        protected void OnGUI()
        {
            string             resourcename = FNResourceManager.FNRESOURCE_MEGAJOULES;
            Vessel             vessel       = FlightGlobals.ActiveVessel;
            ORSResourceManager mega_manager = null;

            if (vessel == null)
            {
                return;
            }


            if (FNResourceOvermanager.getResourceOvermanagerForResource(resourcename).hasManagerForVessel(vessel) && !hide_button)
            {
                mega_manager = FNResourceOvermanager.getResourceOvermanagerForResource(resourcename).getManagerForVessel(vessel);
                if (mega_manager.getPartModule() != null)
                {
                    mega_manager.OnGUI();

                    if (show_window)
                    {
                        mega_manager.showWindow();
                    }
                }
            }
        }
 public static new FNResourceOvermanager getResourceOvermanagerForResource(String resource_name) {
     FNResourceOvermanager fnro;
     //Debug.Log("getResourceOvermanager");
     if (ORSResourceOvermanager.resources_managers.ContainsKey(resource_name)) {
         fnro = (FNResourceOvermanager) ORSResourceOvermanager.resources_managers[resource_name];
     } else {
         fnro = new FNResourceOvermanager(resource_name);
         ORSResourceOvermanager.resources_managers.Add(resource_name, fnro);
     }
     return fnro;
 }
 public static FNResourceOvermanager getResourceOvermanagerForResource(String resource_name)
 {
     FNResourceOvermanager fnro;
     if (resources_managers.ContainsKey(resource_name)) {
         fnro = resources_managers[resource_name];
     }
     else {
         fnro = new FNResourceOvermanager(resource_name);
         resources_managers.Add(resource_name,fnro);
     }
     return fnro;
 }
Пример #5
0
        public static new FNResourceOvermanager getResourceOvermanagerForResource(String resource_name)
        {
            FNResourceOvermanager fnro;

            //Debug.Log("getResourceOvermanager");
            if (ORSResourceOvermanager.resources_managers.ContainsKey(resource_name))
            {
                fnro = (FNResourceOvermanager)ORSResourceOvermanager.resources_managers[resource_name];
            }
            else
            {
                fnro = new FNResourceOvermanager(resource_name);
                ORSResourceOvermanager.resources_managers.Add(resource_name, fnro);
            }
            return(fnro);
        }
        public static new FNResourceOvermanager getResourceOvermanagerForResource(String resource_name)
        {
            FNResourceOvermanager  fnro;
            ORSResourceOvermanager orsResourcManager;

            if (!ORSResourceOvermanager.resources_managers.TryGetValue(resource_name, out orsResourcManager))
            {
                fnro = new FNResourceOvermanager(resource_name);
                ORSResourceOvermanager.resources_managers.Add(resource_name, fnro);
            }
            else
            {
                fnro = (FNResourceOvermanager)orsResourcManager;
            }

            return(fnro);
        }
 protected override ORSResourceOvermanager getOvermanagerForResource(string resourcename)
 {
     return(FNResourceOvermanager.getResourceOvermanagerForResource(resourcename));
 }
Пример #8
0
        protected void OnGUI()
        {
            Vessel vessel = FlightGlobals.ActiveVessel;

            if (vessel == null)
            {
                return;
            }

            if (FNResourceOvermanager.getResourceOvermanagerForResource(FNResourceManager.FNRESOURCE_MEGAJOULES).hasManagerForVessel(vessel) && !hide_button)
            {
                ORSResourceManager mega_manager = FNResourceOvermanager.getResourceOvermanagerForResource(FNResourceManager.FNRESOURCE_MEGAJOULES).getManagerForVessel(vessel);
                if (mega_manager != null && mega_manager.PartModule != null)
                {
                    // activate rendering
                    if (show_window)
                    {
                        mega_manager.showWindow();
                    }

                    // show window
                    mega_manager.OnGUI();
                }
            }

            if (FNResourceOvermanager.getResourceOvermanagerForResource(FNResourceManager.FNRESOURCE_THERMALPOWER).hasManagerForVessel(vessel) && !hide_button)
            {
                ORSResourceManager thermal_manager = FNResourceOvermanager.getResourceOvermanagerForResource(FNResourceManager.FNRESOURCE_THERMALPOWER).getManagerForVessel(vessel);
                if (thermal_manager != null && thermal_manager.PartModule != null)
                {
                    // activate rendering
                    if (show_window)
                    {
                        thermal_manager.showWindow();
                    }

                    // show window
                    thermal_manager.OnGUI();
                }
            }

            if (FNResourceOvermanager.getResourceOvermanagerForResource(FNResourceManager.FNRESOURCE_CHARGED_PARTICLES).hasManagerForVessel(vessel) && !hide_button)
            {
                ORSResourceManager charged_manager = FNResourceOvermanager.getResourceOvermanagerForResource(FNResourceManager.FNRESOURCE_CHARGED_PARTICLES).getManagerForVessel(vessel);
                if (charged_manager != null && charged_manager.PartModule != null)
                {
                    // activate rendering
                    if (show_window)
                    {
                        charged_manager.showWindow();
                    }

                    // show window
                    charged_manager.OnGUI();
                }
            }

            if (FNResourceOvermanager.getResourceOvermanagerForResource(FNResourceManager.FNRESOURCE_WASTEHEAT).hasManagerForVessel(vessel) && !hide_button)
            {
                ORSResourceManager waste_manager = FNResourceOvermanager.getResourceOvermanagerForResource(FNResourceManager.FNRESOURCE_WASTEHEAT).getManagerForVessel(vessel);
                if (waste_manager != null && waste_manager.PartModule != null)
                {
                    // activate rendering
                    if (show_window)
                    {
                        waste_manager.showWindow();
                    }

                    // show window
                    waste_manager.OnGUI();
                }
            }

            show_window = false;
        }