Merge branch 'master' into explosiveInteraction

This commit is contained in:
Garth L-H de Wet 2015-02-24 00:14:09 +02:00
commit a13fe3e9ce
100 changed files with 860 additions and 1113 deletions

View File

@ -17,14 +17,15 @@ class RscTitles {
class HintBox: RscStructuredText {
idc = 1;
text = "";
size = "1 / 40 / (getResolution select 5)";
sizeEx = 1;
//size = "1 / 40 / (getResolution select 5)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0, 0, 0, 0.5};
x = safeZoneW + safeZoneX - 0 * safezoneW; //safeZoneW + safeZoneX - 0.2 * safezoneW;
y = safeZoneY + 0.2 * safezoneH;
w = 0.2 * safeZoneW;
h = 0.1 * SafeZoneH;
font = "PuristaMedium";
};
};
};
@ -36,13 +37,12 @@ class RscTitles {
fadeIn = 0.2;
fadeOut = 0.2;
name = "ACE_RscErrorHint";
class controls {
class HintBox: RscStructuredText {
idc = 1;
text = "";
size = "1 / 40 / (getResolution select 5)";
sizeEx = 1;
//size = "1 / 40 / (getResolution select 5)";
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
colorText[] = {1, 1, 1, 1};
colorBackground[] = {0.8, 0, 0, 0.5};
x = 0.3 * safeZoneW + safeZoneX;
@ -52,6 +52,7 @@ class RscTitles {
};
};
};
class ACE_EventHandlerHelper: ACE_Rsc_Display_Base {
idd = -1;
class controls {

View File

@ -1,6 +1,3 @@
class ACE_gui_RscProgress;
class ACE_gui_staticBase;
class GVAR(ProgressBar_Dialog) {
idd = -1;
@ -20,7 +17,7 @@ class GVAR(ProgressBar_Dialog) {
type = 0;
style = 0;
size = 1;
colorBackground[] = {0, 0, 0, 0.1};
colorBackground[] = {0, 0, 0, 0.0};
colorText[] = {0, 0, 0, 0};
x = "safezoneX";
y = "safezoneY";
@ -34,7 +31,7 @@ class GVAR(ProgressBar_Dialog) {
y = "0.1 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = ".8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
colorFrame[] = {0,0,0,0.025};
colorFrame[] = {0,0,0,0.0};
colorBar[] = {0.27,0.5,0.31,0.8};
texture = "#(argb,8,8,3)color(1,1,1,0.7)";
};

View File

@ -26,5 +26,5 @@ class RscDisplayInventory {
};
class RscDisplayChannel {
onLoad = QUOTE(_this call GVAR(onLoadRscDisplayChannel));
onLoad = QUOTE(_this call FUNC(onLoadRscDisplayChannel));
};

View File

@ -17,6 +17,7 @@ PREP(ambientBrightness);
PREP(applyForceWalkStatus);
PREP(beingCarried);
PREP(binarizeNumber);
PREP(blurScreen);
PREP(callCustomEventHandlers);
PREP(callCustomEventHandlersGlobal);
PREP(canGetInPosition);
@ -39,6 +40,7 @@ PREP(debugModule);
PREP(defineVariable);
PREP(disableAI);
PREP(disableUserInput);
PREP(displayIcon);
PREP(displayText);
PREP(displayTextPicture);
PREP(displayTextStructured);

View File

@ -94,8 +94,41 @@ class ACE_Settings {
isClientSetable = 1;
displayName = "$STR_ACE_Common_EnableNumberHotkeys";
};
class GVAR(settingFeedbackIcons) {
value = 1;
typeName = "SCALAR";
force = 0;
isClientSetable = 1;
displayName = "$STR_ACE_Common_SettingFeedbackIconsName";
description = "$STR_ACE_Common_SettingFeedbackIconsDesc";
values[] = {"Hide", "Top right, downwards", "Top right, to the left", "Top left, downwards", "Top left, to the right"};
};
class GVAR(SettingProgressBarLocation) {
value = 0;
typeName = "SCALAR";
force = 0;
isClientSetable = 1;
displayName = "$STR_ACE_Common_SettingProgressbarLocationName";
description = "$STR_ACE_Common_SettingProgressbarLocationDesc";
values[] = {"Top", "Bottom"};
};
class GVAR(displayTextColor) {
value[] = {0,0,0,0.1};
typeName = "COLOR";
isClientSetable = 1;
displayName = "$STR_ACE_Common_SettingDisplayTextColorName";
description = "$STR_ACE_Common_SettingDisplayTextColorDesc";
};
class GVAR(displayTextFontColor) {
value[] = {1,1,1,1};
typeName = "COLOR";
isClientSetable = 1;
displayName = "$STR_ACE_Common_SettingDisplayTextFontColorName";
description = "$STR_ACE_Common_SettingDisplayTextFontColorDesc";
};
};
#include "define.hpp"
#include <ProgressScreen.hpp>
#include <HintConfig.hpp>
#include <RscInfoType.hpp>
@ -103,3 +136,23 @@ class ACE_Settings {
#include <FixAnimations.hpp>
#include <NoVoice.hpp>
class CfgUIGrids {
class IGUI {
class Presets {
class Arma3 {
class Variables {
grid_ACE_displayText[] = {{((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40)),safeZoneY + 0.175 * safezoneH, (10 *(((safezoneW / safezoneH) min 1.2) / 40)), (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))}, "(((safezoneW / safezoneH) min 1.2) / 40)","((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)"};
};
};
};
class Variables {
class grid_ACE_displayText {
displayName = "ACE Hint";
description = "Textual in game feedback to the player.";
preview = "\a3\Ui_f\data\GUI\Cfg\UIGrids\grid_hint_ca.paa";
saveToProfile[] = {0,1};
};
};
};
};

View File

@ -182,12 +182,12 @@ class ACE_gui_buttonBase {
bottom = 0.00;
};
textureNoShortcut = "";
animTextureNormal = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa) );
animTextureDisabled = QUOTE( PATHTOF(data\buttonDisabled_gradient.paa));
animTextureOver = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa));
animTextureFocused = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa));
animTexturePressed = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa));
animTextureDefault = QUOTE( PATHTOF(data\buttonNormal_gradient_top.paa));
animTextureNormal = "#(argb,8,8,3)color(0,0,0,0.9)";
animTextureDisabled = "#(argb,8,8,3)color(0,0,0,0.8)";
animTextureOver = "#(argb,8,8,3)color(1,1,1,1)";
animTextureFocused = "#(argb,8,8,3)color(1,1,1,1)";
animTexturePressed = "#(argb,8,8,3)color(1,1,1,1)";
animTextureDefault = "#(argb,8,8,3)color(1,1,1,1)";
period = 0.5;
font = FontCSE;
soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};

View File

@ -39,4 +39,4 @@ if (_show) then {
GVAR(MENU_ppHandle_GUI_BLUR_SCREEN) = nil;
};
};
};
};

View File

@ -14,4 +14,4 @@
#define CHANNELS ["group", "side", "global", "command", "vehicle", "direct"]
#define CHANNELS_LOCALIZED [localize "str_channel_group", localize "str_channel_side", localize "str_channel_global", localize "str_channel_command", localize "str_channel_vehicle", localize "str_channel_direct"]
CHANNELS select (CHANNELS_LOCALIZED find (uiNamespace getVariable ["ACE_currentChannel", ""])) max 0
CHANNELS select (CHANNELS_LOCALIZED find (uiNamespace getVariable [QGVAR(currentChannel), ""])) max 0

View File

