6 Screenshots

About This File

DavWebCreator

DavWebCreator is a C# class 'library' which provides you the possibility to generate HTML structures with according styles and logic behind each element.

There are already plenty of examples online here: https://DavWebCreator.com

But anyway I will provide you here at least one example 🙂

Note: Compatible with 0.3.7. If you want to use it with for example version 1.1, you will have to change stuff like "Client" to "Player". There will come a version which will be out of the box compatible with 1.1. But at the moment you will have to do this by your own(3-5min work).

Preview

yes or no example picture.

 

Code behind:

        [Command("yesno")]
        public void YesNoDialogExample(Client player)
        {
          // Generate the Browser
            Browser browser = new Browser("YesNoDialog", BrowserType.Custom, BrowserContentAlign.Center, "520px",
                "100%");
			
          	// Create the dialog. (Most of the elements will get a default value)
            var yesNoDialog = browser.GetYesNoDialog("YES_NO_EXAMPLE", "Character Deletion", "WARNING", "Do you really want to delete your character?",
                "Yes", "No");

            // Customize for example the font size and the margin.
            yesNoDialog.Card.ContentTitle.FontSize = "30px";
            yesNoDialog.Card.Margin = "33% 0 0 0";

            // Add to the browser
            browser.AddYesNoDialog(yesNoDialog);
			
          	// Finally open the browser for the desire player.
            browser.OpenBrowser(player);
        }

		//This event will be called when a button was clicked.
        [RemoteEvent("YES_NO_EXAMPLE")]
        public void YesNoExample(Client player, params object[] args)
        {
            if (args == null)
                return;
			
          	// This is just a list of reponses. (You can bind for example 3 textboxes to a textbox and when someone click on that button, all 3 binded textboxes will be in the response.
            List<BrowserEventResponse> responses = JsonConvert.DeserializeObject<List<BrowserEventResponse>>(args[0].ToString());

			// For some reason we know that a YesNoDialog only gives you one response, because only the clicked button will be returned.
            BrowserEventResponse buttonResponse = responses[0];

            player.SendChatMessage(buttonResponse.Value + " Clicked");
			player.SendChatMessage(buttonResponse.HiddenValue + " This is our secret hidden value. e.g. some id");
          
          	// Close the browser
            player.TriggerEvent("CLOSE_BROWSER");

            // Do stuff
        }

 

Installation

  1. Download the .rar
  2. Open the "DavWebCreator_Installation.rar" and open the directory called "DavWebCreator_GetStarted".
  3. Open the directory "Server Resources" and Copy and paste the directory "DavWebCreator" in to your"Visual Studio" server project.
  4. Go back to the directory called "DavWebCreator_GetStarted".
  5. Now open the directory "Client Resources" and Copy and paste the directory "DavWebCreator" in to your "Visual Studio" client project.

Your solution should now look like this.

how the projects should look now picture.

      6. Go back to the directory called"DavWebCreator_GetStarted".

      7. Now open the directory "Client Frontend" and copy and paste the directory "DavWebCreator" in to your RageMp "client_packages" directory.

 

This is how it should look now:

how the 'client_resources' folder should look now picture.

If you want to report a bug or just want some help join my discord: https://discord.gg/zSWRjp

The project stays under the MIT license, feel free to contribute: https://github.com/davidowiz/DavWebBrowser 🙂

Maybe the installation procedure will be improved. But as you all now, time is limited.

Best regards,

Davidowiz


What's New in Version 1.1   See changelog

Released

Bug fixes:

  • The selection example can now handle more than 18 select options -> tested with 130+
  • Card Title alignment got broke in some cases.
  • The dropdown had some not so nicy layout, now it should work way better but still not 100% perfect.
  • Several other fixes

Improvement:

  • The communication between Server and Client got improved. (Not passing null values etc. = up to 35% less data get transmitted across the network for each request.) Additionally, huge requests can now be handled which gives the possibility to even create bigger dynamic pages like the selection with 130+ selection options.



User Feedback

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest

attacking

  

another awesome work. thanks

Share this review


Link to review
Fromlowitz01

  

Beast.

Share this review


Link to review