Skip to content

Commit

Permalink
Improve Toggle AI Pathing keybind with hint icons (#725)
Browse files Browse the repository at this point in the history
  • Loading branch information
ampersand38 authored Mar 31, 2023
1 parent 5de15ba commit 9def352
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
25 changes: 8 additions & 17 deletions addons/editor/initKeybinds.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -223,32 +223,23 @@

[[ELSTRING(main,DisplayName), LSTRING(AIControl)], QGVAR(toggleAIPATH), [LSTRING(ToggleAIPATH), LSTRING(ToggleAIPATH_Description)], {
if (!isNull curatorCamera && {!GETMVAR(RscDisplayCurator_search,false)}) then {
private _enabled = 0;
private _disabled = 0;

{
if (!isPlayer _x && {_x == vehicle _x || {_x == driver vehicle _x}}) then {
private _isPathEnabled = _x checkAIFeature "PATH";
private _eventName = [QEGVAR(common,enableAI), QEGVAR(common,disableAI)] select _isPathEnabled;
[_eventName, [_x, "PATH"], _x] call CBA_fnc_globalEvent;

if (_isPathEnabled) then {
_disabled = _disabled + 1;
} else {
_enabled = _enabled + 1;
};
private _icon = [
"\a3\3den\Data\Displays\Display3DEN\PanelRight\modeWaypoints_ca.paa",
"\a3\3den\Data\CfgWaypoints\hold_ca.paa"
] select _isPathEnabled;

[[
["ICON", [_x, _icon]]
], 3, _x] call EFUNC(common,drawHint);
};
} forEach SELECTED_OBJECTS;

[
"%1 - %2: %3 - %4: %5",
LLSTRING(AIPathToggled),
LELSTRING(common,Enabled),
_enabled,
LELSTRING(common,Disabled),
_disabled
] call EFUNC(common,showMessage);

true // handled
};
}, {}, [0, [false, false, false]]] call CBA_fnc_addKeybind; // Default: Unbound
3 changes: 0 additions & 3 deletions addons/editor/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -411,8 +411,5 @@
<Key ID="STR_ZEN_Editor_ToggleAIPath_Description">
<English>Makes selected AI units start or stop moving. Does not affect aiming or shooting. Similar to "Hold Position" in RTS games.</English>
</Key>
<Key ID="STR_ZEN_Editor_AIPathToggled">
<English>AI Pathing Toggled</English>
</Key>
</Package>
</Project>

0 comments on commit 9def352

Please sign in to comment.