Firex Дата: Четверг, 28.02.2013, 19:06 | Сообщение # 2
Назначение наших MenuDef's: 1. Создаем/переписываем следующие файлы(мой пример). ---main.menu
Код
#include "ui/menudef.h" #define CHOICE_GROUP "main" #include "ui_mp/menustyle.inc" { assetGlobalDef { fadeClamp 1.0 fadeCycle 1 fadeAmount 0.1 } menuDef { name "main" fullScreen 1 rect 0 0 640 480 focusColor COLOR_FOCUSED soundloop "music_mainmenu_mp" onOpen { open loading_mp; setdvar ui_showEndOfGame "0"; uiScript stopRefresh; uiScript addPlayerProfiles; uiScript openMenuOnDvarNot com_playerProfile "Default" create_profile; uiScript openMenuOnDvarNot com_playerProfile "Default" load_profile; open main_text; uiScript openMenuOnDvar ui_playerProfileNewCreated 1 created_profile; } } menuDef { name "main_text" fullScreen 1 rect 0 0 640 480 focusColor COLOR_FOCUSED soundloop "music_mainmenu_mp" onOpen { exec "selectStringTableEntryInDvar mp/didyouknow.csv 0 didyouknow"; close loading_mp; } onESC { open quit_popmenu; } #include "ui_mp/main_bg.inc" itemDef { text "The game in this version can not convey all the impressions of the gameplay." rect -250 -150 500 50 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM autowrapped textfont UI_FONT_NORMAL textscale 0.38 textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_MIDDLE_CENTER visible 1 decoration } itemDef { text "© 2011-2012 Reloaded team. Reloaded Warfare alpha developer testing!" rect -250 -40 500 50 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM autowrapped textfont UI_FONT_NORMAL textscale 0.34 textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_MIDDLE_CENTER visible 1 decoration } itemDef { name back type ITEM_TYPE_BUTTON style WINDOW_STYLE_FILLED textstyle ITEM_TEXTSTYLE_SHADOWED rect -60 -58 40 20 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_BOTTOM text "^3ESC ^7Exit" forecolor 1 1 1 1 textfont UI_FONT_NORMAL textalign ITEM_ALIGN_CENTER textalignY 18 textscale 0.42 visible 1 mouseEnter { play "mouse_over"; } action { play "mouse_click"; open quit_popmenu; } } MENU_BUTTON_BIGMAIN(101, -275, 72, "gm_mp_c", "gm_mp_b", "PLAY ONLINE", "00h:00m:00s", open play_online;, "main" ) MENU_BUTTON_BIGMAIN(102, -90, 72, "gm_sp_c", "gm_sp_b", "PLAY OFFLINE", "00h:00m:00s", open notavailable_popmenu;, "main" ) MENU_BUTTON_BIGMAIN(103, 95, 72, "gm_so_c", "gm_so_b", "SINGLE PLAYER", "00h:00m:00s", open single_player_popmenu;, "main" ) } menuDef { name "loading_mp" fullScreen 1 rect 0 0 640 480 focusColor COLOR_FOCUSED onOpen { setdvar ui_playerProfileNewCreated 0; } itemDef { text "LOADING..." rect -100 20 50 25 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP autowrapped textfont UI_FONT_OBJECTIVE textscale 0.38 textstyle ITEM_TEXTSTYLE_SHADOWED textalign ITEM_ALIGN_MIDDLE_CENTER visible 1 decoration } } #include "ui_mp/profile_library.inc" #include "ui_mp/popupstyle.inc" menuDef { MENU_CENTERPOPUP_SETUP( single_player_popmenu, "WARNING", "Switch to single player?", 280, 120, 2) MENU_CENTERPOPUP_BUTTON( 1, 0, 68, "YES", 276, 22, close self; close main; uiScript startSingleplayer; ) MENU_CENTERPOPUP_BUTTON( 2, 0, 90, "NO", 276, 22, close self; ) } }
---playonline.menu
Код
#include "ui/menudef.h" #define CHOICE_GROUP "play_online" #include "ui_mp/menustyle.inc" { menuDef { name "play_online" fullScreen 1 rect 0 0 640 480 focusColor COLOR_FOCUSED soundloop "music_mainmenu_mp" onOpen { uiScript stopRefresh; setdvar ui_showEndOfGame "0"; } onClose { setLocalVarBool ui_hideBack 0; } #include "ui_mp/main_bg.inc" itemDef { style WINDOW_STYLE_FILLED rect 0 0 280 480 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP backcolor 0 0 0 0.35 visible 1 decoration } itemDef { style WINDOW_STYLE_SHADER rect -40 0 1 480 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP forecolor 1 1 1 0.8 exp material("button_highlight_end"); border 0 bordersize 0 bordercolor 0 0 0 0 visible 1 decoration } itemDef { style WINDOW_STYLE_SHADER rect -40 0 8 480 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP forecolor 1 1 1 0.75 exp material("gradient"); border 0 bordersize 0 bordercolor 0 0 0 0 visible 1 decoration } MENU_TITLE( "PLAY ONLINE", when( !localvarBool( ui_hideBack ) ) ) MENU_SEPLINE( 110, 78, 0.4, when( !localvarBool( ui_hideBack ) )) MENU_BUTTON_MAIN( 1, -20, 80, "PRIVATE MATCH", open privategame;, when( !localvarBool( ui_hideBack ) ), "play_online" ) MENU_BUTTON_MAIN( 2, -20, 100, "OFFICIAL SERVER", open server_popmenu;, when( !localvarBool( ui_hideBack ) ), "play_online" ) MENU_BUTTON_MAIN( 3, -20, 120, "CREATE A CLASS", open notavailable_popmenu;, when( !localvarBool( ui_hideBack ) ), "play_online" ) MENU_BUTTON_MAIN( 4, -20, 140, "BARRACKS", open notavailable_popmenu;, when( !localvarBool( ui_hideBack ) ), "play_online" ) MENU_SEPLINE( 110, 163, 0.4, when( !localvarBool( ui_hideBack ) )) MENU_BUTTON_MAIN( 5, -20, 165, "OPTIONS", open options;, when( !localvarBool( ui_hideBack ) ), "play_online" ) MENU_BUTTON_MAIN( 6, -20, 185, "MAIN MENU", close play_online;, when( !localvarBool( ui_hideBack ) ), "play_online" ) MENU_BUTTON_MAIN( 7, -20, 205, "QUIT", open quit_popmenu;, when( !localvarBool( ui_hideBack ) ), "play_online" ) MENU_SEPLINE( 110, 227, 0.5, when( !localvarBool( ui_hideBack ) ) ) MENU_FOOTNOTE( 15, 230, 260, 60, "Network Access: ^2Unknown", 0.34, ITEM_ALIGN_TOP_RIGHT, ITEM_TEXTSTYLE_SHADOWED, UI_FONT_OBJECTIVE, when( !localvarBool( ui_hideBack ) ) ) MENU_FOOTNOTE( 15, 250, 260, 60, ("Welcome " + dvarString("name") + "^7!"), 0.34, ITEM_ALIGN_TOP_RIGHT, ITEM_TEXTSTYLE_SHADOWED, UI_FONT_OBJECTIVE, when( !localvarBool( ui_hideBack ) ) ) } #include "ui_mp/popupstyle.inc" menuDef { MENU_CENTERPOPUP_SETUP( notavailable_popmenu, "SORRY :(", "Not available in alpha version.", 280, 100, 2) MENU_CENTERPOPUP_BUTTON( 1, 0, 70, "OK", 276, 22, close self; ) } menuDef { MENU_CENTERPOPUP_SETUP( server_popmenu, "WARNING", "Do you really want to play on official server?", 280, 120, 2) MENU_CENTERPOPUP_BUTTON( 1, 0, 68, "YES", 276, 22, exec "connect 123.123.123.123"; ) MENU_CENTERPOPUP_BUTTON( 2, 0, 90, "NO", 276, 22, close self; ) } }
---privategame.menu
Код
#include "ui/menudef.h" #define CHOICE_GROUP "privategame" #include "ui_mp/menustyle.inc" { menuDef { name "privategame" fullScreen 0 rect 0 0 640 480 focusColor COLOR_FOCUSED soundloop "" blurWorld 7.0 onOpen { setLocalVarBool ui_hideBack 1; setLocalVarBool ui_hideCreation 0; setitemcolor fadebox backcolor 0 0 0 1; fadeout fadebox; uiScript loadArenas; } onClose { setLocalVarBool ui_hideBack 0; setLocalVarBool ui_hideCreation 0; } onEsc { close self; } MENU_TITLE( "PRIVATE GAME", when( !localvarBool( ui_hideCreation ) ) ) MENU_SEPLINE( 110, 78, 0.4, when( !localvarBool( ui_hideCreation ) )) MENU_BUTTON_MAIN( 1, -20, 80, "START GAME", uiScript StartServer;, when( !localvarBool( ui_hideCreation ) ), "privategame" ) MENU_BUTTON_MAIN( 2, -20, 100, "GAMEPLAY SETUP", uiScript StartServer;, when( !localvarBool( ui_hideCreation ) ), "privategame" ) MENU_BUTTON_MAIN( 3, -20, 120, "SERVER SETUP", uiScript StartServer;, when( !localvarBool( ui_hideCreation ) ), "privategame" ) MENU_SEPLINE( 110, 143, 0.4, when( !localvarBool( ui_hideCreation ) )) MENU_FOOTNOTE( 15, 146, 260, 60, "Alpha version C:", 0.30, ITEM_ALIGN_TOP_RIGHT, ITEM_TEXTSTYLE_SHADOWED, UI_FONT_OBJECTIVE, when( !localvarBool( ui_hideCreation ) ) ) MENU_FOOTNOTE( 240, 50, 260, 60, ("Recommended Max Players: " + maxrecommendedplayers()), 0.34, ITEM_ALIGN_TOP_RIGHT, ITEM_TEXTSTYLE_SHADOWED, UI_FONT_NORMAL, when( !localvarBool( ui_hideCreation ) ) ) itemDef { name mappreview style 0 ownerdraw UI_MAPPREVIEW rect 50 300 195 97 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP border 1 bordersize 1 bordercolor 0 0 0 1 visible 1 decoration } /* itemDef { name maplist rect -260 266 200 160 HORIZONTAL_ALIGN_RIGHT VERTICAL_ALIGN_TOP type ITEM_TYPE_LISTBOX style WINDOW_STYLE_FILLED elementwidth 120 elementheight 20 origin 0 0 textfont UI_FONT_OBJECTIVE textscale 0.28 elementtype LISTBOX_TEXT feeder FEEDER_ALLMAPS textstyle ITEM_TEXTSTYLE_SHADOWED textalignx 6 textaligny 0 outlinecolor 1 1 1 0.2 forecolor 1 1 1 0.5 backcolor 0 0 0 0 border 1 bordersize 1 bordercolor 1 1 1 0.15 visible 1 columns 1 2 190 25 mouseEnter { play "mouse_over"; setitemcolor maplist bordercolor 1 1 1 0.55 } mouseExit { setitemcolor maplist bordercolor 1 1 1 0.15 } doubleclick { play "mouse_click"; uiScript StartServer; } } */ } }
---error.menu
Код
#include "ui/menudef.h" #include "ui_mp/popupstyle.inc" { menuDef { name "error_popmenu" visible 0 fullscreen 1 rect 0 0 640 480 focusColor COLOR_FOCUSED style WINDOW_STYLE_FILLED border 1 onClose { uiScript clearError } onESC { uiScript clearError; close error_popmenu; open main; } itemDef { name backimage2fade style WINDOW_STYLE_SHADER rect -128 0 896 480 background "white" forecolor 0 0 0 0.3 backcolor 0 0 0 0.3 visible 1 decoration } itemDef { name backimage2fade style WINDOW_STYLE_SHADER rect 50 177 535 200 background "popmenu_bg" visible 1 decoration } itemDef { name confirm dvar "com_errorTitle" style WINDOW_STYLE_EMPTY textscale TEXTSIZE_TITLE rect 326 200 110 20 textalign ITEM_ALIGN_CENTER textalignx -62 textaligny 5 decoration forecolor COLOR_TITLE visible 1 } itemDef { name errorinfo rect 120 210 400 255 type ITEM_TYPE_TEXT style WINDOW_STYLE_FILLED autowrapped dvar "com_errorMessage" textalign ITEM_ALIGN_CENTER textaligny 23 textscale .35 forecolor 1 1 1 1 visible 1 decoration } itemDef { name debug rect 2 5 80 80 type ITEM_TYPE_TEXT style WINDOW_STYLE_FILLED text "DEBUG" autowrapped textfont UI_FONT_OBJECTIVE textalign ITEM_ALIGN_CENTER textaligny 23 textscale 0.39 forecolor 1 1 1 1 visible when( dvarBool(logfile) == 2 ) decoration } itemDef { name back text "@MENU_EXIT" type ITEM_TYPE_BUTTON textscale .3 style WINDOW_STYLE_FILLED textfont UI_FONT_NORMAL rect 270 360 100 17 textalign ITEM_ALIGN_CENTER textaligny 13 forecolor COLOR_UNFOCUSED visible 1 onFocus { play "mouse_over"; } action { play "mouse_click"; uiScript clearError; close error_popmenu; open main } } } }
---quit.menu
Код
#include "ui/menudef.h" #include "ui_mp/popupstyle.inc" } menuDef { MENU_CENTERPOPUP_SETUP( quit_popmenu, "WARNING", "You really want to quit?", 260, 120, 2) MENU_CENTERPOPUP_BUTTON( 1, 0, 68, "YES", 256, 22, exec "quit"; ) MENU_CENTERPOPUP_BUTTON( 2, 0, 90, "NO", 256, 22, close self; ) } }
---options.menu
Код
#include "ui/menudef.h" #define CHOICE_GROUP "options" #include "ui_mp/menustyle.inc" { menuDef { name "options" fullScreen 0 rect 0 0 640 480 focusColor COLOR_FOCUSED soundloop "" blurWorld 7.0 onOpen { setLocalVarBool ui_showApply 0; setLocalVarBool ui_hideBack 1; setLocalVarBool ui_hideOptions 0; setitemcolor fadebox backcolor 0 0 0 1; fadeout fadebox; setdvar g_reloading "0"; } onClose { setLocalVarBool ui_hideOptions 0; setLocalVarBool ui_hideBack 0; } onESC { close self; } MENU_TITLE( "OPTIONS", when( !localvarBool( ui_hideOptions ) ) ) MENU_SEPLINE( 110, 78, 0.4, when( !localvarBool( ui_hideOptions ) )) MENU_BUTTON_MAIN( 1, -20, 80, "@MENU_GRAPHICS", open options_graphics;, when( !localvarBool( ui_hideOptions ) ), "options" ) MENU_BUTTON_MAIN( 2, -20, 100, "@MENU_TEXTURE_SETTINGS", open options_graphics_texture;, when( !localvarBool( ui_hideOptions ) ), "options" ) MENU_BUTTON_MAIN( 3, -20, 120, "@MENU_SOUND", open options_sound;, when( !localvarBool( ui_hideOptions ) ), "options" ) MENU_BUTTON_MAIN( 5, -20, 140, "@MENU_GAME_OPTIONS", open options_game;, when( !localvarBool( ui_hideOptions ) ), "options" ) MENU_BUTTON_MAIN( 6, -20, 160, "@MENU_MULTIPLAYER_OPTIONS", open options_multi;, when( !localvarBool( ui_hideOptions ) ), "options" ) MENU_SEPLINE( 110, 183, 0.4, when( !localvarBool( ui_hideOptions ) )) MENU_BUTTON_MAIN( 7, -20, 185, "@MENU_RESET_SYSTEM_DEFAULTS", open options_graphics_defaults;, when( !localvarBool( ui_hideOptions ) ), "options" ) } menuDef { name options_graphics fullScreen 0 rect 0 0 640 480 focusColor COLOR_FOCUSED soundloop "" onOpen { close options_look; close options_move; close options_shoot; close options_misc; close options_sound; close options_game; close options_view; close options_defaults; close options_driverinfo; close options_multi; close options_graphics_defaults; close options_graphics_texture; close options_control_defaults; exec "exec options_graphics.cfg"; execOnDvarFloatValue r_zfeather 0 "set ui_zfeather 0"; execOnDvarFloatValue r_zfeather 1 "set ui_zfeather 1"; execOnDvarFloatValue r_depthPrepassModels 1 "set ui_zfeather 2"; setLocalVarBool ui_hideOptions 1; setLocalVarBool ui_showApply 0; } onClose { setLocalVarBool ui_hideOptions 0; execOnDvarIntValue ui_zfeather 0 "set r_zfeather 0;set r_depthPrepassModels 0"; // off execOnDvarIntValue ui_zfeather 1 "set r_zfeather 1;set r_depthPrepassModels 0"; // world execondvarintvalue r_lodScaleRigid 2 "set r_lodScaleSkinned 4; set r_lodBiasSkinned -200; set r_lodBiasRigid -100"; execondvarintvalue r_lodScaleRigid 1 "set r_lodScaleSkinned 1; set r_lodBiasSkinned 0; set r_lodBiasRigid 0"; } onESC { close options_graphics; } #include "ui_mp/ls_options.inc" MENU_TITLE_SECTION( "@MENU_GRAPHICS", when( localvarBool( ui_hideOptions ) ) ) MENU_BUTTON_DVARLIST( 8, -20, 80, "@MENU_VIDEO_MODE", ui_r_mode, ITEM_TYPE_DVARENUM, dvarEnumList r_mode, setLocalVarBool ui_showApply 1;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARLIST( 9, -20, 100, "@MENU_SCREEN_REFRESH_RATE", ui_r_displayRefresh, ITEM_TYPE_DVARENUM, dvarEnumList r_displayRefresh, setLocalVarBool ui_showApply 1;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARLIST( 10, -20, 120, "@MENU_ASPECT_RATIO", ui_r_aspectratio, ITEM_TYPE_MULTI, dvarStrList { "@MENU_AUTO"; "auto"; "@MENU_STANDARD_4_3"; "standard"; "@MENU_WIDE_16_10"; "wide 16:10"; "@MENU_WIDE_16_9"; "wide 16:9" }, setLocalVarBool ui_showApply 1;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARLIST( 11, -20, 140, "@MENU_ANTIALIASING", ui_r_aasamples, ITEM_TYPE_MULTI, dvarFloatList { "@MENU_OFF" 1 "@MENU_2X" 2 "@MENU_4X" 4 }, setLocalVarBool ui_showApply 1;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARSLIDER( 12, -20, 160, "@MENU_BRIGHTNESS", r_gamma, 1, 0.5, 3, ; , when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARYESNO( 13, -20, 180, "@MENU_SYNC_EVERY_FRAME", ui_r_vsync, setLocalVarBool ui_showApply 1;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARYESNO( 14, -20, 200, "@MENU_OPTIMIZE_FOR_DUAL_VIDEO_CARDS", r_multiGpu, ;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARYESNO( 15, -20, 220, "@MENU_SHADOWS", sm_enable, ;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARYESNO( 16, -20, 240, "@MENU_SPECULAR_MAP", r_specular, ;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARYESNO( 17, -20, 260, "@MENU_DOF", r_dof_enable, ;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARYESNO( 18, -20, 280, "@MENU_GLOW", r_glow_allowed, ;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARLIST( 19, -20, 300, "Num of dynamic lights", r_dlightlimit, ITEM_TYPE_MULTI, dvarFloatList { "@MENU_OFF" 0 "@MENU_LOW" 2 "@MENU_NORMAL" 4 }, ; , when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARLIST( 20, -20, 320, "@MENU_ZFEATHER_SMOKE", ui_zfeather, ITEM_TYPE_MULTI, dvarFloatList { "@MENU_NO" 0 "@MENU_YES" 1 }, setLocalVarBool ui_showApply 1; , when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARYESNO( 21, -20, 340, "@MENU_RAGDOLL", ragdoll_enable, ;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARYESNO( 22, -20, 360, "@MENU_BULLET_IMPACTS", fx_marks, ;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARLIST( 23, -20, 380, "@MENU_MODEL_DETAIL", r_lodScaleRigid, ITEM_TYPE_MULTI, dvarFloatList { "@MENU_NORMAL" 1 "@MENU_LOW" 2 }, ; , when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARLIST( 24, -20, 400, "@MENU_WATER_DETAIL", r_drawWater, ITEM_TYPE_MULTI, dvarFloatList { "@MENU_NORMAL" 1 "@MENU_LOW" 0 }, ; , when( localvarBool( ui_hideOptions ) ), "options") itemDef { name apply text "@MENU_APPLY" type 1 style WINDOW_STYLE_FILLED textstyle ITEM_TEXTSTYLE_SHADOWED rect 200 -26 80 20 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM textfont UI_FONT_NORMAL textalign ITEM_ALIGN_LEFT textscale TEXTSIZE_SMALL textaligny 18 visible when( localVarBool( ui_showApply ) && !dvarint( sv_running ) ); mouseEnter { play "mouse_over"; } action { play "mouse_click"; open vid_restart_popmenu; } } itemDef { name apply2 text "@MENU_APPLY" type 1 style WINDOW_STYLE_FILLED textstyle ITEM_TEXTSTYLE_SHADOWED rect 200 -26 80 20 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM textfont UI_FONT_NORMAL textalign ITEM_ALIGN_LEFT textscale TEXTSIZE_SMALL textaligny 18 visible when( localVarBool( ui_showApply ) && dvarint( sv_running ) ); mouseEnter { play "mouse_over"; } action { play "mouse_click"; uiScript openMenuOnDvar g_reloading 0 vid_restart_popmenu_listen; /*uiScript openMenuOnDvarNot g_reloading 0 vid_restart_popmenu_dead;*/ /*А нахуя?*/ } } itemDef { name graphic_warning text "@MENU_GRAPHICS_WARNING" type 1 style WINDOW_STYLE_FILLED textstyle ITEM_TEXTSTYLE_SHADOWED rect 20 -116 240 240 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_BOTTOM textfont UI_FONT_NORMAL textalign ITEM_ALIGN_LEFT textscale TEXTSIZE_SMALL visible 1 mouseEnter { play "mouse_over"; } decoration autowrapped } } menuDef { name options_graphics_texture fullScreen 0 rect 0 0 640 480 focusColor COLOR_FOCUSED soundloop "" onOpen { close options_look; close options_move; close options_shoot; close options_misc; close options_sound; close options_game; close options_view; close options_defaults; close options_driverinfo; close options_multi; close options_graphics; close options_graphics_defaults; close options_control_defaults; exec "setfromdvar ui_r_picmip r_picmip"; exec "setfromdvar ui_r_picmip_bump r_picmip_bump"; exec "setfromdvar ui_r_picmip_spec r_picmip_spec"; exec "setfromdvar ui_r_picmip_manual r_picmip_manual"; setLocalVarBool ui_hideOptions 1; setLocalVarBool ui_showApply 0; } onClose { setLocalVarBool ui_hideOptions 0; } onESC { close options_graphics_texture; } #include "ui_mp/ls_options.inc" MENU_TITLE_SECTION( "@MENU_TEXTURE_SETTINGS", when( localvarBool( ui_hideOptions ) ) ) MENU_BUTTON_DVARLIST( 8, -20, 80, "@MENU_TEXTURE_MIPMAPS", r_texFilterMipMode, ITEM_TYPE_MULTI, dvarStrList { "@MENU_AUTOMATIC"; "Unchanged"; "@MENU_BILINEAR"; "Force Bilinear"; "@MENU_TRILINEAR"; "Force Trilinear" }, setLocalVarBool ui_showApply 1;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARSLIDER( 9, -20, 100, "@MENU_TEXTURE_ANISOTROPY", r_texFilterAnisoMin, 1, 1, 16, setLocalVarBool ui_showApply 1; , when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARLIST( 10, -20, 120, "@MENU_TEXTURE_QUALITY", ui_r_picmip_manual, ITEM_TYPE_MULTI, dvarFloatList { "@MENU_AUTOMATIC" 0 "@MENU_MANUAL" 1 }, setLocalVarBool ui_showApply 1;, when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARLIST_EX( 11, -20, 140, 220, "@MENU_TEXTURE_RESOLUTION", ui_r_picmip, ITEM_TYPE_MULTI, dvarFloatList { "@MENU_LOW" 3 "@MENU_NORMAL" 2 "@MENU_HIGH" 1 "@MENU_EXTRA" 0 }, setLocalVarBool ui_showApply 1;, when( localvarBool( ui_hideOptions ) && dvarInt( ui_r_picmip_manual ) ), "options") MENU_BUTTON_DVARLIST_EX( 12, -20, 160, 220, "@MENU_NORMAL_MAP_RESOLUTION", ui_r_picmip_bump, ITEM_TYPE_MULTI, dvarFloatList { "@MENU_LOW" 3 "@MENU_NORMAL" 2 "@MENU_HIGH" 1 "@MENU_EXTRA" 0 }, setLocalVarBool ui_showApply 1;, when( localvarBool( ui_hideOptions ) && dvarInt( ui_r_picmip_manual ) ), "options") MENU_BUTTON_DVARLIST_EX( 13, -20, 180, 220, "@MENU_SPECULAR_MAP_RESOLUTION", ui_r_picmip_spec, ITEM_TYPE_MULTI, dvarFloatList { "@MENU_LOW" 3 "@MENU_NORMAL" 2 "@MENU_HIGH" 1 "@MENU_EXTRA" 0 }, setLocalVarBool ui_showApply 1;, when( localvarBool( ui_hideOptions ) && dvarInt( ui_r_picmip_manual ) ), "options") itemDef { name apply text "@MENU_APPLY" type 1 style WINDOW_STYLE_FILLED textstyle ITEM_TEXTSTYLE_SHADOWED rect 200 -26 80 20 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM textfont UI_FONT_NORMAL textalign ITEM_ALIGN_LEFT textscale TEXTSIZE_SMALL textaligny 18 visible when( localVarBool( ui_showApply ) ); mouseEnter { play "mouse_over"; } action { play "mouse_click"; close self; open apply_picmip_popmenu; } } itemDef { name graphic_warning text "@MENU_GRAPHICS_WARNING" type 1 style WINDOW_STYLE_FILLED textstyle ITEM_TEXTSTYLE_SHADOWED rect 20 -116 240 240 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_BOTTOM textfont UI_FONT_NORMAL textalign ITEM_ALIGN_LEFT textscale TEXTSIZE_SMALL visible 1 mouseEnter { play "mouse_over"; } decoration autowrapped } } menuDef { name apply_picmip_popmenu fullScreen 0 rect 0 0 640 480 focusColor COLOR_FOCUSED soundloop "" onOpen { setLocalVarBool ui_showApply 0; execnow "setfromdvar r_picmip ui_r_picmip"; execnow "setfromdvar r_picmip_bump ui_r_picmip_bump"; execnow "setfromdvar r_picmip_spec ui_r_picmip_spec"; execnow "setfromdvar r_picmip_manual ui_r_picmip_manual"; exec "wait; wait; r_applyPicmip"; close apply_picmip_popmenu; open options_graphics_texture; } } menuDef { name options_sound fullScreen 0 rect 0 0 640 480 focusColor COLOR_FOCUSED soundloop "" onOpen { close options_look; close options_move; close options_shoot; close options_misc; close options_graphics; close options_game; close options_view; close options_defaults; close options_driverinfo; close options_credits; close options_multi; close options_graphics_defaults; close options_graphics_texture; close options_control_defaults; exec "setfromdvar ui_snd_khz snd_khz"; exec "setfromdvar ui_snd_enableEq snd_enableEq"; exec "setfromdvar ui_outputConfig snd_outputConfiguration"; setLocalVarBool ui_hideOptions 1; setLocalVarBool ui_showApply 0; } onClose { setLocalVarBool ui_hideOptions 0; } onESC { close options_sound; } #include "ui_mp/ls_options.inc" MENU_TITLE_SECTION( "@MENU_SOUND", when( localvarBool( ui_hideOptions ) ) ) MENU_BUTTON_DVARSLIDER( 8, -20, 80, "@MENU_MASTER_VOLUME", snd_volume, 0.8, 0.0, 1.0, ; , when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARLIST( 9, -20, 100, "@MENU_SOUND_EQ", ui_snd_enableEq, ITEM_TYPE_MULTI, dvarFloatList { "@MENU_OFF" 0 "@MENU_ON" 1 }, setLocalVarBool ui_showApply 1; , when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARLIST( 10, -20, 120, "@MENU_SOUND_QUALITY", ui_snd_khz, ITEM_TYPE_MULTI, dvarFloatList { "@MENU_11KHZ" 11 "@MENU_22KHZ" 22 "@MENU_44KHZ" 44 }, setLocalVarBool ui_showApply 1; , when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARLIST( 11, -20, 140, "@MENU_SPEAKER_CONFIG", ui_outputConfig, ITEM_TYPE_MULTI, dvarStrList { "@MENU_WINDOWS_DEFAULT"; "Windows default"; "@MENU_MONO"; "Mono"; "@MENU_STEREO"; "Stereo"; "@MENU_FOUR_SPEAKERS"; "4 speakers"; "@MENU_FIVE_ONE_SPEAKERS"; "5.1 speakers"; }, setLocalVarBool ui_showApply 1;, when( localvarBool( ui_hideOptions ) ), "options") itemDef { name apply text "@MENU_APPLY" type 1 style WINDOW_STYLE_FILLED textstyle ITEM_TEXTSTYLE_SHADOWED rect 200 -26 80 20 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM textfont UI_FONT_NORMAL textalign ITEM_ALIGN_LEFT textscale TEXTSIZE_SMALL textaligny 18 visible when( localVarBool( ui_showApply ) && dvarint( ui_multiplayer ) ); mouseEnter { play "mouse_over"; } action { play "mouse_click"; uiScript openMenuOnDvar sv_running 1 vid_restart_popmenu_listen; uiScript openMenuOnDvarNot sv_running 1 snd_restart_popmenu; } } } menuDef { name options_game fullScreen 0 rect 0 0 640 480 focusColor COLOR_FOCUSED soundloop "" onOpen { close options_look; close options_move; close options_shoot; close options_misc; close options_graphics; close options_sound; close options_view; close options_defaults; close options_driverinfo; close options_credits; close options_multi; close options_graphics_defaults; close options_graphics_texture; close options_control_defaults; setLocalVarBool ui_hideOptions 1; uiScript getLanguage; } onClose { setLocalVarBool ui_hideOptions 0; } onESC { close options_game; } #include "ui_mp/ls_options.inc" MENU_TITLE_SECTION( "@MENU_GAME_OPTIONS", when( localvarBool( ui_hideOptions ) ) ) MENU_BUTTON_DVARYESNO( 8, -20, 80, "@MENU_SHOW_BLOOD", cg_blood, ; , when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARLIST( 9, -20, 100, "@MENU_ENABLE_CONSOLE", monkeytoy, ITEM_TYPE_MULTI, dvarFloatList{ "@MENU_YES" 0 "@MENU_NO" 1 }, ; ,when( localvarBool( ui_hideOptions ) ), "options") } menuDef { name options_multi fullScreen 0 rect 0 0 640 480 focusColor COLOR_FOCUSED soundloop "" onOpen { close options_look; close options_move; close options_shoot; close options_graphics; close options_sound; close options_game; close options_view; close options_defaults; close options_driverinfo; close options_credits; close options_graphics_defaults; close options_graphics_texture; close options_control_defaults; exec "setfromdvar ui_name name"; setLocalVarBool ui_hideOptions 1; } onClose { exec "setfromdvar name ui_name"; setLocalVarBool ui_hideOptions 0; } onESC { close options_multi; } #include "ui_mp/ls_options.inc" MENU_TITLE_SECTION( "@MENU_MULTIPLAYER_OPTIONS", when( localvarBool( ui_hideOptions ) ) ) MENU_BUTTON_DVARYESNO( 8, -20, 80, "@MPUI_PUNKBUSTER", cl_punkbuster, ; , when( localvarBool( ui_hideOptions ) ), "options") MENU_BUTTON_DVARYESNO( 9, -20, 100, "@MENU_ALLOW_DOWNLOAD", cl_allowdownload, ; , when( localvarBool( ui_hideOptions ) ), "options") MENU_SEPLINE_EX( -40, 123, 0.4, HORIZONTAL_ALIGN_CENTER, VERTICAL_ALIGN_TOP, when( localvarBool( ui_hideOptions ) )) MENU_BUTTON_DVAREDIT( 10, -20, 125, "@MENU_PLAYER_NAME", ui_name, 15, 15, ; , when( localvarBool( ui_hideOptions ) ), "options") //CHOICE_BUTTON( 25, "@MENU_ENTER_KEY_CODE", open cdkey_menu; ) } #include "ui_mp/popupstyle.inc" menuDef { #define LOCAL_MP_ACTION \ play "mouse_click"; \ uiScript "setRecommended"; \ exec "wait; wait; r_applyPicmip;"; \ close self; MENU_CENTERPOPUP_SETUP( options_graphics_defaults, "@MENU_RESET_SYSTEM_DEFAULTS", "This will restore all system settings to default, are you sure?", 280, 140, 2) MENU_CENTERPOPUP_BUTTON( 1, 0, 88, "YES", 276, 22, LOCAL_MP_ACTION ) MENU_CENTERPOPUP_BUTTON( 2, 0, 110, "NO", 276, 22, close self; ) } }
Сообщение отредактировал Firex - Четверг, 28.02.2013, 19:54
Firex Дата: Четверг, 28.02.2013, 19:23 | Сообщение # 3
---vid_restart.menu
Код
#include "ui/menudef.h" #define CHOICE_GROUP "vid_restart" #include "ui_mp/menustyle.inc" #define LOCAL_SETTING_ACTION \ exec "exec options_graphics_set.cfg"; \ execondvarstringvalue ui_zfeather 0 "set cg_laserLight 0"; \ execondvarstringvalue ui_zfeather 1 "set cg_laserLight 1"; \ close self; \ exec "vid_restart"; { #include "ui_mp/popupstyle.inc" menuDef { MENU_CENTERPOPUP_SETUP( vid_restart_popmenu, "WARNING", "@MENU_APPLY_SETTINGS", 280, 120, 2) MENU_CENTERPOPUP_BUTTON( 1, 0, 68, "YES", 276, 22, LOCAL_SETTING_ACTION ) MENU_CENTERPOPUP_BUTTON( 2, 0, 90, "NO", 276, 22, close self ) } menuDef { MENU_CENTERPOPUP_SETUP( vid_restart_popmenu_listen, "SORRY :(", "Unable to apply settings while connected to a server.", 280, 100, 2) MENU_CENTERPOPUP_BUTTON( 1, 0, 70, "OK", 276, 22, close self; ) } }
---snd_restart.menu
Код
#include "ui/menudef.h" #define CHOICE_GROUP "snd_restart" #include "ui_mp/menustyle.inc" { #include "ui_mp/popupstyle.inc" menuDef { MENU_CENTERPOPUP_SETUP( snd_restart_popmenu, "WARNING", "@MENU_APPLY_SETTINGS", 280, 120, 2) MENU_CENTERPOPUP_BUTTON( 1, 0, 68, "YES", 276, 22, exec "setfromdvar snd_khz ui_snd_khz"; exec "setfromdvar snd_outputConfiguration ui_OutputConfig"; exec "setfromdvar snd_enableEq ui_snd_enableEq"; close snd_restart_popmenu; exec "snd_restart"; ) MENU_CENTERPOPUP_BUTTON( 2, 0, 90, "NO", 276, 22, close self ) } }
2. Для вникания добавляем/убираем парочку вещиц(по желанию). И не выходя мысленно из этих файлов переходим к следующему разделу урока. Назначение наших библиотек оформления: 1. Раз уж вы взяли мои menu файлы, то без моих библиотек они работать не будут C: ---ls_options.inc
Код
MENU_TITLE( "OPTIONS", when( localvarBool( ui_hideOptions ) ) ) MENU_SEPLINE( 110, 78, 0.4, when( localvarBool( ui_hideOptions ) )) MENU_BUTTON_MAIN( 1, -20, 80, "@MENU_GRAPHICS", open options_graphics;, when( localvarBool( ui_hideOptions ) ), "options" ) MENU_BUTTON_MAIN( 2, -20, 100, "@MENU_TEXTURE_SETTINGS", open options_graphics_texture;, when( localvarBool( ui_hideOptions ) ), "options" ) MENU_BUTTON_MAIN( 3, -20, 120, "@MENU_SOUND", open options_sound;, when( localvarBool( ui_hideOptions ) ), "options" ) MENU_BUTTON_MAIN( 5, -20, 140, "@MENU_GAME_OPTIONS", open options_game;, when( localvarBool( ui_hideOptions ) ), "options" ) MENU_BUTTON_MAIN( 6, -20, 160, "@MENU_MULTIPLAYER_OPTIONS", open options_multi;, when( localvarBool( ui_hideOptions ) ), "options" ) MENU_SEPLINE( 110, 183, 0.4, when( localvarBool( ui_hideOptions ) )) MENU_BUTTON_MAIN( 7, -20, 185, "@MENU_RESET_SYSTEM_DEFAULTS", open options_graphics_defaults;, when( localvarBool( ui_hideOptions ) ), "options" )
---main_bg.inc
Код
#undef FOG_SCROLL_TIME #define FOG_SCROLL_TIME 60000 #undef THINFOG_SCROLL_TIME #define THINFOG_SCROLL_TIME 100000 itemDef { style WINDOW_STYLE_SHADER rect FULLSCREEN_WIDE background "background_image" visible 1 decoration } itemDef { style WINDOW_STYLE_SHADER rect -107 0 1708 480 exp rect X((-107) - ((float(milliseconds() % FOG_SCROLL_TIME) / FOG_SCROLL_TIME) * (854))) background "animbg_fogscroll" forecolor 1 1 1 0.55 visible 1 decoration } itemDef { style WINDOW_STYLE_SHADER rect -107 0 1708 480 exp rect X((-961) + ((float(milliseconds() % THINFOG_SCROLL_TIME) / THINFOG_SCROLL_TIME) * (854))) background "animbg_fogscrollthin" forecolor 1 1 1 0.55 visible 1 decoration } itemDef { style WINDOW_STYLE_FILLED rect 0 0 640 480 HORIZONTAL_ALIGN_FULLSCREEN VERTICAL_ALIGN_FULLSCREEN backcolor 0 0 0 0.28 visible 1 decoration }
---menustyle.inc
Код
//Written by Firex //Copying is forbidden! #ifndef CHOICE_GROUP #define CHOICE_GROUP "" #endif #define MENU_TITLE( textArg, visArg ) \ itemDef \ { \ type ITEM_TYPE_TEXT \ rect 255 50 0 0 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP \ forecolor 1 1 1 1 \ exp text( textArg ) \ textfont UI_FONT_OBJECTIVE \ textscale 0.51 \ textstyle 0 \ textalign ITEM_ALIGN_TOP_RIGHT \ textaligny 0 \ textalignx 0 \ visible visArg \ decoration \ } #define MENU_TITLE_SECTION( textArg, visArg ) \ itemDef \ { \ type ITEM_TYPE_TEXT \ rect -20 50 0 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP \ forecolor 1 1 1 1 \ exp text( textArg ) \ textfont UI_FONT_OBJECTIVE \ textscale 0.49 \ textstyle 0 \ textalign ITEM_ALIGN_TOP_LEFT \ textaligny 0 \ textalignx 0 \ visible visArg \ decoration \ } #define MENU_BUTTON_BIGMAIN( indexArg, rectXArg, rectYArg, materialColArg, materialBluArg, textArg, textbArg, actionArg, groupArg ) \ itemDef \ { \ style WINDOW_STYLE_FILLED \ rect (rectXArg) (rectYArg - 128) 180 18 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \ backcolor 0.160 0.176 0.164 1 \ visible 1 \ decoration \ } \ itemDef \ { \ style WINDOW_STYLE_FILLED \ rect (rectXArg) (rectYArg) 180 18 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \ backcolor 0.488 0.520 0.465 1 \ visible when( localVarInt( ui_highlight ) == indexArg && localVarString( ui_choicegroup ) == groupArg ); \ decoration \ } \ itemDef \ { \ style WINDOW_STYLE_FILLED \ rect (rectXArg) (rectYArg) 180 18 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \ backcolor 0.160 0.176 0.164 1 \ visible when( localVarInt( ui_highlight ) != indexArg ); \ decoration \ } \ itemDef \ { \ style ITEM_TYPE_TEXT \ rect (rectXArg) (rectYArg) 180 18 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \ forecolor 1 1 1 1 \ exp text( textbArg ) \ textfont UI_FONT_OBJECTIVE \ textscale 0.42 \ textstyle 0 \ textalign ITEM_ALIGN_MIDDLE_CENTER \ visible when( localVarInt( ui_highlight ) == indexArg && localVarString( ui_choicegroup ) == groupArg ); \ decoration \ } \ itemDef \ { \ style ITEM_TYPE_TEXT \ rect (rectXArg) (rectYArg - 128) 180 18 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \ forecolor 0.504 0.504 0.504 1 \ exp text( textArg ) \ textfont UI_FONT_OBJECTIVE \ textscale 0.42 \ textstyle 0 \ textalign ITEM_ALIGN_MIDDLE_CENTER \ visible when( localVarInt( ui_highlight ) != indexArg); \ decoration \ } \ itemDef \ { \ style ITEM_TYPE_TEXT \ rect (rectXArg) (rectYArg - 128) 180 18 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \ forecolor 1 1 1 1 \ exp text( textArg ) \ textfont UI_FONT_OBJECTIVE \ textscale 0.42 \ textstyle 0 \ textalign ITEM_ALIGN_MIDDLE_CENTER \ visible when( localVarInt( ui_highlight ) == indexArg && localVarString( ui_choicegroup ) == groupArg ); \ decoration \ } \ itemDef \ { \ style WINDOW_STYLE_SHADER \ rect (rectXArg) (rectYArg - 110) 180 110 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \ forecolor 1 1 1 1 \ background materialBluArg \ visible when( localVarInt( ui_highlight ) != indexArg ); \ decoration \ } \ itemDef \ { \ style WINDOW_STYLE_SHADER \ rect (rectXArg) (rectYArg - 110) 180 110 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \ forecolor 1 1 1 1 \ background materialColArg \ visible when( localVarInt( ui_highlight ) == indexArg && localVarString( ui_choicegroup ) == groupArg ); \ decoration \ } \ itemDef \ { \ style WINDOW_STYLE_SHADER \ rect (rectXArg) (rectYArg - 110) 180 5 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \ forecolor 1 1 1 1 \ exp material("gradient_top"); \ border 0 \ bordersize 0 \ bordercolor 0 0 0 0 \ visible 1 \ decoration \ } \ itemDef \ { \ style WINDOW_STYLE_SHADER \ rect (rectXArg) (rectYArg - 5) 180 5 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \ forecolor 1 1 1 1 \ exp material("gradient_bottom"); \ border 0 \ bordersize 0 \ bordercolor 0 0 0 0 \ visible 1 \ decoration \ } \ itemDef \ { \ type ITEM_TYPE_BUTTON \ rect (rectXArg) (rectYArg - 128) 180 146 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \ forecolor 1 1 1 1 \ visible 1 \ MENU_BODY_SCRIPTACTIONS( indexArg, actionArg, groupArg ) \ } #define MENU_SEPLINE( rectXArg, rectYArg, sizeArg, visArg ) \ MENU_SEPLINE_EX( rectXArg, rectYArg, sizeArg, HORIZONTAL_ALIGN_DEFAULT, VERTICAL_ALIGN_DEFAULT, visArg ) #define MENU_SEPLINE_EX( rectXArg, rectYArg, sizeArg, alignXArg, alignYArg, visArg ) \ itemDef \ { \ style WINDOW_STYLE_SHADER \ rect (rectXArg) (rectYArg) 170 (sizeArg) alignXArg alignYArg \ forecolor 1 1 1 1 \ exp material("line_horizontal"); \ border 0 \ bordersize 0 \ bordercolor 0 0 0 0 \ visible visArg \ decoration \ } #define MENU_BUTTON_MAIN( indexArg, rectXArg, rectYArg, textArg, actionArg, visArg, groupArg ) \ itemDef \ { \ style WINDOW_STYLE_SHADER \ rect (rectXArg) (rectYArg) 300 18 HORIZONTAL_ALIGN_DEFAULT VERTICAL_ALIGN_DEFAULT \ background "gradient_fadein" \ forecolor 0.445 0.457 0.527 1 \ /*0.488 0.520 0.465 1*/ visible when( localVarInt( ui_highlight ) == indexArg && localVarString( ui_choicegroup ) == groupArg ); \ decoration \ } \ itemDef \ { \ style WINDOW_STYLE_SHADER \ rect (rectXArg) (rectYArg + 18) 300 4 HORIZONTAL_ALIGN_DEFAULT VERTICAL_ALIGN_DEFAULT \ forecolor 1 1 1 0.7 \ exp material("gradient_top"); \ border 0 \ bordersize 0 \ bordercolor 0 0 0 0 \ visible when( localVarInt( ui_highlight ) == indexArg && localVarString( ui_choicegroup ) == groupArg ); \ decoration \ } \ itemDef \ { \ type ITEM_TYPE_BUTTON \ rect (rectXArg) (rectYArg) 300 18 HORIZONTAL_ALIGN_DEFAULT VERTICAL_ALIGN_DEFAULT \ exp text( textArg ); \ textfont UI_FONT_OBJECTIVE \ textscale 0.39 \ textstyle ITEM_TEXTSTYLE_SHADOWED \ textAlign ITEM_ALIGN_MIDDLE_RIGHT \ textAlignX -25 \ forecolor 1 1 1 1 \ visible visArg \ MENU_BODY_SCRIPTACTIONS( indexArg, actionArg, groupArg ) \ } #define MENU_BUTTON_DVARSLIDER( indexArg, rectXArg, rectYArg, textArg, dvarArg, defaultArg, minArg, maxArg, actionArg, visArg, groupArg ) \ MENU_BUTTON_DVARSLIDER_EX( indexArg, rectXArg, rectYArg, 190, textArg, dvarArg, defaultArg, minArg, maxArg, actionArg, visArg, groupArg ) #define MENU_BUTTON_DVARSLIDER_EX( indexArg, rectXArg, rectYArg, alignXArg, textArg, dvarArg, defaultArg, minArg, maxArg, actionArg, visArg, groupArg ) \ MENU_BODY_DVAROPTIONS( indexArg, rectXArg, rectYArg, textArg, actionArg, visArg, groupArg ) \ itemDef \ { \ type ITEM_TYPE_SLIDER \ dvarfloat dvarArg defaultArg minArg maxArg \ rect (rectXArg) (rectYArg) 260 18 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP \ textfont UI_FONT_OBJECTIVE \ textalign ITEM_ALIGN_MIDDLE_LEFT \ textalignx alignXArg \ textscale 0.35 \ textstyle ITEM_TEXTSTYLE_SHADOWED \ style WINDOW_STYLE_FILLED \ forecolor 1 1 1 1 \ visible visArg \ MENU_BODY_SCRIPTACTIONS( indexArg, actionArg, groupArg ) \ } #define MENU_BUTTON_DVAREDIT( indexArg, rectXArg, rectYArg, textArg, dvarArg, max_chars, max_paintchars, actionArg, visArg, groupArg ) \ MENU_BODY_DVAROPTIONS( indexArg, rectXArg, rectYArg, textArg, actionArg, visArg, groupArg ) \ itemDef \ { \ type ITEM_TYPE_EDITFIELD \ text " " \ dvar dvarArg \ rect (rectXArg) (rectYArg) 260 18 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP \ textfont UI_FONT_OBJECTIVE \ textalign ITEM_ALIGN_MIDDLE_LEFT \ textalignx 170 \ textscale 0.35 \ textstyle ITEM_TEXTSTYLE_SHADOWED \ style WINDOW_STYLE_FILLED \ forecolor 1 1 1 1 \ visible visArg \ maxChars max_chars \ maxpaintchars max_paintchars \ MENU_BODY_SCRIPTACTIONS( indexArg, actionArg, groupArg ) \ } #define MENU_BUTTON_DVARLIST( indexArg, rectXArg, rectYArg, textArg, dvarArg, listTypeArg, listArg, actionArg, visArg, groupArg ) \ MENU_BUTTON_DVARLIST_EX( indexArg, rectXArg, rectYArg, 190, textArg, dvarArg, listTypeArg, listArg, actionArg, visArg, groupArg ) #define MENU_BUTTON_DVARLIST_EX( indexArg, rectXArg, rectYArg, alignXArg, textArg, dvarArg, listTypeArg, listArg, actionArg, visArg, groupArg ) \ MENU_BODY_DVAROPTIONS( indexArg, rectXArg, rectYArg, textArg, actionArg, visArg, groupArg ) \ itemDef \ { \ type listTypeArg \ dvar dvarArg \ listArg \ rect (rectXArg) (rectYArg) 260 18 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP \ textfont UI_FONT_OBJECTIVE \ textalign ITEM_ALIGN_MIDDLE_LEFT \ textalignx alignXArg \ textscale 0.35 \ textstyle ITEM_TEXTSTYLE_SHADOWED \ style WINDOW_STYLE_FILLED \ forecolor 1 1 1 1 \ visible visArg \ MENU_BODY_SCRIPTACTIONS( indexArg, actionArg, groupArg ) \ } #define MENU_BUTTON_DVARYESNO( indexArg, rectXArg, rectYArg, textArg, dvarArg, actionArg, visArg, groupArg ) \ MENU_BODY_DVAROPTIONS( indexArg, rectXArg, rectYArg, textArg, actionArg, visArg, groupArg ) \ itemDef \ { \ type ITEM_TYPE_YESNO \ dvar dvarArg \ rect (rectXArg) (rectYArg) 260 18 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP \ textfont UI_FONT_OBJECTIVE \ textalign ITEM_ALIGN_MIDDLE_LEFT \ textalignx 190 \ textscale 0.35 \ textstyle ITEM_TEXTSTYLE_SHADOWED \ style WINDOW_STYLE_FILLED \ forecolor 1 1 1 1 \ visible visArg \ MENU_BODY_SCRIPTACTIONS( indexArg, actionArg, groupArg ) \ } #define MENU_FOOTNOTE( x, y, sx, sy, textArg, scaleArg, alignArg, styleArg, fontArg, visArg ) \ itemDef \ { \ exp text( textArg )\ rect x y sx sy HORIZONTAL_ALIGN_DEFAULT VERTICAL_ALIGN_DEFAULT \ autowrapped \ textfont fontArg \ textscale scaleArg \ textstyle styleArg \ textalign alignArg \ visible visArg \ decoration \ } //* //Все "тела" для функций дизайна. //Written by Firex //Copying is forbidden! //* #define MENU_BODY_SCRIPTACTIONS( indexArg, actionArg, groupArg ) \ onFocus \ { \ play "mouse_over"; \ setLocalVarInt ui_highlight indexArg; \ setLocalVarString ui_choicegroup groupArg; \ } \ leaveFocus \ { \ setLocalVarInt ui_highlight 0; \ } \ action \ { \ play "mouse_click"; \ actionArg; \ } #define MENU_BODY_DVAROPTIONS( indexArg, rectXArg, rectYArg, textArg, actionArg, visArg, groupArg ) \ itemDef \ { \ style WINDOW_STYLE_SHADER \ rect (rectXArg) (rectYArg) -260 18 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP \ background "gradient_fadein" \ forecolor 0.445 0.457 0.527 1 \ /*0.488 0.520 0.465 1*/ visible when( localVarInt( ui_highlight ) == indexArg && localVarString( ui_choicegroup ) == groupArg ); \ decoration \ } \ itemDef \ { \ style WINDOW_STYLE_SHADER \ rect (rectXArg) (rectYArg + 18) -260 4 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP \ forecolor 1 1 1 0.7 \ exp material("gradient_top"); \ border 0 \ bordersize 0 \ bordercolor 0 0 0 0 \ visible when( localVarInt( ui_highlight ) == indexArg && localVarString( ui_choicegroup ) == groupArg ); \ decoration \ } \ itemDef \ { \ type ITEM_TYPE_BUTTON \ rect (rectXArg) (rectYArg) 260 18 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP \ exp text( textArg ); \ textfont UI_FONT_OBJECTIVE \ textscale 0.35 \ textstyle ITEM_TEXTSTYLE_SHADOWED \ textAlign ITEM_ALIGN_MIDDLE_LEFT \ textAlignX 1 \ forecolor 1 1 1 1 \ visible visArg \ }
Сообщение отредактировал Firex - Четверг, 28.02.2013, 19:33