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

Added captive hotkey #5529

Merged
merged 9 commits into from
Sep 26, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions addons/captives/XEH_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,22 @@ if (isServer) then {

if (!hasInterface) exitWith {};

//Add Keybind:
Copy link
Member

Choose a reason for hiding this comment

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

Many spaces. This comment is kind of superfluous anyways, it's seen immediately it's a keybind thing.

["ACE3 Common", QGVAR(captives), [(localize LSTRING(KeyComb)), (localize LSTRING(KeyComb_description))],
{
if !(cursorObject isKindOf "Man") exitWith {};
Copy link
Contributor

@commy2 commy2 Sep 19, 2017

Choose a reason for hiding this comment

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

CAManBase
Man includes rabbits and snakes and dogs and sheep and fish etc.


if([ACE_player, cursorObject] call FUNC(canApplyHandcuffs)) exitWith {
[cursorObject, true] call FUNC(setHandcuffed);
};

if([ACE_player, cursorObject] call FUNC(canRemoveHandcuffs)) exitWith {
[cursorObject, false] call FUNC(setHandcuffed);
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't use cursorObject. It has really bad accuracy.

Copy link
Author

Choose a reason for hiding this comment

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

What should I use instead of cursorObject?

Copy link
Contributor

Choose a reason for hiding this comment

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

screenToWorld [0.5, 0.5] maybe?

Copy link
Member

Choose a reason for hiding this comment

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

};
},
{false},
[59, [true, false, false]], true] call CBA_fnc_addKeybind; // Shift + Tilda (hold)

["isNotEscorting", {!(GETVAR(_this select 0,GVAR(isEscorting),false))}] call EFUNC(common,addCanInteractWithCondition);
["isNotHandcuffed", {!(GETVAR(_this select 0,GVAR(isHandcuffed),false))}] call EFUNC(common,addCanInteractWithCondition);
["isNotSurrendering", {!(GETVAR(_this select 0,GVAR(isSurrendering),false))}] call EFUNC(common,addCanInteractWithCondition);
8 changes: 8 additions & 0 deletions addons/captives/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -427,5 +427,13 @@
<Chinese>投降或無武器狀態</Chinese>
<Chinesesimp>投降或无武器状态</Chinesesimp>
</Key>
<Key ID="STR_ACE_Captives_KeyComb">
<English>Toggle unit captive</English>
<German>Einheit festnehmen umschalten</German>
</Key>
<Key ID="STR_ACE_Captives_KeyComb_Description">
<English>Toggles the captive status of the unit under the cursor.</English>
<German>Schalten den Festnahmestatus der Einheit vor dem Cursor um.</German>
</Key>
</Package>
</Project>