Exemple #1
0
        public override void Render()
        {
            if (WinApi.IsKeyDown(Keys.Space))
            {
                Settings.Enable.Value = false;
            }

            var drawPosX = Settings.WindowPosX;
            var drawPosY = Settings.WindowPosY;

            DrawRect = new RectangleF(drawPosX, drawPosY, WindowWidth + 10, WindowHeight + 55);
            UpdaterUtils.DrawFrameBox(DrawRect, 2, Color.Black, Color.White);

            #region Close Button
            var closeRect = DrawRect;
            closeRect.X     += closeRect.Width - 25;
            closeRect.Y     += 5;
            closeRect.Width  = 20;
            closeRect.Height = 20;

            if (UpdaterUtils.DrawButton(closeRect, 1, new Color(20, 20, 20, 255), Color.White))
            {
                Settings.Enable.Value = false;
            }
            Graphics.DrawText("X", 20, new Vector2(closeRect.X + 4, closeRect.Y - 2), Color.White);
            #endregion

            #region Tabs buttons
            var installedButtonRect = new RectangleF(DrawRect.X + 5, DrawRect.Y + 5, 120, 25);

            if (UpdaterUtils.DrawTextButton(installedButtonRect, "Installed Plugins", 15, 1, CurrentWindowTab == UWindowTab.InstalledPlugins ? Color.Gray : new Color(60, 60, 60, 255),
                                            Color.White, Color.White))
            {
                CurrentWindowTab = UWindowTab.InstalledPlugins;
            }

            installedButtonRect.X += installedButtonRect.Width + 10;

            if (UpdaterUtils.DrawTextButton(installedButtonRect, "Available Plugins", 15, 1, CurrentWindowTab == UWindowTab.AvailablePlugins ? Color.Gray : new Color(60, 60, 60, 255),
                                            Color.White, Color.White))
            {
                CurrentWindowTab = UWindowTab.AvailablePlugins;
            }

            #endregion


            var subWindowRect = new RectangleF(drawPosX + 5, drawPosY + 30, WindowWidth, WindowHeight);
            UpdaterUtils.DrawFrameBox(subWindowRect, 2, Color.Black, Color.White);

            if (CurrentWindowTab == UWindowTab.InstalledPlugins)
            {
                DrawWindow_InstalledPlugins(subWindowRect.X, subWindowRect.Y, subWindowRect.Width);
            }
            else if (CurrentWindowTab == UWindowTab.AvailablePlugins)
            {
                DrawWindow_AllPlugins(subWindowRect.X, subWindowRect.Y, subWindowRect.Width);
            }

            Graphics.DrawText("Notes: Move window by mouse drag. Close window key: Space", 15,
                              new Vector2(subWindowRect.X + 10, subWindowRect.Y + subWindowRect.Height + 5), Color.Gray, FontDrawFlags.Left);


            bMouse_Click = false;
        }