From 3ccd0987eee3c07aefa6fb3189c7f8445d6ae8cc Mon Sep 17 00:00:00 2001 From: Diavolo Date: Sat, 16 Jul 2022 22:31:38 +0200 Subject: [PATCH] Clantag --- iw4x/iw4x_00/ui_mp/menu_online_barracks.menu | 20 ++++-- iw4x/iw4x_00/ui_mp/popup_customclan.menu | 71 ++++++++++++++++++++ 2 files changed, 87 insertions(+), 4 deletions(-) create mode 100644 iw4x/iw4x_00/ui_mp/popup_customclan.menu diff --git a/iw4x/iw4x_00/ui_mp/menu_online_barracks.menu b/iw4x/iw4x_00/ui_mp/menu_online_barracks.menu index f37427e..48d409c 100644 --- a/iw4x/iw4x_00/ui_mp/menu_online_barracks.menu +++ b/iw4x/iw4x_00/ui_mp/menu_online_barracks.menu @@ -161,11 +161,23 @@ menuDef } } - MENU_CHOICE_HORIZONTAL_LINE(3) + itemDef + { + 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"); + } + } + + MENU_CHOICE_HORIZONTAL_LINE(4) itemDef { - BUTTON_BASE(3, "button_3", "@MPUI_RESET_STATS_CAPS", 0) + BUTTON_BASE(4, "button_4", "@MPUI_RESET_STATS_CAPS", 0) BUTTON_ACTION(open "stats_reset";) onFocus { @@ -177,7 +189,7 @@ menuDef itemDef { - BUTTON_BASE(4, "button_4", "@MPUI_UNLOCK_STATS_CAPS", 0) + BUTTON_BASE(5, "button_5", "@MPUI_UNLOCK_STATS_CAPS", 0) BUTTON_ACTION(open "stats_unlock";) onFocus { @@ -191,7 +203,7 @@ menuDef itemDef { - BUTTON_BASE(5, "button_5", "@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)))) + 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 diff --git a/iw4x/iw4x_00/ui_mp/popup_customclan.menu b/iw4x/iw4x_00/ui_mp/popup_customclan.menu new file mode 100644 index 0000000..573c5ef --- /dev/null +++ b/iw4x/iw4x_00/ui_mp/popup_customclan.menu @@ -0,0 +1,71 @@ +#include "ui/menudef.h" +#include "ui_mp/main.inc" +#include "ui_mp/popup.inc" + +#define MENU_NAME "popup_customclan" +#define MENU_TITLE "@MPUI_CLAN_TAG" + +#define POPMENU_POS_X -150 +#define POPMENU_POS_Y -84 + +#define POPMENU_WIDTH 300 +#define POPMENU_HEIGHT 84 + +#define POPMENU_RECT POPMENU_POS_X POPMENU_POS_Y POPMENU_WIDTH POPMENU_HEIGHT HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER + +#define ITEM_NAMEENTRY \ + itemDef \ + { \ + name "customclanEntry" \ + rect 10 32 (POPMENU_WIDTH - 20) 20 HORIZONTAL_ALIGN_CENTER VERTICAL_ALIGN_CENTER \ + style WINDOW_STYLE_FILLED \ + foreColor CHOICE_TEXTCOLOR \ + backColor 0 0 0 0.3 \ + type ITEM_TYPE_EDITFIELD \ + textFont UI_FONT_SMALL \ + textAlignX 5 \ + textAlignY 18 \ + textScale CHOICE_TEXTSIZE \ + visible 1 \ + text " " \ + dvar "clanName" \ + maxChars 15 \ + maxPaintChars 15 \ + accept \ + { \ + close self; \ + } \ + } + +#define ON_MENU_OPEN \ + setLocalVarInt "ui_centerPopup" (1); \ + setFocus "customclanEntry"; + +#define ON_MENU_CLOSE \ + setLocalVarInt "ui_centerPopup" (0); + +#define ON_MENU_ESC \ + close self; + +menuDef +{ + name MENU_NAME + rect POPMENU_RECT + popup + legacySplitScreenScale + style WINDOW_STYLE_FILLED + foreColor CHOICE_TEXTCOLOR + focusColor CHOICE_TEXTCOLOR + backColor 1 1 1 1 + background "white" + MENU_ON_OPEN(ON_MENU_OPEN) + MENU_ON_CLOSE(ON_MENU_CLOSE) + MENU_ON_ESC(ON_MENU_ESC) + + POPUP_BACKGROUND_BASE + POPUP_TITLE2(MENU_TITLE) + + ITEM_NAMEENTRY + + POPUP_BUTTON_FOOTER(64, "@MENU_CLOSE", close self;) +}