Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enter key hardcoded to Join Team VGUI Menu when spectating #2316

Open
ghost opened this issue Apr 26, 2019 · 9 comments
Open

Enter key hardcoded to Join Team VGUI Menu when spectating #2316

ghost opened this issue Apr 26, 2019 · 9 comments

Comments

@ghost
Copy link

ghost commented Apr 26, 2019

This happens in Half-Life and some mods like Vampire Slayer so I assume it's an engine problem, please correct me if I'm wrong.

Pressing the Enter key will display the jointeam VGUI dialog even if there's something else bound to it.

This can be very bothersome if you bind a command like messagemode to this key.

Steps to reproduce

  • Join a Half-Life Deathmatch or Half-Life Teamplay server that allows spectators
  • Type spectate in console to join the spectators
  • Press the Enter key

Additional notes

Since Enter is +use by default, this dialog should display when sending this command when spectating, rather than being hardcoded. Seems like this menu is barely implemented at all, at least in HLDM, since attempting to join any team to exit the spectator mode the game will not recognize the jointeam command

@ghost
Copy link
Author

ghost commented Apr 26, 2019

Hello @kisak-valve, with "Half-Life Deathmatch" I meant regular Half-Life, sorry about the confusion, editing the OP now.

While it may affect other games like DMC I haven't tested it.

@SamVanheer
Copy link

Can you show a screenshot of this? I'm unable to reproduce this and the jointeam command is not recognized.

I have enter tied to reload and it has never done this before.

@JoelTroch
Copy link
Contributor

JoelTroch commented Apr 26, 2019

@SamVanheer I can reproduce this under the beta branch.

  1. Spectate a game through HLTV.
  2. Press ENTER.
  3. The team menu appears with the "Auto-assign" button and map's description (but the localization isn't made).

I tried with Counter-Strike Condition Zero (beta branch), both in-game spectating and HLTV, can't reproduce there.

@ghost
Copy link
Author

ghost commented Apr 26, 2019

image

Tested on both Linux and Windows (using Proton 4.3-2) versions of Half-Life. No beta branch needed.

As @JoelTroch stated, the entire menu lacks localization strings. As an additional note, if you attempt to exit spectator mode this game the console will say the jointeam command doesn't exists.

Seems like this can't be reproduced on games like Counter-Strike because the team systsm along with the VGUIs are completely implemented.

@ghost ghost changed the title Enter key hardcoded to jointeam when spectating Enter key hardcoded to Join Team VGUI Menu when spectating Apr 26, 2019
@SamVanheer
Copy link

Looks like it's this code:

// Enter gets out of Spectator Mode by bringing up the Team Menu
if (m_iUser1 && gEngfuncs.Con_IsVisible() == false )
{
if ( down && (keynum == K_ENTER || keynum == K_KP_ENTER) )
ShowVGUIMenu( MENU_TEAM );
}

This is VGUI1 code, the VGUI2 version used by Counter-Strike doesn't have this:

int __cdecl CounterStrikeViewport::KeyInput(CounterStrikeViewport *const this, int down, int keynum, const char *pszCurrentBinding)
{
  return 1;
}

I suspect this was intended to be used for in-game spectators only, meaning if you're in the server and able to join teams to begin with.

Adding this conditional check around it should fix the problem:

if( !gEngfuncs.IsSpectateOnly() )
{
    //Original code here
}

This will enable the feature if you're not connected through HLTV. That still doesn't solve the problem with the enter key being hardcoded to open this menu, but at least HLTV will work properly in this case.

@rtxa
Copy link

rtxa commented Apr 26, 2019

Please, do not remove this, MiniAG and plugins that make this VGUI menu works depends on this for change team. Example of how to make it work in AMXX
https://github.com/rtxa/agmodx/blob/master/valve/addons/amxmodx/scripting/agmodx.sma#L1502-L1524

@SamVanheer
Copy link

Is it used in HLTV or only when spectating in-game?

@rtxa
Copy link

rtxa commented Apr 26, 2019

Is it used in HLTV or only when spectating in-game?

In both, but in HLTV doesn't make sense to change team because you are not playing. Is true that this menu isn't working out of the box, but you can make it work through AMXX or some mods like MiniAG implement them, so don't remove it for normal gameplay, just for HLTV.

@0Ky
Copy link

0Ky commented Mar 4, 2024

Protocol version 48
Exe version 1.1.2.2/Stdio (valve)
Exe build: 12:23:38 Dec 22 2023 (9920)

I'm also facing the same issue with the latest version of Half-Life 1. When in a local listen server or a multiplayer server and the server has enabled spectators allow_spectators 1.0, after you spectate with the spectate command you are unable to exit spectator mode.

The command jointeam does not exist, when you press the Enter key to bring the team selection VGUI menu I only see #Team_AutoAssign and pressing that will attempt to jointeam, since the command doesn't exist, the console outputs Unknown command: jointeam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants