├── .gitignore ├── README.md ├── _assets ├── gh │ ├── preview_iw3.png │ ├── preview_iw4.png │ └── preview_iw5.png ├── iw_uimod.iwd └── uimod.ff ├── code.txt ├── connect.menu ├── createserver.menu ├── includes ├── macros.h ├── menudef.h └── styles.h ├── ingame.txt ├── main_text.menu ├── menus.txt ├── mods_menu.menu ├── quit_popmenu.menu ├── scriptmenus └── class.menu └── styles ├── iw3.h ├── iw4.h └── iw5.h /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ui-mod 2 | Recreation of IW3, IW4 and IW5 menus for Modern Warfare 2. Primarily a fun project, but can be used to help with IW4/IW5 menu development as only decompiled menu code is available. 3 | 4 | ![IW3 Preview](https://raw.githubusercontent.com/simonlfc/ui-mod/master/_assets/gh/preview_iw3.png) 5 | ![IW4 Preview](https://raw.githubusercontent.com/simonlfc/ui-mod/master/_assets/gh/preview_iw4.png) 6 | ![IW5 Preview](https://raw.githubusercontent.com/simonlfc/ui-mod/master/_assets/gh/preview_iw5.png) 7 | -------------------------------------------------------------------------------- /_assets/gh/preview_iw3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonlfc/ui-mod/1df1559296e8c1e7e20b1bb51b37722112704d85/_assets/gh/preview_iw3.png -------------------------------------------------------------------------------- /_assets/gh/preview_iw4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonlfc/ui-mod/1df1559296e8c1e7e20b1bb51b37722112704d85/_assets/gh/preview_iw4.png -------------------------------------------------------------------------------- /_assets/gh/preview_iw5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonlfc/ui-mod/1df1559296e8c1e7e20b1bb51b37722112704d85/_assets/gh/preview_iw5.png -------------------------------------------------------------------------------- /_assets/iw_uimod.iwd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonlfc/ui-mod/1df1559296e8c1e7e20b1bb51b37722112704d85/_assets/iw_uimod.iwd -------------------------------------------------------------------------------- /_assets/uimod.ff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/simonlfc/ui-mod/1df1559296e8c1e7e20b1bb51b37722112704d85/_assets/uimod.ff -------------------------------------------------------------------------------- /code.txt: -------------------------------------------------------------------------------- 1 | { 2 | loadmenu { "ui_mp/connect.menu" } 3 | } -------------------------------------------------------------------------------- /connect.menu: -------------------------------------------------------------------------------- 1 | #include "ui_mp/includes/menudef.h" 2 | #include "ui_mp/includes/macros.h" 3 | #include "ui_mp/includes/styles.h" 4 | 5 | #define MENU_NAME "connect" 6 | 7 | // STYLE_OPEN doesn't work here, we can't open another menuDef on the loadscreen 8 | menuDef 9 | { 10 | name MENU_NAME 11 | rect 0 0 640 480 0 0 12 | focuscolor 1 1 1 1 13 | onOpen 14 | { 15 | exec "selectStringTableEntryInDvar mp/didyouknow.csv 0 didyouknow"; 16 | } 17 | 18 | CREATE_SHADER( 0 0 640 480 4 4, "$levelbriefing", 1 1 1 1 ) 19 | 20 | // IW3 21 | CREATE_SHADER_VIS( -130 -20 260 4 2 3, "white", 0 0 0 1, IS_IW3 ) 22 | itemDef 23 | { 24 | name "loadbar" 25 | rect -129 -19 258 2 2 3 26 | style 6 27 | forecolor 1 1 1 1 28 | exp material ( "white" ) 29 | visible when ( IS_IW3 ) 30 | decoration 31 | } 32 | 33 | CREATE_SHADER_VIS( 35 250 285 140 0 0, "white", 0 0 0 0.5, IS_IW3 ) 34 | CREATE_SHADER_EX( 36 251 283 138 0 0, "white", 0.5 0.5 0.5 0.15, IS_IW3, 35 | border 1; 36 | bordersize 1; 37 | bordercolor 0.5 0.5 0.5 0.7 ) 38 | CREATE_TEXT( 42 228 0 0 0 0, "@MENU_INTEL", 1 0.8 0.4 1, IS_IW3, 39 | textfont UI_FONT_DEFAULT; 40 | textalign ITEM_ALIGN_TOP_LEFT; 41 | textscale TEXTSIZE_DEFAULT ) 42 | CREATE_TEXT( 42 255 270 140 0 0, dvarString( "didyouknow" ), 1 1 1 1, IS_IW3, 43 | textfont UI_FONT_DEFAULT; 44 | textalign ITEM_ALIGN_TOP_LEFT; 45 | textscale TEXTSIZE_SMALL; 46 | autowrapped ) 47 | 48 | CREATE_TEXT( 0 70 640 480 0 0, gametypename(), 1 1 1 1, IS_IW3, 49 | textfont UI_FONT_OBJECTIVE; 50 | textalign ITEM_ALIGN_TOP_CENTER; 51 | textstyle ITEM_TEXTSTYLE_SHADOWEDMORE; 52 | textscale 0.5; 53 | glowcolor 0.2 0.6 0.2 0.15 ) 54 | 55 | CREATE_TEXT( 0 100 640 480 0 0, getmapname(), 1 1 1 1, IS_IW3, 56 | textfont UI_FONT_OBJECTIVE; 57 | textalign ITEM_ALIGN_TOP_CENTER; 58 | textstyle ITEM_TEXTSTYLE_SHADOWEDMORE; 59 | textscale 0.5; 60 | glowcolor 0.2 0.6 0.2 0.15 ) 61 | 62 | CREATE_TEXT( 0 130 640 480 0 0, connectioninfo(), 1 1 1 1, IS_IW3, 63 | textfont UI_FONT_OBJECTIVE; 64 | textalign ITEM_ALIGN_TOP_CENTER; 65 | textstyle ITEM_TEXTSTYLE_SHADOWEDMORE; 66 | textscale 0.5 ) 67 | 68 | // IW4 69 | CREATE_SHADER_VIS( -426.667 -236 853.333 -400 2 1, "gradient_bottom", 1 1 1 1, IS_IW4 ) 70 | CREATE_SHADER_VIS( -426.667 -163 853.333 200 2 3, "gradient_bottom", 1 1 1 1, IS_IW4 ) 71 | CREATE_SHADER_VIS( -320 -60 640 1.33333 2 3, "white", 1 1 1 0.3, IS_IW4 ) 72 | itemDef 73 | { 74 | name "loadbar" 75 | rect -320 -60 640 1.33333 2 3 76 | style 6 77 | forecolor 1 1 1 1 78 | exp material ( "white" ) 79 | visible when ( IS_IW4 ) 80 | decoration 81 | } 82 | CREATE_SHADER_VIS( -104 -56 128 64 3 3, "logo_iw", 1 1 1 1, IS_IW4 ) 83 | 84 | CREATE_TEXT( -8 26 0 26 3 1, getmapname(), 1 1 1 1, IS_IW4, 85 | textfont UI_FONT_LARGE; 86 | textalign ITEM_ALIGN_TOP_RIGHT; 87 | textstyle ITEM_TEXTSTYLE_SHADOWED; 88 | textscale 0.5833 ) 89 | 90 | CREATE_TEXT( -8 0 0 26 3 1, gametypename(), 1 0.8 0.4 1, IS_IW4, 91 | textfont UI_FONT_LARGE; 92 | textalign ITEM_ALIGN_TOP_RIGHT; 93 | textstyle ITEM_TEXTSTYLE_SHADOWED; 94 | textscale 0.5833 ) 95 | 96 | CREATE_TEXT( -8 56 0 26 3 1, connectioninfo(), 1 1 1 1, IS_IW4, 97 | textfont UI_FONT_SMALL; 98 | textalign ITEM_ALIGN_TOP_RIGHT; 99 | textstyle ITEM_TEXTSTYLE_SHADOWED; 100 | textscale 0.375 ) 101 | 102 | CREATE_TEXT( 80 -86 0 2 1 3, "@MENU_INTEL", 1 0.8 0.4 1, IS_IW4, 103 | textfont UI_FONT_LARGE; 104 | textalign ITEM_ALIGN_TOP_LEFT; 105 | textscale 0.5833 ) 106 | 107 | CREATE_TEXT( 124 -56 484 2 1 3, dvarString( "didyouknow" ), 1 1 1 1, IS_IW4, 108 | textfont UI_FONT_SMALL; 109 | textalign ITEM_ALIGN_TOP_LEFT; 110 | textscale 0.375; 111 | autowrapped ) 112 | 113 | // IW5 114 | CREATE_SHADER_VIS( -426.667 -236 853.333 -400 2 1, "gradient_bottom", 1 1 1 1, IS_IW5 ) 115 | CREATE_SHADER_VIS( -426.667 -163 853.333 200 2 3, "gradient_bottom", 1 1 1 1, IS_IW5 ) 116 | CREATE_SHADER_VIS( 32 -71 661 7 1 3, "white", 0.2 0.2 0.2 1, IS_IW5 ) 117 | itemDef 118 | { 119 | name "loadbar" 120 | rect 32 -71 661 7 1 3 121 | style 6 122 | forecolor 0.6 0.6314 0.6 1 123 | exp material ( "white" ) 124 | visible when ( IS_IW5 ) 125 | decoration 126 | } 127 | 128 | CREATE_TEXT( 32 29 280 14 1 1, gametypename(), 1 1 1 1, IS_IW5, 129 | textfont UI_FONT_LARGE; 130 | textalign ITEM_ALIGN_TOP_LEFT; 131 | textstyle ITEM_TEXTSTYLE_OUTLINED; 132 | textscale 0.5883 ) 133 | 134 | CREATE_TEXT( 32 55 280 10 1 1, getmapname(), 0.7843 0.7843 0.7843 1, IS_IW5, 135 | textfont UI_FONT_LARGE; 136 | textalign ITEM_ALIGN_TOP_LEFT; 137 | textstyle ITEM_TEXTSTYLE_OUTLINED; 138 | textscale 0.4583 ) 139 | 140 | CREATE_TEXT( -32 -92 0 26 3 3, connectioninfo(), 1 1 1 1, IS_IW5, 141 | textfont UI_FONT_SMALL; 142 | textalign ITEM_ALIGN_TOP_RIGHT; 143 | textscale 0.375 ) 144 | 145 | CREATE_TEXT( 32 -92 410 2 1 3, "@MENU_INTEL", 1 1 1 1, IS_IW5, 146 | textfont UI_FONT_LARGE; 147 | textalign ITEM_ALIGN_TOP_LEFT; 148 | textstyle ITEM_TEXTSTYLE_OUTLINED; 149 | textscale 0.4583 ) 150 | 151 | CREATE_TEXT( 32 -64 504 2 1 3, dvarString( "didyouknow" ), 1 1 1 1, IS_IW5, 152 | textfont UI_FONT_SMALL; 153 | textalign ITEM_ALIGN_TOP_LEFT; 154 | textscale 0.375; 155 | autowrapped ) 156 | 157 | STYLE_WIDGET 158 | } -------------------------------------------------------------------------------- /createserver.menu: -------------------------------------------------------------------------------- 1 | #include "ui_mp/includes/menudef.h" 2 | #include "ui_mp/includes/macros.h" 3 | #include "ui_mp/includes/styles.h" 4 | 5 | #define MENU_NAME "createserver" 6 | 7 | menuDef 8 | { 9 | ADD_BASE_MENU 10 | onOpen 11 | { 12 | uiScript "loadArenas"; 13 | setDvar "xblive_rankedmatch" false; 14 | setDvar "xblive_privatematch" true; 15 | exec "exec dvar_defaults.cfg"; 16 | } 17 | } 18 | 19 | #undef IW3_CHOICE_VERTICAL_ALIGN #define IW3_CHOICE_VERTICAL_ALIGN VERTICAL_ALIGN_TOP 20 | #undef IW3_CHOICE_X_SIZE #define IW3_CHOICE_X_SIZE 180 21 | #undef IW3_CHOICE_X_START #define IW3_CHOICE_X_START 72 22 | #undef IW3_CHOICE_Y_START #define IW3_CHOICE_Y_START -1 23 | 24 | menuDef 25 | { 26 | ADD_STYLED_MENU( iw3 ) 27 | 28 | IW3_BG_BLUR 29 | IW3_BG_NAV( "Private Match" ) 30 | 31 | IW3_CREATE_BUTTON( 0, "Start Match", ; ) 32 | IW3_CREATE_BUTTON( 1, "Game Setup", ; ) 33 | IW3_CREATE_SEPARATOR( 2 ) 34 | IW3_CREATE_BUTTON( 2.5, "Create a Class", ; ) 35 | IW3_CREATE_BUTTON( 3.5, "Callsign & Killstreaks", ; ) 36 | STYLE_WIDGET 37 | } 38 | 39 | #undef IW4_CHOICE_Y_START #define IW4_CHOICE_Y_START 28 40 | 41 | menuDef 42 | { 43 | ADD_STYLED_MENU( iw4 ) 44 | 45 | IW4_BG( "PRIVATE MATCH", false ) 46 | IW4_CREATE_BUTTON( 0, "START MATCH", ; ) 47 | IW4_CREATE_BUTTON( 1, "GAME SETUP", ; ) 48 | IW4_CREATE_SEPARATOR( 2 ) 49 | IW4_CREATE_BUTTON( 2, "CREATE A CLASS", ; ) 50 | IW4_CREATE_BUTTON( 3, "CALLSIGN & KILLSTREAKS", ; ) 51 | 52 | CREATE_SHADER( 0 -199 216 122 1 3, "preview_" + dvarstring( "ui_mapname" ), 1 1 1 1 ) 53 | CREATE_SHADER( 0 -199 216 20 1 3, "white", 0 0 0 0.5 ) 54 | CREATE_SHADER( 0 -97 216 20 1 3, "white", 0 0 0 0.5 ) 55 | CREATE_TEXT( 0 -199 216 20 1 3, dvarstring( "party_mapname" ), 1 1 1 1, true, 56 | textfont UI_FONT_DEFAULT; 57 | textalign ITEM_ALIGN_TOP_RIGHT; 58 | textalignx -4 59 | textscale 0.375; 60 | autowrapped ) 61 | CREATE_TEXT( 0 -97 216 20 1 3, dvarstring( "party_gametype" ), 1 1 1 0.65, true, 62 | textfont UI_FONT_DEFAULT; 63 | textalign ITEM_ALIGN_TOP_RIGHT; 64 | textalignx -4 65 | textscale 0.375; 66 | autowrapped ) 67 | 68 | CREATE_TEXT( -272 0 200 18 3 1, locstring( "@MPUI_RECOMMENDEDPLAYERS", int( min( dvarint( "party_maxplayers" ), maxrecommendedplayers() ) ) ), 1 1 1 1, privatepartyhost(), 69 | textfont UI_FONT_DEFAULT; 70 | textalign ITEM_ALIGN_TOP_LEFT; 71 | textalignx 20; 72 | textscale 0.375; 73 | autowrapped ) 74 | 75 | CREATE_TEXT( -272 -42 272 18 3 3, dvarstring( "party_lobbyPlayerCount" ), 1 1 1 0.15, true, 76 | textfont UI_FONT_LARGE; 77 | textalign ITEM_ALIGN_TOP_RIGHT; 78 | textscale 0.5833; 79 | autowrapped ) 80 | 81 | STYLE_WIDGET 82 | } 83 | 84 | menuDef 85 | { 86 | ADD_STYLED_MENU( iw5 ) 87 | 88 | IW5_BG( "PRIVATE MATCH", true ) 89 | IW5_CREATE_SEPARATOR( 0 ) 90 | IW5_CREATE_BUTTON( 0, "START MATCH", ; ) 91 | IW5_CREATE_BUTTON( 1, "GAME SETUP", ; ) 92 | IW5_CREATE_SEPARATOR( 2 ) 93 | IW5_CREATE_BUTTON( 2, "CREATE A CLASS", ; ) 94 | IW5_CREATE_BUTTON( 3, "CALLSIGN & KILLSTREAKS", ; ) 95 | IW5_CREATE_SEPARATOR( 4 ) 96 | 97 | CREATE_SHADER( -65 212 301 113.333 1 1, "preview_" + dvarstring( "ui_mapname" ), 1 1 1 1 ) 98 | CREATE_SHADER( 76 212 -160 113.333 1 1, "gradient", 0 0 0 1 ) 99 | CREATE_TEXT( 50 252.667 161.333 16 1 1, dvarstring( "party_mapname" ), 1 1 1 1, true, 100 | textfont UI_FONT_DEFAULT; 101 | textalign ITEM_ALIGN_MIDDLE_RIGHT; 102 | textscale 0.34; 103 | autowrapped ) 104 | CREATE_TEXT( 50 268.667 161.333 16 1 1, dvarstring( "party_gametype" ), 1 1 1 1, true, 105 | textfont UI_FONT_DEFAULT; 106 | textalign ITEM_ALIGN_MIDDLE_RIGHT; 107 | textscale 0.34; 108 | autowrapped ) 109 | 110 | CREATE_TEXT( -272 0 200 18 3 1, locstring( "@MPUI_RECOMMENDEDPLAYERS", int( min( dvarint( "party_maxplayers" ), maxrecommendedplayers() ) ) ), 1 1 1 0.5, privatepartyhost(), 111 | textfont UI_FONT_DEFAULT; 112 | textalign ITEM_ALIGN_TOP_LEFT; 113 | textalignx 20; 114 | textscale 0.375; 115 | autowrapped ) 116 | 117 | STYLE_WIDGET 118 | } -------------------------------------------------------------------------------- /includes/macros.h: -------------------------------------------------------------------------------- 1 | #define CREATE_SHADER( position, texture, colour ) \ 2 | CREATE_SHADER_VIS( position, texture, colour, 1 ) 3 | 4 | #define CREATE_SHADER_VIS( position, texture, colour, visibility ) \ 5 | CREATE_SHADER_EX( position, texture, colour, visibility, ; ) 6 | 7 | #define CREATE_SHADER_EX( position, texture, colour, visibility, extra ) \ 8 | itemDef \ 9 | { \ 10 | style WINDOW_STYLE_SHADER \ 11 | rect position; \ 12 | forecolor colour \ 13 | exp material ( texture ) \ 14 | visible when ( visibility ) \ 15 | decoration \ 16 | extra \ 17 | } 18 | 19 | #define CREATE_SHADER_ALT( position, texture, colour, visibility, extra ) \ 20 | itemDef \ 21 | { \ 22 | style WINDOW_STYLE_FILLED \ 23 | rect position; \ 24 | backcolor colour \ 25 | background texture \ 26 | visible when ( visibility ) \ 27 | decoration \ 28 | extra \ 29 | } 30 | 31 | #define CREATE_TEXT( position, string, color, visibility, extras ) \ 32 | itemDef \ 33 | { \ 34 | rect position; \ 35 | style 1 \ 36 | forecolor color \ 37 | exp text ( string ) \ 38 | visible when ( visibility ) \ 39 | decoration \ 40 | extras \ 41 | } 42 | 43 | #define DEBUG_STYLE_BUTTON( idx, string, action_ ) \ 44 | itemDef \ 45 | { \ 46 | rect ( 0 + ( 45 * idx ) ) 0 45 15 1 1; \ 47 | origin -57 -30 \ 48 | style WINDOW_STYLE_FILLED \ 49 | visible when ( DEBUG ) \ 50 | forecolor 1 1 1 1 \ 51 | backcolor 0.8 0.8 0.8 0.1 \ 52 | type ITEM_TYPE_BUTTON \ 53 | text string \ 54 | textfont UI_FONT_OBJECTIVE \ 55 | textalign ITEM_ALIGN_MIDDLE_CENTER \ 56 | textalignx -0.5 \ 57 | textscale 0.2 \ 58 | border WINDOW_BORDER_KCGRADIENT \ 59 | bordersize 0.5 \ 60 | bordercolor 1 1 1 0.25 \ 61 | onFocus \ 62 | { \ 63 | setItemColor self backcolor 0.8 0.8 0.8 0.25; \ 64 | } \ 65 | leaveFocus \ 66 | { \ 67 | setItemColor self backcolor 0.8 0.8 0.8 0.1; \ 68 | } \ 69 | action \ 70 | { \ 71 | close "self"; \ 72 | action_; \ 73 | } \ 74 | } 75 | 76 | #define STYLE_WIDGET \ 77 | DEBUG_STYLE_BUTTON( 0, "RELOAD", if ( dvarBool( "cl_ingame" ) ) { exec "map_restart"; } else { exec "xstopparty;snd_restart"; } ) \ 78 | DEBUG_STYLE_BUTTON( 1, "IW3", setDvar ui_menustyle "iw3"; close "self"; open MENU_NAME; ) \ 79 | DEBUG_STYLE_BUTTON( 2, "IW4", setDvar ui_menustyle "iw4"; close "self"; open MENU_NAME; ) \ 80 | DEBUG_STYLE_BUTTON( 3, "IW5", setDvar ui_menustyle "iw5"; close "self"; open MENU_NAME; ) 81 | 82 | #define INGAME_FACTION_ICON( pos, alpha ) \ 83 | CREATE_SHADER_VIS( pos, dvarstring( "g_TeamIcon_Allies" ), 1 1 1 alpha, localvarstring( "ui_team" ) == "marines" ) \ 84 | CREATE_SHADER_VIS( pos, dvarstring( "g_TeamIcon_Axis" ), 1 1 1 alpha, localvarstring( "ui_team" ) == "opfor" ) \ 85 | CREATE_SHADER_VIS( pos, dvarstring( "g_TeamIcon_Allies" ), 1 1 1 alpha, team( "name" ) == "TEAM_FREE" && localvarstring( "ui_team" ) == "marines" ) \ 86 | CREATE_SHADER_VIS( pos, dvarstring( "g_TeamIcon_Axis" ), 1 1 1 alpha, team( "name" ) == "TEAM_FREE" && localvarstring( "ui_team" ) == "opfor" ) 87 | 88 | #ifndef MENU_BACK_ACTION 89 | #define MENU_BACK_ACTION \ 90 | close "self"; \ 91 | open "main_text"; 92 | #endif -------------------------------------------------------------------------------- /includes/menudef.h: -------------------------------------------------------------------------------- 1 | #define COMPASS_SIZE 109 2 | #define MINIMAP_X 11.5 3 | #define MINIMAP_Y 5 4 | #define MINIMAP_W 89.5 5 | #define MINIMAP_H 89.5 6 | 7 | #define COMPASS_SIZE_MP 125 8 | #define MINIMAP_X_MP 0 9 | #define MINIMAP_Y_MP 12 10 | #define MINIMAP_W_MP 102 11 | #define MINIMAP_H_MP 102 12 | 13 | #define FULLSCREEN 0 0 640 480 14 | #define FULLSCREEN_WIDE -107 0 854 480 15 | 16 | #define ORIGIN_TITLE 48 40 17 | #define ORIGIN_TITLE_SS 104 120 18 | 19 | #define FONTSCALE_SMALL 0.3750 // 18 20 | #define FONTSCALE_NORMAL 0.4583 21 | #define FONTSCALE_BOLD 0.4583 22 | #define FONTSCALE_BIG 0.5833 23 | #define FONTSCALE_EXTRABIG 1.0000 24 | 25 | #define TEXTSIZE_SMALL FONTSCALE_SMALL 26 | #define TEXTSIZE_SMALL_SS (FONTSCALE_SMALL*2) 27 | #define TEXTSIZE_DEFAULT FONTSCALE_NORMAL 28 | #define TEXTSIZE_DEFAULT_SS (FONTSCALE_NORMAL*2) 29 | #define TEXTSIZE_TITLE FONTSCALE_BIG 30 | #define TEXTSIZE_TITLE_SS 1 31 | 32 | 33 | #define TEXTSIZE_BOLD TEXTSIZE_DEFAULT 34 | #define TEXTSIZE_BIG TEXTSIZE_TITLE 35 | 36 | #define COLOR_TITLE 1 0.8 0.4 1 37 | #define COLOR_FOCUSED 1 1 1 1 38 | #define COLOR_UNFOCUSED 0.4823 0.4823 0.4823 1 39 | #define COLOR_DISABLED 0.35 0.35 0.35 1 40 | #define COLOR_SAFEAREA 0 0 1 1 41 | 42 | #define BUTTON_A 1 43 | #define BUTTON_B 2 44 | #define BUTTON_X 3 45 | #define BUTTON_Y 4 46 | #define BUTTON_LSHLDR 5 47 | #define BUTTON_RSHLDR 6 48 | #define BUTTON_START 14 49 | #define BUTTON_BACK 15 50 | #define BUTTON_LSTICK 16 51 | #define BUTTON_RSTICK 17 52 | #define BUTTON_LTRIG 18 53 | #define BUTTON_RTRIG 19 54 | #define DPAD_UP 20 55 | #define DPAD_DOWN 21 56 | #define DPAD_LEFT 22 57 | #define DPAD_RIGHT 23 58 | #define APAD_UP 28 59 | #define APAD_DOWN 29 60 | #define APAD_LEFT 30 61 | #define APAD_RIGHT 31 62 | 63 | #define COLOR_USMC 0.6 0.64 0.69 64 | #define COLOR_ARAB 0.65 0.57 0.41 65 | #define COLOR_USSR 0.52 0.28 0.28 66 | #define COLOR_SAS 0 0 0 67 | 68 | #define DEFAULT_MP_CFG "default_mp.cfg" 69 | #define SPLITSCREEN_MP_CFG "default_splitscreen.cfg" 70 | #define SYSTEMLINK_MP_CFG "default_systemlink.cfg" 71 | #define XBOXLIVE_MP_CFG "default_xboxlive.cfg" 72 | 73 | #define MAX_RANK int(tableLookup( "mp/rankTable.csv", 0, "maxrank", 1)) 74 | #define MAX_PRESTIGE int(tableLookup( "mp/rankIconTable.csv", 0, "maxprestige", 1)) 75 | 76 | #define PRESTIGE_AVAIL (stat(2326) < MAX_PRESTIGE && stat(2301) == int(tableLookup("mp/rankTable.csv",0,MAX_RANK,7))) 77 | #define PRESTIGE_NEXT (stat(2326) < MAX_PRESTIGE && stat(252) == MAX_RANK) 78 | #define PRESTIGE_FINISH (stat(2326) == MAX_PRESTIGE) 79 | 80 | #define CAN_RANK_UP (stat(252) < MAX_RANK || stat(2326) < MAX_PRESTIGE) 81 | 82 | #define ITEM_TYPE_TEXT 0 // simple text 83 | #define ITEM_TYPE_BUTTON 1 // button, basically text with a border 84 | #define ITEM_TYPE_RADIOBUTTON 2 // toggle button, may be grouped 85 | #define ITEM_TYPE_CHECKBOX 3 // check box 86 | #define ITEM_TYPE_EDITFIELD 4 // editable text, associated with a dvar 87 | #define ITEM_TYPE_COMBO 5 // drop down list 88 | #define ITEM_TYPE_LISTBOX 6 // scrollable list 89 | #define ITEM_TYPE_MODEL 7 // model 90 | #define ITEM_TYPE_OWNERDRAW 8 // owner draw, name specs what it is 91 | #define ITEM_TYPE_NUMERICFIELD 9 // editable text, associated with a dvar 92 | #define ITEM_TYPE_SLIDER 10 // mouse speed, volume, etc. 93 | #define ITEM_TYPE_YESNO 11 // yes no dvar setting 94 | #define ITEM_TYPE_MULTI 12 // multiple list setting, enumerated 95 | #define ITEM_TYPE_DVARENUM 13 // multiple list setting, enumerated from a dvar 96 | #define ITEM_TYPE_BIND 14 // bind 97 | #define ITEM_TYPE_MENUMODEL 15 // special menu model 98 | #define ITEM_TYPE_VALIDFILEFIELD 16 // text must be valid for use in a dos filename 99 | #define ITEM_TYPE_DECIMALFIELD 17 // editable text, associated with a dvar, which allows decimal input 100 | #define ITEM_TYPE_UPREDITFIELD 18 // editable text, associated with a dvar 101 | #define ITEM_TYPE_GAME_MESSAGE_WINDOW 19 // game message window 102 | 103 | #define ITEM_ALIGN_LEFT 0 // aligns left of text to left of containing rectangle 104 | #define ITEM_ALIGN_CENTER 1 // aligns center of text to center of containing rectangle 105 | #define ITEM_ALIGN_RIGHT 2 // aligns right of text to right of containing rectangle 106 | #define ITEM_ALIGN_X_MASK 3 107 | 108 | #define ITEM_ALIGN_LEGACY 0 // aligns bottom of text to top of containing rectangle 109 | #define ITEM_ALIGN_TOP 4 // aligns top of text to top of containing rectangle 110 | #define ITEM_ALIGN_MIDDLE 8 // aligns middle of text to middle of containing rectangle 111 | #define ITEM_ALIGN_BOTTOM 12 // aligns bottom of text to bottom of containing rectangle 112 | #define ITEM_ALIGN_Y_MASK 12 113 | 114 | #define ITEM_ALIGN_LEGACY_LEFT 0 115 | #define ITEM_ALIGN_LEGACY_CENTER 1 116 | #define ITEM_ALIGN_LEGACY_RIGHT 2 117 | #define ITEM_ALIGN_TOP_LEFT 4 118 | #define ITEM_ALIGN_TOP_CENTER 5 119 | #define ITEM_ALIGN_TOP_RIGHT 6 120 | #define ITEM_ALIGN_MIDDLE_LEFT 8 121 | #define ITEM_ALIGN_MIDDLE_CENTER 9 122 | #define ITEM_ALIGN_MIDDLE_RIGHT 10 123 | #define ITEM_ALIGN_BOTTOM_LEFT 12 124 | #define ITEM_ALIGN_BOTTOM_CENTER 13 125 | #define ITEM_ALIGN_BOTTOM_RIGHT 14 126 | 127 | #define ITEM_TEXTSTYLE_NORMAL 0 // normal text 128 | #define ITEM_TEXTSTYLE_BLINK 1 // fast blinking 129 | #define ITEM_TEXTSTYLE_SHADOWED 3 // drop shadow ( need a color for this ) 130 | #define ITEM_TEXTSTYLE_SHADOWEDMORE 6 // drop shadow ( need a color for this ) 131 | #define ITEM_TEXTSTYLE_OUTLINED 8 // outlined 132 | #define ITEM_TEXTSTYLE_MONOSPACE 128 133 | 134 | #define WINDOW_BORDER_NONE 0 // no border 135 | #define WINDOW_BORDER_FULL 1 // full border based on border color ( single pixel ) 136 | #define WINDOW_BORDER_HORZ 2 // horizontal borders only 137 | #define WINDOW_BORDER_VERT 3 // vertical borders only 138 | #define WINDOW_BORDER_KCGRADIENT 4 // horizontal border using the gradient bars 139 | #define WINDOW_BORDER_RAISED 5 // darken the bottom and right sides of the border 140 | #define WINDOW_BORDER_SUNKEN 6 // darken the top and left sides of the border 141 | 142 | #define WINDOW_STYLE_EMPTY 0 // no background 143 | #define WINDOW_STYLE_FILLED 1 // filled with background color 144 | #define WINDOW_STYLE_GRADIENT 2 // gradient bar based on background color 145 | #define WINDOW_STYLE_SHADER 3 // shader based on background color 146 | #define WINDOW_STYLE_TEAMCOLOR 4 // team color 147 | #define WINDOW_STYLE_DVAR_SHADER 5 // draws the shader specified by the dvar 148 | #define WINDOW_STYLE_LOADBAR 6 // shader based on background color 149 | 150 | #define MODE_BOTTOMUP_ALIGN_TOP 0 // text appears on bottom of list and moves up to specified Y coordinate as old text fades out 151 | #define MODE_BOTTOMUP_ALIGN_BOTTOM 1 // text appears on bottom of list and moves away from specified Y coordinate as new text pushes it up 152 | #define MODE_TOPDOWN_ALIGN_TOP 2 // text appears on top of list and moves away from specified Y coordinate as new text pushes it down 153 | #define MODE_TOPDOWN_ALIGN_BOTTOM 3 // text appears on top of list and moves down to specified Y coordinate as old text fades out 154 | 155 | #define MENU_TRUE 1 156 | #define MENU_FALSE 0 157 | 158 | #define HUD_VERTICAL 0x00 159 | #define HUD_HORIZONTAL 0x01 160 | 161 | #define RANGETYPE_ABSOLUTE 0 162 | #define RANGETYPE_RELATIVE 1 163 | 164 | // list box element types 165 | #define LISTBOX_TEXT 0x00 166 | #define LISTBOX_IMAGE 0x01 167 | 168 | // list feeders 169 | #define FEEDER_HEADS 0x00 // model heads 170 | #define FEEDER_MAPS 0x01 // text maps based on game type 171 | #define FEEDER_SERVERS 0x02 // servers 172 | #define FEEDER_CLAN_MEMBERS 0x03 // clan names 173 | #define FEEDER_ALLMAPS 0x04 // all maps available, in graphic format 174 | #define FEEDER_REDTEAM_LIST 0x05 // red team members 175 | #define FEEDER_BLUETEAM_LIST 0x06 // blue team members 176 | #define FEEDER_PLAYER_LIST 0x07 // players 177 | #define FEEDER_TEAM_LIST 0x08 // team members for team voting 178 | #define FEEDER_MODS 0x09 // team members for team voting 179 | #define FEEDER_DEMOS 0x0a // team members for team voting 180 | #define FEEDER_SCOREBOARD 0x0b // team members for team voting 181 | #define FEEDER_Q3HEADS 0x0c // model heads 182 | #define FEEDER_SERVERSTATUS 0x0d // server status 183 | #define FEEDER_FINDPLAYER 0x0e // find player 184 | #define FEEDER_CINEMATICS 0x0f // cinematics 185 | #define FEEDER_SAVEGAMES 0x10 // savegames 186 | #define FEEDER_PICKSPAWN 0x11 187 | #define FEEDER_LOBBY_MEMBERS 0x12 // list of players in your party 188 | #define FEEDER_LOBBY_MEMBERS_TALK 0x13 // icon for whether they are speaking or not 189 | #define FEEDER_MUTELIST 0x14 // list of musted players 190 | #define FEEDER_PLAYERSTALKING 0x15 // list of players who are currently talking 191 | #define FEEDER_SPLITSCREENPLAYERS 0x16 // list of all players who are playing splitscreen 192 | #define FEEDER_LOBBY_MEMBERS_READY 0x17 // icon for whether they are ready or not 193 | #define FEEDER_PLAYER_PROFILES 0x18 // player profiles 194 | #define FEEDER_PARTY_MEMBERS 0x19 // list of players in your party 195 | #define FEEDER_PARTY_MEMBERS_TALK 0x1a // icon for whether they are speaking or not 196 | #define FEEDER_PARTY_MEMBERS_READY 0x1b // icon for whether they are ready or not 197 | #define FEEDER_PLAYLISTS 0x1c // list of all playlists 198 | #define FEEDER_GAMEMODES 0x1d // list of all game type modes, including any player custom modes 199 | #define FEEDER_LEADERBOARD 0x1e // list of rows for a leaderboard 200 | #define FEEDER_MYTEAM_MEMBERS 0x20 // list of marine team members 201 | #define FEEDER_MYTEAM_MEMBERS_TALK 0x21 // icon for whether they are speaking 202 | #define FEEDER_ENEMY_MEMBERS 0x22 // list of opfor team members 203 | #define FEEDER_ENEMY_MEMBERS_TALK 0x23 // icon for whether they are speaking 204 | #define FEEDER_LOBBY_MEMBERS_STAT 0x24 // last round stats for lobby members 205 | #define FEEDER_MYTEAM_MEMBERS_STAT 0x25 // last round stats for marine team members 206 | #define FEEDER_ENEMY_MEMBERS_STAT 0x26 // last round stats for opfor team members 207 | #define FEEDER_ONLINEFRIENDS 0x27 // list of your online friends 208 | #define FEEDER_LOBBY_MEMBERS_RANK 0x28 // rank icon 209 | #define FEEDER_PARTY_MEMBERS_RANK 0x29 // rank icon 210 | #define FEEDER_ENEMY_MEMBERS_RANK 0x30 // rank icon 211 | #define FEEDER_MYTEAM_MEMBERS_RANK 0x31 // rank icon 212 | 213 | // display flags 214 | #define CG_SHOW_BLUE_TEAM_HAS_REDFLAG 0x00000001 215 | #define CG_SHOW_RED_TEAM_HAS_BLUEFLAG 0x00000002 216 | #define CG_SHOW_ANYTEAMGAME 0x00000004 217 | #define CG_SHOW_CTF 0x00000020 218 | #define CG_SHOW_OBELISK 0x00000040 219 | #define CG_SHOW_HEALTHCRITICAL 0x00000080 220 | #define CG_SHOW_SINGLEPLAYER 0x00000100 221 | #define CG_SHOW_TOURNAMENT 0x00000200 222 | #define CG_SHOW_DURINGINCOMINGVOICE 0x00000400 223 | #define CG_SHOW_IF_PLAYER_HAS_FLAG 0x00000800 224 | #define CG_SHOW_LANPLAYONLY 0x00001000 225 | #define CG_SHOW_MINED 0x00002000 226 | #define CG_SHOW_HEALTHOK 0x00004000 227 | #define CG_SHOW_TEAMINFO 0x00008000 228 | #define CG_SHOW_NOTEAMINFO 0x00010000 229 | #define CG_SHOW_OTHERTEAMHASFLAG 0x00020000 230 | #define CG_SHOW_YOURTEAMHASENEMYFLAG 0x00040000 231 | #define CG_SHOW_ANYNONTEAMGAME 0x00080000 232 | #define CG_SHOW_TEXTASINT 0x00200000 233 | #define CG_SHOW_HIGHLIGHTED 0x00100000 234 | 235 | #define CG_SHOW_NOT_V_CLEAR 0x02000000 236 | 237 | #define CG_SHOW_2DONLY 0x10000000 238 | 239 | 240 | #define UI_SHOW_LEADER 0x00000001 241 | #define UI_SHOW_NOTLEADER 0x00000002 242 | #define UI_SHOW_FAVORITESERVERS 0x00000004 243 | #define UI_SHOW_ANYNONTEAMGAME 0x00000008 244 | #define UI_SHOW_ANYTEAMGAME 0x00000010 245 | #define UI_SHOW_NEWHIGHSCORE 0x00000020 246 | #define UI_SHOW_DEMOAVAILABLE 0x00000040 247 | #define UI_SHOW_NEWBESTTIME 0x00000080 248 | #define UI_SHOW_FFA 0x00000100 249 | #define UI_SHOW_NOTFFA 0x00000200 250 | #define UI_SHOW_NETANYNONTEAMGAME 0x00000400 251 | #define UI_SHOW_NETANYTEAMGAME 0x00000800 252 | #define UI_SHOW_NOTFAVORITESERVERS 0x00001000 253 | 254 | // font types 255 | #define UI_FONT_DEFAULT 0 // auto-chose betwen big/reg/small 256 | #define UI_FONT_NORMAL 1 257 | #define UI_FONT_BIG 2 258 | #define UI_FONT_SMALL 3 259 | #define UI_FONT_BOLD 4 260 | #define UI_FONT_CONSOLE 5 261 | #define UI_FONT_OBJECTIVE 6 262 | 263 | #define UI_FONT_LARGE 9 264 | 265 | // owner draw types 266 | // ideally these should be done outside of this file but 267 | // this makes it much easier for the macro expansion to 268 | // convert them for the designers ( from the .menu files ) 269 | #define CG_OWNERDRAW_BASE 1 270 | #define CG_PLAYER_AMMO_VALUE 5 271 | #define CG_PLAYER_AMMO_BACKDROP 6 272 | 273 | #define CG_PLAYER_STANCE 20 274 | 275 | #define CG_SPECTATORS 60 276 | 277 | #define CG_HOLD_BREATH_HINT 71 278 | #define CG_CURSORHINT 72 279 | #define CG_PLAYER_POWERUP 73 280 | #define CG_PLAYER_HOLDABLE 74 281 | #define CG_PLAYER_INVENTORY 75 282 | #define CG_CURSORHINT_STATUS 78 // like 'health' bar when pointing at a func_explosive 283 | 284 | #define CG_PLAYER_BAR_HEALTH 79 285 | #define CG_MANTLE_HINT 80 286 | 287 | #define CG_PLAYER_WEAPON_NAME 81 288 | #define CG_PLAYER_WEAPON_NAME_BACK 82 289 | 290 | #define CG_CENTER_MESSAGE 90 // for things like "You were killed by ..." 291 | 292 | #define CG_TANK_BODY_DIR 95 293 | #define CG_TANK_BARREL_DIR 96 294 | 295 | #define CG_DEADQUOTE 97 296 | 297 | #define CG_PLAYER_BAR_HEALTH_BACK 98 298 | 299 | #define CG_MISSION_OBJECTIVE_HEADER 99 300 | #define CG_MISSION_OBJECTIVE_LIST 100 301 | #define CG_MISSION_OBJECTIVE_BACKDROP 101 302 | #define CG_PAUSED_MENU_LINE 102 303 | 304 | #define CG_OFFHAND_WEAPON_ICON_FRAG 103 305 | #define CG_OFFHAND_WEAPON_ICON_SMOKEFLASH 104 306 | #define CG_OFFHAND_WEAPON_AMMO_FRAG 105 307 | #define CG_OFFHAND_WEAPON_AMMO_SMOKEFLASH 106 308 | #define CG_OFFHAND_WEAPON_NAME_FRAG 107 309 | #define CG_OFFHAND_WEAPON_NAME_SMOKEFLASH 108 310 | #define CG_OFFHAND_WEAPON_SELECT_FRAG 109 311 | #define CG_OFFHAND_WEAPON_SELECT_SMOKEFLASH 110 312 | #define CG_SAVING 111 313 | #define CG_PLAYER_LOW_HEALTH_OVERLAY 112 314 | 315 | #define CG_INVALID_CMD_HINT 113 316 | #define CG_PLAYER_SPRINT_METER 114 317 | #define CG_PLAYER_SPRINT_BACK 115 318 | 319 | #define CG_PLAYER_WEAPON_BACKGROUND 116 320 | #define CG_PLAYER_WEAPON_AMMO_CLIP_GRAPHIC 117 321 | #define CG_PLAYER_WEAPON_PRIMARY_ICON 118 322 | #define CG_PLAYER_WEAPON_AMMO_STOCK 119 323 | #define CG_PLAYER_WEAPON_LOW_AMMO_WARNING 120 324 | 325 | #define CG_PLAYER_COMPASS_TICKERTAPE 145 326 | #define CG_PLAYER_COMPASS_TICKERTAPE_NO_OBJ 146 327 | 328 | #define CG_PLAYER_COMPASS_PLAYER 150 329 | #define CG_PLAYER_COMPASS_BACK 151 330 | #define CG_PLAYER_COMPASS_POINTERS 152 331 | #define CG_PLAYER_COMPASS_ACTORS 153 332 | #define CG_PLAYER_COMPASS_TANKS 154 333 | #define CG_PLAYER_COMPASS_HELICOPTERS 155 334 | #define CG_PLAYER_COMPASS_PLANES 156 335 | #define CG_PLAYER_COMPASS_AUTOMOBILES 157 336 | #define CG_PLAYER_COMPASS_FRIENDS 158 337 | #define CG_PLAYER_COMPASS_MAP 159 338 | #define CG_PLAYER_COMPASS_NORTHCOORD 160 339 | #define CG_PLAYER_COMPASS_EASTCOORD 161 340 | #define CG_PLAYER_COMPASS_NCOORD_SCROLL 162 341 | #define CG_PLAYER_COMPASS_ECOORD_SCROLL 163 342 | #define CG_PLAYER_COMPASS_GOALDISTANCE 164 343 | 344 | #define CG_PLAYER_ACTIONSLOT_DPAD 165 345 | #define CG_PLAYER_ACTIONSLOT_1 166 346 | #define CG_PLAYER_ACTIONSLOT_2 167 347 | #define CG_PLAYER_ACTIONSLOT_3 168 348 | #define CG_PLAYER_ACTIONSLOT_4 169 349 | #define CG_PLAYER_COMPASS_ENEMIES 170 350 | 351 | #define CG_PLAYER_FULLMAP_BACK 180 352 | #define CG_PLAYER_FULLMAP_MAP 181 353 | #define CG_PLAYER_FULLMAP_POINTERS 182 354 | #define CG_PLAYER_FULLMAP_PLAYER 183 355 | #define CG_PLAYER_FULLMAP_ACTORS 184 356 | #define CG_PLAYER_FULLMAP_FRIENDS 185 357 | #define CG_PLAYER_FULLMAP_LOCATION_SELECTOR 186 358 | #define CG_PLAYER_FULLMAP_BORDER 187 359 | #define CG_PLAYER_FULLMAP_ENEMIES 188 360 | 361 | #define CG_VEHICLE_RETICLE 190 362 | #define CG_HUD_TARGETS_VEHICLE 191 363 | #define CG_HUD_TARGETS_JAVELIN 192 364 | 365 | #define CG_TALKER1 193 366 | #define CG_TALKER2 194 367 | #define CG_TALKER3 195 368 | #define CG_TALKER4 196 369 | 370 | #define UI_OWNERDRAW_BASE 200 371 | #define UI_HANDICAP 200 372 | #define UI_EFFECTS 201 373 | #define UI_PLAYERMODEL 202 374 | #define UI_GAMETYPE 205 375 | #define UI_SKILL 207 376 | #define UI_NETSOURCE 220 377 | #define UI_NETFILTER 222 378 | #define UI_VOTE_KICK 238 379 | #define UI_NETGAMETYPE 245 380 | #define UI_SERVERREFRESHDATE 247 381 | #define UI_SERVERMOTD 248 382 | #define UI_GLINFO 249 383 | #define UI_KEYBINDSTATUS 250 384 | #define UI_JOINGAMETYPE 253 385 | #define UI_MAPPREVIEW 254 386 | #define UI_MENUMODEL 257 387 | #define UI_SAVEGAME_SHOT 258 388 | #define UI_SAVEGAMENAME 262 389 | #define UI_SAVEGAMEINFO 263 390 | #define UI_LOADPROFILING 264 391 | #define UI_RECORDLEVEL 265 392 | #define UI_AMITALKING 266 393 | #define UI_TALKER1 267 394 | #define UI_TALKER2 268 395 | #define UI_TALKER3 269 396 | #define UI_TALKER4 270 397 | #define UI_PARTYSTATUS 271 398 | #define UI_LOGGEDINUSER 272 399 | #define UI_RESERVEDSLOTS 273 400 | #define UI_PLAYLISTNAME 274 401 | #define UI_PLAYLISTDESCRIPTION 275 402 | #define UI_USERNAME 276 403 | #define UI_CINEMATIC 277 404 | 405 | // Edge relative placement values for rect->h_align and rect->v_align 406 | #define HORIZONTAL_ALIGN_SUBLEFT 0 // left edge of a 4:3 screen (safe area not included) 407 | #define HORIZONTAL_ALIGN_LEFT 1 // left viewable (safe area) edge 408 | #define HORIZONTAL_ALIGN_CENTER 2 // center of the screen (reticle) 409 | #define HORIZONTAL_ALIGN_RIGHT 3 // right viewable (safe area) edge 410 | #define HORIZONTAL_ALIGN_FULLSCREEN 4 // disregards safe area 411 | #define HORIZONTAL_ALIGN_NOSCALE 5 // uses exact parameters - neither adjusts for safe area nor scales for screen size 412 | #define HORIZONTAL_ALIGN_TO640 6 // scales a real-screen resolution x down into the 0 - 640 range 413 | #define HORIZONTAL_ALIGN_CENTER_SAFEAREA 7 // center of the safearea 414 | #define HORIZONTAL_ALIGN_MAX HORIZONTAL_ALIGN_CENTER_SAFEAREA 415 | #define HORIZONTAL_ALIGN_DEFAULT HORIZONTAL_ALIGN_SUBLEFT 416 | 417 | #define VERTICAL_ALIGN_SUBTOP 0 // top edge of the 4:3 screen (safe area not included) 418 | #define VERTICAL_ALIGN_TOP 1 // top viewable (safe area) edge 419 | #define VERTICAL_ALIGN_CENTER 2 // center of the screen (reticle) 420 | #define VERTICAL_ALIGN_BOTTOM 3 // bottom viewable (safe area) edge 421 | #define VERTICAL_ALIGN_FULLSCREEN 4 // disregards safe area 422 | #define VERTICAL_ALIGN_NOSCALE 5 // uses exact parameters - neither adjusts for safe area nor scales for screen size 423 | #define VERTICAL_ALIGN_TO480 6 // scales a real-screen resolution y down into the 0 - 480 range 424 | #define VERTICAL_ALIGN_CENTER_SAFEAREA 7 // center of the save area 425 | #define VERTICAL_ALIGN_MAX VERTICAL_ALIGN_CENTER_SAFEAREA 426 | #define VERTICAL_ALIGN_DEFAULT VERTICAL_ALIGN_SUBTOP 427 | -------------------------------------------------------------------------------- /includes/styles.h: -------------------------------------------------------------------------------- 1 | #include "ui_mp/styles/iw3.h" 2 | #include "ui_mp/styles/iw4.h" 3 | #include "ui_mp/styles/iw5.h" 4 | 5 | #define IS_IW3 dvarString( "ui_menustyle" ) == "iw3" 6 | #define IS_IW4 dvarString( "ui_menustyle" ) == "iw4" 7 | #define IS_IW5 dvarString( "ui_menustyle" ) == "iw5" 8 | 9 | #define iw3 MENU_NAME"_iw3" 10 | #define iw4 MENU_NAME"_iw4" 11 | #define iw5 MENU_NAME"_iw5" 12 | 13 | #define false 0 14 | #define true 1 15 | 16 | #define DEBUG 1 17 | 18 | #define STYLE_OPEN \ 19 | close "self"; \ 20 | if ( IS_IW3 ) { open MENU_NAME"_iw3"; } \ 21 | if ( IS_IW4 ) { open MENU_NAME"_iw4"; } \ 22 | if ( IS_IW5 ) { open MENU_NAME"_iw5"; } 23 | 24 | #define ADD_BASE_MENU \ 25 | name MENU_NAME \ 26 | rect 0 0 640 480 0 0; \ 27 | onOpen \ 28 | { \ 29 | if ( dvarString( "ui_menustyle" ) == "" ) \ 30 | { \ 31 | setDvar ui_menustyle "iw3"; \ 32 | } \ 33 | STYLE_OPEN; \ 34 | } 35 | 36 | #define ADD_STYLED_MENU( style ) \ 37 | name style \ 38 | rect 0 0 640 480 0 0; \ 39 | forecolor 1 1 1 1 \ 40 | focuscolor 1 1 1 1 \ 41 | fullscreen 1 \ 42 | soundloop "music_mainmenu_mp" \ 43 | onEsc \ 44 | { \ 45 | MENU_BACK_ACTION; \ 46 | } 47 | 48 | #define ADD_STYLED_INGAME_MENU( style ) \ 49 | ADD_STYLED_MENU( style ) \ 50 | fullscreen 0 \ 51 | blurworld 7 52 | 53 | #define ADD_STYLED_POPUP( style, width, height) \ 54 | name style \ 55 | rect ( - width / 2 ) ( - height / 2 ) width height 2 2; \ 56 | forecolor 1 1 1 1 \ 57 | focuscolor 1 1 1 1 \ 58 | popup \ 59 | outofboundsclick \ 60 | soundloop "music_mainmenu_mp" \ 61 | onOpen \ 62 | { \ 63 | focusFirst; \ 64 | } \ 65 | onEsc \ 66 | { \ 67 | MENU_BACK_ACTION; \ 68 | } 69 | -------------------------------------------------------------------------------- /ingame.txt: -------------------------------------------------------------------------------- 1 | { 2 | loadmenu { "ui_mp/scriptmenus/class.menu" } 3 | } -------------------------------------------------------------------------------- /main_text.menu: -------------------------------------------------------------------------------- 1 | #include "ui_mp/includes/menudef.h" 2 | #include "ui_mp/includes/macros.h" 3 | #include "ui_mp/includes/styles.h" 4 | 5 | #define MENU_NAME "main_text" 6 | 7 | menuDef 8 | { 9 | ADD_BASE_MENU 10 | onOpen 11 | { 12 | exec "selectStringTableEntryInDvar mp/didyouknow.csv 0 didyouknow"; 13 | } 14 | } 15 | 16 | #define CREATE_GAME_ACTION \ 17 | exec "xrequirelivesignin"; \ 18 | setDvar "systemlink" 0; \ 19 | setDvar "splitscreen" 0; \ 20 | setDvar "onlinegame" 1; \ 21 | exec "exec default_xboxlive.cfg"; \ 22 | setDvar "party_maxplayers" 18; \ 23 | setDvar "xblive_privateserver" 0; \ 24 | setDvar "xblive_rankedmatch" 0; \ 25 | exec "xstartprivateparty"; \ 26 | setDvar "ui_mptype" 0; \ 27 | exec "xcheckezpatch"; \ 28 | exec "exec default_xboxlive.cfg" \ 29 | setDvar "xblive_rankedmatch" 0; \ 30 | exec "ui_enumeratesaved"; \ 31 | setDvar "xblive_privateserver" 1; \ 32 | exec "xstartprivatematch"; \ 33 | open "createserver"; 34 | 35 | menuDef 36 | { 37 | ADD_STYLED_MENU( iw3 ) 38 | 39 | IW3_BG 40 | CREATE_TEXT( -15 -60 220 60 1 3, "Game experience may change during online play.", 1 1 1 1, IS_IW3, 41 | textfont UI_FONT_DEFAULT; 42 | textalign ITEM_ALIGN_BOTTOM_LEFT; 43 | textstyle ITEM_TEXTSTYLE_SHADOWED; 44 | textscale 0.35; 45 | autowrapped ) 46 | 47 | IW3_CREATE_SEPARATOR( 2 ) 48 | IW3_CREATE_SEPARATOR( 5.5 ) 49 | IW3_CREATE_SEPARATOR( 9 ) 50 | CREATE_SHADER( 324 56 278 68 0 0, "logo_cod2", 1 1 1 1 ) 51 | IW3_CREATE_BUTTON( 0, "Server Browser", open "pc_join_unranked" ) 52 | IW3_CREATE_BUTTON( 1, "Private Match", CREATE_GAME_ACTION; ) 53 | IW3_CREATE_BUTTON( 2.5, "Create a Class", open "cac_popup" ) 54 | IW3_CREATE_BUTTON( 3.5, "Callsign & Killstreaks", open "menu_online_barracks" ) 55 | IW3_CREATE_BUTTON( 4.5, "Barracks", open "menu_online_barracks" ) 56 | IW3_CREATE_BUTTON( 6, "Theater", open "pc_options_controls" ) 57 | IW3_CREATE_BUTTON( 7, "Options", open "pc_options_video" ) 58 | IW3_CREATE_BUTTON( 8, "Mods", open "mods_menu" ) 59 | IW3_CREATE_BUTTON( 9.5, "Quit", open "quit_popmenu" ) 60 | STYLE_WIDGET 61 | } 62 | 63 | menuDef 64 | { 65 | ADD_STYLED_MENU( iw4 ) 66 | 67 | IW4_BG( "", true ) 68 | CREATE_SHADER( 304 270 288 72 0 0, "logo_cod2", 1 1 1 1 ) 69 | IW4_CREATE_SEPARATOR( 2 ) 70 | IW4_CREATE_SEPARATOR( 5 ) 71 | IW4_CREATE_SEPARATOR( 8 ) 72 | IW4_CREATE_BUTTON( 0, "SERVER BROWSER", open "pc_join_unranked" ) 73 | IW4_CREATE_BUTTON( 1, "PRIVATE MATCH", CREATE_GAME_ACTION; ) 74 | IW4_CREATE_BUTTON( 2, "CREATE A CLASS", open "cac_popup" ) 75 | IW4_CREATE_BUTTON( 3, "CALLSIGN & KILLSTREAKS", open "menu_online_barracks" ) 76 | IW4_CREATE_BUTTON( 4, "BARRACKS", open "menu_online_barracks" ) 77 | IW4_CREATE_BUTTON( 5, "THEATER", open "pc_options_controls" ) 78 | IW4_CREATE_BUTTON( 6, "OPTIONS", open "pc_options_video" ) 79 | IW4_CREATE_BUTTON( 7, "MODS", open "mods_menu" ) 80 | IW4_CREATE_BUTTON( 8, "QUIT", open "quit_popmenu" ) 81 | STYLE_WIDGET 82 | } 83 | 84 | menuDef 85 | { 86 | ADD_STYLED_MENU( iw5 ) 87 | 88 | IW5_BG( "@MENU_MULTIPLAYER_CAPS", false ) 89 | IW5_CREATE_SEPARATOR( 0 ) 90 | IW5_CREATE_SEPARATOR( 2 ) 91 | IW5_CREATE_SEPARATOR( 5 ) 92 | IW5_CREATE_SEPARATOR( 8 ) 93 | 94 | IW5_CREATE_BUTTON( 0, "SERVER BROWSER", open "pc_join_unranked" ) 95 | IW5_CREATE_BUTTON( 1, "PRIVATE MATCH", CREATE_GAME_ACTION; ) 96 | IW5_CREATE_BUTTON( 2, "CREATE A CLASS", open "cac_popup" ) 97 | IW5_CREATE_BUTTON( 3, "CALLSIGN & KILLSTREAKS", open "menu_online_barracks" ) 98 | IW5_CREATE_BUTTON( 4, "BARRACKS", open "menu_online_barracks" ) 99 | IW5_CREATE_BUTTON( 5, "THEATER", open "pc_options_controls" ) 100 | IW5_CREATE_BUTTON( 6, "OPTIONS", open "pc_options_video" ) 101 | IW5_CREATE_BUTTON( 7, "MODS", open "mods_menu" ) 102 | IW5_CREATE_BUTTON( 8, "QUIT", open "quit_popmenu" ) 103 | STYLE_WIDGET 104 | } -------------------------------------------------------------------------------- /menus.txt: -------------------------------------------------------------------------------- 1 | { 2 | loadmenu { "ui_mp/main.menu" } 3 | loadmenu { "ui_mp/main_text.menu" } 4 | loadmenu { "ui_mp/mods_menu.menu" } 5 | loadmenu { "ui_mp/quit_popmenu.menu" } 6 | loadmenu { "ui_mp/createserver.menu" } 7 | } -------------------------------------------------------------------------------- /mods_menu.menu: -------------------------------------------------------------------------------- 1 | #include "ui_mp/includes/menudef.h" 2 | #include "ui_mp/includes/macros.h" 3 | #include "ui_mp/includes/styles.h" 4 | 5 | #define MENU_NAME "mods_menu" 6 | 7 | menuDef 8 | { 9 | ADD_BASE_MENU 10 | onOpen 11 | { 12 | uiScript "loadMods"; 13 | } 14 | } 15 | 16 | #undef IW3_CHOICE_X_SIZE #define IW3_CHOICE_X_SIZE 336 17 | #undef IW3_CHOICE_X_START #define IW3_CHOICE_X_START -170 18 | #undef IW3_CHOICE_Y_START #define IW3_CHOICE_Y_START 83 19 | #undef IW3_CHOICE_HORIZONTAL_ALIGN #define IW3_CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_CENTER 20 | 21 | menuDef 22 | { 23 | ADD_STYLED_MENU( iw3 ) 24 | 25 | IW3_BG_NAV( "@MENU_MODS" ) 26 | itemDef 27 | { 28 | rect -170 64 340 280 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_DEFAULT 29 | type ITEM_TYPE_LISTBOX 30 | style WINDOW_STYLE_FILLED 31 | textstyle ITEM_TEXTSTYLE_SHADOWED 32 | elementwidth 120 33 | elementheight 22 34 | textscale 0.4 35 | elementtype LISTBOX_TEXT 36 | feeder FEEDER_MODS 37 | textalignx 6 38 | forecolor 1 1 1 0.9 39 | backcolor 0 0 0 0 40 | border 1 41 | bordercolor 1 1 1 0.15 42 | bordersize 1 43 | outlinecolor 0.9 0.9 1 0.12 44 | visible 1 45 | doubleClick 46 | { 47 | play "mouse_click"; 48 | uiScript "RunMod"; 49 | } 50 | } 51 | 52 | IW3_CREATE_BUTTON( 1, "@MENU_LAUNCH", uiScript "RunMod"; ) 53 | IW3_CREATE_BUTTON_VIS( 2, "@MENU_LAUNCH_WITHOUT_MODS", uiScript "ClearMods";, dvarString( "fs_game" ) != "" ) 54 | STYLE_WIDGET 55 | } 56 | 57 | menuDef 58 | { 59 | ADD_STYLED_MENU( iw4 ) 60 | 61 | IW4_BG( "@MENU_MODS", false ) 62 | STYLE_WIDGET 63 | } 64 | 65 | menuDef 66 | { 67 | ADD_STYLED_MENU( iw5 ) 68 | 69 | IW5_BG( "@MENU_MODS", true ) 70 | STYLE_WIDGET 71 | } -------------------------------------------------------------------------------- /quit_popmenu.menu: -------------------------------------------------------------------------------- 1 | #define POPUP 1 2 | #include "ui_mp/includes/menudef.h" 3 | #include "ui_mp/includes/macros.h" 4 | #include "ui_mp/includes/styles.h" 5 | 6 | #define MENU_NAME "quit_popmenu" 7 | #define ITEM_COUNT 2 8 | 9 | menuDef 10 | { 11 | ADD_BASE_MENU 12 | } 13 | 14 | menuDef 15 | { 16 | ADD_STYLED_POPUP( iw3, IW3_POPUP_WIDTH, IW3_POPUP_HEIGHT ) 17 | IW3_POPUP( "@MENU_ARE_YOU_SURE_QUIT", "" ) 18 | IW3_CREATE_BUTTON( 0, "@MENU_YES", uiScript "quit"; ) 19 | IW3_CREATE_BUTTON( 1, "@MENU_NO", MENU_BACK_ACTION; ) 20 | } 21 | 22 | menuDef 23 | { 24 | ADD_STYLED_POPUP( iw4, IW4_POPUP_WIDTH, IW4_POPUP_HEIGHT ) 25 | IW4_POPUP( "@MENU_NOTICE", "@MENU_ARE_YOU_SURE_QUIT" ) 26 | IW4_CREATE_BUTTON( 0, "@MENU_YES", uiScript "quit"; ) 27 | IW4_CREATE_BUTTON( 1, "@MENU_NO", MENU_BACK_ACTION; ) 28 | } 29 | 30 | menuDef 31 | { 32 | ADD_STYLED_POPUP( iw5, IW5_POPUP_WIDTH, IW5_POPUP_HEIGHT ) 33 | IW5_POPUP( "NOTICE", "@MENU_ARE_YOU_SURE_QUIT" ) 34 | IW5_CREATE_BUTTON( 0, "YES", uiScript "quit"; ) 35 | IW5_CREATE_BUTTON( 1, "NO", MENU_BACK_ACTION; ) 36 | } -------------------------------------------------------------------------------- /scriptmenus/class.menu: -------------------------------------------------------------------------------- 1 | #include "ui_mp/includes/menudef.h" 2 | #include "ui_mp/includes/macros.h" 3 | #include "ui_mp/includes/styles.h" 4 | 5 | #define MENU_NAME "class" 6 | #define CHANGE_CLASS_ACTION \ 7 | if ( localvarstring( "ui_team" ) == "marines" ) \ 8 | { \ 9 | scriptmenuresponse "changeclass_marines"; \ 10 | } \ 11 | if ( localvarstring( "ui_team" ) == "opfor" ) \ 12 | { \ 13 | scriptmenuresponse "changeclass_opfor"; \ 14 | } 15 | 16 | 17 | menuDef 18 | { 19 | ADD_BASE_MENU 20 | } 21 | 22 | menuDef 23 | { 24 | ADD_STYLED_INGAME_MENU( iw3 ) 25 | 26 | IW3_INGAME 27 | 28 | #undef IW3_CHOICE_X_START #define IW3_CHOICE_X_START -320 29 | #undef IW3_CHOICE_Y_START #define IW3_CHOICE_Y_START -25 30 | #undef IW3_CHOICE_HORIZONTAL_ALIGN #define IW3_CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_CENTER 31 | 32 | CREATE_SHADER_VIS( 108 48 400 0.5 0 0, "line_horizontal", 1 1 1 0.85, IS_IW3 ) 33 | CREATE_SHADER_VIS( 138 49 340 10 0 0, "line_horizontal", 0.4 0.6 1 0.75, IS_IW3 ) 34 | CREATE_SHADER_VIS( 108 60 400 0.5 0 0, "line_horizontal", 1 1 1 0.85, IS_IW3 ) 35 | INGAME_FACTION_ICON( 10 58 128 128 0 0, 0.275 ) 36 | 37 | CREATE_TEXT( -400 28 800 0 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP, gametypename(), 1 1 1 0.85, IS_IW3, 38 | textalign ITEM_ALIGN_CENTER; 39 | textstyle ITEM_TEXTSTYLE_SHADOWED; 40 | textscale TEXTSIZE_TITLE; 41 | autowrapped ) 42 | 43 | CREATE_TEXT( -250 48 500 60 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_TOP, gametypedescription(), 1 1 1 0.75, IS_IW3, 44 | textalign ITEM_ALIGN_CENTER; 45 | textstyle ITEM_TEXTSTYLE_SHADOWED; 46 | textscale TEXTSIZE_SMALL; 47 | autowrapped ) 48 | 49 | IW3_CREATE_SEPARATOR( 2 ) 50 | IW3_CREATE_BUTTON( 0, "Choose Class", play "mouse_click"; CHANGE_CLASS_ACTION ) 51 | IW3_CREATE_BUTTON( 1, "Change Team", play "mouse_click"; scriptmenuresponse "changeteam" ) 52 | IW3_CREATE_BUTTON( 2.5, "Options", play "mouse_click"; open "pc_options_video" ) 53 | IW3_CREATE_BUTTON( 3.5, "Friends", play "mouse_click"; open "popup_friends" ) 54 | IW3_CREATE_BUTTON( 4.5, "Leave Game", play "mouse_click"; open "popup_leavegame" ) 55 | 56 | STYLE_WIDGET 57 | } 58 | 59 | menuDef 60 | { 61 | ADD_STYLED_INGAME_MENU( iw4 ) 62 | #undef IW4_CHOICE_Y_START #define IW4_CHOICE_Y_START 28 63 | 64 | IW4_INGAME( "@MENU_OPTIONS_CAPS" ) 65 | INGAME_FACTION_ICON( 10 58 128 128 1 1, 0.275 ) 66 | 67 | CREATE_TEXT( -272 0 272 28 3 1, gametypename(), 1 1 1 1, IS_IW4, 68 | textfont UI_FONT_LARGE; 69 | textalign ITEM_ALIGN_TOP_LEFT; 70 | textscale 0.35; 71 | autowrapped ) 72 | 73 | CREATE_TEXT( -272 28 272 60 3 1, gametypedescription(), 1 1 1 0.75, IS_IW4, 74 | textfont UI_FONT_DEFAULT; 75 | textalign ITEM_ALIGN_TOP_LEFT; 76 | textscale 0.375; 77 | textstyle ITEM_TEXTSTYLE_SHADOWED; 78 | autowrapped ) 79 | 80 | IW4_CREATE_SEPARATOR( 2 ) 81 | IW4_CREATE_BUTTON( 0, "Choose Class", play "mouse_click"; CHANGE_CLASS_ACTION ) 82 | IW4_CREATE_BUTTON( 1, "Change Team", play "mouse_click"; scriptmenuresponse "changeteam" ) 83 | IW4_CREATE_BUTTON( 2, "Options", play "mouse_click"; open "pc_options_video" ) 84 | IW4_CREATE_BUTTON( 3, "Friends", play "mouse_click"; open "popup_friends" ) 85 | IW4_CREATE_BUTTON( 4, "Leave Game", play "mouse_click"; open "popup_leavegame" ) 86 | 87 | IW4_CREATE_BUTTON( 18, "@PLATFORM_BACK_CAPS", scriptmenuresponse "back"; ) 88 | STYLE_WIDGET 89 | } 90 | 91 | menuDef 92 | { 93 | ADD_STYLED_INGAME_MENU( iw5 ) 94 | 95 | IW5_INGAME( "@MENU_OPTIONS_CAPS" ) 96 | INGAME_FACTION_ICON( 92.667 170 119.967 119.967 1 1, 0.5 ) 97 | 98 | CREATE_TEXT( -272 0 272 28 3 1, gametypename(), 1 1 1 1, IS_IW5, 99 | textfont UI_FONT_LARGE; 100 | textalign ITEM_ALIGN_TOP_LEFT; 101 | textscale 0.35; 102 | autowrapped ) 103 | 104 | CREATE_TEXT( -272 28 272 60 3 1, gametypedescription(), 1 1 1 0.75, IS_IW5, 105 | textfont UI_FONT_DEFAULT; 106 | textalign ITEM_ALIGN_TOP_LEFT; 107 | textscale 0.375; 108 | textstyle ITEM_TEXTSTYLE_SHADOWED; 109 | autowrapped ) 110 | 111 | IW5_CREATE_SEPARATOR( 0 ) 112 | IW5_CREATE_BUTTON( 0, "CHOOSE CLASS", play "mouse_click"; CHANGE_CLASS_ACTION ) 113 | IW5_CREATE_BUTTON( 1, "CHANGE TEAM", play "mouse_click"; scriptmenuresponse "changeteam" ) 114 | IW5_CREATE_BUTTON( 2, "OPTIONS", play "mouse_click"; open "pc_options_video" ) 115 | IW5_CREATE_BUTTON( 3, "FRIENDS", play "mouse_click"; open "popup_friends" ) 116 | IW5_CREATE_BUTTON( 4, "LEAVE GAME", play "mouse_click"; open "popup_leavegame" ) 117 | STYLE_WIDGET 118 | } -------------------------------------------------------------------------------- /styles/iw3.h: -------------------------------------------------------------------------------- 1 | #define IW3_CHOICE_X_SIZE 220 2 | #define IW3_CHOICE_Y_SIZE 22 3 | #define IW3_CHOICE_X_START -60 4 | #define IW3_CHOICE_Y_START -80 5 | #define IW3_CHOICE_X_SPACING ( IW3_CHOICE_X_SIZE + 5 ) 6 | #define IW3_CHOICE_Y_COUNT 20 7 | #define IW3_CHOICE_Y_SPACING ( IW3_CHOICE_Y_SIZE + 2 ) 8 | #define IW3_CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_LEFT 9 | #define IW3_CHOICE_VERTICAL_ALIGN VERTICAL_ALIGN_CENTER 10 | #define IW3_CHOICE_ROW( idx ) ( ( idx - 0 ) % IW3_CHOICE_Y_COUNT ) 11 | #define IW3_CHOICE_COL( idx ) ( ( idx - 0 - ( ( idx - 0 ) % IW3_CHOICE_Y_COUNT ) ) / IW3_CHOICE_Y_COUNT ) 12 | #define IW3_CHOICE_X( idx ) ( IW3_CHOICE_X_START + IW3_CHOICE_X_SPACING * IW3_CHOICE_COL( idx ) ) 13 | #define IW3_CHOICE_Y( idx ) ( IW3_CHOICE_Y_START + IW3_CHOICE_Y_SPACING * IW3_CHOICE_ROW( idx ) ) 14 | #define IW3_CHOICE_ORIGIN( idx ) IW3_CHOICE_X( idx ) IW3_CHOICE_Y( idx ) 15 | #define IW3_CHOICE_RECT( idx ) IW3_CHOICE_ORIGIN( idx ) IW3_CHOICE_X_SIZE IW3_CHOICE_Y_SIZE IW3_CHOICE_HORIZONTAL_ALIGN IW3_CHOICE_VERTICAL_ALIGN 16 | #define IW3_TEXTSIZE 0.4 17 | #define IW3_CHOICE_X_OFFSET -5 18 | #define IW3_TEXTCOLOUR 0.9 0.9 0.92 0.75 19 | 20 | #ifdef POPUP && POPUP == 1 21 | #undef IW3_CHOICE_X_SIZE #define IW3_CHOICE_X_SIZE 290 22 | #undef IW3_CHOICE_X_START #define IW3_CHOICE_X_START ( IW3_POPUP_WIDTH - IW3_CHOICE_X_SIZE - 9 ) 23 | #undef IW3_CHOICE_Y_START #define IW3_CHOICE_Y_START ( IW3_POPUP_HEIGHT - ( IW3_CHOICE_Y_SPACING * ITEM_COUNT ) - 2 ) 24 | #undef IW3_CHOICE_HORIZONTAL_ALIGN #define IW3_CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_CENTER 25 | #undef IW3_CHOICE_Y_SIZE #define IW3_CHOICE_Y_SIZE 18 26 | #undef IW3_TEXTSIZE #define IW3_TEXTSIZE 0.375 27 | #undef IW3_CHOICE_X_OFFSET #define IW3_CHOICE_X_OFFSET -2 28 | #endif 29 | 30 | #define IW3_TEMPLATE_TEXT_MENU \ 31 | textfont UI_FONT_DEFAULT \ 32 | textscale IW3_TEXTSIZE \ 33 | textstyle ITEM_TEXTSTYLE_SHADOWEDMORE \ 34 | textalign ITEM_ALIGN_MIDDLE_RIGHT \ 35 | textalignx IW3_CHOICE_X_OFFSET \ 36 | textaligny -0.5 \ 37 | forecolor IW3_TEXTCOLOUR 38 | 39 | #define IW3_CREATE_SEPARATOR( idx ) \ 40 | CREATE_SHADER_VIS( IW3_CHOICE_X( idx ) ( IW3_CHOICE_Y( idx ) + 1 ) IW3_CHOICE_X_SIZE 8 IW3_CHOICE_HORIZONTAL_ALIGN IW3_CHOICE_VERTICAL_ALIGN, "gradient_fadein", 0.9 0.9 1 0.07, IS_IW3 ) \ 41 | 42 | #define IW3_CREATE_BUTTON( idx, string, action_ ) \ 43 | IW3_CREATE_BUTTON_VIS( idx, string, action_, 1 ) 44 | 45 | #define IW3_CREATE_BUTTON_VIS( idx, string, action_, visibility ) \ 46 | CREATE_SHADER_EX( IW3_CHOICE_RECT( idx ), "gradient_fadein", 0.9 0.9 1 0.07, visibility && IS_IW3, group choice_button_##idx ) \ 47 | CREATE_SHADER_EX( ( IW3_CHOICE_X( idx ) + IW3_CHOICE_X_SIZE ) IW3_CHOICE_Y( idx ) 5 IW3_CHOICE_Y_SIZE IW3_CHOICE_HORIZONTAL_ALIGN IW3_CHOICE_VERTICAL_ALIGN, "button_highlight_end", 0.9 0.9 1 0.07, visibility && IS_IW3, group choice_button_##idx ) \ 48 | itemDef \ 49 | { \ 50 | rect IW3_CHOICE_RECT( idx ) \ 51 | exp text ( string ) \ 52 | style WINDOW_STYLE_EMPTY \ 53 | type ITEM_TYPE_BUTTON \ 54 | visible when ( visibility && IS_IW3 ) \ 55 | IW3_TEMPLATE_TEXT_MENU \ 56 | onFocus \ 57 | { \ 58 | setItemColor choice_button_##idx forecolor 0.9 0.9 1 0.3; \ 59 | play "mouse_over"; \ 60 | } \ 61 | leaveFocus \ 62 | { \ 63 | setItemColor choice_button_##idx forecolor 0.9 0.9 1 0.07; \ 64 | } \ 65 | action \ 66 | { \ 67 | play "mouse_click"; \ 68 | action_; \ 69 | } \ 70 | } 71 | 72 | #define FOG_SCROLL_TIME 60000 73 | #define THINFOG_SCROLL_TIME 100000 74 | 75 | #define IW3_BG \ 76 | CREATE_SHADER_VIS( 0 0 640 480 4 4, "uim_iw3_bg_back", 1 1 1 1, IS_IW3 ) \ 77 | CREATE_SHADER_EX( -107 0 1708 480 4 4, "uim_iw3_bg_fogscroll", 1 1 1 1, IS_IW3, exp rect X ( ( -107 ) - ( ( float( milliseconds() % FOG_SCROLL_TIME ) / FOG_SCROLL_TIME ) * ( 854 ) ) ) ) \ 78 | CREATE_SHADER_EX( -107 0 1708 480 4 4, "uim_iw3_bg_fogscroll_thin", 1 1 1 1, IS_IW3, exp rect X ( ( -961 ) + ( ( float( milliseconds() % THINFOG_SCROLL_TIME ) / THINFOG_SCROLL_TIME ) * ( 854 ) ) ) ) \ 79 | CREATE_SHADER_VIS( 0 0 640 480 4 4, "uim_iw3_bg_front", 1 1 1 1, IS_IW3 ) \ 80 | CREATE_SHADER_VIS( 0 0 640 480 4 4, "uim_iw3_bg_front2", 1 1 1 1, IS_IW3 ) 81 | 82 | #define IW3_BG_BLUR \ 83 | CREATE_SHADER_VIS( 0 0 640 480 4 4, "uim_iw3_bg_back_blur", 1 1 1 1, IS_IW3 ) \ 84 | CREATE_SHADER_EX( -107 0 1708 480 4 4, "uim_iw3_bg_fogscroll_blur", 1 1 1 1, IS_IW3, exp rect X ( ( -107 ) - ( ( float( milliseconds() % FOG_SCROLL_TIME ) / FOG_SCROLL_TIME ) * ( 854 ) ) ) ) \ 85 | CREATE_SHADER_VIS( 0 0 640 480 4 4, "uim_iw3_bg_front_blur", 1 1 1 1, IS_IW3 ) 86 | 87 | 88 | #define IW3_BG_NAV( string ) \ 89 | CREATE_SHADER_VIS( -120 -32 378 64, "white", 0.9 0.9 0.95 0.175, IS_IW3 ) \ 90 | CREATE_SHADER_VIS( 258 -32 16 -64, "button_highlight_end", 0.9 0.9 0.95 0.175, IS_IW3 ) \ 91 | CREATE_SHADER_VIS( 56 448 528 40, "white", 0.9 0.9 0.95 0.175, IS_IW3 ) \ 92 | CREATE_SHADER_VIS( 584 448 16 64, "button_highlight_end", 0.9 0.9 0.95 0.175, IS_IW3 ) \ 93 | CREATE_SHADER_VIS( 40 448 -16 64, "button_highlight_end", 0.9 0.9 0.95 0.175, IS_IW3 ) \ 94 | CREATE_SHADER_VIS( -120 464 160 32, "white", 0.9 0.9 0.95 0.175, IS_IW3 ) \ 95 | CREATE_SHADER_VIS( 600 464 160 32, "white", 0.9 0.9 0.95 0.175, IS_IW3 ) \ 96 | CREATE_TEXT( 12 3.5 0 0, string, 1 0.8 0.4 1, IS_IW3, textfont UI_FONT_DEFAULT \ 97 | textscale TEXTSIZE_TITLE \ 98 | textstyle ITEM_TEXTSTYLE_SHADOWED \ 99 | textalign ITEM_ALIGN_TOP_LEFT ) \ 100 | itemDef \ 101 | { \ 102 | text "@MENU_BACK" \ 103 | type ITEM_TYPE_BUTTON \ 104 | style WINDOW_STYLE_FILLED \ 105 | textstyle ITEM_TEXTSTYLE_SHADOWED \ 106 | rect -250 10 40 20 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_BOTTOM \ 107 | textfont UI_FONT_DEFAULT \ 108 | textalign ITEM_ALIGN_LEFT \ 109 | textscale TEXTSIZE_SMALL \ 110 | textaligny 18 \ 111 | visible 1 \ 112 | onFocus \ 113 | { \ 114 | play "mouse_over"; \ 115 | } \ 116 | action \ 117 | { \ 118 | play "mouse_click"; \ 119 | MENU_BACK_ACTION; \ 120 | } \ 121 | } 122 | 123 | #define IW3_INGAME \ 124 | CREATE_SHADER_VIS( 0 0 640 480 4 4, "white", 0 0 0 0.75, IS_IW3 ) \ 125 | CREATE_SHADER_VIS( 0 0 854 75 HORIZONTAL_ALIGN_FULLSCREEN 0, "gradient_top", 1 1 1 1, IS_IW3 ) \ 126 | CREATE_SHADER_VIS( 0 405 854 75 HORIZONTAL_ALIGN_FULLSCREEN 0, "gradient_bottom", 1 1 1 1, IS_IW3 ) 127 | 128 | #define IW3_POPUP_WIDTH ( 330 ) 129 | #define IW3_POPUP_HEIGHT ( 50 + ( IW3_CHOICE_Y_SPACING * ITEM_COUNT ) ) 130 | 131 | #define IW3_POPUP( title, desc ) \ 132 | CREATE_SHADER_VIS( -1000 -1000 2000 2000 2 2, "white", 0 0 0 0.5, IS_IW3 ) \ 133 | CREATE_SHADER_VIS( 0 0 IW3_POPUP_WIDTH IW3_POPUP_HEIGHT 0 0, "white", 0.2 0.2 0.22 1; border 1; bordersize 2; bordercolor 0.29 0.29 0.3 1, IS_IW3 ) \ 134 | CREATE_TEXT( 0 0 IW3_POPUP_WIDTH IW3_POPUP_HEIGHT 0 0, title, IW3_TEXTCOLOUR, IS_IW3, textfont UI_FONT_DEFAULT \ 135 | textscale 0.4583 \ 136 | textstyle ITEM_TEXTSTYLE_SHADOWEDMORE \ 137 | textalign ITEM_ALIGN_TOP_CENTER \ 138 | textaligny 4 ) 139 | -------------------------------------------------------------------------------- /styles/iw4.h: -------------------------------------------------------------------------------- 1 | #define IW4_CHOICE_X_SIZE 336 2 | #define IW4_CHOICE_Y_SIZE 20 3 | #define IW4_CHOICE_X_START -64 4 | #define IW4_CHOICE_Y_START 48 5 | #define IW4_CHOICE_X_SPACING 250 6 | #define IW4_CHOICE_Y_COUNT 20 7 | #define IW4_CHOICE_Y_SPACING IW4_CHOICE_Y_SIZE 8 | #define IW4_CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_LEFT 9 | #define IW4_CHOICE_VERTICAL_ALIGN VERTICAL_ALIGN_TOP 10 | #define IW4_CHOICE_ROW( idx ) ( ( idx - 0 ) % IW4_CHOICE_Y_COUNT ) 11 | #define IW4_CHOICE_COL( idx ) ( ( idx - 0 - ( ( idx - 0 ) % IW4_CHOICE_Y_COUNT ) ) / IW4_CHOICE_Y_COUNT ) 12 | #define IW4_CHOICE_X( idx ) ( IW4_CHOICE_X_START + IW4_CHOICE_X_SPACING * IW4_CHOICE_COL( idx ) ) 13 | #define IW4_CHOICE_Y( idx ) ( IW4_CHOICE_Y_START + IW4_CHOICE_Y_SPACING * IW4_CHOICE_ROW( idx ) ) 14 | #define IW4_CHOICE_ORIGIN( idx ) IW4_CHOICE_X( idx ) IW4_CHOICE_Y( idx ) 15 | #define IW4_CHOICE_RECT( idx ) IW4_CHOICE_ORIGIN( idx ) IW4_CHOICE_X_SIZE IW4_CHOICE_Y_SIZE IW4_CHOICE_HORIZONTAL_ALIGN IW4_CHOICE_VERTICAL_ALIGN 16 | #define IW4_CHOICE_X_OFFSET -60 17 | #define IW4_CHOICE_BACKGROUND "menu_button_selection_bar" 18 | #define IW4_TEXTALIGN ITEM_ALIGN_MIDDLE_RIGHT 19 | 20 | #ifdef POPUP && POPUP == 1 21 | #undef IW4_CHOICE_X_SIZE #define IW4_CHOICE_X_SIZE ( IW4_POPUP_WIDTH - 8 ) 22 | #undef IW4_CHOICE_Y_SIZE #define IW4_CHOICE_Y_SIZE 20 23 | #undef IW4_CHOICE_X_START #define IW4_CHOICE_X_START ( IW4_POPUP_WIDTH - IW4_CHOICE_X_SIZE - 4 ) 24 | #undef IW4_CHOICE_Y_START #define IW4_CHOICE_Y_START ( IW4_POPUP_HEIGHT - ( IW4_CHOICE_Y_SPACING * ITEM_COUNT ) ) 25 | #undef IW4_CHOICE_HORIZONTAL_ALIGN #define IW4_CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_CENTER 26 | #undef IW4_CHOICE_VERTICAL_ALIGN #define IW4_CHOICE_VERTICAL_ALIGN VERTICAL_ALIGN_CENTER 27 | #undef IW4_CHOICE_X_OFFSET #define IW4_CHOICE_X_OFFSET -24 28 | #undef IW4_CHOICE_BACKGROUND #define IW4_CHOICE_BACKGROUND "popup_button_selection_bar" 29 | #endif 30 | 31 | #define IW4_TEMPLATE_TEXT_MENU \ 32 | textfont UI_FONT_DEFAULT \ 33 | textscale TEXTSIZE_SMALL \ 34 | textstyle ITEM_TEXTSTYLE_NORMAL \ 35 | textalign IW4_TEXTALIGN \ 36 | textalignx IW4_CHOICE_X_OFFSET \ 37 | textaligny -1 \ 38 | forecolor 1 1 1 1 39 | 40 | #define IW4_CREATE_SEPARATOR( idx ) \ 41 | CREATE_SHADER_VIS( ( IW4_CHOICE_X( idx ) + 40 ) IW4_CHOICE_Y( idx ) 240 1 IW4_CHOICE_HORIZONTAL_ALIGN IW4_CHOICE_VERTICAL_ALIGN, "gradient_fadein", 1 1 1 0.65, IS_IW4 ) \ 42 | 43 | #define IW4_CREATE_BUTTON( idx, string, action_ ) \ 44 | CREATE_SHADER_EX( IW4_CHOICE_RECT( idx ), IW4_CHOICE_BACKGROUND, 0 0 0 0, IS_IW4, group choice_button_##idx ) \ 45 | itemDef \ 46 | { \ 47 | rect IW4_CHOICE_RECT( idx ) \ 48 | exp text ( string ) \ 49 | style WINDOW_STYLE_EMPTY \ 50 | type ITEM_TYPE_BUTTON \ 51 | visible when ( visibility && IS_IW4 ) \ 52 | IW4_TEMPLATE_TEXT_MENU \ 53 | onFocus \ 54 | { \ 55 | setItemColor choice_button_##idx forecolor 0 0 0 1; \ 56 | play "mouse_over"; \ 57 | } \ 58 | leaveFocus \ 59 | { \ 60 | setItemColor choice_button_##idx forecolor 0 0 0 0; \ 61 | } \ 62 | action \ 63 | { \ 64 | play "mouse_click"; \ 65 | action_; \ 66 | } \ 67 | } 68 | 69 | #define IW4_BG( string, show_front ) \ 70 | CREATE_SHADER_VIS( 0 0 640 480 4 4, "uim_iw4_bg", 1 1 1 1, IS_IW4 ) \ 71 | CREATE_SHADER_EX( 0 0 1708 480 0 0, "uim_iw4_smoke", 1 1 1 0.5, IS_IW4, exp rect X ( ( -107 ) - ( ( float( milliseconds() % 60000 ) / 60000 ) * ( 854 ) ) ) ) \ 72 | CREATE_SHADER_EX( 0 0 -1708 -480 0 0, "uim_iw4_smoke", 1 1 1 0.5, IS_IW4, exp rect X ( ( -107 + 854 ) + ( ( float( milliseconds() % 50000 ) / 50000 ) * ( 854 ) ) ) ) \ 73 | CREATE_SHADER_VIS( -427 -240 854 480 2 2, "uim_iw4_bg_front", 1 1 1 1, IS_IW4 && show_front ) \ 74 | CREATE_SHADER_EX( 0 0 640 480 4 4, "uim_iw4_glow", 1 1 1 0, IS_IW4, exp forecolor a ( ( ( sin( milliseconds( ) / 1500 ) + 1 ) * 0.25 ) + 0.25 ) ) \ 75 | CREATE_SHADER_EX( 0 0 640 480 4 4, "uim_iw4_glow", 1 1 1 0, IS_IW4, exp forecolor a ( ( ( sin( milliseconds( ) / 480 ) + 1 ) * 0.25 ) + 0.25 ) ) \ 76 | CREATE_SHADER_VIS( -64 0 280 480 1 0, "gradient_fadein_fadebottom", 1 1 1 0.1, IS_IW4 ) \ 77 | CREATE_TEXT( -60 0 272 28 1 1, string, 1 1 1 1, IS_IW4, \ 78 | textfont UI_FONT_LARGE; \ 79 | textalign ITEM_ALIGN_TOP_RIGHT; \ 80 | textscale 0.5; \ 81 | autowrapped ) 82 | 83 | #define IW4_INGAME( string ) \ 84 | CREATE_SHADER_VIS( 0 0 640 480 4 4, "white", 0 0 0 0.4, IS_IW4 ) \ 85 | CREATE_SHADER_EX( 0 0 640 480 4 4, "uim_iw4_glow", 1 1 1 0, IS_IW4, exp forecolor a ( ( ( sin( milliseconds( ) / 1500 ) + 1 ) * 0.25 ) + 0.25 ) ) \ 86 | CREATE_SHADER_EX( 0 0 640 480 4 4, "uim_iw4_glow", 1 1 1 0, IS_IW4, exp forecolor a ( ( ( sin( milliseconds( ) / 480 ) + 1 ) * 0.25 ) + 0.25 ) ) \ 87 | CREATE_SHADER_VIS( -64 0 280 480 1 0, "gradient_fadein_fadebottom", 0 0 0 0.25, IS_IW4 ) \ 88 | CREATE_TEXT( -60 0 272 28 1 1, string, 1 1 1 1, IS_IW4, \ 89 | textfont UI_FONT_LARGE; \ 90 | textalign ITEM_ALIGN_TOP_RIGHT; \ 91 | textscale 0.5; \ 92 | autowrapped ) 93 | 94 | #define IW4_POPUP_WIDTH ( 300 ) 95 | #define IW4_POPUP_HEIGHT ( 44 + ( IW4_CHOICE_Y_SPACING * ITEM_COUNT ) ) 96 | 97 | #define IW4_POPUP_WIDTH_POST ( - IW4_POPUP_WIDTH / 2 ) 98 | #define IW4_POPUP_HEIGHT_POST ( - IW4_POPUP_HEIGHT ) 99 | 100 | #define IW4_POPUP( title, desc ) \ 101 | exp rect Y ( - IW4_POPUP_HEIGHT ) \ 102 | CREATE_SHADER_VIS( -1000 -1000 2000 2000 2 2, "white", 0 0 0 0.35, IS_IW4 ) \ 103 | CREATE_SHADER_VIS( -1004 -564 1708 960 2 2, "xpbar_stencilbase", 1 1 1 1, IS_IW4 ) \ 104 | CREATE_SHADER_VIS( 0 0 IW4_POPUP_WIDTH IW4_POPUP_HEIGHT 0 0, "white", 0.5 0.5 0.5 1, IS_IW4 ) \ 105 | CREATE_SHADER_VIS( 0 0 1708 480 2 2, "mw2_popup_bg_fogstencil", 1 1 1 0.75; exp rect x ( 0 - ( ( float( milliseconds() % 60000 ) / 60000 ) * ( 854 ) ) ), IS_IW4 ) \ 106 | CREATE_SHADER_VIS( 0 0 -1708 -480 2 2, "mw2_popup_bg_fogscroll", 0.85 0.85 0.85 1; exp rect x ( 0 - ( ( float( milliseconds() % 60000 ) / 60000 ) * ( 854 ) ) ), IS_IW4 ) \ 107 | CREATE_SHADER_VIS( 0 0 IW4_POPUP_WIDTH IW4_POPUP_HEIGHT 2 2, "mockup_popup_bg_stencilfill", 1 1 1 1, IS_IW4 ) \ 108 | CREATE_SHADER_VIS( 0 0 -1708 -480 2 2, "mw2_popup_bg_fogstencil", 1 1 1 0.75; exp rect x ( ( - 854 ) + ( ( float( milliseconds() % 50000 ) / 50000 ) * ( 854 ) ) ), IS_IW4 ) \ 109 | CREATE_SHADER_VIS( 0 0 -1708 -480 2 2, "mw2_popup_bg_fogscroll", 0.85 0.85 0.85 1; exp rect x ( ( - 854 ) + ( ( float( milliseconds() % 50000 ) / 50000 ) * ( 854 ) ) ), IS_IW4 ) \ 110 | \ // shadow 111 | CREATE_SHADER_VIS( -64 0 64 IW4_POPUP_HEIGHT 2 2, "drop_shadow_l", 0 0 0 1, IS_IW4 ) \ 112 | CREATE_SHADER_VIS( IW4_POPUP_WIDTH 0 64 IW4_POPUP_HEIGHT 2 2, "drop_shadow_r", 0 0 0 1, IS_IW4 ) \ 113 | CREATE_SHADER_VIS( -64 -64 64 64 2 2, "drop_shadow_tl", 0 0 0 1, IS_IW4 ) \ 114 | CREATE_SHADER_VIS( IW4_POPUP_WIDTH -64 64 64 2 2, "drop_shadow_tr", 0 0 0 1, IS_IW4 ) \ 115 | CREATE_SHADER_VIS( 0 -64 IW4_POPUP_WIDTH 64 2 2, "drop_shadow_t", 0 0 0 1, IS_IW4 ) \ 116 | CREATE_SHADER_VIS( -64 IW4_POPUP_HEIGHT 64 64 2 2, "drop_shadow_bl", 0 0 0 1, IS_IW4 ) \ 117 | CREATE_SHADER_VIS( IW4_POPUP_WIDTH IW4_POPUP_HEIGHT 64 64 2 2, "drop_shadow_br", 0 0 0 1, IS_IW4 ) \ 118 | CREATE_SHADER_VIS( 0 IW4_POPUP_HEIGHT IW4_POPUP_WIDTH 64 2 2, "drop_shadow_b", 0 0 0 1, IS_IW4 ) \ 119 | \ // end shadow 120 | CREATE_TEXT( 0 0 IW4_POPUP_WIDTH IW4_POPUP_HEIGHT 0 0, title, 1 1 1 1, IS_IW4, textfont 9 \ 121 | textscale TEXTSIZE_SMALL \ 122 | textalign ITEM_ALIGN_TOP_CENTER \ 123 | textaligny 1 ) \ 124 | CREATE_TEXT( 0 0 IW4_POPUP_WIDTH IW4_POPUP_HEIGHT 0 0, desc, 1 1 1 1, IS_IW4, textfont UI_FONT_DEFAULT \ 125 | textscale TEXTSIZE_SMALL \ 126 | textalign ITEM_ALIGN_TOP_CENTER \ 127 | textaligny 21 ) 128 | -------------------------------------------------------------------------------- /styles/iw5.h: -------------------------------------------------------------------------------- 1 | #define IW5_CHOICE_X_SIZE 336 2 | #define IW5_CHOICE_Y_SIZE 17.3 3 | #define IW5_CHOICE_X_START -100 4 | #define IW5_CHOICE_Y_START 45 5 | #define IW5_CHOICE_X_SPACING 250 6 | #define IW5_CHOICE_Y_COUNT 20 7 | #define IW5_CHOICE_Y_SPACING ( IW5_CHOICE_Y_SIZE + 2.7 ) 8 | #define IW5_CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_LEFT 9 | #define IW5_CHOICE_VERTICAL_ALIGN VERTICAL_ALIGN_TOP 10 | #define IW5_CHOICE_ROW( idx ) ( ( idx - 0 ) % IW5_CHOICE_Y_COUNT ) 11 | #define IW5_CHOICE_COL( idx ) ( ( idx - 0 - ( ( idx - 0 ) % IW5_CHOICE_Y_COUNT ) ) / IW5_CHOICE_Y_COUNT ) 12 | #define IW5_CHOICE_X( idx ) ( IW5_CHOICE_X_START + IW5_CHOICE_X_SPACING * IW5_CHOICE_COL( idx ) ) 13 | #define IW5_CHOICE_Y( idx ) ( IW5_CHOICE_Y_START + IW5_CHOICE_Y_SPACING * IW5_CHOICE_ROW( idx ) ) 14 | #define IW5_CHOICE_ORIGIN( idx ) IW5_CHOICE_X( idx ) IW5_CHOICE_Y( idx ) 15 | #define IW5_CHOICE_RECT( idx ) IW5_CHOICE_ORIGIN( idx ) IW5_CHOICE_X_SIZE IW5_CHOICE_Y_SIZE IW5_CHOICE_HORIZONTAL_ALIGN IW5_CHOICE_VERTICAL_ALIGN 16 | #define IW5_CHOICE_X_OFFSET -25 17 | #define IW5_TEXTALIGN ITEM_ALIGN_MIDDLE_RIGHT 18 | 19 | #ifdef POPUP && POPUP == 1 20 | #undef IW5_CHOICE_X_SIZE #define IW5_CHOICE_X_SIZE IW5_POPUP_WIDTH 21 | #undef IW5_CHOICE_Y_SIZE #define IW5_CHOICE_Y_SIZE 20 22 | #undef IW5_CHOICE_Y_SPACING #define IW5_CHOICE_Y_SPACING 22 23 | #undef IW5_CHOICE_X_START #define IW5_CHOICE_X_START ( IW5_POPUP_WIDTH - IW5_CHOICE_X_SIZE ) 24 | #undef IW5_CHOICE_Y_START #define IW5_CHOICE_Y_START ( IW5_POPUP_HEIGHT - ( IW5_CHOICE_Y_SPACING * ITEM_COUNT ) - 4 ) 25 | #undef IW5_CHOICE_HORIZONTAL_ALIGN #define IW5_CHOICE_HORIZONTAL_ALIGN HORIZONTAL_ALIGN_CENTER 26 | #undef IW5_CHOICE_VERTICAL_ALIGN #define IW5_CHOICE_VERTICAL_ALIGN VERTICAL_ALIGN_CENTER 27 | #undef IW5_TEXTALIGN #define IW5_TEXTALIGN ITEM_ALIGN_MIDDLE_LEFT 28 | #undef IW5_CHOICE_X_OFFSET #define IW5_CHOICE_X_OFFSET 8 29 | #endif 30 | 31 | #define IW5_TEMPLATE_TEXT_MENU \ 32 | textfont UI_FONT_DEFAULT \ 33 | textscale TEXTSIZE_SMALL \ 34 | textstyle ITEM_TEXTSTYLE_NORMAL \ 35 | textalign IW5_TEXTALIGN \ 36 | textalignx IW5_CHOICE_X_OFFSET \ 37 | textaligny -0.5 \ 38 | forecolor 1 1 1 1 39 | 40 | #define IW5_CREATE_SEPARATOR( idx ) \ 41 | CREATE_SHADER_VIS( ( IW5_CHOICE_X( idx ) + 144 ) ( IW5_CHOICE_Y( idx ) - 2.5 ) 192 1 IW5_CHOICE_HORIZONTAL_ALIGN IW5_CHOICE_VERTICAL_ALIGN, "gradient_fadein", 1 1 1 0.25, IS_IW5 ) \ 42 | 43 | #define IW5_CREATE_BUTTON( idx, string, action_ ) \ 44 | CREATE_SHADER_EX( IW5_CHOICE_RECT( idx ), "white", 0 0 0 0, IS_IW5 && POPUP == 1, name choice_button_fade##idx ) \ 45 | CREATE_SHADER_EX( IW5_CHOICE_RECT( idx ), "gradient_fadein", 0 0 0 0, IS_IW5, group choice_button_##idx ) \ 46 | CREATE_SHADER_ALT( IW5_CHOICE_X( idx ) ( IW5_CHOICE_Y( idx ) + IW5_CHOICE_Y_SIZE ) IW5_CHOICE_X_SIZE 3.6667 IW5_CHOICE_HORIZONTAL_ALIGN IW5_CHOICE_VERTICAL_ALIGN, "gradient_top", 0 0 0 0, IS_IW5, group choice_button_##idx ) \ 47 | itemDef \ 48 | { \ 49 | rect IW5_CHOICE_RECT( idx ) \ 50 | exp text ( string ) \ 51 | style WINDOW_STYLE_EMPTY \ 52 | type ITEM_TYPE_BUTTON \ 53 | visible when ( visibility && IS_IW5 ) \ 54 | IW5_TEMPLATE_TEXT_MENU \ 55 | onFocus \ 56 | { \ 57 | setItemColor choice_button_##idx forecolor 0.488 0.520 0.465 1; \ 58 | setItemColor choice_button_fade##idx forecolor 0.488 0.520 0.465 0.4; \ 59 | setItemColor choice_button_##idx backcolor 1 1 1 1; \ 60 | play "mouse_over"; \ 61 | } \ 62 | leaveFocus \ 63 | { \ 64 | setItemColor choice_button_##idx forecolor 0 0 0 0; \ 65 | setItemColor choice_button_fade##idx forecolor 0 0 0 0; \ 66 | setItemColor choice_button_##idx backcolor 0 0 0 0; \ 67 | } \ 68 | action \ 69 | { \ 70 | play "mouse_click"; \ 71 | action_; \ 72 | } \ 73 | } 74 | 75 | #define IW5_BG( string, blur ) \ 76 | CREATE_SHADER_VIS( 0 0 640 480 4 4, "uim_iw5_bg", 1 1 1 1, IS_IW5 && !blur ) \ 77 | CREATE_SHADER_VIS( 0 0 640 480 4 4, "uim_iw5_bg_blur", 1 1 1 1, IS_IW5 && blur ) \ 78 | CREATE_SHADER_EX( 0 0 1708 480 0 0, "uim_iw5_smoke", 0.35 0.35 0.35 1, IS_IW5, exp rect X ( ( -107 ) - ( ( float( milliseconds() % 60000 ) / 60000 ) * ( 854 ) ) ) ) \ 79 | CREATE_SHADER_EX( 0 0 -1708 -480 0 0, "uim_iw5_smoke", 0.35 0.35 0.35 1, IS_IW5, exp rect X ( ( -107 + 854 ) + ( ( float( milliseconds() % 50000 ) / 50000 ) * ( 854 ) ) ) ) \ 80 | CREATE_SHADER_VIS( -426.667 -36 853.333 480 2 1, "white", 0 0 0 0.4, IS_IW5 ) \ 81 | CREATE_SHADER_VIS( 237.5 -236 13 680 1 1, "gradient", 1 1 1 0.75, IS_IW5 ) \ 82 | CREATE_SHADER_VIS( -64 -36 301.5 480 1 1, "white", 0 0 0 0.4, IS_IW5 ) \ 83 | CREATE_SHADER_VIS( 236 -36 1 480 1 1, "white", 1 1 1 0.1, IS_IW5 ) \ 84 | CREATE_TEXT( -63 13 276.667 24.233 1 1, string, 1 1 1 1, IS_IW5, \ 85 | textfont UI_FONT_LARGE; \ 86 | textalign ITEM_ALIGN_BOTTOM_RIGHT; \ 87 | textscale 0.5; \ 88 | autowrapped ) 89 | 90 | #define IW5_INGAME( string ) \ 91 | CREATE_SHADER_VIS( 0 0 640 480 4 4, "white", 0 0 0 0.4, IS_IW5 ) \ 92 | CREATE_SHADER_VIS( 237.5 -236 13 680 1 1, "gradient", 1 1 1 0.75, IS_IW5 ) \ 93 | CREATE_SHADER_VIS( -64 -36 301.5 480 1 1, "white", 0 0 0 0.4, IS_IW5 ) \ 94 | CREATE_SHADER_VIS( 236 -36 1 480 1 1, "white", 1 1 1 0.1, IS_IW5 ) \ 95 | CREATE_TEXT( -63 13 276.667 24.233 1 1, string, 1 1 1 1, IS_IW5, \ 96 | textfont UI_FONT_LARGE; \ 97 | textalign ITEM_ALIGN_BOTTOM_RIGHT; \ 98 | textscale 0.5; \ 99 | autowrapped ) 100 | 101 | 102 | #define IW5_POPUP_WIDTH ( 260 ) 103 | #define IW5_POPUP_HEIGHT ( 75 + ( IW5_CHOICE_Y_SPACING * ITEM_COUNT ) ) 104 | 105 | #define IW5_POPUP( title, desc ) \ 106 | CREATE_SHADER_VIS( -1000 -1000 2000 2000 2 2, "white", 0 0 0 0.8, IS_IW5 ) \ 107 | CREATE_SHADER_VIS( 0 0 IW5_POPUP_WIDTH IW5_POPUP_HEIGHT 0 0, "white", 0.3098 0.349 0.2745 1, IS_IW5 ) \ 108 | CREATE_SHADER_VIS( 0 0 IW5_POPUP_WIDTH 24 0 0, "white", 0.1569 0.1725 0.1608 1, IS_IW5 ) \ 109 | CREATE_SHADER_VIS( 0 24 IW5_POPUP_WIDTH 5 0 0, "gradient_top", 1 1 1 0.75, IS_IW5 ) \ 110 | CREATE_SHADER_VIS( 0 24 IW5_POPUP_WIDTH 2 0 0, "white", 0 0 0 1, IS_IW5 ) \ 111 | CREATE_SHADER_VIS( 0 IW5_CHOICE_Y_START IW5_POPUP_WIDTH ( IW5_CHOICE_Y_SPACING * ITEM_COUNT ) 0 0, "white", 0.2118 0.2314 0.22 1, IS_IW5 ) \ 112 | CREATE_TEXT( 0 0 IW5_POPUP_WIDTH 24 0 0, title, 1 1 1 1, IS_IW5, textfont 9 \ 113 | textscale TEXTSIZE_SMALL \ 114 | textalign ITEM_ALIGN_MIDDLE_LEFT \ 115 | textalignx 9 ) \ 116 | CREATE_TEXT( 0 24 IW5_POPUP_WIDTH IW5_POPUP_HEIGHT 0 0, desc, 1 1 1 1, IS_IW5, textfont UI_FONT_DEFAULT \ 117 | textscale TEXTSIZE_SMALL \ 118 | textalign ITEM_ALIGN_TOP_LEFT \ 119 | textalignx 9 \ 120 | textaligny 3 ) --------------------------------------------------------------------------------