Exemple #1
0
        public void OnGUI()
        {
            //Window ID's - Doesn't include "random" offset.
            //Connection window: 6702
            //Status window: 6703
            //Chat window: 6704
            //Debug window: 6705
            //Mod windw: 6706
            //Craft library window: 6707
            //Craft upload window: 6708
            //Screenshot window: 6710
            //Options window: 6711
            //Converter window: 6712
            //Disclaimer window: 6713
            long startClock = Profiler.DMPReferenceTime.ElapsedTicks;

            if (showGUI)
            {
                if (connectionWindow != null)
                {
                    connectionWindow.Draw();
                }
                if (modWindow != null)
                {
                    modWindow.Draw();
                }
                if (optionsWindow != null)
                {
                    optionsWindow.Draw();
                }
                if (universeConverterWindow != null)
                {
                    universeConverterWindow.Draw();
                }
                if (dmpGame != null)
                {
                    foreach (Action drawAction in dmpGame.drawEvent)
                    {
#if !DEBUG
                        try
                        {
#endif
                        // Don't hide the connectionWindow if we disabled DMP GUI
                        if (toolbarShowGUI || (!toolbarShowGUI && drawAction.Target.ToString() == "DarkMultiPlayer.connectionWindow"))
                        {
                            drawAction();
                        }
#if !DEBUG
                    }
                    catch (Exception e)
                    {
                        DarkLog.Debug("Threw in OnGUI event, exception: " + e);
                    }
#endif
                    }
                }
            }
            Profiler.guiData.ReportTime(startClock);
        }
Exemple #2
0
        public void OnGUI()
        {
            profiler.Report("KSP", kspTime, kspMemory);
            long profilerStartTime   = profiler.GetCurrentTime;
            long profilerStartMemory = profiler.GetCurrentMemory;

            //Window ID's - Doesn't include "random" offset.
            //Connection window: 6702
            //Status window: 6703
            //Chat window: 6704
            //Debug window: 6705
            //Mod windw: 6706
            //Craft library window: 6707
            //Craft upload window: 6708
            //Screenshot window: 6710
            //Options window: 6711
            //Converter window: 6712
            //Disclaimer window: 6713
            if (showGUI)
            {
                if (connectionWindow != null)
                {
                    connectionWindow.Draw();
                }
                if (modWindow != null)
                {
                    modWindow.Draw();
                }
                if (optionsWindow != null)
                {
                    optionsWindow.Draw();
                }
                if (serversWindow != null)
                {
                    serversWindow.Draw();
                }
                if (universeConverterWindow != null)
                {
                    universeConverterWindow.Draw();
                }
                if (dmpGame != null)
                {
                    foreach (NamedAction drawAction in dmpGame.drawEvent)
                    {
#if !DEBUG
                        try
                        {
#endif
                        // Don't hide the connectionWindow if we disabled DMP GUI
                        if (toolbarShowGUI || (!toolbarShowGUI && drawAction.name == "DarkMultiPlayer.ConnectionWindow.Draw"))
                        {
                            drawAction.action();
                        }
#if !DEBUG
                    }
                    catch (Exception e)
                    {
                        DarkLog.Debug("Threw in OnGUI event, exception: " + e);
                    }
#endif
                    }
                }
            }
            profiler.Report("Draw", profilerStartTime, profilerStartMemory);
            kspTime   = profiler.GetCurrentTime;
            kspMemory = profiler.GetCurrentMemory;
        }