Jump to content
  • 0

How to add a button on main interface that leads to webpage


Vio

Question

1 answer to this question

Recommended Posts

  • 2

Step 1:

You would need to modify the client's source to do this, adding a button to your main menu (Intersect.Client.Interface.Menu.MainMenu.cs), like so:

 

 

private readonly Button mWebsiteButton;


mWebsiteButton = new Button(mMenuWindow, "WebsiteButton");
mWebsiteButton.SetText(Strings.MainMenu.Website);
mWebsiteButton.Clicked += WebsiteButton_Clicked;

 

 

_______________________________________________________________________________________________________

 

 

Step 2:

Then, also in (Intersect.Client.Interface.Menu.MainMenu.cs), add a button event, something like:

 

 

private void WebsiteButton_Click(object sender, EventArgs e)
{
    // Launch browser to ascensiongamedev...
    System.Diagnostics.Process.Start("http://www.ascensiongamedev.com");
}

 

 

_______________________________________________________________________________________________________

 

 

Step 3:

Lastly, in (Intersect.Client.Localisation.Strings.cs , find "public partial struct MainMenu") add the JsonProperty:

 

 

[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public static LocalizedString Website = @"Website";

 

 

_______________________________________________________________________________________________________

 

Feel free to modify and customize the new button under "WebsiteButton": { , this piece of code will be in your client's resources (yourClient\resources\gui\layouts\menu\MenuWindow.json)

 

Sadly, you need source modifications to add a new button, so if you have some coding knowledge, load up visual studio and follow the steps above. If not, sorry that I couldn't help you :)

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...