[TF2] Main menu VGUI link to webpage

Grab your favourite IDE and tinker with the innards of game engines

[TF2] Main menu VGUI link to webpage

Postby coldandtired on Fri Mar 18, 2011 6:15 pm

Hi,

Hopefully I've posted this in the right place. If not, can someone please move it or tell me where would be more appropriate?

I'm writing a replacement main menu for TF2, and would like to replicate some functionality that's already built-in.

In MainMenuOverride.res, there is this panel:

Code: Select all
"NewUserForumsButton"
   {
      "ControlName"   "CTFImageButton"
      "fieldName"      "NewUserForumsButton"
      "xpos"         "c15"
      "ypos"         "437"
      "zpos"         "3"
      "wide"         "30"
      "tall"         "25"
      "autoResize"   "0"
      "pinCorner"      "3"
      "visible"      "1"
      "enabled"      "1"
      "tabPosition"   "0"
      "labelText"      ""
      "font"         "HudFontSmallBold"
      "textAlignment"   "center"
      "dulltext"      "0"
      "brighttext"   "0"
      "default"      "1"
      "Command"      "view_newuser_forums"
      "sound_depressed"   "UI/buttonclick.wav"
      "sound_released"   "UI/buttonclickrelease.wav"
      "border_default"   "MainMenuSubButtonBorder"
      
      "image_drawcolor"   "235 226 202 255"
      "SubImage"
      {
         "ControlName"   "ImagePanel"
         "fieldName"      "SubImage"
         "xpos"         "5"
         "ypos"         "6"
         "zpos"         "1"
         "wide"         "15"
         "tall"         "15"
         "visible"      "1"
         "enabled"      "1"
         "image"         "glyph_forums"
         "scaleImage"   "1"
      }            
   }


For anyone unfamiliar with TF2, this is a button on the menu that, when clicked, opens the Steam cloud browser and directs it to a SPUF forum.

The important part is this one:
Code: Select all
"Command"      "view_newuser_forums"


I'm quite comfortable with messing around with the .res files but it seems this command goes to somewhere else in the .gcf.

So, I would like to ask, how can I do exactly the same thing with my button and a different URL? Plus, does anyone know where to find the location of the "view_newuser_forums" command?
coldandtired
Dumpling
Dumpling
 
Joined: Fri Mar 18, 2011 6:10 pm

Re: [TF2] Main menu VGUI link to webpage

Postby dark0r on Fri Mar 25, 2011 2:52 pm

The commands are hard-coded into GameUI so you won't be able to change them unfortunately, and to view a list, that is also nigh impossible unless you open up gameui.dll in Hexrays, find "view_newuser_forums" and see if you can track it from there.

Good luck!
dark0r
Been Here A While
Been Here A While
 
Joined: Sat Mar 25, 2006 10:16 am
Location: de_hell

Re: [TF2] Main menu VGUI link to webpage

Postby coldandtired on Sat Mar 26, 2011 4:20 pm

Thanks for the reply. After a lot of messing around I found a way to put a URLLabel on the menu, which will open a link in the system browser, and a URLLabel on the overlay, which will open a link in the Steam browser.

Not perfect but good enough :)
coldandtired
Dumpling
Dumpling
 
Joined: Fri Mar 18, 2011 6:10 pm

Return to Programming

Who is online

Users browsing this forum: No registered users