2021-04-04 09:20:03 -07:00
|
|
|
#include "ui/menudef.h"
|
|
|
|
#include "ui_mp/main.inc"
|
|
|
|
#include "ui_mp/barracks.inc"
|
|
|
|
|
|
|
|
#undef TEXTSIZE_TITLE
|
|
|
|
#define TEXTSIZE_TITLE FONTSCALE_BIG
|
|
|
|
|
|
|
|
#define MENU_NAME "menu_online_barracks"
|
|
|
|
#define MENU_MUSIC "music_mainmenu_mp"
|
|
|
|
#define MENU_TITLE "@MPUI_BARRACKS_CAP"
|
|
|
|
|
|
|
|
#undef CHOICE_GROUP
|
|
|
|
#define CHOICE_GROUP MENU_NAME
|
|
|
|
|
|
|
|
#define CHOICE_Y(i) ((PLAYERCARD_POS_Y + 28) + (i * 20))
|
|
|
|
#define CHOICE_ORIGIN(i) -64 CHOICE_Y(i)
|
|
|
|
#define CHOICE_RECT(i) CHOICE_ORIGIN(i) 336 20 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP
|
|
|
|
|
|
|
|
#define HR_ORIGIN(i) 0 (CHOICE_Y(i) - 0.5)
|
|
|
|
#define HR_RECT(i) HR_ORIGIN(i) 216 1 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP
|
|
|
|
|
|
|
|
#define ON_MENU_OPEN \
|
|
|
|
focusFirst;
|
|
|
|
|
|
|
|
#define ON_MENU_ESC \
|
|
|
|
close self;
|
|
|
|
|
|
|
|
#define BUTTON_BASE(itemIndex, nameArg, textArg, disabledArg) \
|
|
|
|
name nameArg \
|
|
|
|
rect CHOICE_RECT(itemIndex) \
|
|
|
|
group "mw2_button" \
|
|
|
|
style WINDOW_STYLE_FILLED \
|
|
|
|
foreColor CHOICE_TEXTCOLOR \
|
|
|
|
disableColor MENU_BUTTON_TEXTCOLOR_DISABLED \
|
|
|
|
background HIGHLIGHT_SHADER_ART \
|
|
|
|
type ITEM_TYPE_BUTTON \
|
|
|
|
textFont CHOICE_TEXTFONT \
|
|
|
|
textAlign ITEM_ALIGN_TOP_RIGHT \
|
|
|
|
textAlignX -60 \
|
|
|
|
textScale CHOICE_TEXTSIZE \
|
|
|
|
disabled when (disabledArg) \
|
|
|
|
text textArg \
|
|
|
|
visible 1 \
|
|
|
|
BUTTON_LEAVE_FOCUS \
|
|
|
|
|
|
|
|
#define BUTTON_ACTION(actionArg) \
|
|
|
|
action \
|
|
|
|
{ \
|
|
|
|
play CHOICE_CLICK_SOUND; \
|
|
|
|
actionArg \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define BUTTON_LEAVE_FOCUS \
|
|
|
|
leaveFocus \
|
|
|
|
{ \
|
|
|
|
setItemColor self backColor 0 0 0 0; \
|
|
|
|
setLocalVarString "ui_hint_text" ("@NULL_EMPTY"); \
|
|
|
|
setLocalVarBool "ui_menuAButton" (0); \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define HINT_AREA \
|
|
|
|
itemDef \
|
|
|
|
{ \
|
|
|
|
rect 0 320 215 18 HORIZONTAL_ALIGN_LEFT VERTICAL_ALIGN_TOP \
|
|
|
|
decoration \
|
|
|
|
autowrapped \
|
|
|
|
visible 1 \
|
|
|
|
foreColor 1 1 1 0.65 \
|
|
|
|
textFont UI_FONT_SMALL \
|
|
|
|
textAlign ITEM_ALIGN_TOP_RIGHT \
|
|
|
|
textAlignX -1 \
|
|
|
|
textScale CHOICE_TEXTSIZE \
|
|
|
|
exp text (localvarstring("ui_hint_text")) \
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
menuDef
|
|
|
|
{
|
|
|
|
name MENU_NAME
|
|
|
|
fullscreen 1
|
|
|
|
rect 0 0 640 480
|
|
|
|
foreColor CHOICE_TEXTCOLOR
|
|
|
|
focusColor CHOICE_TEXTCOLOR
|
|
|
|
soundLoop MENU_MUSIC
|
|
|
|
fadeCycle 1
|
|
|
|
fadeClamp 1
|
|
|
|
fadeAmount 0.1
|
2021-04-04 09:20:03 -07:00
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
MENU_ON_OPEN(ON_MENU_OPEN)
|
|
|
|
MENU_ON_ESC(ON_MENU_ESC)
|
2021-04-04 09:20:03 -07:00
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
#define BACKGROUND_IW4
|
|
|
|
#include "ui_mp/bg.inc"
|
2021-04-04 09:20:03 -07:00
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
ITEM_NEWSTICKER_VIS("", 1, NEWSTICKER_SPEED)
|
2021-04-04 09:20:03 -07:00
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
MENU_CHOICE_TITLE(MENU_TITLE, PLAYERCARD_POS_Y)
|
2021-04-04 09:20:03 -07:00
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
MENU_PARTY_STATUS_STRING
|
2021-04-04 09:20:03 -07:00
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
HINT_AREA
|
2021-04-04 09:20:03 -07:00
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
itemDef
|
2021-04-04 09:20:03 -07:00
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
BUTTON_BASE(0, "button_0", "@MPUI_CHALLENGES_CAPS", !isItemUnlocked("challenges"))
|
|
|
|
BUTTON_ACTION(setPlayerData("featureNew", "challenges", "false"); open "menu_challenges";)
|
|
|
|
onFocus
|
2021-04-04 09:20:03 -07:00
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
play CHOICE_FOCUS_SOUND;
|
|
|
|
setItemColor self backColor 0 0 0 1;
|
|
|
|
if (isItemUnlocked("challenges"))
|
2021-04-04 09:20:03 -07:00
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
setLocalVarString "ui_hint_text" ("@MPUI_DESC_CHALLENGES");
|
2021-04-04 09:20:03 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
if (tablelookup("mp/unlockTable.csv", 0, "challenges", 2) == 9999)
|
2021-04-04 09:20:03 -07:00
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
setLocalVarString "ui_hint_text" ("@PERKS_UNLOCKED_AT_NONE");
|
2021-04-04 09:20:03 -07:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
if (tablelookup("mp/unlockTable.csv", 0, "challenges", 3) != "")
|
|
|
|
{
|
|
|
|
setLocalVarString "ui_hint_text" ("@PERKS_UNLOCKED_BY_CHALLENGE");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
setLocalVarString "ui_hint_text" ("@" + tablelookup("mp/rankTable.csv", 0, tablelookup("mp/unlockTable.csv", 0, "challenges", 2) , 17));
|
|
|
|
}
|
2021-04-04 09:20:03 -07:00
|
|
|
}
|
2023-12-15 09:02:18 -08:00
|
|
|
exec "set ui_hint_text THIS MENU SHOULD BE UPDATED TO USE setLocalVarString ui_hint_text;";
|
2021-04-04 09:20:03 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
MENU_CHOICE_NEWICON_VIS(0, when((getplayerdata("prestige") < int(tablelookup("mp/rankIconTable.csv", 0, "maxprestige", 1)) && getplayerdata("experience") >= int(tablelookup("mp/rankTable.csv", 0, int(tablelookup("mp/rankTable.csv", 0, "maxrank", 1)), 7))) && getplayerdata("featureNew" ,"prestige")))
|
2021-04-04 09:20:03 -07:00
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
itemDef
|
2021-04-04 09:20:03 -07:00
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
BUTTON_BASE(1, "button_1", "@MPUI_HIGHLIGHTS_CAPS", 0)
|
|
|
|
BUTTON_ACTION(open "menu_records";)
|
|
|
|
onFocus
|
|
|
|
{
|
|
|
|
play CHOICE_FOCUS_SOUND;
|
|
|
|
setItemColor self backColor 0 0 0 1;
|
|
|
|
setLocalVarString "ui_hint_text" ("@MPUI_DESC_HIGHLIGHTS");
|
|
|
|
}
|
2021-04-04 09:20:03 -07:00
|
|
|
}
|
2023-12-15 09:02:18 -08:00
|
|
|
|
|
|
|
MENU_CHOICE_HORIZONTAL_LINE(2)
|
2021-04-04 09:20:03 -07:00
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
itemDef
|
2021-04-04 09:20:03 -07:00
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
BUTTON_BASE(2, "button_2", "@MENU_CUSTOM_TITLE_CAPS", 0)
|
|
|
|
BUTTON_ACTION(open "popup_customtitle";)
|
|
|
|
onFocus
|
|
|
|
{
|
|
|
|
play CHOICE_FOCUS_SOUND;
|
|
|
|
setItemColor self backColor 0 0 0 1;
|
|
|
|
setLocalVarString "ui_hint_text" ("@MPUI_DESC_CUSTOM_TITLE");
|
|
|
|
}
|
2021-04-04 09:20:03 -07:00
|
|
|
}
|
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
itemDef
|
2022-07-16 13:31:38 -07:00
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
BUTTON_BASE(3, "button_3", "@MPUI_CLAN_TAG_CAPS", 0)
|
|
|
|
BUTTON_ACTION(open "popup_customclan";)
|
|
|
|
onFocus
|
|
|
|
{
|
|
|
|
play CHOICE_FOCUS_SOUND;
|
|
|
|
setItemColor self backColor 0 0 0 1;
|
|
|
|
setLocalVarString "ui_hint_text" ("@MPUI_DESC_CLANTAG");
|
|
|
|
}
|
2022-07-16 13:31:38 -07:00
|
|
|
}
|
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
MENU_CHOICE_HORIZONTAL_LINE(4)
|
2021-04-04 09:20:03 -07:00
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
itemDef
|
2021-04-04 09:20:03 -07:00
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
BUTTON_BASE(4, "button_4", "@MPUI_RESET_STATS_CAPS", 0)
|
|
|
|
BUTTON_ACTION(open "stats_reset";)
|
|
|
|
onFocus
|
|
|
|
{
|
|
|
|
play CHOICE_FOCUS_SOUND;
|
|
|
|
setItemColor self backColor 0 0 0 1;
|
|
|
|
setLocalVarString "ui_hint_text" ("@MPUI_DESC_RESET_STATS");
|
|
|
|
}
|
2021-04-04 09:20:03 -07:00
|
|
|
}
|
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
itemDef
|
2021-04-04 09:20:03 -07:00
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
BUTTON_BASE(5, "button_5", "@MPUI_UNLOCK_STATS_CAPS", 0)
|
|
|
|
BUTTON_ACTION(open "stats_unlock";)
|
|
|
|
onFocus
|
|
|
|
{
|
|
|
|
play CHOICE_FOCUS_SOUND;
|
|
|
|
setItemColor self backColor 0 0 0 1;
|
|
|
|
setLocalVarString "ui_hint_text" ("@MPUI_DESC_UNLOCK_STATS");
|
|
|
|
}
|
2021-04-04 09:20:03 -07:00
|
|
|
}
|
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
MENU_CHOICE_HORIZONTAL_LINE_VIS(5, when ((getplayerdata("prestige") == int(tablelookup("mp/rankIconTable.csv", 0, "maxprestige", 1))) == 0))
|
2021-04-04 09:20:03 -07:00
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
itemDef
|
2021-04-04 09:20:03 -07:00
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
BUTTON_BASE(6, "button_6", "@MPUI_PRESTIGE_MODE_CAPS", !(getplayerdata("prestige") < int(tablelookup("mp/rankIconTable.csv", 0, "maxprestige", 1)) && getplayerdata("experience") >= int(tablelookup("mp/rankTable.csv", 0, int(tablelookup("mp/rankTable.csv", 0, "maxrank", 1)), 7))) && !(getplayerdata("prestige") == int(tablelookup("mp/rankIconTable.csv", 0, "maxprestige", 1))))
|
|
|
|
visible when (!(getplayerdata("prestige") == int(tablelookup("mp/rankIconTable.csv", 0, "maxprestige", 1))))
|
|
|
|
BUTTON_ACTION(open "prestige_reset1";)
|
|
|
|
onFocus
|
2021-04-04 09:20:03 -07:00
|
|
|
{
|
2023-12-15 09:02:18 -08:00
|
|
|
play CHOICE_FOCUS_SOUND;
|
|
|
|
setItemColor self backColor 0 0 0 1;
|
|
|
|
setPlayerData("featureNew", "prestige", "false");
|
|
|
|
if (!(getplayerdata("prestige") < int(tablelookup("mp/rankIconTable.csv", 0, "maxprestige", 1)) && getplayerdata("experience") >= int(tablelookup("mp/rankTable.csv", 0, int(tablelookup("mp/rankTable.csv", 0, "maxrank", 1)) , 7))))
|
|
|
|
{
|
|
|
|
setLocalVarString "ui_hint_text" ( "@MPUI_DESC_PRESTIGE2" );
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
setLocalVarString "ui_hint_text" ( "@MPUI_DESC_PRESTIGE" );
|
|
|
|
}
|
2021-04-04 09:20:03 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
MENU_CHOICE_NEWICON_VIS(5, when((getplayerdata("prestige") < int(tablelookup("mp/rankIconTable.csv", 0, "maxprestige", 1)) && getplayerdata("experience") >= int(tablelookup("mp/rankTable.csv", 0, int(tablelookup("mp/rankTable.csv", 0, "maxrank", 1)), 7))) && getplayerdata("featureNew", "prestige")))
|
2021-04-04 09:20:03 -07:00
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
MENU_ITEM_PLAYERCARD
|
|
|
|
MENU_ITEM_PLAYERSTATS
|
2021-04-04 09:20:03 -07:00
|
|
|
|
2023-12-15 09:02:18 -08:00
|
|
|
ITEM_BUTTON_FRIENDS(-120)
|
|
|
|
ITEM_BUTTON_BACK(close self;)
|
|
|
|
}
|
|
|
|
}
|