Skip to content

Commit

Permalink
Implement Single Key press as Accessability option
Browse files Browse the repository at this point in the history
  • Loading branch information
john681611 committed Dec 2, 2024
1 parent 46d200d commit 91e2722
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions addons/quicktime/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ SCRIPT(XEH_preInit);

ADDON = false;

#include "initSettings.inc.sqf"

[LSTRING(QTEKeybindGroup), QGVAR(qteUpKey), ["", LSTRING(QTEKeybindUpTooltip)], {
[""] call CBA_fnc_keyPressedQTE // return
}, {}, [DIK_UP, [false, true, false]]] call CBA_fnc_addKeybind;
Expand Down
3 changes: 3 additions & 0 deletions addons/quicktime/fnc_runQTE.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ GVAR(QTEHistory) = [];
GVAR(QTEResetCount) = 0;
GVAR(QTERunning) = true;
private _startTime = CBA_missionTime;
if(GVAR(qteShorten)) then {
_qteSequence = _qteSequence select [0, 1];
};
private _qteArgsArray = [
["args", _args],
["failCondition", _failCondition],
Expand Down
9 changes: 9 additions & 0 deletions addons/quicktime/initSettings.inc.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[
QGVAR(qteShorten),
"CHECKBOX",
[LLSTRING(QTEAccessabilitySingleKey), LLSTRING(QTEAccessabilitySingleKeyTooltip)],
[LELSTRING(main,DisplayName), LLSTRING(QTETitle)],
false, // default value
0 // isGlobal
] call CBA_fnc_addSetting;

9 changes: 9 additions & 0 deletions addons/quicktime/stringtable.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project name="CBA_A3">
<Package name="Quicktime">
<Key ID="STR_cba_quicktime_QTETitle">
<English>Quick-Time Events</English>
</Key>
<Key ID="STR_cba_quicktime_QTEKeybindGroup">
<English>CBA Quick-Time Events</English>
</Key>
Expand All @@ -16,5 +19,11 @@
<Key ID="STR_cba_quicktime_QTEKeybindRightTooltip">
<English>Right key used in Quick-Time Events.</English>
</Key>
<Key ID="STR_cba_quicktime_QTEAccessabilitySingleKey">
<English>Single Key press</English>
</Key>
<Key ID="STR_cba_quicktime_QTEAccessabilitySingleKeyTooltip">
<English>When enabled, all Quick-Time Events will be shortened to a single key press.</English>
</Key>
</Package>
</Project>

0 comments on commit 91e2722

Please sign in to comment.