@ -0,0 +1,120 @@
/*
* Author: Glowbal
*
* Draw progress bar and execute given function if succesful.
* Finish/Failure/Conditional are all passed [_args, _elapsedTime, _totalTime, _errorCode]
*
* Argument:
* 0: icon ID <STRING>
* 1: show <BOOL>
* 2: Icon Path <STRING>
* 3: Icon color <ARRAY>
* 4: timeAlive. -1 = forever <NUMBER> <OPTIONAL>
*
* Return value:
* Nothing
*
* Example:
* ["myID", true, QUOTE(PATHTOF(data\icon_group.paa)), [1,1,1,1], 0] call ace_gui_fnc_displayIcon;
*/
#include "script_component.hpp"
// positions for the icon UI
#define RIGHT_SIDE (safezoneW + safezoneX)
#define LEFT_SIDE safezoneX
#define TOP_SIDE safeZoneY
#define BOTTOM_SIDE (safeZoneH + safezoneY)
#define ICON_WIDTH (2 * (((safezoneW / safezoneH) min 1.2) / 40))
#define X_POS_ICONS (RIGHT_SIDE - (1.5 * ICON_WIDTH))
#define Y_POS_ICONS (TOP_SIDE + (2.5 * ICON_WIDTH))
#define DIFFERENCE_ICONS (1.1 * ICON_WIDTH)
#define X_POS_ICONS_SECOND (RIGHT_SIDE - (4.4 * ICON_WIDTH))
#define Y_POS_ICONS_SECOND (TOP_SIDE + (1.1 * ICON_WIDTH))
// setting values
#define TOP_RIGHT_DOWN 1
#define TOP_RIGHT_LEFT 2
#define TOP_LEFT_DOWN 3
#define TOP_LEFT_RIGHT 4
// other constants
#define DEFAULT_TIME 6
private ["_iconId", "_show", "_icon", "_allControls", "_refresh", "_timeAlive", "_list", "_color"];
_iconId = _this select 0;
_show = _this select 1;
_icon = _this select 2;
_color = _this select 3;
_timeAlive = if (count _this > 4) then {_this select 4} else {DEFAULT_TIME};
disableSerialization;
_list = missionNamespace getvariable [QGVAR(displayIconList),[]];
_refresh = {
private ["_allControls"];
// Refreshing of all icons..
_allControls = missionNamespace getvariable [QGVAR(displayIconListControls), []];
{
ctrlDelete _x;
}foreach _allControls;
_allControls = [];
private ["_ctrl", "_setting"];
_setting = missionNamespace getvariable[QGVAR(settingFeedbackIcons), 0];
if (_setting > 0) then {
{
// +19000 because we want to make certain we are using free IDCs..
_ctrl = ((findDisplay 46) ctrlCreate ["RscPicture", _foreachIndex + 19000]);
_position = switch (_setting) do {
case TOP_RIGHT_DOWN: {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
case TOP_RIGHT_LEFT: {[X_POS_ICONS_SECOND - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND - (ICON_WIDTH / 2), ICON_WIDTH, ICON_WIDTH]};
case TOP_LEFT_DOWN: {[LEFT_SIDE + (0.5 * ICON_WIDTH), Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
case TOP_LEFT_RIGHT: {[LEFT_SIDE + (0.5 * ICON_WIDTH) - ((_foreachIndex+3) * DIFFERENCE_ICONS), Y_POS_ICONS_SECOND, ICON_WIDTH, ICON_WIDTH]};
default {[X_POS_ICONS, Y_POS_ICONS + (_foreachIndex * DIFFERENCE_ICONS), ICON_WIDTH, ICON_WIDTH]};
};
_ctrl ctrlSetPosition _position;
_ctrl ctrlsetText (_x select 1);
_ctrl ctrlSetTextColor (_x select 2);
_ctrl ctrlCommit 0;
_allControls pushback _ctrl;
}foreach (missionNamespace getvariable [QGVAR(displayIconList),[]]);
};
missionNamespace setvariable [QGVAR(displayIconListControls), _allControls];
};
if (_show) then {
if ({(_x select 0 == _iconId)} count _list == 0) then {
_list pushback [_iconId, _icon, _color, time];
} else {
{
if (_x select 0 == _iconId) exitwith {
_list set [_foreachIndex, [_iconId, _icon, _color, time]];
};
}foreach _list;
};
missionNamespace setvariable [QGVAR(displayIconList), _list];
call _refresh;
if (_timeAlive >= 0) then {
[{
[_this select 0, false, "", [0,0,0], 0] call FUNC(displayIcon);
}, [_iconId], _timeAlive, _timeAlive] call EFUNC(common,waitAndExecute);
};
} else {
if ({(_x select 0 == _iconId)} count _list == 1) then {
private "_newList";
_newList = [];
{
if (_x select 0 != _iconId) then {
_newList pushback _x;
};
}foreach _list;
missionNamespace setvariable [QGVAR(displayIconList), _newList];
call _refresh;
};
};

View File

@ -18,36 +18,32 @@
#define DEFAULT_DELAY 2
#define DEFAULT_PRIORITY 0
if (isNil QGVAR(lastHint)) then {
GVAR(lastHint) = [0, 0];
};
_this resize 4;
_this spawn {
private ["_text", "_sound", "_delay", "_priority", "_lastHintTime", "_lastHintPriority", "_time"];
private ["_text", "_sound", "_delay", "_priority", "_lastHintTime", "_lastHintPriority", "_time"];
_text = _this select 0;
_sound = _this select 1;
_delay = _this select 2;
_priority = _this select 3;
_text = _this select 0;
_sound = _this select 1;
_delay = _this select 2;
_priority = _this select 3;
if (isNil QGVAR(lastHint)) then {
GVAR(lastHint) = [0, 0];
};
_lastHintTime = GVAR(lastHint) select 0;
_lastHintPriority = GVAR(lastHint) select 1;
_lastHintTime = GVAR(lastHint) select 0;
_lastHintPriority = GVAR(lastHint) select 1;
if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text};
if (isNil "_sound") then {_sound = DEFAULT_PLAY_SOUND};
if (isNil "_delay") then {_delay = DEFAULT_DELAY};
if (isNil "_priority") then {_priority = DEFAULT_PRIORITY};
if !(typeName _text in ["STRING", "TEXT"]) then {_text = str _text};
if (isNil "_sound") then {_sound = DEFAULT_PLAY_SOUND};
if (isNil "_delay") then {_delay = DEFAULT_DELAY};
if (isNil "_priority") then {_priority = DEFAULT_PRIORITY};
_time = time;
if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then {
_time = time;
if (_time > _lastHintTime + _delay || {_priority >= _lastHintPriority}) then {
hintSilent _text;
if (_sound) then {playSound "ACE_Sound_Click"};
GVAR(lastHint) set [0, _time];
GVAR(lastHint) set [1, _priority];
sleep _delay;
if (_time == GVAR(lastHint) select 0) then {hintSilent ""};
};
[{if ((_this select 0) == GVAR(lastHint) select 0) then {hintSilent ""};}, [_time], _delay, 0] call FUNC(waitAndExecute);
};

View File

@ -1,30 +1,30 @@
/*
* Author: commy2
* Author: commy2, Glowbal
*
* Display a structured text with image.
*
* Argument:
* 0: Text (Anything)
* 1: Image (String)
* 0: Text <ANY>
* 1: Image <STRING>
* 2: Image color <ARRAY> <OPTIONAL>
*
* Return value:
* Nothing
*/
#include "script_component.hpp"
private ["_text", "_image"];
private ["_text", "_image", "_imageColor"];
_text = _this select 0;
_image = _this select 1;
_imageColor = if (count _this > 2) then {_this select 2} else {[1,1,1]};
_imageColor resize 3;
if (typeName _text != "TEXT") then {
_text = parseText format ["<t align='center'>%1</t>", _text];
if (typeName _text == "STRING" && {isLocalized _text}) then {
_text = localize _text;
};
_text = parseText format ["<t align='center'>%1</t>", _text];
};
_text = composeText [
parseText format ["<img size='2.5' align='center' color='#ffffff' image='%1'/>", _image],
lineBreak,
_text
];
[_text] call FUNC(displayTextStructured);
_text = composeText [parseText format ["<img size='2' align='center' color='%2' image='%1'/>", _image, _imageColor call BIS_fnc_colorRGBtoHTML], lineBreak, _text];
[_text, 2] call FUNC(displayTextStructured);

View File

@ -1,26 +1,30 @@
/*
* Author: commy2
* Author: commy2, Glowbal
*
* Display a structured text.
*
* Argument:
* 0: Text (Anything)
* 1: Size of the textbox (Number, optional default: 1)
* 0: Text <ANY>
* 1: Size of the textbox <NUMBER> <OPTIONAL>
*
* Return value:
* Nothing
*/
#include "script_component.hpp"
private ["_text", "_size", "_isShown", "_ctrlHint"];
private ["_text", "_size", "_isShown", "_ctrlHint", "_yPos", "_xPos", "_wPos", "_hPos", "_position"];
_text = _this select 0;
_size = _this select 1;
if (isNil "_size") then {_size = 1};
if (isNil "_size") then {_size = 1.5};
if (typeName _text != "TEXT") then {
_text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]];
if (typeName _text == "STRING" && {isLocalized _text}) then {
_text = localize _text;
};
_text = composeText [lineBreak, parseText format ["<t align='center'>%1</t>", _text]];
};
_isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]);
@ -30,19 +34,25 @@ _isShown = ctrlShown (uiNamespace getVariable ["ACE_ctrlHint", controlNull]);
disableSerialization;
_ctrlHint = uiNamespace getVariable "ACE_ctrlHint";
_ctrlHint ctrlSetPosition [
safeZoneW + safeZoneX - 0 * safezoneW,
safeZoneY + 0.2 * safezoneH,
0.2 * safeZoneW,
_size * 0.1 * SafeZoneH
];
_ctrlHint ctrlSetBackgroundColor GVAR(displayTextColor);
_ctrlHint ctrlSetTextColor GVAR(displayTextFontColor);
/*
// This does not function at the moment. Has been disabled until it fixed.
_xPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_X", ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40))];
_yPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_Y", safeZoneY + 0.175 * safezoneH];
_wPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_W", (10 *(((safezoneW / safezoneH) min 1.2) / 40))];
_hPos = profilenamespace getvariable ["IGUI_GRID_ACE_displayText_H", (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25))];
*/
_xPos = ((safezoneX + safezoneW) - (10 *(((safezoneW / safezoneH) min 1.2) / 40)) - 2.9 *(((safezoneW / safezoneH) min 1.2) / 40));
_yPos = safeZoneY + 0.175 * safezoneH;
_wPos = (10 *(((safezoneW / safezoneH) min 1.2) / 40));
_hPos = (2 *((((safezoneW / safezoneH) min 1.2) / 1.2) / 25));
_position = [_xPos, _yPos, _wPos, _size * _hPos];
_ctrlHint ctrlSetPosition _position;
_ctrlHint ctrlCommit 0;
_ctrlHint ctrlSetStructuredText _text;
_ctrlHint ctrlSetPosition [
safeZoneW + safeZoneX - 0.2 * safezoneW,
safeZoneY + 0.2 * safezoneH,
0.2 * safeZoneW,
_size * 0.1 * SafeZoneH
];
_ctrlHint ctrlCommit ([0.2, 0] select _isShown);
_ctrlHint ctrlSetPosition _position;
_ctrlHint ctrlCommit ([0.5, 0] select _isShown);

View File

@ -1,24 +1,29 @@
/*
Name: FUNC(onLoadRscDisplayChannel)
Author: Pabst Mirror, commy2
Description:
When the RscDisplayChannel is loaded, this will constantly uiNamespace variable "ACE_currentChannel"
with the raw localized text of CA_Channel (IDC=101). Only runs while the display is open.
Parameters:
0: DISPLAY - RscDisplayChannel
Returns:
Nothing
*/
* Author: Pabst Mirror, commy2
* When the RscDisplayChannel is loaded, this will constantly uiNamespace variable ace_common_currentChannel
* with the raw localized text of CA_Channel (IDC=101). Only runs while the display is open.
*
* Arguments:
* 0: The RscDisplayChannel Display <DISPLAY>
*
* Return Value:
* Nothing
*
* Example:
* onLoad = QUOTE(_this call FUNC(onLoadRscDisplayChannel));
*
* Public: No
*/
#include "script_component.hpp"
uiNamespace setVariable ["ACE_ctrlChannel", (_this select 0) displayCtrl 101];
uiNamespace setVariable [QGVAR(currentChannelControl), ((_this select 0) displayCtrl 101)];
["ACE_currentChannel", "onEachFrame", {
if (ctrlText (uiNamespace getVariable ["ACE_ctrlChannel", controlNull]) != "") then {
uiNamespace setVariable ["ACE_currentChannel", ctrlText (uiNamespace getVariable ["ACE_ctrlChannel", controlNull])];
};
if (isNull (uiNamespace getVariable [QGVAR(currentChannelControl), controlNull])) then {
["ACE_currentChannel", "onEachFrame"] call BIS_fnc_removeStackedEventHandler;
} else {
private "_localizedChannelText";
_localizedChannelText = ctrlText (uiNamespace getVariable [QGVAR(currentChannelControl), controlNull]);
uiNamespace setVariable [QGVAR(currentChannel), _localizedChannelText];
};
}] call BIS_fnc_addStackedEventhandler;

View File

@ -15,6 +15,9 @@
*
* Return value:
* Nothing
*
* Example:
* [5, [], {Hint "Finished!"}, {hint "Failure!"}, "My Title"] call ace_common_fnc_progressBar
*/
#include "script_component.hpp"
@ -32,14 +35,24 @@ closeDialog 0;
createDialog QGVAR(ProgressBar_Dialog);
(uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetText _localizedTitle;
if (GVAR(SettingProgressBarLocation) == 1) then {
private "_ctrlPos";
_ctrlPos = [1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2), 29 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2), 38 * (((safezoneW / safezoneH) min 1.2) / 40), 0.8 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)];
(uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlSetPosition _ctrlPos;
(uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlSetPosition _ctrlPos;
(uiNamespace getVariable QGVAR(ctrlProgressBar)) ctrlCommit 0;
(uiNamespace getVariable QGVAR(ctrlProgressBarTitle)) ctrlCommit 0;
};
_perFrameFunction = {
PARAMS_2(_parameters,_pfhID);
EXPLODE_8_PVT(_parameters,_args,_onFinish,_onFail,_condition,_player,_startTime,_totalTime,_exceptions);
private ["_elapsedTime", "_errorCode"];
_elapsedTime = time - _startTime;
_errorCode = -1;
if (isNull (uiNamespace getVariable [QGVAR(ctrlProgressBar), controlNull])) then {
_errorCode = 1;
} else {

View File

@ -42,6 +42,6 @@ if (isPlayer _reciever) then {
}foreach _content;
[_title,_content,_type] call EFUNC(gui,displayInformation);
[_title,_content,_type] call EFUNC(common,displayInformation);
};
};

View File

@ -41,6 +41,6 @@ if (isPlayer _reciever) then {
}foreach _parameters;
_content = format _localizationArray;
[_title,_content,_type] call EFUNC(gui,displayMessage);
[_title,_content,_type] call EFUNC(common,displayMessage);
};
};

View File

@ -17,7 +17,8 @@ EXPLODE_1_PVT(_this,_optionEntry);
_fnc_getValueWithType = {
EXPLODE_2_PVT(_this,_optionEntry,_typeName);
_value = getNumber (_optionEntry >> "value");
_valueConfig = (_optionEntry >> "value");
_value = if (isNumber (_optionEntry >> "value")) then {getNumber (_optionEntry >> "value")} else {0};
TRACE_3("_fnc_getValueWithType:", configName _optionEntry, _typeName, _value);
if (_typeName == "BOOL") exitWith {
_value > 0

View File

@ -315,6 +315,30 @@
<Polish>Ignoruj prośby wysłane przez innych graczy. Akceptacji wymagają między innymi akcje używania / współdzielenia wyposażenia, wykonywania określonych czynności.</Polish>
<Spanish>Rechazar Peticiones de otros jugadores. Pueden ser solicitudes para usar / compartir equipamiento, realizar ciertas acciones.</Spanish>
</Key>
<Key ID="STR_ACE_Common_SettingFeedbackIconsName">
<English>Feedback icons</English>
</Key>
<Key ID="STR_ACE_Common_SettingFeedbackIconsDesc">
<English>Select the position of or disable the feedback icons on your screen. These icons will show to provide extra feedback on your character status and actions performed.</English>
</Key>
<Key ID="STR_ACE_Common_SettingProgressbarLocationName">
<English>Progress bar location</English>
</Key>
<Key ID="STR_ACE_Common_SettingProgressbarLocationDesc">
<English>Set the desired location of the progress bar on your screen.</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextColorName">
<English>Hint Background color</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextColorDesc">
<English>The color of the background from the ACE hints.</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextFontColorName">
<English>Hint text font color</English>
</Key>
<Key ID="STR_ACE_Common_SettingDisplayTextFontColorDesc">
<English>The color of the text font from the ACE hints. This color is the default color for all text displayed through the ACE Hint system, if the hint text has no other color specified.</English>
</Key>
</Package>
</Project>

View File

@ -1,11 +0,0 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE( call compile preprocessFileLineNumbers QUOTE(QUOTE(PATHTOF(XEH_preInit.sqf))) );
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE( call compile preprocessFileLineNumbers QUOTE(QUOTE(PATHTOF(XEH_postInit.sqf))) );
};
};

View File

