mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
nametags: cba keybinds
This commit is contained in:
parent
058aa8d920
commit
fc8c391596
@ -1,10 +1,29 @@
|
||||
// by commy2 and CAA-Picard
|
||||
#include "script_component.hpp"
|
||||
|
||||
// by commy2 and CAA-Picard
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
GVAR(ShowNamesTime) = -10;
|
||||
|
||||
// Add keybinds
|
||||
["ACE3",
|
||||
localize "STR_ACE_NameTags_ShowNames",
|
||||
{
|
||||
// Conditions: canInteract
|
||||
_exceptions = [];
|
||||
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
|
||||
|
||||
// Statement
|
||||
GVAR(ShowNamesTime) = time;
|
||||
if (call FUNC(canShow)) then{ call FUNC(doShow); };
|
||||
true
|
||||
},
|
||||
[29, [false, false, false]],
|
||||
false,
|
||||
"keydown"
|
||||
] call cba_fnc_registerKeybind;
|
||||
|
||||
|
||||
// Draw handle
|
||||
addMissionEventHandler ["Draw3D", {
|
||||
if !(profileNamespace getVariable ["ACE_showPlayerNames", true]) exitWith {};
|
||||
|
||||
|
@ -8,3 +8,5 @@ PREP(getVehicleData);
|
||||
PREP(moduleNameTags);
|
||||
PREP(onMouseZChanged);
|
||||
PREP(setText);
|
||||
|
||||
GVAR(ShowNamesTime) = -10;
|
||||
|
@ -15,19 +15,6 @@ class CfgPatches {
|
||||
#include "CfgEventHandlers.hpp"
|
||||
#include "CfgVehicles.hpp"
|
||||
|
||||
class ACE_Default_Keys {
|
||||
class showNames {
|
||||
displayName = "$STR_ACE_NameTags_ShowNames";
|
||||
condition = "true";
|
||||
statement = QUOTE(GVAR(ShowNamesTime) = time; if (call FUNC(canShow)) then{ call FUNC(doShow); };);
|
||||
key = 29;
|
||||
shift = 0;
|
||||
control = 0;
|
||||
alt = 0;
|
||||
allowHolding = 1;
|
||||
};
|
||||
};
|
||||
|
||||
class ACE_Options {
|
||||
class showPlayerNames {
|
||||
displayName = "$STR_ACE_NameTags_ShowPlayerNames";
|
||||
|
Loading…
Reference in New Issue
Block a user