[Tutorial]How to add a new button to the pause menu

Started by Bamdur, November 04, 2011, 07:17:20 PM

Previous topic - Next topic
(havent tested yet)
You can add a wide range of features, but i will just be showing you how to make a basic menu addition

First get ifs_pausemenu from downloads section http://www.swbfgamers.com/index.php?action=downloads;sa=view;down=374

open it in notepad/or any other text editor you use.

for the first part, adding the button


-- Ingame pause menu

ifspausemenu_vbutton_layout = {
ySpacing = 5,
width = 260,
font = "gamefont_medium",
buttonlist = {
{ tag = "resume", string = "common.resume", },
{ tag = "freecam", string = "game.pause.freecam", },
{ tag = "lobby", string = "game.pause.playerlist", },
{ tag = "opts", string = "ifs.main.options", },
{ tag = "console", string = "Fake Console", },
{ tag = "suicide", string = "game.pause.suicide", },
{ tag = "friends", string = "ifs.onlinelobby.friendslist", },
{ tag = "recent", string = "common.mp.recent", },
{ tag = "restart", string = "common.restart", },
{ tag = "quit", string = "common.quit", },
{ tag = "exit", string = "common.quit2windows", },
},
title = "game.pause.title",
}

ifspausemenu_split_vbutton_layout = {
ySpacing = 5,
width = 220,
font = "gamefont_small",
buttonlist = {
{ tag = "resume", string = "common.resume", },
{ tag = "freecam", string = "game.pause.freecam", },
{ tag = "lobby", string = "game.pause.playerlist", },
{ tag = "opts", string = "ifs.main.options", },
{ tag = "console", string = "Fake Console", },
{ tag = "suicide", string = "game.pause.suicide", },
{ tag = "friends", string = "ifs.onlinelobby.friendslist", },
{ tag = "restart", string = "common.restart", },
{ tag = "quit", string = "common.quit", },
{ tag = "exit", string = "common.quit2windows", },
},
title = "game.pause.title",
}


we will add a button that sets reinforcements to 0 on both sides, effectivly ending the map.

first we add our button and additional localization

{ tag = "SRTZ", string = "End Game", },    (note that you cant change localization from core.lvl if you do this method, to add core.lvl localization for sting put common.SRTZ.endgame)

now we add it to both sides and it should look like

-- Ingame pause menu

ifspausemenu_vbutton_layout = {
ySpacing = 5,
width = 260,
font = "gamefont_medium",
buttonlist = {
{ tag = "resume", string = "common.resume", },
{ tag = "freecam", string = "game.pause.freecam", },
{ tag = "lobby", string = "game.pause.playerlist", },
{ tag = "opts", string = "ifs.main.options", },
{ tag = "console", string = "Fake Console", },
{ tag = "suicide", string = "game.pause.suicide", },
{ tag = "friends", string = "ifs.onlinelobby.friendslist", },
{ tag = "recent", string = "common.mp.recent", },
{ tag = "restart", string = "common.restart", },
{ tag = "quit", string = "common.quit", },
{ tag = "exit", string = "common.quit2windows", },
                { tag = "SRTZ", string = "End Game", },
},
title = "game.pause.title",
}

ifspausemenu_split_vbutton_layout = {
ySpacing = 5,
width = 220,
font = "gamefont_small",
buttonlist = {
{ tag = "resume", string = "common.resume", },
{ tag = "freecam", string = "game.pause.freecam", },
{ tag = "lobby", string = "game.pause.playerlist", },
{ tag = "opts", string = "ifs.main.options", },
{ tag = "console", string = "Fake Console", },
{ tag = "suicide", string = "game.pause.suicide", },
{ tag = "friends", string = "ifs.onlinelobby.friendslist", },
{ tag = "restart", string = "common.restart", },
{ tag = "quit", string = "common.quit", },
{ tag = "exit", string = "common.quit2windows", },
                { tag = "SRTZ", string = "End Game", },
},
title = "game.pause.title",


You have now succesfuly added your first button.

Stay tuned for part 2! giving your button functionality

(Important)
You must munge ifs_pausemenu correctly and then replace the old ifs_pausemenu in common.lvl

Oo   ok... it doasnt work ;-)
i want to add (only) one button, it must not have a sence......
(like signature xD)
How i have it to munge?