-
Notifications
You must be signed in to change notification settings - Fork 741
Wire cutter - Various improvements and cleanup #6389
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
Conversation
|
Wrong button 😞 |
|
Why don't we get the sound files to work instead of deleting them? More sfx! |
|
They sound like a machine cutting metal (a saw or something similar), instead of clipping with a wire cutter. |
| class Land_IndFnc_3_Hole_F: Wall_F { GVAR(isFence) = 1; }; | ||
| class Land_IndFnc_3_F: Wall_F { GVAR(isFence) = 1; }; | ||
| class Land_Razorwire_F: NonStrategic { GVAR(isFence) = 1; }; | ||
| class Land_Net_Fence_4m_F: Wall_F { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it didn't break Coding Guidelines before and was quite compact
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer the spread out variant more as it looks cleaner. I would however prefer a Macro much more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about MACRO_FENCE(Land_Net_Fence_4m_F,Wall_F);?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried it out and it is less readable than having them spread out.
| * | ||
| * Example: | ||
| * [player, berlinWall] call ace_logistics_wirecutter_fnc_cutDownFence | ||
| * [_player, _fence] call ace_logistics_wirecutter_fnc_cutDownFence |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
example is mostly useful for copy-pasting to debug console so [player, cursorObject] call ace_logistics_wirecutter_fnc_cutDownFence would be better
| params ["_unit", "_fence"]; | ||
| TRACE_2("Fence cutting started",_unit,_fence); | ||
|
|
||
| // Exit if unit is not player |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
really
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
brain-lag
| // Ignore self-interaction menu or mounted vehicle interaction | ||
| // For performance reasons only add PFH if player has wirecutter item | ||
| // If player somehow gets a wirecutter during keyDown, they will just have to reopen menu | ||
| if (_interactionType != 0 || {vehicle ACE_player != ACE_player} || {!("ACE_wirecutter" in ([ACE_player, false, true, true, true, false] call CBA_fnc_uniqueUnitItems))}) exitWith {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better to split this line to multi-line condition
| if (!(_x in _fencesHelped) && {_x call FUNC(isFence)}) then { | ||
| _fencesHelped pushBack _x; | ||
| private _helper = "ACE_LogicDummy" createVehicleLocal [0, 0, 0]; | ||
| private _action = [QGVAR(helperCutFence), localize LSTRING(CutFence), QPATHTOF(ui\wirecutter_ca.paa), _fncStatement, _fncCondition, {}, _x, {[0, 0, 0]}, 5.5, [false, false, false, false, true]] call EFUNC(interact_menu,createAction); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about creating a helper object with this action in config? The attached fence would then be a variable on the helper.
* Optimize and cleanup interactEH function * Add missing fences and improve formatting * Improve cutDownFence function * Remove unused sound files and cleanup * Multi-line condition and fix examples * Increase PFH delay and use distanceSqr
When merged this pull request will:
interactEHfunctionisFenceandcutDownFencefunctions (cleanup, readability, time macros)Performance results for
ace_logistics_wirecutter_interactEH_counter: