コード例 #1
0
 protected override void ResetState()
 {
     programSystem = null;
 }
コード例 #2
0
    void DoMyWindow(int WindowID)
    {
        GUI.DragWindow(new Rect(1, 1, 395, 21));

        if (CompactMode == true)
        {
            CompactModeName = " - Compact";
        }
        else
        {
            CompactModeName = " - Normal";
        }

        if (CloseButton.Contains(Event.current.mousePosition))
        {
            if (GUI.Button(new Rect(CloseButton), "X", com.Skin[GameControl.control.GUIID].customStyles[0]))
            {
                this.enabled = false;
            }
        }
        else
        {
            GUI.backgroundColor = com.colors[Customize.cust.ButtonColorInt];
            GUI.contentColor    = com.colors[Customize.cust.FontColorInt];
            if (GUI.Button(new Rect(CloseButton), "X", com.Skin[GameControl.control.GUIID].customStyles[1]))
            {
                this.enabled = false;
            }
        }

        GUI.backgroundColor = com.colors[Customize.cust.ButtonColorInt];
        GUI.contentColor    = com.colors[Customize.cust.FontColorInt];

        if (MiniButton.Contains(Event.current.mousePosition))
        {
            if (CompactMode == true)
            {
                if (GUI.Button(new Rect(MiniButton), "-", com.Skin[GameControl.control.GUIID].customStyles[2]))
                {
                    minimize = !minimize;
                    Minimize();
                }
            }
            else
            {
                if (GUI.Button(new Rect(MiniButton), "-", com.Skin[GameControl.control.GUIID].customStyles[2]))
                {
                    minimize = !minimize;
                    Minimize();
                }
            }
        }
        else
        {
            if (GUI.Button(new Rect(MiniButton), "-", com.Skin[GameControl.control.GUIID].customStyles[2]))
            {
                minimize = !minimize;
                Minimize();
            }
        }

        if (CompactMode)
        {
            GUI.Box(new Rect(2, 2, 141, 21), "Application Manager");
        }
        else
        {
            GUI.Box(new Rect(1, 1, 395, 21), "Application Manager" + Title);
        }

        GUI.contentColor = Color.white;
        if (GUI.Button(new Rect(SettingsButton), Pics[3]))
        {
            Title = " - Settings";
            CloseAllMainMenus();
            showSettings = true;
        }

        GUI.contentColor = com.colors[Customize.cust.FontColorInt];

        MenuSystem();

        if (showPerformance == true)
        {
            GUI.Button(new Rect(2, 50, 40, 40), Pics[1]);
            GUI.Button(new Rect(2, 100, 40, 40), Pics[2]);
            //GUI.Button (new Rect (2, 50, 60, 20),"Memory");
            //GUI.Button (new Rect (2, 50, 60, 20),"GPU");
            //GUI.Button (new Rect (2, 50, 60, 20),"Disk");
            //GUI.Button (new Rect (2, 50, 60, 20),"Network");

            //			scrollpos = GUI.BeginScrollView(new Rect(2, 71, 500, 100), scrollpos, new Rect(0, 0, 0, scrollsize * 20));
            //			for (scrollsize = 0; scrollsize < RunningApplications.Count; scrollsize++)
            //			{
            //				//GUI.Button (new Rect (2, scrollsize * 20, 20, 20),"" + scrollsize);
            //				GUI.Button (new Rect (0, scrollsize * 20, 150, 20), RunningApplications [scrollsize]);
            //				GUI.Button (new Rect (151, scrollsize * 20, 60, 20),"" + CPU [scrollsize]);
            //				GUI.Button (new Rect (212, scrollsize * 20, 60, 20),"" + Memory [scrollsize]);
            //				GUI.Button (new Rect (273, scrollsize * 20, 60, 20),"" + Graphics [scrollsize]);
            //				GUI.Button (new Rect (334, scrollsize * 20, 60, 20),"" + Disk [scrollsize]);
            //				GUI.Button (new Rect (395, scrollsize * 20, 60, 20),"" + Network [scrollsize]);
            //			}
            //			GUI.EndScrollView();
        }

        if (ShowApplications == true)
        {
            GUI.Button(new Rect(1, 42 + 2, 150, 20), "Application Name");
            GUI.Button(new Rect(152, 42 + 2, 60, 20), "CPU");
            GUI.Button(new Rect(213, 42 + 2, 60, 20), "Memory");
            GUI.Button(new Rect(274, 42 + 2, 60, 20), "GPU");
            GUI.Button(new Rect(335, 42 + 2, 60, 20), "Disk");
            GUI.Button(new Rect(396, 42 + 2, 66, 20), "Network");

            scrollpos = GUI.BeginScrollView(new Rect(1, 65 + 0, 500, 125), scrollpos, new Rect(0, 0, 0, scrollsize * 21));
            for (scrollsize = 0; scrollsize < RunningApplications.Count; scrollsize++)
            {
                //GUI.Button (new Rect (2, scrollsize * 20, 20, 20),"" + scrollsize);
                if (GUI.Button(new Rect(0, scrollsize * 21, 150, 20), RunningApplications[scrollsize]))
                {
                    if (Input.GetMouseButtonUp(0))
                    {
                        if (Time.time - LastClick < Customize.cust.DoubleClickDelayMenu)
                        {
                            PlayClickSound();
                            SelectedProgram = scrollsize;
                            //OpenFld();
                        }
                        else
                        {
                            PlayClickSound();
                            SelectedProgram = scrollsize;
                        }
                        LastClick   = Time.time;
                        ShowContext = false;
                    }
                    if (Input.GetMouseButtonUp(1))
                    {
                        ContextMenuOptions.RemoveRange(0, ContextMenuOptions.Count);
                        SelectedProgram = scrollsize;
                        if (new Rect(0, scrollsize * 21, 150, 20).Contains(Event.current.mousePosition))
                        {
                            for (int i = 0; i < GameControl.control.ProgramFiles.Count; i++)
                            {
                                if (GameControl.control.ProgramFiles[i].Target == RunningApplications[SelectedProgram])
                                {
                                    SelectedTask = GameControl.control.ProgramFiles[i];
                                }
                            }
                            ContextwindowRect.x = Input.mousePosition.x;
                            ContextwindowRect.y = Screen.height - Input.mousePosition.y;
                            ShowContext         = true;
                            GUI.BringWindowToFront(ContextMenuID);
                        }
                    }
                }
                GUI.Button(new Rect(151, scrollsize * 21, 60, 20), "" + CPUList[scrollsize].ToString("F2") + "%");
                GUI.Button(new Rect(212, scrollsize * 21, 60, 20), "" + MemoryList[scrollsize].ToString("F2") + "%");
                GUI.Button(new Rect(273, scrollsize * 21, 60, 20), "" + GraphicsList[scrollsize].ToString("F2") + "%");
                GUI.Button(new Rect(334, scrollsize * 21, 60, 20), "" + DiskList[scrollsize].ToString("F2") + "%");
                GUI.Button(new Rect(395, scrollsize * 21, 66, 20), "" + NetworkList[scrollsize].ToString("F2") + "%");
            }
            GUI.EndScrollView();
        }

        if (showSettings == true)
        {
            GUI.Label(new Rect(1, 170, 200, 21), hint);

            if (CompactMode)
            {
                if (GUI.Button(new Rect(1, 44 + 2, 150, 20), "Normal Mode"))
                {
                    CompactMode  = false;
                    showSettings = false;
                    minimize     = false;
                    Minimize();
                }
            }
            else
            {
                if (GUI.Button(new Rect(1, 44 + 2, 150, 20), "Compact Mode"))
                {
                    CompactMode  = true;
                    showSpecs    = true;
                    showSettings = false;
                    minimize     = true;
                    Minimize();
                }
            }
        }

        if (ChangeLayout == true)
        {
            if (AnyShowen == false)
            {
                if (GUI.Button(new Rect(2, 24, 75, 21), "Specs"))
                {
                    showSettings = false;
                    showSpecs    = true;
                }
            }
            if (AnyShowen == true)
            {
                if (GUI.Button(new Rect(2, 24, 74, 21), "Back"))
                {
                    CloseAllMainMenuSubMenus();
                }
            }
        }

        if (showSpecs == true && ChangeLayout == true)
        {
            showSettings = false;

            if (showCPU == true)
            {
                for (int i = 0; i < GameControl.control.Gateway.InstalledCPU.Count; i++)
                {
                    if (Selected == -1)
                    {
                        if (GUI.Button(new Rect(1, 46 + 22 * i, 150, 22), "Slot" + i + " - " + GameControl.control.Gateway.InstalledCPU[i].Name))
                        {
                            Selected = i;
                        }
                    }

                    if (Selected != -1)
                    {
                        for (Index = 0; Index < GameControl.control.Gateway.InstalledCPU[Selected].Cores; Index++)
                        {
                            GUI.Label(new Rect(1, 66 + 22 * Index, 150, 22), "Core" + Index + "-" + GameControl.control.Gateway.InstalledCPU[Selected].Cores + GameControl.control.SpaceName + "s");
                        }

                        GUI.Label(new Rect(1, 84 + 22 * Index, 150, 22), "Core Voltage: " + GameControl.control.Gateway.InstalledCPU[Selected].Voltage.ToString("F2"));

                        GUI.Label(new Rect(1, 84 + 44 * Index, 150, 22), "Health: %" + GameControl.control.Gateway.InstalledCPU[Selected].HealthPercentage.ToString("F0"));
                    }
                }
                //for (Index = 0; Index < cpu.CPUSpeed.Count; Index++)
                //{
                //    GUI.Label(new Rect(1, 66 + 22 * Index, 150, 22), "Core" + Index + "-" + cpu.CPUSpeed[Index] + GameControl.control.SpaceName + "s");
                //}
                ////GUI.Label(new Rect (1, 66 + 22 * Index, 150, 22), "Core Temp: " + cpu.CPUTemp.ToString("F0"));
                //GUI.Label(new Rect(1, 84 + 22 * Index, 150, 22), "Core Voltage: " + cpu.Voltage.ToString("F2"));
            }
            if (showGPU == true)
            {
                for (int i = 0; i < GameControl.control.Gateway.InstalledGPU.Count; i++)
                {
                    if (Selected == -1)
                    {
                        if (GUI.Button(new Rect(1, 46 + 22 * i, 150, 22), "Slot" + i + " - " + GameControl.control.Gateway.InstalledGPU[i].Name))
                        {
                            Selected = i;
                        }
                    }

                    if (Selected != -1)
                    {
                        GUI.Label(new Rect(1, 22 + 22, 250, 22), "Total Memory" + "-" + GameControl.control.Gateway.InstalledGPU[Selected].MaxMemory + GameControl.control.SpaceName + "s");

                        GUI.Label(new Rect(1, 44 + 22, 250, 22), "Used Memory" + "-" + GameControl.control.Gateway.InstalledGPU[Selected].MemoryUsage + GameControl.control.SpaceName + "s");

                        GUI.Label(new Rect(1, 66 + 22, 150, 22), "GPU Cores" + "-" + GameControl.control.Gateway.InstalledGPU[Selected].Cores);

                        GUI.Label(new Rect(1, 84 + 22, 150, 22), "GPU Voltage: " + GameControl.control.Gateway.InstalledGPU[Selected].Voltage.ToString("F2"));

                        GUI.Label(new Rect(1, 84 + 44, 150, 22), "Speed: " + GameControl.control.Gateway.InstalledGPU[Selected].MaxSpeed + GameControl.control.SpaceName + "s");

                        GUI.Label(new Rect(1, 84 + 66, 150, 22), "Health: %" + GameControl.control.Gateway.InstalledGPU[Selected].HealthPercentage.ToString("F0"));
                    }
                }
                //for (Index = 0; Index < cpu.CPUSpeed.Count; Index++)
                //{
                //    GUI.Label(new Rect(1, 66 + 22 * Index, 150, 22), "Core" + Index + "-" + cpu.CPUSpeed[Index] + GameControl.control.SpaceName + "s");
                //}
                ////GUI.Label(new Rect (1, 66 + 22 * Index, 150, 22), "Core Temp: " + cpu.CPUTemp.ToString("F0"));
                //GUI.Label(new Rect(1, 84 + 22 * Index, 150, 22), "Core Voltage: " + cpu.Voltage.ToString("F2"));
            }

            if (showDisk == true)
            {
                for (int i = 0; i < GameControl.control.Gateway.InstalledStorageDevice.Count; i++)
                {
                    if (Selected == -1)
                    {
                        if (GUI.Button(new Rect(1, 46 + 22 * i, 150, 22), "" + i + " - " + GameControl.control.Gateway.InstalledStorageDevice[i].Name))
                        {
                            Selected = i;
                        }
                    }

                    if (Selected != -1)
                    {
                        GUI.Label(new Rect(1, 22 + 22, 250, 22), "Capacity: " + GameControl.control.Gateway.InstalledStorageDevice[Selected].Capacity + GameControl.control.SpaceName + "s");

                        GUI.Label(new Rect(1, 44 + 22, 250, 22), "Free: " + GameControl.control.Gateway.InstalledStorageDevice[Selected].FreeSpace + GameControl.control.SpaceName + "s");

                        GUI.Label(new Rect(1, 66 + 22, 250, 22), "Power Usage: " + GameControl.control.Gateway.InstalledStorageDevice[Selected].PowerUsage);

                        GUI.Label(new Rect(1, 84 + 22, 150, 22), "Type: " + GameControl.control.Gateway.InstalledStorageDevice[Selected].Type);

                        GUI.Label(new Rect(1, 84 + 44, 150, 22), "Speed: " + GameControl.control.Gateway.InstalledStorageDevice[Selected].Speed + GameControl.control.SpaceName + "s");

                        GUI.Label(new Rect(1, 84 + 66, 150, 22), "Health: %" + GameControl.control.Gateway.InstalledStorageDevice[Selected].HealthPercentage.ToString("F0"));
                    }
                }
            }

            if (AnyShowen == false)
            {
                if (GUI.Button(new Rect(2, 46, 141, 20), "CPU:" + cpu.MaxCPUSpeed + GameControl.control.SpaceName + "s"))
                {
                    CloseAllMainMenuSubMenus();
                    showCPU   = true;
                    AnyShowen = true;
                }

                float RemainingRAMUI = ram.RemainingRAM / 1024;
                float MaxRAMUI       = ram.MaxRAM / 1024;

                if (GUI.Button(new Rect(2, 67, 141, 20), "RAM:" + RemainingRAMUI.ToString("F2") + " / " + MaxRAMUI.ToString("F2")))
                {
                    CloseAllMainMenuSubMenus();
                    showRAM   = true;
                    AnyShowen = true;
                }

                if (GUI.Button(new Rect(2, 88, 141, 20), "Disk:" + HardwareController.hdcon.HDDFreeSpace + GameControl.control.SpaceName + "/" + HardwareController.hdcon.HDDMaxSpace + GameControl.control.SpaceName))
                {
                    CloseAllMainMenuSubMenus();
                    showDisk  = true;
                    AnyShowen = true;
                }

                if (GUI.Button(new Rect(2, 109, 141, 20), "Network:" + HardwareController.hdcon.networkspeed + GameControl.control.SpaceName + "s" + "/" + HardwareController.hdcon.Maxsnetworkspeed + GameControl.control.SpaceName + "s"))
                {
                    CloseAllMainMenuSubMenus();
                    showNET   = true;
                    AnyShowen = true;
                }

                if (GUI.Button(new Rect(2, 130, 141, 20), "GPU:" + GameControl.control.Gateway.InstalledGPU[0].MemoryUsage + " / " + GameControl.control.Gateway.InstalledGPU[0].MaxMemory))
                {
                    CloseAllMainMenuSubMenus();
                    showGPU   = true;
                    AnyShowen = true;
                }

                if (GUI.Button(new Rect(2, 151, 141, 20), "PSU:" + GameControl.control.Gateway.InstalledPSU[0].Remaining + " / " + GameControl.control.Gateway.InstalledPSU[0].Max))
                {
                    CloseAllMainMenuSubMenus();
                    showPSU   = true;
                    AnyShowen = true;
                }
            }
        }
    }
コード例 #3
0
 protected override void LoadState()
 {
     programSystem = new(ParsedFileLines(PipeConnection.Parse));
 }