@ -1,2 +0,0 @@
#include "UI\define.hpp"
#include "UI\RscTitles.hpp"

View File

@ -1,11 +0,0 @@
ace_gui
=======
to be scrapped.
## Maintainers
The people responsible for merging changes to this component or answering potential questions.
- [Glowbal](https://github.com/Glowbal)

View File

@ -1,179 +0,0 @@
#define RIGHT_SIDE (safezoneW + safezoneX)
#define LEFT_SIDE safezoneX
#define TOP_SIDE safeZoneY
#define BOTTOM_SIDE (safeZoneH + safezoneY)
#define ICON_WIDTH (1.75 * (((safezoneW / safezoneH) min 1.2) / 40))
#define X_POS_ICONS RIGHT_SIDE - (1.1 * ICON_WIDTH)
#define Y_POS_ICONS TOP_SIDE + (2.2 * ICON_WIDTH)
#define DIFFERENCE_ICONS (1.1 * ICON_WIDTH)
class RscTitles {
class GVAR(iconsDisplay) {
duration = 1e+011;
idd = 1111;
movingenable = 0;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(iconsDisplay)), _this select 0)]);
class controlsBackground {
class icon_1: ACE_gui_backgroundBase {
text = "";
colorText[] = {0.0,1.0,0.0,0.4};
idc = 10501;
x = X_POS_ICONS;
y = Y_POS_ICONS + (0 * DIFFERENCE_ICONS);
w = ICON_WIDTH;
h = ICON_WIDTH;
};
class icon_2: icon_1 {
idc = 10502;
y = Y_POS_ICONS + (1 * DIFFERENCE_ICONS);
};
class icon_3: icon_1 {
idc = 10503;
y = Y_POS_ICONS + (2 * DIFFERENCE_ICONS);
};
class icon_4: icon_1 {
idc = 10504;
y = Y_POS_ICONS + (3 * DIFFERENCE_ICONS);
};
class icon_5: icon_1 {
idc = 10505;
y = Y_POS_ICONS + (4 * DIFFERENCE_ICONS);
};
class icon_6: icon_1 {
idc = 10506;
y = Y_POS_ICONS + (5 * DIFFERENCE_ICONS);
};
};
};
class GVAR(RSC_PROGRESSBAR_LOADING) {
idd = -1;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(RSC_PROGRESSBAR_LOADING)), _this select 0)]);
fadein = 0;
fadeout = 0;
duration = 10e10;
class Controls {
class background: ACE_gui_backgroundBase {
idc = -1;
colorBackground[] = {0,0,0,1};
colorText[] = {1, 1, 1, 1};
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "29 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "0.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
text = "#(argb,8,8,3)color(0,0,0,0.4)";
};
class Progress: ACE_gui_RscProgress {
idc = 6;
x = "1 * (((safezoneW / safezoneH) min 1.2) / 40) + (safezoneX + (safezoneW - ((safezoneW / safezoneH) min 1.2))/2)";
y = "29 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) + (safezoneY + (safezoneH - (((safezoneW / safezoneH) min 1.2) / 1.2))/2)";
w = "38 * (((safezoneW / safezoneH) min 1.2) / 40)";
h = "0.4 * ((((safezoneW / safezoneH) min 1.2) / 1.2) / 25)";
colorFrame[] = {0,0,0,0};
colorBar[] = {0.27,0.5,0.31,0.6};
texture = "#(argb,8,8,3)color(1,1,1,0.7)";
};
};
};
class GVAR(RSC_DISPLAY_MESSAGE) {
duration = 7;
idd = 86411;
movingenable = 0;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(RSC_DISPLAY_MESSAGE)), _this select 0)]);
fadein = 0;
class controlsBackground {
class header: ACE_gui_staticBase {
idc = 1;
type = CT_STATIC;
x = "safezoneX + (safezoneW / 10)";
y = "safezoneY + (30 * (safeZoneH / 40))";
w = "(safeZoneW / 10)";
h = "(safeZoneH / 40)";
style = ST_LEFT;
font = FontCSE;
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
colorText[] = {0.85, 0.85, 0.85, 1.0};
colorBackground[] = {0, 0, 0, 0.9};
text = "";
};
class text: header {
idc = 2;
y = "safezoneY + (31 * (safeZoneH / 40))";
w = "(safeZoneW / 10) * 1.3";
colorText[] = {0.0, 0.0, 0.0, 1.0};
colorBackground[] = {1, 1, 1, 0.9};
text = "";
};
};
};
class GVAR(RSC_DISPLAY_INFORMATION) {
duration = 15;
idd = 86412;
movingenable = 0;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(RSC_DISPLAY_INFORMATION)), _this select 0)]);
fadein = 0;
class controlsBackground {
class header: ACE_gui_staticBase {
idc = 1;
type = CT_STATIC;
x = "safezoneX + (safezoneW / 10)";
y = "safezoneY + (6 * (safeZoneH / 40))";
w = "(safeZoneW / 10)";
h = "(safeZoneH / 40)";
style = ST_LEFT;
font = FontCSE;
SizeEx = "(((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)";
colorText[] = {0.85, 0.85, 0.85, 1.0};
colorBackground[] = {0, 0, 0, 0.9};
text = "";
};
class text: header {
idc = 2;
y = "safezoneY + (7.1 * (safeZoneH / 40))";
w = "(safeZoneW / 10) * 1.3";
colorText[] = {0.0, 0.0, 0.0, 1.0};
colorBackground[] = {1, 1, 1, 0.9};
text = "";
};
class text2: text {
idc = 3;
y = "safezoneY + (8.2 * (safeZoneH / 40))";
};
class text3: text {
idc = 4;
y = "safezoneY + (9.3 * (safeZoneH / 40))";
};
class text4: text {
idc = 5;
y = "safezoneY + (10.4 * (safeZoneH / 40))";
};
class text5: text {
idc = 6;
y = "safezoneY + (11.5 * (safeZoneH / 40))";
};
class icon: ACE_gui_backgroundBase {
type = CT_STATIC;
idc = 10;
style = ST_PICTURE;
colorBackground[] = {0,0,0,1};
colorText[] = {1, 1, 1, 1};
font = FontCSE;
text = "";
sizeEx = 0.032;
x = "safezoneX + (safezoneW / 10)";
y = "safezoneY + (4 * (safeZoneH / 40))";
w = "(safeZoneH / 40)*2";
h = "(safeZoneH / 40)*2";
};
};
};
};

View File

@ -1,11 +0,0 @@
/**
* XEH_postInit.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"

View File

@ -1,25 +0,0 @@
/**
* XEH_preInit.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"
ADDON = false;
PREP(loadingBar);
PREP(displayInformation);
PREP(displayMessage);
PREP(blurScreen);
PREP(displayIcon);
PREP(sendHintTo);
PREP(sendMessageTo);
PREP(sendDisplayInformationTo);
PREP(sendDisplayMessageTo);
ADDON = true;

View File

@ -1,27 +0,0 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ACE_main"};
version = VERSION;
author[] = {$STR_ACE_Common_ACETeam};
authorUrl = "http://csemod.com"; // TODO website link?
};
};
class CfgAddons {
class PreloadAddons {
class ADDON {
list[] = {QUOTE(ADDON)};
};
};
};
#include "CfgEventHandlers.hpp"
// TODO Port over the UI defines
#include "GUI.hpp"
#include "empty.hpp"

Binary file not shown.

Binary file not shown.

View File

@ -1,21 +0,0 @@
#include "\z\ace\addons\gui\UI\define.hpp"
class ACE_common_empty_screen {
idd = 679123;
onLoad = "uiNamespace setVariable [""ACE_common_empty_screen"", _this select 0]";
onUnload = "if (missionNamespace getvariable [""ACE_common_DISABLE_USER_INPUT_SCREEN"", false)]) then { createDialog ""ACE_common_empty_screen""; }";
class controlsBackground {
class background : ACE_gui_backgroundBase {
idc = 1;
x = safezoneX;
y = safezoneY;
w = safezoneW;
h = safezoneH;
text = "";
moving = 0;
};
};
class controls {
};
};

View File

@ -1,79 +0,0 @@
/**
* fn_gui_displayIcon.sqf
* @Descr:
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: true
*
* @Example ["myID", true, QUOTE(PATHTOF(data\icon_group.paa)), [1,1,1,1]] call ace_gui_fnc_displayIcon;
*/
#include "script_component.hpp"
#define MAX_N_ICONS 6
private ["_iconId", "_show", "_icon", "_spot", "_idc", "_display","_next_IDC", "_nextText"];
_iconId = _this select 0;
_show = _this select 1;
_icon = _this select 2;
_color = _this select 3;
disableSerialization;
_list = missionNamespace getvariable [QGVAR(displayIconList),[]];
_display = uiNamespace getvariable QGVAR(iconsDisplay);
if (isNil "_display") then {
// Display the icons
11401 cutRsc [QGVAR(iconsDisplay),"PLAIN"];
_display = uiNamespace getvariable QGVAR(iconsDisplay);
};
if (_show) then {
if ({(_x select 0 == _iconId)} count _list == 0) then {
_list pushback [_iconId, _icon, _color];
} else {
{
if (_x select 0 == _iconId) exitwith {
_list set [_foreachIndex, [_iconId, _icon, _color]];
};
}foreach _list;
};
missionNamespace setvariable [QGVAR(displayIconList), _list];
{
if (_x select 0 == _iconId) exitwith {
_idc = 10501 + _foreachIndex;
_ctrl = _display displayCtrl _idc;
_ctrl ctrlsetText _icon;
_ctrl ctrlSetTextColor _color;
};
}foreach _list;
} else {
if ({(_x select 0 == _iconId)} count _list == 1) then {
_newList = [];
{
if (_x select 0 != _iconId) then {
_newList pushback _x;
};
}foreach _list;
missionNamespace setvariable [QGVAR(displayIconList), _newList];
for "_i" from 0 to (MAX_N_ICONS - 1) /* step +1 */ do {
_idc = 10501 + _i;
_ctrl = _display displayCtrl _idc;
_ctrl ctrlsetText "";
_ctrl ctrlSetTextColor [1,1,1,1];
};
{
_idc = 10501 + _foreachIndex;
_ctrl = _display displayCtrl _idc;
_ctrl ctrlsetText (_x select 1);
_ctrl ctrlSetTextColor (_x select 2);
}foreach _newList;
};
};

View File

@ -1,67 +0,0 @@
/**
* fn_gui_displayInformation.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"
#define DISPLAY_LAYER 32547
private["_title", "_content","_type","_display","_headerCtrl","_contentCtrl","_contentAmountOfChars","_pos","_icon","_iconCtrl"];
_title = [_this, 0, "",[""]] call BIS_fnc_Param;
_content = [_this, 1, [""],[[""]]] call BIS_fnc_Param;
_type = [_this, 2, 0, [0]] call BIS_fnc_Param;
_icon = [_this, 3, "",[""]] call BIS_fnc_Param;
if (_title != "") then {
DISPLAY_LAYER cutRsc [QGVAR(RSC_DISPLAY_INFORMATION),"PLAIN"];
disableSerialization;
_display = uiNamespace getvariable QGVAR(RSC_DISPLAY_INFORMATION);
if (!isnil "_display") then {
_headerCtrl = _display displayCtrl 1;
_headerCtrl ctrlSetText _title;
_iconCtrl = _display displayCtrl 10;
_iconCtrl ctrlSetText _icon;
_idc = 2;
{
_text = _x;
if (_text != "") then {
_contentCtrl = _display displayCtrl _idc;
_contentCtrl ctrlSetText _text;
_contentAmountOfChars = count (toArray _text);
_pos = ctrlPosition _contentCtrl;
_pos set [2, _contentAmountOfChars * ((((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)/ 3.3) max (safeZoneW / 11)];
_contentCtrl ctrlSetPosition _pos;
_contentCtrl ctrlCommit 0;
if (_type >0) then {
if (_type == 1) then {
_contentCtrl ctrlSetBackgroundColor [0.7,0.2,0.2,0.8];
_contentCtrl ctrlSetTextColor [1,1,1,0.9];
};
};
_idc = _idc + 1;
};
}foreach _content;
while {(_idc < 7)} do {
_contentCtrl = _display displayCtrl _idc;
_contentCtrl ctrlSetPosition [0,0,0,0];
_contentCtrl ctrlCommit 0;
_idc = _idc + 1;
};
};
} else {
DISPLAY_LAYER cutText ["","PLAIN"];
};

View File

@ -1,45 +0,0 @@
/**
* fn_gui_displayMessage.sqf
* @Descr: N/A
* @Author: Glowbal
*
* @Arguments: []
* @Return:
* @PublicAPI: false
*/
#include "script_component.hpp"
#define DISPLAY_LAYER 546
private["_title", "_content","_type","_display","_headerCtrl","_contentCtrl","_contentAmountOfChars","_pos"];
_title = [_this, 0, "",[""]] call BIS_fnc_Param;
_content = [_this, 1, "",[""]] call BIS_fnc_Param;
_type = [_this, 2, 0, [0]] call BIS_fnc_Param;
if (_title != "" && _content != "") then {
DISPLAY_LAYER cutRsc [QGVAR(RSC_DISPLAY_MESSAGE),"PLAIN"];
disableSerialization;
_display = uiNamespace getvariable QGVAR(RSC_DISPLAY_MESSAGE);
if (!isnil "_display") then {
_headerCtrl = _display displayCtrl 1;
_contentCtrl = _display displayCtrl 2;
_headerCtrl ctrlSetText _title;
_contentCtrl ctrlSetText _content;
_contentAmountOfChars = count (toArray _content);
_pos = ctrlPosition _contentCtrl;
_pos set [2, _contentAmountOfChars * ((((((safezoneW / safezoneH) min 1.2) / 1.2) / 25) * 1)/ 3.3) max (safeZoneW / 11)];
_contentCtrl ctrlSetPosition _pos;
_contentCtrl ctrlCommit 0;
if (_type >0) then {
if (_type == 1) then {
_contentCtrl ctrlSetBackgroundColor [0.7,0.2,0.2,0.8];
_contentCtrl ctrlSetTextColor [1,1,1,0.9];
};
};
};
};

