Client: Add auto-skin selection buttons that were missing in team menus.
This commit is contained in:
parent
1c3d2656d3
commit
3858bfb4b7
2 changed files with 43 additions and 0 deletions
|
@ -26,6 +26,9 @@ CSClassCT_Init(void)
|
|||
g_classDescrGSG9 = textfile_to_string("classes/gsg9.txt");
|
||||
g_classDescrSAS = textfile_to_string("classes/sas.txt");
|
||||
g_classDescrGIGN = textfile_to_string("classes/gign.txt");
|
||||
|
||||
if (!g_classDescrAuto)
|
||||
g_classDescrAuto = textfile_to_string("classes/autoselect.txt");
|
||||
}
|
||||
|
||||
static VGUIWindow winClassSelectionCT;
|
||||
|
@ -51,6 +54,11 @@ void
|
|||
CSClassButtonCT::OnMouseUp(void)
|
||||
{
|
||||
int classSelection = GetTag();
|
||||
|
||||
/* auto-select, aka random really */
|
||||
if (classSelection == 5)
|
||||
classSelection = floor(random(1, 5));
|
||||
|
||||
sendevent("JoinTeam", "f", (float)classSelection + 4);
|
||||
winClassSelectionCT.Hide();
|
||||
}
|
||||
|
@ -81,6 +89,11 @@ CSClassButtonCT::OnMouseEntered(void)
|
|||
imgClassPreview.SetImage("gfx/vgui/640_gign");
|
||||
lblClassDescription.SetTitle(g_classDescrGIGN);
|
||||
break;
|
||||
case 5:
|
||||
lblClassTitle.SetTitle(Titles_GetTextBody("Auto_Select"));
|
||||
imgClassPreview.SetImage("gfx/vgui/640_ct_random");
|
||||
lblClassDescription.SetTitle(g_classDescrAuto);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,6 +107,7 @@ VGUI_ChooseClassCT(void)
|
|||
static CSClassButtonCT btnGSG9;
|
||||
static CSClassButtonCT btnSAS;
|
||||
static CSClassButtonCT btnGIGN;
|
||||
static CSClassButtonCT btnAuto;
|
||||
|
||||
if (!initialized) {
|
||||
vector btnpos = [40,80];
|
||||
|
@ -163,11 +177,18 @@ VGUI_ChooseClassCT(void)
|
|||
btnGIGN.SetPos([40, 176]);
|
||||
btnGIGN.SetTag(4);
|
||||
btnGIGN.SetKeyEquivalent("4");
|
||||
btnAuto = spawn(CSClassButtonCT);
|
||||
btnAuto.SetTitle(Titles_GetTextBody("Auto_Select"));
|
||||
btnAuto.SetSize([124, 24]);
|
||||
btnAuto.SetPos([40, 240]);
|
||||
btnAuto.SetTag(5);
|
||||
btnAuto.SetKeyEquivalent("5");
|
||||
|
||||
winClassSelectionCT.Add(btnSeal);
|
||||
winClassSelectionCT.Add(btnGSG9);
|
||||
winClassSelectionCT.Add(btnSAS);
|
||||
winClassSelectionCT.Add(btnGIGN);
|
||||
winClassSelectionCT.Add(btnAuto);
|
||||
}
|
||||
|
||||
winClassSelectionCT.Show();
|
||||
|
|
|
@ -18,6 +18,7 @@ static string g_classDescrPhoenix;
|
|||
static string g_classDescrLeet;
|
||||
static string g_classDescrArctic;
|
||||
static string g_classDescrGuerilla;
|
||||
string g_classDescrAuto;
|
||||
|
||||
static void
|
||||
CSClassT_Init(void)
|
||||
|
@ -26,6 +27,9 @@ CSClassT_Init(void)
|
|||
g_classDescrLeet = textfile_to_string("classes/leet.txt");
|
||||
g_classDescrArctic = textfile_to_string("classes/arctic.txt");
|
||||
g_classDescrGuerilla = textfile_to_string("classes/guerilla.txt");
|
||||
|
||||
if (g_classDescrAuto)
|
||||
g_classDescrAuto = textfile_to_string("classes/autoselect.txt");
|
||||
}
|
||||
|
||||
static VGUIWindow winClassSelection;
|
||||
|
@ -51,6 +55,11 @@ void
|
|||
CSClassButtonT::OnMouseUp(void)
|
||||
{
|
||||
int classSelection = GetTag();
|
||||
|
||||
/* auto-select, aka random really */
|
||||
if (classSelection == 5)
|
||||
classSelection = floor(random(1, 5));
|
||||
|
||||
sendevent("JoinTeam", "f", (float)classSelection);
|
||||
winClassSelection.Hide();
|
||||
}
|
||||
|
@ -81,6 +90,11 @@ CSClassButtonT::OnMouseEntered(void)
|
|||
imgClassPreview.SetImage("gfx/vgui/640_guerilla");
|
||||
lblClassDescription.SetTitle(g_classDescrGuerilla);
|
||||
break;
|
||||
case 5:
|
||||
lblClassTitle.SetTitle(Titles_GetTextBody("Auto_Select"));
|
||||
imgClassPreview.SetImage("gfx/vgui/640_t_random");
|
||||
lblClassDescription.SetTitle(g_classDescrAuto);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -94,6 +108,7 @@ VGUI_ChooseClassT(void)
|
|||
static CSClassButtonT btnLeet;
|
||||
static CSClassButtonT btnArctic;
|
||||
static CSClassButtonT btnGuerilla;
|
||||
static CSClassButtonT btnAuto;
|
||||
|
||||
if (!initialized) {
|
||||
vector btnpos = [40,80];
|
||||
|
@ -163,11 +178,18 @@ VGUI_ChooseClassT(void)
|
|||
btnGuerilla.SetPos([40, 176]);
|
||||
btnGuerilla.SetTag(4);
|
||||
btnGuerilla.SetKeyEquivalent("4");
|
||||
btnAuto = spawn(CSClassButtonT);
|
||||
btnAuto.SetTitle(Titles_GetTextBody("Auto_Select"));
|
||||
btnAuto.SetSize([124, 24]);
|
||||
btnAuto.SetPos([40, 240]);
|
||||
btnAuto.SetTag(5);
|
||||
btnAuto.SetKeyEquivalent("5");
|
||||
|
||||
winClassSelection.Add(btnPhoenix);
|
||||
winClassSelection.Add(btnLeet);
|
||||
winClassSelection.Add(btnArctic);
|
||||
winClassSelection.Add(btnGuerilla);
|
||||
winClassSelection.Add(btnAuto);
|
||||
}
|
||||
|
||||
winClassSelection.Show();
|
||||
|
|
Loading…
Reference in a new issue