nametags: cba keybinds

This commit is contained in:
Nicolás Badano 2015-01-18 19:39:15 -03:00
parent 058aa8d920
commit fc8c391596
3 changed files with 23 additions and 15 deletions

View File

@ -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 {};

View File

@ -8,3 +8,5 @@ PREP(getVehicleData);
PREP(moduleNameTags);
PREP(onMouseZChanged);
PREP(setText);
GVAR(ShowNamesTime) = -10;

View File

@ -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";