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

Add client sniperline and server stationary gun options #11

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

BranDougherty
Copy link
Member

This PR adds support + UI for the sv_stationaryguns and ui_sniperline cvars.

The ui_sniperline and sv_sniperline relationship is not obvious for users so I changed their descriptions to try and make it easier to understand. Unfortunately adding the ui_sniperline setting resulted in a small awkward scrollbar on my screen, but I'm not sure what to do about it, and we need to have UI for this cvar somewhere.

The sv_stationaryguns cvar controls whether stationary guns are allowed to be spawned in maps and shot by players. IMO for a singleplayer experience, having stationary guns enabled by default makes sense.

I also ran into issues with the launcher not starting the server properly. This happened because the node.js stream interface chunks 'data' events, and we were searching for the [NET] ... string only within one chunk. So on the off chance the string spanned two chunks, we would miss it. Consider this a stop-gap measure while proper IPC is implemented.

While this PR is not very ambitious, I'm not familiar with the technologies used in the launcher so please give this a careful review.

@BranDougherty BranDougherty linked an issue Oct 1, 2022 that may be closed by this pull request
@rzaba0
Copy link
Collaborator

rzaba0 commented Oct 1, 2022

I like all of the changes except the approach to ui_sniperline. In my opinion forcing users to check 2 boxes in 2 different areas of the launcher in order to enable sniper line is still not intuitive. What I like about the sniper line in 1.7.1 is that you can toggle it with ALT+F2 (as long as server allows it?) while you are playing, and this is a behavior that I would keep, especially since we have all the functionality to do it this way.

So, what I would recommend is:

  1. Keep the local server setting to "Allow sniper line"
  2. Optionally add a tooltip next to "Allow sniper line" to explain that you can toggle the sniper line while you are playing by pressing some combination of keys (ALT+F2 by default)
  3. Add a new key binding in Settings->Controls->Other (or use a new custom binding if it's not possible otherwise) that maps the /toggle ui_sniperline 0 1 command to ALT+F2. Ideally it would have some intuitive label like "Toggle sniper line (if server allows it)". I think this may also require changes to the configs in base repo.
  4. Remove the option to display sniper line from Settings->Graphics->Interface

Let me know what you think, I'm also fine with keeping your changes if people prefer your approach.

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

Successfully merging this pull request may close these issues.

Lack of option to enable sniper line from client side(?)
2 participants