View File

@ -1,64 +0,0 @@
/**
* fn_gui_loadingbar.sqf
* @Descr: Displays a loading bar and halts script until loading bar has finished
* @Author: Glowbal
*
* @Arguments: [timeToWait NUMBER, condition CODE (Optional), onSuccess CODE (Optional), onFailure CODE (Optional), arguments ARRAY (Optional)]
* @Return: BOOl Returns true if loading bar has fully finished. Otherwise false
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_timeToWait","_cond","_onfailure","_onSuccess","_args"];
_timeToWait = _this select 0;
_cond = [_this, 1, {true}, [{true}]] call BIS_fnc_Param;
_onSuccess = [_this, 2, {}, [{}]] call BIS_fnc_Param;
_onfailure = [_this, 3, {}, [{}]] call BIS_fnc_Param;
_args = [_this, 4, [], [[]]] call BIS_fnc_Param;
if (_timeToWait > 0) exitwith {
GVAR(LOADING_BAR_STATUS) = 0;
disableSerialization;
1534 cutRsc [QGVAR(RSC_PROGRESSBAR_LOADING),"plain"];
[{
private ["_args","_timeToWait","_start","_cond","_onSuccess","_onfailure","_params"];
_args = _this select 0;
_start = _args select 0;
_timeToWait = _args select 1;
_cond = _args select 2;
_onSuccess = _args select 3;
_onfailure = _args select 4;
_params = _args select 5;
if !(_params call _cond) exitwith {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
1534 cutText ["","plain"];
_params call _onfailure;
};
if (GVAR(LOADING_BAR_STATUS) >= 1) exitwith {
[(_this select 1)] call cba_fnc_removePerFrameHandler;
1534 cutText ["","plain"];
_params call _onSuccess;
};
private "_dialog";
disableSerialization;
_dialog = uiNamespace getvariable QGVAR(RSC_PROGRESSBAR_LOADING);
GVAR(LOADING_BAR_STATUS) = (diag_tickTime - _start) / _timeToWait;
(_dialog displayCtrl 6) progressSetPosition GVAR(LOADING_BAR_STATUS);
}, 0, [diag_tickTime, _timeToWait, _cond, _onSuccess, _onfailure, _args]] call CBA_fnc_addPerFrameHandler;
true;
};
if (_args call _cond) exitwith {
_args call _onSuccess;
true;
};
_args call _onfailure;
false;

View File

@ -1,26 +0,0 @@
/**
* fn_sendHintTo.sqf
* @Descr: Sends a hint to player unit across network
* @Author: Glowbal
*
* @Arguments: [reciever OBJECT, message STRING]
* @Return: void
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_reciever","_message"];
_reciever = _this select 0;
_message = _this select 1;
if (isPlayer _reciever) then {
if (!local _reciever) then {
[_this, QUOTE(FUNC(sendHintTo)), _reciever, false] call EFUNC(common,execRemoteFnc);
} else {
if (isLocalized _message) then {
_message = localize _message;
};
hintsilent format ["%1",_message];
};
};

View File

@ -1,31 +0,0 @@
/**
* fn_sendMessageTo.sqf
* @Descr: Sends a chat message to player unit across the network
* @Author: Glowbal
*
* @Arguments: [reciever OBJECT, message STRING]
* @Return: void
* @PublicAPI: true
*/
#include "script_component.hpp"
private ["_reciever","_message"];
_reciever = _this select 0;
_message = _this select 1;
if (isPlayer _reciever) then {
if (!local _reciever) then {
[_this, QUOTE(FUNC(sendMessageTo)), _reciever, false] call EFUNC(common,execRemoteFnc);
} else {
if (isnil QGVAR(LOGIC_OBJECT)) exitwith {
// need to create an object instead
};
if (isLocalized _message) then {
_message = localize _message;
};
GVAR(LOGIC_OBJECT) globalChat format ["%1",_message];
};
};

View File

@ -1,12 +0,0 @@
#define COMPONENT GUI
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_GUI
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_GUI
#define DEBUG_SETTINGS DEBUG_SETTINGS_GUI
#endif
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -1,12 +0,0 @@
#define COMPONENT GUI
#include "\z\ace\addons\main\script_mod.hpp"
#ifdef DEBUG_ENABLED_GUI
#define DEBUG_MODE_FULL
#endif
#ifdef DEBUG_SETTINGS_GUI
#define DEBUG_SETTINGS DEBUG_SETTINGS_GUI
#endif
#include "\z\ace\addons\main\script_macros.hpp"

View File

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project name="ACE3">
<Package name="ACE_gui">
<Container ID="GUI">
</Container>
</Package>
</Project>

View File

@ -1,9 +1,9 @@
/*
* Author: commy2
* Add an ACE action to an object. Note: This function is NOT global.
* Author: commy2 and NouberNou
* Add an ACE action to an object or inside a parent action. Note: This function is NOT global.
*
* Argument:
* 0: Object the action should be assigned to <OBJECT>
* 0: Object the action should be assigned to or parent action <OBJECT> or <ARRAY>
* 1: Name of the action shown in the menu <STRING>
* 2: Icon <STRING>
* 3: Position (Position or Selection Name) <POSITION> or <STRING>
@ -18,15 +18,10 @@
*/
#include "script_component.hpp"
private ["_object", "_displayName", "_icon", "_position", "_statement", "_condition", "_distance", "_actions", "_entry"];
_object = _this select 0;
_displayName = _this select 1;
_icon = _this select 2;
_position = _this select 3;
_statement = _this select 4;
_condition = _this select 5;
_distance = _this select 6;
EXPLODE_7_PVT(_this,_object,_displayName,_icon,_position,_statement,_condition,_distance);
private ["_actions","_entry"];
_actions = [];
if(IS_OBJECT(_object)) then {
_actions = _object getVariable [QUOTE(GVAR(actionData)), []];
@ -51,4 +46,4 @@ _entry = [
];
GVAR(uidCounter) = GVAR(uidCounter) + 1;
_actions pushBack _entry;
_entry;
_entry;

View File

@ -1,23 +1,18 @@
//fnc_compileMenu.sqf
#include "script_component.hpp";
// diag_log text format["COMPILE ACTIONS: %1", _this];
_object = _this select 0;
_objectType = typeOf _object;
/*
displayName = "$STR_ACE_Interaction_TeamManagement";
distance = 4;
condition = QUOTE(alive _target && {!isPlayer _target} && {_target in units group _player} && {GVAR(EnableTeamManagement)});
statement = "";
showDisabled = 0;
priority = 3.2;
icon = PATHTOF(UI\team\team_management_ca.paa);
subMenu[] = {"ACE_TeamManagement", 0};
hotkey = "M";
enableInside = 1;
*/
* Author: NouberNou
* Compile the action menu from config for a given object.
*
* Argument:
* 0: Object <OBJECT>
*
* Return value:
* None
*
* Public: No
*/
#include "script_component.hpp";
EXPLODE_1_PVT(_this,_object);
/*
[
@ -33,6 +28,8 @@ enableInside = 1;
]
*/
private ["_objectType","_recurseFnc","_actions"];
_objectType = typeOf _object;
_actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_Actions";
@ -73,7 +70,6 @@ _recurseFnc = {
_children,
GVAR(uidCounter)
];
diag_log _entry;
GVAR(uidCounter) = GVAR(uidCounter) + 1;
_actions pushBack _entry;
};
@ -82,29 +78,5 @@ _recurseFnc = {
};
_actions = [_actionsCfg] call _recurseFnc;
//diag_log _actions;
// Backward-compat, filter only base actions that have a selection
private ["_newActions","_oldActions","_selection"];
_filteredActions = [];
{
_selection = _x select 2;
if (typeName _selection == "STRING") then {
_filteredActions pushBack _x;
};
} forEach _actions;
/*
_actions = [[
"Interactions",
"\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",
"Spine3",
{ true },
{ true },
5,
_actions,
GVAR(uidCounter)
]
];
GVAR(uidCounter) = GVAR(uidCounter) + 1;
*/
_object setVariable [QUOTE(GVAR(actionData)), _filteredActions];
_object setVariable [QUOTE(GVAR(actionData)), _actions];

View File

