JerryTube writes...Quote:
Ahh i see.
The 'onEsc' function may be your problem..
onEsc
{
close yourmenuname
}
This is my menu for my cod4 mod if you need something to compare..
Code:
#define ORIGIN_CHOICE1 80 84
#define ORIGIN_CHOICE2 80 108
#define ORIGIN_CHOICE3 80 132
#define ORIGIN_CHOICE4 80 156
#define ORIGIN_CHOICE5 80 180
#define ORIGIN_IMAGE 300 140
#define ORIGIN_QUICKMESSAGETAB 32 224
#define ORIGIN_QUICKMESSAGEWINDOW 32 256
#undef FOG_SCROLL_TIME
#define FOG_SCROLL_TIME 40000
{
menuDef
{
name "commander"
rect 0 0 640 480
style WINDOW_STYLE_EMPTY
focusColor COLOR_FOCUSED
blurWorld 5.0
onEsc
{
scriptMenuResponse "exit"; close commander
}
onOpen
{
show image_inf;
}
// TITLE
itemDef
{
type ITEM_TYPE_TEXT
visible 1
origin ORIGIN_TITLE
forecolor 1 1 1 1
text "Commander Menu"
textfont UI_FONT_NORMAL
decoration
}
// CHOICES
execKey "1" { play "mouse_click"; close commander; open infantry}
execKey "2" { play "mouse_click"; close commander; open armour}
execKey "3" { play "mouse_click"; close commander; open helicopters}
execKey "4" { play "mouse_click"; close commander; open weapons}
execKey "5" { ScriptMenuResponse "ammo"; close commander}
itemDef
{
name "button_infantry"
visible 1
rect 0 0 128 24
origin ORIGIN_CHOICE1
type ITEM_TYPE_BUTTON
text "1. Infantry"
textfont UI_FONT_NORMAL
textscale .4
textstyle ITEM_TEXTSTYLE_SHADOWED
textaligny 20
action
{
play "mouse_click";
close commander;
open infantry;
}
onFocus
{
hide image_arm;
hide image_heli;
play "mouse_over";
show image_inf;
}
}
itemDef
{
name "button_armour"
visible 1
rect 0 0 128 24
origin ORIGIN_CHOICE2
type ITEM_TYPE_BUTTON
text "2. Armour"
textfont UI_FONT_NORMAL
textscale .4
textstyle ITEM_TEXTSTYLE_SHADOWED
textaligny 20
action
{
play "mouse_click";
close commander;
open armour
}
onFocus
{
hide image_inf;
hide image_heli;
play "mouse_over";
show image_arm;
}
}
itemDef
{
name "button_helicopters"
visible 1
rect 0 0 128 24
origin ORIGIN_CHOICE3
type ITEM_TYPE_BUTTON
text "3. Helicopters"
textfont UI_FONT_NORMAL
textscale .4
textstyle ITEM_TEXTSTYLE_SHADOWED
textaligny 20
action
{
play "mouse_click";
close commander;
open helicopters
}
onFocus
{
hide image_inf;
hide image_arm;
play "mouse_over";
show image_heli;
}
}
itemDef
{
name "button_weapons"
visible 1
rect 0 0 128 24
origin ORIGIN_CHOICE4
type ITEM_TYPE_BUTTON
text "4. Personal Weapons"
textfont UI_FONT_NORMAL
textscale .4
textstyle ITEM_TEXTSTYLE_SHADOWED
textaligny 20
action
{
play "mouse_click";
close commander;
open weapons
}
onFocus
{
hide image_inf;
hide image_arm;
hide image_heli;
}
}
itemDef
{
name "button_ammo"
visible 1
rect 0 0 128 24
origin ORIGIN_CHOICE5
type ITEM_TYPE_BUTTON
text "5. Ammo ($100)"
textfont UI_FONT_NORMAL
textscale .4
textstyle ITEM_TEXTSTYLE_SHADOWED
textaligny 20
action
{
play "mouse_click";
close commander;
ScriptmenuResponse "ammo";
}
onFocus
{
hide image_inf;
hide image_arm;
hide image_heli;
}
}
// IMAGES
itemDef
{
name "image_inf"
visible 0
rect 0 0 256 256
origin ORIGIN_IMAGE
style WINDOW_STYLE_SHADER
background "warfare_infantry"
decoration
}
itemDef
{
name "image_arm"
visible 0
rect 0 0 256 256
origin ORIGIN_IMAGE
style WINDOW_STYLE_SHADER
background "warfare_armour"
decoration
}
itemDef
{
name "image_heli"
visible 0
rect 0 0 256 256
origin ORIGIN_IMAGE
style WINDOW_STYLE_SHADER
background "warfare_helicopter"
decoration
}
//#include "ui_mp/leftside_options.inc"
}
}
tyvm for your responce jerry so here is my menu
Code:
#include "ui/menudef.h"
#include "ui_mp/common_macro.inc"
#define CHOICE_GROUP "kalahari_v4"
#include "ui_mp/menustyle.inc"
#include "ui/choices_setup_common.menu"
#include "ui_mp/popupstyle.inc"
#include "ui/choices_setup_popmenu.menu"
#undef CHOICE_POPUP_BACKCOLOR
#define CHOICE_POPUP_BACKCOLOR 0.2 0.2 0.22 0.65
#define ORIGIN_QUICKMESSAGEWINDOW 0 16
{
menuDef
{
IMPROVED_POPUP_SETUP_ONOPEN( kalahari_v4, 6, 6, 160, ;, setDvar cl_bypassMouseInput "1";, 0 )
onClose{ setDvar cl_bypassMouseInput "0" }
onEsc{close kalahari_v4}
CHOICE_POPMENU_TITLE( "^2Public Menu" )
itemDef
{
name "window"
group ingamebox
visible 1
rect 16 20 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textstyle ITEM_TEXTSTYLE_SHADOWED
textscale TEXTSIZE_SMALL
textaligny 8
text "^01. ^2Advertise"
decoration
}
execKey "1" { scriptMenuResponse "1"; close kalahari_v4 }
itemDef
{
name "window"
group ingamebox
visible 1
rect 16 40 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textstyle ITEM_TEXTSTYLE_SHADOWED
textscale TEXTSIZE_SMALL
textaligny 8
text "^02. ^2You rock!"
decoration
}
execKey "2" { scriptMenuResponse "2"; close kalahari_v4 }
itemDef
{
name "window"
group ingamebox
visible 1
rect 16 60 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textstyle ITEM_TEXTSTYLE_SHADOWED
textscale TEXTSIZE_SMALL
textaligny 8
text "^03. ^2Teleport Down !"
decoration
}
execKey "3" { scriptMenuResponse "3"; close kalahari_v4 }
itemDef
{
name "window"
group ingamebox
visible 1
rect 16 80 0 0
origin ORIGIN_QUICKMESSAGEWINDOW
forecolor 1 1 1 1
textfont UI_FONT_NORMAL
textstyle ITEM_TEXTSTYLE_SHADOWED
textscale TEXTSIZE_SMALL
textaligny 8
text "^04. ^2To The Saferoom PPL"
decoration
}
execKey "4" { scriptMenuResponse "4"; close kalahari_v4 }
}
}
have i put the onESC function in the right place also my menu is called kalahari_v4.menu just incase you need to know