Merge branch 'master' into repairHitpointStrings

Conflicts:
	addons/repair/functions/fnc_doRepair.sqf
This commit is contained in:
jonpas 2015-08-26 23:29:36 +02:00
commit 6a6c5008c0
29 changed files with 228 additions and 150 deletions

View File

@ -37,7 +37,7 @@ class CfgVehicles {
displayName = CSTRING(Module_DisplayName);
function = QFUNC(moduleMapFill);
scope = 2;
isGlobal = 1;
isGlobal = 0;
icon = QUOTE(PATHTOF(UI\Icon_Module_microDAGR_ca.paa));
functionPriority = 0;
class Arguments {
@ -46,9 +46,9 @@ class CfgVehicles {
description = CSTRING(MapDataAvailable_Description);
typeName = "NUMBER";
class values {
class None {name = CSTRING(None); value = MAP_DETAIL_SAT; default = 1;};
class Side {name = CSTRING(Side); value = MAP_DETAIL_TOPOROADS;};
class Unique {name = CSTRING(Unique); value = MAP_DETAIL_NONE;};
class Full {name = CSTRING(MapFill_Full); value = MAP_DETAIL_SAT; default = 1;};
class Roads {name = CSTRING(MapFill_OnlyRoads); value = MAP_DETAIL_TOPOROADS;};
class Disabled {name = CSTRING(MapFill_None); value = MAP_DETAIL_NONE;};
};
};
};

View File

@ -6,7 +6,7 @@
* 0: String version of Keypad entry ["ok","del","1",...] <STRING>
*
* Return Value:
* Nothing
* None
*
* Example:
* ["ok"] call ace_microdagr_fnc_appMarkKeypadEntry
@ -16,15 +16,12 @@
#include "script_component.hpp"
private ["_display", "_editText", "_actualPos"];
PARAMS_1(_keypadButton);
params ["_keypadButton"];
disableSerialization;
_display = displayNull;
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
} else {
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
};
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
if (isNull _display) exitWith {ERROR("No Display");};
if (GVAR(currentApplicationPage) != APP_MODE_MARK) exitWith {};

View File

@ -3,18 +3,18 @@
* Handles the "Connect To" button from the menu application
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Nothing
* None
*
* Example:
* [] call ace_microdagr_fnc_appMenuButtonConnectRangefinder
* call ace_microdagr_fnc_appMenuButtonConnectRangefinder
*
* Public: No
*/
#include "script_component.hpp"
GVAR(currentWaypoint) = if (GVAR(currentWaypoint) == -2) then {-1} else {-2};
GVAR(currentWaypoint) = [-2, -1] select (GVAR(currentWaypoint) == -2);
GVAR(rangeFinderPositionASL) = [];
[APP_MODE_INFODISPLAY] call FUNC(saveCurrentAndSetNewMode);

View File

@ -7,7 +7,7 @@
* 1: Index <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* [settingList, 1] call ace_microdagr_fnc_appSettingsLBClick
@ -17,7 +17,7 @@
#include "script_component.hpp"
disableSerialization;
PARAMS_2(_control,_itemClicked);
params ["", "_itemClicked"];
switch (_itemClicked) do {
case (0): { GVAR(settingUseMils) = ! GVAR(settingUseMils)};

View File

@ -3,13 +3,13 @@
* Handles clicking the delete button from the waypoint application
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Nothing
* None
*
* Example:
* [] call ace_microdagr_fnc_appWaypointsButtonDeleteWP
* call ace_microdagr_fnc_appWaypointsButtonDeleteWP
*
* Public: No
*/
@ -18,12 +18,8 @@
private ["_display", "_wpIndex"];
disableSerialization;
_display = displayNull;
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
} else {
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
};
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select GVAR(currentShowMode) == DISPLAY_MODE_DIALOG, displayNull];
if (isNull _display) exitWith {ERROR("No Display");};
_wpIndex = lbCurSel (_display displayCtrl IDC_MODEWAYPOINTS_LISTOFWAYPOINTS);

View File

@ -6,10 +6,10 @@
* The "SetWP" button <CONTROL>
*
* Return Value:
* Nothing
* None
*
* Example:
* [] call ace_microdagr_fnc_appWaypointsButtonSetWP
* [1234] call ace_microdagr_fnc_appWaypointsButtonSetWP
*
* Public: No
*/
@ -18,7 +18,7 @@
private ["_wpListBox", "_newWpIndex", "_waypoints"];
disableSerialization;
PARAMS_1(_wpButton);
params ["_wpButton"];
_wpListBox = (ctrlParent _wpButton) displayCtrl 144501;
_newWpIndex = lbCurSel _wpListBox;

View File