@ -1,21 +1,18 @@
//fnc_compileMenuSelfAction.sqf
#include "script_component.hpp";
// diag_log text format["COMPILE ACTIONS: %1", _this];
_object = _this select 0;
_objectType = typeOf _object;
/*
displayName = "$STR_ACE_Hearing_Earbuds_On";
condition = QUOTE( !([_player] call FUNC(hasEarPlugsIn)) && {'ACE_EarBuds' in items _player} );
statement = QUOTE( [_player] call FUNC(putInEarPlugs) );
showDisabled = 0;
priority = 2.5;
icon = PATHTOF(UI\ACE_earplugs_x_ca.paa);
hotkey = "E";
enableInside = 1;
*/
* Author: NouberNou and CAA-Picard
* Compile the self action menu from config for a given object.
*
* Argument:
* 0: Object <OBJECT>
*
* Return value:
* None
*
* Public: No
*/
#include "script_component.hpp";
EXPLODE_1_PVT(_this,_object);
/*
[
@ -31,6 +28,8 @@ enableInside = 1;
]
*/
private ["_objectType","_recurseFnc","_actions"];
_objectType = typeOf _object;
_actionsCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions";
@ -56,14 +55,7 @@ _recurseFnc = {
_enableInside = getNumber (_entryCfg >> "enableInside");
_condition = compile _condition;
// diag_log text format["_condition: %1", _condition];
_children = [];
if(isArray (_entryCfg >> "subMenu")) then {
_subMenuDef = getArray (_entryCfg >> "subMenu");
_childMenuName = _subMenuDef select 0;
_childMenuCfg = configFile >> "CfgVehicles" >> _objectType >> "ACE_SelfActions" >> _childMenuName;
_children = [_childMenuCfg] call _recurseFnc;
};
_children = [_entryCfg] call _recurseFnc;
_entry = [
_displayName,
_icon,
@ -83,6 +75,7 @@ _recurseFnc = {
_actions = [_actionsCfg] call _recurseFnc;
// Create a master action to base on self action
_actions = [[
"Self Actions",
"\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa",

View File

@ -1,4 +1,15 @@
//fnc_keyDown.sqf
/*
* Author: NouberNou
* Handle interaction key down
*
* Argument:
* None
*
* Return value:
* true <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
if(!GVAR(keyDown)) then {

View File

@ -1,4 +1,15 @@
//fnc_keyDownSelfAction.sqf
/*
* Author: NouberNou
* Handle self action key down
*
* Argument:
* None
*
* Return value:
* true <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
if(!GVAR(keyDownSelfAction)) then {

View File

@ -1,4 +1,15 @@
//fnc_keyUpSelfAction.sqf
/*
* Author: NouberNou
* Handle interaction key up
*
* Argument:
* None
*
* Return value:
* true <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
GVAR(keyDown) = false;

View File

@ -1,4 +1,15 @@
//fnc_keyUp.sqf
/*
* Author: NouberNou
* Handle self action key up
*
* Argument:
* None
*
* Return value:
* true <BOOL>
*
* Public: No
*/
#include "script_component.hpp"
GVAR(keyDownSelfAction) = false;

View File

@ -1,9 +1,21 @@
//fnc_probe.sqf
/*
* Author: NouberNou
* Scan de vicinity of the player and collect every interaction available around it on
* the GVAR(toRender) array.
*
* Argument:
* None
*
* Return value:
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_nearestObjects", "_actionObject", "_x", "_actionData", "_renderData", "_actionItem", "_active", "_renderItem", "_object", "_forEachIndex"];
if(!GVAR(keyDown)) then {
_nearestObjects = nearestObjects [(getPos player), ["All"], 100];
_nearestObjects = nearestObjects [(getPos ACE_player), ["All"], 100];
GVAR(toRender) = [];
{
@ -36,7 +48,7 @@ if(!GVAR(keyDown)) then {
GVAR(filter) = [];
{
_object = _x select 0;
if(_object distance player > 100) then {
if(_object distance ACE_player > 100) then {
GVAR(filter) set[(count GVAR(filter)), _forEachIndex];
};
} forEach GVAR(toRender);

View File

@ -1,24 +1,21 @@
/*
* Author: commy2
*
* Add an ACE action to an object. Note: This function is global.
* Author: commy2 and NouberNou
* Remove an action from an object
*
* Argument:
* 0: Object the action should be assigned to (Object)
* 1: Entry to remove (Array or Number)
* 0: Object the action should be assigned to <OBJECT>
* 1: Entry to remove <ARRAY> or <NUMBER>
*
* Return value:
* ID of the action (used to remove it later).
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_object", "_entry", "_found", "_actions", "_searchFnc"];
_object = _this select 0;
_entry = _this select 1;
EXPLODE_2_PVT(_this,_object,_entry);
private ["_found", "_actions", "_searchFnc"];
if(!IS_OBJECT(_object)) exitWith {false};
@ -50,4 +47,4 @@ _searchFnc = {
_actions = [_actions, _entry] call _searchFnc;
_object setVariable [QUOTE(GVAR(actionData)), _actions];
_found;
_found;

View File

@ -1,4 +1,15 @@
//fnc_render.sqf
/*
* Author: NouberNou and CAA-Picard
* Render all available nearby interactions
*
* Argument:
* None
*
* Return value:
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_cursorPos1", "_cursorPos2", "_cursorVec", "_p1", "_p2", "_p", "_v", "_cp", "_forEachIndex", "_renderTargets", "_x", "_cursorScreenPos", "_closestDistance", "_closestSelection", "_pos", "_sPos", "_disSq", "_closest", "_cTime", "_delta", "_foundTarget", "_misMatch", "_hoverPath", "_i"];

View File

@ -1,4 +1,21 @@
//fnc_renderIcon.sqf
/*
* Author: NouberNou and CAA-Picard
* Render a single interaction icon
*
* Argument:
* 0: Text <STRING>
* 1: Color <STRING>
* 2: 3d position ASL <ARRAY>
* 3: ?
* 4: ?
* 5: ?
* 6: Icon <STRING>
*
* Return value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#define DEFAULT_ICON QUOTE(\z\ace\addons\interaction\ui\dot_ca.paa)
private ["_color", "_pos", "_sPos", "_ctrl", "_icon"];
@ -6,11 +23,11 @@ _text = _this select 0;
_color = _this select 1;
_pos = _this select 2;
_icon = _this select 6;
//systemChat format ["Drawing icon %1", _text];
_sPos = worldToScreen _pos;
// _sPos = _pos;
if(count _sPos > 0) then {
// player sideChat format["render!"];
if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then {
GVAR(iconCtrls) pushBack ((findDisplay 46) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]);
};

View File

@ -1,4 +1,20 @@
//fnc_renderMenu.sqf
/*
* Author: NouberNou and CAA-Picard
* Render a interaction menu
*
* Argument:
* 0: Object <OBJECT>
* 1: Action data <ARRAY>
* 2: ?
* 3: Angle range available for rendering <ARRAY>
* 4: 3D position <ARRAY> (Optional)
* 5: Path of UIDs <ARRAY> (Optional)
*
* Return value:
* None
*
* Public: No
*/
#include "script_component.hpp"
private ["_object", "_actionData", "_distance", "_uid", "_pos", "_cursorScreenPos", "_path", "_menuDepth", "_opacity", "_currentRenderDepth", "_radialOffset", "_active", "_x", "_offset", "_newPos", "_forEachIndex"];

View File

@ -1,4 +1,16 @@
//fnc_rotateVectLine.sqf
/*
* Author: NouberNou
* Rotate a vector line (?)
*
* Argument:
* 0: Map <ARRAY>
* 1: Theta <ARRAY>
*
* Return value:
* 0: ?? <ARRAY>
*
* Public: No
*/
#include "script_component.hpp"
private ["_theta", "_p", "_map", "_p1", "_p2", "_q1", "_q2", "_u", "_d"];

View File

@ -1,4 +1,17 @@
//fnc_rotateVectLineGetMap.sqf
/*
* Author: NouberNou
* ?
*
* Argument:
* 0: p0 <ARRAY>
* 1: p1 <ARRAY>
* 2: p2 <ARRAY>
*
* Return value:
* Map <ARRAY>
*
* Public: No
*/
#include "script_component.hpp"
private ["_p", "_p1", "_p2", "_q1", "_q2", "_u", "_d"];

View File

@ -146,12 +146,23 @@ class CfgVehicles {
};
};
class ACE_TapShoulder {
class ACE_TapShoulderRight {
displayName = "$STR_ACE_Interaction_TapShoulder";
selection = "rightshoulder";
distance = 4;
distance = 2.0;
condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder));
statement = QUOTE([ARR_2(_player, _target)] call DFUNC(tapShoulder));
statement = QUOTE([ARR_3(_player, _target, 0)] call DFUNC(tapShoulder));
showDisabled = 0;
priority = 2.8;
hotkey = "Q";
enableInside = 1;
};
class ACE_TapShoulderLeft {
displayName = "$STR_ACE_Interaction_TapShoulder";
selection = "leftshoulder";
distance = 2.0;
condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder));
statement = QUOTE([ARR_3(_player, _target, 1)] call DFUNC(tapShoulder));
showDisabled = 0;
priority = 2.8;
hotkey = "Q";

View File

@ -1,21 +1,22 @@
// by commy2
#include "script_component.hpp"
private ["_unit", "_message"];
_tapper = _this select 0;
_target = _this select 1;
EXPLODE_3_PVT(_this,_tapper,_target,_shoulderNum);
if (_target != ACE_player) exitWith {
addCamShake [4, 0.5, 5];
if !(local _target) then {
[[_tapper, _target], QUOTE(DFUNC(tapShoulder)), _target] call EFUNC(common,execRemoteFnc);
};
addCamShake [4, 0.5, 5];
ACE_player playActionNow 'gestureAdvance';
if !(local _target) then {
[[_tapper, _target, _shoulderNum], QUOTE(DFUNC(tapShoulder)), _target] call EFUNC(common,execRemoteFnc);
};
};
addCamShake [4, 0.5, 5];
//_message = format ["%1 tapped you on your shoulder.", [_unit] call EFUNC(common,getName)];
_message = localize "STR_ACE_Interaction_YouWereTapped";
if (_shoulderNum == 0) then {
_message = localize "STR_ACE_Interaction_YouWereTappedRight";
} else {
_message = localize "STR_ACE_Interaction_YouWereTappedLeft";
};
[_message] call EFUNC(common,displayTextStructured);

View File

@ -341,17 +341,29 @@
<Portuguese>Tocar ombro</Portuguese>
<Italian>Dai un colpetto</Italian>
</Key>
<Key ID="STR_ACE_Interaction_YouWereTapped">
<English>You were tapped on the shoulder.</English>
<German>Dir wurde auf die Schulter geklopft</German>
<Spanish>Te tocaron el hombro.</Spanish>
<French>On te tape sur l'épaule.</French>
<Polish>Zostałeś klepnięty po ramieniu</Polish>
<Hungarian>Vállonveregettek</Hungarian>
<Czech>Někdo tě poklepal na rameno.</Czech>
<Russian>Вас похлопали по плечу</Russian>
<Portuguese>Você foi tocado no ombro.</Portuguese>
<Italian>Ti è stato dato un colpetto sulla spalla</Italian>
<Key ID="STR_ACE_Interaction_YouWereTappedRight">
<English>You were tapped on the RIGHT shoulder &gt;</English>
<Spanish>Te tocaron el hombro DERECHO &gt;</Spanish>
<German>Dir wurde auf die Schulter geklopft &gt;</German>
<French>On te tape sur l'épaule &gt;</French>
<Polish>Zostałeś klepnięty po ramieniu &gt;</Polish>
<Hungarian>Vállonveregettek &gt;</Hungarian>
<Czech>Někdo tě poklepal na rameno &gt;</Czech>
<Russian>Вас похлопали по плечу &gt;</Russian>
<Portuguese>Você foi tocado no ombro &gt;</Portuguese>
<Italian>Ti è stato dato un colpetto sulla spalla &gt;</Italian>
</Key>
<Key ID="STR_ACE_Interaction_YouWereTappedLeft">
<English>&lt; You were tapped on the LEFT shoulder.</English>
<Spanish>&lt; Te tocaron el hombro IZQUIERDO.</Spanish>
<German>&lt; Dir wurde auf die Schulter geklopft</German>
<French>&lt; On te tape sur l'épaule.</French>
<Polish>&lt; Zostałeś klepnięty po ramieniu</Polish>
<Hungarian>&lt; Vállonveregettek</Hungarian>
<Czech>&lt; Někdo tě poklepal na rameno.</Czech>
<Russian>&lt; Вас похлопали по плечу</Russian>
<Portuguese>&lt; Você foi tocado no ombro.</Portuguese>
<Italian>&lt; Ti è stato dato un colpetto sulla spalla</Italian>
</Key>
<Key ID="STR_ACE_Interaction_CancelSelection">
<English>Cancel</English>

View File

@ -31,42 +31,49 @@
ctrlSetFocus _text;
//Change ok button's text based on current channel
//if (isNull _buttonOK) exitWith {true};
[{
EXPLODE_2_PVT(_this,_params,_pfhId);
EXPLODE_1_PVT(_params,_buttonOK);
_channel = "";
_textColor = [1,1,1,1];
switch (call EFUNC(common,currentChannel)) do {
if (isNull _buttonOK) exitWith {
[_pfhId] call CBA_fnc_removePerFrameHandler;
};
_channel = "";
_textColor = [1,1,1,1];
switch (call EFUNC(common,currentChannel)) do {
case ("global"): {
_channel = localize "str_channel_global";
_textColor = [(216/255),(216/255),(216/255),1];
};
_channel = localize "str_channel_global";
_textColor = [(216/255),(216/255),(216/255),1];
};
case ("side"): {
_channel = localize "str_channel_side";
_textColor = [(70/255),(211/255),(252/255),1];
};
_channel = localize "str_channel_side";
_textColor = [(70/255),(211/255),(252/255),1];
};
case ("group"): {
_channel = localize "str_channel_group";
_textColor = [(181/255),(248/255),(98/255),1];
};
_channel = localize "str_channel_group";
_textColor = [(181/255),(248/255),(98/255),1];
};
case ("vehicle"): {
_channel = localize "str_channel_vehicle";
_textColor = [(255/255),(208/255),(0/255),1];
};
_channel = localize "str_channel_vehicle";
_textColor = [(255/255),(208/255),(0/255),1];
};
case ("direct"): {
_channel = localize "str_channel_direct";
_textColor = [(255/255),(255/255),(255/255),1];
};
_channel = localize "str_channel_direct";
_textColor = [(255/255),(255/255),(255/255),1];
};
case ("command"): {
_channel = localize "str_channel_command";
_textColor = [(255/255),(255/255),(70/255),1];
_channel = localize "str_channel_command";
_textColor = [(255/255),(255/255),(70/255),1];
};
};
};
//If localization not found, then don't touch anything (default is RscButtonMenuOK's localized text)
if (_channel != "") then {
_buttonOK ctrlSetTextColor _textColor;
_buttonOK ctrlSetText format [localize "STR_ACE_Markers_PlaceIn", _channel];
};
//If localization not found, then don't touch anything (default is RscButtonMenuOK's localized text)
if (_channel != "") then {
_buttonOK ctrlSetTextColor _textColor;
_buttonOK ctrlSetText format [localize "STR_ACE_Markers_PlaceIn", _channel];
};
}, 0, [_buttonOK]] call CBA_fnc_addPerFrameHandler;
//--- Background
_pos = ctrlposition _text;

