Merge branch 'release'

This commit is contained in:
Glowbal 2016-01-05 22:55:34 +01:00
commit c042703786
128 changed files with 1433 additions and 1008 deletions

View File

@ -4,9 +4,9 @@
<p align="center">
<a href="https://github.com/acemod/ACE3/releases">
<img src="https://img.shields.io/badge/Version-3.4.1-blue.svg?style=flat-square" alt="ACE3 Version">
<img src="https://img.shields.io/badge/Version-3.4.2-blue.svg?style=flat-square" alt="ACE3 Version">
</a>
<a href="https://github.com/acemod/ACE3/releases/download/v3.4.1/ace3_3.4.1.zip">
<a href="https://github.com/acemod/ACE3/releases/download/v3.4.2/ace3_3.4.2.zip">
<img src="https://img.shields.io/badge/Download-72.6_MB-green.svg?style=flat-square" alt="ACE3 Download">
</a>
<a href="https://github.com/acemod/ACE3/issues">

View File

@ -1,7 +1,7 @@
// ACE - Common
// #define ENABLE_PERFORMANCE_COUNTERS
#include "script_component.hpp"
// #define ENABLE_PERFORMANCE_COUNTERS
//////////////////////////////////////////////////
// PFHs
@ -57,6 +57,24 @@
// Eventhandlers
//////////////////////////////////////////////////
//Add a fix for BIS's zeus remoteControl module not reseting variables on DC when RC a unit
//This variable is used for isPlayer checks
if (isServer) then {
addMissionEventHandler ["HandleDisconnect", {
params ["_dcPlayer"];
private _zeusLogic = getAssignedCuratorLogic _dcPlayer;
if ((!isNil "_zeusLogic") && {!isNull _zeusLogic}) then {
{
if ((_x getvariable ["bis_fnc_moduleRemoteControl_owner", objnull]) isEqualTo _dcPlayer) exitWith {
ACE_LOGINFO_3("[%1] DC - Was Zeus [%2] while controlling unit [%3] - manually clearing `bis_fnc_moduleRemoteControl_owner`", [_x] call FUNC(getName), _dcPlayer, _x);
_x setVariable ["bis_fnc_moduleRemoteControl_owner", nil, true];
};
nil
} count (curatorEditableObjects _zeusLogic);
};
}];
};
// Listens for global "SettingChanged" events, to update the force status locally
["SettingChanged", {
params ["_name", "_value", "_force"];
@ -293,6 +311,17 @@ enableCamShake true;
// Set up numerous eventhanders for player controlled units
//////////////////////////////////////////////////
//CBA has events for zeus's display onLoad and onUnload (Need to delay a frame for display to be ready)
private _zeusDisplayChangedFNC = {
[{
private _data = !(isNull findDisplay 312);
["zeusDisplayChanged", [ACE_player, _data]] call FUNC(localEvent);
}, []] call FUNC(execNextFrame);
};
["CBA_curatorOpened", _zeusDisplayChangedFNC] call CBA_fnc_addEventHandler;
["CBA_curatorClosed", _zeusDisplayChangedFNC] call CBA_fnc_addEventHandler;
// default variables
GVAR(OldPlayerVehicle) = vehicle objNull;
GVAR(OldPlayerTurret) = [objNull] call FUNC(getTurretIndex);
@ -302,7 +331,6 @@ GVAR(OldPlayerVisionMode) = currentVisionMode objNull;
GVAR(OldCameraView) = "";
GVAR(OldVisibleMap) = false;
GVAR(OldInventoryDisplayIsOpen) = nil; //@todo check this
GVAR(OldZeusDisplayIsOpen) = false;
GVAR(OldIsCamera) = false;
// clean up playerChanged eventhandler from preinit and put it in the same PFH as the other events to reduce overhead and guarantee advantageous execution order
@ -314,13 +342,11 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
// PFH to raise varios events
[{
BEGIN_COUNTER(stateChecker);
private "_data"; // reuse one variable to reduce number of variables that have to be set to private each frame
// "playerChanged" event
_data = call FUNC(player);
private _data = call FUNC(player); // reuse one variable to reduce number of variables that have to be set to private each frame
if !(_data isEqualTo ACE_player) then {
private "_oldPlayer";
_oldPlayer = ACE_player;
private _oldPlayer = ACE_player;
ACE_player = _data;
uiNamespace setVariable ["ACE_player", _data];
@ -393,14 +419,6 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
["inventoryDisplayChanged", [ACE_player, _data]] call FUNC(localEvent);
};
// "zeusDisplayChanged" event
_data = !(isNull findDisplay 312);
if !(_data isEqualTo GVAR(OldZeusDisplayIsOpen)) then {
// Raise ACE event locally
GVAR(OldZeusDisplayIsOpen) = _data;
["zeusDisplayChanged", [ACE_player, _data]] call FUNC(localEvent);
};
// "activeCameraChanged" event
_data = call FUNC(isfeatureCameraActive);
if !(_data isEqualTo GVAR(OldIsCamera)) then {
@ -449,6 +467,7 @@ if (!isNil QGVAR(PreInit_playerChanged_PFHID)) then {
{_unit != _target && {vehicle _unit == vehicle _target}}
}] call FUNC(addCanInteractWithCondition);
["isNotInZeus", {isNull curatorCamera}] call FUNC(addCanInteractWithCondition);
//////////////////////////////////////////////////
// Set up PlayerJIP eventhandler

View File

@ -5,24 +5,27 @@
* Arguments:
* 0: Object <OBJECT>
* 1: Use effective commander name when used on vehicles (default: false) <BOOL>
* 2: Get Raw Name (Don't sanatize HTML tags `</>`) (default: false) <BOOL>
*
* Return Value:
* Object Name <STRING>
*
* Example:
* [player, false, true] call ace_common_fnc_getName;
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit", ["_showEffective", false]];
params ["_unit", ["_showEffective", false], ["_useRaw", false]];
private "_name";
_name = "";
private _name = "";
if (_unit isKindOf "CAManBase") then {
_name = _unit getVariable ["ACE_Name", localize QUOTE(DOUBLES(STR,GVAR(Unknown)))];
_name = _unit getVariable [(["ACE_Name", "ACE_NameRaw"] select _useRaw), localize QUOTE(DOUBLES(STR,GVAR(Unknown)))];
} else {
if (_showEffective) then {
_name = [effectiveCommander _unit] call FUNC(getName);
_name = [effectiveCommander _unit, false, _useRaw] call FUNC(getName);
} else {
_name = getText (configFile >> "CfgVehicles" >> typeOf _unit >> "displayName");
};

View File

@ -1,7 +1,7 @@
/*
* Author: bux578, commy2, akalegman
* Checks if a unit is a player / curator controlled unit.
* Currently returns false for non-local remote controlled zeus units. (Remotes from another zeus machine)
* This now includes both local and non-local remote controlled zeus units. (Remotes from another zeus machine)
*
* Arguments:
* 0: unit to be checked <OBJECT>
@ -10,10 +10,13 @@
* Return Value:
* Is unit a player? <BOOL>
*
* Example:
* [cursorTarget, false] call ace_common_fnc_isPlayer;
*
* Public: Yes
*/
#include "script_component.hpp"
params ["_unit", ["_excludeRemoteControlled", false]];
isPlayer _unit || (!_excludeRemoteControlled && {_unit == call FUNC(player)}) // return
(isPlayer _unit) || {(!_excludeRemoteControlled) && {!isNull (_unit getVariable ["bis_fnc_moduleRemoteControl_owner", objNull])}}

View File

@ -19,9 +19,9 @@ _requestID = ("ace_recieveRequest_f_id_"+_requestID);
_target setVariable [_requestID, _this];
if (isLocalized _requestMessage) then {
_requestMessage = format [localize _requestMessage, [_caller] call FUNC(getName)];
_requestMessage = format [localize _requestMessage, [_caller, false, true] call FUNC(getName)];
} else {
_requestMessage = format [_requestMessage, [_caller] call FUNC(getName)];
_requestMessage = format [_requestMessage, [_caller, false, true] call FUNC(getName)];
};
hint format ["%1", _requestMessage]; // @todo ?

View File

@ -7,7 +7,10 @@
* 1: Remove html tags (default: false) <BOOL>
*
* Return Value:
* Sanitized string
* Sanitized string <STRING>
*
* Example:
* ["<CoolGroup>CoolGuy", true] call ace_common_fnc_sanitizeString;
*
* Public: Yes
*/
@ -20,14 +23,14 @@ _array = [];
{
switch _x do {
case 60 : {
case 60 : { // less than symbol: `<`
if (_removeTags) then {
_array append toArray "&lt;";
} else {
_array pushBack _x;
};
};
case 62 : {
case 62 : { // greater than symbol: `>`
if (_removeTags) then {
_array append toArray "&gt;";
} else {

View File

@ -1,19 +1,24 @@
/*
* Author: esteldunedain
* ?
* Log a RPT messaged on just the server
*
* Arguments:
* ?
* 0: Text to display <STRING>
*
* Return Value:
* None
*
* Example:
* ["x happened"] call ace_common_fnc_serverLog;
*
* Public: no
*/
#include "script_component.hpp"
params [["_msg", "", [""]]];
if (isServer) then {
diag_log _this;
diag_log text _msg;
} else {
[_this, QFUNC(serverLog), 1] call FUNC(execRemoteFnc);
};

View File

@ -17,9 +17,15 @@ params ["_unit"];
if (isNull _unit || {!alive _unit}) exitWith {};
if (_unit isKindOf "CAManBase") then {
_name = [name _unit, true] call FUNC(sanitizeString);
private _sanitizedName = [name _unit, true] call FUNC(sanitizeString);
private _rawName = [name _unit, false] call FUNC(sanitizeString);
//Debug Testing Code (with html tags):
// private _sanitizedName = ["<TAG>Name", true] call FUNC(sanitizeString);
// private _rawName = ["<TAG>Name", false] call FUNC(sanitizeString);
//if (_name != _unit getVariable ["ACE_Name", ""]) then {
_unit setVariable ["ACE_Name", _name, true];
_unit setVariable ["ACE_Name", _sanitizedName, true];
_unit setVariable ["ACE_NameRaw", _rawName, true];
//};
};

View File

@ -72,7 +72,7 @@ GVAR(disarmTarget) = _target;
_icon = format [DEFUALTPATH, toLower (rank _target)];
if (_icon isEqualTo DEFUALTPATH) then {_icon = ""};
_rankPicture ctrlSetText _icon;
_playerName ctrlSetText ([GVAR(disarmTarget)] call EFUNC(common,getName));
_playerName ctrlSetText ([GVAR(disarmTarget), false, true] call EFUNC(common,getName));
//Clear both inventory lists:
lbClear _groundContainer;

View File

@ -1,3 +1,4 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
@ -6,7 +7,7 @@ class Extended_PreInit_EventHandlers {
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_clientInit));
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -26,7 +26,7 @@ class CfgVehicles {
class ACE_SelfActions {
class ResetFCS {
displayName = CSTRING(ResetFCS);
condition = QUOTE(call FUNC(canResetFCS));
condition = QUOTE(_player call FUNC(canResetFCS));
statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
showDisabled = 0;
priority = 1;
@ -39,7 +39,7 @@ class CfgVehicles {
class ACE_SelfActions {
class ResetFCS {
displayName = CSTRING(ResetFCS);
condition = QUOTE(call FUNC(canResetFCS));
condition = QUOTE(_player call FUNC(canResetFCS));
statement = QUOTE([ARR_2(vehicle _player,[_player] call DEFUNC(common,getTurretIndex))] call DFUNC(reset););
showDisabled = 0;
priority = 1;
@ -321,9 +321,13 @@ class CfgVehicles {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
/*class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};*/
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {
GVAR(Enabled) = 1;
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
};
};
@ -346,9 +350,13 @@ class CfgVehicles {
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
/*class Turrets: Turrets {
class CommanderOptics: CommanderOptics {};
};*/
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {
GVAR(Enabled) = 1;
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};
};
};
@ -362,6 +370,8 @@ class CfgVehicles {
class Turrets: Turrets {
class CommanderOptics: CommanderOptics {
GVAR(Enabled) = 1;
discreteDistance[] = {};
discreteDistanceInitIndex = 0;
};
};
};

View File

@ -16,4 +16,4 @@ if (!hasInterface) exitWith {};
}] call EFUNC(common,addEventHandler);
// Register event for global updates
[QGVAR(forceUpdate), FUNC(onForceUpdate)] call EFUNC(common,addEventHandler);
[QGVAR(forceUpdate), {ACE_player call FUNC(onForceUpdate)}] call EFUNC(common,addEventHandler);

View File

@ -14,6 +14,7 @@ PREP(onForceUpdate);
PREP(keyDown);
PREP(keyUp);
PREP(reset);
PREP(updateRangeHUD);
PREP(vehicleInit);
ADDON = true;

View File

@ -1,29 +1,27 @@
/*
* Author: KoffeinFlummi
*
* Adjusts the currently zeroed distance.
*
* Arguments:
* 0: The vehicle in question
* 1: The amount to add to the distance (can be negative)
* 0: The vehicle in question <OBJECT>
* 1: The Turrets that the Vehicle has <ARRAY>
* 2: The amount to add to the distance (can be negative) <NUMMBER>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_vehicle", "_turret", "_delta", "_turretConfig", "_min", "_max", "_distance"];
params ["_vehicle", "_turret", "_delta"];
_vehicle = _this select 0;
_turret = _this select 1;
_delta = _this select 2;
private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath);
_turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath);
private _min = getNumber (_turretConfig >> QGVAR(MinDistance));
private _max = getNumber (_turretConfig >> QGVAR(MaxDistance));
_min = getNumber (_turretConfig >> QGVAR(MinDistance));
_max = getNumber (_turretConfig >> QGVAR(MaxDistance));
_distance = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], _min];
private _distance = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], _min];
_distance = _distance + _delta;
_distance = _distance min _max;

View File

@ -1,15 +1,17 @@
/*
* Author: KoffeinFlummi
*
* Called from config. Can player reset FCS?
*
* Argument:
* Nothing
*
* Return value:
* Boolean (Bool)
* Return Value:
* Boolean <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
count ((vehicle ACE_player) getVariable [format ["%1_%2", QGVAR(Magazines), [ACE_player] call EFUNC(common,getTurretIndex)], []]) > 1
params ["_unit"];
count ((vehicle _unit) getVariable [format ["%1_%2", QGVAR(Magazines), [_unit] call EFUNC(common,getTurretIndex)], []]) > 1 // return

View File

@ -1,16 +1,16 @@
/*
* Author: commy2
*
* Called from config. Returns true if the player is a gunner and the players current vehicle has a FCS.
*
* Argument:
* Nothing
* Arguments:
* None
*
* Return value:
* Boolean (Bool)
* Return Value:
* Boolean <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
getNumber ([configFile >> "CfgVehicles" >> typeOf vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex)] call EFUNC(common,getTurretConfigPath) >> QGVAR(Enabled)) == 1
&& {cameraView == "GUNNER"}
&& {cameraView == "GUNNER"} // return

View File

@ -1,16 +1,16 @@
/*
* Author: commy2
*
* Returns true if the laser distance measurement can be read from the engine.
*
* Argument:
* Nothing
* Arguments:
* None
*
* Return value:
* Boolean (Bool)
* Return Value:
* Boolean <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
!isNull ((uiNamespace getVariable ["ACE_dlgRangefinder", displayNull]) displayCtrl 1713151)
&& {cameraView == "GUNNER"}
&& {cameraView == "GUNNER"} // return

View File

@ -1,6 +1,5 @@
/*
* Author: KoffeinFlummi
*
* Adjusts the direction of a shell.
*
* Arguments:
@ -8,58 +7,48 @@
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_vehicle", "_weapon", "_ammo", "_magazine", "_projectile", "_sumVelocity"];
params ["_vehicle", "_weapon", "", "", "_ammo", "_magazine", "_projectile"];
_vehicle = _this select 0;
_weapon = _this select 1;
_ammo = _this select 4;
_magazine = _this select 5;
_projectile = _this select 6;
private ["_gunner", "_turret"];
_gunner = [_vehicle, _weapon] call EFUNC(common,getGunner);
_turret = [_gunner] call EFUNC(common,getTurretIndex);
private _gunner = [_vehicle, _weapon] call EFUNC(common,getGunner);
private _turret = _gunner call EFUNC(common,getTurretIndex);
// Exit if the unit isn't a player
if !([_gunner] call EFUNC(common,isPlayer)) exitWith {};
private ["_FCSMagazines", "_FCSElevation", "_offset"];
_FCSMagazines = _vehicle getVariable [(format ["%1_%2", QGVAR(Magazines), _turret]), []];
_FCSElevation = _vehicle getVariable format ["%1_%2", QGVAR(Elevation), _turret];
private _FCSMagazines = _vehicle getVariable [format ["%1_%2", QGVAR(Magazines), _turret], []];
private _FCSElevation = _vehicle getVariable format ["%1_%2", QGVAR(Elevation), _turret];
if !(_magazine in _FCSMagazines) exitWith {};
// GET ELEVATION OFFSET OF CURRENT MAGAZINE
_offset = 0;
private _offset = 0;
{
if (_x == _magazine) exitWith {
_offset = _FCSElevation select _forEachIndex;
};
} forEach _FCSMagazines;
[_projectile, (_vehicle getVariable format ["%1_%2", QGVAR(Azimuth), _turret]), _offset, 0] call EFUNC(common,changeProjectileDirection);
// Remove the platform velocity
if( (vectorMagnitude velocity _vehicle) > 2) then {
_sumVelocity = (velocity _projectile) vectorDiff (velocity _vehicle);
if (vectorMagnitude velocity _vehicle > 2) then {
private _sumVelocity = (velocity _projectile) vectorDiff (velocity _vehicle);
_projectile setVelocity _sumVelocity;
};
// Air burst missile
// handle locally only
if (!local _gunner) exitWith {};
if (getNumber (configFile >> "CfgAmmo" >> _ammo >> QGVAR(Airburst)) == 1) then {
private "_zeroing";
_zeroing = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], currentZeroing _vehicle];
private _zeroing = _vehicle getVariable [format ["%1_%2", QGVAR(Distance), _turret], currentZeroing _vehicle];
if (_zeroing < 50) exitWith {};
if (_zeroing > 1500) exitWith {};

View File

@ -1,91 +1,82 @@
/*
* Author: KoffeinFlummi
*
* Calculates the angle offset necessary to hit the current target.
*
* Arguments:
* 0: distance to target in meters
* 1: current angle of the turret
* 2: maximum elevation of the turret
* 3: initSpeed of the projectile
* 4: airFriction of the projectile
* 5: maximum timeToLive of the projectile
* 6: simulationStep of the projectile
* 0: distance to target in meters <NUMBER>
* 1: current angle of the turret <NUMBER>
* 2: maximum elevation of the turret <NUMBER>
* 3: initSpeed of the projectile <NUMBER>
* 4: airFriction of the projectile <NUMBER>
* 5: maximum timeToLive of the projectile <NUMBER>
* 6: simulationStep of the projectile <NUMBER>
*
* Return Value:
* offset from the current angle necessary to hit the target
* offset from the current angle necessary to hit the target <NUMBER>
*
* Public: No
*/
#include "script_component.hpp"
#define PRECISION 0.1
private ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle1", "_angle2", "_it2", "_f1", "_f2", "_temp", "_it1", "_angle"];
_distance = _this select 0;
_angleTarget = _this select 1;
_maxElev = _this select 2;
_initSpeed = _this select 3;
_airFriction = _this select 4;
_timeToLive = _this select 5;
_simulationStep = _this select 6;
params ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep"];
if (_simulationStep == 0) exitWith {_angleTarget};
FUNC(traceBullet) = {
private ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle", "_posTargetX", "_posTargetY", "_posX", "_posY", "_velocityX", "_velocityY", "_velocityMagnitude", "_i"];
_distance = _this select 0;
_angleTarget = _this select 1;
_maxElev = _this select 2;
_initSpeed = _this select 3;
_airFriction = _this select 4;
_timeToLive = _this select 5;
_simulationStep = _this select 6;
_angle = _this select 7;
private _fnc_traceBullet = {
params ["_distance", "_angleTarget", "_maxElev", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_angle"];
_angle = _angle - _angleTarget;
_angleTarget = 0;
_posTargetX = (cos _angleTarget) * _distance;
_posTargetY = (sin _angleTarget) * _distance;
private _posTargetX = (cos _angleTarget) * _distance;
private _posTargetY = (sin _angleTarget) * _distance;
_posX = 0;
_posY = 0;
private _posX = 0;
private _posY = 0;
_velocityX = (cos _angle) * _initSpeed;
_velocityY = (sin _angle) * _initSpeed;
private _velocityX = (cos _angle) * _initSpeed;
private _velocityY = (sin _angle) * _initSpeed;
// trace the path of the bullet
for "_i" from 1 to ((floor (_timeToLive / _simulationStep)) + 1) do {
_velocityMagnitude = sqrt (_velocityX^2 + _velocityY^2);
private _velocityMagnitude = sqrt (_velocityX^2 + _velocityY^2);
_velocityX = _velocityX + _simulationStep * (_velocityX * _velocityMagnitude * _airFriction);
_velocityY = _velocityY + _simulationStep * (_velocityY * _velocityMagnitude * _airFriction - 9.81);
_posX = _posX + _velocityX * _simulationStep;
_posY = _posY + _velocityY * _simulationStep;
if (_posX >= _posTargetX) exitWith {}; // bullet passed the target
};
_posY - _posTargetY
};
if ((_this + [_maxElev]) call FUNC(traceBullet) < 0) exitWith {_maxElev - _angleTarget};
private _data = [_distance, _angleTarget, _maxElev, _initSpeed, _airFriction, _timeToLive, _simulationStep, _maxElev];
if (_data call _fnc_traceBullet < 0) exitWith {_maxElev - _angleTarget};
// Newton Method / Secand Method
_angle1 = _angleTarget;
_angle2 = _maxElev;
_it2 = 0;
_f1 = (_this + [_angle1]) call FUNC(traceBullet);
private _angle1 = _angleTarget;
private _angle2 = _maxElev;
private _it2 = 0;
_data set [7, _maxElev];
private _f1 = _data call _fnc_traceBullet;
if (abs _f1 <= PRECISION) exitWith {0};
while {abs _f1 > PRECISION} do {
_data set [7, _angle2];
private _f2 = _data call _fnc_traceBullet;
if ((abs _f1) <= PRECISION) exitWith {0};
while {(abs _f1) > PRECISION} do {
_f2 = (_this + [_angle2]) call FUNC(traceBullet);
_temp = _angle2-_f2*(_angle2-_angle1)/(_f2-_f1);
_angle1 = _angle2;
_angle2 = _temp;
_f1 = _f2;
_it2 = _it2+1;
};
//player globalChat format ["it1: %1 | _angle1: %2 | it2: %3 | _angle2: %4",_it1, _angle-_angleTarget, _it2, _angle2-_angleTarget];
_angle2 = _angle2 - _f2 * (_angle2 - _angle1) / (_f2 - _f1);
_angle=_angle2;
_angle - _angleTarget
_f1 = _f2;
_it2 = _it2 + 1;
};
_angle2 - _angleTarget

View File

@ -1,23 +1,18 @@
/*
* Author: commy2
*
* Read laser distance measurement from engine and update compatible info elements.
* Read laser distance measurement from engine.
*
* Argument:
* Nothing
* None
*
* Return value:
* Measured distance (Number)
* Measured distance <NUMBER>
*
* Public: No
*/
#include "script_component.hpp"
private ["_dlgRangefinder", "_range"];
disableSerialization;
_dlgRangefinder = uiNamespace getVariable ["ACE_dlgRangefinder", displayNull];
private _dlgRangefinder = uiNamespace getVariable ["ACE_dlgRangefinder", displayNull];
_range = ctrlText (_dlgRangefinder displayCtrl 151);
(_dlgRangefinder displayCtrl 1713151) ctrlSetText _range;
parseNumber _range
parseNumber ctrlText (_dlgRangefinder displayCtrl 151);

View File

@ -1,21 +1,32 @@
// by commy2
/*
* Author: commy2
* Handle Air burst ammunition. Called from per frame handler.
*
* Arguments:
* -
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_vehicle", "_projectile", "_zeroing", "_position", "_subMunition"];
_vehicle = _this select 0 select 0;
_projectile = _this select 0 select 1;
_zeroing = _this select 0 select 2;
(_this select 0) params ["_vehicle", "_projectile", "_zeroing"];
// remove pfh if the projectile died before arriving
if (isNull _projectile || {!alive _projectile}) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
// wait if not there
if (_projectile distance _vehicle < _zeroing) exitWith {};
_position = getPosATL _projectile;
// explode
private _position = getPosATL _projectile;
private _subMunition = createVehicle ["ACE_B_35mm_ABM_Helper", _position, [], 0, "FLY"];
_subMunition = createVehicle ["ACE_B_35mm_ABM_Helper", _position, [], 0, "FLY"];
_subMunition setPosATL _position;
_subMunition setVelocity [0, 0, -10];

View File

@ -1,23 +1,22 @@
/*
* Author: KoffeinFlummi
*
* Starts watching the target for sideways correction.
*
* Arguments:
* 0: Vehicle
* 0: Vehicle <OBJECT>
* 1: Turret <ARRAY>
*
* Return Value:
* none
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_vehicle", "_turret", "_distance", "_weaponDirection"];
params ["_vehicle", "_turret"];
_vehicle = _this select 0;
_turret = _this select 1;
_distance = call FUNC(getRange);
private _distance = call FUNC(getRange);
call (updateRangeHUD);
if !(!GVAR(enabled) && FUNC(canUseFCS)) exitWith {};
@ -28,7 +27,7 @@ if (_distance == 0) then {
_distance = [5, 5000, 0] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision
};
_weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets
private _weaponDirection = _vehicle weaponDirection (_vehicle currentWeaponTurret _turret); // @todo doesn't work for sub turrets
if (_turret isEqualTo ([_vehicle] call EFUNC(common,getTurretCommander))) then {
_weaponDirection = eyeDirection _vehicle;
@ -38,8 +37,4 @@ if (_weaponDirection isEqualTo [0,0,0]) then { // dummy value for non main turr
_weaponDirection = [1,0,0];
};
GVAR(Position) = [
(getPos _vehicle select 0) + _distance * (_weaponDirection select 0),
(getPos _vehicle select 1) + _distance * (_weaponDirection select 1),
(getPos _vehicle select 2) + _distance * (_weaponDirection select 2)
];
GVAR(Position) = (getPosASL _vehicle) vectorAdd (_weaponDirection vectorMultiply _distance);

View File

@ -1,40 +1,38 @@
/*
* Author: KoffeinFlummi
*
* Calculates the offsets for all weapons needed to hit the current target.
*
* Arguments:
* 0: The vehicle
* 0: Vehicle <OBJECT>
* 1: Turret <ARRAY>
*
* Return Value:
* none
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_vehicle", "_turret", "_turretConfig", "_distance", "_weapons", "_magazines", "_showHint", "_playSound", "_i"];
params ["_vehicle", "_turret", "_distance", ["_showHint", false], ["_playSound", true]];
_vehicle = _this select 0;
_turret = _this select 1;
private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath);
_turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _turret] call EFUNC(common,getTurretConfigPath);
call (updateRangeHUD);
_distance = call FUNC(getRange);
if (isNil "_distance") then {
_distance = call FUNC(getRange);
_weapons = _vehicle weaponsTurret _turret;
_magazines = _vehicle magazinesTurret _turret;
if (_distance == 0) then {
_distance = [
getNumber (_turretConfig >> QGVAR(DistanceInterval)),
getNumber (_turretConfig >> QGVAR(MaxDistance)),
getNumber (_turretConfig >> QGVAR(MinDistance))
] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision
if (_distance == 0) then {
_distance = [
getNumber (_turretConfig >> QGVAR(DistanceInterval)),
getNumber (_turretConfig >> QGVAR(MaxDistance)),
getNumber (_turretConfig >> QGVAR(MinDistance))
] call EFUNC(common,getTargetDistance); // maximum distance: 5000m, 5m precision
};
};
private ["_weapon", "_weaponDirection", "_angleTarget"];
_weapon = _vehicle currentWeaponTurret _turret;
_weaponDirection = _vehicle weaponDirection _weapon; // @todo doesn't work for sub turrets
private _weapon = _vehicle currentWeaponTurret _turret;
private _weaponDirection = _vehicle weaponDirection _weapon; // @todo doesn't work for sub turrets
if (_turret isEqualTo ([_vehicle] call EFUNC(common,getTurretCommander))) then {
_weaponDirection = eyeDirection _vehicle;
@ -44,176 +42,139 @@ if (_weaponDirection isEqualTo [0,0,0]) then { // dummy value for non main turr
_weaponDirection = [1,0,0];
};
_angleTarget = asin (_weaponDirection select 2);
if (count _this > 2) then {
if((_this select 2) > -1) then {
_distance = _this select 2;
};
};
if (!(isNil QGVAR(backgroundCalculation)) and {!(scriptDone GVAR(backgroundCalculation))}) then {
terminate GVAR(backgroundCalculation);
};
private ["_movingAzimuth", "_posTarget", "_velocityTarget"];
private _angleTarget = asin (_weaponDirection select 2);
// MOVING TARGETS
_movingAzimuth = 0;
if (ACE_time - GVAR(time) > 1 and GVAR(time) != -1 and count _this < 3) then {
// calculate speed of target
_posTarget = [
(getPos _vehicle select 0) + _distance * (_weaponDirection select 0),
(getPos _vehicle select 1) + _distance * (_weaponDirection select 1),
(getPos _vehicle select 2) + _distance * (_weaponDirection select 2)
];
_velocityTarget = [
((_posTarget select 0) - (GVAR(position) select 0)) / (ACE_time - GVAR(time)),
((_posTarget select 1) - (GVAR(position) select 1)) / (ACE_time - GVAR(time)),
((_posTarget select 2) - (GVAR(position) select 2)) / (ACE_time - GVAR(time))
];
private _movingAzimuth = 0;
private ["_magazineType", "_ammoType", "_initSpeed", "_airFriction", "_timeToLive", "_simulationStep", "_initSpeedCoef", "_velocityMagnitude"];
if (ACE_time - GVAR(time) > 1 && GVAR(time) != -1 && isNil {_this select 2}) then {
// calculate speed of target
private _posTarget = (getPosASL _vehicle) vectorAdd (_weaponDirection vectorMultiply _distance);
private _velocityTarget = (_posTarget vectorDiff GVAR(position)) vectorMultiply (1 / (ACE_time - GVAR(time)));
// estimate time to target
_magazineType = _vehicle currentMagazineTurret _turret;
_ammoType = getText (configFile >> "CfgMagazines" >> _magazineType >> "ammo");
_initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazineType >> "initSpeed");
_airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction");
_timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "timeToLive");
_simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "simulationStep");
private _magazine = _vehicle currentMagazineTurret _turret;
private _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo");
private _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
private _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction");
private _timeToLive = getNumber (configFile >> "CfgAmmo" >> _ammo >> "timeToLive");
private _simulationStep = getNumber (configFile >> "CfgAmmo" >> _ammo >> "simulationStep");
private _initSpeedCoef = getNumber (configFile >> "CfgWeapons" >> _weapon >> "initSpeed");
_initSpeedCoef = getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed");
if (_initSpeedCoef < 0) then {
_initSpeed = _initSpeed * -_initSpeedCoef;
_initSpeed = _initSpeed * - _initSpeedCoef;
};
if (_initSpeedCoef > 0) then {
_initSpeed = _initSpeedCoef;
};
if (_simulationStep != 0) then {
private ["_posX", "_velocityX", "_velocityY", "_timeToTarget"];
private _posX = 0;
private _velocityX = _initSpeed;
private _velocityY = 0;
private _timeToTarget = 0;
_posX = 0;
_velocityX = _initSpeed;
_velocityY = 0;
_timeToTarget = 0;
for "_i" from 1 to ((floor (_timeToLive / _simulationStep)) + 1) do {
for "_i" from 1 to (floor (_timeToLive / _simulationStep) + 1) do {
_posX = _posX + _velocityX * _simulationStep;
if (_posX >= _distance) exitWith { // bullet passed the target
_timeToTarget = _i * _simulationStep;
};
_velocityMagnitude = sqrt (_velocityX^2 + _velocityY^2);
private _velocityMagnitude = sqrt (_velocityX ^ 2 + _velocityY ^ 2);
_velocityX = _velocityX + _velocityX * _velocityMagnitude * _airFriction * _simulationStep;
_velocityY = _velocityY + _velocityY * _velocityMagnitude * _airFriction * _simulationStep - 9.81 * _simulationStep;
};
private ["_posArrival", "_dirArrival"];
// calculate offsets
_posArrival = [
(_posTarget select 0) + (_velocityTarget select 0) * _timeToTarget,
(_posTarget select 1) + (_velocityTarget select 1) * _timeToTarget,
(_posTarget select 2) + (_velocityTarget select 2) * _timeToTarget
];
_dirArrival = [
((_posArrival select 0) - (getPos _vehicle select 0)) / (_posArrival distance (getPos _vehicle)),
((_posArrival select 1) - (getPos _vehicle select 1)) / (_posArrival distance (getPos _vehicle)),
((_posArrival select 2) - (getPos _vehicle select 2)) / (_posArrival distance (getPos _vehicle))
];
private _posArrival = _posTarget vectorAdd (_velocityTarget vectorMultiply _timeToTarget);
private _dirArrival = (_posArrival vectorDiff getPosASL _vehicle) vectorMultiply (1 / (_posArrival vectorDistance getPosASL _vehicle));
_movingAzimuth = ((_dirArrival select 0) atan2 (_dirArrival select 1)) - ((_weaponDirection select 0) atan2 (_weaponDirection select 1));
_angleTarget = asin (_dirArrival select 2);
_distance = floor (_posArrival distance (getPos _vehicle));
_distance = floor (_posArrival distance (getPosASL _vehicle));
};
};
GVAR(enabled) = false;
GVAR(time) = -1;
private ["_viewDiff", "_FCSAzimuth", "_FCSMagazines", "_FCSElevation"];
// CALCULATE AZIMUTH CORRECTION
_viewDiff = _vehicle getVariable format ["%1_%2", QGVAR(ViewDiff), _turret];
_FCSAzimuth = _movingAzimuth;
private _viewDiff = _vehicle getVariable format ["%1_%2", QGVAR(ViewDiff), _turret];
private _FCSAzimuth = _movingAzimuth;
if (_viewDiff != 0) then {
_FCSAzimuth = (atan (_distance / _viewDiff) - (abs _viewDiff / _viewDiff) * 90) + _movingAzimuth;
};
// CALCULATE OFFSET
_FCSMagazines = [];
_FCSElevation = [];
private _FCSMagazines = [];
private _FCSElevation = [];
{
private ["_magazine", "_ammoType"];
_magazine = _x;
_ammoType = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo");
private _magazine = _x;
private _ammo = getText (configFile >> "CfgMagazines" >> _magazine >> "ammo");
if !(getText (configFile >> "CfgAmmo" >> _ammoType >> "simulation") == "shotMissile") then {
private ["_maxElev", "_initSpeed", "_airFriction", "_offset"];
_maxElev = getNumber (_turretConfig >> "maxElev");
_initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
_airFriction = getNumber (configFile >> "CfgAmmo" >> _ammoType >> "airFriction");
if !(getText (configFile >> "CfgAmmo" >> _ammo >> "simulation") == "shotMissile") then {
private _maxElev = getNumber (_turretConfig >> "maxElev");
private _initSpeed = getNumber (configFile >> "CfgMagazines" >> _magazine >> "initSpeed");
private _airFriction = getNumber (configFile >> "CfgAmmo" >> _ammo >> "airFriction");
{
private ["_weapon", "_muzzles", "_weaponMagazines", "_muzzleMagazines"];
_weapon = _x;
_muzzles = getArray (configFile >> "CfgWeapons" >> _weapon >> "muzzles");
_weaponMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> "magazines");
{
if (_x != "this") then {
_muzzleMagazines = getArray (configFile >> "CfgWeapons" >> _weapon >> _x >> "magazines");
_weaponMagazines append _muzzleMagazines;
};
} forEach _muzzles;
false
} count _muzzles;
if (_magazine in _weaponMagazines) exitWith {
_initSpeedCoef = getNumber(configFile >> "CfgWeapons" >> _weapon >> "initSpeed");
if (_initSpeedCoef < 0) then {
_initSpeed = _initSpeed * -_initSpeedCoef;
};
if (_initSpeedCoef > 0) then {
_initSpeed = _initSpeedCoef;
};
};
} forEach _weapons;
false
} count (_vehicle weaponsTurret _turret);
_offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance];
private _offset = "ace_fcs" callExtension format ["%1,%2,%3,%4", _initSpeed, _airFriction, _angleTarget, _distance];
_offset = parseNumber _offset;
_FCSMagazines = _FCSMagazines + [_magazine];
_FCSElevation = _FCSElevation + [_offset];
_FCSMagazines pushBack _magazine;
_FCSElevation pushBack _offset;
};
} forEach _magazines;
false
} count (_vehicle magazinesTurret _turret);
[_vehicle, format ["%1_%2", QGVAR(Distance), _turret], _distance] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Distance), _turret], _distance] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Magazines), _turret], _FCSMagazines] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Elevation), _turret], _FCSElevation] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Azimuth), _turret], _FCSAzimuth] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Azimuth), _turret], _FCSAzimuth] call EFUNC(common,setVariablePublic);
_showHint = false;
if( (count _this) > 3) then {
_showHint = _this select 3;
};
_playSound = true;
if( (count _this) > 3) then {
_playSound = _this select 4;
};
if(_playSound) then {
if (_playSound) then {
playSound "ACE_Sound_Click";
};
if(_showHint) 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 {
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);

View File

@ -1,7 +1,13 @@
#include "script_component.hpp"
if !([ACE_player, vehicle ACE_player, []] call EFUNC(common,canInteractWith)) exitWith {false};
params ["_unit"];
private _vehicle = vehicle _unit;
if !([_unit, _vehicle, []] call EFUNC(common,canInteractWith)) exitWith {false};
if !((!GVAR(enabled) && FUNC(canUseFCS)) || FUNC(canUseRangefinder)) exitWith {false};
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -1, false] call FUNC(keyDown);
[vehicle ACE_player, [ACE_player] call EFUNC(common,getTurretIndex), -1, false, false] call FUNC(keyUp);
private _turret = _unit call EFUNC(common,getTurretIndex);
[_vehicle, _turret, -1, false] call FUNC(keyDown);
[_vehicle, _turret, -1, false, false] call FUNC(keyUp);

View File

@ -1,21 +1,19 @@
/*
* Author: KoffeinFlummi
*
* Resets the FCS to default.
*
* Arguments:
* 0: Vehicle
* 0: Vehicle <OBJECT>
* 1: Turret <ARRAY>
*
* Return Value:
* none
*
* Public: No
*/
#include "script_component.hpp"
private ["_vehicle", "_turret"];
_vehicle = _this select 0;
_turret = _this select 1;
params ["_vehicle", "_turret"];
[_vehicle, format ["%1_%2", QGVAR(Distance), _turret], 0] call EFUNC(common,setVariablePublic);
[_vehicle, format ["%1_%2", QGVAR(Magazines), _turret], []] call EFUNC(common,setVariablePublic);

View File

@ -0,0 +1,18 @@
/*
* Author: commy2
* Update compatible info elements.
*
* Argument:
* None
*
* Return value:
* None
*
* Public: No
*/
#include "script_component.hpp"
disableSerialization;
private _dlgRangefinder = uiNamespace getVariable ["ACE_dlgRangefinder", displayNull];
(_dlgRangefinder displayCtrl 1713151) ctrlSetText ctrlText (_dlgRangefinder displayCtrl 151);

View File

@ -1,6 +1,5 @@
/*
* Author: KoffeinFlummi, commy2
*
* Checks if a vehicle is equipped with an FCS and if so, adds the fired event handler. Execute on server.
*
* Arguments:
@ -8,17 +7,15 @@
*
* Return Value:
* none
*
* Public: No
*/
#include "script_component.hpp"
private "_vehicle";
_vehicle = _this select 0;
params ["_vehicle"];
{
private "_turretConfig";
_turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _x] call EFUNC(common,getTurretConfigPath);
private _turretConfig = [configFile >> "CfgVehicles" >> typeOf _vehicle, _x] call EFUNC(common,getTurretConfigPath);
if (getNumber (_turretConfig >> QGVAR(Enabled)) == 1) then {
_vehicle setVariable [format ["%1_%2", QGVAR(Distance), _x], 0, true];
@ -42,4 +39,5 @@ _vehicle = _this select 0;
_vehicle setVariable [format ["%1_%2", QGVAR(ViewDiff), _x], 0, true];
};
};
} forEach allTurrets _vehicle;
false
} count allTurrets _vehicle;

View File

@ -27,7 +27,7 @@ _fingerPos = if (_sourceUnit == ACE_player) then {
_fingerPosPrecise vectorAdd [random (2*FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2*FP_RANDOMIZATION_X) - FP_RANDOMIZATION_X, random (2*FP_RANDOMIZATION_Y) - FP_RANDOMIZATION_Y]
};
_data = [ACE_diagTime, _fingerPos, ([_sourceUnit] call EFUNC(common,getName))];
_data = [ACE_diagTime, _fingerPos, ([_sourceUnit, false, true] call EFUNC(common,getName))];
HASH_SET(GVAR(fingersHash), _sourceUnit, _data);
if (GVAR(pfeh_id) == -1) then {

View File

@ -0,0 +1,11 @@
class ACE_Settings {
class GVAR(showOnInteractionMenu) {
value = 2;
typeName = "SCALAR";
isClientSettable = 1;
category = ECSTRING(interact_menu,Category_InteractionMenu);
displayName = CSTRING(showOnInteractionMenu_displayName);
description = CSTRING(showOnInteractionMenu_description);
values[] = {"$STR_A3_OPTIONS_DISABLED", CSTRING(justKeybinds), CSTRING(keysAndInteractionMenu)};
};
};

View File

@ -5,7 +5,7 @@ class CfgVehicles {
class ACE_SelfActions {
class ADDON {
displayName = CSTRING(Gestures);
condition = QUOTE(canStand _target && GVAR(ReloadMutex));
condition = QUOTE((canStand _target) && GVAR(ReloadMutex) && {GVAR(showOnInteractionMenu) == 2});
statement = "";
showDisabled = 1;
priority = 3.5;

View File

@ -12,6 +12,7 @@ class CfgPatches {
};
};
#include "ACE_Settings.hpp"
#include "CfgMovesBasic.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"

View File

@ -18,10 +18,14 @@
TRACE_1("params",_this);
if (!GVAR(ReloadMutex)) exitWith {false};
if (GVAR(showOnInteractionMenu) == 0) exitWith {false};
if !([ACE_player, objNull, []] call EFUNC(common,canInteractWith)) exitWith {false};
private _gesture = if (_this select [0,2] == "BI") then {
private _gesture = if ((_this select [0,2]) == "BI") then {
//If it starts with BI, just strip off the leading BI and use it directly
_this select [2]
} else {
//Adjust gesture based on stance:
if (((animationState ACE_player) select [0, 12]) in ["amovpercmstp", "amovpercmwlk", "amovpercmtac"] && weaponLowered ACE_player) then {
format ["%1StandLowered", _this]
} else {
@ -29,5 +33,6 @@ private _gesture = if (_this select [0,2] == "BI") then {
};
};
TRACE_1("playing gesture",_gesture);
ACE_player playAction _gesture;
true

View File

@ -3,11 +3,15 @@
{
_x params ["_currentName","_key"];
if (_currentName select [0,1] == "BI") then {
_currentName = _currentName select [2];
private _signalName = format [QGVAR(%1), _currentName];
if (_currentName select [0,2] == "BI") then {
//Don't add "ace_gestures_" prefix to BI gestures
_signalName = _currentName;
};
private _code = (compile format [QUOTE(QUOTE(QGVAR(%1)) call FUNC(playSignal);), _currentName]);
private _code = (compile format [QUOTE('%1' call FUNC(playSignal);), _signalName]);
TRACE_4("Adding KeyBind",_currentName,_signalName,_code,_key);
[
"ACE3 Gestures",

View File

@ -208,5 +208,17 @@
<Portuguese>Atacar</Portuguese>
<Italian>Attaccare</Italian>
</Key>
<Key ID="STR_ACE_Gestures_showOnInteractionMenu_displayName">
<English>Show Gestures On Interaction Menu</English>
</Key>
<Key ID="STR_ACE_Gestures_showOnInteractionMenu_description">
<English>Show gestures on the self interaction menu, or just use keybinds, or disable completely</English>
</Key>
<Key ID="STR_ACE_Gestures_justKeybinds">
<English>Just Keybinds</English>
</Key>
<Key ID="STR_ACE_Gestures_keysAndInteractionMenu">
<English>Keybinds + Interaction Menu</English>
</Key>
</Package>
</Project>

View File

@ -114,16 +114,20 @@ private _fnc_checkGoggles = {
// goggles effects main PFH
[{
BEGIN_COUNTER(goggles);
// rain
call FUNC(applyRainEffect);
// auto remove effects under water
if (GVAR(EffectsActive) && {[goggles ACE_player] call FUNC(isDivingGoggles) && {underwater ACE_player}}) then {
if (GVAR(EffectsActive) && {underwater ACE_player} && {[goggles ACE_player] call FUNC(isDivingGoggles)}) then {
call FUNC(removeRainEffect);
call FUNC(removeDirtEffect);
call FUNC(removeDustEffect);
};
// rotor wash effect
call FUNC(applyRotorWashEffect)
}, 0.5, _fnc_checkGoggles] call CBA_fnc_addPerFrameHandler;
call FUNC(applyRotorWashEffect);
END_COUNTER(goggles);
}, 0.5, []] call CBA_fnc_addPerFrameHandler;

View File

@ -15,7 +15,6 @@
*/
#include "script_component.hpp"
if (GVAR(showInThirdPerson)) exitWith {false};
if (call FUNC(externalCamera)) exitWith {false};
private ["_unit", "_effects"];

View File

@ -15,7 +15,6 @@
*/
#include "script_component.hpp"
if (GVAR(showInThirdPerson)) exitWith {};
if (call FUNC(ExternalCamera)) exitWith {};
private ["_unit", "_amount"];

View File

@ -15,4 +15,8 @@
*/
#include "script_component.hpp"
cameraView in ["EXTERNAL", "GROUP"] || EFUNC(common,isFeatureCameraActive) // return
if (GVAR(showInThirdPerson)) then {
cameraView in ["GROUP"] || EFUNC(common,isFeatureCameraActive)
} else {
cameraView in ["EXTERNAL", "GROUP"] || EFUNC(common,isFeatureCameraActive)
};

View File

@ -37,7 +37,6 @@ _effects set [BROKEN, true];
SETGLASSES(_unit,_effects);
if (getText (_config >> "ACE_OverlayCracked") != "") then {
if (GVAR(showInThirdPerson)) exitWith {};
if (call FUNC(ExternalCamera)) exitWith {};
if (isNull (GLASSDISPLAY)) then {

View File

@ -77,37 +77,6 @@ GVAR(ParsedTextCached) = [];
if (GVAR(menuBackground)==2) then {(uiNamespace getVariable [QGVAR(menuBackground), displayNull]) closeDisplay 0;};
}] call EFUNC(common,addEventHandler);
// Let key work with zeus open (not perfect, contains workaround to prevent other CBA keybindings)
["zeusDisplayChanged",{
if (_this select 1) then {
(finddisplay 312) displayAddEventHandler ["KeyUp", {
_key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind;
_key = _key select 5;
_dik = _key select 0;
_mods = _key select 1;
if ((_this select 1) == _dik) then {
if ((_this select [2,3]) isEqualTo _mods) then {
[_this,'keyup'] call CBA_events_fnc_keyHandler
};
};
}];
(finddisplay 312) displayAddEventHandler ["KeyDown", {
_key = ["ACE3 Common","ace_interact_menu_InteractKey"] call CBA_fnc_getKeybind;
_key = _key select 5;
_dik = _key select 0;
_mods = _key select 1;
if ((_this select 1) == _dik) then {
if ((_this select [2,3]) isEqualTo _mods) then {
[_this,'keydown'] call CBA_events_fnc_keyHandler
};
};
}];
};
}] call EFUNC(common,addEventHandler);
//Debug to help end users identify mods that break CBA's XEH
[{
private ["_badClassnames"];

View File

@ -80,11 +80,10 @@ if ((vehicle ACE_player) != ACE_player) exitWith {};
// systemChat format ["Add Actions for [%1] (count %2) @ %3", _typeOfHouse, (count _memPoints), diag_tickTime];
{
_helperPos = (_houseBeingScaned modelToWorld (_houseBeingScaned selectionPosition _x)) call EFUNC(common,positionToASL);
_helperObject = "Sign_Sphere25cm_F" createVehicleLocal _helperPos;
_helperObject = "ACE_LogicDummy" createVehicleLocal _helperPos;
_addedHelpers pushBack _helperObject;
_helperObject setVariable [QGVAR(building), _houseBeingScaned];
_helperObject setPosASL _helperPos;
_helperObject hideObject true;
TRACE_3("Making New Helper",_helperObject,_x,_houseBeingScaned);
{

View File

@ -0,0 +1,12 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_postInit));
};
};

View File

@ -0,0 +1,50 @@
#include "script_component.hpp"
if (!hasInterface) exitWith {};
GVAR(customFilters) = [];
GVAR(selectedFilterIndex) = -1;
["inventoryDisplayLoaded", {_this call FUNC(inventoryDisplayLoaded)}] call EFUNC(common,addEventHandler);
// add custom filters
// generate list of grenades
GVAR(Grenades_ItemList) = [];
{
GVAR(Grenades_ItemList) append getArray (configFile >> "CfgWeapons" >> "Throw" >> _x >> "magazines");
false
} count getArray (configFile >> "CfgWeapons" >> "Throw" >> "muzzles");
// make list case insensitive
GVAR(Grenades_ItemList) = [GVAR(Grenades_ItemList), {toLower _this}] call EFUNC(common,map);
// filter duplicates
GVAR(Grenades_ItemList) = GVAR(Grenades_ItemList) arrayIntersect GVAR(Grenades_ItemList);
[localize LSTRING(Grenades), QFUNC(filterGrenades)] call FUNC(addCustomFilter);
[localize LSTRING(Backpacks), QFUNC(filterBackpacks)] call FUNC(addCustomFilter);
[localize LSTRING(Uniforms), QFUNC(filterUniforms)] call FUNC(addCustomFilter);
[localize LSTRING(Vests), QFUNC(filterVests)] call FUNC(addCustomFilter);
[localize LSTRING(Headgear), QFUNC(filterHeadgear)] call FUNC(addCustomFilter);
// generate list of medical items
GVAR(Medical_ItemList) = [];
{
GVAR(Medical_ItemList) append getArray (_x >> "items");
false
} count (
("true" configClasses (configFile >> QEGVAR(Medical,Actions) >> "Basic")) +
("true" configClasses (configFile >> QEGVAR(Medical,Actions) >> "Advanced"))
);
// make list case insensitive
GVAR(Medical_ItemList) = [GVAR(Medical_ItemList), {if (_this isEqualType "") then {toLower _this}}] call EFUNC(common,map);
// filter duplicates
GVAR(Medical_ItemList) = GVAR(Medical_ItemList) arrayIntersect GVAR(Medical_ItemList);
[localize LSTRING(Medical), QFUNC(filterMedical)] call FUNC(addCustomFilter);

View File

@ -0,0 +1,64 @@
#include "script_component.hpp"
ADDON = false;
PREP(addCustomFilter);
PREP(currentItemListBox);
PREP(forceItemListUpdate);
PREP(inventoryDisplayLoaded);
PREP(onLBSelChanged);
// cache config
// items in the inventory display can only be distinguished by their lb names and pictures
// this can cause collisions (mainly weapons with attachments),
// but if the item has the same name and picture it at least shouldn't change the filter anyway
// luckily we don't need private items, so dummy and parent classes are out of the picture
if !(uiNamespace getVariable [QGVAR(configCached), false]) then {
private _fnc_addToCache = {
private _displayName = getText (_this >> "displayName");
private _picture = getText (_this >> "picture");
// list box seems to delete the leading backslash
if (_picture select [0,1] == "\") then {
_picture = _picture select [1];
};
uiNamespace setVariable [format [QGVAR(ItemKey:%1:%2), _displayName, _picture], _this];
};
// weapons and items
{
if (getNumber (_x >> "scope") > 0) then {_x call _fnc_addToCache};
false
} count (
("true" configClasses (configFile >> "CfgWeapons")) +
("true" configClasses (configFile >> "CfgGlasses"))
);
// magazines
{
if (getNumber (_x >> "scope") == 2) then {_x call _fnc_addToCache};
false
} count ("true" configClasses (configFile >> "CfgMagazines"));
// backpacks
{
if (getNumber (_x >> "scope") > 0 && {getNumber (_x >> "isBackpack") == 1}) then {_x call _fnc_addToCache};
false
} count ("true" configClasses (configFile >> "CfgVehicles"));
uiNamespace setVariable [QGVAR(configCached), true];
};
PREP(filterWeapons);
PREP(filterMagazines);
PREP(filterItems);
PREP(filterHeadgear);
PREP(filterUniforms);
PREP(filterVests);
PREP(filterBackpacks);
PREP(filterGrenades);
PREP(filterMedical);
ADDON = true;

View File

@ -6,11 +6,13 @@ class CfgPatches {
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"Pabst Mirror"};
author[] = {"Pabst Mirror, commy2"};
authorUrl = "https://github.com/PabstMirror/";
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "RscDisplayInventory.hpp"
#include "ACE_Settings.hpp"

View File

@ -0,0 +1,19 @@
/*
* Author: commy2
* Adds a custom filter list to the inventory display.
* Functions are here as strings, because list boxes can only store numbers and strings.
*
* Arguments:
* 0: Localized filter display name <STRING>
* 1: Filter function name <STRING>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params [["_filterName", "ERROR: No Name", [""]], ["_fncName", "", [""]]];
GVAR(customFilters) pushBack [_filterName, _fncName];

View File

@ -0,0 +1,30 @@
/*
* Author: commy2
* Returns the current item list box of given inventory display.
* These can be Ground, Soldier, Uniform, Backpack or Vest.
* Can also be Weapon since 1.52, but that apparently uses one of the above.
*
* Arguments:
* 0: Inventory display <DISPLAY>
*
* Return Value:
* Currently selected item list box <CONTROL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_display"];
scopeName "main";
{
private _control = _display displayCtrl _x;
if (ctrlShown _control) then {
_control breakOut "main";
};
false
} count [IDC_ITEMLIST_GROUND, IDC_ITEMLIST_SOLDIER, IDC_ITEMLIST_UNIFORM, IDC_ITEMLIST_VEST, IDC_ITEMLIST_BACKPACK];
-1

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Filter condition for the Backpacks filter list
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
getNumber (_config >> "isBackpack") == 1

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Filter condition for the Grenades filter list
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
toLower configName _config in GVAR(Grenades_ItemList)

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Filter condition for the Headgear filter list
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
getNumber (_config >> "ItemInfo" >> "type") in [TYPE_HEADGEAR, TYPE_HMD] || {isClass (configFile >> "CfgGlasses" >> configName _config)}

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Remove uniforms, vests and backpacks from Items filter.
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
!(getNumber (_config >> "ItemInfo" >> "type") in [TYPE_UNIFORM, TYPE_VESTS, TYPE_HEADGEAR]) && {!(_this call FUNC(filterBackpacks))}

View File

@ -0,0 +1,15 @@
/*
* Author: commy2
* Remove backpacks and grenades from Magazines filter.
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
!(_this call FUNC(filterBackpacks)) && {!(_this call FUNC(filterGrenades))}

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Filter condition for the Medical filter list
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
toLower configName _config in GVAR(Medical_ItemList)

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Filter condition for the Uniforms filter list
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
getNumber (_config >> "ItemInfo" >> "type") == TYPE_UNIFORM

View File

@ -0,0 +1,17 @@
/*
* Author: commy2
* Filter condition for the Vests filter list
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
params ["_config"];
getNumber (_config >> "ItemInfo" >> "type") == TYPE_VEST

View File

@ -0,0 +1,15 @@
/*
* Author: commy2
* Remove backpacks from Weapons filter.
*
* Arguments:
* 0: Item config entry <CONFIG>
*
* Return Value:
* Item should appear in this list? <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
!(_this call FUNC(filterBackpacks))

View File

@ -0,0 +1,40 @@
/*
* Author: commy2
* Updates item list and removes every entry that does not fit in the currently selected filter list.
*
* Arguments:
* 0: Inventory display <DISPLAY>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
disableSerialization;
params ["_display"];
private _index = GVAR(selectedFilterIndex);
private _itemList = _display call FUNC(currentItemListBox);
private _filterFunction = missionNamespace getVariable ((_display displayCtrl IDC_FILTERLISTS) lbData _index);
if (_filterFunction isEqualType {}) then {
private _i = 0;
while {_i < lbSize _itemList} do {
private _config = uiNamespace getVariable [
format [QGVAR(ItemKey:%1:%2), _itemList lbText _i, _itemList lbPicture _i],
configNull
];
if (!isNull _config && {!(_config call _filterFunction)}) then {
_itemList lbDelete _i;
// in case the filter function returns nil. Otherwise could lock up the game.
_i = _i - 1;
};
_i = _i + 1;
};
};

View File

@ -0,0 +1,77 @@
/*
* Author: commy2
* Executed every time an inventory display is opened.
*
* Arguments:
* 0: Inventory display <DISPLAY>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
disableSerialization;
params ["_display"];
private _filter = _display displayCtrl IDC_FILTERLISTS;
// engine defined behaviour is the following:
// lb value, data and text don't matter, only the index.
// the first three indecies are hard coded: 0 - weapons , 1 - magazines, 2 - items
// all of them show backpacks, because BI
// all other indecies show everything, so all we have to do is delete stuff we dont like
_filter ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChanged)}];
// have to add these a frame later, because this event happens before the engine adds the default filters
[{
disableSerialization;
params ["_filter"];
// remove "All", so we can push it to the back later.
// to keep localization we can keep the lbText (displayed name).
private _index = lbSize _filter - 1;
private _nameAll = _filter lbText _index;
_filter lbDelete _index;
// add additional filter functions to the default filters. These remove backpacks etc.
_filter lbSetData [0, QFUNC(filterWeapons)];
_filter lbSetData [1, QFUNC(filterMagazines)];
_filter lbSetData [2, QFUNC(filterItems)];
// add our custom filters
{
_x params ["_name", "_fncName"];
_index = _filter lbAdd _name;
_filter lbSetData [_index, _fncName];
false
} count GVAR(customFilters);
// readd "All" filter to last position and select it
_index = _filter lbAdd _nameAll;
_filter lbSetCurSel _index;
}, [_filter]] call EFUNC(common,execNextFrame);
// monitor changes that can happen and force our update
private _dummyControl = _display ctrlCreate ["RscMapControl", -1];
_dummyControl ctrlSetPosition [0,0,0,0];
_dummyControl ctrlCommit 0;
_dummyControl ctrlAddEventHandler ["Draw", {
disableSerialization;
params ["_dummyControl"];
private _display = ctrlParent _dummyControl;
private _itemList = _display call FUNC(currentItemListBox);
// monitoring is done by setting a lb value. These are unused here and are reset every time the list box updates.
if (_itemList lbValue 0 != DUMMY_VALUE) then {
_display call FUNC(forceItemListUpdate);
_itemList lbSetValue [0, DUMMY_VALUE];
};
}];

View File

@ -0,0 +1,27 @@
/*
* Author: commy2
* Executed when the filter list box is changed.
* Sets new filter list index.
*
* Arguments:
* 0: Filter list box <CONTROL>
* 1: Filter list index <NUMBER>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
disableSerialization;
params ["_filter", "_index"];
GVAR(selectedFilterIndex) = _index;
[{
disableSerialization;
params ["_display"];
[_display] call FUNC(forceItemListUpdate);
}, [ctrlParent _filter]] call EFUNC(common,execNextFrame);

View File

@ -0,0 +1 @@
#include "\z\ace\addons\inventory\script_component.hpp"

View File

@ -2,11 +2,20 @@
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_INVENTORY
#define DEBUG_MODE_FULL
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_INVENTORY
#define DEBUG_SETTINGS DEBUG_SETTINGS_INVENTORY
#define DEBUG_SETTINGS DEBUG_SETTINGS_INVENTORY
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#define IDC_FILTERLISTS 6554
#define IDC_ITEMLIST_GROUND 632
#define IDC_ITEMLIST_SOLDIER 640
#define IDC_ITEMLIST_UNIFORM 633
#define IDC_ITEMLIST_VEST 638
#define IDC_ITEMLIST_BACKPACK 619
#define DUMMY_VALUE 127

View File

@ -25,5 +25,33 @@
<Italian>Normalmente il menù inventario è scalato in base alle dimensioni interfaccia. Questa opzione di permette di ingrandirlo ulteriormente ma senza aumentare la dimensione del testo.</Italian>
<Portuguese>Normalmente o tamanho da tela do inventário é ditada pelo tamanho da UI. Isso permite aumentar o tamanho da tela de inventário, mas não aumenta o tamanho da fonte, permitindo que mais linhas sejam visualizadas.</Portuguese>
</Key>
<Key ID="STR_ACE_Inventory_Backpacks">
<English>Backpacks</English>
<German>Rucksäcke</German>
</Key>
<Key ID="STR_ACE_Inventory_Headgear">
<English>Headgear</English>
<German>Kopfbedeckungen</German>
</Key>
<Key ID="STR_ACE_Inventory_Glasses">
<English>Glasses</English>
<German>Brillen</German>
</Key>
<Key ID="STR_ACE_Inventory_Uniforms">
<English>Uniforms</English>
<German>Uniformen</German>
</Key>
<Key ID="STR_ACE_Inventory_Vests">
<English>Vests</English>
<German>Westen</German>
</Key>
<Key ID="STR_ACE_Inventory_Grenades">
<English>Grenades</English>
<German>Granaten</German>
</Key>
<Key ID="STR_ACE_Inventory_Medical">
<English>Medical</English>
<German>Sanimaterial</German>
</Key>
</Package>
</Project>

View File

@ -1,3 +1,2 @@
#include "script_component.hpp"
NO_DEDICATED;

View File

@ -81,7 +81,7 @@ _camPos = AGLToASL _camPos;
if (terrainIntersectASL [_camPos, _pL2]) exitWith {};
if (lineIntersects [_camPos, _pL2]) exitWith {};
private _size = 2 * (_range - (positionCameraToWorld [0,0,0] vectorDistance _pL)) / _range;
private _size = 2 * sqrt (1 / _distance) * (call EFUNC(common,getZoom));
drawIcon3D [
format ["\a3\weapons_f\acc\data\collimdot_%1_ca.paa", ["red", "green"] select _isGreen],

View File

@ -38,25 +38,48 @@
#define MACRO_ADDWEAPON(WEAPON,COUNT) class _xx_##WEAPON { \
weapon = #WEAPON; \
count = COUNT; \
weapon = #WEAPON; \
count = COUNT; \
}
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
name = #ITEM; \
count = COUNT; \
name = #ITEM; \
count = COUNT; \
}
#define MACRO_ADDMAGAZINE(MAGAZINE,COUNT) class _xx_##MAGAZINE { \
magazine = #MAGAZINE; \
count = COUNT; \
magazine = #MAGAZINE; \
count = COUNT; \
}
#define MACRO_ADDBACKPACK(BACKPACK,COUNT) class _xx_##BACKPACK { \
backpack = #BACKPACK; \
count = COUNT; \
backpack = #BACKPACK; \
count = COUNT; \
}
// item types
#define TYPE_DEFAULT 0
#define TYPE_MUZZLE 101
#define TYPE_OPTICS 201
#define TYPE_FLASHLIGHT 301
#define TYPE_BIPOD 302
#define TYPE_FIRST_AID_KIT 401
#define TYPE_FINS 501 // not implemented
#define TYPE_BREATHING_BOMB 601 // not implemented
#define TYPE_NVG 602
#define TYPE_GOGGLE 603
#define TYPE_SCUBA 604 // not implemented
#define TYPE_HEADGEAR 605
#define TYPE_FACTOR 607
#define TYPE_RADIO 611
#define TYPE_HMD 616
#define TYPE_BINOCULAR 617
#define TYPE_MEDIKIT 619
#define TYPE_TOOLKIT 620
#define TYPE_UAV_TERMINAL 621
#define TYPE_VEST 701
#define TYPE_UNIFORM 801
#define TYPE_BACKPACK 901
#ifdef DISABLE_COMPILE_CACHE
#define PREP(fncName) DFUNC(fncName) = compile preprocessFileLineNumbers QUOTE(PATHTOF(functions\DOUBLES(fnc,fncName).sqf))

View File

@ -5,7 +5,7 @@
#define MAJOR 3
#define MINOR 4
#define PATCHLVL 1
#define PATCHLVL 2
#define BUILD 0
#define VERSION MAJOR.MINOR.PATCHLVL.BUILD

View File

@ -17,7 +17,6 @@
<German>Kartenbeleuchtung</German>
<Polish>Oświetlenie mapy</Polish>
<Spanish>¿Iluminación de mapa?</Spanish>
<German>Kartenausleuchtung</German>
<Czech>Osvětlení mapy</Czech>
<Portuguese>Iluminação do mapa?</Portuguese>
<French>Luminosité</French>

View File

@ -44,7 +44,7 @@ if (_dir != 1) then {
deleteMarkerLocal (GVAR(drawing_tempLineMarker) select 0);
["drawing_addLineMarker", GVAR(drawing_tempLineMarker)] call EFUNC(common,globalEvent);
// Log who drew on the briefing screen
(text format ["[ACE] Server: Player %1 drew on the briefing screen", profileName]) call EFUNC(common,serverLog);
[ACE_INFOFORMAT_1("Player %1 drew on the briefing screen", profileName)] call EFUNC(common,serverLog);
} else {
GVAR(drawing_tempLineMarker) call FUNC(updateLineMarker);
GVAR(drawing_lineMarkers) pushBack (+GVAR(drawing_tempLineMarker));

View File

@ -1,3 +1,4 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));

View File

@ -1,3 +1,4 @@
class RscPicture;
class RscText;
class RscStructuredText;
@ -12,21 +13,9 @@ class RscXSliderH;
class RscDisplayInsertMarker {
onLoad = QUOTE(_this call DFUNC(initInsertMarker););
onUnload = QUOTE(_this call DFUNC(placeMarker););
// idd = 54;
movingEnable = 1;
class controlsBackground {
// class RscText_1000: RscText {idc = 1000;};
};
class controls {
// class ButtonMenuOK: RscButtonMenuOK {idc = 1;};
// class ButtonMenuCancel: RscButtonMenuCancel {idc = 2;};
// class Title: RscText {idc = 1001;};
// class Description: RscStructuredText {idc = 1100;};
// class DescriptionChannel: RscStructuredText {idc = 1101;};
// class MarkerPicture: RscPicture {idc = 102;};
// class MarkerText: RscEdit {idc = 101;};
// class MarkerChannel: RscCombo {idc = 103;};
class controls {
class MarkerShape: RscCombo {
idc = 1210;
};
@ -39,22 +28,5 @@ class RscDisplayInsertMarker {
class MarkerAngleText: RscText {
idc = 1221;
};
/*class SizeX: RscEdit {
idc = 1200;
text = "10";
x = "14 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};
class SizeY: RscEdit {
idc = 1201;
text = "10";
x = "19 * ( ((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX)";
y = "12.5 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + safezoneH - ( ((safezoneW / safezoneH) min 1.2) / 1.2))";
w = "5 * ( ((safezoneW / safezoneH) min 1.2) / 40)";
h = "1 * ( ( ((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
};*/
};
};

View File

@ -9,14 +9,13 @@
// request marker data for JIP
if (isMultiplayer && {!isServer} && {hasInterface}) then {
private "_logic";
_logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"];
private _logic = createGroup sideLogic createUnit ["Logic", [0,0,0], [], 0, "NONE"];
[QGVAR(sendMarkersJIP), [_logic]] call EFUNC(common,serverEvent);
};
GVAR(mapDisplaysWithDrawEHs) = [];
GVAR(currentMarkerPosition) = [];
GVAR(currentMarkerAngle) = 0;
GVAR(currentMarkerColorConfigName) = "";
GVAR(currentMarkerConfigName) = "";
GVAR(currentMarkerConfigName) = "";

View File

@ -2,8 +2,10 @@
ADDON = false;
PREP(getEnabledChannels);
PREP(initInsertMarker);
PREP(mapDrawEH);
PREP(onLBSelChangedChannel);
PREP(onLBSelChangedColor);
PREP(onLBSelChangedShape);
PREP(onSliderPosChangedAngle);
@ -12,19 +14,19 @@ PREP(sendMarkersJIP);
PREP(setMarkerJIP);
PREP(setMarkerNetwork);
private ["_config", "_marker", "_a", "_scope", "_icon", "_rgba", "_name"];
// init marker types
if (isNil QGVAR(MarkersCache)) then {
_config = configFile >> "CfgMarkers";
GVAR(MarkersCache) = [];
private _config = configfile >> "CfgMarkers";
for "_a" from 0 to (count _config - 1) do {
_marker = _config select _a;
_scope = getNumber (_marker >> "scope");
if (_scope == 2) then {
_name = getText (_marker >> "name");
_icon = getText (_marker >> "icon");
private _marker = _config select _a;
if (getNumber (_marker >> "scope") == 2) then {
private _name = getText (_marker >> "name");
private _icon = getText (_marker >> "icon");
GVAR(MarkersCache) pushBack [_name, _a, _icon];
};
};
@ -32,22 +34,25 @@ if (isNil QGVAR(MarkersCache)) then {
// init marker colors
if (isNil QGVAR(MarkerColorsCache)) then {
_config = configFile >> "CfgMarkerColors";
GVAR(MarkerColorsCache) = [];
private _config = configfile >> "CfgMarkerColors";
for "_a" from 0 to (count _config - 1) do {
_marker = _config select _a;
_scope = getNumber (_marker >> "scope");
if (_scope == 2) then {
_name = getText (_marker >> "name");
_rgba = getArray (_marker >> "color");
private _marker = _config select _a;
if (getNumber (_marker >> "scope") == 2) then {
private _name = getText (_marker >> "name");
private _rgba = getArray (_marker >> "color");
{
if (!( _x isEqualType 0)) then {
if !( _x isEqualType 0) then {
_rgba set [_forEachIndex, call compile _x];
};
} forEach _rgba;
_rgba params ["_red", "_green", "_blue", "_alpha"];
_icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _red, _green, _blue, _alpha];
private _icon = format ["#(argb,8,8,3)color(%1,%2,%3,%4)", _red, _green, _blue, _alpha];
GVAR(MarkerColorsCache) pushBack [_name, _a, _icon];
};

View File

@ -0,0 +1,54 @@
/*
* Author: commy2
* Return enabled channels.
*
* Arguments:
* 0: false - use channel id, true - use localized channel names <BOOl> (default: false)
*
* Return Value:
* Enabled Channels <ARRAY>
*
* Public: No
*/
#include "script_component.hpp"
params [["_localize", false, [false]]];
private _currentChannel = currentChannel;
private _enabledChannels = [];
if (_localize) then {
if (setCurrentChannel 0) then {
_enabledChannels pushBack localize "str_channel_global";
};
if (setCurrentChannel 1) then {
_enabledChannels pushBack localize "str_channel_side";
};
if (setCurrentChannel 2) then {
_enabledChannels pushBack localize "str_channel_command";
};
if (setCurrentChannel 3) then {
_enabledChannels pushBack localize "str_channel_group";
};
if (setCurrentChannel 4) then {
_enabledChannels pushBack localize "str_channel_vehicle";
};
if (setCurrentChannel 5) then {
_enabledChannels pushBack localize "str_channel_direct";
};
} else {
for "_i" from 0 to 5 do {
if (setCurrentChannel _i) then {
_enabledChannels pushBack _i;
};
};
};
setCurrentChannel _currentChannel;
_enabledChannels

View File

@ -16,53 +16,61 @@
*/
#include "script_component.hpp"
#define BORDER 0.005
#define BORDER 0.005
[{
private ["_text", "_picture", "_channel", "_buttonOK", "_buttonCancel", "_description", "_title", "_descriptionChannel", "_sizeX", "_sizeY", "_aceShapeLB", "_aceColorLB", "_aceAngleSlider", "_aceAngleSliderText", "_mapIDD", "_pos", "_offsetButtons", "_buttonOk", "_curSelShape", "_curSelColor", "_curSelAngle"];
disableserialization;
params ["_display"];
TRACE_1("params",_display);
//Can't place markers when can't interact
if (!([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith))) exitWith {
if !([ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)) exitWith {
_display closeDisplay 2; //emulate "Cancel" button
};
//BIS Controls:
_text = _display displayctrl 101;
_picture = _display displayctrl 102;
_channel = _display displayctrl 103;
_buttonOK = _display displayctrl 1;
_buttonCancel = _display displayctrl 2;
_description = _display displayctrl 1100;
_title = _display displayctrl 1001;
_descriptionChannel = _display displayctrl 1101;
private _text = _display displayctrl 101;
private _picture = _display displayctrl 102;
private _channel = _display displayctrl 103;
private _buttonOK = _display displayctrl 1;
private _buttonCancel = _display displayctrl 2;
private _description = _display displayctrl 1100;
private _title = _display displayctrl 1001;
private _descriptionChannel = _display displayctrl 1101;
//ACE Controls:
// _sizeX = _display displayctrl 1200;
// _sizeY = _display displayctrl 1201;
_aceShapeLB = _display displayctrl 1210;
_aceColorLB = _display displayctrl 1211;
_aceAngleSlider = _display displayctrl 1220;
_aceAngleSliderText = _display displayctrl 1221;
private _aceShapeLB = _display displayctrl 1210;
private _aceColorLB = _display displayctrl 1211;
private _aceAngleSlider = _display displayctrl 1220;
private _aceAngleSliderText = _display displayctrl 1221;
////////////////////
// Install MapDrawEH on current map
private _mapIDD = -1;
//Install MapDrawEH on current map
_mapIDD = -1;
{
if (!isNull (findDisplay _x)) exitWith {_mapIDD = _x};
} forEach [12, 37, 52, 53, 160];
if (_mapIDD == -1) exitWith {ERROR("No Map?");};
if (!(_mapIDD in GVAR(mapDisplaysWithDrawEHs))) then {
GVAR(mapDisplaysWithDrawEHs) pushBack _mapIDD;
((finddisplay _mapIDD) displayctrl 51) ctrlAddEventHandler ["Draw", {_this call FUNC(mapDrawEH)}];
if (!isNull (findDisplay _x)) exitWith {
_mapIDD = _x;
};
false
} count [12, 37, 52, 53, 160];
if (_mapIDD == -1) exitWith {
ERROR("No Map?");
};
//Calculate center position of the marker placement ctrl
_pos = ctrlPosition _picture;
if !(_mapIDD in GVAR(mapDisplaysWithDrawEHs)) then {
GVAR(mapDisplaysWithDrawEHs) pushBack _mapIDD;
((finddisplay _mapIDD) displayctrl 51) ctrlAddEventHandler ["Draw", {_this call FUNC(mapDrawEH)}]; // @todo check if persistent
};
////////////////////
// Calculate center position of the marker placement ctrl
private _pos = ctrlPosition _picture;
_pos = [(_pos select 0) + (_pos select 2) / 2, (_pos select 1) + (_pos select 3) / 2];
GVAR(currentMarkerPosition) = ((findDisplay _mapIDD) displayCtrl 51) ctrlMapScreenToWorld _pos;
//Hide the bis picture:
@ -77,98 +85,116 @@
//--- Background
_pos = ctrlposition _text;
_pos params ["_posX", "_posY", "_posW", "_posH"];
_pos params ["_posX", "_posY", "_posW", "_posH"];
_posX = _posX + 0.01;
_posY = _posY min ((safeZoneH + safeZoneY) - (8 * _posH + 8 * BORDER)); //prevent buttons being placed below bottom edge of screen
_pos set [0,_posX];
_pos set [1,_posY];
_text ctrlsetposition _pos;
_text ctrlcommit 0;
_pos set [0, _posX];
_pos set [1, _posY];
_text ctrlSetPosition _pos;
_text ctrlCommit 0;
//--- Title
_pos set [1,_posY - 2*_posH - BORDER];
_pos set [3,_posH];
_title ctrlsetposition _pos;
_title ctrlcommit 0;
_pos set [1, _posY - 2 * _posH - BORDER];
_pos set [3, _posH];
_title ctrlSetPosition _pos;
_title ctrlCommit 0;
//--- Description
_pos set [1,_posY - 1*_posH];
_pos set [3,6*_posH + 6 * BORDER];
_description ctrlenable false;
_description ctrlsetposition _pos;
_description ctrlsetstructuredtext parsetext format ["<t size='0.8'>%1</t>", (localize "str_lib_label_description")];
_description ctrlcommit 0;
_pos set [1, _posY - 1 * _posH];
_pos set [3,6 * _posH + 6 * BORDER];
_description ctrlEnable false;
_description ctrlSetPosition _pos;
_description ctrlSetStructuredText parseText format ["<t size='0.8'>%1</t>", localize "str_lib_label_description"];
_description ctrlCommit 0;
//--- Shape
_pos set [1,_posY + 1 * _posH + 2 * BORDER];
_pos set [2,_posW];
_pos set [3,_posH];
_aceShapeLB ctrlsetposition _pos;
_aceShapeLB ctrlcommit 0;
_pos set [1, _posY + 1 * _posH + 2 * BORDER];
_pos set [2, _posW];
_pos set [3, _posH];
_aceShapeLB ctrlSetPosition _pos;
_aceShapeLB ctrlCommit 0;
//--- Color
_pos set [1,_posY + 2 * _posH + 3 * BORDER];
_pos set [2,_posW];
_aceColorLB ctrlsetposition _pos;
_aceColorLB ctrlcommit 0;
_pos set [1, _posY + 2 * _posH + 3 * BORDER];
_pos set [2, _posW];
_aceColorLB ctrlSetPosition _pos;
_aceColorLB ctrlCommit 0;
//--- Angle
_pos set [1,_posY + 3 * _posH + 4 * BORDER];
_pos set [2,_posW];
_aceAngleSlider ctrlsetposition _pos;
_aceAngleSlider ctrlcommit 0;
_pos set [1, _posY + 3 * _posH + 4 * BORDER];
_pos set [2, _posW];
_aceAngleSlider ctrlSetPosition _pos;
_aceAngleSlider ctrlCommit 0;
//--- Angle Text
_pos set [1,_posY + 4 * _posH + 5 * BORDER];
_pos set [2,_posW];
_aceAngleSliderText ctrlsetposition _pos;
_aceAngleSliderText ctrlcommit 0;
_pos set [1, _posY + 4 * _posH + 5 * BORDER];
_pos set [2, _posW];
_aceAngleSliderText ctrlSetPosition _pos;
_aceAngleSliderText ctrlCommit 0;
private _offsetButtons = 0;
_offsetButtons = 0;
if (isMultiplayer) then {
_pos set [1,_posY + 5 * _posH + 7 * BORDER];
_pos set [3,_posH];
_descriptionChannel ctrlsetstructuredtext parsetext format ["<t size='0.8'>%1</t>", (localize "str_a3_cfgvehicles_modulerespawnposition_f_arguments_marker_0") + ":"];
_descriptionChannel ctrlsetposition _pos;
_descriptionChannel ctrlcommit 0;
_descriptionChannel ctrlSetStructuredText parseText format ["<t size='0.8'>%1:</t>", localize "str_a3_cfgvehicles_modulerespawnposition_f_arguments_marker_0"];
_descriptionChannel ctrlSetPosition _pos;
_descriptionChannel ctrlCommit 0;
_pos set [1,_posY + 6 * _posH + 7 * BORDER];
_pos set [3,_posH];
_channel ctrlsetposition _pos;
_channel ctrlcommit 0;
_channel ctrlSetPosition _pos;
_channel ctrlCommit 0;
// channels are added by engine and not script. we have to manually delete them. requires channel names to be unique?
private _enabledChannels = true call FUNC(getEnabledChannels);
private _i = 0;
while {_i < lbSize _channel} do {
private _channelName = _channel lbText _i;
// _enabledChannels can not include custom channels names. Therefore also check if it's a custom one. Blame BI if the unit should not access the channel.
if (_channelName in _enabledChannels || {!(_channelName in CHANNEL_NAMES)}) then {
_i = _i + 1;
} else {
_channel lbDelete _i;
};
};
private _currentChannelName = CHANNEL_NAMES param [currentChannel, localize "str_channel_group"];
// select current channel in list box, must be done after lbDelete
for "_j" from 0 to (lbSize _channel - 1) do {
if (_channel lbText _j == _currentChannelName) then {
_channel lbSetCurSel _j;
};
};
_channel ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedChannel)}];
_offsetButtons = 7 * _posH + 8 * BORDER;
} else {
_descriptionChannel ctrlshow false;
_channel ctrlshow false;
_descriptionChannel ctrlShow false;
_channel ctrlShow false;
_offsetButtons = 5 * _posH + 7 * BORDER;
};
//--- ButtonOK
_pos set [1,_posY + _offsetButtons];
_pos set [2,_posW / 2 - BORDER];
_pos set [3,_posH];
_buttonOk ctrlsetposition _pos;
_buttonOk ctrlcommit 0;
_pos set [1, _posY + _offsetButtons];
_pos set [2, _posW / 2 - BORDER];
_pos set [3, _posH];
_buttonOk ctrlSetPosition _pos;
_buttonOk ctrlCommit 0;
//--- ButtonCancel
_pos set [0,_posX + _posW / 2];
_pos set [1,_posY + _offsetButtons];
_pos set [2,_posW / 2];
_pos set [3,_posH];
_buttonCancel ctrlsetposition _pos;
_buttonCancel ctrlcommit 0;
//--- PositionX
/*_pos set [1,_posY + 2 * _posH + 3 * BORDER];
_sizeX ctrlsetposition _pos;
_sizeX ctrlcommit 0;*/
//--- PositionY
/*_pos set [1,_posY + 2 * _posH + 3 * BORDER];
_sizeY ctrlsetposition _pos;
_sizeY ctrlcommit 0;*/
_pos set [0, _posX + _posW / 2];
_pos set [1, _posY + _offsetButtons];
_pos set [2, _posW / 2];
_pos set [3, _posH];
_buttonCancel ctrlSetPosition _pos;
_buttonCancel ctrlCommit 0;
////////////////////
// init marker shape lb
lbClear _aceShapeLB;
{
@ -177,14 +203,15 @@
_aceShapeLB lbSetValue [_forEachIndex, _set];
_aceShapeLB lbSetPicture [_forEachIndex, _pic];
} forEach GVAR(MarkersCache);
_curSelShape = GETGVAR(curSelMarkerShape,0);
private _curSelShape = GETGVAR(curSelMarkerShape,0);
_aceShapeLB lbSetCurSel _curSelShape;
//Update now and add eventHandler:
[_aceShapeLB, _curSelShape] call FUNC(onLBSelChangedShape);
_aceShapeLB ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedShape)}];
////////////////////
// init marker color lb
lbClear _aceColorLB;
{
@ -193,20 +220,22 @@
_aceColorLB lbSetValue [_forEachIndex, _set];
_aceColorLB lbSetPicture [_forEachIndex, _pic];
} forEach GVAR(MarkerColorsCache);
_curSelColor = GETGVAR(curSelMarkerColor,0);
private _curSelColor = GETGVAR(curSelMarkerColor,0);
_aceColorLB lbSetCurSel _curSelColor;
//Update now and add eventHandler:
[_aceColorLB, _curSelColor] call FUNC(onLBSelChangedColor);
_aceColorLB ctrlAddEventHandler ["LBSelChanged", {_this call FUNC(onLBSelChangedColor)}];
////////////////////
// init marker angle slider
_aceAngleSlider sliderSetRange [-180, 180];
_curSelAngle = GETGVAR(currentMarkerAngle,0);
private _curSelAngle = GETGVAR(currentMarkerAngle,0);
_aceAngleSlider sliderSetPosition _curSelAngle;
//Update now and add eventHandler:
[_aceAngleSlider, _curSelAngle] call FUNC(onSliderPosChangedAngle);
_aceAngleSlider ctrlAddEventHandler ["SliderPosChanged", {_this call FUNC(onSliderPosChangedAngle)}];
}, _this] call EFUNC(common,execNextFrame);

View File

@ -15,32 +15,42 @@
*/
#include "script_component.hpp"
private ["_sizeX", "_sizeY", "_textureConfig", "_texture", "_markerSize", "_markerShadow", "_colorConfig", "_drawColor"];
params ["_theMap"];
// TRACE_1("params",_theMap);
//Only show if marker place is open:
if (isNull (findDisplay 54)) exitWith {};
if (isNull findDisplay 54) exitWith {};
//Error checking:
if ((GVAR(currentMarkerConfigName) == "") || {GVAR(currentMarkerColorConfigName) == ""} || {GVAR(currentMarkerPosition) isEqualTo []}) exitWith {ERROR("Bad Data");};
if (GVAR(currentMarkerConfigName) == "" || {GVAR(currentMarkerColorConfigName) == ""} || {GVAR(currentMarkerPosition) isEqualTo []}) exitWith {
ERROR("Bad Data");
};
_sizeX = 1;
_sizeY = 1;
private _sizeX = 1;
private _sizeY = 1;
_textureConfig = configFile >> "CfgMarkers" >> GVAR(currentMarkerConfigName);
_texture = getText (_textureConfig >> "icon");
_markerSize = getNumber (_textureConfig >> "size");
_markerShadow = getNumber (_textureConfig >> "shadow");
_colorConfig = (configFile >> "CfgMarkerColors" >> GVAR(currentMarkerColorConfigName));
_drawColor = getArray (_colorConfig >> "color");
private _textureConfig = configFile >> "CfgMarkers" >> GVAR(currentMarkerConfigName);
private _texture = getText (_textureConfig >> "icon");
private _markerSize = getNumber (_textureConfig >> "size");
private _markerShadow = getNumber (_textureConfig >> "shadow");
private _colorConfig = (configFile >> "CfgMarkerColors" >> GVAR(currentMarkerColorConfigName));
private _drawColor = getArray (_colorConfig >> "color");
//Convert possible code into numbers
{
if (_x isEqualType "") then {
_drawColor set [_forEachIndex, (call compile _x)];
_drawColor set [_forEachIndex, call compile _x];
};
} forEach _drawColor;
_drawColor set [3, ((_drawColor select 3) * 0.875)]; //Arma adds a slight transparency
_theMap drawIcon [_texture, _drawColor, GVAR(currentMarkerPosition), (_sizeX * _markerSize), (_sizeY * _markerSize), GVAR(currentMarkerAngle), "", _markerShadow];
_drawColor set [3, (_drawColor select 3) * 0.875]; //Arma adds a slight transparency
_theMap drawIcon [
_texture,
_drawColor,
GVAR(currentMarkerPosition),
_sizeX * _markerSize,
_sizeY * _markerSize,
GVAR(currentMarkerAngle),
"",
_markerShadow
];

View File

@ -0,0 +1,21 @@
/*
* Author: commy2
* When the channel list box is changed.
*
* Arguments:
* 0: Channel ListBox (idc 103) <CONTROL>
* 1: Selected Index <NUMBER>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
params ["_ctrl", "_index"];
TRACE_2("params",_ctrl,_index);
private _channelName = _ctrl lbText _index;
setCurrentChannel (CHANNEL_NAMES find _channelName);

View File

@ -16,15 +16,13 @@
*/
#include "script_component.hpp"
private ["_data", "_config"];
params ["_ctrl", "_index"];
TRACE_2("params",_ctrl,_index);
_data = _ctrl lbValue _index;
private _data = _ctrl lbValue _index;
GVAR(curSelMarkerColor) = _index;
_config = (configFile >> "CfgMarkerColors") select _data;
private _config = (configFile >> "CfgMarkerColors") select _data;
GVAR(currentMarkerColorConfigName) = (configName _config);
GVAR(currentMarkerColorConfigName) = configName _config;

View File

@ -16,15 +16,13 @@
*/
#include "script_component.hpp"
private ["_data", "_config"];
params ["_ctrl", "_index"];
TRACE_2("params",_ctrl,_index);
_data = _ctrl lbValue _index;
private _data = _ctrl lbValue _index;
GVAR(curSelMarkerShape) = _index;
_config = (configFile >> "CfgMarkers") select _data;
private _config = (configFile >> "CfgMarkers") select _data;
GVAR(currentMarkerConfigName) = (configName _config);
GVAR(currentMarkerConfigName) = configName _config;

View File

@ -16,12 +16,11 @@
*/
#include "script_component.hpp"
private ["_direction"];
params ["_ctrl", "_data"];
TRACE_2("params",_ctrl,_data);
_direction = round _data;
private _direction = round _data;
if (_direction < 0) then {
_direction = _direction + 360;
};

View File

@ -21,16 +21,15 @@ params ["_display", "_closeNum"];
TRACE_2("params",_display,_closeNum);
if (_closeNum == 1) then {
// set and send marker data the next frame. the actual marker isn't created yet
[{
[QGVAR(setMarkerNetwork), [
allMapMarkers select (count allMapMarkers - 1), [
GETGVAR(currentMarkerConfigName,""),
GETGVAR(currentMarkerColorConfigName,""),
GETGVAR(currentMarkerPosition,[]),
GETGVAR(currentMarkerAngle,0)
]
allMapMarkers select (count allMapMarkers - 1), [
GETGVAR(currentMarkerConfigName,""),
GETGVAR(currentMarkerColorConfigName,""),
GETGVAR(currentMarkerPosition,[]),
GETGVAR(currentMarkerAngle,0)
]
]] call EFUNC(common,globalEvent);
}, []] call EFUNC(common,execNextFrame);

View File

@ -21,31 +21,34 @@ params ["_allMapMarkers", "_allMapMarkersProperties", "_logic"];
TRACE_3("params",_allMapMarkers,_allMapMarkersProperties,_logic);
{
private ["_index", "_data", "_config"];
_index = _allMapMarkers find _x;
private _index = _allMapMarkers find _x;
if (_index != -1) then {
_data = _allMapMarkersProperties select _index;
_data params ["_name", "_color", "_pos", "_dir"];
private _data = _allMapMarkersProperties select _index;
_data params ["_markerClassname", "_colorClassname", "_pos", "_dir"];
private _config = (configfile >> "CfgMarkers") >> _markerClassname;
_config = (configFile >> "CfgMarkers") >> _name;
if (!isClass _config) then {
WARNING("CfgMarker not found, changed to milDot");
_config == (configFile >> "CfgMarkers" >> "MilDot");
_config = configFile >> "CfgMarkers" >> "MilDot";
};
_x setMarkerTypeLocal (configName _config);
_config = (configFile >> "CfgMarkerColors") >> _color;
_x setMarkerTypeLocal configName _config;
_config = configfile >> "CfgMarkerColors" >> _colorClassname;
if (!isClass _config) then {
WARNING("CfgMarkerColors not found, changed to Default");
_config == (configFile >> "CfgMarkerColors" >> "Default");
_config = configFile >> "CfgMarkerColors" >> "Default";
};
_x setMarkerColorLocal (configName _config);
_x setMarkerColorLocal configName _config;
_x setMarkerPosLocal _pos;
_x setMarkerDirLocal _dir;
};
} forEach allMapMarkers;
false
} count allMapMarkers;
deleteVehicle _logic;

View File

@ -17,38 +17,37 @@
*/
#include "script_component.hpp"
private ["_config"];
params ["_marker", "_data"];
_data params ["_markerClassname", "_colorClassname", "_markerPos", "_markerDir"];
TRACE_2("params",_marker,_data);
_data params ["_markerClassname", "_colorClassname", "_pos", "_dir"];
private _config = configfile >> "CfgMarkers" >> _markerClassname;
_config = (configFile >> "CfgMarkers") >> _markerClassname;
if (!isClass _config) then {
WARNING("CfgMarker not found, changed to milDot");
_config == (configFile >> "CfgMarkers" >> "MilDot");
_config = configFile >> "CfgMarkers" >> "MilDot";
};
_marker setMarkerTypeLocal (configName _config);
_config = (configFile >> "CfgMarkerColors") >> _colorClassname;
_marker setMarkerTypeLocal configName _config;
_config = configfile >> "CfgMarkerColors" >> _colorClassname;
if (!isClass _config) then {
WARNING("CfgMarkerColors not found, changed to Default");
_config == (configFile >> "CfgMarkerColors" >> "Default");
_config = configFile >> "CfgMarkerColors" >> "Default";
};
_marker setMarkerColorLocal configName _config;
_marker setMarkerPosLocal _markerPos;
_marker setMarkerDirLocal _markerDir;
_marker setMarkerPosLocal _pos;
_marker setMarkerDirLocal _dir;
// save properties on server machine for JIP, marker editing ready
if (isMultiplayer && {isServer}) then {
private ["_allMapMarkers", "_allMapMarkersProperties", "_index"];
private _allMapMarkers = GETGVAR(allMapMarkers,[]);
private _allMapMarkersProperties = GETGVAR(allMapMarkersProperties,[]);
_allMapMarkers = GETGVAR(allMapMarkers,[]);
_allMapMarkersProperties = GETGVAR(allMapMarkersProperties,[]);
_index = _allMapMarkers find _marker;
private _index = _allMapMarkers find _marker;
if (_index == -1) then {
_allMapMarkers pushBack _marker;

View File

@ -9,4 +9,13 @@
#define DEBUG_SETTINGS DEBUG_ENABLED_MARKERS
#endif
#include "\z\ace\addons\main\script_macros.hpp"
#include "\z\ace\addons\main\script_macros.hpp"
#define CHANNEL_NAMES [ \
localize "str_channel_global", \
localize "str_channel_side", \
localize "str_channel_command", \
localize "str_channel_group", \
localize "str_channel_vehicle", \
localize "str_channel_direct" \
]

View File

@ -27,7 +27,10 @@ class ACE_Medical_Actions {
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = { {"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} };
litter[] = {
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class Morphine: Bandage {
displayName = CSTRING(Inject_Morphine);
@ -163,12 +166,19 @@ class ACE_Medical_Actions {
animationCallerProne = "AinvPpneMstpSlayW[wpn]Dnon_medicOther";
animationCallerSelf = "AinvPknlMstpSlayW[wpn]Dnon_medic";
animationCallerSelfProne = "AinvPpneMstpSlayW[wpn]Dnon_medic";
litter[] = { {"All", "_previousDamage > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}}, {"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}} };
litter[] = {
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class PackingBandage: fieldDressing {
displayName = CSTRING(Actions_PackingBandage);
items[] = {"ACE_packingBandage"};
litter[] = { {"All", "", {"ACE_MedicalLitter_packingBandage"}}};
litter[] = {
{"All", "", {"ACE_MedicalLitter_packingBandage"}},
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class ElasticBandage: fieldDressing {
displayName = CSTRING(Actions_ElasticBandage);
@ -177,7 +187,11 @@ class ACE_Medical_Actions {
class QuikClot: fieldDressing {
displayName = CSTRING(Actions_QuikClot);
items[] = {"ACE_quikclot"};
litter[] = { {"All", "", {"ACE_MedicalLitter_QuickClot"}}};
litter[] = {
{"All", "", {"ACE_MedicalLitter_QuickClot"}},
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class Tourniquet: fieldDressing {
displayName = CSTRING(Apply_Tourniquet);
@ -296,9 +310,9 @@ class ACE_Medical_Actions {
animationCallerSelf = "";
animationCallerSelfProne = "";
litter[] = { {"All", "", {"ACE_MedicalLitter_gloves"}},
{"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}} },
{"All", "_previousDamage > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_previousDamage <= 0", {"ACE_MedicalLitter_clean"}}
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnSelection > 0", {{"ACE_MedicalLitterBase", "ACE_MedicalLitter_bandage1", "ACE_MedicalLitter_bandage2", "ACE_MedicalLitter_bandage3"}}},
{"All", "_bloodLossOnSelection <= 0", {"ACE_MedicalLitter_clean"}}
};
};
class CheckPulse: fieldDressing {

View File

@ -60,6 +60,6 @@ if (_selectionName in ["hand_l","hand_r"] && {[_unit, _selectionName] call FUNC(
["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)], 1.75, _caller]] call EFUNC(common,targetEvent);
if (_logOutPut != "") then {
[_target,"activity", LSTRING(Check_Bloodpressure_Log), [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);
[_target,"quick_view", LSTRING(Check_Bloodpressure_Log), [[_caller] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);
[_target,"activity", LSTRING(Check_Bloodpressure_Log), [[_caller, false, true] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);
[_target,"quick_view", LSTRING(Check_Bloodpressure_Log), [[_caller, false, true] call EFUNC(common,getName), _logOutPut]] call FUNC(addToLog);
};

View File

@ -21,5 +21,5 @@ _output = [LSTRING(Check_Response_Unresponsive), LSTRING(Check_Response_Responsi
["displayTextStructured", [_caller], [[_output, [_target] call EFUNC(common,getName)], 2, _caller]] call EFUNC(common,targetEvent);
[_target,"activity",_output, [[_target] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target,"quick_view",_output, [[_target] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target,"activity",_output, [[_target, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target,"quick_view",_output, [[_target, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);

View File

@ -9,7 +9,7 @@
* 3: The treatment classname <STRING>
* 4: ?
* 5: Users of Items <?>
* 6: Previous Damage <NUMBER>
* 6: Blood Loss on selection (previously called _previousDamage) <NUMBER>
*
* Return Value:
* None
@ -22,7 +22,10 @@
#define MIN_ENTRIES_LITTER_CONFIG 3
private ["_config", "_litter", "_createLitter", "_position", "_createdLitter"];
params ["_caller", "_target", "_selectionName", "_className", "", "_usersOfItems", "_previousDamage"];
params ["_caller", "_target", "_selectionName", "_className", "", "_usersOfItems", "_bloodLossOnSelection"];
//Ensures comptibilty with other possible medical treatment configs
private _previousDamage = _bloodLossOnSelection;
if !(GVAR(allowLitterCreation)) exitwith {};
if (vehicle _caller != _caller || vehicle _target != _target) exitwith {};
@ -72,7 +75,7 @@ _createdLitter = [];
_litterCondition = missionNamespace getVariable _litterCondition;
if (!(_litterCondition isEqualType {})) then {_litterCondition = {false}};
};
if !([_caller, _target, _selectionName, _className, _usersOfItems, _previousDamage] call _litterCondition) exitwith {};
if !([_caller, _target, _selectionName, _className, _usersOfItems, _bloodLossOnSelection] call _litterCondition) exitwith {};
if (_litterOptions isEqualType []) then {
// Loop through through the litter options and place the litter

View File

@ -16,7 +16,7 @@
if(!hasInterface) exitWith { false };
params ["_litterClass", "_position", "_unit"];
params ["_litterClass", "_position", "_direction"];
private["_litterObject", "_maxLitterCount"];
//IGNORE_PRIVATE_WARNING(_values);

View File

@ -30,7 +30,7 @@ if (GVAR(level) > 1 && {(random 1) >= 0.6}) then {
_target setVariable [QGVAR(bloodPressure), [50,70]];
};
[_target, "activity", LSTRING(Activity_CPR), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_CPR), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
[_target, "activity", LSTRING(Activity_CPR), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_CPR), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
true;

View File

@ -19,8 +19,8 @@
#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
[_target, "activity", LSTRING(Activity_bandagedPatient), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_bandagedPatient), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
if !([_target] call FUNC(hasMedicalEnabled)) exitWith {
_this call FUNC(treatmentBasic_bandage);

View File

@ -68,6 +68,6 @@ if (alive _target) exitWith {
// Resetting damage
_target setDamage 0;
[_target, "activity", LSTRING(Activity_fullHeal), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_fullHeal), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
[_target, "activity", LSTRING(Activity_fullHeal), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_fullHeal), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
};

View File

@ -24,8 +24,8 @@ params ["_caller", "_target", "_selectionName", "_className", "_items"];
{
if (_x != "") then {
[_target, _x] call FUNC(addToTriageCard);
[_target, "activity", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_usedItem), [[_caller] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog);
[_target, "activity", LSTRING(Activity_usedItem), [[_caller, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_usedItem), [[_caller, false, true] call EFUNC(common,getName), getText (configFile >> "CfgWeapons" >> _x >> "displayName")]] call FUNC(addToLog);
};
} forEach _items;

View File

@ -24,7 +24,7 @@ if (count _items == 0) exitWith {false};
_removeItem = _items select 0;
[[_target, _className], QUOTE(DFUNC(treatmentIVLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
[_target, _removeItem] call FUNC(addToTriageCard);
[_target, "activity", LSTRING(Activity_gaveIV), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_gaveIV), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
[_target, "activity", LSTRING(Activity_gaveIV), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_gaveIV), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
true

View File

@ -43,8 +43,8 @@ _removeItem = _items select 0;
[[_target, _removeItem, _selectionName], QUOTE(DFUNC(treatmentTourniquetLocal)), _target] call EFUNC(common,execRemoteFnc); /* TODO Replace by event system */
[_target, _removeItem] call FUNC(addToTriageCard);
[_target, "activity", LSTRING(Activity_appliedTourniquet), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_appliedTourniquet), [[_caller] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
[_target, "activity", LSTRING(Activity_appliedTourniquet), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog);
[_target, "activity_view", LSTRING(Activity_appliedTourniquet), [[_caller, false, true] call EFUNC(common,getName)]] call FUNC(addToLog); // TODO expand message
true

View File

@ -65,15 +65,28 @@ if (isNil _callback) then {
_callback = missionNamespace getVariable _callback;
};
//Get current damage before treatment (for litter)
_previousDamage = if (_selectionName in GVAR(SELECTIONS)) then {
_target getHitPointDamage ([_target, _selectionName, true] call FUNC(translateSelections));
//Get current blood loose on limb (for "bloody" litter)
private _bloodLossOnSelection = 0;
private _partNumber = ([_selectionName] call FUNC(selectionNameToNumber)) max 0;
if ((GVAR(level) >= 2) && {([_target] call FUNC(hasMedicalEnabled))}) then {
//Advanced Medical - Add all bleeding from wounds on selection
private _openWounds = _target getvariable [QGVAR(openWounds), []];
{
_x params ["", "", "_selectionX", "_amountOf", "_bleedingRatio"];
if (_selectionX == _partNumber) then {
_bloodLossOnSelection = _bloodLossOnSelection + (_amountOf * _bleedingRatio);
};
} forEach _openWounds;
TRACE_1("advanced",_bloodLossOnSelection);
} else {
damage _target;
//Basic Medical (just use blodyPartStatus):
private _damageBodyParts = _target getvariable [QGVAR(bodyPartStatus), [0,0,0,0,0,0]];
_bloodLossOnSelection = _damageBodyParts select _partNumber
TRACE_1("basic",_bloodLossOnSelection);
};
_args call _callback;
_args pushBack _previousDamage;
_args pushBack _bloodLossOnSelection;
_args call FUNC(createLitter);
//If we're not already tracking vitals, start:

View File

@ -113,7 +113,7 @@ class GVAR(triageCard) {
animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.9)";
animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.9)";
animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.9)";
action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setVariable [ARR_3('ACE_medical_triageLevel',0,true)];);
action = QUOTE([false] call FUNC(dropDownTriageCard); (GVAR(TriageCardTarget)) setVariable [ARR_3('ACE_medical_triageLevel',0,true)];);
};
class selectTriageStatusMinor: selectTriageStatus {
idc = 2003;
@ -131,7 +131,7 @@ class GVAR(triageCard) {
animTextureFocused = "#(argb,8,8,3)color(0,0.5,0,0.9)";
animTexturePressed = "#(argb,8,8,3)color(0,0.5,0,0.9)";
animTextureDefault = "#(argb,8,8,3)color(0,0.5,0,0.9)";
action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setVariable [ARR_3('ACE_medical_triageLevel',1,true)];);
action = QUOTE([false] call FUNC(dropDownTriageCard); (GVAR(TriageCardTarget)) setVariable [ARR_3('ACE_medical_triageLevel',1,true)];);
};
class selectTriageStatusDelayed: selectTriageStatus {
idc = 2004;
@ -149,7 +149,7 @@ class GVAR(triageCard) {
animTextureFocused = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)";
animTexturePressed = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)";
animTextureDefault = "#(argb,8,8,3)color(0.77,0.51,0.08,0.9)";
action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setVariable [ARR_3('ACE_medical_triageLevel',2,true)];);
action = QUOTE([false] call FUNC(dropDownTriageCard); (GVAR(TriageCardTarget)) setVariable [ARR_3('ACE_medical_triageLevel',2,true)];);
};
class selectTriageStatusImmediate: selectTriageStatus {
idc = 2005;
@ -167,7 +167,7 @@ class GVAR(triageCard) {
animTextureFocused = "#(argb,8,8,3)color(1,0.2,0.2,0.9)";
animTexturePressed = "#(argb,8,8,3)color(1,0.2,0.2,0.9)";
animTextureDefault = "#(argb,8,8,3)color(1,0.2,0.2,0.9)";
action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setVariable [ARR_3('ACE_medical_triageLevel', 3, true)];);
action = QUOTE([false] call FUNC(dropDownTriageCard); (GVAR(TriageCardTarget)) setVariable [ARR_3('ACE_medical_triageLevel', 3, true)];);
};
class selectTriageStatusDeceased: selectTriageStatus {
idc = 2006;
@ -185,7 +185,7 @@ class GVAR(triageCard) {
animTextureFocused = "#(argb,8,8,3)color(0,0,0,0.9)";
animTexturePressed = "#(argb,8,8,3)color(0,0,0,0.9)";
animTextureDefault = "#(argb,8,8,3)color(0,0,0,0.9)";
action = QUOTE([false] call FUNC(dropDownTriageCard); GVAR(TriageCardTarget) setVariable [ARR_3('ACE_medical_triageLevel', 4, true)];);
action = QUOTE([false] call FUNC(dropDownTriageCard); (GVAR(TriageCardTarget)) setVariable [ARR_3('ACE_medical_triageLevel', 4, true)];);
};
};
};

View File

@ -77,11 +77,11 @@ GVAR(MenuPFHID) = [{
[GVAR(LatestDisplayOptionMenu)] call FUNC(handleUI_DisplayOptions);
//Check that it's valid to stay open:
if !(([ACE_player, _target, ["isNotInside"]] call EFUNC(common,canInteractWith)) && {[ACE_player, _target] call FUNC(canOpenMenu)}) then {
if !(([ACE_player, GVAR(INTERACTION_TARGET), ["isNotInside"]] call EFUNC(common,canInteractWith)) && {[ACE_player, GVAR(INTERACTION_TARGET)] call FUNC(canOpenMenu)}) then {
closeDialog 314412;
//If we failed because of distance check, show UI message:
if ((ACE_player distance GVAR(INTERACTION_TARGET)) > GVAR(maxRange)) then {
["displayTextStructured", [ACE_player], [[ELSTRING(medical,DistanceToFar), [GVAR(INTERACTION_TARGET)] call EFUNC(common,getName)], 1.75, ACE_player]] call EFUNC(common,targetEvent);
["displayTextStructured", [[ELSTRING(medical,DistanceToFar), [GVAR(INTERACTION_TARGET)] call EFUNC(common,getName)], 2, ACE_player]] call EFUNC(common,localEvent);
};
};

View File

@ -171,6 +171,9 @@ case (APP_MODE_WAYPOINTS): {
_currentIndex = (_currentIndex max 0) min (count _waypoints);
_wpListBox lbSetCurSel _currentIndex;
//Reset focus to a dummy ctrl (top button), otherwise HOME/POS1 key goes to top of listBox and has keybind blocked
ctrlSetFocus (_display displayCtrl IDC_TOPMENUBUTTON);
};
case (APP_MODE_SETUP): {
@ -190,5 +193,8 @@ case (APP_MODE_SETUP): {
} else {
_settingListBox lbSetTextRight [1, (localize LSTRING(settingOff))];
};
//Reset focus to a dummy ctrl (top button), otherwise HOME/POS1 key goes to top of listBox and has keybind blocked
ctrlSetFocus (_display displayCtrl IDC_TOPMENUBUTTON);
};
};

View File

@ -140,7 +140,7 @@ class controlsBackground {
class controls {
class TopMenuClick: GVAR(RscActiveTextPicture) {
idc = -1;
idc = IDC_TOPMENUBUTTON;
text = "#(argb,8,8,3)color(0,0,0,0)";
x = X_PART(0);
y = Y_PART(0);

View File

@ -54,6 +54,7 @@
#define IDC_MODEDISPLAY_TARGETRANGENUM 144023
#define IDC_MODEDISPLAY_TARGETELEVATIONNUM 144024
#define IDC_MODEDISPLAY_TARGETNAME 144025
#define IDC_TOPMENUBUTTON 144030
#define IDC_MODECOMPASS 144100
#define IDC_MODECOMPASS_HEADING 144110

Some files were not shown because too many files have changed in this diff Show More