PDA

View Full Version : Menu doesnt work



Loveboy
17th June 2013, 19:47
Hi guys, i have a problem with my menu.
There is in weapon_german.menu a zombie hand weapon, but i only see ingame on menu there stay nothing and there is a info from MP40 xD
Idk why (i will add later the ui_allow to klick on this button, but there should be still stay a text)
here my script:



#include "ui_mp/menudef.h"

#define ORIGIN_TITLE 48 64
#define ORIGIN_CHOICE1 320 240

#define ORIGIN_WEAPONIMAGE 296 84
#define ORIGIN_WEAPONTEXT 296 220
#define ORIGIN_WEAPONPROPERTIESTEXT 296 290
#define ORIGIN_WEAPONACCURACY 395 277
#define ORIGIN_WEAPONDAMAGE 395 301
#define ORIGIN_WEAPONMOBILITY 395 325
#define ORIGIN_GRENADESLOT1 296 144
#define ORIGIN_GRENADESLOT2 312 144
#define ORIGIN_GRENADESLOT3 328 144

{
menuDef
{
name "weapon_german"
rect 0 0 640 480
focuscolor GLOBAL_FOCUSED_COLOR
style WINDOW_STYLE_EMPTY
blurWorld 5.0
onEsc
{
close weapon_german;
}
onOpen
{
show mp40_info;
show weapon_propertiestext;
}
onClose
{
hide kar98k_info;
hide g43_info;
hide mp40_info;
hide mp44_info;
hide kar98ksniper_info;
hide shotgun_info;
}

// Gradient
itemDef
{
style WINDOW_STYLE_SHADER
//rect -107 0 554 480
rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN
background "gradient"
visible 1
decoration
}

#include "ui/bars.menu"

itemDef
{
type ITEM_TYPE_TEXT
visible 1
origin ORIGIN_TITLE
forecolor 1 1 1 1
text "Join Zombies"
textfont UI_FONT_NORMAL
textscale GLOBAL_HEADER_SIZE
decoration
}

// MENU CHOICES
execKey "1" { play "mouse_click"; scriptMenuResponse "zombie_bash_mp"; }

itemDef
{
name "button_zombie_bash"
visible 1
rect 0 0 128 24
origin ORIGIN_CHOICE1
forecolor GLOBAL_UNFOCUSED_COLOR
type ITEM_TYPE_BUTTON
text "Join Zombies"
textfont UI_FONT_NORMAL
textscale 1
textstyle ITEM_TEXTSTYLE_SHADOWED
textaligny 20
dvartest "ui_allow_zombie_bash"
showDvar { "1" }
action
{
play "mouse_click";
scriptMenuResponse "zombie_bash_mp";
}
onFocus
{
hide kar98k_info;
hide g43_info;
hide mp44_info;
hide kar98ksniper_info;
hide shotgun_info;
play "mouse_over";
hide mp40_info;
hide weapon_propertiestext;
}
}
itemDef
{
name "button_zombie_bash"
visible 1
rect 0 0 128 24
origin ORIGIN_CHOICE1
forecolor GLOBAL_DISABLED_COLOR
type ITEM_TYPE_BUTTON
text "Join Zombies"
textfont UI_FONT_NORMAL
textscale 1
textstyle ITEM_TEXTSTYLE_SHADOWED
textaligny 20
dvartest "ui_allow_zombie_bash"
showDvar { "2" }
onFocus
{
hide kar98k_info;
hide g43_info;
hide mp44_info;
hide kar98ksniper_info;
hide shotgun_info;
play "mouse_over";
hide mp40_info;
hide weapon_propertiestext;
}
}


itemDef
{
#include "ui_mp/button_mainmenu.menu"

action
{
play "mouse_click";
close ingame;
open main;
}
onFocus
{
play "mouse_over";
}
}

// WEAPON IMAGES
itemDef
{
name "mp40_info"
visible 0
rect 0 20 199 112
origin ORIGIN_WEAPONIMAGE
style WINDOW_STYLE_SHADER
background "weapon_mp40"
decoration
}
itemDef
{
name "kar98k_info"
visible 0
rect 0 -2 224 112
origin ORIGIN_WEAPONIMAGE
style WINDOW_STYLE_SHADER
background "weapon_kar98"
decoration
}
itemDef
{
name "g43_info"
visible 0
rect 0 -4 224 112
origin ORIGIN_WEAPONIMAGE
style WINDOW_STYLE_SHADER
background "weapon_g43"
decoration
}
itemDef
{
name "mp44_info"
visible 0
rect 0 8 224 112
origin ORIGIN_WEAPONIMAGE
style WINDOW_STYLE_SHADER
background "weapon_mp44"
decoration
}
itemDef
{
name "kar98ksniper_info"
visible 0
rect 0 -2 224 112
origin ORIGIN_WEAPONIMAGE
style WINDOW_STYLE_SHADER
background "weapon_kar98scoped"
decoration
}
itemDef
{
name "shotgun_info"
visible 0
rect 0 0 224 112
origin ORIGIN_WEAPONIMAGE
style WINDOW_STYLE_SHADER
background "weapon_shotgun"
decoration
}

/*
// WEAPON DESCRIPTIONS
itemDef
{
name "mp40_info"
visible 0
rect 0 17 224 64
origin ORIGIN_WEAPONTEXT
forecolor 1 1 1 1
autowrapped
text "@MPUI_THE_MP40_SUBMACHINE_GUN"
textfont UI_FONT_NORMAL
textscale GLOBAL_TEXT_SIZE
decoration
}
itemDef
{
name "kar98k_info"
visible 0
rect 0 0 224 64
origin ORIGIN_WEAPONTEXT
forecolor 1 1 1 1
autowrapped
text "@MPUI_THE_KAR98K_IS_THE_STANDARD"
textfont UI_FONT_NORMAL
textscale GLOBAL_TEXT_SIZE
decoration
}
itemDef
{
name "mp44_info"
visible 0
rect 0 17 224 64
origin ORIGIN_WEAPONTEXT
forecolor 1 1 1 1
autowrapped
text "@MPUI_THE_MP44_IS_AN_ASSAULT"
textfont UI_FONT_NORMAL
textscale GLOBAL_TEXT_SIZE
decoration
}
itemDef
{
name "kar98ksniper_info"
visible 0
rect 0 0 224 64
origin ORIGIN_WEAPONTEXT
forecolor 1 1 1 1
autowrapped
text "@MPUI_THIS_KAR98K_VARIANT_USES"
textfont UI_FONT_NORMAL
textscale GLOBAL_TEXT_SIZE
decoration
}
*/
// WEAPON PROPERTIES
itemDef
{
name "weapon_propertiestext"
visible 0
origin ORIGIN_WEAPONPROPERTIESTEXT
forecolor 1 1 1 1
autowrapped
text "@MPUI_ACCURACY_DAMAGE_MOBILITY"
textfont UI_FONT_NORMAL
textscale GLOBAL_TEXT_SIZE
decoration
}

itemDef
{
name "mp40_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONACCURACY
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "mp40_info"
visible 0
rect 0 0 70 10
origin ORIGIN_WEAPONACCURACY
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "mp40_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONDAMAGE
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "mp40_info"
visible 0
rect 0 0 75 10
origin ORIGIN_WEAPONDAMAGE
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "mp40_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONMOBILITY
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "mp40_info"
visible 0
rect 0 0 96 10
origin ORIGIN_WEAPONMOBILITY
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "kar98k_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONACCURACY
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "kar98k_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONACCURACY
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "kar98k_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONDAMAGE
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "kar98k_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONDAMAGE
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "kar98k_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONMOBILITY
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "kar98k_info"
visible 0
rect 0 0 80 10
origin ORIGIN_WEAPONMOBILITY
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "g43_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONACCURACY
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "g43_info"
visible 0
rect 0 0 96 10
origin ORIGIN_WEAPONACCURACY
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "g43_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONDAMAGE
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "g43_info"
visible 0
rect 0 0 96 10
origin ORIGIN_WEAPONDAMAGE
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "g43_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONMOBILITY
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "g43_info"
visible 0
rect 0 0 80 10
origin ORIGIN_WEAPONMOBILITY
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "mp44_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONACCURACY
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "mp44_info"
visible 0
rect 0 0 80 10
origin ORIGIN_WEAPONACCURACY
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "mp44_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONDAMAGE
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "mp44_info"
visible 0
rect 0 0 105 10
origin ORIGIN_WEAPONDAMAGE
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "mp44_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONMOBILITY
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "mp44_info"
visible 0
rect 0 0 64 10
origin ORIGIN_WEAPONMOBILITY
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "kar98ksniper_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONACCURACY
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "kar98ksniper_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONACCURACY
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "kar98ksniper_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONDAMAGE
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "kar98ksniper_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONDAMAGE
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "kar98ksniper_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONMOBILITY
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "kar98ksniper_info"
visible 0
rect 0 0 80 10
origin ORIGIN_WEAPONMOBILITY
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "shotgun_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONACCURACY
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "shotgun_info"
visible 0
rect 0 0 35 10
origin ORIGIN_WEAPONACCURACY
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "shotgun_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONDAMAGE
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "shotgun_info"
visible 0
rect 0 0 100 10
origin ORIGIN_WEAPONDAMAGE
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

itemDef
{
name "shotgun_info"
visible 0
rect 0 0 128 10
origin ORIGIN_WEAPONMOBILITY
backcolor 1 1 1 .125
style WINDOW_STYLE_FILLED
decoration
}
itemDef
{
name "shotgun_info"
visible 0
rect 0 0 80 10
origin ORIGIN_WEAPONMOBILITY
backcolor 1 1 1 1
style WINDOW_STYLE_FILLED
decoration
}

// GRENADE LOADOUT
itemDef
{
name "mp40_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT1
style WINDOW_STYLE_SHADER
background "gfx/icons/hud@steilhandgrenate_C.tga"
decoration
}

itemDef
{
name "kar98k_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT1
style WINDOW_STYLE_SHADER
background "gfx/icons/hud@steilhandgrenate_C.tga"
decoration
}
itemDef
{
name "kar98k_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT2
style WINDOW_STYLE_SHADER
background "gfx/icons/hud@steilhandgrenate_C.tga"
decoration
}
itemDef
{
name "kar98k_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT3
style WINDOW_STYLE_SHADER
background "gfx/icons/hud@steilhandgrenate_C.tga"
decoration
}

itemDef
{
name "g43_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT1
style WINDOW_STYLE_SHADER
background "gfx/icons/hud@steilhandgrenate_C.tga"
decoration
}
itemDef
{
name "g43_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT2
style WINDOW_STYLE_SHADER
background "gfx/icons/hud@steilhandgrenate_C.tga"
decoration
}

itemDef
{
name "mp44_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT1
style WINDOW_STYLE_SHADER
background "gfx/icons/hud@steilhandgrenate_C.tga"
decoration
}
itemDef
{
name "mp44_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT2
style WINDOW_STYLE_SHADER
background "gfx/icons/hud@steilhandgrenate_C.tga"
decoration
}

itemDef
{
name "kar98ksniper_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT1
style WINDOW_STYLE_SHADER
background "gfx/icons/hud@steilhandgrenate_C.tga"
decoration
}
itemDef
{
name "kar98ksniper_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT2
style WINDOW_STYLE_SHADER
background "gfx/icons/hud@steilhandgrenate_C.tga"
decoration
}
itemDef
{
name "kar98ksniper_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT3
style WINDOW_STYLE_SHADER
background "gfx/icons/hud@steilhandgrenate_C.tga"
decoration
}

itemDef
{
name "shotgun_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT1
style WINDOW_STYLE_SHADER
background "gfx/icons/hud@steilhandgrenate_C.tga"
decoration
}

// SMOKE GRENADE LOADOUT
itemDef
{
name "mp40_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT3
style WINDOW_STYLE_SHADER
background "hud_us_smokegrenade_C"
decoration
}

itemDef
{
name "shotgun_info"
visible 0
rect 0 0 32 32
origin ORIGIN_GRENADESLOT3
style WINDOW_STYLE_SHADER
background "hud_us_smokegrenade_C"
decoration
}
}
}


Please help me. Thanks

RobsoN
17th June 2013, 19:49
I don't understand you at all, but if you dont want to see mp40 info remove this code:



onOpen
{
show mp40_info;
show weapon_propertiestext;
}

Loveboy
17th June 2013, 20:00
Thx robson, i mean this:

317

There should be a text but there isn't. The text should be "Join Zombies" if you look in .menu

STAUFFi
17th June 2013, 20:08
But why you dont open the Console in the Game?
The yellow text show you the errors from the .menu

RobsoN
17th June 2013, 20:13
Hmm try this instead old one:



itemDef
{
name "button_zombie_bash"
visible 1
rect 0 0 128 24
origin ORIGIN_CHOICE1
forecolor GLOBAL_UNFOCUSED_COLOR
type ITEM_TYPE_BUTTON
text "Join Zombies"
textfont UI_FONT_NORMAL
textscale 1
textstyle ITEM_TEXTSTYLE_SHADOWED
textaligny 20
action
{
play "mouse_click";
scriptMenuResponse "zombie_bash_mp";
}
onFocus
{
hide kar98k_info;
hide g43_info;
hide mp44_info;
hide kar98ksniper_info;
hide shotgun_info;
play "mouse_over";
hide mp40_info;
hide weapon_propertiestext;
}
}


And comment this



itemDef
{
name "button_zombie_bash"
visible 1
rect 0 0 128 24
origin ORIGIN_CHOICE1
forecolor GLOBAL_DISABLED_COLOR
type ITEM_TYPE_BUTTON
text "Join Zombies"
textfont UI_FONT_NORMAL
textscale 1
textstyle ITEM_TEXTSTYLE_SHADOWED
textaligny 20
dvartest "ui_allow_zombie_bash"
showDvar { "2" }
onFocus
{
hide kar98k_info;
hide g43_info;
hide mp44_info;
hide kar98ksniper_info;
hide shotgun_info;
play "mouse_over";
hide mp40_info;
hide weapon_propertiestext;
}
}

Loveboy
17th June 2013, 20:19
I try it tommorow thank you robson

randall
17th June 2013, 20:45
This two lines are the essence:
dvartest "ui_allow_zombie_bash"
showDvar { "1" }

Delete them from all itemdefs.
Reason: You can see the itemDef if the value of "ui_allow_zombie_bash" is "1". I think you didnt know what it means or forgot give value for the dvars, so the itemdefs stayed invisible.