View File

@ -7,7 +7,7 @@ class CfgPatches
units[] = {"ACE_medical_supply_crate_cms", "ACE_bandage_basicItem","ACE_packing_bandageItem","ACE_bandageElasticItem","ACE_tourniquetItem","ACE_splintItem","ACE_morphineItem","ACE_atropineItem","ACE_epinephrineItem","ACE_plasma_ivItem","ACE_plasma_iv_500Item","ACE_plasma_iv250Item","ACE_blood_ivItem","ACE_blood_iv_500Item","ACE_blood_iv_250Item","ACE_saline_ivItem","ACE_saline_iv_500Item","ACE_saline_iv_250Item","ACE_quikclotItem","ACE_nasopharyngeal_tubeItem","ACE_opaItem","ACE_liquidSkinItem","ACE_chestsealItem","ACE_personal_aid_kitItem"};
weapons[] = {"ACE_surgical_kit"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ACE_gui","ACE_common"};
requiredAddons[] = {"ACE_common"};
version = VERSION;
author[] = {$STR_ACE_Common_ACETeam, "Glowbal"};
authorUrl = "http://csemod.com";

View File

@ -51,7 +51,7 @@ if ([_caller] call FUNC(isMedic)) then {
_title = format["STR_ACE_CHECK_BLOODPRESSURE"];
_content = ["STR_ACE_CHECK_BLOODPRESSURE_CHECKED_MEDIC", _output];
[_caller, _title, _content, 0,[[_unit] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)] ] call EFUNC(gui,sendDisplayInformationTo);
[_caller, _title, _content, 0,[[_unit] call EFUNC(common,getName), round(_bloodPressureHigh),round(_bloodPressureLow)] ] call EFUNC(common,sendDisplayInformationTo);
if (_logOutPut != "") then {
[_unit,"examine",format["%1 checked Blood Pressure: %2",[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToQuickViewLog);

View File

@ -19,7 +19,7 @@ if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {};
_title = format["STR_ACE_CHECK_PULSE"];
_content = ["STR_ACE_CHECK_PULSE_CONTENT"];
[_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo);
[_caller, _title, _content] call EFUNC(common,sendDisplayInformationTo);
_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
[2 + round(random(1)),
@ -32,8 +32,8 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
[_caller,false] call FUNC(treatmentMutex);
}, // on success
{
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo);
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
[(_this select 0),false] call FUNC(treatmentMutex);
}, // on failure
[_caller, _target] // arguments
] call EFUNC(gui,loadingBar);
] call EFUNC(common,loadingBar);

View File

@ -19,7 +19,7 @@ if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {};
_title = format["STR_ACE_CHECK_BLOODPRESSURE"];
_content = ["STR_ACE_CHECK_BLOODPRESSURE_CONTENT"];
[_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo);
[_caller, _title, _content] call EFUNC(common,sendDisplayInformationTo);
_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
[2 + round(random(1)),
@ -32,9 +32,9 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
[_caller,false] call FUNC(treatmentMutex);
}, // on success
{
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo);
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
[(_this select 0),false] call FUNC(treatmentMutex);
}, // on failure
[_caller, _target] // arguments
] call EFUNC(gui,loadingBar);
] call EFUNC(common,loadingBar);

View File

@ -87,9 +87,9 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
}, // on success
{
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo);
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
[(_this select 0), false] call FUNC(treatmentMutex);
[(_this select 0), objNull,[0, 0, 0]] call EFUNC(common,carryObj);
}, // on failure
[_caller, _unit, _killOnDrop] // arguments
] call EFUNC(gui,loadingBar);
] call EFUNC(common,loadingBar);

View File

@ -44,7 +44,7 @@ if (_heartRate > 1.0) then {
_title = "STR_ACE_CHECK_PULSE";
_content = ["STR_ACE_CHECK_PULSE_CHECKED_MEDIC",_heartRateOutput];
[_caller, _title, _content, 0, [[_unit] call EFUNC(common,getName), round(_heartRate)]] call EFUNC(gui,sendDisplayInformationTo);
[_caller, _title, _content, 0, [[_unit] call EFUNC(common,getName), round(_heartRate)]] call EFUNC(common,sendDisplayInformationTo);
if (_logOutPut != "") then {
[_unit,"examine",format["%1 checked Heart Rate: %2",[_caller] call EFUNC(common,getName),_logOutPut]] call FUNC(addToQuickViewLog);

View File

@ -19,7 +19,7 @@ if ([_caller] call FUNC(isSetTreatmentMutex)) exitwith {};
_title = format["STR_ACE_CHECK_RESPONSE"];
_content = ["STR_ACE_CHECK_RESPONSE_CONTENT"];
[_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo);
[_caller, _title, _content] call EFUNC(common,sendDisplayInformationTo);
_caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
[2 + round(random(1)),
@ -38,14 +38,14 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
_title = format["STR_ACE_CHECK_RESPONSE"];
_content = [format[localize "STR_ACE_CHECK_REPONSE_YOU_CHECKED",[_target] call EFUNC(common,getName)],_output];
[_caller, _title, _content] call EFUNC(gui,sendDisplayInformationTo);
[_caller, _title, _content] call EFUNC(common,sendDisplayInformationTo);
[_target,"examine",_output] call FUNC(addToQuickViewLog);
[_caller,false] call FUNC(treatmentMutex);
}, // on success
{
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo);
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
[(_this select 0),false] call FUNC(treatmentMutex);
}, // on failure
[_caller, _target] // arguments
] call EFUNC(gui,loadingBar);
] call EFUNC(common,loadingBar);

View File

@ -94,9 +94,9 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
}, // on success
{
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo);
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
[(_this select 0), false] call FUNC(treatmentMutex);
[(_this select 0), objNull,[0, 0, 0]] call EFUNC(common,carryObj);
}, // on failure
[_caller, _unit, _killOnDrop] // arguments
] call EFUNC(gui,loadingBar);
] call EFUNC(common,loadingBar);

View File

@ -53,10 +53,10 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
[_caller,false] call FUNC(treatmentMutex);
}, // on success
{
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo);
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
[(_this select 0),false] call FUNC(treatmentMutex);
}, // on failure
[_caller, _target, _selectionName] // arguments
] call EFUNC(gui,loadingBar);
] call EFUNC(common,loadingBar);

View File

@ -19,7 +19,7 @@ if (!(isPlayer _healer) && GVAR(setting_allowAIFullHeal) && !([_unit] call EFUNC
[_unit, QGVAR(bandagedWounds),[[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0],[0,0,0]]] call EFUNC(common,setDefinedVariable);
if (_unit != _healer) then {
[_unit,"STR_ACE_BANDAGED","STR_ACE_IS_BANDAGING_YOU", 0, [[_healer] call EFUNC(common,getName)]] call EFUNC(gui,sendDisplayMessageTo);
[_unit,"STR_ACE_BANDAGED","STR_ACE_IS_BANDAGING_YOU", 0, [[_healer] call EFUNC(common,getName)]] call EFUNC(common,sendDisplayMessageTo);
};
[_unit,"treatment",format["%1 has patched up the patient",[_healer] call EFUNC(common,getName)]] call FUNC(addActivityToLog);

View File

@ -19,7 +19,7 @@ _removeItem = _this select 3;
if (!local _target) exitwith{};
[_target,"STR_ACE_AIRWAY","STR_ACE_IS_TREATING_YOUR_AIRWAY",0, [([_caller] call EFUNC(common,getName))]] call EFUNC(gui,sendDisplayMessageTo);
[_target,"STR_ACE_AIRWAY","STR_ACE_IS_TREATING_YOUR_AIRWAY",0, [([_caller] call EFUNC(common,getName))]] call EFUNC(common,sendDisplayMessageTo);
[_target,_removeItem] call FUNC(addToTriageList);

View File

@ -24,7 +24,7 @@ if (!local _target) exitwith{
};
if (_caller != _target) then {
[_target,"STR_ACE_BANDAGING", "STR_ACE_IS_BANDAGING_YOU", 0, [[_treatingPerson] call EFUNC(common,getName)]] call EFUNC(gui,sendDisplayMessageTo);
[_target,"STR_ACE_BANDAGING", "STR_ACE_IS_BANDAGING_YOU", 0, [[_treatingPerson] call EFUNC(common,getName)]] call EFUNC(common,sendDisplayMessageTo);
};
[_target,_removeItem] call FUNC(addToTriageList);

View File

@ -56,7 +56,7 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
}, // on success
{
private ["_caller","_target", "_selectionName", "_prevAnim"];
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo);
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
if (_prevAnim != "") then {
[_caller,_prevAnim, 0] call EFUNC(common,doAnimation);
@ -66,6 +66,6 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent;
}, // on failure
[_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments
] call EFUNC(gui,loadingBar);
] call EFUNC(common,loadingBar);
true;

View File

@ -23,7 +23,7 @@ _selectionName = _this select 2;
_removeItem = _this select 3;
_prevAnim = _this select 4;
[_caller,"STR_ACE_STITCHING","STR_ACE_START_STITCHING_INJURIES", 0, [[_injuredPerson] call EFUNC(common,getName),_selectionName]] call EFUNC(gui,sendDisplayMessageTo);
[_caller,"STR_ACE_STITCHING","STR_ACE_START_STITCHING_INJURIES", 0, [[_injuredPerson] call EFUNC(common,getName),_selectionName]] call EFUNC(common,sendDisplayMessageTo);
_bandagedWounds = [_injuredPerson,QGVAR(bandagedWounds)] call EFUNC(common,getDefinedVariable);
_bodyPartN = [_selectionName] call FUNC(getBodyPartNumber);
@ -46,12 +46,12 @@ _caller setvariable [QGVAR(lastStichPerformed), diag_tickTime];
_prevAnim = _args select 4;
if ((vehicle _caller != _caller) || ((getPos _caller) distance (_caller getvariable GVAR(ORIGINAL_POSITION_PLAYER))) >= 1) then {
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo);
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
if (_prevAnim != "") then {
[_caller,_prevAnim, 0] call EFUNC(common,doAnimation);
};
[QGVAR(treatmentIconID), false, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon);
[QGVAR(treatmentIconID), false, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(common,displayIcon);
["Medical_handleTreatment_Stitching", [_caller, _target, _selectionName, _removeItem, false]] call ace_common_fnc_localEvent;
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent;
@ -83,7 +83,7 @@ _caller setvariable [QGVAR(lastStichPerformed), diag_tickTime];
if (_prevAnim != "") then {
[_caller,_prevAnim, 0] call EFUNC(common,doAnimation);
};
[QGVAR(treatmentIconID), false, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon);
[QGVAR(treatmentIconID), false, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(common,displayIcon);
["Medical_handleTreatment_Stitching", [_caller, _target, _selectionName, _removeItem, true]] call ace_common_fnc_localEvent;
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent;
@ -99,6 +99,6 @@ _caller setvariable [QGVAR(lastStichPerformed), diag_tickTime];
{}, // on success
{}, // on failure
[_caller] // arguments
] call EFUNC(gui,loadingBar);
] call EFUNC(common,loadingBar);
true;

View File

@ -42,7 +42,7 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
[_caller,_prevAnim, 0] call EFUNC(common,doAnimation);
};
[QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(gui,displayIcon);
[QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(common,displayIcon);
["Medical_handleTreatment_FullHeal", [_caller, _target, _selectionName, _removeItem, true]] call ace_common_fnc_localEvent;
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent;
}, // on success
@ -54,18 +54,18 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
_removeItem = _this select 3;
_prevAnim = _this select 4;
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo);
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
if (_prevAnim != "") then {
[_caller,_prevAnim, 0] call EFUNC(common,doAnimation);
};
[QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(gui,displayIcon);
[QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(common,displayIcon);
["Medical_handleTreatment_FullHeal", [_caller, _target, _selectionName, _removeItem, false]] call ace_common_fnc_localEvent;
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent;
}, // on failure
[_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments
] call EFUNC(gui,loadingBar);
] call EFUNC(common,loadingBar);
if (!(_unit getvariable [QEGVAR(common,isDead),false]) && alive _unit) then {

View File

@ -31,7 +31,7 @@ if (vehicle _caller == _caller && (vehicle _target == _target) && !(stance _call
if (ACE_player == _caller) then {
// Displaying the treatment icon action
[QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon);
[QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\icon_advanced_treatment.paa)), [1,1,1,1]] call EFUNC(common,displayIcon);
};
_isHandled = switch (_removeItem) do {
@ -77,7 +77,7 @@ _isHandled = switch (_removeItem) do {
_selectionName = _this select 2;
_removeItem = _this select 3;
_prevAnim = _this select 4;
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo);
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
if (_prevAnim != "") then {
[_caller,_prevAnim, 0] call EFUNC(common,doAnimation);
@ -87,7 +87,7 @@ _isHandled = switch (_removeItem) do {
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent;
}, // on failure
[_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments
] call EFUNC(gui,loadingBar);
] call EFUNC(common,loadingBar);
true;
};
};

