221 lines
No EOL
5.1 KiB
Text
221 lines
No EOL
5.1 KiB
Text
#include "ui/menudef.h"
|
|
#include "ui_mp/common_macro.inc"
|
|
|
|
#define CHOICE_GROUP "invert_axis_pc"
|
|
|
|
// required for inside-popup styles
|
|
#include "ui_mp/menustyle.inc"
|
|
#include "ui/choices_setup_common.menu"
|
|
|
|
// required for popup style
|
|
#include "ui_mp/popupstyle.inc"
|
|
#include "ui/choices_setup_popmenu.menu"
|
|
|
|
// setting longer buttons which in turn sets the width of the popup
|
|
#undef CHOICE_SIZE_X
|
|
#define CHOICE_SIZE_X 320
|
|
|
|
#undef CHOICE_HORIZONTAL_ALIGN
|
|
#define CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_CENTER
|
|
#undef CHOICE_VERTICAL_ALIGN
|
|
#define CHOICE_VERTICAL_ALIGN VERTICAL_ALIGN_CENTER
|
|
|
|
{
|
|
/*
|
|
menuDef
|
|
{
|
|
//IMPROVED_POPUP_SETUP( nameArg, itemCount, xArg, yArg, onEscArg, shadow_visArg )
|
|
// setup popup properties
|
|
IMPROVED_POPUP_SETUP( "invert_axis_pc", 4, 160, 170, scriptMenuResponse "accept_normal";, 1 )
|
|
// yes action
|
|
//#define LOCAL_YES \
|
|
// play "mouse_click"; \
|
|
// execnow "toggle ui_mousePitch";\
|
|
// uiScript update ui_mousePitch;\
|
|
// scriptMenuResponse "try_invert";\
|
|
// close self;
|
|
// no action
|
|
//#define LOCAL_NO \
|
|
// play "mouse_click"; \
|
|
// scriptMenuResponse "accept_normal"; \
|
|
// close self;
|
|
// yes action
|
|
#define LOCAL_YES \
|
|
play "mouse_click"; \
|
|
execNowOnDvarIntValue ui_start_inverted 0 "set ui_mousePitch 1";\
|
|
execNowOnDvarIntValue ui_start_inverted 1 "set ui_mousePitch 0";\
|
|
uiScript update ui_mousePitch;\
|
|
scriptMenuResponse "try_invert";\
|
|
close self;
|
|
// no action
|
|
#define LOCAL_NO \
|
|
play "mouse_click"; \
|
|
execNowOnDvarIntValue ui_start_inverted 0 "set ui_mousePitch 0";\
|
|
execNowOnDvarIntValue ui_start_inverted 1 "set ui_mousePitch 1";\
|
|
uiScript update ui_mousePitch;\
|
|
scriptMenuResponse "accept_normal"; \
|
|
close self;
|
|
CHOICE_POPMENU_SUBTITLE( dvarString( "ui_invert_string" ) )
|
|
CHOICE_BUTTON( 4, "@MENU_NO", LOCAL_NO )
|
|
CHOICE_BUTTON( 3, "@MENU_YES", LOCAL_YES )
|
|
}
|
|
*/
|
|
|
|
menuDef
|
|
{
|
|
// yes action
|
|
#define LOCAL_YES \
|
|
play "mouse_click"; \
|
|
execNowOnDvarIntValue ui_start_inverted 0 "set ui_mousePitch 1";\
|
|
execNowOnDvarIntValue ui_start_inverted 1 "set ui_mousePitch 0";\
|
|
uiScript update ui_mousePitch;\
|
|
scriptMenuResponse "try_invert";\
|
|
close self;
|
|
// no action
|
|
#define LOCAL_NO \
|
|
play "mouse_click"; \
|
|
execNowOnDvarIntValue ui_start_inverted 0 "set ui_mousePitch 0";\
|
|
execNowOnDvarIntValue ui_start_inverted 1 "set ui_mousePitch 1";\
|
|
uiScript update ui_mousePitch;\
|
|
scriptMenuResponse "accept_normal"; \
|
|
close self;
|
|
|
|
// hook for custom onClose action
|
|
#undef CENTER_POPUP_ON_CLOSE
|
|
#define CENTER_POPUP_ON_CLOSE scriptMenuResponse "accept_normal";
|
|
|
|
CENTER_POPUP_SETUP( "invert_axis_pc", 4, scriptMenuResponse "accept_normal";, 1 )
|
|
CHOICE_POPMENU_SUBTITLE( dvarString( "ui_invert_string" ) )
|
|
|
|
CHOICE_BUTTON( 4, "@MENU_NO", LOCAL_NO )
|
|
CHOICE_BUTTON( 3, "@MENU_YES", LOCAL_YES )
|
|
}
|
|
}
|
|
|
|
/*
|
|
`
|
|
#include "ui/menudef.h"
|
|
|
|
#define ORIGIN_BUTTONS 0 0
|
|
#define ORIGIN_MENUWINDOW 115 50
|
|
|
|
{
|
|
menuDef
|
|
{
|
|
name invert_axis_pc
|
|
visible 0
|
|
fullscreen 0
|
|
//rect 217 200 210 85
|
|
rect 204 160 235 160
|
|
style 1
|
|
border 1
|
|
popup
|
|
onESC
|
|
{
|
|
scriptMenuResponse "accept_normal";
|
|
close "invert_axis_pc";
|
|
}
|
|
|
|
itemDef
|
|
{
|
|
name backimage2fade
|
|
style WINDOW_STYLE_SHADER
|
|
rect -150 2 535 150
|
|
background "popmenu_bg"
|
|
// forecolor 0 0 0 0.4
|
|
// backcolor 0 0 0 0.4
|
|
visible 1
|
|
decoration
|
|
}
|
|
itemDef
|
|
{
|
|
name backimage2fade
|
|
style WINDOW_STYLE_SHADER
|
|
rect -90 20 415 24
|
|
background "popmenu_goldline"
|
|
// forecolor 0 0 0 0.4
|
|
// backcolor 0 0 0 0.4
|
|
visible 1
|
|
decoration
|
|
}
|
|
itemDef
|
|
{
|
|
name confirm
|
|
exp text ( dvarString( "ui_invert_string" ) );
|
|
style 0
|
|
textscale .38
|
|
textstyle ITEM_TEXTSTYLE_SHADOWED
|
|
rect 126 25 110 20
|
|
textalign 1
|
|
textalignx -7
|
|
textaligny 5
|
|
decoration
|
|
visible 1
|
|
}
|
|
|
|
itemDef
|
|
{
|
|
name invert_enabled
|
|
text "@MENU_YES"
|
|
type 1
|
|
textscale .5
|
|
style 1
|
|
textfont UI_FONT_NORMAL
|
|
textstyle ITEM_TEXTSTYLE_NORMAL
|
|
rect 20 60 100 20
|
|
textalign 0
|
|
//textalignx 50
|
|
//textaligny 19
|
|
forecolor .9 .9 .95 1
|
|
//backcolor .1747 .1903 .2335 0
|
|
border 1
|
|
bordercolor 0 0 0 0
|
|
visible 1
|
|
focusdvar { "1" }
|
|
mouseEnter
|
|
{
|
|
play "mouse_over";
|
|
}
|
|
action
|
|
{
|
|
play "mouse_click";
|
|
execnow "toggle ui_mousePitch";
|
|
uiScript update ui_mousePitch;
|
|
scriptMenuResponse "try_invert";
|
|
close invert_axis_pc;
|
|
}
|
|
}
|
|
itemDef
|
|
{
|
|
name invert_disabled
|
|
text "@MENU_NO"
|
|
type 1
|
|
textscale .5
|
|
style 1
|
|
textfont UI_FONT_NORMAL
|
|
textstyle ITEM_TEXTSTYLE_NORMAL
|
|
rect 120 60 100 20
|
|
textalign 0
|
|
//textalignx 50
|
|
//textaligny 19
|
|
forecolor .9 .9 .95 1
|
|
//backcolor .1747 .1903 .2335 0
|
|
border 0
|
|
bordercolor 0 0 0 0
|
|
visible 1
|
|
focusdvar { "0" }
|
|
mouseEnter
|
|
{
|
|
play "mouse_over";
|
|
}
|
|
action
|
|
{
|
|
play "mouse_click";
|
|
scriptMenuResponse "accept_normal";
|
|
close invert_axis_pc;
|
|
}
|
|
}
|
|
|
|
}
|
|
}
|
|
*/ |