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

fix next/prev weapon without carousel #2201

Merged
merged 2 commits into from
Feb 13, 2025
Merged

fix next/prev weapon without carousel #2201

merged 2 commits into from
Feb 13, 2025

Conversation

fabiangreffrath
Copy link
Owner

Fixes #2196

@ceski-1
Copy link
Collaborator

ceski-1 commented Feb 13, 2025

I'm not really familiar with g_nextweapon.c, so I'll ask some questions and share some results.

What is the traditional behavior for next/prev weapon when the automap is open? What is the desired behavior? What takes priority when the automap is open? Should the behavior differ for the overlay automap (because the weapons are visible)?

With this PR, here's how next/prev weapon behaves with the automap open:

  • Keyboard Q/E keys: weapons cycle, no automap zooming
  • Mouse4/Mouse5 buttons (side buttons): weapons cycle, no automap zooming
  • Mousewheel up/down: automap zooms in/out, no weapon cycling
  • Gamepad LB/RB buttons: weapons cycle, no automap zooming

@fabiangreffrath
Copy link
Owner Author

What is the traditional behavior for next/prev weapon when the automap is open?

Traditional ports, including MBF, did not have prev/next weapon bindings. Chocolate Doom allows to bind prev/next weapon to the mouse wheel, but does not allow to bind Automap zoom to any mouse button, so the events are passed through if the Automap is open.

What takes priority when the automap is open?

I think the Automap bindings should be given priority when the Automap is open.

Should the behavior differ for the overlay automap (because the weapons are visible)?

This would be surprising IMHO.

With this PR, here's how next/prev weapon behaves with the automap open:

* Keyboard Q/E keys: weapons cycle, no automap zooming

* Mouse4/Mouse5 buttons (side buttons): weapons cycle, no automap zooming

* Mousewheel up/down: automap zooms in/out, no weapon cycling

* Gamepad LB/RB buttons: weapons cycle, no automap zooming

Sounds reasonable to me (I assume Q/E and mouse side buttons are bound to prev/next weapon).

nw_state_deactivate,
nw_state_cmd
} next_weapon_state_t;

static next_weapon_state_t state;
static boolean currently_active;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be reset to false in G_NextWeaponReset?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most probably yes!

@fabiangreffrath fabiangreffrath merged commit b760605 into master Feb 13, 2025
8 checks passed
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.

Next/prev weapon doesn't work with carousel disabled
2 participants