View File

@ -31,7 +31,7 @@ if (_part == 0 || _part == 1) exitwith {
if (ACE_player == _caller) then {
// Displaying the treatment icon action
[QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\icon_airway_management.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon);
[QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\icon_airway_management.paa)), [1,1,1,1]] call EFUNC(common,displayIcon);
};
// Get the current position for the treatment person
@ -57,7 +57,7 @@ if (_part == 0 || _part == 1) exitwith {
}, // on success
{
private ["_caller","_target", "_selectionName", "_prevAnim"];
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo);
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
if (_prevAnim != "") then {
[_caller,_prevAnim, 0] call EFUNC(common,doAnimation);
@ -67,7 +67,7 @@ if (_part == 0 || _part == 1) exitwith {
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent;
}, // on failure
[_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments
] call EFUNC(gui,loadingBar);
] call EFUNC(common,loadingBar);
true;
};
// TODO display message to caller

View File

@ -39,11 +39,11 @@ if (ACE_player == _caller) then {
};
default {
[_caller, "STR_ACE_BANDAGING", "STR_ACE_APPLY_BANDAGE", 0, [[_target] call EFUNC(common,getName), _selectionName]] call EFUNC(gui,sendDisplayMessageTo);
[_caller, "STR_ACE_BANDAGING", "STR_ACE_APPLY_BANDAGE", 0, [[_target] call EFUNC(common,getName), _selectionName]] call EFUNC(common,sendDisplayMessageTo);
};
};
// Displaying the treatment icon action
[QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\bandage_fracture_small.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon);
[QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\bandage_fracture_small.paa)), [1,1,1,1]] call EFUNC(common,displayIcon);
};
// Get the current position for the treatment person
@ -83,7 +83,7 @@ if (isnil QGVAR(setting_bandageWaitingTime)) then {
}, // on success
{
private ["_caller","_target","_selectedData", "_selectionName", "_prevAnim"];
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo);
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
if (_prevAnim != "") then {
[_caller,_prevAnim, 0] call EFUNC(common,doAnimation);
@ -92,6 +92,6 @@ if (isnil QGVAR(setting_bandageWaitingTime)) then {
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent;
}, // on failure
[_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments
] call EFUNC(gui,loadingBar);
] call EFUNC(common,loadingBar);
true;

View File

@ -28,7 +28,7 @@ if (vehicle _caller == _caller && (vehicle _target == _target) && !(stance _call
if (ACE_player == _caller) then {
// Displaying the treatment icon action
[QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\medication_small.paa)), [1,1,1,1]] call EFUNC(gui,displayIcon);
[QGVAR(treatmentIconID), true, QUOTE(PATHTOF(data\icons\medication_small.paa)), [1,1,1,1]] call EFUNC(common,displayIcon);
};
// Get the current position for the treatment person
@ -54,7 +54,7 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
}, // on success
{
private ["_caller","_target", "_selectionName", "_prevAnim"];
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(gui,sendDisplayInformationTo);
[(_this select 0), "STR_ACE_CANCELED", ["STR_ACE_ACTION_CANCELED","STR_ACE_YOU_MOVED_AWAY"]] call EFUNC(common,sendDisplayInformationTo);
if (_prevAnim != "") then {
[_caller,_prevAnim, 0] call EFUNC(common,doAnimation);
@ -64,6 +64,6 @@ _caller setvariable [QGVAR(StartingPositionHandleTreatment), getPos _caller];
["Medical_treatmentCompleted", [_caller, _target, _selectionName, _removeItem]] call ace_common_fnc_localEvent;
}, // on failure
[_caller, _target, _selectionName, _removeItem, _prevAnim] // arguments
] call EFUNC(gui,loadingBar);
] call EFUNC(common,loadingBar);
true;

View File

@ -46,7 +46,7 @@ if (GVAR(setting_AdvancedLevel) == -1) exitwith{};
GVAR(isEnabled) = true;
waituntil{!isnil "ACE_gui" && !isnil "ACE_common"};
waituntil{!isnil "ACE_common"};
if (GVAR(setting_AdvancedLevel) > 0) then {

View File

@ -21,7 +21,6 @@ private ["_logic","_setting","_objects", "_medicsLoadout", "_nonMedics", "_code"
_logic = [_this,0,objNull,[objNull]] call BIS_fnc_param;
if (!isNull _logic) then {
_setting = _logic getvariable ["equipment",0];
waituntil {!isnil "ACE_gui"}; // ensure the player unit is available.
waituntil {time>0};
_start = diag_tickTime;

View File

@ -23,4 +23,4 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then {
[_caller,false] call FUNC(treatmentMutex);
// TODO: BUG: if AI finishes treatment, it will also hide the icon for the player
[QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(gui,displayIcon);
[QGVAR(treatmentIconID), false, "", [1,1,1,1]] call EFUNC(common,displayIcon);

View File

@ -1 +1 @@
#include "\z\ace\addons\gui\UI\define.hpp"
#include "\z\ace\addons\common\define.hpp"

View File

@ -1,8 +1,8 @@
class GVAR(medicalMenu) {
idd = 314412;
movingEnable = true;
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(medicalMenu)), _this select 0)]; [ARR_2(QUOTE(QGVAR(id)), true)] call EFUNC(gui,blurScreen); [_this select 0] call FUNC(onMenuOpen););
onUnload = QUOTE([ARR_2(QUOTE(QGVAR(id)), false)] call EFUNC(gui,blurScreen); [ARR_2(QUOTE(QGVAR(onMenuOpen)), 'onEachFrame')] call BIS_fnc_removeStackedEventHandler;);
onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(medicalMenu)), _this select 0)]; [ARR_2(QUOTE(QGVAR(id)), true)] call EFUNC(common,blurScreen); [_this select 0] call FUNC(onMenuOpen););
onUnload = QUOTE([ARR_2(QUOTE(QGVAR(id)), false)] call EFUNC(common,blurScreen); [ARR_2(QUOTE(QGVAR(onMenuOpen)), 'onEachFrame')] call BIS_fnc_removeStackedEventHandler;);
class controlsBackground {
class HeaderBackground: ACE_gui_backgroundBase{
idc = -1;

View File

@ -1,19 +1,19 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit) );
};
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit) );
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient) );
};
class ADDON {
clientInit = QUOTE(call COMPILE_FILE(XEH_postInitClient) );
};
};
class Extended_FiredBIS_EventHandlers {
class AllVehicles {
class ADDON {
clientFiredBIS = QUOTE( _this call FUNC(blending) );
class AllVehicles {
class ADDON {
clientFiredBIS = QUOTE( _this call FUNC(blending) );
};
};
};
};

View File

@ -1,22 +1,22 @@
class CfgVehicles {
class All {
ACE_NightVision_grain = 0.75;
ACE_NightVision_blur = 0.055;
};
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
name = #ITEM; \
count = COUNT; \
};
class Box_NATO_Support_F;
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(ACE_NVG_Gen1,6)
MACRO_ADDITEM(ACE_NVG_Gen2,6)
//MACRO_ADDITEM(ACE_NVG_Gen3,6)
MACRO_ADDITEM(ACE_NVG_Gen4,6)
MACRO_ADDITEM(ACE_NVG_Wide,6)
class All {
ACE_NightVision_grain = 0.75;
ACE_NightVision_blur = 0.055;
};
#define MACRO_ADDITEM(ITEM,COUNT) class _xx_##ITEM { \
name = #ITEM; \
count = COUNT; \
};
class Box_NATO_Support_F;
class ACE_Box_Misc: Box_NATO_Support_F {
class TransportItems {
MACRO_ADDITEM(ACE_NVG_Gen1,6)
MACRO_ADDITEM(ACE_NVG_Gen2,6)
//MACRO_ADDITEM(ACE_NVG_Gen3,6)
MACRO_ADDITEM(ACE_NVG_Gen4,6)
MACRO_ADDITEM(ACE_NVG_Wide,6)
};
};
};
};

View File

@ -1,56 +1,56 @@
class CfgWeapons {
class Binocular;
class NVGoggles: Binocular {
displayName = "$STR_ACE_NightVision_NVG_Gen3_brown";
ACE_NightVision_grain = 0.75;
ACE_NightVision_blur = 0.055;
ACE_NightVision_radBlur = 0.001;
};
class NVGoggles_OPFOR: NVGoggles {
displayName = "$STR_ACE_NightVision_NVG_Gen3_black";
};
class NVGoggles_INDEP: NVGoggles {
displayName = "$STR_ACE_NightVision_NVG_Gen3_green";
};
class Binocular;
class NVGoggles: Binocular {
displayName = "$STR_ACE_NightVision_NVG_Gen3_brown";
ACE_NightVision_grain = 0.75;
ACE_NightVision_blur = 0.055;
ACE_NightVision_radBlur = 0.001;
};
class NVGoggles_OPFOR: NVGoggles {
displayName = "$STR_ACE_NightVision_NVG_Gen3_black";
};
class NVGoggles_INDEP: NVGoggles {
displayName = "$STR_ACE_NightVision_NVG_Gen3_green";
};
class ACE_NVG_Gen1: NVGoggles_OPFOR {
author = "$STR_ACE_Common_ACETeam";
modelOptics = "\A3\weapons_f\reticle\optics_night";
displayName = "$STR_ACE_NightVision_NVG_Gen1";
ACE_NightVision_grain = 2.25;
ACE_NightVision_blur = 0.22;
ACE_NightVision_radBlur = 0.004;
};
class ACE_NVG_Gen2: NVGoggles_INDEP {
author = "$STR_ACE_Common_ACETeam";
modelOptics = "\A3\weapons_f\reticle\optics_night";
displayName = "$STR_ACE_NightVision_NVG_Gen2";
ACE_NightVision_grain = 1.5;
ACE_NightVision_blur = 0.11;
ACE_NightVision_radBlur = 0.002;
};
/*class ACE_NVG_Gen3: NVGoggles {
class ACE_NVG_Gen1: NVGoggles_OPFOR {
author = "$STR_ACE_Common_ACETeam";
modelOptics = "\A3\weapons_f\reticle\optics_night";
displayName = "$STR_ACE_NightVision_NVG_Gen1";
ACE_NightVision_grain = 2.25;
ACE_NightVision_blur = 0.22;
ACE_NightVision_radBlur = 0.004;
};
class ACE_NVG_Gen2: NVGoggles_INDEP {
author = "$STR_ACE_Common_ACETeam";
modelOptics = "\A3\weapons_f\reticle\optics_night";
displayName = "$STR_ACE_NightVision_NVG_Gen2";
ACE_NightVision_grain = 1.5;
ACE_NightVision_blur = 0.11;
ACE_NightVision_radBlur = 0.002;
};
/*class ACE_NVG_Gen3: NVGoggles {
author = "$STR_ACE_Common_ACETeam";
modelOptics = "\A3\weapons_f\reticle\optics_night";
displayName = "$STR_ACE_NightVision_NVG_Gen3";
ACE_NightVision_grain = 0.75;
ACE_NightVision_blur = 0.055;
ACE_NightVision_radBlur = 0.001;
};*/
class ACE_NVG_Gen4: NVGoggles {
author = "$STR_ACE_Common_ACETeam";
modelOptics = "\A3\weapons_f\reticle\optics_night";
displayName = "$STR_ACE_NightVision_NVG_Gen4";
ACE_NightVision_grain = 0.0;
ACE_NightVision_blur = 0.0;
ACE_NightVision_radBlur = 0.0;
};
class ACE_NVG_Wide: NVGoggles {
author = "$STR_ACE_Common_ACETeam";
modelOptics = QUOTE(PATHTOF(ACE_nvg_wide_optics));
displayName = "$STR_ACE_NightVision_NVG_FullScreen";
ACE_NightVision_grain = 0.75;
ACE_NightVision_blur = 0.055;
ACE_NightVision_radBlur = 0.001;
};
};*/
class ACE_NVG_Gen4: NVGoggles {
author = "$STR_ACE_Common_ACETeam";
modelOptics = "\A3\weapons_f\reticle\optics_night";
displayName = "$STR_ACE_NightVision_NVG_Gen4";
ACE_NightVision_grain = 0.0;
ACE_NightVision_blur = 0.0;
ACE_NightVision_radBlur = 0.0;
};
class ACE_NVG_Wide: NVGoggles {
author = "$STR_ACE_Common_ACETeam";
modelOptics = QUOTE(PATHTOF(models\ACE_nvg_wide_optics));
displayName = "$STR_ACE_NightVision_NVG_FullScreen";
ACE_NightVision_grain = 0.75;
ACE_NightVision_blur = 0.055;
ACE_NightVision_radBlur = 0.001;
};
};

