-
Notifications
You must be signed in to change notification settings - Fork 150
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add userXX to keybinding menu (#828)
* add userXX to keybinding menu * Update XEH_preStart.sqf * Update XEH_preStart.sqf * Don't check inputAction if we have none bound * check all keys instead of counting them * Don't check inputAction if we have none bound (#830) * Don't check inputAction if we have none bound * check all keys instead of counting them * constant as macro * constant as macro * Invert logic for faster condition checking 0.0001 ms faster!
- Loading branch information
Showing
10 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* ---------------------------------------------------------------------------- | ||
Internal Function: CBA_events_fnc_userKeyHandler | ||
Description: | ||
Check state of user keys if enabled | ||
Author: | ||
commy2 | ||
---------------------------------------------------------------------------- */ | ||
#include "script_component.hpp" | ||
|
||
if (GVAR(skipCheckingUserActions)) exitWith {}; | ||
|
||
params ["_display"]; | ||
|
||
private _userKeyStates = [ | ||
inputAction "User1" > 0.1, inputAction "User2" > 0.1, inputAction "User3" > 0.1, inputAction "User4" > 0.1, inputAction "User5" > 0.1, | ||
inputAction "User6" > 0.1, inputAction "User7" > 0.1, inputAction "User8" > 0.1, inputAction "User9" > 0.1, inputAction "User10" > 0.1, | ||
inputAction "User11" > 0.1, inputAction "User12" > 0.1, inputAction "User13" > 0.1, inputAction "User14" > 0.1, inputAction "User15" > 0.1, | ||
inputAction "User16" > 0.1, inputAction "User17" > 0.1, inputAction "User18" > 0.1, inputAction "User19" > 0.1, inputAction "User20" > 0.1 | ||
]; | ||
|
||
if !(_userKeyStates isEqualTo GVAR(userKeyStates)) then { | ||
{ | ||
if !(_x isEqualTo (GVAR(userKeyStates) select _forEachIndex)) then { | ||
GVAR(userKeyStates) set [_forEachIndex, _x]; | ||
[_display, USERACTION_OFFSET + _forEachIndex, false, false, false] call ([FUNC(keyHandlerUp), FUNC(keyHandlerDown)] select _x); | ||
}; | ||
} forEach _userKeyStates; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters