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

[CoC/Anomaly] Optional grenade launcher switch animation usage. #1768

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from

Conversation

Neloreck
Copy link
Contributor

@Neloreck Neloreck commented Jan 12, 2025

Just changing how animation is handled for grenade launcher toggling.

In case of missing animation just toggle switch. It is normal for some weapons with GL where switching mode does not require adjusting weapon / placing hand on another position. Found this one when was playing with integration of anomaly weapons and noticed some missing anm_switch_g anm_switch animation fields.

Main question as for now is logging -> probably prettier variant without method overloading can be implemented?

Changes

  • Just changing how animation is handled for grenade launcher toggling, allow cases without animation
  • Still respect variant with two animations (SoC support?) and add comment for it
  • Add param to prevent not_found log messages when doing animation checks / playing SoC animation variant (currently it produces 2 messages if animation is not found, I believe it is always 1 message for SoC)

Links

https://github.com/xrLil-Batya/xray-monolith/blob/d404b95d92947e83b283d912111fe0957fb5fbb6/src/xrGame/WeaponMagazinedWGrenade.cpp#L839

#1763

Comment on lines 187 to 190
bool isHUDAnimationExist(pcstr anim_name) const;
bool isHUDAnimationExist(pcstr anim_name, bool is_silent) const;
pcstr WhichHUDAnimationExist(pcstr anim_name, pcstr anim_name2) const;
pcstr WhichHUDAnimationExist(pcstr anim_name, pcstr anim_name2, bool is_silent) const;
Copy link
Member

Choose a reason for hiding this comment

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

This is better IMO:

Suggested change
bool isHUDAnimationExist(pcstr anim_name) const;
bool isHUDAnimationExist(pcstr anim_name, bool is_silent) const;
pcstr WhichHUDAnimationExist(pcstr anim_name, pcstr anim_name2) const;
pcstr WhichHUDAnimationExist(pcstr anim_name, pcstr anim_name2, bool is_silent) const;
bool isHUDAnimationExist(pcstr anim_name, bool silent = false) const;
pcstr WhichHUDAnimationExist(pcstr anim_name, pcstr anim_name2, bool silent = false) const;

Also notice that is_silent was renamed to silent. Not too much need in using is here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will update for all methods

@Neloreck Neloreck force-pushed the dev-coc-optional-gl-animation branch from dbc6921 to b7b0604 Compare January 14, 2025 18:21
@Neloreck Neloreck requested a review from Xottab-DUTY January 14, 2025 18:24
@Neloreck Neloreck force-pushed the dev-coc-optional-gl-animation branch from c37f49a to 03990f1 Compare January 19, 2025 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: To do
Development

Successfully merging this pull request may close these issues.

2 participants