View File

@ -35,3 +35,40 @@ GVAR(ppEffectMuzzleFlash) ppEffectCommit 0;
["cameraViewChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
["playerVehicleChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
["playerTurretChanged", {_this call FUNC(updatePPEffects)}] call EFUNC(common,addEventHandler);
// Add keybinds
["ACE3",
localize "STR_ACE_NightVision_IncreaseNVGBrightness",
{
// Conditions: canInteract
_exceptions = [QEGVAR(captives,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if ((currentVisionMode _player != 1)) exitWith {false};
// Statement
[ACE_player, 1] call FUNC(changeNVGBrightness);
true
},
[201, [false, false, true]], //PageUp + ALT
false,
"keydown"
] call cba_fnc_registerKeybind;
["ACE3",
localize "STR_ACE_NightVision_DecreaseNVGBrightness",
{
// Conditions: canInteract
_exceptions = [QEGVAR(captives,isNotEscorting)];
if !(_exceptions call EGVAR(common,canInteract)) exitWith {false};
// Conditions: specific
if ((currentVisionMode _player != 1)) exitWith {false};
// Statement
[ACE_player, -1] call FUNC(changeNVGBrightness);
true
},
[209, [false, false, true]], //PageDown + ALT
false,
"keydown"
] call cba_fnc_registerKeybind;

View File

@ -3,8 +3,7 @@
ADDON = false;
PREP(blending);
PREP(decreaseNVGBrightness);
PREP(increaseNVGBrightness);
PREP(changeNVGBrightness);
PREP(updatePPEffects);
ADDON = true;

View File

@ -1,42 +1,17 @@
#include "script_component.hpp"
class CfgPatches {
class ADDON {
units[] = {};
weapons[] = {"ACE_NVG_Gen1", "ACE_NVG_Gen2", /*"ACE_NVG_Gen3",*/ "ACE_NVG_Gen4", "ACE_NVG_Wide"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"commy2", "KoffeinFlummi", "PabstMirror"};
authorUrl = "https://github.com/commy2/";
VERSION_CONFIG;
};
class ADDON {
units[] = {};
weapons[] = {"ACE_NVG_Gen1", "ACE_NVG_Gen2", /*"ACE_NVG_Gen3",*/ "ACE_NVG_Gen4", "ACE_NVG_Wide"};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
author[] = {"commy2", "KoffeinFlummi", "PabstMirror"};
authorUrl = "https://github.com/commy2/";
VERSION_CONFIG;
};
};
#include "CfgEventHandlers.hpp"
#include "CfgVehicles.hpp"
#include "CfgWeapons.hpp"
// class EGVAR(common,Default_Keys) { //???
class ACE_common_Default_Keys {
class increaseNVGBrightness {
displayName = "$STR_ACE_NightVision_IncreaseNVGBrightness";
condition = QUOTE( currentVisionMode _player == 1 );
statement = QUOTE( [_player, _vehicle] call FUNC(increaseNVGBrightness) );
key = 201;
shift = 0;
control = 0;
alt = 1;
allowHolding = 1;
};
class decreaseNVGBrightness {
displayName = "$STR_ACE_NightVision_DecreaseNVGBrightness";
condition = QUOTE( currentVisionMode _player == 1 );
statement = QUOTE( [_player, _vehicle] call FUNC(decreaseNVGBrightness) );
key = 209;
shift = 0;
control = 0;
alt = 1;
allowHolding = 1;
};
};

View File

@ -1,4 +1,24 @@
// by commy2
/*
* Author: commy2
* Change the blending when the player fires??
*
* Arguments:
* 0: unit - Object the event handler is assigned to <OBJECT>
* 1: weapon - Fired weapon <STRING>
* 2: muzzle - Muzzle that was used <STRING>
* 3: mode - Current mode of the fired weapon <STRING>
* 4: ammo - Ammo used <STRING>
* 5: magazine - magazine name which was used <STRING>
* 6: projectile - Object of the projectile that was shot <OBJECT>
*
* Return Value:
* Nothing
*
* Example:
* [clientFiredBIS-XEH] call ace_nightvision_fnc_blending
*
* Public: No
*/
#include "script_component.hpp"
private ["_vehicle", "_weapon", "_ammo", "_magazine", "_player"];
@ -8,26 +28,26 @@ _weapon = _this select 1;
_ammo = _this select 4;
_magazine = _this select 5;
if ((_vehicle != (vehicle ACE_player)) || {(currentVisionMode _vehicle) != 1}) exitWith {};
_player = ACE_player;
//If our vehicle didn't shoot, or we're not in NVG mode, exit
if ((_vehicle != (vehicle _player)) || {(currentVisionMode _player) != 1}) exitWith {};
//If we are mounted, and it wasn't our weapon system that fired, exit
if (_player != _vehicle && {!(_weapon in (_vehicle weaponsTurret ([_player] call EFUNC(common,getTurretIndex))))}) exitWith {};
private ["_silencer", "_visibleFireCoef", "_visibleFireTimeCoef", "_visibleFire", "_visibleFireTime", "_nvgBrightnessCoef", "_fnc_isTracer", "_darkness"];
_silencer = switch (_weapon) do {
case (primaryWeapon _player) : {primaryWeaponItems _player select 0};
case (secondaryWeapon _player) : {secondaryWeaponItems _player select 0};
case (handgunWeapon _player) : {handgunItems _player select 0};
default {""};
case (primaryWeapon _player) : {primaryWeaponItems _player select 0};
case (secondaryWeapon _player) : {secondaryWeaponItems _player select 0};
case (handgunWeapon _player) : {handgunItems _player select 0};
default {""};
};
_visibleFireCoef = 1;
_visibleFireTimeCoef = 1;
if (_silencer != "") then {
_visibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFire");
_visibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFireTime");
_visibleFireCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFire");
_visibleFireTimeCoef = getNumber (configFile >> "CfgWeapons" >> _silencer >> "ItemInfo" >> "AmmoCoef" >> "visibleFireTime");
};
_visibleFire = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFire");
@ -36,24 +56,24 @@ _visibleFireTime = getNumber (configFile >> "CfgAmmo" >> _ammo >> "visibleFireTi
_nvgBrightnessCoef = 1 + (_player getVariable [QGVAR(NVGBrightness), 0]) / 4;
_fnc_isTracer = {
private ["_indexShot", "_lastRoundsTracer", "_tracersEvery"];
private ["_indexShot", "_lastRoundsTracer", "_tracersEvery"];
if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "nvgOnly") > 0) exitWith {false};
if (getNumber (configFile >> "CfgAmmo" >> _ammo >> "nvgOnly") > 0) exitWith {false};
_indexShot = (_player ammo _weapon) + 1;
_indexShot = (_player ammo _weapon) + 1;
_lastRoundsTracer = getNumber (configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer");
if (_indexShot <= _lastRoundsTracer) exitWith {true};
_lastRoundsTracer = getNumber (configFile >> "CfgMagazines" >> _magazine >> "lastRoundsTracer");
if (_indexShot <= _lastRoundsTracer) exitWith {true};
_tracersEvery = getNumber (configFile >> "CfgMagazines" >> _magazine >> "tracersEvery");
if (_tracersEvery == 0) exitWith {false};
_tracersEvery = getNumber (configFile >> "CfgMagazines" >> _magazine >> "tracersEvery");
if (_tracersEvery == 0) exitWith {false};
(_indexShot - _lastRoundsTracer) % _tracersEvery == 0
(_indexShot - _lastRoundsTracer) % _tracersEvery == 0
};
if (call _fnc_isTracer) then {
_visibleFire = _visibleFire + 2;
_visibleFireTime = _visibleFireTime + 2;
_visibleFire = _visibleFire + 2;
_visibleFireTime = _visibleFireTime + 2;
};
_darkness = 1 - (call EFUNC(common,ambientBrightness));

View File

@ -0,0 +1,33 @@
/*
* Author: commy2
* Change the brightness of the unit's NVG
*
* Arguments:
* 0: The Unit <OBJECT>
* 1: Change in brightness (1 or -1) <SCALAR>
*
* Return Value:
* Nothing
*
* Example:
* [player, 1] call ace_nightvision_fnc_changeNVGBrightness
*
* Public: No
*/
#include "script_component.hpp"
private ["_brightness"];
PARAMS_2(_player,_changeInBrightness);
_brightness = _player getVariable [QGVAR(NVGBrightness), 0];
_brightness = ((round (10 * _brightness + _changeInBrightness) / 10) min 1) max -1;
_player setVariable [QGVAR(NVGBrightness), _brightness, false];
GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
GVAR(ppEffectNVGBrightness) ppEffectCommit 0;
[format [(localize "STR_ACE_NightVision_NVGBrightness"), (_brightness * 100)]] call EFUNC(common,displayTextStructured);
playSound "ACE_Sound_Click";

View File

@ -1,21 +0,0 @@
// by commy2
#include "script_component.hpp"
private ["_player", "_vehicle", "_brightness"];
_player = _this select 0;
_vehicle = _this select 1;
_brightness = _player getVariable [QGVAR(NVGBrightness), 0];
if (_brightness > -1) then {
_brightness = round (10 * _brightness - 1) / 10;
_player setVariable [QGVAR(NVGBrightness), _brightness, false];
GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
GVAR(ppEffectNVGBrightness) ppEffectCommit 0;
[format [localize "STR_ACE_NightVision_NVGBrightness", format ["%1%", _brightness * 100]]] call EFUNC(common,displayTextStructured);
playSound "ACE_Sound_Click";
};

View File

@ -1,21 +0,0 @@
// by commy2
#include "script_component.hpp"
private ["_player", "_vehicle", "_brightness"];
_player = _this select 0;
_vehicle = _this select 1;
_brightness = _player getVariable [QGVAR(NVGBrightness), 0];
if (_brightness < 1) then {
_brightness = round (10 * _brightness + 1) / 10;
_player setVariable [QGVAR(NVGBrightness), _brightness, false];
GVAR(ppEffectNVGBrightness) ppEffectAdjust [1, 1, _brightness / 4, [0, 0, 0, 0], [0, 0, 0, 1], [0, 0, 0, 1]];
GVAR(ppEffectNVGBrightness) ppEffectCommit 0;
[format [localize "STR_ACE_NightVision_NVGBrightness", format ["%1%", _brightness * 100]]] call EFUNC(common,displayTextStructured);
playSound "ACE_Sound_Click";
};

View File

@ -1,4 +1,18 @@
//by commy2, PabstMirror and CAA-Picard
/*
* Author: commy2, PabstMirror and CAA-Picard
* Update the ppEffects everytime something changes
*
* Arguments:
* Nothing
*
* Return Value:
* Nothing
*
* Example:
* [someEvent] call ace_nightvision_fnc_updatePPEffects
*
* Public: No
*/
#include "script_component.hpp"
private ["_currentVehicle", "_grainSetting", "_blurSetting", "_radBlurSetting", "_config"];

Binary file not shown.

View File

@ -27,6 +27,9 @@ _intersects = _this call FUNC(getIntersection);
if (true in _intersects) then {
_unit setVariable ["ACE_weaponRested", true];
if (_unit == ACE_PLAYER) then {
[QGVAR(bipodDeployed), true, QUOTE(PATHTOF(data\icons\icon_bipod.paa)), [1,1,1,1], -1] call EFUNC(common,displayIcon);
};
private "_restedPosition";
_restedPosition = getPosASL _unit;

View File

@ -47,3 +47,7 @@ playSound QGVAR(unrest);
_unit setVariable ["ACE_weaponRested", false];
_unit setVariable ["ACE_bipodDeployed", false];
if (_unit == ACE_PLAYER) then {
[QGVAR(bipodDeployed), false, "", [1,1,1,1], -1] call EFUNC(common,displayIcon);
};