2019-03-13 19:20:07 +00:00
|
|
|
/*
|
2020-06-04 21:01:28 +00:00
|
|
|
===========================================================================
|
2019-03-13 19:20:07 +00:00
|
|
|
Copyright (C) 1997-2001 Id Software, Inc.
|
|
|
|
|
2020-06-04 21:01:28 +00:00
|
|
|
This file is part of Quake 2 source code.
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2020-06-04 21:01:28 +00:00
|
|
|
Quake 2 source code is free software; you can redistribute it
|
|
|
|
and/or modify it under the terms of the GNU General Public License as
|
|
|
|
published by the Free Software Foundation; either version 2 of the License,
|
|
|
|
or (at your option) any later version.
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2020-06-04 21:01:28 +00:00
|
|
|
Quake 2 source code is distributed in the hope that it will be
|
|
|
|
useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
2020-06-04 21:01:28 +00:00
|
|
|
along with Quake 2 source code; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
===========================================================================
|
2019-03-13 19:20:07 +00:00
|
|
|
*/
|
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
// menu_mp_playersetup.c -- the player setup menu
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
#include <ctype.h>
|
|
|
|
#ifdef _WIN32
|
|
|
|
#include <io.h>
|
|
|
|
#endif
|
|
|
|
#include "../client/client.h"
|
|
|
|
#include "ui_local.h"
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
=============================================================================
|
|
|
|
|
|
|
|
PLAYER CONFIG MENU
|
|
|
|
|
|
|
|
=============================================================================
|
|
|
|
*/
|
|
|
|
extern menuframework_s s_multiplayer_menu;
|
|
|
|
|
|
|
|
static menuframework_s s_player_config_menu;
|
2021-02-17 09:11:49 +00:00
|
|
|
static menufield_s s_playerconfig_name_field;
|
|
|
|
static menulist_s s_playerconfig_model_box;
|
|
|
|
static menulist_s s_playerconfig_skin_box;
|
|
|
|
static menulist_s s_playerconfig_handedness_box;
|
|
|
|
static menulist_s s_playerconfig_rate_box;
|
2021-10-21 06:03:19 +00:00
|
|
|
static menuslider_s s_playerconfig_railcolor_slider[3];
|
2021-02-17 09:11:49 +00:00
|
|
|
static menuseparator_s s_playerconfig_skin_title;
|
|
|
|
static menuseparator_s s_playerconfig_model_title;
|
|
|
|
static menuseparator_s s_playerconfig_hand_title;
|
|
|
|
static menuseparator_s s_playerconfig_rate_title;
|
2021-10-21 06:03:19 +00:00
|
|
|
static menuseparator_s s_playerconfig_railcolor_title;
|
2021-02-17 09:11:49 +00:00
|
|
|
static menuaction_s s_playerconfig_back_action;
|
|
|
|
|
|
|
|
//=======================================================================
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
#define NUM_SKINBOX_ITEMS 7
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-09-21 07:01:20 +00:00
|
|
|
static void Menu_PlayerHandednessCallback (void *unused)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-09-04 06:18:06 +00:00
|
|
|
UI_MenuSpinControl_SaveValue (&s_playerconfig_handedness_box, "hand");
|
2019-03-13 19:20:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-09-21 07:01:20 +00:00
|
|
|
static void Menu_PlayerRateCallback (void *unused)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-09-04 06:18:06 +00:00
|
|
|
UI_MenuSpinControl_SaveValue (&s_playerconfig_rate_box, "rate");
|
2019-03-13 19:20:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-10-21 06:03:19 +00:00
|
|
|
static void Menu_LoadPlayerRailColor (void)
|
|
|
|
{
|
|
|
|
color_t railColor;
|
|
|
|
|
|
|
|
if ( Com_ParseColorString(Cvar_VariableString("color1"), railColor) ) {
|
|
|
|
Cvar_SetInteger ("ui_player_railred", railColor[0]);
|
|
|
|
Cvar_SetInteger ("ui_player_railgreen", railColor[1]);
|
|
|
|
Cvar_SetInteger ("ui_player_railblue", railColor[2]);
|
|
|
|
}
|
|
|
|
UI_MenuSlider_SetValue (&s_playerconfig_railcolor_slider[0], "ui_player_railred", 0, 256, true);
|
|
|
|
UI_MenuSlider_SetValue (&s_playerconfig_railcolor_slider[1], "ui_player_railgreen", 0, 256, true);
|
|
|
|
UI_MenuSlider_SetValue (&s_playerconfig_railcolor_slider[2], "ui_player_railblue", 0, 256, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void Menu_SavePlayerRailColor (void)
|
|
|
|
{
|
|
|
|
Cvar_Set ( "color1", va("%02X%02X%02X",
|
|
|
|
min(max(Cvar_VariableInteger("ui_player_railred"), 0), 255),
|
|
|
|
min(max(Cvar_VariableInteger("ui_player_railgreen"), 0), 255),
|
|
|
|
min(max(Cvar_VariableInteger("ui_player_railblue"), 0), 255)) );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void Menu_PlayerRailColorRedFunc (void *unused)
|
|
|
|
{
|
|
|
|
UI_MenuSlider_SaveValue (&s_playerconfig_railcolor_slider[0], "ui_player_railred");
|
|
|
|
Menu_SavePlayerRailColor ();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void Menu_PlayerRailColorGreenFunc (void *unused)
|
|
|
|
{
|
|
|
|
UI_MenuSlider_SaveValue (&s_playerconfig_railcolor_slider[1], "ui_player_railgreen");
|
|
|
|
Menu_SavePlayerRailColor ();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
static void Menu_PlayerRailColorBlueFunc (void *unused)
|
|
|
|
{
|
|
|
|
UI_MenuSlider_SaveValue (&s_playerconfig_railcolor_slider[2], "ui_player_railblue");
|
|
|
|
Menu_SavePlayerRailColor ();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
static void Menu_PlayerModelCallback (void *unused)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-02-17 09:11:49 +00:00
|
|
|
int mNum, sNum;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-09-04 06:18:06 +00:00
|
|
|
mNum = s_playerconfig_model_box.curValue;
|
|
|
|
s_playerconfig_skin_box.itemNames = ui_pmi[mNum].skinDisplayNames;
|
|
|
|
s_playerconfig_skin_box.curValue = 0;
|
|
|
|
sNum = s_playerconfig_skin_box.curValue;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
UI_UpdatePlayerModelInfo (mNum, sNum);
|
2019-03-13 19:20:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
static void Menu_PlayerSkinCallback (void *unused)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-02-17 09:11:49 +00:00
|
|
|
int mNum, sNum;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-09-04 06:18:06 +00:00
|
|
|
mNum = s_playerconfig_model_box.curValue;
|
|
|
|
sNum = s_playerconfig_skin_box.curValue;
|
2021-02-17 09:11:49 +00:00
|
|
|
UI_UpdatePlayerSkinInfo (mNum, sNum);
|
2019-03-13 19:20:07 +00:00
|
|
|
}
|
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
//=======================================================================
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
qboolean Menu_PlayerConfig_Init (void)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-09-04 06:18:06 +00:00
|
|
|
int y;
|
2021-08-30 02:52:34 +00:00
|
|
|
int mNum = 0, sNum = 0;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
static const char *handedness_names[] = { "right", "left", "center", 0 };
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-09-04 06:18:06 +00:00
|
|
|
static const char *rate_names[] =
|
|
|
|
{
|
|
|
|
"28.8 Modem",
|
|
|
|
"33.6 Modem",
|
|
|
|
"56K/Single ISDN",
|
|
|
|
"Dual ISDN",
|
|
|
|
"Cable/DSL",
|
|
|
|
"T1/LAN",
|
|
|
|
"User defined",
|
|
|
|
0
|
|
|
|
};
|
|
|
|
static const char *rate_values[] =
|
|
|
|
{
|
|
|
|
"2500",
|
|
|
|
"3200",
|
|
|
|
"5000",
|
|
|
|
"10000",
|
|
|
|
"15000",
|
|
|
|
"25000",
|
|
|
|
UI_ITEMVALUE_WILDCARD,
|
|
|
|
0
|
|
|
|
};
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
if ( !UI_HaveValidPlayerModels(NULL) )
|
2019-03-13 19:20:07 +00:00
|
|
|
return false;
|
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
// get model and skin index and precache them
|
|
|
|
UI_InitPlayerModelInfo (&mNum, &sNum);
|
|
|
|
|
|
|
|
y = 0;
|
|
|
|
|
2019-03-13 19:20:07 +00:00
|
|
|
s_player_config_menu.x = SCREEN_WIDTH*0.5 - 210;
|
|
|
|
s_player_config_menu.y = SCREEN_HEIGHT*0.5 - 70;
|
|
|
|
s_player_config_menu.nitems = 0;
|
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_name_field.generic.type = MTYPE_FIELD;
|
|
|
|
s_playerconfig_name_field.generic.textSize = MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_name_field.generic.flags = QMF_LEFT_JUSTIFY;
|
|
|
|
s_playerconfig_name_field.generic.name = "name";
|
|
|
|
s_playerconfig_name_field.generic.callback = 0;
|
|
|
|
s_playerconfig_name_field.generic.x = -MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_name_field.generic.y = y;
|
|
|
|
s_playerconfig_name_field.length = 20;
|
|
|
|
s_playerconfig_name_field.visible_length = 20;
|
|
|
|
Q_strncpyz (s_playerconfig_name_field.buffer, sizeof(s_playerconfig_name_field.buffer), Cvar_VariableString("name"));
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_name_field.cursor = (int)strlen(s_playerconfig_name_field.buffer);
|
2021-02-17 09:11:49 +00:00
|
|
|
|
|
|
|
s_playerconfig_model_title.generic.type = MTYPE_SEPARATOR;
|
|
|
|
s_playerconfig_model_title.generic.textSize = MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_model_title.generic.flags = QMF_LEFT_JUSTIFY;
|
|
|
|
s_playerconfig_model_title.generic.name = "model";
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_model_title.generic.x = -2*MENU_FONT_SIZE;
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_model_title.generic.y = y += 3*MENU_LINE_SIZE;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_model_box.generic.type = MTYPE_SPINCONTROL;
|
|
|
|
s_playerconfig_model_box.generic.textSize = MENU_FONT_SIZE;
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_model_box.generic.x = -8*MENU_FONT_SIZE;
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_model_box.generic.y = y += MENU_LINE_SIZE;
|
2021-08-12 19:30:51 +00:00
|
|
|
s_playerconfig_model_box.generic.callback = Menu_PlayerModelCallback;
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_model_box.generic.cursor_offset = -1*MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_model_box.curValue = mNum;
|
|
|
|
s_playerconfig_model_box.itemNames = ui_pmnames;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_skin_title.generic.type = MTYPE_SEPARATOR;
|
|
|
|
s_playerconfig_skin_title.generic.textSize = MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_skin_title.generic.flags = QMF_LEFT_JUSTIFY;
|
|
|
|
s_playerconfig_skin_title.generic.name = "skin";
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_skin_title.generic.x = -3*MENU_FONT_SIZE;
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_skin_title.generic.y = y += 2*MENU_LINE_SIZE;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_skin_box.generic.type = MTYPE_SPINCONTROL;
|
|
|
|
s_playerconfig_skin_box.generic.textSize = MENU_FONT_SIZE;
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_skin_box.generic.x = -8*MENU_FONT_SIZE;
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_skin_box.generic.y = y += MENU_LINE_SIZE;
|
|
|
|
s_playerconfig_skin_box.generic.name = 0;
|
2021-08-12 19:30:51 +00:00
|
|
|
s_playerconfig_skin_box.generic.callback = Menu_PlayerSkinCallback; // Knightmare added, was 0
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_skin_box.generic.cursor_offset = -1*MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_skin_box.curValue = sNum;
|
|
|
|
s_playerconfig_skin_box.itemNames = ui_pmi[mNum].skinDisplayNames;
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_skin_box.generic.flags |= QMF_SKINLIST;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_hand_title.generic.type = MTYPE_SEPARATOR;
|
|
|
|
s_playerconfig_hand_title.generic.textSize = MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_hand_title.generic.flags = QMF_LEFT_JUSTIFY;
|
|
|
|
s_playerconfig_hand_title.generic.name = "handedness";
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_hand_title.generic.x = 3*MENU_FONT_SIZE;
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_hand_title.generic.y = y += 2*MENU_LINE_SIZE;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_handedness_box.generic.type = MTYPE_SPINCONTROL;
|
|
|
|
s_playerconfig_handedness_box.generic.textSize = MENU_FONT_SIZE;
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_handedness_box.generic.x = -8*MENU_FONT_SIZE;
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_handedness_box.generic.y = y += MENU_LINE_SIZE;
|
|
|
|
s_playerconfig_handedness_box.generic.name = 0;
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_handedness_box.generic.cursor_offset = -1*MENU_FONT_SIZE;
|
2021-09-21 07:01:20 +00:00
|
|
|
s_playerconfig_handedness_box.generic.callback = Menu_PlayerHandednessCallback;
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_handedness_box.itemNames = handedness_names;
|
|
|
|
UI_MenuSpinControl_SetValue (&s_playerconfig_handedness_box, "hand", 0, 2, true);
|
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_rate_title.generic.type = MTYPE_SEPARATOR;
|
|
|
|
s_playerconfig_rate_title.generic.textSize = MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_rate_title.generic.flags = QMF_LEFT_JUSTIFY;
|
|
|
|
s_playerconfig_rate_title.generic.name = "connect speed";
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_rate_title.generic.x = 6*MENU_FONT_SIZE;
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_rate_title.generic.y = y += 2*MENU_LINE_SIZE;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_rate_box.generic.type = MTYPE_SPINCONTROL;
|
|
|
|
s_playerconfig_rate_box.generic.textSize = MENU_FONT_SIZE;
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_rate_box.generic.x = -8*MENU_FONT_SIZE;
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_rate_box.generic.y = y += MENU_LINE_SIZE;
|
|
|
|
s_playerconfig_rate_box.generic.name = 0;
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_rate_box.generic.cursor_offset = -1*MENU_FONT_SIZE;
|
2021-09-21 07:01:20 +00:00
|
|
|
s_playerconfig_rate_box.generic.callback = Menu_PlayerRateCallback;
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_rate_box.itemNames = rate_names;
|
|
|
|
s_playerconfig_rate_box.itemValues = rate_values;
|
|
|
|
UI_MenuSpinControl_SetValue (&s_playerconfig_rate_box, "rate", 0, 0, false);
|
|
|
|
|
2021-10-21 06:03:19 +00:00
|
|
|
s_playerconfig_railcolor_title.generic.type = MTYPE_SEPARATOR;
|
|
|
|
s_playerconfig_railcolor_title.generic.textSize = MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_railcolor_title.generic.flags = QMF_LEFT_JUSTIFY;
|
|
|
|
s_playerconfig_railcolor_title.generic.name = "railgun effect color";
|
|
|
|
s_playerconfig_railcolor_title.generic.x = 13*MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_railcolor_title.generic.y = y += 2*MENU_LINE_SIZE;
|
|
|
|
|
|
|
|
s_playerconfig_railcolor_slider[0].generic.type = MTYPE_SLIDER;
|
|
|
|
s_playerconfig_railcolor_slider[0].generic.textSize = MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_railcolor_slider[0].generic.x = 0*MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_railcolor_slider[0].generic.y = y += MENU_LINE_SIZE;
|
|
|
|
s_playerconfig_railcolor_slider[0].generic.name = "red";
|
|
|
|
s_playerconfig_railcolor_slider[0].generic.callback = Menu_PlayerRailColorRedFunc;
|
|
|
|
s_playerconfig_railcolor_slider[0].maxPos = 64;
|
|
|
|
s_playerconfig_railcolor_slider[0].baseValue = 0.0f;
|
|
|
|
s_playerconfig_railcolor_slider[0].increment = 4.0f;
|
|
|
|
s_playerconfig_railcolor_slider[0].displayAsPercent = false;
|
|
|
|
s_playerconfig_railcolor_slider[0].generic.statusbar = "changes player's railgun particle effect red component";
|
|
|
|
|
|
|
|
s_playerconfig_railcolor_slider[1].generic.type = MTYPE_SLIDER;
|
|
|
|
s_playerconfig_railcolor_slider[1].generic.textSize = MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_railcolor_slider[1].generic.x = 0*MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_railcolor_slider[1].generic.y = y += MENU_LINE_SIZE;
|
|
|
|
s_playerconfig_railcolor_slider[1].generic.name = "green";
|
|
|
|
s_playerconfig_railcolor_slider[1].generic.callback = Menu_PlayerRailColorGreenFunc;
|
|
|
|
s_playerconfig_railcolor_slider[1].maxPos = 64;
|
|
|
|
s_playerconfig_railcolor_slider[1].baseValue = 0.0f;
|
|
|
|
s_playerconfig_railcolor_slider[1].increment = 4.0f;
|
|
|
|
s_playerconfig_railcolor_slider[1].displayAsPercent = false;
|
|
|
|
s_playerconfig_railcolor_slider[1].generic.statusbar = "changes player's railgun particle effect green component";
|
|
|
|
|
|
|
|
s_playerconfig_railcolor_slider[2].generic.type = MTYPE_SLIDER;
|
|
|
|
s_playerconfig_railcolor_slider[2].generic.textSize = MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_railcolor_slider[2].generic.x = 0*MENU_FONT_SIZE;
|
|
|
|
s_playerconfig_railcolor_slider[2].generic.y = y += MENU_LINE_SIZE;
|
|
|
|
s_playerconfig_railcolor_slider[2].generic.name = "blue";
|
|
|
|
s_playerconfig_railcolor_slider[2].generic.callback = Menu_PlayerRailColorBlueFunc;
|
|
|
|
s_playerconfig_railcolor_slider[2].maxPos = 64;
|
|
|
|
s_playerconfig_railcolor_slider[2].baseValue = 0.0f;
|
|
|
|
s_playerconfig_railcolor_slider[2].increment = 4.0f;
|
|
|
|
s_playerconfig_railcolor_slider[2].displayAsPercent = false;
|
|
|
|
s_playerconfig_railcolor_slider[2].generic.statusbar = "changes player's railgun particle effect blue component";
|
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_back_action.generic.type = MTYPE_ACTION;
|
|
|
|
s_playerconfig_back_action.generic.textSize = MENU_FONT_SIZE;
|
2021-09-05 04:05:38 +00:00
|
|
|
s_playerconfig_back_action.generic.name = "Back to Multiplayer";
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_back_action.generic.flags = QMF_LEFT_JUSTIFY;
|
|
|
|
s_playerconfig_back_action.generic.x = -5*MENU_FONT_SIZE;
|
2021-10-21 06:03:19 +00:00
|
|
|
s_playerconfig_back_action.generic.y = y += 3*MENU_LINE_SIZE;
|
2021-02-17 09:11:49 +00:00
|
|
|
s_playerconfig_back_action.generic.statusbar = NULL;
|
|
|
|
s_playerconfig_back_action.generic.callback = UI_BackMenu;
|
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_AddMenuItem (&s_player_config_menu, &s_playerconfig_name_field);
|
|
|
|
UI_AddMenuItem (&s_player_config_menu, &s_playerconfig_model_title);
|
|
|
|
UI_AddMenuItem (&s_player_config_menu, &s_playerconfig_model_box);
|
2021-09-04 06:18:06 +00:00
|
|
|
if ( s_playerconfig_skin_box.itemNames )
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_AddMenuItem (&s_player_config_menu, &s_playerconfig_skin_title);
|
|
|
|
UI_AddMenuItem (&s_player_config_menu, &s_playerconfig_skin_box);
|
2019-03-13 19:20:07 +00:00
|
|
|
}
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_AddMenuItem (&s_player_config_menu, &s_playerconfig_hand_title);
|
|
|
|
UI_AddMenuItem (&s_player_config_menu, &s_playerconfig_handedness_box);
|
|
|
|
UI_AddMenuItem (&s_player_config_menu, &s_playerconfig_rate_title);
|
|
|
|
UI_AddMenuItem (&s_player_config_menu, &s_playerconfig_rate_box);
|
2021-10-21 06:03:19 +00:00
|
|
|
UI_AddMenuItem (&s_player_config_menu, &s_playerconfig_railcolor_title);
|
|
|
|
UI_AddMenuItem (&s_player_config_menu, (void *) &s_playerconfig_railcolor_slider[0]);
|
|
|
|
UI_AddMenuItem (&s_player_config_menu, (void *) &s_playerconfig_railcolor_slider[1]);
|
|
|
|
UI_AddMenuItem (&s_player_config_menu, (void *) &s_playerconfig_railcolor_slider[2]);
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_AddMenuItem (&s_player_config_menu, &s_playerconfig_back_action);
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-10-21 06:03:19 +00:00
|
|
|
// get color components from color1 cvar
|
|
|
|
Menu_LoadPlayerRailColor ();
|
|
|
|
|
2019-03-13 19:20:07 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2021-09-05 04:05:38 +00:00
|
|
|
//=======================================================================
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
qboolean Menu_PlayerConfig_CheckIncrement (int dir, float x, float y, float w, float h)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
|
|
|
float min[2], max[2], x1, y1, w1, h1;
|
|
|
|
char *sound = NULL;
|
|
|
|
|
|
|
|
x1 = x; y1 = y; w1 = w; h1 = h;
|
2021-07-20 04:21:05 +00:00
|
|
|
SCR_ScaleCoords (&x1, &y1, &w1, &h1, ALIGN_CENTER);
|
2019-03-13 19:20:07 +00:00
|
|
|
min[0] = x1; max[0] = x1 + w1;
|
|
|
|
min[1] = y1; max[1] = y1 + h1;
|
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
if ( (ui_mousecursor.x >= min[0]) && (ui_mousecursor.x <= max[0]) &&
|
|
|
|
(ui_mousecursor.y >= min[1]) && (ui_mousecursor.y <= max[1]) &&
|
|
|
|
!ui_mousecursor.buttonused[MOUSEBUTTON1] &&
|
|
|
|
ui_mousecursor.buttonclicks[MOUSEBUTTON1]==1)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-02-17 09:11:49 +00:00
|
|
|
if (dir) // dir == 1 is left
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-09-04 06:18:06 +00:00
|
|
|
if (s_playerconfig_skin_box.curValue > 0)
|
|
|
|
s_playerconfig_skin_box.curValue--;
|
2019-03-13 19:20:07 +00:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
2021-09-04 06:18:06 +00:00
|
|
|
if (s_playerconfig_skin_box.curValue < ui_pmi[s_playerconfig_model_box.curValue].nskins)
|
|
|
|
s_playerconfig_skin_box.curValue++;
|
2019-03-13 19:20:07 +00:00
|
|
|
}
|
|
|
|
|
2021-09-05 04:05:38 +00:00
|
|
|
sound = ui_menu_move_sound;
|
2021-02-17 09:11:49 +00:00
|
|
|
ui_mousecursor.buttonused[MOUSEBUTTON1] = true;
|
|
|
|
ui_mousecursor.buttonclicks[MOUSEBUTTON1] = 0;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
if ( sound )
|
|
|
|
S_StartLocalSound( sound );
|
2021-08-12 19:30:51 +00:00
|
|
|
Menu_PlayerSkinCallback (NULL);
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
void Menu_PlayerConfig_MouseClick (void)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-02-17 09:11:49 +00:00
|
|
|
float icon_x = SCREEN_WIDTH*0.5 - 5, // width - 325
|
2019-03-13 19:20:07 +00:00
|
|
|
icon_y = SCREEN_HEIGHT - 108,
|
|
|
|
icon_offset = 0;
|
|
|
|
int i, count;
|
|
|
|
char *sound = NULL;
|
|
|
|
buttonmenuobject_t buttons[NUM_SKINBOX_ITEMS];
|
|
|
|
|
|
|
|
for (i=0; i<NUM_SKINBOX_ITEMS; i++)
|
|
|
|
buttons[i].index =- 1;
|
|
|
|
|
2021-09-04 06:18:06 +00:00
|
|
|
if ( (ui_pmi[s_playerconfig_model_box.curValue].nskins < NUM_SKINBOX_ITEMS) || (s_playerconfig_skin_box.curValue < 4) )
|
2021-02-17 09:11:49 +00:00
|
|
|
i = 0;
|
2021-09-04 06:18:06 +00:00
|
|
|
else if (s_playerconfig_skin_box.curValue > ui_pmi[s_playerconfig_model_box.curValue].nskins-4)
|
|
|
|
i = ui_pmi[s_playerconfig_model_box.curValue].nskins-NUM_SKINBOX_ITEMS;
|
2019-03-13 19:20:07 +00:00
|
|
|
else
|
2021-09-04 06:18:06 +00:00
|
|
|
i = s_playerconfig_skin_box.curValue-3;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
if (i > 0)
|
2021-08-12 19:30:51 +00:00
|
|
|
if (Menu_PlayerConfig_CheckIncrement (1, icon_x-39, icon_y, 32, 32))
|
2019-03-13 19:20:07 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
for (count=0; count<NUM_SKINBOX_ITEMS; i++,count++)
|
|
|
|
{
|
2021-09-04 06:18:06 +00:00
|
|
|
if ( (i < 0) || (i >= ui_pmi[s_playerconfig_model_box.curValue].nskins) )
|
2019-03-13 19:20:07 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
UI_AddButton (&buttons[count], i, icon_x+icon_offset, icon_y, 32, 32);
|
|
|
|
icon_offset += 34;
|
|
|
|
}
|
|
|
|
|
|
|
|
icon_offset = NUM_SKINBOX_ITEMS*34;
|
2021-09-04 06:18:06 +00:00
|
|
|
if (ui_pmi[s_playerconfig_model_box.curValue].nskins-i > 0)
|
2021-08-12 19:30:51 +00:00
|
|
|
if (Menu_PlayerConfig_CheckIncrement (0, icon_x+icon_offset+5, icon_y, 32, 32))
|
2019-03-13 19:20:07 +00:00
|
|
|
return;
|
|
|
|
|
|
|
|
for (i=0; i<NUM_SKINBOX_ITEMS; i++)
|
|
|
|
{
|
|
|
|
if (buttons[i].index == -1)
|
|
|
|
continue;
|
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
if ( (ui_mousecursor.x >= buttons[i].min[0]) && (ui_mousecursor.x <= buttons[i].max[0]) &&
|
|
|
|
(ui_mousecursor.y >= buttons[i].min[1]) && (ui_mousecursor.y <= buttons[i].max[1]) )
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-02-17 09:11:49 +00:00
|
|
|
if (!ui_mousecursor.buttonused[MOUSEBUTTON1] && ui_mousecursor.buttonclicks[MOUSEBUTTON1]==1)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-09-04 06:18:06 +00:00
|
|
|
s_playerconfig_skin_box.curValue = buttons[i].index;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-09-05 04:05:38 +00:00
|
|
|
sound = ui_menu_move_sound;
|
2021-02-17 09:11:49 +00:00
|
|
|
ui_mousecursor.buttonused[MOUSEBUTTON1] = true;
|
|
|
|
ui_mousecursor.buttonclicks[MOUSEBUTTON1] = 0;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
if (sound)
|
|
|
|
S_StartLocalSound (sound);
|
2021-08-12 19:30:51 +00:00
|
|
|
Menu_PlayerSkinCallback (NULL);
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
void Menu_PlayerConfig_DrawSkinSelection (void)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-08-07 04:43:46 +00:00
|
|
|
char scratch[MAX_QPATH];
|
|
|
|
float icon_x = SCREEN_WIDTH*0.5 - 5; // width - 325
|
|
|
|
float icon_y = SCREEN_HEIGHT - 108;
|
|
|
|
float icon_offset = 0;
|
|
|
|
float x, y, w, h;
|
|
|
|
int i, count, color[3];
|
|
|
|
color_t arrowColor;
|
|
|
|
vec4_t arrowTemp[2];
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2020-04-16 07:18:49 +00:00
|
|
|
CL_TextColor ((int)Cvar_VariableValue("alt_text_color"), &color[0], &color[1], &color[2]);
|
2021-08-07 04:43:46 +00:00
|
|
|
Vector4Copy (stCoord_arrow_left, arrowTemp[0]);
|
|
|
|
Vector4Copy (stCoord_arrow_right, arrowTemp[1]);
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-09-04 06:18:06 +00:00
|
|
|
if ( (ui_pmi[s_playerconfig_model_box.curValue].nskins < NUM_SKINBOX_ITEMS) || (s_playerconfig_skin_box.curValue < 4) )
|
2021-02-17 09:11:49 +00:00
|
|
|
i = 0;
|
2021-09-04 06:18:06 +00:00
|
|
|
else if ( s_playerconfig_skin_box.curValue > (ui_pmi[s_playerconfig_model_box.curValue].nskins - 4) )
|
|
|
|
i = ui_pmi[s_playerconfig_model_box.curValue].nskins-NUM_SKINBOX_ITEMS;
|
2019-03-13 19:20:07 +00:00
|
|
|
else
|
2021-09-04 06:18:06 +00:00
|
|
|
i = s_playerconfig_skin_box.curValue - 3;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
// left arrow
|
2021-08-07 04:43:46 +00:00
|
|
|
if (i > 0) {
|
|
|
|
Vector4Set (arrowColor, color[0], color[1], color[2], 255);
|
|
|
|
// Com_sprintf (scratch, sizeof(scratch), "/gfx/ui/arrows/arrow_left.pcx");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
Vector4Set (arrowColor, 150, 150, 150, 255);
|
|
|
|
arrowTemp[0][1] += 0.25;
|
|
|
|
arrowTemp[0][3] += 0.25;
|
|
|
|
// Com_sprintf (scratch, sizeof(scratch), "/gfx/ui/arrows/arrow_left_d.pcx");
|
|
|
|
}
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_DrawPicST (icon_x-39, icon_y+2, 32, 32, arrowTemp[0], ALIGN_CENTER, false, arrowColor, UI_ARROWS_PIC);
|
|
|
|
// UI_DrawPic (icon_x-39, icon_y+2, 32, 32, ALIGN_CENTER, false, scratch, 1.0);
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
// background
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_DrawFill (icon_x-3, icon_y-3, NUM_SKINBOX_ITEMS*34+4, 38, ALIGN_CENTER, false, 0, 0, 0, 255);
|
2021-08-07 04:43:46 +00:00
|
|
|
if (R_DrawFindPic("/gfx/ui/widgets/listbox_background.pcx")) {
|
|
|
|
x = icon_x-2; y = icon_y-2; w = NUM_SKINBOX_ITEMS * 34 + 2; h = 36;
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_DrawTiledPic (x, y, w, h, ALIGN_CENTER, true, "/gfx/ui/widgets/listbox_background.pcx", 255);
|
2021-08-07 04:43:46 +00:00
|
|
|
// SCR_ScaleCoords (&x, &y, &w, &h, ALIGN_CENTER);
|
|
|
|
// R_DrawTileClear ((int)x, (int)y, (int)w, (int)h, "/gfx/ui/widgets/listbox_background.pcx");
|
2019-03-13 19:20:07 +00:00
|
|
|
}
|
|
|
|
else
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_DrawFill (icon_x-2, icon_y-2, NUM_SKINBOX_ITEMS*34+2, 36, ALIGN_CENTER, false, 60, 60, 60, 255);
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
for (count=0; count<NUM_SKINBOX_ITEMS; i++,count++)
|
|
|
|
{
|
2021-09-04 06:18:06 +00:00
|
|
|
if ( (i < 0) || (i >= ui_pmi[s_playerconfig_model_box.curValue].nskins) )
|
2019-03-13 19:20:07 +00:00
|
|
|
continue;
|
|
|
|
|
|
|
|
Com_sprintf (scratch, sizeof(scratch), "/players/%s/%s_i.pcx",
|
2021-09-04 06:18:06 +00:00
|
|
|
ui_pmi[s_playerconfig_model_box.curValue].directory,
|
|
|
|
ui_pmi[s_playerconfig_model_box.curValue].skinDisplayNames[i] );
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-09-04 06:18:06 +00:00
|
|
|
if (i == s_playerconfig_skin_box.curValue)
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_DrawFill (icon_x + icon_offset-1, icon_y-1, 34, 34, ALIGN_CENTER, false, color[0], color[1] ,color[2], 255);
|
|
|
|
UI_DrawPic (icon_x + icon_offset, icon_y, 32, 32, ALIGN_CENTER, false, scratch, 1.0);
|
2019-03-13 19:20:07 +00:00
|
|
|
icon_offset += 34;
|
|
|
|
}
|
|
|
|
|
|
|
|
// right arrow
|
|
|
|
icon_offset = NUM_SKINBOX_ITEMS*34;
|
2021-09-04 06:18:06 +00:00
|
|
|
if ( ui_pmi[s_playerconfig_model_box.curValue].nskins-i > 0 ) {
|
2021-08-07 04:43:46 +00:00
|
|
|
Vector4Set (arrowColor, color[0], color[1], color[2], 255);
|
|
|
|
// Com_sprintf (scratch, sizeof(scratch), "/gfx/ui/arrows/arrow_right.pcx");
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
Vector4Set (arrowColor, 150, 150, 150, 255);
|
|
|
|
arrowTemp[1][1] += 0.25;
|
|
|
|
arrowTemp[1][3] += 0.25;
|
|
|
|
// Com_sprintf (scratch, sizeof(scratch), "/gfx/ui/arrows/arrow_right_d.pcx");
|
|
|
|
}
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_DrawPicST (icon_x+icon_offset+5, icon_y+2, 32, 32, arrowTemp[1], ALIGN_CENTER, false, arrowColor, UI_ARROWS_PIC);
|
|
|
|
// UI_DrawPic (icon_x+icon_offset+5, icon_y+2, 32, 32, ALIGN_CENTER, false, scratch, 1.0);
|
2019-03-13 19:20:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
void Menu_PlayerConfig_Draw (void)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
|
|
|
refdef_t refdef;
|
|
|
|
float rx, ry, rw, rh;
|
2021-02-17 09:11:49 +00:00
|
|
|
qboolean lefthand = (Cvar_VariableInteger("hand") == 1);
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_DrawBanner ("m_banner_plauer_setup"); // typo for image name is id's fault
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
memset(&refdef, 0, sizeof(refdef));
|
|
|
|
|
|
|
|
rx = 0; ry = 0;
|
|
|
|
rw = SCREEN_WIDTH; rh = SCREEN_HEIGHT;
|
2021-07-20 04:21:05 +00:00
|
|
|
SCR_ScaleCoords (&rx, &ry, &rw, &rh, ALIGN_CENTER);
|
2019-03-13 19:20:07 +00:00
|
|
|
refdef.x = rx; refdef.y = ry;
|
|
|
|
refdef.width = rw; refdef.height = rh;
|
|
|
|
refdef.fov_x = 50;
|
|
|
|
refdef.fov_y = CalcFov (refdef.fov_x, refdef.width, refdef.height);
|
|
|
|
refdef.time = cls.realtime*0.001;
|
|
|
|
|
2021-09-04 06:18:06 +00:00
|
|
|
if ( ui_pmi[s_playerconfig_model_box.curValue].skinDisplayNames )
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
|
|
|
int yaw;
|
|
|
|
int maxframe = 29;
|
|
|
|
vec3_t modelOrg;
|
|
|
|
// Psychopspaz's support for showing weapon model
|
|
|
|
entity_t entity[2], *ent;
|
|
|
|
|
|
|
|
refdef.num_entities = 0;
|
|
|
|
refdef.entities = entity;
|
|
|
|
|
|
|
|
yaw = anglemod(cl.time/10);
|
|
|
|
|
2021-02-17 09:11:49 +00:00
|
|
|
VectorSet (modelOrg, 150, -25, 0); // was 80, 0, 0
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
// Setup player model
|
|
|
|
ent = &entity[0];
|
|
|
|
memset (&entity[0], 0, sizeof(entity[0]));
|
|
|
|
|
|
|
|
// moved registration code to init and change only
|
2021-02-17 09:11:49 +00:00
|
|
|
ent->model = ui_playermodel;
|
|
|
|
ent->skin = ui_playerskin;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
ent->flags = RF_FULLBRIGHT|RF_NOSHADOW|RF_DEPTHHACK;
|
2021-02-17 09:11:49 +00:00
|
|
|
if (lefthand)
|
2019-03-13 19:20:07 +00:00
|
|
|
ent->flags |= RF_MIRRORMODEL;
|
|
|
|
|
|
|
|
ent->origin[0] = modelOrg[0];
|
|
|
|
ent->origin[1] = modelOrg[1];
|
|
|
|
ent->origin[2] = modelOrg[2];
|
|
|
|
|
|
|
|
VectorCopy( ent->origin, ent->oldorigin );
|
|
|
|
ent->frame = 0;
|
|
|
|
ent->oldframe = 0;
|
|
|
|
ent->backlerp = 0.0;
|
|
|
|
ent->angles[1] = yaw;
|
|
|
|
|
|
|
|
refdef.num_entities++;
|
|
|
|
|
|
|
|
// Setup weapon model
|
|
|
|
ent = &entity[1];
|
|
|
|
memset (&entity[1], 0, sizeof(entity[1]));
|
|
|
|
|
|
|
|
// moved registration code to init and change only
|
2021-02-17 09:11:49 +00:00
|
|
|
ent->model = ui_weaponmodel;
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
if (ent->model)
|
|
|
|
{
|
|
|
|
ent->skinnum = 0;
|
|
|
|
|
|
|
|
ent->flags = RF_FULLBRIGHT|RF_NOSHADOW|RF_DEPTHHACK;
|
2021-02-17 09:11:49 +00:00
|
|
|
if (lefthand)
|
2019-03-13 19:20:07 +00:00
|
|
|
ent->flags |= RF_MIRRORMODEL;
|
|
|
|
|
|
|
|
ent->origin[0] = modelOrg[0];
|
|
|
|
ent->origin[1] = modelOrg[1];
|
|
|
|
ent->origin[2] = modelOrg[2];
|
|
|
|
|
|
|
|
VectorCopy( ent->origin, ent->oldorigin );
|
|
|
|
ent->frame = 0;
|
|
|
|
ent->oldframe = 0;
|
|
|
|
ent->backlerp = 0.0;
|
|
|
|
ent->angles[1] = yaw;
|
|
|
|
|
|
|
|
refdef.num_entities++;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
refdef.areabits = 0;
|
|
|
|
refdef.lightstyles = 0;
|
|
|
|
refdef.rdflags = RDF_NOWORLDMODEL;
|
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_DrawMenu (&s_player_config_menu);
|
2019-03-13 19:20:07 +00:00
|
|
|
|
|
|
|
// skin selection preview
|
2021-08-12 19:30:51 +00:00
|
|
|
Menu_PlayerConfig_DrawSkinSelection ();
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
R_RenderFrame (&refdef);
|
2019-03-13 19:20:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
void Menu_PConfigSaveChanges (void)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-02-17 09:11:49 +00:00
|
|
|
int mNum, sNum;
|
|
|
|
char scratch[1024];
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-08-30 02:52:34 +00:00
|
|
|
Cvar_Set ("name", s_playerconfig_name_field.buffer);
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-09-04 06:18:06 +00:00
|
|
|
mNum = s_playerconfig_model_box.curValue;
|
|
|
|
sNum = s_playerconfig_skin_box.curValue;
|
2021-08-30 02:52:34 +00:00
|
|
|
Com_sprintf (scratch, sizeof( scratch ), "%s/%s",
|
|
|
|
ui_pmi[mNum].directory, ui_pmi[mNum].skinDisplayNames[sNum]);
|
|
|
|
Cvar_Set ("skin", scratch);
|
2019-03-13 19:20:07 +00:00
|
|
|
}
|
|
|
|
|
2021-09-05 04:05:38 +00:00
|
|
|
//=======================================================================
|
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
const char *Menu_PlayerConfig_Key (int key)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
|
|
|
if ( key == K_ESCAPE )
|
2021-08-12 19:30:51 +00:00
|
|
|
Menu_PConfigSaveChanges ();
|
2019-03-13 19:20:07 +00:00
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
return UI_DefaultMenuKey (&s_player_config_menu, key);
|
2019-03-13 19:20:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-08-12 19:30:51 +00:00
|
|
|
void Menu_PlayerConfig_f (void)
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-09-21 07:01:20 +00:00
|
|
|
UI_RefreshPlayerModels (); // Reload player models if we recently downloaded anything
|
2021-08-30 02:52:34 +00:00
|
|
|
if ( !Menu_PlayerConfig_Init() )
|
2019-03-13 19:20:07 +00:00
|
|
|
{
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_SetMenuStatusBar (&s_multiplayer_menu, "No valid player models found");
|
2019-03-13 19:20:07 +00:00
|
|
|
return;
|
|
|
|
}
|
2021-08-12 19:30:51 +00:00
|
|
|
UI_SetMenuStatusBar (&s_multiplayer_menu, NULL);
|
|
|
|
UI_PushMenu (Menu_PlayerConfig_Draw, Menu_PlayerConfig_Key);
|
2019-03-13 19:20:07 +00:00
|
|
|
}
|