/// <summary>
 /// Sets the drawing properties, namely rectangle size and position for the current displayed messagebox at the bottom of the screen..
 /// </summary>
 public virtual void Set_MessageBox_Drawing_Properties()
 {
     try
     {
         Mod_Menu_MessageBox_Properties = DirectX_Menu_Methods.Get_Menu_Size_Location_Message(this.Mod_Menu_MessageBox_Strings.ToArray(), 50.0F, 80.0F, Program.Sonic_Heroes_Overlay.direct2DWindowTarget, Program.Sonic_Heroes_Overlay.overlayWinForm);
     }
     catch { }
 }
 /// <summary>
 /// Sets the drawing properties, namely rectangle size and position for the current menu.
 /// </summary>
 public virtual void Set_Drawing_Properties()
 {
     try
     {
         Mod_Menu_Page_Visual_Style = DirectX_Menu_Methods.Get_Menu_Size_Location(this.Mod_Menu_Page_Strings.ToArray(), Program.Menu_Horizontal_Percentage, Program.Menu_Vertical_Percentage, Program.Sonic_Heroes_Overlay.direct2DWindowTarget, Program.Sonic_Heroes_Overlay.overlayWinForm);
     }
     catch { }
 }
 /// <summary>
 /// Sets the current message to be displayed in the messagebox.
 /// </summary>
 /// <param name="Message"></param>
 public virtual void Set_MessageBox_Message(List <string> Message)
 {
     try
     {
         // Obtain current selection.
         Mod_Menu_MessageBox_Strings    = Message;
         Mod_Menu_MessageBox_Properties = DirectX_Menu_Methods.Get_Menu_Size_Location_Message(Mod_Menu_MessageBox_Strings.ToArray(), 50.0F, 80.0F, Program.Sonic_Heroes_Overlay.direct2DWindowTarget, Program.Sonic_Heroes_Overlay.overlayWinForm);
     } catch { }
 }
Esempio n. 4
0
 /// <summary>
 /// Sets the drawing properties, namely rectangle size and position for the current menu.
 /// </summary>
 public override void Set_Drawing_Properties()
 {
     Mod_Menu_Page_Visual_Style = DirectX_Menu_Methods.Get_Menu_Size_Location(this.Mod_Menu_Page_Strings.ToArray(), 0.00F, 50.00F, Program.Sonic_Heroes_Overlay.direct2DWindowTarget, Program.Sonic_Heroes_Overlay.overlayWinForm);
 }
        /// <summary>
        /// Main Method Ran by the Rendering Thread. Renders the menu, messageboxes and any other items to screen.
        /// </summary>
        /// <param name="DirectX_Graphics_Window"></param>
        public virtual void Render_This_Menu(WindowRenderTarget DirectX_Graphics_Window)
        {
            try
            {
                // Sets render properties if not set.
                if (!Render_Properties_Set)
                {
                    if (Program.Sonic_Heroes_Overlay.Ready_To_Render)
                    {
                        Set_Drawing_Properties();
                    }
                    Set_MessageBox_Drawing_Properties();
                    Render_Properties_Set = true;
                }

                // Draws the menu background rectangle.
                DirectX_Graphics_Window.FillRectangle(DirectX_Menu_Methods.Rectangle_To_RawRectangleF(Mod_Menu_Page_Visual_Style.Rectangle_Menu_DirectX), DirectX_2D_Overlay_Properties.Background_Brush_DirectX);

                // Draw Title Rectangle
                DirectX_Graphics_Window.FillRectangle(DirectX_Menu_Methods.Rectangle_To_RawRectangleF(Mod_Menu_Page_Visual_Style.Rectangle_Title_DirectX), DirectX_2D_Overlay_Properties.Title_Background_Brush_DirectX);

                // Render the title!
                for (int x = 0; x < Mod_Menu_Title.Count; x++)
                {
                    DirectX_Graphics_Window.DrawText
                    (
                        Mod_Menu_Title[x],                                                                                   // Current String to Draw
                        DirectX_2D_Overlay_Properties.Title_Font_DirectX,                                                    // Current Chosen Font
                        DirectX_Menu_Methods.RawRectangle_Get_Title_Location(Mod_Menu_Page_Visual_Style, Mod_Menu_Title[x]), // Current Text Rectangle Regions
                        DirectX_2D_Overlay_Properties.Title_Brush_DirectX
                    );
                }

                // Render all strings. Highlight current selection.
                for (int x = 0; x < Mod_Menu_Page_Strings.Count; x++)
                {
                    if (x != Menu_Index) // If it's not the current selection, render gray, else render the accent colour!
                    {
                        DirectX_Graphics_Window.DrawText
                        (
                            Mod_Menu_Page_Strings[x],                                                           // Current String to Draw
                            DirectX_2D_Overlay_Properties.Text_Font_DirectX,                                    // Current Chosen Font
                            DirectX_Menu_Methods.RawRectangle_Get_Text_Location(Mod_Menu_Page_Visual_Style, x), // Current Text Rectangle Regions
                            DirectX_2D_Overlay_Properties.Drawing_Brush_DirectX
                        );
                    }
                    else
                    {
                        DirectX_Graphics_Window.DrawText
                        (
                            Mod_Menu_Page_Strings[x],                                                           // Current String to Draw
                            DirectX_2D_Overlay_Properties.Text_Font_DirectX,                                    // Current Chosen Font
                            DirectX_Menu_Methods.RawRectangle_Get_Text_Location(Mod_Menu_Page_Visual_Style, x), // Current Text Rectangle Regions
                            DirectX_2D_Overlay_Properties.Highlight_Brush_DirectX
                        );
                    }
                }

                // Render the messagebox information
                DirectX_Graphics_Window.FillRectangle(DirectX_Menu_Methods.Rectangle_To_RawRectangleF(Mod_Menu_MessageBox_Properties.Rectangle_Menu_DirectX), DirectX_2D_Overlay_Properties.Background_Brush_DirectX);

                // Render all strings in messagebox.
                for (int x = 0; x < Mod_Menu_MessageBox_Strings.Count; x++)
                {
                    DirectX_Graphics_Window.DrawText
                    (
                        Mod_Menu_MessageBox_Strings[x],                                                                 // Current String to Draw
                        DirectX_2D_Overlay_Properties.Text_Font_DirectX,                                                // Current Chosen Font
                        DirectX_Menu_Methods.RawRectangle_Get_Text_Location_Message(Mod_Menu_MessageBox_Properties, x), // Current Text Rectangle Regions
                        DirectX_2D_Overlay_Properties.Drawing_Brush_DirectX
                    );
                }
            }
            catch { }
        }