@ -6,32 +6,31 @@
* The display mode to test showing <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* [mode] call ace_microdagr_fnc_canShow
* [1] call ace_microdagr_fnc_canShow
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_1(_showType);
params ["_showType"];
private ["_returnValue"];
_returnValue = false;
switch (_showType) do {
case (DISPLAY_MODE_CLOSED): {_returnValue = true}; //Can always close
case (DISPLAY_MODE_HIDDEN): {_returnValue = true}; //Can always hide
case (DISPLAY_MODE_DIALOG): {
_returnValue = ("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)};
_returnValue = switch (_showType) do {
case (DISPLAY_MODE_CLOSED): { true }; //Can always close
case (DISPLAY_MODE_HIDDEN): { true }; //Can always hide
case (DISPLAY_MODE_DIALOG): {
("ACE_microDAGR" in (items ACE_player)) && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}
};
case (DISPLAY_MODE_DISPLAY): {
case (DISPLAY_MODE_DISPLAY): {
//Can't have minimap up while zoomed in
_returnValue = (cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)};
(cameraview != "GUNNER") && {"ACE_microDAGR" in (items ACE_player)} && {[ACE_player, objNull, ["notOnMap", "isNotInside", "isNotSitting"]] call EFUNC(common,canInteractWith)}
};
default { false };
};
_returnValue

View File

@ -8,7 +8,7 @@
* 1: Waypoint Position ASL <ARRAY>
*
* Return Value:
* Nothing
* None
*
* Example:
* ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceAddWaypoint
@ -17,10 +17,11 @@
*/
#include "script_component.hpp"
PARAMS_2(_waypointName,_waypointPosASL);
private "_waypoints";
params ["_waypointName","_waypointPosASL"];
_waypoints = ace_player getVariable [QGVAR(waypoints), []];
_waypoints = ACE_player getVariable [QGVAR(waypoints), []];
_waypoints pushBack [_waypointName, _waypointPosASL];
ace_player setVariable [QGVAR(waypoints), _waypoints];
ACE_player setVariable [QGVAR(waypoints), _waypoints];

View File

@ -7,7 +7,7 @@
* 0: Waypoint Index <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* ["Hill 55", [41,324, 12]] call ace_microdagr_fnc_deviceDeleteWaypoint
@ -16,13 +16,12 @@
*/
#include "script_component.hpp"
PARAMS_1(_wpIndex);
private "_waypoints";
params ["_wpIndex"];
_waypoints = ace_player getVariable [QGVAR(waypoints), []];
_waypoints = ACE_player getVariable [QGVAR(waypoints), []];
if ((_wpIndex < 0) || (_wpIndex > ((count _waypoints) - 1))) exitWith {ERROR("out of bounds wp");};
_waypoints deleteAt _wpIndex;
ace_player setVariable [QGVAR(waypoints), _waypoints];
ACE_player setVariable [QGVAR(waypoints), _waypoints];

View File

@ -4,7 +4,7 @@
* Device saving not implemented yet, just save to player object
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Waypoints <ARRAY>
@ -16,4 +16,4 @@
*/
#include "script_component.hpp"
(ace_player getVariable [QGVAR(waypoints), []])
(ACE_player getVariable [QGVAR(waypoints), []])

View File

@ -3,13 +3,13 @@
* Handles the dialog closeing, switches back to display mode
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Nothing
* None
*
* Example:
* [] call ace_microdagr_fnc_dialogClosedEH
* call ace_microdagr_fnc_dialogClosedEH
*
* Public: No
*/

View File

@ -10,7 +10,7 @@
* 3: MousePosY <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapButtonDownEH
@ -19,7 +19,7 @@
*/
#include "script_component.hpp"
PARAMS_4(_theMap,_mouseButton,_xPos,_yPos);
params ["", "_mouseButton"];
//Only handle RMB
if (_mouseButton != 1) exitWith {};

View File

@ -9,7 +9,7 @@
* 3: MousePosY <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* [minimap,0,0.5,0.5] call ace_microdagr_fnc_mapDoubleTapEH
@ -18,7 +18,7 @@
*/
#include "script_component.hpp"
PARAMS_4(_theMap,_mouseButton,_xPos,_yPos);
params ["_theMap", "_mouseButton", "_xPos", "_yPos"];
private ["_worldPos"];
@ -26,7 +26,7 @@ private ["_worldPos"];
if (_mouseButton != 0) exitWith {};
_worldPos = _theMap ctrlMapScreenToWorld [_xPos, _yPos];
_worldPos set [2, (getTerrainHeightASL _worldPos)];
_worldPos pushBack (getTerrainHeightASL _worldPos);
GVAR(newWaypointPosition) = _worldPos;
[APP_MODE_MARK] call FUNC(saveCurrentAndSetNewMode);

View File

@ -6,7 +6,7 @@
* 0: The Map <CONTROL>
*
* Return Value:
* Nothing
* None
*
* Example:
* [compassMap] call ace_microdagr_fnc_mapOnDrawEH
@ -15,10 +15,10 @@
*/
#include "script_component.hpp"
PARAMS_1(_theMap);
private ["_mapSize", "_waypoints", "_size", "_targetPos", "_relBearing", "_wpName", "_wpPos", "_alpha"];
params ["_theMap"];
_mapSize = (ctrlPosition _theMap) select 3;
_waypoints = [] call FUNC(deviceGetWaypoints);
@ -27,7 +27,7 @@ if (GVAR(currentApplicationPage) == 1) then {
_theMap ctrlMapAnimAdd [0, DUMMY_ZOOM, DUMMY_POS];
ctrlMapAnimCommit _theMap;
_size = 412 * _mapSize;
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ace_player)), '', 0 ];
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_starInverted.paa)), [1,1,1,1], DUMMY_POS, _size, _size, (-1 * (getDir ACE_player)), '', 0 ];
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [0.533,0.769,0.76,1], DUMMY_POS, _size, _size, 0, '', 0 ];
if (GVAR(currentWaypoint) != -1) then {
@ -42,23 +42,23 @@ if (GVAR(currentApplicationPage) == 1) then {
};
};
if ((count _targetPos) == 3) then {
_relBearing = [ace_player, _targetPos] call BIS_fnc_relativeDirTo;
_relBearing = [ACE_player, _targetPos] call BIS_fnc_relativeDirTo;
_theMap drawIcon [QUOTE(PATHTO_R(images\compass_needle.paa)), [1,0.564,0.564,1], DUMMY_POS, _size, _size, _relBearing, '', 0 ];
};
};
} else { //Map Mode:
if (GVAR(mapAutoTrackPosition)) then {
_theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ace_player)];
_theMap ctrlMapAnimAdd [0, (GVAR(mapZoom)/_mapSize), (getPosASL ACE_player)];
ctrlMapAnimCommit _theMap;
};
_size = 48 * _mapSize;
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ace_player), _size, _size, (getDir ace_player), '', 0 ];
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_self.paa)), [0.533,0.769,0.76,0.75], (getPosASL ACE_player), _size, _size, (getDir ACE_player), '', 0 ];
if (GVAR(settingShowAllWaypointsOnMap)) then {
_size = 32 * _mapSize;
{
EXPLODE_2_PVT(_x,_wpName,_wpPos);
_x params ["_wpName", "_wpPos"];
_alpha = if (_forEachIndex == GVAR(currentWaypoint)) then {1} else {0.5};
_theMap drawIcon [QUOTE(PATHTO_R(images\icon_mapWaypoints.paa)), [1,1,1,_alpha], _wpPos, _size, _size, 0, '', 0 ];
} forEach _waypoints;

View File

@ -6,7 +6,7 @@
* 0: String of the map button pressed <STRING>
*
* Return Value:
* Nothing
* None
*
* Example:
* ["autotrack"] call ace_microdagr_fnc_modeMapButtons
@ -15,7 +15,7 @@
*/
#include "script_component.hpp"
PARAMS_1(_mode);
params ["_mode"];
[-1] call FUNC(saveCurrentAndSetNewMode); //backup current draw pos/zoom

View File

@ -4,23 +4,18 @@
*
* Arguments:
* 0: logic <OBJECT>
* 1: synced units-not used <ARRAY>
* 2: Module Activated <BOOL>
*
* Return Value:
* Nothing
* None
*
* Example:
* [module, [], true] call ace_microdagr_fnc_moduleMapFill
* [module] call ace_microdagr_fnc_moduleMapFill
*
* Public: No
*/
#include "script_component.hpp"
PARAMS_3(_logic,_syncedUnits,_activated);
if !(isServer) exitWith {};
params ["_logic"];
if (!_activated) exitWith {WARNING("Module Placed but not active");};
if (isServer) then {
[_logic, QGVAR(MapDataAvailable), "MapDataAvailable"] call EFUNC(common,readSettingFromModule);
};
[_logic, QGVAR(MapDataAvailable), "MapDataAvailable"] call EFUNC(common,readSettingFromModule);

View File

@ -6,7 +6,7 @@
* 0: Display Mode to show the microDAGR in <NUMBER><OPTIONAL>
*
* Return Value:
* Nothing
* None
*
* Example:
* [1] call ace_microdagr_fnc_openDisplay
@ -15,9 +15,9 @@
*/
#include "script_component.hpp"
private ["_oldShowMode", "_args", "_pfID", "_player"];
private ["_oldShowMode", "_args", "_player"];
DEFAULT_PARAM(0,_newDisplayShowMode,-1);
params [["_newDisplayShowMode", -1, [-1]]];
_oldShowMode = GVAR(currentShowMode);
if (_newDisplayShowMode == -1) then {
@ -30,11 +30,10 @@ if ((_newDisplayShowMode == DISPLAY_MODE_DISPLAY) && {!([DISPLAY_MODE_DISPLAY] c
if ((_newDisplayShowMode == DISPLAY_MODE_DIALOG) && {!([DISPLAY_MODE_DIALOG] call FUNC(canShow))}) then {_newDisplayShowMode = DISPLAY_MODE_HIDDEN};
//On first-startup
if (GVAR(currentApplicationPage) == APP_MODE_NULL) then {
GVAR(currentApplicationPage) = APP_MODE_INFODISPLAY;
GVAR(mapPosition) = getPos ace_player;
GVAR(mapPosition) = getPos ACE_player;
};
if (_newDisplayShowMode in [DISPLAY_MODE_CLOSED, DISPLAY_MODE_HIDDEN]) then {
@ -74,14 +73,14 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M
//Start a pfeh to update display and handle hiding display
[{
PARAMS_2(_args,_pfID);
EXPLODE_1_PVT(_args,_player);
if ((isNull ace_player) || {!alive ace_player} || {ace_player != _player} || {!("ACE_microDAGR" in (items ace_player))} || {GVAR(currentShowMode) == DISPLAY_MODE_CLOSED}) then {
params ["_args", "_idPFH"];
_args params ["_player"];
if ((isNull ACE_player) || {!alive ACE_player} || {ACE_player != _player} || {!("ACE_microDAGR" in (items ACE_player))} || {GVAR(currentShowMode) == DISPLAY_MODE_CLOSED}) then {
//Close Display if still open:
if (GVAR(currentShowMode) != DISPLAY_MODE_CLOSED) then {
[DISPLAY_MODE_CLOSED] call FUNC(openDisplay);
};
[_pfID] call CBA_fnc_removePerFrameHandler;
[_idPFH] call CBA_fnc_removePerFrameHandler;
} else {
if (GVAR(currentShowMode) == DISPLAY_MODE_HIDDEN) then {
//If display is hidden, and we can show, then swithc modes:
@ -96,5 +95,5 @@ if ((_oldShowMode == DISPLAY_MODE_CLOSED) && {GVAR(currentShowMode) != DISPLAY_M
};
};
};
}, 0.1, [ace_player]] call CBA_fnc_addPerFrameHandler;
}, 0.1, [ACE_player]] call CBA_fnc_addPerFrameHandler;
};

View File

@ -8,7 +8,7 @@
* 2: Inclination (Degrees) <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* [1000, 45, 1] call ace_microdagr_fnc_recieveRangefinderData
@ -19,7 +19,7 @@
private ["_horizontalDistance", "_verticleDistance", "_targetOffset", "_targetPosASL"];
PARAMS_3(_slopeDistance,_azimuth,_inclination);
params ["_slopeDistance", "_azimuth", "_inclination"];
if (GVAR(currentWaypoint) != -2) exitWith {}; //Only take waypoint when "connected"
if (_slopeDistance < 0) exitWith {}; //Bad Data
@ -29,6 +29,6 @@ _verticleDistance = (sin _inclination) * _slopeDistance;
_targetOffset = [((sin _azimuth) * _horizontalDistance), ((cos _azimuth) * _horizontalDistance), _verticleDistance];
//This assumes the "rangefinder view" pos is very close to player, at worst the turret should only be a few meters different
_targetPosASL = (getPosASL ace_player) vectorAdd _targetOffset;
_targetPosASL = (getPosASL ACE_player) vectorAdd _targetOffset;
GVAR(rangeFinderPositionASL) = _targetPosASL;

View File

@ -7,7 +7,7 @@
* 0: New Mode <NUMBER>
*
* Return Value:
* Nothing
* None
*
* Example:
* [2] call ace_microdagr_fnc_saveCurrentAndSetNewMode
@ -16,24 +16,21 @@
*/
#include "script_component.hpp"
private ["_display", "_theMap", "_mapSize", "_centerPos", "_mapCtrlPos"];
private ["_display", "_theMap", "_centerPos", "_mapCtrlPos"];
PARAMS_1(_newMode);
params ["_newMode"];
disableSerialization;
_display = displayNull;
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
} else {
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
};
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
if (isNull _display) exitWith {ERROR("No Display");};
if (GVAR(currentApplicationPage) == 2) then {
_theMap = if (!GVAR(mapShowTexture)) then {_display displayCtrl IDC_MAPPLAIN} else {_display displayCtrl IDC_MAPDETAILS};
_theMap = [_display displayCtrl IDC_MAPDETAILS, _display displayCtrl IDC_MAPPLAIN] select (!GVAR(mapShowTexture));
_mapCtrlPos = ctrlPosition _theMap;
_mapSize = _mapCtrlPos select 3;
_centerPos = [((_mapCtrlPos select 0) + (_mapCtrlPos select 2) / 2), ((_mapCtrlPos select 1) + (_mapCtrlPos select 3) / 2)];
_mapCtrlPos params ["_mapCtrlPosX", "_mapCtrlPosY", "_mapCtrlPosZ", "_mapSize"];
_centerPos = [(_mapCtrlPosX + _mapCtrlPosZ / 2), (_mapCtrlPosY + _mapSize / 2)];
GVAR(mapPosition) = _theMap ctrlMapScreenToWorld _centerPos;
GVAR(mapZoom) = (ctrlMapScale _theMap) * _mapSize;

View File

@ -3,10 +3,10 @@
* Changes the "application page" shown on the microDAGR
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Nothing
* None
*
* Example:
* [] call ace_microdagr_fnc_showApplicationPage
@ -19,12 +19,8 @@ private ["_display", "_theMap", "_mapSize"];
disableSerialization;
_display = displayNull;
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
} else {
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
};
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
if (isNull _display) exitWith {ERROR("No Display");};
//TopBar

View File

@ -3,10 +3,10 @@
* Updates the display (several times a second) called from the pfeh
*
* Arguments:
* Nothing
* None
*
* Return Value:
* Nothing
* None
*
* Example:
* [] call ace_microdagr_fnc_updateDisplay
@ -15,15 +15,11 @@
*/
#include "script_component.hpp"
private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_playerPos2d", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString"];
private ["_display", "_waypoints", "_posString", "_eastingText", "_northingText", "_numASL", "_aboveSeaLevelText", "_compassAngleText", "_targetPos", "_targetPosName", "_targetPosLocationASL", "_bearingText", "_rangeText", "_targetName", "_bearing", "_2dDistanceKm", "_SpeedText", "_wpListBox", "_currentIndex", "_wpName", "_wpPos", "_settingListBox", "_yearString", "_monthSring", "_dayString", "_daylight"];
disableSerialization;
_display = displayNull;
if (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG) then {
_display = (uiNamespace getVariable [QGVAR(DialogDisplay), displayNull]);
} else {
_display = (uiNamespace getVariable [QGVAR(RscTitleDisplay), displayNull]);
};
_display = uiNamespace getVariable [[QGVAR(RscTitleDisplay), QGVAR(DialogDisplay)] select (GVAR(currentShowMode) == DISPLAY_MODE_DIALOG), displayNull];
if (isNull _display) exitWith {ERROR("No Display");};
//Fade "shell" at night
@ -44,21 +40,21 @@ case (APP_MODE_INFODISPLAY): {
(_display displayCtrl IDC_MODEDISPLAY_NORTHING) ctrlSetText _northingText;
//Elevation:
_numASL = ((getPosASL ace_player) select 2) + EGVAR(common,mapAltitude);
_numASL = ((getPosASL ACE_player) select 2) + EGVAR(common,mapAltitude);
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
_aboveSeaLevelText = if (_numASL > 0) then {"+" + _aboveSeaLevelText + " MSL"} else {_aboveSeaLevelText + " MSL"};
(_display displayCtrl IDC_MODEDISPLAY_ELEVATIONNUM) ctrlSetText _aboveSeaLevelText;
//Heading:
_compassAngleText = if (GVAR(settingUseMils)) then {
[(floor ((6400 / 360) * (getDir ace_player))), 4, 0] call CBA_fnc_formatNumber;
[(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber;
} else {
([(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
};
(_display displayCtrl IDC_MODEDISPLAY_HEADINGNUM) ctrlSetText _compassAngleText;
//Speed:
(_display displayCtrl IDC_MODEDISPLAY_SPEEDNUM) ctrlSetText format ["%1kph", (round (speed (vehicle ace_player)))];;
(_display displayCtrl IDC_MODEDISPLAY_SPEEDNUM) ctrlSetText format ["%1kph", (round (speed (vehicle ACE_player)))];;
if (GVAR(currentWaypoint) == -1) then {
@ -89,13 +85,13 @@ case (APP_MODE_INFODISPLAY): {
};
if (!(_targetPosLocationASL isEqualTo [])) then {
_bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearingText = if (GVAR(settingUseMils)) then {
[(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber;
} else {
([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
};
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
_2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000;
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
_numASL = (_targetPosLocationASL select 2) + EGVAR(common,mapAltitude);
_aboveSeaLevelText = [_numASL, 5, 0] call CBA_fnc_formatNumber;
@ -111,14 +107,14 @@ case (APP_MODE_INFODISPLAY): {
case (APP_MODE_COMPASS): {
//Heading:
_compassAngleText = if (GVAR(settingUseMils)) then {
[(floor ((6400 / 360) * (getDir ace_player))), 4, 0] call CBA_fnc_formatNumber;
[(floor ((6400 / 360) * (getDir ACE_player))), 4, 0] call CBA_fnc_formatNumber;
} else {
([(floor (getDir ace_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
([(floor (getDir ACE_player)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
};
(_display displayCtrl IDC_MODECOMPASS_HEADING) ctrlSetText _compassAngleText;
//Speed:
_SpeedText = format ["%1kph", (round (speed (vehicle ace_player)))];;
_SpeedText = format ["%1kph", (round (speed (vehicle ACE_player)))];;
(_display displayCtrl IDC_MODECOMPASS_SPEED) ctrlSetText _SpeedText;
if (GVAR(currentWaypoint) == -1) then {
@ -126,8 +122,6 @@ case (APP_MODE_COMPASS): {
(_display displayCtrl IDC_MODECOMPASS_RANGE) ctrlSetText "";
(_display displayCtrl IDC_MODECOMPASS_TARGET) ctrlSetText "";
} else {
_playerPos2d = (getPosASL ace_player) select [0,2];
_targetPosName = "";
_targetPosLocationASL = [];
@ -147,13 +141,13 @@ case (APP_MODE_COMPASS): {
_rangeText = "---";
if (!(_targetPosLocationASL isEqualTo [])) then {
_bearing = [(getPosASL ace_player), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearing = [(getPosASL ACE_player), _targetPosLocationASL] call BIS_fnc_dirTo;
_bearingText = if (GVAR(settingUseMils)) then {
[(floor ((6400 / 360) * (_bearing))), 4, 0] call CBA_fnc_formatNumber;
} else {
([(floor (_bearing)), 3, 1] call CBA_fnc_formatNumber) + "°" //degree symbol is in UTF-8
};
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_targetPosLocationASL select [0,2])) / 1000;
_2dDistanceKm = ((getPosASL ACE_player) distance2D _targetPosLocationASL) / 1000;
_rangeText = format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)];
};
@ -169,9 +163,9 @@ case (APP_MODE_WAYPOINTS): {
lbClear _wpListBox;
{
EXPLODE_2_PVT(_x,_wpName,_wpPos);
_x params ["_wpName", "_wpPos"];
_wpListBox lbAdd _wpName;
_2dDistanceKm = (((getPosASL ace_player) select [0,2]) distance (_wpPos select [0,2])) / 1000;
_2dDistanceKm = ((getPosASL ACE_player) distance2D _wpPos) / 1000;
_wpListBox lbSetTextRight [_forEachIndex, (format ["%1km", ([_2dDistanceKm, 1, 1] call CBA_fnc_formatNumber)])];
} forEach _waypoints;

View File

@ -325,7 +325,7 @@
<Czech>Kolik informací je načteno do MicroDAGR?</Czech>
<Portuguese>Quanta informação é preenchida no mapa do MicroDAGR</Portuguese>
</Key>
<Key ID="STR_ACE_MicroDAGR_None">
<Key ID="STR_ACE_MicroDAGR_MapFill_Full">
<English>Full Satellite + Buildings</English>
<Polish>Pełna satelitarna + budynki</Polish>
<Spanish>Satelite completo + Edificios</Spanish>
@ -333,7 +333,7 @@
<Czech>Satelit + Budovy</Czech>
<Portuguese>Satélite completo + Edifícios</Portuguese>
</Key>
<Key ID="STR_ACE_MicroDAGR_Side">
<Key ID="STR_ACE_MicroDAGR_MapFill_OnlyRoads">
<English>Topographical + Roads</English>
<Polish>Topograficzna + drogi</Polish>
<Spanish>Topografico + Carreteras</Spanish>
@ -341,7 +341,7 @@
<Czech>Topografické + Cesty</Czech>
<Portuguese>Topográfico + Estradas</Portuguese>
</Key>
<Key ID="STR_ACE_MicroDAGR_Unique">
<Key ID="STR_ACE_MicroDAGR_MapFill_None">
<English>None (Cannot use map view)</English>
<Polish>Żadna (wyłącza ekran mapy)</Polish>
<Spanish>Nada (No se puede el mapa)</Spanish>

View File

@ -31,7 +31,7 @@ class ACE_Repair {
class MiscRepair: ReplaceWheel {
displayName = CSTRING(Repairing); // let's make empty string an auto generated string
displayNameProgress = CSTRING(RepairingHitPoint);
condition = QUOTE((_target getHitPointDamage _hitPoint) > ([_caller] call FUNC(getPostRepairDamage)));
condition = QUOTE(call FUNC(canMiscRepair));
requiredEngineer = 0;
repairingTime = 15;
callbackSuccess = QUOTE(call FUNC(doRepair));
@ -63,7 +63,7 @@ class ACE_Repair {
requiredEngineer = QGVAR(engineerSetting_fullRepair);
repairLocations[] = {QGVAR(fullRepairLocation)};
repairingTime = 30;
condition = "damage (_this select 1) > 0";
condition = "damage _target > 0";
callbackSuccess = QUOTE(call FUNC(doFullRepair));
};
};

View File

@ -285,7 +285,10 @@ class CfgVehicles {
transportRepair = 0;
};
class Heli_Transport_04_base_F;
class Helicopter_Base_H;
class Heli_Transport_04_base_F: Helicopter_Base_H {
GVAR(hitpointGroups[]) = { {"HitEngine", {"HitEngine1", "HitEngine2"}}, {"Glass_1_hitpoint", {"Glass_2_hitpoint", "Glass_3_hitpoint", "Glass_4_hitpoint", "Glass_5_hitpoint", "Glass_6_hitpoint", "Glass_7_hitpoint", "Glass_8_hitpoint", "Glass_9_hitpoint", "Glass_10_hitpoint", "Glass_11_hitpoint", "Glass_12_hitpoint", "Glass_13_hitpoint", "Glass_14_hitpoint", "Glass_15_hitpoint", "Glass_16_hitpoint", "Glass_17_hitpoint", "Glass_18_hitpoint", "Glass_19_hitpoint", "Glass_20_hitpoint"}} };
};
class O_Heli_Transport_04_repair_F: Heli_Transport_04_base_F {
GVAR(canRepair) = 1;
transportRepair = 0;
@ -303,12 +306,19 @@ class CfgVehicles {
transportRepair = 0;
};
class Offroad_01_base_F;
class Car_F;
class Offroad_01_base_F: Car_F {
GVAR(hitpointGroups[]) = { {"HitGlass1", {"HitGlass2"}} };
};
class Offroad_01_repair_base_F: Offroad_01_base_F {
GVAR(canRepair) = 1;
transportRepair = 0;
};
class MRAP_01_base_F: Car_F {
GVAR(hitpointGroups[]) = { {"HitGlass1", {"HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6"}} };
};
class B_Truck_01_mover_F;
class B_Truck_01_Repair_F: B_Truck_01_mover_F {
GVAR(canRepair) = 1;

View File

@ -3,6 +3,7 @@
ADDON = false;
PREP(addRepairActions);
PREP(canMiscRepair);
PREP(canRemove);
PREP(canRepair);
PREP(canRepairTrack);

View File

@ -14,7 +14,6 @@
* Public: No
*/
#include "script_component.hpp"
#define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"]
params ["_vehicle"];
TRACE_1("params", _vehicle);
@ -79,6 +78,26 @@ _hitPointsAddedAmount = [];
// exit if the hitpoint is in the blacklist, e.g. glasses
if (_x in IGNORED_HITPOINTS) exitWith {};
private ["_hitpointGroupConfig", "_inHitpointSubGroup", "_currentHitpoint"];
// Get hitpoint groups if available
_hitpointGroupConfig = configFile >> "CfgVehicles" >> _type >> QGVAR(hitpointGroups);
_inHitpointSubGroup = false;
if (isArray _hitpointGroupConfig) then {
// Set variable if current hitpoint is in a sub-group (to be excluded from adding action)
_currentHitpoint = _x;
{
{
if (_x == _currentHitpoint) exitWith {
_inHitpointSubGroup = true;
};
} forEach (_x select 1);
} forEach (getArray _hitpointGroupConfig);
};
// Exit if current hitpoint is in sub-group (only main hitpoints get actions)
if (_inHitpointSubGroup) exitWith {};
// exit if the hitpoint is virtual
if (isText (configFile >> "CfgVehicles" >> _type >> "HitPoints" >> _x >> "depends")) exitWith {};

View File

@ -0,0 +1,54 @@
/*
* Author: Jonpas
* Check if misc repair action can be done, called from callbackSuccess.
*
* Arguments:
* 0: Unit that does the repairing <OBJECT>
* 1: Vehicle to repair <OBJECT>
* 2: Selected hitpoint <STRING>
*
* Return Value:
* Can Misc Repair <BOOL>
*
* Example:
* [unit, vehicle, "hitpoint", "classname"] call ace_repair_fnc_canMiscRepair
*
* Public: No
*/
#include "script_component.hpp"
private ["_hitpointGroupConfig", "_hitpointGroup", "_postRepairDamage", "_return"];
params ["_caller", "_target", "_hitPoint"];
// Get hitpoint groups if available
_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _target >> QGVAR(hitpointGroups);
_hitpointGroup = [];
if (isArray _hitpointGroupConfig) then {
// Retrieve hitpoint subgroup if current hitpoint is main hitpoint of a group
{
// Exit using found hitpoint group if this hitpoint is leader of any
if (_x select 0 == _hitPoint) exitWith {
_hitpointGroup = _x select 1;
};
} forEach (getArray _hitpointGroupConfig);
};
// Add current hitpoint to the group
_hitpointGroup pushBack _hitPoint;
// Get post repair damage
_postRepairDamage = [_caller] call FUNC(getPostRepairDamage);
// Return true if damage can be repaired on any hitpoint in the group, else false
_return = false;
{
if ((_target getHitPointDamage _x) > _postRepairDamage) exitWith {
_return = true;
};
} forEach _hitpointGroup;
if (typeOf _target == "B_MRAP_01_F") then {
diag_log format ["%1 - %2", _hitPoint, _hitpointGroup];
};
_return

View File

@ -17,11 +17,11 @@
*/
#include "script_component.hpp"
private ["_hitPointDamage", "_text", "_hitpointGroup"];
params ["_unit", "_vehicle", "_hitPoint"];
TRACE_3("params",_unit,_vehicle,_hitPoint);
// get current hitpoint damage
private "_hitPointDamage";
_hitPointDamage = _vehicle getHitPointDamage _hitPoint;
_hitPointDamage = _hitPointDamage - 0.5;
@ -31,6 +31,27 @@ _hitPointDamage = _hitPointDamage max ([_unit] call FUNC(getPostRepairDamage));
// raise event to set the new hitpoint damage
["setVehicleHitPointDamage", _vehicle, [_vehicle, _hitPoint, _hitPointDamage]] call EFUNC(common,targetEvent);
// Get hitpoint groups if available
_hitpointGroupConfig = configFile >> "CfgVehicles" >> typeOf _vehicle >> QGVAR(hitpointGroups);
_hitpointGroup = [];
if (isArray _hitpointGroupConfig) then {
// Retrieve group if current hitpoint is leader of any
{
if (_x select 0 == _hitPoint) exitWith {
([_vehicle] call EFUNC(common,getHitPointsWithSelections)) params ["_hitpoints"];
// Set all sub-group hitpoints' damage to 0, if a hitpoint is invalid print RPT error
{
if (_x in _hitpoints) then {
["setVehicleHitPointDamage", _vehicle, [_vehicle, _x, 0]] call EFUNC(common,targetEvent);
} else {
diag_log text format ["[ACE] ERROR: Invalid hitpoint %1 in hitpointGroups of %2", _x, _vehicle];
};
} forEach (_x select 1);
};
} forEach (getArray _hitpointGroupConfig);
};
// display text message if enabled
if (GVAR(DisplayTextOnRepair)) then {
private ["_textLocalized", "_textDefault"];

View File

@ -12,5 +12,5 @@
#include "\z\ace\addons\main\script_macros.hpp"
#define IGNORED_HITPOINTS ["HitGlass1","HitGlass2","HitGlass3","HitGlass4","HitGlass5","HitGlass6","HitGlass7","HitGlass8","HitGlass9","HitGlass10","HitGlass11","HitGlass12","HitGlass13","HitGlass14","HitGlass15","HitRGlass","HitLGlass"]
// #define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"];
#define IGNORED_HITPOINTS ["HitGlass1", "HitGlass2", "HitGlass3", "HitGlass4", "HitGlass5", "HitGlass6", "HitGlass7", "HitGlass8", "HitGlass9", "HitGlass10", "HitGlass11", "HitGlass12", "HitGlass13", "HitGlass14", "HitGlass15", "HitRGlass", "HitLGlass", "Glass_1_hitpoint", "Glass_2_hitpoint", "Glass_3_hitpoint", "Glass_4_hitpoint", "Glass_5_hitpoint", "Glass_6_hitpoint", "Glass_7_hitpoint", "Glass_8_hitpoint", "Glass_9_hitpoint", "Glass_10_hitpoint", "Glass_11_hitpoint", "Glass_12_hitpoint", "Glass_13_hitpoint", "Glass_14_hitpoint", "Glass_15_hitpoint", "Glass_16_hitpoint", "Glass_17_hitpoint", "Glass_18_hitpoint", "Glass_19_hitpoint", "Glass_20_hitpoint"]
#define TRACK_HITPOINTS ["HitLTrack", "HitRTrack"]