mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge branch 'master' into fixFlashlightPrivates
This commit is contained in:
commit
0273dd1d4d
@ -20,9 +20,11 @@ _weaponConfig = (configFile >> "CfgWeapons" >> _this);
|
||||
|
||||
_barrelTwist = getNumber(_weaponConfig >> "ACE_barrelTwist");
|
||||
_twistDirection = 1;
|
||||
_twistDirection = getNumber(_weaponConfig >> "ACE_twistDirection");
|
||||
if !(_twistDirection in [-1, 0, 1]) then {
|
||||
_twistDirection = 1;
|
||||
if (isNumber (_weaponConfig >> "ACE_twistDirection")) then {
|
||||
_twistDirection = getNumber (_weaponConfig >> "ACE_twistDirection");
|
||||
if !(_twistDirection in [-1, 0, 1]) then {
|
||||
_twistDirection = 1;
|
||||
};
|
||||
};
|
||||
|
||||
_barrelLength = getNumber(_weaponConfig >> "ACE_barrelLength");
|
||||
|
@ -192,6 +192,7 @@ class CfgVehicles {
|
||||
scope = 2;
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_settings_ca.paa));
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
class Arguments {
|
||||
class allowHandcuffOwnSide {
|
||||
displayName = CSTRING(ModuleSettings_handcuffSide_name);
|
||||
|
@ -56,7 +56,7 @@ if (_state) then {
|
||||
|
||||
//Adds an animation changed eh
|
||||
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
|
||||
local _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
|
||||
private _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
|
||||
if (_animChangedEHID != -1) then {
|
||||
TRACE_1("removing animChanged EH",_animChangedEHID);
|
||||
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
|
||||
@ -92,7 +92,7 @@ if (_state) then {
|
||||
[_unit, QGVAR(Handcuffed), false] call EFUNC(common,setCaptivityStatus);
|
||||
|
||||
//remove AnimChanged EH
|
||||
local _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
|
||||
private _animChangedEHID = _unit getVariable [QGVAR(handcuffAnimEHID), -1];
|
||||
TRACE_1("removing animChanged EH",_animChangedEHID);
|
||||
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
|
||||
_unit setVariable [QGVAR(handcuffAnimEHID), -1];
|
||||
|
@ -48,7 +48,7 @@ if (_state) then {
|
||||
if (_unit getVariable [QGVAR(isSurrendering), false] && {(vehicle _unit) == _unit}) then {
|
||||
//Adds an animation changed eh
|
||||
//If we get a change in animation then redo the animation (handles people vaulting to break the animation chain)
|
||||
local _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
|
||||
private _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
|
||||
if (_animChangedEHID != -1) then {
|
||||
TRACE_1("removing animChanged EH",_animChangedEHID);
|
||||
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
|
||||
@ -68,7 +68,7 @@ if (_state) then {
|
||||
[_unit, QGVAR(Surrendered), false] call EFUNC(common,setCaptivityStatus);
|
||||
|
||||
//remove AnimChanged EH
|
||||
local _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
|
||||
private _animChangedEHID = _unit getVariable [QGVAR(surrenderAnimEHID), -1];
|
||||
_unit removeEventHandler ["AnimChanged", _animChangedEHID];
|
||||
_unit setVariable [QGVAR(surrenderAnimEHID), -1];
|
||||
|
||||
|
@ -166,7 +166,7 @@
|
||||
<Portuguese>Fazer unidade se render</Portuguese>
|
||||
<French>Faire capituler l'unité</French>
|
||||
<Hungarian>Egység kapitulálása</Hungarian>
|
||||
<Russian>Сделать юнита пленным</Russian>
|
||||
<Russian>Заставить юнита сдаться</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Captives_ModuleSurrender_Description">
|
||||
<English>Sync a unit to make them surrender.<br />Source: ace_captives</English>
|
||||
@ -177,15 +177,17 @@
|
||||
<Portuguese>Sincroniza uma unidade para fazer com que ela se renda. <br/>Fonte: ace_captives</Portuguese>
|
||||
<French>Synchronise une unité pour la rendre captive. <br/>Source: ace_captives</French>
|
||||
<Hungarian>Egység szinkronizálása, hogy kapituláljon.<br />Forrás: ace_captives</Hungarian>
|
||||
<Russian>Синхронизируйте с юнитами, чтобы сделать их пленными.<br />Источник: ace_captives</Russian>
|
||||
<Russian>Синхронизируйте с юнитами, чтобы заставить их сдаться в плен.<br />Источник: ace_captives</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Captives_ModuleHandcuffed_DisplayName">
|
||||
<English>Make Unit Handcuffed</English>
|
||||
<Portuguese>Fazer unidade algemada</Portuguese>
|
||||
<Russian>Связать юнита</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Captives_ModuleHandcuffed_Description">
|
||||
<English>Sync a unit to make them handcuffed.<br />Source: ace_captives</English>
|
||||
<Portuguese>Sincronizar uma unidade para deixá-la algemada.<br/>Source: ace_captives</Portuguese>
|
||||
<Russian>Синхронизируйте с юнитами, чтобы сделать их связанными.<br />Источник: ace_captives</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Captives_ModuleSettings_DisplayName">
|
||||
<English>Captives Settings</English>
|
||||
|
@ -8,6 +8,7 @@ class CfgVehicles {
|
||||
function = QFUNC(moduleSettings);
|
||||
functionPriority = 1;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
isTriggerActivated = 0;
|
||||
author = ECSTRING(common,ACETeam);
|
||||
|
||||
|
@ -18,12 +18,11 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_position", "_item", "_i"];
|
||||
params ["_itemClass", "_vehicle", ["_amount", 1], ["_showHint", false, [false]] ];
|
||||
TRACE_3("params",_itemClass,_vehicle,_amount);
|
||||
|
||||
for "_i" from 1 to _amount do {
|
||||
[_item, _vehicle] call FUNC(loadItem);
|
||||
[_itemClass, _vehicle] call FUNC(loadItem);
|
||||
};
|
||||
|
||||
// Invoke listenable event
|
||||
|
@ -97,15 +97,19 @@
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_LoadingItem">
|
||||
<English>Loading Cargo</English>
|
||||
<Portuguese>Carregando carga</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_UnloadingItem">
|
||||
<English>Unloading Cargo</English>
|
||||
<Portuguese>Descarregando carga</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_LoadingFailed">
|
||||
<English>%1<br/>could not be loaded</English>
|
||||
<Portuguese>%1<br/>não pode ser carregado</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Cargo_UnloadingFailed">
|
||||
<English>%1<br/>could not be unloaded</English>
|
||||
<Portuguese>%1<br/>não pode ser descarregado</Portuguese>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
</Project>
|
@ -35,6 +35,7 @@ class CfgVehicles {
|
||||
function = QFUNC(moduleCheckPBOs);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa));
|
||||
class Arguments {
|
||||
class Action {
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
//Handle the waitAndExec array:
|
||||
while {!(GVAR(waitAndExecArray) isEqualTo []) && {GVAR(waitAndExecArray) select 0 select 0 <= ACE_Time}} do {
|
||||
local _entry = GVAR(waitAndExecArray) deleteAt 0;
|
||||
private _entry = GVAR(waitAndExecArray) deleteAt 0;
|
||||
(_entry select 2) call (_entry select 1);
|
||||
};
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
GVAR(nextFrameNo) = diag_frameno + 1;
|
||||
|
||||
//Handle the waitUntilAndExec array:
|
||||
local _deleted = 0;
|
||||
private _deleted = 0;
|
||||
{
|
||||
// if condition is satisifed call statement
|
||||
if ((_x select 2) call (_x select 0)) then {
|
||||
@ -194,9 +194,17 @@ call FUNC(checkFiles);
|
||||
|
||||
ACE_LOGINFO("Settings received from server.");
|
||||
|
||||
if (isServer) then { //read settings from paramsArray
|
||||
[] call FUNC(readSettingsFromParamsArray);
|
||||
};
|
||||
// Event so that ACE_Modules have their settings loaded:
|
||||
["InitSettingsFromModules", []] call FUNC(localEvent);
|
||||
|
||||
if (isServer) then {
|
||||
// Publish all settings data after all configs and modules are read
|
||||
publicVariable QGVAR(settings);
|
||||
};
|
||||
|
||||
// Load user settings from profile
|
||||
if (hasInterface) then {
|
||||
call FUNC(loadSettingsFromProfile);
|
||||
|
@ -115,6 +115,7 @@ PREP(isInBuilding);
|
||||
PREP(isModLoaded);
|
||||
PREP(isPlayer);
|
||||
PREP(isTurnedOut);
|
||||
PREP(isUnderwater);
|
||||
PREP(letterToCode);
|
||||
PREP(lightIntensityFromObject);
|
||||
PREP(loadPerson);
|
||||
@ -139,6 +140,7 @@ PREP(playerSide);
|
||||
PREP(positionToASL);
|
||||
PREP(progressBar);
|
||||
PREP(readSettingFromModule);
|
||||
PREP(readSettingsFromParamsArray);
|
||||
PREP(receiveRequest);
|
||||
PREP(removeCanInteractWithCondition);
|
||||
PREP(removeSpecificMagazine);
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
params ["_var", ["_depth", 0, [0]]];
|
||||
|
||||
local _pad = "";
|
||||
private _pad = "";
|
||||
|
||||
for "_i" from 0 to _depth do {
|
||||
_pad = _pad + toString [9];
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
local _vehicle = vehicle _unit;
|
||||
private _vehicle = vehicle _unit;
|
||||
if (_unit == _vehicle) exitWith {[]};
|
||||
|
||||
scopeName "main";
|
||||
|
@ -14,11 +14,11 @@
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
local _vehicle = vehicle _unit;
|
||||
private _vehicle = vehicle _unit;
|
||||
|
||||
if (_unit == _vehicle) exitWith {false};
|
||||
|
||||
local _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
private _config = configFile >> "CfgVehicles" >> typeOf _vehicle;
|
||||
|
||||
if (getNumber (_config >> "hideProxyInCombat") != 1) exitWith {false};
|
||||
|
||||
@ -26,10 +26,10 @@ if (_unit == driver _vehicle) exitWith {
|
||||
getNumber (_config >> "forceHideDriver") == 0; // return
|
||||
};
|
||||
|
||||
local _turret = [_unit] call FUNC(getTurretIndex);
|
||||
private _turret = [_unit] call FUNC(getTurretIndex);
|
||||
|
||||
if (_turret isEqualTo []) exitWith {false};
|
||||
|
||||
local _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
private _turretConfig = [_config, _turret] call FUNC(getTurretConfigPath);
|
||||
|
||||
getNumber (_turretConfig >> "forceHideGunner") == 0; // return
|
||||
|
@ -1,29 +1,19 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Check if unit is underwater
|
||||
* Check if unit's head is underwater
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* if unit is in the water (BOOLEAN)
|
||||
* If unit's head is underwater <BOOL>
|
||||
*
|
||||
* Public: Yes
|
||||
*
|
||||
* Deprecated
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
ACE_DEPRECATED("ace_common_fnc_inWater","3.5.0","ace_common_fnc_isUnderwater");
|
||||
|
||||
private "_return";
|
||||
_return = false;
|
||||
|
||||
if (surfaceIsWater getPosASL _unit) then {
|
||||
private "_pos";
|
||||
_pos = _unit modelToWorldVisual (_unit selectionPosition "head");
|
||||
|
||||
if (_pos select 2 < 0) then {
|
||||
_return = true;
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
||||
_this call FUNC(isUnderwater)
|
||||
|
29
addons/common/functions/fnc_isUnderwater.sqf
Normal file
29
addons/common/functions/fnc_isUnderwater.sqf
Normal file
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Author: Glowbal
|
||||
* Check if unit's head is underwater
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit <OBJECT>
|
||||
*
|
||||
* Return Value:
|
||||
* If unit's head is underwater <BOOL>
|
||||
*
|
||||
* Public: Yes
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_unit"];
|
||||
|
||||
private "_return";
|
||||
_return = false;
|
||||
|
||||
if (surfaceIsWater getPosASL _unit) then {
|
||||
private "_pos";
|
||||
_pos = _unit modelToWorldVisual (_unit selectionPosition "head");
|
||||
|
||||
if (_pos select 2 < 0) then {
|
||||
_return = true;
|
||||
};
|
||||
};
|
||||
|
||||
_return
|
@ -35,12 +35,23 @@ _fnc_parseConfigForDisplayNames = {
|
||||
_values set [_forEachIndex, _text];
|
||||
};
|
||||
} forEach _values;
|
||||
|
||||
if (!(_values isEqualTo [])) then {
|
||||
if (_typeOf != "SCALAR") then {
|
||||
ACE_LOGWARNING_2("Setting [%1] has values[] but is not SCALAR (%2)", _name, _typeOf);
|
||||
} else {
|
||||
private _value = missionNamespace getVariable [_name, -1];
|
||||
if ((_value < 0) || {_value >= (count _values)}) then {
|
||||
ACE_LOGWARNING_3("Setting [%1] out of bounds %2 (values[] count is %3)(", _name, _value, count _values);
|
||||
};
|
||||
};
|
||||
};
|
||||
true
|
||||
};
|
||||
|
||||
// Iterate through settings
|
||||
{
|
||||
_x params ["_name"];
|
||||
_x params ["_name", "_typeOf"];
|
||||
|
||||
if !([configFile >> "ACE_Settings" >> _name] call _fnc_parseConfigForDisplayNames) then {
|
||||
if !([configFile >> "ACE_ServerSettings" >> _name] call _fnc_parseConfigForDisplayNames) then {
|
||||
|
@ -51,8 +51,6 @@ _fnc_parseConfigForSettings = {
|
||||
// mission side settings
|
||||
[missionConfigFile >> "ACE_Settings"] call _fnc_parseConfigForSettings;
|
||||
|
||||
// Publish all settings data
|
||||
publicVariable QGVAR(settings);
|
||||
// Publish all setting values
|
||||
{
|
||||
publicVariable (_x select 0);
|
||||
|
63
addons/common/functions/fnc_readSettingsFromParamsArray.sqf
Normal file
63
addons/common/functions/fnc_readSettingsFromParamsArray.sqf
Normal file
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Author: PabstMirror
|
||||
* Read settins from paramsArray that have a ACE_setting = 1.
|
||||
* Happens before modules but after all other configs (for force priority)
|
||||
*
|
||||
* Arguments:
|
||||
* None
|
||||
*
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* [] call ace_common_fnc_readSettingsFromParamsArray
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
//paramsArray is a normal variable not a command
|
||||
private _paramsArray = missionnamespace getvariable ["paramsArray", []];
|
||||
|
||||
TRACE_1("Reading missionConfigFile params",_paramsArray);
|
||||
|
||||
{
|
||||
private _config = (missionConfigFile >> "params") select _forEachIndex;
|
||||
if ((getNumber (_config >> "ACE_setting")) > 0) then {
|
||||
private _settingName = configName _config;
|
||||
private _settingValue = _x;
|
||||
private _title = getText (_config >> "title");
|
||||
|
||||
TRACE_3("ace_setting",_title,_settingName,_settingValue);
|
||||
|
||||
// Check if the variable is already defined
|
||||
if (isNil _settingName) exitWith {
|
||||
ACE_LOGERROR_1("readSettingsFromParamsArray - param [%1] is not an ace_setting", _settingName);
|
||||
};
|
||||
|
||||
private _settingData = [_settingName] call FUNC(getSettingData);
|
||||
_settingData params ["", "_typeName", "", "", "", "", "_isForced"];
|
||||
|
||||
// Check if it's already forced and quit
|
||||
if (_isForced) exitWith {ACE_LOGWARNING_1("readSettingsFromParamsArray - param [%1] is already set and forced", _settingName);};
|
||||
|
||||
// The setting is not forced, so update the value
|
||||
// Read entry and cast it to the correct type from the existing variable
|
||||
private _validValue = false;
|
||||
switch (true) do {
|
||||
case (_typeName == "SCALAR"): {_validValue = true;};
|
||||
case (_typeName == "BOOL"): {
|
||||
_settingValue = _settingValue > 0;
|
||||
_validValue = true;
|
||||
};
|
||||
//TODO: Handle ARRAY,COLOR,STRING??? (bool/scalar covers most important settings)
|
||||
};
|
||||
|
||||
if (!_validValue) exitWith {
|
||||
ACE_LOGWARNING_3("readSettingsFromParamsArray - param [%1] type not valid [%2] - expected type [%3]", _settingName,_settingValue,_typeName);
|
||||
};
|
||||
|
||||
// Update the variable globaly and Force
|
||||
[_settingName, _settingValue, true, true] call FUNC(setSetting);
|
||||
};
|
||||
} foreach _paramsArray;
|
@ -19,7 +19,7 @@
|
||||
|
||||
params ["_unit", "_muzzle", "_mode"];
|
||||
|
||||
local _index = 0;
|
||||
private _index = 0;
|
||||
|
||||
while {
|
||||
_index < 100 && {currentMuzzle _unit != _muzzle || {currentWeaponMode _unit != _mode}}
|
||||
|
@ -148,7 +148,7 @@ if (_backpack != "") then {
|
||||
_unit addBackpack _backpack;
|
||||
|
||||
if (_clearBackpack) then {
|
||||
local _backpackObject = unitBackpack _unit;
|
||||
private _backpackObject = unitBackpack _unit;
|
||||
|
||||
clearMagazineCargoGlobal _backpackObject;
|
||||
clearWeaponCargoGlobal _backpackObject;
|
||||
|
@ -13,27 +13,39 @@
|
||||
* Return Value:
|
||||
* None
|
||||
*
|
||||
* Example:
|
||||
* ["ace_map_gestures_enabled", true, false, true] call ace_common_fnc_setSetting
|
||||
*
|
||||
* Public: No
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_name", "_value", ["_force", false], ["_broadcastChanges", false]];
|
||||
|
||||
private ["_settingData", "_failed"];
|
||||
|
||||
_settingData = [_name] call FUNC(getSettingData);
|
||||
private _settingData = [_name] call FUNC(getSettingData);
|
||||
|
||||
// Exit if the setting does not exist
|
||||
if (count _settingData == 0) exitWith {};
|
||||
if (_settingData isEqualTo []) exitWith {
|
||||
ACE_LOGERROR_1("SetSetting [%1] setting does not exist", _name);
|
||||
};
|
||||
|
||||
_settingData params ["", "_typeName", "_isClientSetable", "", "", "", "_isForced"];
|
||||
|
||||
// Exit if the setting is already forced
|
||||
if (_settingData select 6) exitWith {};
|
||||
if (_isForced) exitWith {
|
||||
ACE_LOGINFO_1("SetSetting [%1] Trying to set forced setting", _name);
|
||||
};
|
||||
|
||||
//This does NOT broadcast changes to GVAR(settings), so clients would not get updated force status
|
||||
if ((missionNamespace getVariable [QEGVAR(modules,serverModulesRead), false]) && {!(_isForced isEqualTo _force)}) then {
|
||||
ACE_LOGWARNING_3("SetSetting [%1] attempting to broadcast a change to force (%2 to %3)", _name, _isForced, _force);
|
||||
};
|
||||
|
||||
// If the type is not equal, try to cast it
|
||||
_failed = false;
|
||||
private _failed = false;
|
||||
if (typeName _value != _settingData select 1) then {
|
||||
_failed = true;
|
||||
if (_settingData select 1 == "BOOL" && typeName _value == "SCALAR") then {
|
||||
if ((_typeName == "BOOL") && {typeName _value == "SCALAR"}) then {
|
||||
// If value is not 0 or 1 consider it invalid and don't set anything
|
||||
if (_value isEqualTo 0) then {
|
||||
_value = false;
|
||||
@ -44,12 +56,12 @@ if (typeName _value != _settingData select 1) then {
|
||||
_failed = false;
|
||||
};
|
||||
};
|
||||
if (_settingData select 1 == "COLOR" && typeName _value == "ARRAY") then {
|
||||
if ((_typeName == "COLOR") && {typeName _value == "ARRAY"}) then {
|
||||
_failed = false;
|
||||
};
|
||||
};
|
||||
|
||||
if (_failed) exitWith {};
|
||||
if (_failed) exitWith {ACE_LOGERROR_3("SetSetting [%1] bad data type expected %2 got %3", _name, _typeName, typeName _value);};
|
||||
|
||||
// Force it if it was required
|
||||
_settingData set [6, _force];
|
||||
|
@ -14,13 +14,13 @@
|
||||
|
||||
BEGIN_COUNTER(timePFH);
|
||||
|
||||
local _lastTickTime = ACE_diagTime;
|
||||
local _lastGameTime = ACE_gameTime;
|
||||
private _lastTickTime = ACE_diagTime;
|
||||
private _lastGameTime = ACE_gameTime;
|
||||
|
||||
ACE_gameTime = time;
|
||||
ACE_diagTime = diag_tickTime;
|
||||
|
||||
local _delta = ACE_diagTime - _lastTickTime;
|
||||
private _delta = ACE_diagTime - _lastTickTime;
|
||||
|
||||
if (ACE_gameTime <= _lastGameTime) then {
|
||||
TRACE_1("paused",_delta);
|
||||
|
@ -54,6 +54,7 @@
|
||||
<German>Heben/Senken</German>
|
||||
<Polish>Wyżej/Niżej</Polish>
|
||||
<Portuguese>Levantar/Abaixar</Portuguese>
|
||||
<Russian>Поднять/Опустить</Russian>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
@ -6,6 +6,7 @@ class ACE_ModuleExplosive: ACE_Module {
|
||||
function = QUOTE(FUNC(module));
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
icon = PATHTOF(UI\Icon_Module_Explosives_ca.paa);
|
||||
class Arguments {
|
||||
class RequireSpecialist {
|
||||
|
@ -210,3 +210,11 @@ if(_playSound) then {
|
||||
if(_showHint) then {
|
||||
[format ["%1: %2", localize LSTRING(ZeroedTo), _distance]] call EFUNC(common,displayTextStructured);
|
||||
};
|
||||
|
||||
//Update the hud's distance display to the new value or "----" if out of range
|
||||
//(10m fudge because of EFUNC(common,getTargetDistance))
|
||||
if ((_distance + 10) >= (getNumber (_turretConfig >> QGVAR(MaxDistance)))) then {
|
||||
((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151) ctrlSetText "----";
|
||||
} else {
|
||||
((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151) ctrlSetText ([_distance, 4, 0] call CBA_fnc_formatNumber);
|
||||
};
|
||||
|
@ -1,12 +1 @@
|
||||
#define COMPONENT fcs
|
||||
#include "\z\ace\addons\main\script_mod.hpp"
|
||||
|
||||
#ifdef DEBUG_ENABLED_FCS
|
||||
#define DEBUG_MODE_FULL
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_SETTINGS_FCS
|
||||
#define DEBUG_SETTINGS DEBUG_SETTINGS_FCS
|
||||
#endif
|
||||
|
||||
#include "\z\ace\addons\main\script_macros.hpp"
|
||||
#include "\z\ace\addons\fcs\script_component.hpp"
|
@ -7,6 +7,7 @@ class CfgVehicles {
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_finger_ca.paa));
|
||||
function = QFUNC(moduleSettings);
|
||||
isGlobal = 0;
|
||||
isSingular = 1;
|
||||
author = ECSTRING(common,ACETeam);
|
||||
class Arguments {
|
||||
class enabled {
|
||||
|
@ -95,7 +95,7 @@ GVAR(OldGlasses) = "#NULLSTRING";
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
// check goggles
|
||||
local _fnc_checkGoggles = {
|
||||
private _fnc_checkGoggles = {
|
||||
params ["_unit"];
|
||||
|
||||
if (GVAR(EffectsActive)) then {
|
||||
|
@ -28,7 +28,7 @@ _effects set [DIRT, true];
|
||||
SETGLASSES(_unit,_effects);
|
||||
|
||||
if ([_unit] call FUNC(isGogglesVisible)) then {
|
||||
local _dirtImage = getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_OverlayDirt");
|
||||
private _dirtImage = getText (configFile >> "CfgGlasses" >> goggles _unit >> "ACE_OverlayDirt");
|
||||
|
||||
if (_dirtImage != "") then {
|
||||
GVAR(GogglesEffectsLayer) cutRsc ["RscACE_GogglesEffects", "PLAIN", 0.1, false];
|
||||
|
@ -54,7 +54,7 @@ GVAR(DustHandler) = [{
|
||||
if (ACE_diagTime >= GETDUSTT(DTIME) + 3) then {
|
||||
SETDUST(DAMOUNT,CLAMP(GETDUSTT(DAMOUNT)-1,0,2));
|
||||
|
||||
local _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
|
||||
private _amount = 1 - (GETDUSTT(DAMOUNT) * 0.125);
|
||||
|
||||
if !(_unit getVariable ["ACE_EyesDamaged", false]) then {
|
||||
GVAR(PostProcessEyes) ppEffectAdjust [1, 1, 0, [0, 0, 0, 0], [_amount, _amount, _amount, _amount], [1, 1, 1, 0]];
|
||||
|
@ -27,7 +27,7 @@ _fnc_underCover = {
|
||||
if (vehicle _unit != _unit && {!isTurnedOut _unit}) exitWith {true};
|
||||
|
||||
// looking up and no roof over head
|
||||
local _position = eyePos _unit;
|
||||
private _position = eyePos _unit;
|
||||
positionCameraToWorld [0, 0, 1] select 2 < (positionCameraToWorld [0, 0, 0] select 2) - 0.4 || {(lineIntersects [_position, _position vectorAdd [0, 0, 15], _unit])} // return
|
||||
};
|
||||
|
||||
|
@ -86,7 +86,7 @@ if (_safe) exitWith {};
|
||||
|
||||
// apply rotor wash effect
|
||||
if (_rotorWash select 1 > 0) then {
|
||||
local _scale = 0.7;
|
||||
private _scale = 0.7;
|
||||
|
||||
if (_rotorWash select 1 > 0) then {
|
||||
_scale = CLAMP(0.3 * (_rotorWash select 1),0.1,0.3);
|
||||
|
@ -73,7 +73,7 @@ SETDUST(DTIME,ACE_diagTime);
|
||||
|
||||
// apply dust effect if the amount of fired bullets is over the threshold
|
||||
if (GETDUSTT(DAMOUNT) < 2) then {
|
||||
local _bulletsRequired = 100;
|
||||
private _bulletsRequired = 100;
|
||||
|
||||
if (isNumber (configFile >> _cloudType >> QGVAR(BulletCount))) then {
|
||||
_bulletsRequired = getNumber (configFile >> _cloudType >> QGVAR(BulletCount));
|
||||
|
@ -26,7 +26,9 @@ GVAR(EffectsActive) = false;
|
||||
|
||||
_unit setVariable ["ACE_EyesDamaged", false];
|
||||
|
||||
[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler;
|
||||
if (GVAR(DustHandler) != -1) then {
|
||||
[GVAR(DustHandler)] call CBA_fnc_removePerFrameHandler;
|
||||
};
|
||||
GVAR(DustHandler) = -1;
|
||||
|
||||
true
|
||||
|
@ -17,7 +17,7 @@
|
||||
|
||||
params ["_glasses"];
|
||||
|
||||
local _config = configFile >> "CfgGlasses" >> _glasses;
|
||||
private _config = configFile >> "CfgGlasses" >> _glasses;
|
||||
|
||||
if (!isClass _config) exitWith {false};
|
||||
|
||||
|
@ -21,11 +21,11 @@
|
||||
|
||||
params ["_unit", ["_radius", 15]];
|
||||
|
||||
local _rotorWash = [false, 0];
|
||||
private _rotorWash = [false, 0];
|
||||
|
||||
{
|
||||
if (isEngineOn _x) then {
|
||||
local _distance = _unit distance _x;
|
||||
private _distance = _unit distance _x;
|
||||
|
||||
// convert distance to 0...1 range, where 0 is the maximum radius
|
||||
_distance = 1 - _distance / _radius;
|
||||
|
@ -101,6 +101,7 @@ class CfgVehicles {
|
||||
function = QFUNC(moduleHearing);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
icon = PATHTOF(UI\Icon_Module_Hearing_ca.paa);
|
||||
class Arguments {
|
||||
class EnableCombatDeafness {
|
||||
|
@ -96,4 +96,13 @@ class ACE_Settings {
|
||||
displayName = CSTRING(addBuildingActions);
|
||||
description = CSTRING(addBuildingActionsDescription);
|
||||
};
|
||||
class GVAR(menuAnimationSpeed) {
|
||||
value = 0;
|
||||
typeName = "SCALAR";
|
||||
isClientSettable = 1;
|
||||
category = CSTRING(Category_InteractionMenu);
|
||||
displayName = CSTRING(menuAnimationSpeed);
|
||||
description = CSTRING(menuAnimationSpeed_Description);
|
||||
values[] = {"$str_speed_normal", "2x", "3x"};
|
||||
};
|
||||
};
|
||||
|
@ -78,6 +78,21 @@ if (GVAR(useCursorMenu)) then {
|
||||
GVAR(selfMenuOffset) = ((positionCameraToWorld [0, 0, 2]) call EFUNC(common,positionToASL)) vectorDiff
|
||||
((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL));
|
||||
|
||||
if (GVAR(menuAnimationSpeed) > 0) then {
|
||||
//Auto expand the first level when self, mounted vehicle or zeus (skips the first animation as there is only one choice)
|
||||
if (GVAR(openedMenuType) == 0) then {
|
||||
if (isNull curatorCamera) then {
|
||||
if (vehicle ACE_player != ACE_player) then {
|
||||
GVAR(menuDepthPath) = [["ACE_SelfActions", (vehicle ACE_player)]];
|
||||
};
|
||||
} else {
|
||||
GVAR(menuDepthPath) = [["ACE_ZeusActions", (getAssignedCuratorLogic player)]];
|
||||
};
|
||||
} else {
|
||||
GVAR(menuDepthPath) = [["ACE_SelfActions", ACE_player]];
|
||||
};
|
||||
};
|
||||
|
||||
["interactMenuOpened", [_menuType]] call EFUNC(common,localEvent);
|
||||
|
||||
true
|
||||
|
@ -14,13 +14,12 @@
|
||||
|
||||
BEGIN_COUNTER(fnc_render);
|
||||
|
||||
private ["_cursorPos2", "_p1", "_p2", "_forEachIndex", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i", "_actionData", "_player", "_target"];
|
||||
|
||||
_foundTarget = false;
|
||||
private _foundTarget = false;
|
||||
|
||||
if (GVAR(openedMenuType) >= 0) then {
|
||||
// _cursorPos1 = positionCameraToWorld [0, 0, 2];
|
||||
_cursorPos2 = positionCameraToWorld [0, 0, 2];
|
||||
BEGIN_COUNTER(fnc_renderMenuOpen);
|
||||
|
||||
private _cursorPos2 = positionCameraToWorld [0, 0, 2];
|
||||
|
||||
// Render all available nearby interactions
|
||||
call FUNC(renderActionPoints);
|
||||
@ -30,27 +29,26 @@ if (GVAR(openedMenuType) >= 0) then {
|
||||
[[0.5,0.5], "\a3\ui_f\data\IGUI\Cfg\Cursors\selected_ca.paa"] call FUNC(renderSelector);
|
||||
};
|
||||
|
||||
_cursorScreenPos = [worldToScreen _cursorPos2, GVAR(cursorPos)] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]);
|
||||
private _cursorScreenPos = [worldToScreen _cursorPos2, GVAR(cursorPos)] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]);
|
||||
|
||||
_closestDistance = 1000000;
|
||||
_closestSelection = -1;
|
||||
private _closestDistance = 1000000;
|
||||
private _closestSelection = -1;
|
||||
{
|
||||
_sPos = _x select 1;
|
||||
_disSq = (((_cursorScreenPos select 0) - (_sPos select 0))^2 + ((_cursorScreenPos select 1) - (_sPos select 1))^2);
|
||||
if(_disSq < 0.0125 && _disSq < _closestDistance) then {
|
||||
_closestDistance = _disSq;
|
||||
_x params ["", "_sPos"];
|
||||
private _distanceFromCursor = _cursorScreenPos distance2d _sPos;
|
||||
if ((_distanceFromCursor < 0.1118) && {_distanceFromCursor < _closestDistance}) then {
|
||||
_closestDistance = _distanceFromCursor;
|
||||
_closestSelection = _forEachIndex;
|
||||
};
|
||||
} forEach GVAR(currentOptions);
|
||||
|
||||
|
||||
if(_closestSelection == -1) exitWith {};
|
||||
|
||||
_closest = GVAR(currentOptions) select _closestSelection;
|
||||
private _closest = GVAR(currentOptions) select _closestSelection;
|
||||
_closest params ["_action", "_sPos", "_hoverPath"];
|
||||
|
||||
_sPos = _closest select 1;
|
||||
_cTime = ACE_diagTime;
|
||||
_delta = _cTime - GVAR(lastTime);
|
||||
private _cTime = ACE_diagTime;
|
||||
private _delta = _cTime - GVAR(lastTime);
|
||||
GVAR(lastTime) = _cTime;
|
||||
|
||||
GVAR(rotationAngle) = (GVAR(rotationAngle) + (270*_delta)) mod 360;
|
||||
@ -58,28 +56,17 @@ if (GVAR(openedMenuType) >= 0) then {
|
||||
|
||||
_foundTarget = true;
|
||||
GVAR(actionSelected) = true;
|
||||
GVAR(selectedAction) = (_closest select 0) select 1;
|
||||
GVAR(selectedAction) = _action select 1;
|
||||
GVAR(selectedTarget) = (GVAR(selectedAction)) select 2;
|
||||
|
||||
_misMatch = false;
|
||||
_hoverPath = (_closest select 2);
|
||||
private _misMatch = !(GVAR(lastPath) isEqualTo _hoverPath);
|
||||
|
||||
if((count GVAR(lastPath)) != (count _hoverPath)) then {
|
||||
_misMatch = true;
|
||||
} else {
|
||||
{
|
||||
if !(_x isEqualTo (_hoverPath select _forEachIndex)) exitWith {
|
||||
_misMatch = true;
|
||||
};
|
||||
} forEach GVAR(lastPath);
|
||||
};
|
||||
|
||||
if(_misMatch && {ACE_diagTime-GVAR(expandedTime) > 0.25}) then {
|
||||
if(_misMatch && {ACE_diagTime-GVAR(expandedTime) > linearConversion [0, 2, GVAR(menuAnimationSpeed), 0.25, 0.08333333]}) then {
|
||||
GVAR(startHoverTime) = ACE_diagTime;
|
||||
GVAR(lastPath) = _hoverPath;
|
||||
GVAR(expanded) = false;
|
||||
} else {
|
||||
if(!GVAR(expanded) && ACE_diagTime-GVAR(startHoverTime) > 0.25) then {
|
||||
if(!GVAR(expanded) && {ACE_diagTime-GVAR(startHoverTime) > linearConversion [0, 2, GVAR(menuAnimationSpeed), 0.25, 0.08333333]}) then {
|
||||
GVAR(expanded) = true;
|
||||
|
||||
// Start the expanding menu animation only if the user is not going up the menu
|
||||
@ -89,9 +76,8 @@ if (GVAR(openedMenuType) >= 0) then {
|
||||
GVAR(menuDepthPath) = +GVAR(lastPath);
|
||||
|
||||
// Execute the current action if it's run on hover
|
||||
private "_runOnHover";
|
||||
_tmp = ((GVAR(selectedAction) select 0) select 9) select 3;
|
||||
_runOnHover = true;
|
||||
private _tmp = ((GVAR(selectedAction) select 0) select 9) select 3;
|
||||
private _runOnHover = true;
|
||||
if ((typeName _tmp) == "CODE" ) then {
|
||||
_runOnHover = call _tmp;
|
||||
} else {
|
||||
@ -103,14 +89,14 @@ if (GVAR(openedMenuType) >= 0) then {
|
||||
};
|
||||
if (_runOnHover) then {
|
||||
this = GVAR(selectedTarget);
|
||||
_player = ACE_Player;
|
||||
_target = GVAR(selectedTarget);
|
||||
private _player = ACE_Player;
|
||||
private _target = GVAR(selectedTarget);
|
||||
|
||||
// Clear the conditions caches
|
||||
["clearConditionCaches", []] call EFUNC(common,localEvent);
|
||||
|
||||
// Check the action conditions
|
||||
_actionData = GVAR(selectedAction) select 0;
|
||||
private _actionData = GVAR(selectedAction) select 0;
|
||||
if ([_target, _player, _actionData select 6] call (_actionData select 4)) then {
|
||||
// Call the statement
|
||||
[_target, _player, _actionData select 6] call (_actionData select 3);
|
||||
@ -121,6 +107,7 @@ if (GVAR(openedMenuType) >= 0) then {
|
||||
};
|
||||
};
|
||||
};
|
||||
END_COUNTER(fnc_renderMenuOpen);
|
||||
};
|
||||
|
||||
if(!_foundTarget && GVAR(actionSelected)) then {
|
||||
|
@ -101,9 +101,9 @@ if (GVAR(UseListMenu)) then {
|
||||
};
|
||||
|
||||
// Animate menu scale
|
||||
if (_menuInSelectedPath && (_menuDepth == count _path)) then {
|
||||
_scaleX = _scaleX * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * 8) min 1));
|
||||
_scaleY = _scaleY * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * 8) min 1));
|
||||
if (_menuInSelectedPath && {_menuDepth == count _path}) then {
|
||||
_scaleX = _scaleX * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * linearConversion [0, 2, GVAR(menuAnimationSpeed), 8, 16]) min 1));
|
||||
_scaleY = _scaleY * (0.3 + 0.7 * (((ACE_diagTime - GVAR(expandedTime)) * linearConversion [0, 2, GVAR(menuAnimationSpeed), 8, 16]) min 1));
|
||||
};
|
||||
|
||||
_target = _actionObject;
|
||||
|
@ -299,5 +299,11 @@
|
||||
<Czech>Menu interakce</Czech>
|
||||
<Spanish>Menú de interacción</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Interact_Menu_menuAnimationSpeed">
|
||||
<English>Interaction Animation Speed</English>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Interact_Menu_menuAnimationSpeed_Description">
|
||||
<English>Makes menu animations faster and decreases the time needed to hover to show sub actions</English>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
|
@ -199,47 +199,47 @@ class ACE_ZeusActions {
|
||||
class wedge {
|
||||
displayName = "$STR_Wedge";
|
||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\wedge_ca.paa";
|
||||
statement = "{_x setWaypointFormation 'WEDGE';} forEach (curatorSelected select 1);";
|
||||
statement = "{_x setWaypointFormation 'WEDGE';} forEach (curatorSelected select 2);";
|
||||
};
|
||||
class vee {
|
||||
displayName = "$STR_Vee";
|
||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\vee_ca.paa";
|
||||
statement = "{_x setWaypointFormation 'VEE';} forEach (curatorSelected select 1);";
|
||||
statement = "{_x setWaypointFormation 'VEE';} forEach (curatorSelected select 2);";
|
||||
};
|
||||
class line {
|
||||
displayName = "$STR_Line";
|
||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\line_ca.paa";
|
||||
statement = "{_x setWaypointFormation 'LINE';} forEach (curatorSelected select 1);";
|
||||
statement = "{_x setWaypointFormation 'LINE';} forEach (curatorSelected select 2);";
|
||||
};
|
||||
class column {
|
||||
displayName = "$STR_Column";
|
||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\column_ca.paa";
|
||||
statement = "{_x setWaypointFormation 'COLUMN';} forEach (curatorSelected select 1);";
|
||||
statement = "{_x setWaypointFormation 'COLUMN';} forEach (curatorSelected select 2);";
|
||||
};
|
||||
class file {
|
||||
displayName = "$STR_File";
|
||||
icon = "\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\file_ca.paa";
|
||||
statement = "{_x setWaypointFormation 'FILE';} forEach (curatorSelected select 1);";
|
||||
statement = "{_x setWaypointFormation 'FILE';} forEach (curatorSelected select 2);";
|
||||
};
|
||||
class stag_column {
|
||||
displayName = "$STR_Staggered";
|
||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\stag_column_ca.paa";
|
||||
statement = "{_x setWaypointFormation 'STAG COLUMN';} forEach (curatorSelected select 1);";
|
||||
statement = "{_x setWaypointFormation 'STAG COLUMN';} forEach (curatorSelected select 2);";
|
||||
};
|
||||
class ech_left {
|
||||
displayName = "$STR_EchL";
|
||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_left_ca.paa";
|
||||
statement = "{_x setWaypointFormation 'ECH LEFT';} forEach (curatorSelected select 1);";
|
||||
statement = "{_x setWaypointFormation 'ECH LEFT';} forEach (curatorSelected select 2);";
|
||||
};
|
||||
class ech_right {
|
||||
displayName = "$STR_EchR";
|
||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\ech_right_ca.paa";
|
||||
statement = "{_x setWaypointFormation 'ECH RIGHT';} forEach (curatorSelected select 1);";
|
||||
statement = "{_x setWaypointFormation 'ECH RIGHT';} forEach (curatorSelected select 2);";
|
||||
};
|
||||
class diamond {
|
||||
displayName = "$STR_Diamond";
|
||||
icon="\A3\UI_F_Curator\Data\RscCommon\RscAttributeFormation\diamond_ca.paa";
|
||||
statement = "{_x setWaypointFormation 'DIAMOND';} forEach (curatorSelected select 1);";
|
||||
statement = "{_x setWaypointFormation 'DIAMOND';} forEach (curatorSelected select 2);";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -8,6 +8,7 @@ class CfgVehicles {
|
||||
function = "ACE_Interaction_fnc_moduleInteraction";
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa);
|
||||
|
||||
class Arguments {
|
||||
|
@ -29,7 +29,7 @@ GVAR(isOpeningDoor) = false;
|
||||
|
||||
if (_unit == ACE_player) then {
|
||||
addCamShake [4, 0.5, 5];
|
||||
local _message = parseText format ([["%1 >", localize LSTRING(YouWereTappedRight)], ["< %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0));
|
||||
private _message = parseText format ([["%1 >", localize LSTRING(YouWereTappedRight)], ["< %1", localize LSTRING(YouWereTappedLeft)]] select (_shoulderNum == 0));
|
||||
[_message] call FUNC(displayTextStructured);
|
||||
};
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
@ -19,9 +19,9 @@
|
||||
params ["_object"];
|
||||
TRACE_1("params",_object);
|
||||
|
||||
local _typeOf = typeOf _object;
|
||||
private _typeOf = typeOf _object;
|
||||
|
||||
local _returnValue = if (_typeOf != "") then {
|
||||
private _returnValue = if (_typeOf != "") then {
|
||||
//If the fence has configEntry we can check it directly
|
||||
(1 == (getNumber (configFile >> "CfgVehicles" >> _typeOf >> QGVAR(isFence))));
|
||||
} else {
|
||||
|
@ -23,6 +23,7 @@ class CfgVehicles {
|
||||
function = QFUNC(moduleMap);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
icon = PATHTOF(UI\Icon_Module_Map_ca.paa);
|
||||
class Arguments {
|
||||
class MapIllumination {
|
||||
@ -82,6 +83,7 @@ class CfgVehicles {
|
||||
function = QFUNC(blueForceTrackingModule);
|
||||
scope = 2;
|
||||
isGlobal = 0;
|
||||
isSingular = 1;
|
||||
icon = PATHTOF(UI\Icon_Module_BFTracking_ca.paa);
|
||||
class Arguments {
|
||||
class Enabled {
|
||||
|
@ -284,11 +284,13 @@
|
||||
<English>Set Channel At Start</English>
|
||||
<Polish>Ust. domyślny kanał</Polish>
|
||||
<Portuguese>Definir canal no início</Portuguese>
|
||||
<Russian>Установить канал на старте</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Map_DefaultChannel_Description">
|
||||
<English>Change the starting marker channel at mission start</English>
|
||||
<Polish>Ustaw domyślny kanał dla markerów przy starcie misji</Polish>
|
||||
<Portuguese>Muda o canal do marcador no início da missão</Portuguese>
|
||||
<Russian>Изменить начальный канал для установки маркеров при запуске миссии</Russian>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
@ -6,11 +6,13 @@ class CfgVehicles {
|
||||
displayName = CSTRING(moduleSettings_displayName);
|
||||
function = QFUNC(moduleSettings);
|
||||
isGlobal = 0;
|
||||
isSingular = 1;
|
||||
author = ECSTRING(common,ACETeam);
|
||||
icon = PATHTOF(ui\icon_module_map_gestures_ca.paa);
|
||||
class Arguments {
|
||||
class enabled {
|
||||
displayName = CSTRING(enabled_DisplayName);
|
||||
description = CSTRING(enabled_description);
|
||||
typeName = "BOOL";
|
||||
defaultValue = 1;
|
||||
};
|
||||
@ -18,7 +20,7 @@ class CfgVehicles {
|
||||
displayName = CSTRING(maxRange_displayName);
|
||||
description = CSTRING(maxRange_description);
|
||||
typeName = "NUMBER";
|
||||
defaultValue = 4;
|
||||
defaultValue = 7;
|
||||
};
|
||||
class interval {
|
||||
displayName = CSTRING(interval_displayName);
|
||||
@ -30,13 +32,13 @@ class CfgVehicles {
|
||||
displayName = CSTRING(defaultLeadColor_displayName);
|
||||
description = CSTRING(defaultLeadColor_description);
|
||||
typeName = "STRING";
|
||||
defaultValue = "0,0,0,0";
|
||||
defaultValue = "1,0.88,0,0.95";
|
||||
};
|
||||
class defaultColor {
|
||||
displayName = CSTRING(defaultColor_displayName);
|
||||
description = CSTRING(defaultColor_description);
|
||||
typeName = "STRING";
|
||||
defaultValue = "0,0,0,0";
|
||||
defaultValue = "1,0.88,0,0.7";
|
||||
};
|
||||
};
|
||||
};
|
||||
@ -53,13 +55,13 @@ class CfgVehicles {
|
||||
displayName = CSTRING(leadColor_displayName);
|
||||
description = CSTRING(leadColor_description);
|
||||
typeName = "STRING";
|
||||
defaultValue = "0,0,0,0";
|
||||
defaultValue = "1,0.88,0,0.95";
|
||||
};
|
||||
class color {
|
||||
displayName = CSTRING(color_displayName);
|
||||
description = CSTRING(color_description);
|
||||
typeName = "STRING";
|
||||
defaultValue = "0,0,0,0";
|
||||
defaultValue = "1,0.88,0,0.7";
|
||||
};
|
||||
};
|
||||
};
|
||||
|
@ -1,8 +1,13 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
if (["STMapGestures"] call EFUNC(common,isModLoaded)) exitWith {
|
||||
ACE_LOGWARNING("st_map_gestures is installed - exiting [remove st_map_gestures.pbo to allow ace version]");
|
||||
};
|
||||
|
||||
if (!hasInterface) exitWith {};
|
||||
|
||||
["SettingsInitialized", {
|
||||
if (!GVAR(enabled)) exitWith {};
|
||||
[{
|
||||
if (isNull (findDisplay 12)) exitWith {};
|
||||
|
||||
|
@ -17,8 +17,6 @@
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_defaultColor", "_defaultLeadColor"];
|
||||
|
||||
params ["_logic", "", "_activated"];
|
||||
|
||||
if (!_activated || !isServer) exitWith {};
|
||||
@ -27,11 +25,19 @@ if (!_activated || !isServer) exitWith {};
|
||||
[_logic, QGVAR(maxRange), "maxRange"] call EFUNC(common,readSettingFromModule);
|
||||
[_logic, QGVAR(interval), "interval"] call EFUNC(common,readSettingFromModule);
|
||||
|
||||
_defaultLeadColor = call compile ("[" + (_logic getVariable ["defaultLeadColor", ""]) + "]");
|
||||
if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultLeadColor is not a valid color array.")};
|
||||
//For default fallback colors, setting to empty ("") will not force on clients
|
||||
private _defaultLeadColor = _logic getVariable ["defaultLeadColor", ""];
|
||||
if (_defaultLeadColor != "") then {
|
||||
_defaultLeadColor = call compile ("[" + _defaultLeadColor + "]");
|
||||
if (!([_defaultLeadColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultLeadColor is not a valid color array.")};
|
||||
[QGVAR(defaultLeadColor), _defaultLeadColor, true, true] call EFUNC(common,setSetting);
|
||||
};
|
||||
|
||||
_defaultColor = call compile ("[" + (_logic getVariable ["defaultColor", ""]) + "]");
|
||||
if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")};
|
||||
private _defaultColor = _logic getVariable ["defaultColor", ""];
|
||||
if (_defaultColor != "") then {
|
||||
_defaultColor = call compile ("[" + _defaultColor + "]");
|
||||
if (!([_defaultColor] call FUNC(isValidColorArray))) exitWith {ERROR("defaultColor is not a valid color array.")};
|
||||
[QGVAR(defaultColor), _defaultColor, true, true] call EFUNC(common,setSetting);
|
||||
};
|
||||
|
||||
[QGVAR(defaultLeadColor), _defaultLeadColor, false, true] call EFUNC(common,setSetting);
|
||||
[QGVAR(defaultColor), _defaultColor, false, true] call EFUNC(common,setSetting);
|
||||
ACE_LOGINFO("Map Gestures Module Initialized.");
|
||||
|
@ -4,126 +4,117 @@
|
||||
<Key ID="STR_ACE_map_gestures_moduleSettings_displayName">
|
||||
<English>Map Gestures</English>
|
||||
<Portuguese>Gestos no mapa</Portuguese>
|
||||
<Russian>Жесты на карте</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_enabled_displayName">
|
||||
<English>Enabled</English>
|
||||
<Portuguese>Ativado</Portuguese>
|
||||
<Russian>Включено</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_maxRange_displayName">
|
||||
<English>Map Gesture Max Range</English>
|
||||
<Portuguese>Distância para gestos no mapa</Portuguese>
|
||||
<Russian>Макс. дистанция жестов на карте</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_maxRange_description">
|
||||
<English>Max range between players to show the map gesture indicator [default: 7 meters]</English>
|
||||
<Portuguese>Distância max. entre os jogadores para mostrar o indicador de gesto no mapa [padrão: 7 metros]</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_defaultLeadAlpha_displayName">
|
||||
<English>Lead Default Alpha</English>
|
||||
<Portuguese>Transparência padrão do líder</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_defaultLeadAlpha_description">
|
||||
<English>Fallback Alpha value for group leaders.</English>
|
||||
<Portuguese>Valor de transparência alternativo para líderes de grupo</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_defaultAlpha_displayName">
|
||||
<English>Default Alpha</English>
|
||||
<Portuguese>Transparência padrão</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_defaultAlpha_descriptions">
|
||||
<English>Fallback Alpha value.</English>
|
||||
<Portuguese>Valor alternativo de transparência</Portuguese>
|
||||
<Russian>Макс. дистанция между игроками для отображения жестов на карте [по-умолчанию: 7 метров]</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_defaultLeadColor_displayName">
|
||||
<English>Lead Default Color</English>
|
||||
<Portuguese>Cor padrão para o líder</Portuguese>
|
||||
<Russian>Лид. цвет по-умолчанию</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_defaultLeadColor_description">
|
||||
<English>Fallback Color value for group leaders.</English>
|
||||
<English>Fallback Color value for group leaders when there is no group setting. [Module: leave blank to not force on clients]</English>
|
||||
<Portuguese>Valor de cor alternativa para líderes de grupo</Portuguese>
|
||||
<Russian>Значение цвета для лидеров групп.</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_defaultColor_displayName">
|
||||
<English>Default Color</English>
|
||||
<Portuguese>Cor padrão</Portuguese>
|
||||
<Russian>Цвет по-умолчанию</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_defaultColor_description">
|
||||
<English>Fallback Color value.</English>
|
||||
<English>Fallback Color value when there is no group setting. [Module: leave blank to not force on clients]</English>
|
||||
<Portuguese>Valor alternativo de cor</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_leadAlpha_displayName">
|
||||
<English>Lead Alpha</English>
|
||||
<Portuguese>Transparência do líder</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_leadAlpha_description">
|
||||
<English>Alpha value for group leaders of groups synced with this module.</English>
|
||||
<Portuguese>Valor de transparência para líderes de grupo sincronizados com este módulo.</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_alpha_displayName">
|
||||
<English>Alpha</English>
|
||||
<Portuguese>Transparência</Portuguese>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_alpha_description">
|
||||
<English>Alpha value for group members of groups synced with this module.</English>
|
||||
<Portuguese>Valor de transparência para membros de grupo sincronizados com este módulo.</Portuguese>
|
||||
<Russian>Значение цвета.</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_leadColor_displayName">
|
||||
<English>Lead Color</English>
|
||||
<Portuguese>Cor do líder</Portuguese>
|
||||
<Russian>Лид. цвет</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_leadColor_description">
|
||||
<English>Color value for group leaders of groups synced with this module.</English>
|
||||
<Portuguese>Valor de cor para líderes de grupo sincronizados com este módulo.</Portuguese>
|
||||
<Russian>Значение цвета для лидеров групп, которые [группы] синхронизированы с этим модулем.</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_color_displayName">
|
||||
<English>Color</English>
|
||||
<Portuguese>Cor</Portuguese>
|
||||
<Russian>Цвет</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_color_description">
|
||||
<English>Color value for group members of groups synced with this module.</English>
|
||||
<Portuguese>Valor de cor para membros de grupo sincronizados com este módulo.</Portuguese>
|
||||
<Russian>Значение цвета для членов групп, которые [группы] синхронизированы с этим модулем.</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_moduleGroupSettings_displayName">
|
||||
<English>Map Gestures - Group Settings</English>
|
||||
<Portuguese>Gestos no mapa - Definições de Grupo</Portuguese>
|
||||
<Russian>Жесты на карте - настройки групп</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_interval_displayName">
|
||||
<English>Update Interval</English>
|
||||
<Portuguese>Intervalo de atualizações</Portuguese>
|
||||
<Russian>Интервал обновления</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_interval_description">
|
||||
<English>Time between data updates.</English>
|
||||
<Portuguese>Tempo entre atualização de dados</Portuguese>
|
||||
<Russian>Время между обновлениями данных.</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_GroupColorConfigurations_displayName">
|
||||
<English>Group color configurations</English>
|
||||
<Portuguese>Configurações de cores de grupo</Portuguese>
|
||||
<Russian>Конфигурация цвета групп</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_GroupColorConfigurations_description">
|
||||
<English>Group color configuration containing arrays of color pairs ([leadColor, color]).</English>
|
||||
<Portuguese>Configuração de cores de grupo contendo arrays com pares de cores ([leadColor, color]).</Portuguese>
|
||||
<Russian>Конфигурация цвета групп содержит массив цветовых пар ([лид. цвет, цвет]).</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_GroupColorConfigurationMapping_description">
|
||||
<English>Hash of Group ID mapped to the Group color configuration index.</English>
|
||||
<Portuguese>Hashes de ID de grupos mapeados para o índice de configuração de cor de grupos.</Portuguese>
|
||||
<Russian>Хеш ID групп, соответствующих индексам конфигурации цвета групп.</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_GroupColorConfigurationMapping_displayName">
|
||||
<English>GroupID Color configuration mapping</English>
|
||||
<Portuguese>Mapeamento de configuração para cores de GroupID</Portuguese>
|
||||
<Russian>Соответствие ID групп конфигурации цвета групп</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_enabled_description">
|
||||
<English>Enables the Map Gestures.</English>
|
||||
<Portuguese>Ativa os gestos no mapa</Portuguese>
|
||||
<Russian>Включает указания на карте.</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_nameTextColor_displayName">
|
||||
<English>Name Text Color</English>
|
||||
<Portuguese>Cor do texto do nome</Portuguese>
|
||||
<Russian>Цвет текста имени</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_nameTextColor_description">
|
||||
<English>Color of the name tag text besides the map gestures mark.</English>
|
||||
<Portuguese>Cor do texto da etiqueta de nome que fica embaixo da marcação de gestos no mapa.</Portuguese>
|
||||
<Russian>Цвет инмени игрока рядом с маркером жестов.</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_map_gestures_mapGestures_category">
|
||||
<English>Map Gestures</English>
|
||||
<Portuguese>Gestos no mapa</Portuguese>
|
||||
<Russian>Жесты на карте</Russian>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
</Project>
|
||||
|
@ -17,6 +17,7 @@ class CfgVehicles {
|
||||
function = QUOTE(DFUNC(moduleMedicalSettings));
|
||||
functionPriority = 1;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
isTriggerActivated = 0;
|
||||
author = ECSTRING(common,ACETeam);
|
||||
|
||||
@ -153,6 +154,7 @@ class CfgVehicles {
|
||||
function = QUOTE(FUNC(moduleAdvancedMedicalSettings));
|
||||
functionPriority = 10;
|
||||
isGlobal = 2;
|
||||
isSingular = 1;
|
||||
isTriggerActivated = 0;
|
||||
isDisposable = 0;
|
||||
author = ECSTRING(common,ACETeam);
|
||||
@ -274,6 +276,7 @@ class CfgVehicles {
|
||||
function = QUOTE(DFUNC(moduleReviveSettings));
|
||||
functionPriority = 1;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
isTriggerActivated = 0;
|
||||
author = ECSTRING(common,ACETeam);
|
||||
|
||||
|
@ -47,7 +47,7 @@ if (_selection in R_LEG_SELECTIONS) exitwith {"leg_r"};*/
|
||||
//Backup method to detect weird selections/hitpoints
|
||||
if ((_selection == "?") || {!(_selection in GVAR(SELECTIONS))}) exitWith {
|
||||
if (_hitPointIndex < 0) exitWith {_selection};
|
||||
local _hitPoint = toLower configName ((configProperties [(configFile >> "CfgVehicles" >> (typeOf _unit) >> "HitPoints")]) select _hitPointIndex);
|
||||
private _hitPoint = toLower configName ((configProperties [(configFile >> "CfgVehicles" >> (typeOf _unit) >> "HitPoints")]) select _hitPointIndex);
|
||||
TRACE_4("Weird sel/hit", _unit, _selection, _hitPointIndex, _hitPoint);
|
||||
|
||||
if (_hitPoint in HEAD_HITPOINTS) exitWith {"head"};
|
||||
|
@ -19,6 +19,9 @@
|
||||
#include "script_component.hpp"
|
||||
params ["_caller", "_target", "_selectionName", "_className", "_items", "", ["_specificSpot", -1]];
|
||||
|
||||
[_target, "activity", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);
|
||||
[_target, "activity_view", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
|
||||
|
||||
if !([_target] call FUNC(hasMedicalEnabled)) exitwith {
|
||||
_this call FUNC(treatmentBasic_bandage);
|
||||
};
|
||||
@ -30,7 +33,4 @@ if !([_target] call FUNC(hasMedicalEnabled)) exitwith {
|
||||
};
|
||||
}foreach _items;*/
|
||||
|
||||
[_target, "activity", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);
|
||||
[_target, "activity_view", LSTRING(Activity_bandagedPatient), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
|
||||
|
||||
true;
|
||||
|
@ -2111,6 +2111,7 @@
|
||||
<English>%1 used Personal Aid Kit</English>
|
||||
<Polish>%1 użył apteczki</Polish>
|
||||
<Portuguese>%1 utilizou KPS</Portuguese>
|
||||
<Russian>%1 использовал аптечку</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_HeavilyWounded">
|
||||
<English>Heavily wounded</English>
|
||||
@ -2963,7 +2964,7 @@
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Medical_MedicalSettings_enableUnconsciousnessAI_Description">
|
||||
<English>Allow AI to go unconscious</English>
|
||||
<Russian>Позволить ботам терять сознание</Russian>
|
||||
<Russian>Позволить ботам терять сознание (вместо мгновенной смерти)</Russian>
|
||||
<Polish>Czy AI może być nieprzytomne od odniesionych obrażeń?</Polish>
|
||||
<Spanish>Permita a la IA caer inconsciente</Spanish>
|
||||
<German>KI kann bewusstlos werden</German>
|
||||
|
@ -10,6 +10,7 @@ class CfgVehicles {
|
||||
function = QUOTE(DFUNC(module));
|
||||
functionPriority = 1;
|
||||
isGlobal = 0;
|
||||
isSingular = 1;
|
||||
isTriggerActivated = 0;
|
||||
author = ECSTRING(common,ACETeam);
|
||||
class Arguments {
|
||||
|
@ -19,7 +19,7 @@ GVAR(pendingReopen) = false;
|
||||
|
||||
["ACE3 Common", QGVAR(displayMenuKeyPressed), localize LSTRING(DisplayMenuKey),
|
||||
{
|
||||
local _target = cursorTarget;
|
||||
private _target = cursorTarget;
|
||||
if (!((_target isKindOf "CAManBase") && {[ACE_player, _target] call FUNC(canOpenMenu)})) then {_target = ACE_player};
|
||||
|
||||
// Conditions: canInteract
|
||||
|
@ -20,7 +20,7 @@
|
||||
params ["_selectionBloodLoss", "_damaged", "_display"];
|
||||
|
||||
// Handle the body image coloring
|
||||
local _availableSelections = [50, 51, 52, 53, 54, 55];
|
||||
private _availableSelections = [50, 51, 52, 53, 54, 55];
|
||||
{
|
||||
private ["_red", "_green", "_blue"];
|
||||
|
||||
|
@ -38,6 +38,7 @@ class CfgVehicles {
|
||||
function = QFUNC(moduleMapFill);
|
||||
scope = 2;
|
||||
isGlobal = 0;
|
||||
isSingular = 1;
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_microDAGR_ca.paa));
|
||||
functionPriority = 0;
|
||||
class Arguments {
|
||||
|
@ -18,10 +18,8 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
private ["_logic", "_units", "_activated","_ambianceSounds", "_soundFiles", "_minimalDistance","_maximalDistance", "_minimalDistance", "_maxDelayBetweenSounds", "_allUnits", "_newPos", "_targetUnit", "_soundToPlay", "_soundPath", "_unparsedSounds", "_list", "_splittedList", "_nilCheckPassedList"];
|
||||
_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param;
|
||||
_units = [_this,1,[],[[]]] call BIS_fnc_param;
|
||||
_activated = [_this,2,true,[true]] call BIS_fnc_param;
|
||||
private ["_ambianceSounds", "_minimalDistance","_maximalDistance", "_minimalDistance", "_maxDelayBetweenSounds", "_missionRoot", "_unparsedSounds", "_splittedList", "_soundPath"];
|
||||
params ["_logic", "_units", "_activated"];
|
||||
|
||||
// We only play this on the locality of the logic, since the sounds are broadcasted across the network
|
||||
if (_activated && local _logic) then {
|
||||
@ -34,51 +32,49 @@ if (_activated && local _logic) then {
|
||||
_volume = (_logic getVariable ["soundVolume", 30]) max 1;
|
||||
_followPlayers = _logic getVariable ["followPlayers", false];
|
||||
|
||||
_splittedList = [_unparsedSounds, ","] call BIS_fnc_splitString;
|
||||
_splittedList = _unparsedSounds splitString ",";
|
||||
_missionRoot = str missionConfigFile select [0, count str missionConfigFile - 15];
|
||||
|
||||
_nilCheckPassedList = "";
|
||||
{
|
||||
_x = [_x] call EFUNC(common,stringRemoveWhiteSpace);
|
||||
_splittedList set [_forEachIndex, _x];
|
||||
}forEach _splittedList;
|
||||
|
||||
_soundPath = [(str missionConfigFile), 0, -15] call BIS_fnc_trimString;
|
||||
{
|
||||
if (isClass (missionConfigFile >> "CfgSounds" >> _x)) then {
|
||||
_ambianceSounds pushBack (_soundPath + (getArray(missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0));
|
||||
// CfgSounds accepts a leading backslash, but a double backslash
|
||||
// is not accepted in the path, so we have to filter that.
|
||||
_soundPath = getArray (missionConfigFile >> "CfgSounds" >> _x >> "sound") select 0;
|
||||
if (_soundPath select [0,1] == "\") then {
|
||||
_ambianceSounds pushBack (_missionRoot + (_soundPath select [1]));
|
||||
} else {
|
||||
_ambianceSounds pushBack (_missionRoot + _soundPath);
|
||||
};
|
||||
} else {
|
||||
if (isClass (configFile >> "CfgSounds" >> _x)) then {
|
||||
_ambianceSounds pushBack ((getArray(configFile >> "CfgSounds" >> _x >> "sound") select 0));
|
||||
} else {
|
||||
ACE_LOGERROR_1("Ambient Sounds: Sound ""%1"" not found.",_x);
|
||||
};
|
||||
};
|
||||
}forEach _splittedList;
|
||||
|
||||
false
|
||||
} count _splittedList;
|
||||
|
||||
if (count _ambianceSounds == 0) exitWith {};
|
||||
{
|
||||
if !([".", _x, true] call BIS_fnc_inString) then {
|
||||
if ((_x find ".") == -1) then {
|
||||
_ambianceSounds set [_forEachIndex, _x + ".wss"];
|
||||
};
|
||||
}forEach _ambianceSounds;
|
||||
} forEach _ambianceSounds;
|
||||
|
||||
[{
|
||||
private ["_args", "_logic", "_ambianceSounds", "_minimalDistance", "_maximalDistance", "_minDelayBetweensounds", "_maxDelayBetweenSounds", "_volume", "_followPlayers","_lastTimePlayed", "_newPos"];
|
||||
_args = _this select 0;
|
||||
_logic = _args select 0;
|
||||
_minDelayBetweensounds = _args select 4;
|
||||
_maxDelayBetweenSounds = _args select 5;
|
||||
_lastTimePlayed = _args select 8;
|
||||
private ["_newPos", "_allUnits", "_targetUnit"];
|
||||
params ["_args", "_pfhHandle"];
|
||||
_args params ["_logic", "_ambianceSounds", "_minimalDistance", "_maximalDistance", "_minDelayBetweensounds", "_maxDelayBetweenSounds", "_volume", "_followPlayers", "_lastTimePlayed"];
|
||||
|
||||
if (!alive _logic) exitWith {
|
||||
[(_this select 1)] call cba_fnc_removePerFrameHandler;
|
||||
[_pfhHandle] call cba_fnc_removePerFrameHandler;
|
||||
};
|
||||
|
||||
if (ACE_time - _lastTimePlayed >= ((_minDelayBetweensounds + random(_maxDelayBetweenSounds)) min _maxDelayBetweenSounds)) then {
|
||||
_ambianceSounds = _args select 1;
|
||||
_minimalDistance = _args select 2;
|
||||
_maximalDistance = _args select 3;
|
||||
|
||||
_volume = _args select 6;
|
||||
_followPlayers = _args select 7;
|
||||
|
||||
// Find all players in session.
|
||||
_allUnits = if (isMultiplayer) then {playableUnits} else {[ACE_player]};
|
||||
@ -87,7 +83,7 @@ if (_activated && local _logic) then {
|
||||
if (count _allUnits > 0) then {
|
||||
|
||||
// Select a target unit at random.
|
||||
_targetUnit = _allUnits select (round(random((count _allUnits)-1)));
|
||||
_targetUnit = _allUnits call BIS_fnc_selectRandom;
|
||||
|
||||
// find the position from which we are going to play this sound from.
|
||||
_newPos = (getPos _targetUnit);
|
||||
@ -112,7 +108,7 @@ if (_activated && local _logic) then {
|
||||
|
||||
// If no unit is to close to this position, we will play the sound.
|
||||
if ({(_newPos distance _x < (_minimalDistance / 2))}count _allUnits == 0) then {
|
||||
playSound3D [_ambianceSounds select (round(random((count _ambianceSounds)-1))), ObjNull, false, _newPos, _volume, 1, 1000];
|
||||
playSound3D [_ambianceSounds call BIS_fnc_selectRandom, objNull, false, _newPos, _volume, 1, 1000];
|
||||
_args set [8, ACE_time];
|
||||
};
|
||||
};
|
||||
|
@ -52,6 +52,7 @@ class CfgVehicles {
|
||||
function = QFUNC(moduleInit);
|
||||
scope = 2;
|
||||
isGlobal = 0;
|
||||
isSingular = 1;
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_mk6_ca.paa));
|
||||
functionPriority = 0;
|
||||
class Arguments {
|
||||
|
@ -4,27 +4,32 @@
|
||||
["InitSettingsFromModules", {
|
||||
// TODO This is a basic and limited implementation that mimics some of the functionality from the A3 module framework, but not all of it.
|
||||
// We have to execute this in the postInit XEH because on object init, the parameters of the modules are not yet available. They are if we execute it at the start of postInit execution.
|
||||
|
||||
private _uniqueModulesHandled = [];
|
||||
{
|
||||
[_x] call {
|
||||
private ["_logic", "_logicType", "_config", "_isGlobal", "_isDisposable", "_isPersistent","_function"];
|
||||
_logic = _this select 0;
|
||||
_logicType = typeof _logic;
|
||||
params ["_logic"];
|
||||
private _logicType = typeof _logic;
|
||||
_logic hideobject true;
|
||||
|
||||
if (_logic getvariable [QGVAR(initalized), false]) exitwith {};
|
||||
_config = (configFile >> "CfgVehicles" >> _logicType);
|
||||
private _config = (configFile >> "CfgVehicles" >> _logicType);
|
||||
if !(isClass _config) exitwith {};
|
||||
|
||||
// isGlobal = 1;
|
||||
_isGlobal = getNumber (_config >> "isGlobal") > 0;
|
||||
_isDisposable = getNumber (_config >> "isDisposable") > 0;
|
||||
_isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1;
|
||||
_function = getText (_config >> "function");
|
||||
private _isGlobal = getNumber (_config >> "isGlobal") > 0;
|
||||
private _isDisposable = getNumber (_config >> "isDisposable") > 0;
|
||||
private _isPersistent = getNumber (_config >> "isPersistent") > 0 || getnumber (_config >> "isGlobal") > 1;
|
||||
private _isSingular = getNumber (_config >> "isSingular") > 0;
|
||||
private _function = getText (_config >> "function");
|
||||
if (isnil _function) then {
|
||||
_function = compile _function;
|
||||
} else {
|
||||
_function = missionNamespace getvariable _function;
|
||||
};
|
||||
if (_isSingular && {_logicType in _uniqueModulesHandled}) then { //ToDo: should this be an exit?
|
||||
ACE_LOGWARNING_1("Module [%1] - More than 1 singular module placed", _logicType);
|
||||
};
|
||||
if (_isSingular) then {_uniqueModulesHandled pushBack _logicType;};
|
||||
|
||||
if (_isGlobal || isServer) then {
|
||||
[_logic, (synchronizedObjects _logic), true] call _function;
|
||||
@ -38,7 +43,7 @@
|
||||
deleteVehicle _logic;
|
||||
};
|
||||
};
|
||||
}foreach GVAR(moduleInitCollection);
|
||||
} forEach GVAR(moduleInitCollection);
|
||||
|
||||
if (isServer) then {
|
||||
GVAR(serverModulesRead) = true;
|
||||
|
@ -114,26 +114,11 @@ class CfgMovesMaleSdr: CfgMovesBasic {
|
||||
leftHandIKCurve[] = {};
|
||||
};
|
||||
|
||||
// enable optics in prone left and right stance
|
||||
class AidlPpneMstpSrasWrflDnon_G0S;
|
||||
class AadjPpneMstpSrasWrflDleft: AidlPpneMstpSrasWrflDnon_G0S {
|
||||
enableOptics = 1;
|
||||
};
|
||||
class AadjPpneMstpSrasWrflDright: AidlPpneMstpSrasWrflDnon_G0S {
|
||||
enableOptics = 1;
|
||||
};
|
||||
// enable optics in prone down stance
|
||||
class AadjPpneMstpSrasWrflDup;
|
||||
class AadjPpneMstpSrasWrflDdown: AadjPpneMstpSrasWrflDup {
|
||||
enableOptics = 1;
|
||||
};
|
||||
|
||||
class AidlPpneMstpSrasWpstDnon_G0S;
|
||||
class AadjPpneMstpSrasWpstDleft: AidlPpneMstpSrasWpstDnon_G0S {
|
||||
enableOptics = 2;
|
||||
};
|
||||
class AadjPpneMstpSrasWpstDright: AidlPpneMstpSrasWpstDnon_G0S {
|
||||
enableOptics = 2;
|
||||
};
|
||||
class AadjPpneMstpSrasWpstDup;
|
||||
class AadjPpneMstpSrasWpstDdown: AadjPpneMstpSrasWpstDup {
|
||||
enableOptics = 2;
|
||||
|
@ -7,6 +7,7 @@ class CfgVehicles {
|
||||
function = QFUNC(moduleNameTags);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_NameTags_ca.paa));
|
||||
class Arguments {
|
||||
class showPlayerNames {
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="NameTags">
|
||||
<Key ID="STR_ACE_NameTags_ShowNames">
|
||||
|
@ -8,6 +8,7 @@ class CfgVehicles {
|
||||
function = QUOTE(DFUNC(moduleAllowConfigExport));
|
||||
functionPriority = 1;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
isTriggerActivated = 0;
|
||||
author = ECSTRING(common,ACETeam);
|
||||
class Arguments {
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project name="ACE">
|
||||
<Package name="OptionsMenu">
|
||||
<Key ID="STR_ACE_OptionsMenu_OpenConfigMenu">
|
||||
@ -356,6 +356,7 @@
|
||||
<Czech>Pošle debug informace do RPT a schránky.</Czech>
|
||||
<German>Protokolliert Debug-Informationen im RPT und speichert sie in der Zwischenablage.</German>
|
||||
<Portuguese>Envia informação de depuração para RPT e área de transferência.</Portuguese>
|
||||
<Russian>Отправляет отладочную информацию в RPT и буфер обмена.</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_OptionsMenu_headBugFix">
|
||||
<English>Headbug Fix</English>
|
||||
@ -415,4 +416,4 @@
|
||||
<Spanish>Logística</Spanish>
|
||||
</Key>
|
||||
</Package>
|
||||
</Project>
|
||||
</Project>
|
@ -41,14 +41,14 @@ _var params["_backblastAngle","_backblastRange","_backblastDamage"];
|
||||
|
||||
// Damage to others
|
||||
private "_affected";
|
||||
_affected = getPos _projectile nearEntities ["CAManBase", _backblastRange];
|
||||
_affected = (ASLtoAGL _position) nearEntities ["CAManBase", _backblastRange];
|
||||
|
||||
// Let each client handle their own affected units
|
||||
["overpressure", _affected, [_firer, _position, _direction, _weapon]] call EFUNC(common,targetEvent);
|
||||
["overpressure", _affected, [_firer, _position, _direction, _weapon, _magazine, _ammo]] call EFUNC(common,targetEvent);
|
||||
|
||||
// Damage to the firer
|
||||
private "_distance";
|
||||
_distance = [_position, _direction, _backblastRange] call FUNC(getDistance);
|
||||
_distance = [_position, _direction, _backblastRange, _firer] call FUNC(getDistance);
|
||||
|
||||
TRACE_1("Distance",_distance);
|
||||
|
||||
|
@ -40,7 +40,7 @@ _var params["_dangerZoneAngle","_dangerZoneRange","_dangerZoneDamage"];
|
||||
|
||||
// Damage to others
|
||||
private "_affected";
|
||||
_affected = getPos _projectile nearEntities ["CAManBase", _dangerZoneRange];
|
||||
_affected = (ASLtoAGL _position) nearEntities ["CAManBase", _dangerZoneRange];
|
||||
|
||||
// Let each client handle their own affected units
|
||||
["overpressure", _affected, [_firer, _position, _direction, _weapon, _magazine, _ammo]] call EFUNC(common,targetEvent);
|
||||
|
@ -7,60 +7,45 @@
|
||||
* 0: Pos ASL of origin (ARRAY>
|
||||
* 1: Direction <ARRAY>
|
||||
* 2: Max distance to search <Number>
|
||||
* 3: Shooter <OBJECT>
|
||||
*
|
||||
* Return value:
|
||||
* Distance to intersection (+- 0.1 m) <NUMBER>
|
||||
* Distance to intersection (999 if distance is greater than max) <NUMBER>
|
||||
*
|
||||
* Example:
|
||||
* [[1823.41,5729.05,6.66627], [-0.953255,0.109689,-0.281554], 15, ace_player] call ace_overpressure_fnc_getDistance
|
||||
*
|
||||
*/
|
||||
#include "script_component.hpp"
|
||||
|
||||
EXPLODE_3_PVT(_this,_posASL,_direction,_maxDistance);
|
||||
params ["_posASL", "_direction", "_maxDistance", "_shooter"];
|
||||
TRACE_3("params",_posASL,_direction,_maxDistance);
|
||||
|
||||
private ["_distance", "_interval", "_line", "_intersections", "_terrainIntersect", "_lastTerrainIntersect"];
|
||||
private _intersections = lineIntersectsSurfaces [_posASL, _posASL vectorAdd (_direction vectorMultiply _maxDistance), _shooter, objNull, true, 99];
|
||||
|
||||
_distance = _maxDistance;
|
||||
_interval = _distance;
|
||||
_line = [_posASL, []];
|
||||
_terrainIntersect = false;
|
||||
_lastTerrainIntersect = false;
|
||||
TRACE_1("lineIntersectsSurfaces",_intersections);
|
||||
|
||||
while {
|
||||
_interval > 0.1
|
||||
} do {
|
||||
_lastTerrainIntersect = _terrainIntersect;
|
||||
_interval = _interval / 2;
|
||||
private _distance = 999;
|
||||
|
||||
_line set [1, _posASL vectorAdd (_direction vectorMultiply _distance)];
|
||||
{
|
||||
_x params ["_intersectPosASL", "_surfaceNormal", "_intersectObject"];
|
||||
|
||||
_intersections = {
|
||||
_x isKindOf "Static" || {_x isKindOf "AllVehicles"}
|
||||
} count (lineIntersectsWith _line);
|
||||
//Hit something solid that can reflect - (Static covers Building)
|
||||
if ((isNull _intersectObject) || {(_intersectObject isKindOf "Static") || {_intersectObject isKindOf "AllVehicles"}}) exitWith {
|
||||
_distance = _posASL vectorDistance _intersectPosASL;
|
||||
TRACE_3("hit solid object",_distance,_intersectObject,typeOf _intersectObject);
|
||||
|
||||
_terrainIntersect = if (_intersections > 0) then {
|
||||
false
|
||||
} else {
|
||||
terrainIntersectASL _line
|
||||
if (isNull _intersectObject) then { //Terrain:
|
||||
// Calculate the angle between the terrain and the back blast direction
|
||||
_angle = 90 - acos (- (_surfaceNormal vectorDotProduct _direction));
|
||||
TRACE_3("Terrain Intersect",_surfaceNormal,_direction,_angle);
|
||||
// Angles is below 25deg, no backblast at all
|
||||
if (_angle < 25) exitWith {_distance = 999};
|
||||
// Angles is below 45deg the distance is increased according to the difference
|
||||
if (_angle < 45) exitWith {_distance = _distance * (5 - 4 * sqrt ((_angle - 25)/20))};
|
||||
// Angles above 45degcreate full backblast
|
||||
};
|
||||
};
|
||||
|
||||
_distance = _distance + ([1, -1] select (_intersections > 0 || _terrainIntersect)) * _interval;
|
||||
|
||||
if (_distance > _maxDistance) exitWith {_distance = 999};
|
||||
};
|
||||
|
||||
if (_distance > _maxDistance) exitWith {_distance};
|
||||
|
||||
// If the intersection was with the terrain, check slope
|
||||
if (_terrainIntersect || _lastTerrainIntersect) exitWith {
|
||||
private ["_slope","_angle"];
|
||||
_slope = surfaceNormal (_posASL vectorAdd (_direction vectorMultiply _distance));
|
||||
// Calculate the angle between the terrain and the back blast direction
|
||||
_angle = 90 - acos (- (_slope vectorDotProduct _direction));
|
||||
|
||||
//systemChat format ["Angle: %1", _angle];
|
||||
// Angles is below 25º, no backblast at all
|
||||
if (_angle < 25) exitWith {_distance = 999};
|
||||
// Angles is below 45º the distance is increased according to the difference
|
||||
if (_angle < 45) exitWith {_distance = _distance * (5 - 4 * sqrt ((_angle - 25)/20))};
|
||||
// Angles above 45º create full backblast
|
||||
};
|
||||
} forEach _intersections;
|
||||
|
||||
_distance
|
||||
|
@ -30,12 +30,6 @@ _var params["_overpressureAngle","_overpressureRange","_overpressureDamage"];
|
||||
|
||||
TRACE_4("Parameters:",_overpressureAngle,_overpressureRange,_overpressureDamage,_weapon);
|
||||
|
||||
private "_pos";
|
||||
_pos = _posASL;
|
||||
if (!surfaceIsWater _pos) then {
|
||||
_pos = ASLtoATL _pos;
|
||||
};
|
||||
|
||||
{
|
||||
if (local _x && {_x != _firer} && {vehicle _x == _x}) then {
|
||||
private ["_targetPositionASL", "_relativePosition", "_axisDistance", "_distance", "_angle", "_line", "_line2"];
|
||||
@ -68,4 +62,4 @@ if (!surfaceIsWater _pos) then {
|
||||
};
|
||||
};
|
||||
};
|
||||
} forEach (_pos nearEntities ["CAManBase", _overpressureRange]);
|
||||
} forEach ((ASLtoAGL _posASL) nearEntities ["CAManBase", _overpressureRange]);
|
||||
|
@ -25,7 +25,7 @@ if (_target isKindOf "StaticWeapon") exitWith {
|
||||
// no check ammo action on destroyed static weapons
|
||||
if (!alive _target) exitWith {false};
|
||||
|
||||
local _found = false;
|
||||
private _found = false;
|
||||
|
||||
{
|
||||
if (_x select 2) exitWith {
|
||||
|
@ -25,6 +25,7 @@ class CfgVehicles {
|
||||
function = QFUNC(moduleRepairSettings);
|
||||
functionPriority = 1;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
isTriggerActivated = 0;
|
||||
author = ECSTRING(Common,ACETeam);
|
||||
class Arguments {
|
||||
|
@ -37,7 +37,7 @@ if (
|
||||
};
|
||||
|
||||
if (currentWeapon _unit != "") then {
|
||||
local _index = 0;
|
||||
private _index = 0;
|
||||
|
||||
while {
|
||||
_index < 100 && {currentWeaponMode _unit != _activeWeaponMode}
|
||||
|
@ -7,6 +7,7 @@ class CfgVehicles {
|
||||
function = QFUNC(moduleInit);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_Sitting_ca.paa));
|
||||
class Arguments {
|
||||
class enable {
|
||||
|
@ -190,8 +190,8 @@ class GVAR(interface) {
|
||||
1
|
||||
};
|
||||
multiselectEnabled = 0;
|
||||
maxHistoryDelay = 10e10;
|
||||
onTreeDblClick = QUOTE([ARR_2('onTreeDblClick',_this)] call FUNC(handleInterface));
|
||||
onTreeSelChanged = QUOTE([ARR_2('onTreeSelChanged',_this)] call FUNC(handleInterface));
|
||||
};
|
||||
class unitFrame: RscFrame {
|
||||
x = 0;
|
||||
|
@ -8,3 +8,6 @@
|
||||
GVAR(availableModes) = [[0,1,2], [1,2], [0], [1], [2]] select GVAR(restrictModes);
|
||||
GVAR(availableVisions) = [[-2,-1,0,1], [-2,-1], [-2,0,1], [-2]] select GVAR(restrictVisions);
|
||||
}] call EFUNC(common,addEventHandler);
|
||||
|
||||
// Should prevent unending spectator on mission end
|
||||
addMissionEventHandler ["Ended",{ [false] call FUNC(setSpectator) }];
|
||||
|
@ -35,7 +35,7 @@ GVAR(camDistance) = 10;
|
||||
GVAR(camMode) = 0;
|
||||
GVAR(camPan) = 0;
|
||||
GVAR(camPos) = ATLtoASL [worldSize * 0.5, worldSize * 0.5, 20];
|
||||
GVAR(camSpeed) = 2.5;
|
||||
GVAR(camSpeed) = 1.5;
|
||||
GVAR(camTilt) = -10;
|
||||
GVAR(camUnit) = objNull;
|
||||
GVAR(camVision) = -2;
|
||||
|
@ -45,37 +45,36 @@ switch (toLower _mode) do {
|
||||
};
|
||||
} forEach [
|
||||
[localize LSTRING(uiControls),""],
|
||||
[localize LSTRING(uiToggleUnits),"1"],
|
||||
[localize LSTRING(uiToggleHelp),"2"],
|
||||
[localize LSTRING(uiToggleTools),"3"],
|
||||
[localize LSTRING(uiToggleCompass),"4"],
|
||||
[localize LSTRING(uiToggleIcons),"5"],
|
||||
[localize LSTRING(uiToggleMap),"M"],
|
||||
[localize LSTRING(uiToggleInterface),"Backspace"],
|
||||
[localize LSTRING(uiToggleUnits),keyName 2],
|
||||
[localize LSTRING(uiToggleHelp),keyName 3],
|
||||
[localize LSTRING(uiToggleTools),keyName 4],
|
||||
[localize LSTRING(uiToggleCompass),keyName 5],
|
||||
[localize LSTRING(uiToggleIcons),keyName 6],
|
||||
[localize LSTRING(uiToggleMap),keyName 50],
|
||||
[localize LSTRING(uiToggleInterface),keyName 14],
|
||||
[localize LSTRING(freeCamControls),""],
|
||||
[localize LSTRING(freeCamForward),"W"],
|
||||
[localize LSTRING(freeCamBackward),"S"],
|
||||
[localize LSTRING(freeCamLeft),"A"],
|
||||
[localize LSTRING(freeCamRight),"D"],
|
||||
[localize LSTRING(freeCamUp),"Q"],
|
||||
[localize LSTRING(freeCamDown),"Z"],
|
||||
[localize LSTRING(freeCamForward),keyName 17],
|
||||
[localize LSTRING(freeCamBackward),keyName 31],
|
||||
[localize LSTRING(freeCamLeft),keyName 30],
|
||||
[localize LSTRING(freeCamRight),keyName 32],
|
||||
[localize LSTRING(freeCamUp),keyName 16],
|
||||
[localize LSTRING(freeCamDown),keyName 44],
|
||||
[localize LSTRING(freeCamPan),"RMB (Hold)"],
|
||||
[localize LSTRING(freeCamDolly),"LMB (Hold)"],
|
||||
[localize LSTRING(freeCamBoost),"Shift (Hold)"],
|
||||
[localize LSTRING(freeCamFocus),"F"],
|
||||
[localize LSTRING(attributeControls),""],
|
||||
[localize LSTRING(nextCam),"Up Arrow"],
|
||||
[localize LSTRING(prevCam),"Down Arrow"],
|
||||
[localize LSTRING(nextUnit),"Right Arrow"],
|
||||
[localize LSTRING(prevUnit),"Left Arrow"],
|
||||
[localize LSTRING(nextVis),"N"],
|
||||
[localize LSTRING(prevVis),"Ctrl + N"],
|
||||
[localize LSTRING(nextCam),keyName 200],
|
||||
[localize LSTRING(prevCam),keyName 208],
|
||||
[localize LSTRING(nextUnit),keyName 205],
|
||||
[localize LSTRING(prevUnit),keyName 203],
|
||||
[localize LSTRING(nextVis),keyName 49],
|
||||
[localize LSTRING(prevVis),format["%1 + %2",keyName 29,keyname 49]],
|
||||
[localize LSTRING(adjZoom),"Scrollwheel"],
|
||||
[localize LSTRING(adjSpeed),"Ctrl + Scrollwheel"],
|
||||
[localize LSTRING(incZoom),"Num-/Num+"],
|
||||
[localize LSTRING(incSpeed),"Ctrl + Num-/Num+"],
|
||||
[localize LSTRING(reZoom),"Alt + Num-"],
|
||||
[localize LSTRING(reSpeed),"Alt + Num+"]
|
||||
[localize LSTRING(adjSpeed),format["%1 + Scrollwheel",keyName 29]],
|
||||
[localize LSTRING(incZoom),format["%1/%2",keyName 74,keyName 78]],
|
||||
[localize LSTRING(incSpeed),format["%1 + %2/%3",keyName 29,keyName 74,keyName 78]],
|
||||
[localize LSTRING(reZoom),format["%1 + %2",keyName 56,keyName 74]],
|
||||
[localize LSTRING(reSpeed),format["%1 + %2",keyName 56,keyName 78]]
|
||||
];
|
||||
|
||||
// Handle support for BI's respawn counter
|
||||
@ -126,7 +125,6 @@ switch (toLower _mode) do {
|
||||
GVAR(heldKeys) resize 255;
|
||||
GVAR(mouse) = [false,false];
|
||||
GVAR(mousePos) = [0.5,0.5];
|
||||
GVAR(treeSel) = objNull;
|
||||
};
|
||||
// Mouse events
|
||||
case "onmousebuttondown": {
|
||||
@ -226,19 +224,11 @@ switch (toLower _mode) do {
|
||||
case 32: { // D
|
||||
GVAR(camDolly) set [0, GVAR(camSpeed) * ([1, 2] select _shift)];
|
||||
};
|
||||
case 33: { // F
|
||||
private ["_sel","_vector"];
|
||||
_sel = GVAR(treeSel);
|
||||
if ((GVAR(camMode) == 0) && {!isNull _sel} && {_sel in GVAR(unitList)}) then {
|
||||
_vector = (positionCameraToWorld [0,0,0]) vectorDiff (positionCameraToWorld [0,0,25]);
|
||||
[nil,nil,nil,(getPosATL _sel) vectorAdd _vector] call FUNC(setCameraAttributes);
|
||||
};
|
||||
};
|
||||
case 44: { // Z
|
||||
GVAR(camBoom) = -0.5 * GVAR(camSpeed) * ([1, 2] select _shift);
|
||||
};
|
||||
case 49: { // N
|
||||
if (GVAR(camMode) == 0) then {
|
||||
if (GVAR(camMode) != 1) then {
|
||||
if (_ctrl) then {
|
||||
[nil,nil,-1] call FUNC(cycleCamera);
|
||||
} else {
|
||||
@ -250,7 +240,7 @@ switch (toLower _mode) do {
|
||||
[_display,nil,nil,nil,true] call FUNC(toggleInterface);
|
||||
};
|
||||
case 57: { // Spacebar
|
||||
// Freecam attachment here, if in external then set cam pos and attach
|
||||
// Switch between unit and freecam here
|
||||
};
|
||||
case 74: { // Num -
|
||||
if (_alt) exitWith { [nil,nil,nil,nil,nil,nil, 1.25] call FUNC(setCameraAttributes); };
|
||||
@ -261,7 +251,7 @@ switch (toLower _mode) do {
|
||||
};
|
||||
};
|
||||
case 78: { // Num +
|
||||
if (_alt) exitWith { [nil,nil,nil,nil,nil,nil,nil, 2.5] call FUNC(setCameraAttributes); };
|
||||
if (_alt) exitWith { [nil,nil,nil,nil,nil,nil,nil, 1.5] call FUNC(setCameraAttributes); };
|
||||
if (_ctrl) then {
|
||||
[nil,nil,nil,nil,nil,nil,nil, GVAR(camSpeed) + 0.05] call FUNC(setCameraAttributes);
|
||||
} else {
|
||||
@ -335,15 +325,6 @@ switch (toLower _mode) do {
|
||||
[_newMode,_newUnit] call FUNC(transitionCamera);
|
||||
};
|
||||
};
|
||||
case "ontreeselchanged": {
|
||||
_args params ["_tree","_sel"];
|
||||
|
||||
if (count _sel == 3) then {
|
||||
GVAR(treeSel) = objectFromNetId (_tree tvData _sel);
|
||||
} else {
|
||||
GVAR(treeSel) = objNull;
|
||||
};
|
||||
};
|
||||
case "onunitsupdate": {
|
||||
_args params ["_tree"];
|
||||
private ["_cachedUnits","_cachedGrps","_cachedSides","_s","_g","_grp","_u","_unit","_side"];
|
||||
|
@ -18,12 +18,32 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_map"];
|
||||
private ["_cachedVehicles","_unit","_color","_icon","_txt"];
|
||||
private ["_center","_radius","_scaled","_drawVehicles","_leader","_color","_cachedVehicles","_unit","_icon","_txt"];
|
||||
|
||||
if (GVAR(camMode) == 0) then {
|
||||
_map drawIcon ["\A3\UI_F\Data\GUI\Rsc\RscDisplayMissionEditor\iconcamera_ca.paa",[0,0,0,1],GVAR(freeCamera),20,20,GVAR(camPan)];
|
||||
};
|
||||
|
||||
_center = _map ctrlMapScreenToWorld [0.5,0.5];
|
||||
_radius = (_map ctrlMapScreenToWorld [safeZoneX,safeZoneY]) distance2D _center;
|
||||
_scaled = (ctrlMapScale _map) > 0.2;
|
||||
|
||||
// Draw only group icons when scaled out
|
||||
_drawVehicles = [];
|
||||
{
|
||||
_leader = leader _x;
|
||||
if (_scaled) then {
|
||||
_color = GETVAR(_x,GVAR(gColor),[ARR_4(0,0,0,0)]);
|
||||
_map drawIcon ["\A3\ui_f\data\map\markers\nato\b_inf.paa", _color, _leader, 20, 20, 0, "", 0, 0];
|
||||
} else {
|
||||
if ((_leader distance2D _center) < _radius) then {
|
||||
_drawVehicles append (units _x);
|
||||
};
|
||||
};
|
||||
nil
|
||||
} count GVAR(groupList);
|
||||
|
||||
// Draw units when group leader is within screen bounds
|
||||
_cachedVehicles = [];
|
||||
{
|
||||
_unit = vehicle _x;
|
||||
@ -41,7 +61,7 @@ _cachedVehicles = [];
|
||||
_icon = GETVAR(_unit,GVAR(uIcon),"");
|
||||
_txt = ["", GETVAR(_x,GVAR(uName),"")] select (isPlayer _x);
|
||||
|
||||
_map drawIcon [_icon, _color, _unit, 19, 19, getDir _unit, _txt, 1, 0.03];
|
||||
_map drawIcon [_icon, _color, _unit, 19, 19, getDir _unit, _txt, 1, 0.04];
|
||||
};
|
||||
false
|
||||
} count GVAR(unitList);
|
||||
nil
|
||||
} count (_drawVehicles arrayIntersect GVAR(unitList));
|
||||
|
@ -26,8 +26,13 @@ private ["_name","_vision","_fov","_speed","_mode","_time","_toolbar"];
|
||||
_toolbar = _display displayCtrl IDC_TOOL;
|
||||
|
||||
// Find all tool values
|
||||
if (GVAR(camVision) >= 0) then {
|
||||
_vision = localize LSTRING(VisionThermal);
|
||||
} else {
|
||||
_vision = [localize LSTRING(VisionNight), localize LSTRING(VisionNormal)] select (GVAR(camVision) < -1);
|
||||
};
|
||||
|
||||
if (GVAR(camMode) == 0) then {
|
||||
_vision = if (GVAR(camVision) >= 0) then {localize LSTRING(VisionThermal)} else { [localize LSTRING(VisionNight), localize LSTRING(VisionNormal)] select (GVAR(camVision) < -1) };
|
||||
_fov = format ["%1x", floor(GVAR(camZoom) * 100) * 0.01];
|
||||
_speed = format ["%1 m/s", floor(GVAR(camSpeed) * 100) * 0.01];
|
||||
} else {
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Reason <STRING>
|
||||
* 1: Interrupting <BOOL>
|
||||
* 1: Interrupting <BOOL> (default: true)
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
|
@ -34,7 +34,7 @@ _pos = (getPosATL _unit) vectorAdd [0,0,5];
|
||||
// Enter/exit spectator based on the respawn type and whether killed/respawned
|
||||
if (alive _unit) then {
|
||||
if (_respawn == 1) then {
|
||||
[_unit,QGVAR(isSeagull)] call EFUNC(common,hideUnit);
|
||||
[_unit] call FUNC(stageSpectator);
|
||||
[2,_killer,_vision,_pos,getDir _unit] call FUNC(setCameraAttributes);
|
||||
[true] call FUNC(setSpectator);
|
||||
} else {
|
||||
|
@ -1,23 +1,24 @@
|
||||
/*
|
||||
* Author: SilentSpike
|
||||
* Sets the spectator camera attributes as desired
|
||||
* All values are optional and default to whatever the current value is
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Camera mode <NUMBER> <OPTIONAL>
|
||||
* 0: Camera mode <NUMBER>
|
||||
* - 0: Free
|
||||
* - 1: Internal
|
||||
* - 2: External
|
||||
* 1: Camera unit (objNull for random) <OBJECT> <OPTIONAL>
|
||||
* 2: Camera vision <NUMBER> <OPTIONAL>
|
||||
* 1: Camera unit (objNull for random) <OBJECT>
|
||||
* 2: Camera vision <NUMBER>
|
||||
* - -2: Normal
|
||||
* - -1: Night vision
|
||||
* - 0: Thermal white hot
|
||||
* - 1: Thermal black hot
|
||||
* 3: Camera position (ATL) <ARRAY> <OPTIONAL>
|
||||
* 4: Camera pan (0 - 360) <NUMBER> <OPTIONAL>
|
||||
* 5: Camera tilt (-90 - 90) <NUMBER> <OPTIONAL>
|
||||
* 6: Camera zoom (0.01 - 2) <NUMBER> <OPTIONAL>
|
||||
* 7: Camera speed in m/s (0.05 - 10) <NUMBER> <OPTIONAL>
|
||||
* 3: Camera position (ATL) <ARRAY>
|
||||
* 4: Camera pan (0 - 360) <NUMBER>
|
||||
* 5: Camera tilt (-90 - 90) <NUMBER>
|
||||
* 6: Camera zoom (0.01 - 2) <NUMBER>
|
||||
* 7: Camera speed in m/s (0.05 - 10) <NUMBER>
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
|
@ -7,7 +7,8 @@
|
||||
* The spectator interface will be opened/closed
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Spectator state of local client <BOOL> <OPTIONAL>
|
||||
* 0: Spectator state of local client <BOOL> (default: true)
|
||||
* 1: Force interface <BOOL> (default: true)
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
@ -20,7 +21,7 @@
|
||||
|
||||
#include "script_component.hpp"
|
||||
|
||||
params [["_set",true,[true]]];
|
||||
params [["_set",true,[true]], ["_force",true,[true]]];
|
||||
|
||||
// Only clients can be spectators
|
||||
if (!hasInterface) exitWith {};
|
||||
@ -29,7 +30,10 @@ if (!hasInterface) exitWith {};
|
||||
if (_set isEqualTo GVAR(isSet)) exitwith {};
|
||||
|
||||
// Handle common addon audio
|
||||
if (["ace_hearing"] call EFUNC(common,isModLoaded)) then {EGVAR(hearing,disableVolumeUpdate) = _set};
|
||||
if (["ace_hearing"] call EFUNC(common,isModLoaded)) then {
|
||||
EGVAR(hearing,disableVolumeUpdate) = _set;
|
||||
EGVAR(hearing,deafnessDV) = 0;
|
||||
};
|
||||
if (["acre_sys_radio"] call EFUNC(common,isModLoaded)) then {[_set] call acre_api_fnc_setSpectator};
|
||||
if (["task_force_radio"] call EFUNC(common,isModLoaded)) then {[player, _set] call TFAR_fnc_forceSpectator};
|
||||
|
||||
@ -45,7 +49,6 @@ if (_set) then {
|
||||
GVAR(heldKeys) resize 255;
|
||||
GVAR(mouse) = [false,false];
|
||||
GVAR(mousePos) = [0.5,0.5];
|
||||
GVAR(treeSel) = objNull;
|
||||
|
||||
// Update units before opening to support pre-set camera unit
|
||||
[] call FUNC(updateUnits);
|
||||
@ -75,7 +78,17 @@ if (_set) then {
|
||||
[{
|
||||
// Create the display
|
||||
(findDisplay 46) createDisplay QGVAR(interface);
|
||||
}, []] call EFUNC(common,execNextFrame);
|
||||
|
||||
// If not forced, make esc end spectator
|
||||
if (_this) then {
|
||||
(findDisplay 12249) displayAddEventHandler ["KeyDown", {
|
||||
if (_this select 1 == 1) then {
|
||||
[false] call ace_spectator_fnc_setSpectator;
|
||||
true
|
||||
};
|
||||
}];
|
||||
};
|
||||
}, !_force] call EFUNC(common,execNextFrame);
|
||||
|
||||
// Cache and disable nametag settings
|
||||
if (["ace_nametags"] call EFUNC(common,isModLoaded)) then {
|
||||
@ -119,7 +132,6 @@ if (_set) then {
|
||||
GVAR(heldKeys) = nil;
|
||||
GVAR(mouse) = nil;
|
||||
GVAR(mousePos) = nil;
|
||||
GVAR(treeSel) = nil;
|
||||
|
||||
// Reset nametag settings
|
||||
if (["ace_nametags"] call EFUNC(common,isModLoaded)) then {
|
||||
|
@ -7,8 +7,8 @@
|
||||
* Upon unstage, units will be moved to the position they were in upon staging
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Unit to put into spectator stage <OBJECT> <OPTIONAL>
|
||||
* 1: Spectator stage <BOOL> <OPTIONAL>
|
||||
* 0: Unit to put into spectator stage <OBJECT> (default: player)
|
||||
* 1: Unit should be staged <BOOL> (default: true)
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
|
@ -49,7 +49,6 @@ if (_newMode == 0) then { // Free
|
||||
|
||||
// Preserve camUnit value for consistency when manually changing view
|
||||
_camera cameraEffect ["internal", "back"];
|
||||
showCinemaBorder false;
|
||||
|
||||
// Apply the camera zoom
|
||||
_camera camSetFov -(linearConversion [0.01,2,GVAR(camZoom),-2,-0.01,true]);
|
||||
@ -63,23 +62,6 @@ if (_newMode == 0) then { // Free
|
||||
|
||||
GVAR(camAgent) switchCamera "internal";
|
||||
clearRadio;
|
||||
|
||||
// If new vision isn't available then keep current (unless current also isn't)
|
||||
if !(_newVision in GVAR(availableVisions)) then {
|
||||
_newVision = GVAR(availableVisions) select ((GVAR(availableVisions) find GVAR(camVision)) max 0);
|
||||
};
|
||||
|
||||
// Vision mode only applies to free cam
|
||||
if (_newVision < 0) then {
|
||||
false setCamUseTi 0;
|
||||
camUseNVG (_newVision >= -1);
|
||||
} else {
|
||||
true setCamUseTi _newVision;
|
||||
};
|
||||
GVAR(camVision) = _newVision;
|
||||
|
||||
// Handle camera movement
|
||||
if (isNil QGVAR(camHandler)) then { GVAR(camHandler) = [FUNC(handleCamera), 0] call CBA_fnc_addPerFrameHandler; };
|
||||
} else {
|
||||
_camera = GVAR(unitCamera);
|
||||
|
||||
@ -103,10 +85,6 @@ if (_newMode == 0) then { // Free
|
||||
} else {
|
||||
// Switch to the camera
|
||||
_camera cameraEffect ["internal", "back"];
|
||||
showCinemaBorder false;
|
||||
|
||||
// Handle camera orbit movement
|
||||
if (isNil QGVAR(camHandler)) then { GVAR(camHandler) = [FUNC(handleCamera), 0] call CBA_fnc_addPerFrameHandler; };
|
||||
};
|
||||
|
||||
// Clear radio if group changed
|
||||
@ -117,4 +95,27 @@ if (_newMode == 0) then { // Free
|
||||
GVAR(camUnit) = _newUnit;
|
||||
};
|
||||
|
||||
if (_newMode in [0,2]) then {
|
||||
// Set up camera UI
|
||||
showCinemaBorder false;
|
||||
cameraEffectEnableHUD true;
|
||||
|
||||
// Handle camera movement
|
||||
if (isNil QGVAR(camHandler)) then { GVAR(camHandler) = [FUNC(handleCamera), 0] call CBA_fnc_addPerFrameHandler; };
|
||||
|
||||
// If new vision isn't available then keep current (unless current also isn't)
|
||||
if !(_newVision in GVAR(availableVisions)) then {
|
||||
_newVision = GVAR(availableVisions) select ((GVAR(availableVisions) find GVAR(camVision)) max 0);
|
||||
};
|
||||
|
||||
// Vision mode applies to free and external cam
|
||||
if (_newVision < 0) then {
|
||||
false setCamUseTi 0;
|
||||
camUseNVG (_newVision >= -1);
|
||||
} else {
|
||||
true setCamUseTi _newVision;
|
||||
};
|
||||
GVAR(camVision) = _newVision;
|
||||
};
|
||||
|
||||
GVAR(camMode) = _newMode;
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* Arguments:
|
||||
* 0: Units to add to the whitelist <ARRAY>
|
||||
* 1: Use blacklist <BOOL> <OPTIONAL>
|
||||
* 1: Use blacklist <BOOL> (default: false)
|
||||
*
|
||||
* Return Value:
|
||||
* None <NIL>
|
||||
|
@ -344,14 +344,6 @@
|
||||
<Russian>Ускорение камеры</Russian>
|
||||
<Spanish>Aumento de velocidad</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Spectator_freeCamFocus">
|
||||
<English>Focus on Unit</English>
|
||||
<Polish>Skup na jednostce</Polish>
|
||||
<Portuguese>Focar na unidade</Portuguese>
|
||||
<Russian>Фокус на юните</Russian>
|
||||
<Czech>Zaměřit se na Jednotku</Czech>
|
||||
<Spanish>Centrarse en la unidad</Spanish>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Spectator_uiControls">
|
||||
<English>Interface</English>
|
||||
<Polish>Interfejs</Polish>
|
||||
|
@ -42,6 +42,7 @@
|
||||
<German>Ausfahren, +Strg kippen</German>
|
||||
<Polish>Rozłóż, +Ctrl nachyl</Polish>
|
||||
<Portuguese>Extender, +Ctrl tilt</Portuguese>
|
||||
<Russian>Разложить, +Ctrl наклонить</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_TacticalLadder_Position">
|
||||
<English>Position ladder</English>
|
||||
|
@ -74,6 +74,7 @@ class CfgVehicles {
|
||||
function = QFUNC(moduleInit);
|
||||
scope = 2;
|
||||
isGlobal = 0;
|
||||
isSingular = 1;
|
||||
icon = QUOTE(PATHTOF(UI\Icon_Module_VehicleLock_ca.paa));
|
||||
functionPriority = 0;
|
||||
class Arguments {
|
||||
|
@ -7,6 +7,7 @@ class CfgVehicles {
|
||||
displayName = CSTRING(Module_DisplayName);
|
||||
scope = 2;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
//icon = ""; // needs an icon
|
||||
class Arguments {
|
||||
class moduleViewDistanceEnabled {
|
||||
|
@ -8,6 +8,7 @@ class CfgVehicles {
|
||||
function = QUOTE(DFUNC(initModuleSettings));
|
||||
functionPriority = 1;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
isTriggerActivated = 0;
|
||||
author = ECSTRING(common,ACETeam);
|
||||
class Arguments {
|
||||
|
@ -8,6 +8,7 @@ class CfgVehicles {
|
||||
function = QUOTE(DFUNC(initModuleSettings));
|
||||
functionPriority = 1;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
isTriggerActivated = 0;
|
||||
author = ECSTRING(common,ACETeam);
|
||||
class Arguments {
|
||||
|
@ -23,6 +23,7 @@ class CfgVehicles {
|
||||
function = QFUNC(moduleZeusSettings);
|
||||
functionPriority = 1;
|
||||
isGlobal = 1;
|
||||
isSingular = 1;
|
||||
isTriggerActivated = 0;
|
||||
author = "SilentSpike";
|
||||
class Arguments {
|
||||
|
@ -215,18 +215,22 @@
|
||||
<Key ID="STR_ACE_Zeus_ModuleAddSpareWheel_DisplayName">
|
||||
<English>Add Spare Wheel</English>
|
||||
<Portuguese>Adicionar roda sobressalente</Portuguese>
|
||||
<Russian>Добавить запасное колесо</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Zeus_ModuleAddSpareWheel_Description">
|
||||
<English>Adds a Spare Wheel to the vehicle</English>
|
||||
<Portuguese>Adiciona uma roda sobressalente ao veículo</Portuguese>
|
||||
<Russian>Добавляет запасное колесо в транспорт</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Zeus_ModuleAddSpareTrack_DisplayName">
|
||||
<English>Add Spare Track</English>
|
||||
<Portuguese>Adicionar esteira sobressalente</Portuguese>
|
||||
<Russian>Дабавить запасную гусеницу</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Zeus_ModuleAddSpareTrack_Description">
|
||||
<English>Adds a Spare Track to the vehicle</English>
|
||||
<Portuguese>Adiciona uma esteira sobressalente ao veículo</Portuguese>
|
||||
<Russian>Добавляет запасную гусеницу в транспорт</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Zeus_OnlyAlive">
|
||||
<English>Unit must be alive</English>
|
||||
@ -269,10 +273,12 @@
|
||||
<Key ID="STR_ACE_Zeus_OnlyVehiclesWithCargo">
|
||||
<English>Unit must be a vehicle with cargo space</English>
|
||||
<Portuguese>Unidade deve ser um veículo com espaço em carga</Portuguese>
|
||||
<Russian>Юнит должен быть транспортом с грузовым отсеком</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Zeus_OnlyEnoughCargoSpace">
|
||||
<English>Unit must have cargo space left</English>
|
||||
<Portuguese>Unidade deve conter espaço sobressalente</Portuguese>
|
||||
<Russian>Юнит должен иметь свободное место в грузовом отсеке</Russian>
|
||||
</Key>
|
||||
<Key ID="STR_ACE_Zeus_OnlyNonCaptive">
|
||||
<English>Unit must not be captive</English>
|
||||
|
@ -489,7 +489,7 @@ def check_for_obsolete_pbos(addonspath, file):
|
||||
|
||||
|
||||
def backup_config(module):
|
||||
#PABST: Convert config (run the macro'd config.cpp through CfgConvert twice to produce a de-macro'd cpp that pboProject can read without fucking up:
|
||||
#backup original $PBOPREFIX$
|
||||
global work_drive
|
||||
global prefix
|
||||
|
||||
@ -503,52 +503,11 @@ def backup_config(module):
|
||||
except:
|
||||
print_error("Error creating backup of $PBOPREFIX$ for module {}.".format(module))
|
||||
|
||||
try:
|
||||
shutil.copyfile(os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.backup"))
|
||||
os.chdir(work_drive)
|
||||
except:
|
||||
print_error("Error creating backup of config.cpp for module {}.".format(module))
|
||||
|
||||
return True
|
||||
|
||||
def convert_config(module):
|
||||
try:
|
||||
global work_drive
|
||||
global prefix
|
||||
global arma3tools_path
|
||||
|
||||
cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-bin", "-dst", os.path.join(work_drive, prefix, module, "config.bin"), os.path.join(work_drive, prefix, module, "config.cpp")]
|
||||
ret = subprocess.call(cmd)
|
||||
if ret != 0:
|
||||
print_error("CfgConvert -bin return code == {}. Usually means there is a syntax error within the config.cpp file.".format(str(ret)))
|
||||
os.remove(os.path.join(work_drive, prefix, module, "config.cpp"))
|
||||
shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp"))
|
||||
|
||||
cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-txt", "-dst", os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.bin")]
|
||||
ret = subprocess.call(cmd)
|
||||
if ret != 0:
|
||||
print_error("CfgConvert -txt return code == {}. Usually means there is a syntax error within the config.cpp file.".format(str(ret)))
|
||||
os.remove(os.path.join(work_drive, prefix, module, "config.cpp"))
|
||||
shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp"))
|
||||
except Exception as e:
|
||||
print_error("Exception from convert_config=>CfgConvert: {}".format(e))
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def addon_restore(modulePath):
|
||||
#PABST: cleanup config BS (you could comment this out to see the "de-macroed" cpp
|
||||
#print_green("\Pabst! (restoring): {}".format(os.path.join(modulePath, "config.cpp")))
|
||||
#restore original $PBOPREFIX$
|
||||
try:
|
||||
if os.path.isfile(os.path.join(modulePath, "config.cpp")):
|
||||
os.remove(os.path.join(modulePath, "config.cpp"))
|
||||
if os.path.isfile(os.path.join(modulePath, "config.backup")):
|
||||
os.rename(os.path.join(modulePath, "config.backup"), os.path.join(modulePath, "config.cpp"))
|
||||
if os.path.isfile(os.path.join(modulePath, "config.bin")):
|
||||
os.remove(os.path.join(modulePath, "config.bin"))
|
||||
if os.path.isfile(os.path.join(modulePath, "texHeaders.bin")):
|
||||
os.remove(os.path.join(modulePath, "texHeaders.bin"))
|
||||
if os.path.isfile(os.path.join(modulePath, "$PBOPREFIX$.backup")):
|
||||
if os.path.isfile(os.path.join(modulePath, "$PBOPREFIX$")):
|
||||
os.remove(os.path.join(modulePath, "$PBOPREFIX$"))
|
||||
@ -1216,9 +1175,6 @@ See the make.cfg file for additional build options.
|
||||
nobinFilePath = os.path.join(work_drive, prefix, module, "$NOBIN$")
|
||||
backup_config(module)
|
||||
|
||||
if (not os.path.isfile(nobinFilePath)):
|
||||
convert_config(module)
|
||||
|
||||
version_stamp_pboprefix(module,commit_id)
|
||||
|
||||
if os.path.isfile(nobinFilePath):
|
||||
|
Loading…
Reference in New Issue
Block a user