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 Cancel (RMB) Action #3524

Merged
merged 2 commits into from
Mar 6, 2016
Merged

Fix Cancel (RMB) Action #3524

merged 2 commits into from
Mar 6, 2016

Conversation

jonpas
Copy link
Member

@jonpas jonpas commented Mar 3, 2016

When merged this pull request will:

  • FIxes "Cancel" action which is right mouse button when placing things

Untested (no access to Arma-capable machine at the moment)

@jonpas jonpas added status/needs-testing kind/bug-fix Release Notes: **FIXED:** labels Mar 3, 2016
@jonpas jonpas added this to the 3.5.1 milestone Mar 3, 2016
@jonpas
Copy link
Member Author

jonpas commented Mar 5, 2016

Tested, seems to work fine. Tagging @commy2 for review.

@commy2
Copy link
Contributor

commy2 commented Mar 6, 2016

Okay this works as far as I can tell.
But.
We should add simple sanity checks after the != -1 check

previously these actions would only be called when the current action was active (e.g. carrying a ladder), but now all of them are executed when you RMB every time.

e.g.:
_magClassname in (magazines _unit)

{_unit != ACE_player} ||
{!([_unit, objNull, ["isNotSwimming"]] call EFUNC(common,canInteractWith))} ||
{!(_magClassname in (magazines _unit))}) then {
GVAR(placeAction) = PLACE_CANCEL;
Copy link
Contributor

Choose a reason for hiding this comment

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

We don't want to remove this entire if statement, just the RMB part.
All of the other checks need to be run each frame in the PFEH so it will cancel if any of them happen.
e.g. if canInteractWith is false, we need to cancel right away instead of waiting for RMB

@PabstMirror
Copy link
Contributor

I wonder if we could simplify the event handler code to a single common
EFUNC(common,rmbPressed) = true;

and then in all our placement blocks we do

EFUNC(common,rmbPressed) = false
PFEH: if (EFUNC(common,rmbPressed)) then {cancle};

@commy2
Copy link
Contributor

commy2 commented Mar 6, 2016

there is no RMB release event though.

@nicolasbadano
Copy link
Contributor

I still think installing only one of this EH and launching an ACE event on RMB would be more efficient and easier to use.

@jonpas
Copy link
Member Author

jonpas commented Mar 6, 2016

@esteldunedain I believe this is supposed to be solved with CBA_fnc_addDisplayHandler once new CBA is released. @commy2 can confirm?

@commy2
Copy link
Contributor

commy2 commented Mar 6, 2016

Yes.

@jonpas jonpas removed the status/WIP label Mar 6, 2016
commy2 added a commit that referenced this pull request Mar 6, 2016
@commy2 commy2 merged commit a9578ab into master Mar 6, 2016
@commy2 commy2 deleted the fixCancelAction branch March 6, 2016 18:16
@dedmen dedmen mentioned this pull request Oct 9, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug-fix Release Notes: **FIXED:**
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants