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

Improve Toggle AI Pathing keybind with hint icons #725

Merged
merged 2 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
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>