This tutorial will teach you to add your own menu items in THPS3 menus using THQBEditor.
Click Read more to continue
Click Read more to continue
Most menus can be found in qb files that have menu it their names like debugmenu, mainmenu, sfxmenu, etc.
Let's check a static menu example in optionsmenu.qb.
It's the menu that you can access by pressing options in main menu.
Look for Id = options_main_menu and you'll find this (actually it's the very first struct in this file)
#00029 createmenu STRUCT{
type = verticalmenu //menu type
Id = options_main_menu //menu ID
x = 170.0 // x, y - menu position
y = 90.0
w = 300.0 // w,h - menu width and height
h = 400.0
just_center_x just_center_y blue_top
//params, other menus may have more.
eventhandlers = ARRAY( <...> )
//this array contains event handlers, so you can show something different if conditions are met.
children = ARRAY(
//children array, aka list of menuelements.
STRUCT{
// this struct creates the blue menu header
type = textmenuelement
auto_id text = "Options"
static dont_gray drawer = title
//this part makes it blue and huge
}
STRUCT{
//this struct links to another menu
type = textmenuelement
Id = soundfx_menu
text = "sound options"
link = sfx_menu_container
}
STRUCT{
// this struct links to a function
type = textmenuelement
auto_id
text = "load game"
target = "OptionsMenuLoad"
}
<...>
}
)
So actionly all you need to add a new element is to insert another menuitem struct in the children array
STRUCT{
type = textmenuelement
//says that it is menu element
auto_id
// you may use this if you don't need actual ID, else you have to use Id = <your_id>. IDs should be unique.
text = "load game"
//text that will be shown in menu
target = "OptionsMenuLoad"
//target calls 1 function. if you need more than 1, you have to write your own function and call it instead.
//link = sfx_menu_container this may be used instead of target to link to another menu. the menu ID should be called here.
}
Now a working example that will add a new menu item and play a special trick sound right after you press it.
Insert this struct as the second one in array, compile and try.
STRUCT{
type = textmenuelement
Id = newfunc_id
text = "Play Special Sound"
target = "LaunchSpecialMessage"
}
You have a menu item that plays special sound now!
Let's check a static menu example in optionsmenu.qb.
It's the menu that you can access by pressing options in main menu.
Look for Id = options_main_menu and you'll find this (actually it's the very first struct in this file)
#00029 createmenu STRUCT{
type = verticalmenu //menu type
Id = options_main_menu //menu ID
x = 170.0 // x, y - menu position
y = 90.0
w = 300.0 // w,h - menu width and height
h = 400.0
just_center_x just_center_y blue_top
//params, other menus may have more.
eventhandlers = ARRAY( <...> )
//this array contains event handlers, so you can show something different if conditions are met.
children = ARRAY(
//children array, aka list of menuelements.
STRUCT{
// this struct creates the blue menu header
type = textmenuelement
auto_id text = "Options"
static dont_gray drawer = title
//this part makes it blue and huge
}
STRUCT{
//this struct links to another menu
type = textmenuelement
Id = soundfx_menu
text = "sound options"
link = sfx_menu_container
}
STRUCT{
// this struct links to a function
type = textmenuelement
auto_id
text = "load game"
target = "OptionsMenuLoad"
}
<...>
}
)
So actionly all you need to add a new element is to insert another menuitem struct in the children array
STRUCT{
type = textmenuelement
//says that it is menu element
auto_id
// you may use this if you don't need actual ID, else you have to use Id = <your_id>. IDs should be unique.
text = "load game"
//text that will be shown in menu
target = "OptionsMenuLoad"
//target calls 1 function. if you need more than 1, you have to write your own function and call it instead.
//link = sfx_menu_container this may be used instead of target to link to another menu. the menu ID should be called here.
}
Now a working example that will add a new menu item and play a special trick sound right after you press it.
Insert this struct as the second one in array, compile and try.
STRUCT{
type = textmenuelement
Id = newfunc_id
text = "Play Special Sound"
target = "LaunchSpecialMessage"
}
You have a menu item that plays special sound now!