This commit is contained in:
commy2 2015-01-20 13:17:59 +01:00
commit 65e12745d6
14 changed files with 182 additions and 88 deletions

View File

@ -34,6 +34,13 @@ if(_eventType == "ACEc") then {
if(!IS_ARRAY(_eventTargets)) then {
_eventTargets = [_eventTargets];
};
//If not multiplayer, and there are targets, then just run localy
if ((!isMultiplayer) && {(count _eventTargets) > 0}) exitWith {
ACEg = [_eventName, _eventArgs];
["ACEg", ACEg] call FUNC(_handleNetEvent);
};
_serverFlagged = false;
{
_owner = _x;

View File

@ -5,7 +5,7 @@ private ["_function", "_configFile", "_count", "_index", "_config", "_configName
_function = "private '_exceptions'; _exceptions = _this; alive ACE_player";
_configFile = configFile >> QGVAR(canInteractConditions);
_configFile = configFile >> "ACE_canInteractConditions";
_count = count _configFile;
for "_index" from 0 to (_count -1) do {

View File

@ -16,7 +16,8 @@ GVAR(position) = [0,0,0];
// Statement
[vehicle ACE_player] call FUNC(keyDown);
true
// Return false so it doesn't block the rest weapon action
false
},
[15, [false, false, false]],
false,
@ -34,7 +35,7 @@ GVAR(position) = [0,0,0];
// Statement
[vehicle ACE_player] call FUNC(keyUp);
true
false
},
[15, [false, false, false]],
false,

View File

@ -10,6 +10,98 @@ GVAR(isOpeningDoor) = false;
// restore global fire teams for JIP
{
_team = _x getVariable [QGVAR(assignedFireTeam), ""];
if (_team != "") then {_x assignTeam _team};
_team = _x getVariable [QGVAR(assignedFireTeam), ""];
if (_team != "") then {_x assignTeam _team};
} forEach allUnits;
// Add keybinds
["ACE3",
localize "STR_ACE_Interaction_OpenDoor",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(!GVAR(isOpeningDoor) &&
{[2] call FUNC(getDoor) select 1 != ''}
) exitWith {false};
// Statement
call EFUNC(interaction,openDoor);
true
},
[57, [false, true, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_OpenDoor",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !(GVAR(isOpeningDoor)) exitWith {false};
// Statement
GVAR(isOpeningDoor) = false;
true
},
[57, [false, true, false]],
false,
"keyup"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_TapShoulder",
{
// Conditions: canInteract
_exceptions = [];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if !([ACE_player, cursorTarget] call FUNC(canTapShoulder)) exitWith {false};
// Statement
[ACE_player, cursorTarget] call FUNC(tapShoulder);
true
},
[20, [true, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_ModifierKey",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Statement
ACE_Modifier = 1;
// Return false so it doesn't block other actions
false
},
[29, [false, false, false]],
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_Interaction_ModifierKey",
{
// Conditions: canInteract
_exceptions = ["ACE_Drag_isNotDragging"];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Statement
ACE_Modifier = 0;
// Return false so it doesn't block other actions
false
},
[29, [false, false, false]],
false,
"keyup"
] call cba_fnc_registerKeybind;

View File

@ -43,38 +43,6 @@ class ACE_Default_Keys {
control = 1;
alt = 0;
};
class openDoor {
displayName = "$STR_ACE_Interaction_OpenDoor";
condition = QUOTE(!GVAR(isOpeningDoor) && {[2] call FUNC(getDoor) select 1 != ''});
statement = QUOTE(call ACE_Interaction_fnc_openDoor);
conditionUp = QUOTE( GVAR(isOpeningDoor) );
statementUp = QUOTE( GVAR(isOpeningDoor) = false;);
key = 57;
shift = 0;
control = 1;
alt = 0;
};
class tapShoulder {
displayName = "$STR_ACE_Interaction_TapShoulder";
condition = QUOTE([_player, cursorTarget] call FUNC(canTapShoulder));
statement = QUOTE([_player, cursorTarget] call FUNC(tapShoulder););
key = 20;
shift = 1;
control = 0;
alt = 0;
};
class modifierKey {
displayName = "$STR_ACE_Interaction_ModifierKey";
condition = "";
statement = QUOTE(ACE_Modifier = 1;);
conditionUp = "";
statementUp = QUOTE(ACE_Modifier = 0;);
exceptions[] = {"ACE_Drag_isNotDragging"};
key = 29;
shift = 0;
control = 0;
alt = 0;
};
};
class ACE_Options {
@ -98,15 +66,15 @@ class ACE_Parameters_Boolean {
class ACE_canInteractConditions {
class GVAR(isNotEscorting) {
condition = QUOTE( !(_player getVariable ['ACE_isEscorting', false]) );
condition = QUOTE( !(ACE_player getVariable [ARR_2('ACE_isEscorting', false)]) );
};
class GVAR(isNotCaptive) {
condition = QUOTE( !(_player getVariable ['ACE_isCaptive', false]) );
condition = QUOTE( !(ACE_player getVariable [ARR_2('ACE_isCaptive', false)]) );
};
class GVAR(isNotSurrendering) {
condition = QUOTE( !(_player getVariable ['ACE_isSurrender', false]) );
condition = QUOTE( !(ACE_player getVariable [ARR_2('ACE_isSurrender', false)]) );
};
class GVAR(isNotSwimming) {
condition = QUOTE( !underwater _player );
condition = QUOTE( !underwater ACE_player );
};
};

View File

@ -20,4 +20,4 @@ _color = getArray (_config >> "color");
((ctrlParent _ctrl) displayCtrl 102) ctrlSetTextColor _color;
GVAR(currentMarkerColor) = _data;
GVAR(currentMarkerColorConfigName) = (configName _config);

View File

@ -14,4 +14,4 @@ _icon = getText (_config >> "icon");
((ctrlParent _ctrl) displayCtrl 102) ctrlSetText _icon;
GVAR(currentMarkerShape) = _data;
GVAR(currentMarkerConfigName) = (configName _config);

View File

@ -32,8 +32,8 @@ if (_this select 1 == 1) then {
[QGVAR(setMarkerNetwork), [
allMapMarkers select (count allMapMarkers - 1), [
GETGVAR(currentMarkerShape,0),
GETGVAR(currentMarkerColor,0),
GETGVAR(currentMarkerConfigName,""),
GETGVAR(currentMarkerColorConfigName,""),
_this,
GETGVAR(currentMarkerAngle,0)
]

View File

@ -8,20 +8,28 @@ _allMapMarkersProperties = _this select 1;
_logic = _this select 2;
{
_index = _allMapMarkers find _x;
_index = _allMapMarkers find _x;
if (_index != -1) then {
_data = _allMapMarkersProperties select _index;
if (_index != -1) then {
_data = _allMapMarkersProperties select _index;
_config = (configfile >> "CfgMarkers") select (_data select 0);
_x setMarkerTypeLocal configName _config;
_config = (configfile >> "CfgMarkerColors") select (_data select 1);
_x setMarkerColorLocal configName _config;
_x setMarkerPosLocal (_data select 2);
_x setMarkerDirLocal (_data select 3);
_config = (configfile >> "CfgMarkers") >> (_data select 0);
if (!isClass _config) then {
WARNING("CfgMarker not found, changed to milDot");
_config == (configFile >> "CfgMarkers" >> "MilDot");
};
_x setMarkerTypeLocal (configName _config);
_config = (configfile >> "CfgMarkerColors") >> (_data select 1);
if (!isClass _config) then {
WARNING("CfgMarkerColors not found, changed to Default");
_config == (configFile >> "CfgMarkerColors" >> "Default");
};
_x setMarkerColorLocal (configName _config);
_x setMarkerPosLocal (_data select 2);
_x setMarkerDirLocal (_data select 3);
};
} forEach allMapMarkers;
deleteVehicle _logic;

View File

@ -6,10 +6,18 @@ private ["_marker", "_data", "_config"];
_marker = _this select 0;
_data = _this select 1;
_config = (configfile >> "CfgMarkers") select (_data select 0);
_marker setMarkerTypeLocal configName _config;
_config = (configfile >> "CfgMarkers") >> (_data select 0);
if (!isClass _config) then {
WARNING("CfgMarker not found, changed to milDot");
_config == (configFile >> "CfgMarkers" >> "MilDot");
};
_marker setMarkerTypeLocal (configName _config);
_config = (configfile >> "CfgMarkerColors") select (_data select 1);
_config = (configfile >> "CfgMarkerColors") >> (_data select 1);
if (!isClass _config) then {
WARNING("CfgMarkerColors not found, changed to Default");
_config == (configFile >> "CfgMarkerColors" >> "Default");
};
_marker setMarkerColorLocal configName _config;
_marker setMarkerPosLocal (_data select 2);
@ -17,21 +25,21 @@ _marker setMarkerDirLocal (_data select 3);
// save properties on server machine for JIP, marker editing ready
if (isMultiplayer && {isServer}) then {
private ["_allMapMarkers", "_allMapMarkersProperties", "_index"];
private ["_allMapMarkers", "_allMapMarkersProperties", "_index"];
_allMapMarkers = GETMVAR(allMapMarkers,[]);
_allMapMarkersProperties = GETMVAR(allMapMarkersProperties,[]);
_allMapMarkers = GETMVAR(allMapMarkers,[]);
_allMapMarkersProperties = GETMVAR(allMapMarkersProperties,[]);
_index = _allMapMarkers find _marker;
_index = _allMapMarkers find _marker;
if (_index == -1) then {
_allMapMarkers pushBack _marker;
_allMapMarkersProperties pushBack _data;
} else {
_allMapMarkers set [_index, _marker];
_allMapMarkersProperties set [_index, _data];
};
if (_index == -1) then {
_allMapMarkers pushBack _marker;
_allMapMarkersProperties pushBack _data;
} else {
_allMapMarkers set [_index, _marker];
_allMapMarkersProperties set [_index, _data];
};
GVAR(allMapMarkers) = _allMapMarkers;
GVAR(allMapMarkersProperties) = _allMapMarkersProperties;
GVAR(allMapMarkers) = _allMapMarkers;
GVAR(allMapMarkersProperties) = _allMapMarkersProperties;
};

View File

@ -1,10 +1,30 @@
// 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); };
// Return false so it doesn't block other actions
false
},
[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";

View File

@ -18,7 +18,8 @@ if !(hasInterface) exitWith {};
// Statement
[ACE_player, vehicle ACE_player, currentWeapon ACE_player] call FUNC(restWeapon);
true
// Return false so it doesn't block other actions
false
},
[15, [false, false, false]],
false,