From 675b76f569b1d2bd0dd74f8919fc6526af6ad249 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Fri, 1 May 2015 18:12:24 -0500 Subject: [PATCH 001/172] Privates - Interaction --- addons/interaction/XEH_postInit.sqf | 1 + addons/interaction/functions/fnc_MoveDown.sqf | 2 ++ addons/interaction/functions/fnc_addPassengerActions.sqf | 2 +- addons/interaction/functions/fnc_addPassengersActions.sqf | 3 ++- addons/interaction/functions/fnc_applyButtons.sqf | 2 +- addons/interaction/functions/fnc_getDoorAnimations.sqf | 2 +- addons/interaction/functions/fnc_moduleInteraction.sqf | 2 ++ addons/interaction/functions/fnc_openDoor.sqf | 1 + addons/interaction/functions/fnc_openSelectMenu.sqf | 2 ++ addons/interaction/functions/fnc_push.sqf | 3 +-- addons/interaction/functions/fnc_removeTag.sqf | 1 + addons/interaction/functions/fnc_showMouseHint.sqf | 2 +- addons/interaction/functions/fnc_updateTooltipPosition.sqf | 2 ++ 13 files changed, 18 insertions(+), 7 deletions(-) diff --git a/addons/interaction/XEH_postInit.sqf b/addons/interaction/XEH_postInit.sqf index 6417043df2..e828c60912 100644 --- a/addons/interaction/XEH_postInit.sqf +++ b/addons/interaction/XEH_postInit.sqf @@ -15,6 +15,7 @@ if (!hasInterface) exitWith {}; GVAR(isOpeningDoor) = false; // restore global fire teams for JIP +private ["_team"]; { _team = _x getVariable [QGVAR(assignedFireTeam), ""]; if (_team != "") then {_x assignTeam _team}; diff --git a/addons/interaction/functions/fnc_MoveDown.sqf b/addons/interaction/functions/fnc_MoveDown.sqf index eac30e4008..9c916aacbe 100644 --- a/addons/interaction/functions/fnc_MoveDown.sqf +++ b/addons/interaction/functions/fnc_MoveDown.sqf @@ -16,6 +16,8 @@ */ #include "script_component.hpp" +private["_action", "_color", "_count", "_ctrl", "_current", "_dlgInteractionDialog", "_i", "_index", "_infoText", "_player", "_target", "_top", "_vehicle"]; + #define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) if (isNil QGVAR(MainButton)) exitWith{}; if (isNil QGVAR(Buttons)) exitWith{}; diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index 82e3b3b4fb..ae58fe195e 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -16,7 +16,7 @@ EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); -private ["_unit","_actions"]; +private ["_unit", "_actions", "_actionTrees", "_varName"]; _unit = _parameters select 0; _varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit]; diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index c446be3737..5a7c5a4eb1 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -20,8 +20,9 @@ private ["_actions"]; _actions = []; { + private ["_unit"]; _unit = _x; - if (_x != _player) then { + if (_unit != _player) then { _actions pushBack [ [ diff --git a/addons/interaction/functions/fnc_applyButtons.sqf b/addons/interaction/functions/fnc_applyButtons.sqf index be35b34877..e87cfc5e9c 100644 --- a/addons/interaction/functions/fnc_applyButtons.sqf +++ b/addons/interaction/functions/fnc_applyButtons.sqf @@ -2,7 +2,7 @@ #include "script_component.hpp" -private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon"]; +private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon", "_a", "_action", "_count"]; _object = GVAR(Target); _actions = GVAR(Buttons); diff --git a/addons/interaction/functions/fnc_getDoorAnimations.sqf b/addons/interaction/functions/fnc_getDoorAnimations.sqf index ca59ec177c..cd3bc85c50 100644 --- a/addons/interaction/functions/fnc_getDoorAnimations.sqf +++ b/addons/interaction/functions/fnc_getDoorAnimations.sqf @@ -1,7 +1,7 @@ // by commy2 #include "script_component.hpp" -private ["_house", "_door", "_animations", "_lockedVariable"]; +private ["_house", "_door", "_animations", "_lockedVariable", "_index"]; _house = _this select 0; _door = _this select 1; diff --git a/addons/interaction/functions/fnc_moduleInteraction.sqf b/addons/interaction/functions/fnc_moduleInteraction.sqf index 37b7bacba5..6cc70185ec 100644 --- a/addons/interaction/functions/fnc_moduleInteraction.sqf +++ b/addons/interaction/functions/fnc_moduleInteraction.sqf @@ -11,6 +11,8 @@ */ #include "script_component.hpp" +private["_activated", "_logic"]; + _logic = _this select 0; _activated = _this select 2; diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index e175e752cb..25b0cc7cab 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -26,6 +26,7 @@ GVAR(isOpeningDoor) = true; playSound "ACE_Sound_Click"; [_house, _animations] spawn { + private ["_house", "_animations", "_phase", "_position", "_time", "_usedMouseWheel"]; _house = _this select 0; _animations = _this select 1; diff --git a/addons/interaction/functions/fnc_openSelectMenu.sqf b/addons/interaction/functions/fnc_openSelectMenu.sqf index de5459f88c..dad9c424d2 100644 --- a/addons/interaction/functions/fnc_openSelectMenu.sqf +++ b/addons/interaction/functions/fnc_openSelectMenu.sqf @@ -23,6 +23,8 @@ */ #include "script_component.hpp" +private["_action", "_count", "_customActions", "_i"]; + if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then { GVAR(SelectAccept) = _this select 1; GVAR(SelectCancel) = _this select 2; diff --git a/addons/interaction/functions/fnc_push.sqf b/addons/interaction/functions/fnc_push.sqf index f52a9d40de..defefba079 100644 --- a/addons/interaction/functions/fnc_push.sqf +++ b/addons/interaction/functions/fnc_push.sqf @@ -12,8 +12,7 @@ */ #include "script_component.hpp" -_boat = _this select 0; -_velocity = _this select 1; +PARAMS_2(_boat,_velocity); if !(local _boat) exitWith { [_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc); diff --git a/addons/interaction/functions/fnc_removeTag.sqf b/addons/interaction/functions/fnc_removeTag.sqf index 0894520149..552b030dc5 100644 --- a/addons/interaction/functions/fnc_removeTag.sqf +++ b/addons/interaction/functions/fnc_removeTag.sqf @@ -2,6 +2,7 @@ #include "script_component.hpp" 0 spawn { + private["_index", "_name"]; waitUntil {player getVariable ["ACE_Name", ""] != ""}; _name = player getVariable ["ACE_Name", ""]; diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index 5cb96a0eae..0cf8104901 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -20,7 +20,7 @@ #define GUI_GRID_W (0.025) #define GUI_GRID_H (0.04) -private ["_leftClick", "_rightClick", "_scroll"]; +private ["_leftClick", "_rightClick", "_scroll", "_display"]; _leftClick = _this select 0; _rightClick = _this select 1; _scroll = ""; diff --git a/addons/interaction/functions/fnc_updateTooltipPosition.sqf b/addons/interaction/functions/fnc_updateTooltipPosition.sqf index 27148c5aa3..4433d7ecc3 100644 --- a/addons/interaction/functions/fnc_updateTooltipPosition.sqf +++ b/addons/interaction/functions/fnc_updateTooltipPosition.sqf @@ -1,6 +1,8 @@ // by commy2 #include "script_component.hpp" +private["_ctrl"]; + disableSerialization; _ctrl = ctrlParent (_this select 0) displayCtrl 40; From 8b53d5de332d33e05149c96af459bee91e6692cc Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Sat, 2 May 2015 01:18:42 -0300 Subject: [PATCH 002/172] Replace dialog by display --- addons/interact_menu/CursorMenus.hpp | 45 ++----------------- addons/interact_menu/XEH_preInit.sqf | 15 +++++++ .../interact_menu/functions/fnc_keyDown.sqf | 35 ++++++++------- addons/interact_menu/functions/fnc_keyUp.sqf | 2 +- .../functions/fnc_renderIcon.sqf | 4 ++ .../functions/fnc_renderSelector.sqf | 4 ++ 6 files changed, 46 insertions(+), 59 deletions(-) diff --git a/addons/interact_menu/CursorMenus.hpp b/addons/interact_menu/CursorMenus.hpp index d13813b92e..16ced412ec 100644 --- a/addons/interact_menu/CursorMenus.hpp +++ b/addons/interact_menu/CursorMenus.hpp @@ -1,47 +1,8 @@ class GVAR(cursorMenu) { idd = 91919; - movingEnable = false; + access = 0; + movingEnable = 0; + enableSimulation = 1; onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgCursorMenu)),_this select 0)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(cursorMenuOpened)),true)]); onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(cursorMenuOpened)),false)]); - objects[] = {}; - /*class controlsBackground { - class Background { - idc = 91920; - moving = 0; - font = "TahomaB"; - text = ""; - sizeEx = 0; - lineSpacing = 0; - access = 0; - type = 0; - style = 0; - size = 1; - colorBackground[] = {0, 0, 0, 0.5}; - colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; - }; - };*/ - class controls { - class Canvas { - idc = 91921; - moving = 0; - font = "TahomaB"; - text = ""; - sizeEx = 0; - lineSpacing = 0; - access = 0; - type = 0; - style = 0; - size = 1; - colorBackground[] = {0, 0, 0, 0}; - colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; - }; - }; }; diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 7e86646b79..3d67dab6a9 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -25,6 +25,21 @@ PREP(renderSelector); PREP(setupTextColors); PREP(splitPath); +// Event handlers for all interact menu controls +DFUNC(handleMouseMovement) = { + if (GVAR(cursorKeepCentered)) then { + GVAR(cursorPos) = GVAR(cursorPos) vectorAdd [_this select 1, _this select 2, 0] vectorDiff [0.5, 0.5, 0]; + setMousePosition [0.5, 0.5]; + } else { + GVAR(cursorPos) = [_this select 1, _this select 2, 0]; + }; +}; +DFUNC(handleMouseButtonDown) = { + if !(GVAR(actionOnKeyRelease)) then { + [GVAR(openedMenuType),true] call FUNC(keyUp); + }; +}; + GVAR(keyDown) = false; GVAR(keyDownSelfAction) = false; GVAR(keyDownTime) = 0; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index d4e460c10f..5976b99223 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -37,27 +37,30 @@ GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) || {(_menuType == 1) && {(isWeaponDeployed ACE_player) || GVAR(AlwaysUseCursorSelfInteraction) || {cameraView == "GUNNER"}}} || {(_menuType == 0) && GVAR(AlwaysUseCursorInteraction)}; +// Delete existing controls in case there's any left +GVAR(iconCount) = 0; +for "_i" from 0 to (count GVAR(iconCtrls))-1 do { + ctrlDelete (GVAR(iconCtrls) select _i); + GVAR(ParsedTextCached) set [_i, ""]; +}; +GVAR(iconCtrls) resize GVAR(iconCount); + if (GVAR(useCursorMenu)) then { - createDialog QGVAR(cursorMenu); + (findDisplay 46) createDisplay QGVAR(cursorMenu); //"RscCinemaBorder";// + (finddisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; + (finddisplay 91919) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; // The dialog sets: // uiNamespace getVariable QGVAR(dlgCursorMenu); // uiNamespace getVariable QGVAR(cursorMenuOpened); - ctrlEnable [91921, true]; GVAR(cursorPos) = [0.5,0.5,0]; - ((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseMoving", { - if (GVAR(cursorKeepCentered)) then { - GVAR(cursorPos) = GVAR(cursorPos) vectorAdd [_this select 1, _this select 2, 0] vectorDiff [0.5, 0.5, 0]; - setMousePosition [0.5, 0.5]; - } else { - GVAR(cursorPos) = [_this select 1, _this select 2, 0]; - }; - }]; - // handles LMB in cursor mode when action on keyrelease is disabled - ((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseButtonDown", { - if !(GVAR(actionOnKeyRelease)) then { - [GVAR(openedMenuType),true] call FUNC(keyUp); - }; - }]; + + _ctrl = (findDisplay 91919) ctrlCreate ["RscStructuredText", 9922]; + _ctrl ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH]; + _ctrl ctrlCommit 0; + + // handles Mouse moving and LMB in cursor mode when action on keyrelease is disabled + ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; setMousePosition [0.5, 0.5]; }; diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index 7b24497802..6f1d00276f 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -19,7 +19,7 @@ _calledByClicking = _this select 1; if (GVAR(openedMenuType) < 0) exitWith {true}; if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then { - closeDialog 0; + (findDisplay 91919) closeDisplay 2; }; if(GVAR(actionSelected)) then { diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index 180b5a3c36..44a280a52e 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -23,6 +23,10 @@ PARAMS_4(_text,_icon,_sPos,_textSettings); if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { _displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); + if (GVAR(useCursorMenu)) then { + ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; + }; }; _ctrl = GVAR(iconCtrls) select GVAR(iconCount); diff --git a/addons/interact_menu/functions/fnc_renderSelector.sqf b/addons/interact_menu/functions/fnc_renderSelector.sqf index 7ac9559297..96a495c715 100644 --- a/addons/interact_menu/functions/fnc_renderSelector.sqf +++ b/addons/interact_menu/functions/fnc_renderSelector.sqf @@ -20,6 +20,10 @@ private ["_displayNum", "_ctrl", "_pos"]; if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { _displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); + if (GVAR(useCursorMenu)) then { + ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; + }; }; _ctrl = GVAR(iconCtrls) select GVAR(iconCount); From fae10aa7319258750ba4b972cc4ea43fc1010b57 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Sat, 2 May 2015 01:33:28 -0300 Subject: [PATCH 003/172] Replace dialog by display. --- addons/interact_menu/CursorMenus.hpp | 45 ++----------------- addons/interact_menu/XEH_preInit.sqf | 15 +++++++ .../interact_menu/functions/fnc_keyDown.sqf | 35 ++++++++------- addons/interact_menu/functions/fnc_keyUp.sqf | 2 +- .../functions/fnc_renderIcon.sqf | 4 ++ .../functions/fnc_renderSelector.sqf | 4 ++ 6 files changed, 46 insertions(+), 59 deletions(-) diff --git a/addons/interact_menu/CursorMenus.hpp b/addons/interact_menu/CursorMenus.hpp index d13813b92e..16ced412ec 100644 --- a/addons/interact_menu/CursorMenus.hpp +++ b/addons/interact_menu/CursorMenus.hpp @@ -1,47 +1,8 @@ class GVAR(cursorMenu) { idd = 91919; - movingEnable = false; + access = 0; + movingEnable = 0; + enableSimulation = 1; onLoad = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(dlgCursorMenu)),_this select 0)]; uiNamespace setVariable [ARR_2(QUOTE(QGVAR(cursorMenuOpened)),true)]); onUnload = QUOTE(uiNamespace setVariable [ARR_2(QUOTE(QGVAR(cursorMenuOpened)),false)]); - objects[] = {}; - /*class controlsBackground { - class Background { - idc = 91920; - moving = 0; - font = "TahomaB"; - text = ""; - sizeEx = 0; - lineSpacing = 0; - access = 0; - type = 0; - style = 0; - size = 1; - colorBackground[] = {0, 0, 0, 0.5}; - colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; - }; - };*/ - class controls { - class Canvas { - idc = 91921; - moving = 0; - font = "TahomaB"; - text = ""; - sizeEx = 0; - lineSpacing = 0; - access = 0; - type = 0; - style = 0; - size = 1; - colorBackground[] = {0, 0, 0, 0}; - colorText[] = {0, 0, 0, 0}; - x = "safezoneX"; - y = "safezoneY"; - w = "safezoneW"; - h = "safezoneH"; - }; - }; }; diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 7e86646b79..3d67dab6a9 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -25,6 +25,21 @@ PREP(renderSelector); PREP(setupTextColors); PREP(splitPath); +// Event handlers for all interact menu controls +DFUNC(handleMouseMovement) = { + if (GVAR(cursorKeepCentered)) then { + GVAR(cursorPos) = GVAR(cursorPos) vectorAdd [_this select 1, _this select 2, 0] vectorDiff [0.5, 0.5, 0]; + setMousePosition [0.5, 0.5]; + } else { + GVAR(cursorPos) = [_this select 1, _this select 2, 0]; + }; +}; +DFUNC(handleMouseButtonDown) = { + if !(GVAR(actionOnKeyRelease)) then { + [GVAR(openedMenuType),true] call FUNC(keyUp); + }; +}; + GVAR(keyDown) = false; GVAR(keyDownSelfAction) = false; GVAR(keyDownTime) = 0; diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index d4e460c10f..5976b99223 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -37,27 +37,30 @@ GVAR(useCursorMenu) = (vehicle ACE_player != ACE_player) || {(_menuType == 1) && {(isWeaponDeployed ACE_player) || GVAR(AlwaysUseCursorSelfInteraction) || {cameraView == "GUNNER"}}} || {(_menuType == 0) && GVAR(AlwaysUseCursorInteraction)}; +// Delete existing controls in case there's any left +GVAR(iconCount) = 0; +for "_i" from 0 to (count GVAR(iconCtrls))-1 do { + ctrlDelete (GVAR(iconCtrls) select _i); + GVAR(ParsedTextCached) set [_i, ""]; +}; +GVAR(iconCtrls) resize GVAR(iconCount); + if (GVAR(useCursorMenu)) then { - createDialog QGVAR(cursorMenu); + (findDisplay 46) createDisplay QGVAR(cursorMenu); //"RscCinemaBorder";// + (finddisplay 91919) displayAddEventHandler ["KeyUp", {[_this,'keyup'] call CBA_events_fnc_keyHandler}]; + (finddisplay 91919) displayAddEventHandler ["KeyDown", {[_this,'keydown'] call CBA_events_fnc_keyHandler}]; // The dialog sets: // uiNamespace getVariable QGVAR(dlgCursorMenu); // uiNamespace getVariable QGVAR(cursorMenuOpened); - ctrlEnable [91921, true]; GVAR(cursorPos) = [0.5,0.5,0]; - ((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseMoving", { - if (GVAR(cursorKeepCentered)) then { - GVAR(cursorPos) = GVAR(cursorPos) vectorAdd [_this select 1, _this select 2, 0] vectorDiff [0.5, 0.5, 0]; - setMousePosition [0.5, 0.5]; - } else { - GVAR(cursorPos) = [_this select 1, _this select 2, 0]; - }; - }]; - // handles LMB in cursor mode when action on keyrelease is disabled - ((finddisplay 91919) displayctrl 91921) ctrlAddEventHandler ["MouseButtonDown", { - if !(GVAR(actionOnKeyRelease)) then { - [GVAR(openedMenuType),true] call FUNC(keyUp); - }; - }]; + + _ctrl = (findDisplay 91919) ctrlCreate ["RscStructuredText", 9922]; + _ctrl ctrlSetPosition [safeZoneX, safeZoneY, safeZoneW, safeZoneH]; + _ctrl ctrlCommit 0; + + // handles Mouse moving and LMB in cursor mode when action on keyrelease is disabled + ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((finddisplay 91919) displayctrl 9922) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; setMousePosition [0.5, 0.5]; }; diff --git a/addons/interact_menu/functions/fnc_keyUp.sqf b/addons/interact_menu/functions/fnc_keyUp.sqf index 7b24497802..6f1d00276f 100644 --- a/addons/interact_menu/functions/fnc_keyUp.sqf +++ b/addons/interact_menu/functions/fnc_keyUp.sqf @@ -19,7 +19,7 @@ _calledByClicking = _this select 1; if (GVAR(openedMenuType) < 0) exitWith {true}; if (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]) then { - closeDialog 0; + (findDisplay 91919) closeDisplay 2; }; if(GVAR(actionSelected)) then { diff --git a/addons/interact_menu/functions/fnc_renderIcon.sqf b/addons/interact_menu/functions/fnc_renderIcon.sqf index 180b5a3c36..44a280a52e 100644 --- a/addons/interact_menu/functions/fnc_renderIcon.sqf +++ b/addons/interact_menu/functions/fnc_renderIcon.sqf @@ -23,6 +23,10 @@ PARAMS_4(_text,_icon,_sPos,_textSettings); if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { _displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); + if (GVAR(useCursorMenu)) then { + ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; + }; }; _ctrl = GVAR(iconCtrls) select GVAR(iconCount); diff --git a/addons/interact_menu/functions/fnc_renderSelector.sqf b/addons/interact_menu/functions/fnc_renderSelector.sqf index 7ac9559297..96a495c715 100644 --- a/addons/interact_menu/functions/fnc_renderSelector.sqf +++ b/addons/interact_menu/functions/fnc_renderSelector.sqf @@ -20,6 +20,10 @@ private ["_displayNum", "_ctrl", "_pos"]; if(GVAR(iconCount) > (count GVAR(iconCtrls))-1) then { _displayNum = [[46, 12] select visibleMap,91919] select (uiNamespace getVariable [QGVAR(cursorMenuOpened),false]); GVAR(iconCtrls) pushBack ((findDisplay _displayNum) ctrlCreate ["RscStructuredText", 54021+GVAR(iconCount)]); + if (GVAR(useCursorMenu)) then { + ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseMoving", DFUNC(handleMouseMovement)]; + ((finddisplay _displayNum) displayctrl (54021+GVAR(iconCount))) ctrlAddEventHandler ["MouseButtonDown", DFUNC(handleMouseButtonDown)]; + }; }; _ctrl = GVAR(iconCtrls) select GVAR(iconCount); From 1735047e3c851a4bc5fc05d9cca6acc5ea0aa7cd Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Sat, 2 May 2015 14:37:58 -0300 Subject: [PATCH 004/172] Make closer action points oclude farther ones. Improves the clutter of the interact menu when interating with a person from the side. Close #738 --- addons/interact_menu/XEH_preInit.sqf | 1 + .../functions/fnc_renderActionPoints.sqf | 36 +++++++++++++++++-- .../functions/fnc_renderBaseMenu.sqf | 8 +++-- 3 files changed, 39 insertions(+), 6 deletions(-) diff --git a/addons/interact_menu/XEH_preInit.sqf b/addons/interact_menu/XEH_preInit.sqf index 3d67dab6a9..ee0ffe9504 100644 --- a/addons/interact_menu/XEH_preInit.sqf +++ b/addons/interact_menu/XEH_preInit.sqf @@ -66,6 +66,7 @@ GVAR(expandedTime) = diag_tickTime; GVAR(iconCtrls) = []; GVAR(iconCount) = 0; +GVAR(collectedActionPoints) = []; GVAR(foundActions) = []; GVAR(lastTimeSearchedActions) = -1000; diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 8e6cb7d390..c12cbe8c16 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -17,13 +17,13 @@ GVAR(currentOptions) = []; private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_target","_player","_action","_cameraPos","_cameraDir", "_lambda", "_nearestObjects", "_pos"]; _player = ACE_player; +_cameraPos = (positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL); +_cameraDir = ((positionCameraToWorld [0, 0, 1]) call EFUNC(common,positionToASL)) vectorDiff _cameraPos; + _fnc_renderNearbyActions = { // Render all nearby interaction menus #define MAXINTERACTOBJECTS 3 - _cameraPos = (positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL); - _cameraDir = ((positionCameraToWorld [0, 0, 1]) call EFUNC(common,positionToASL)) vectorDiff _cameraPos; - GVAR(foundActions) = []; GVAR(lastTimeSearchedActions) = diag_tickTime; @@ -114,6 +114,8 @@ _fnc_renderSelfActions = { }; +GVAR(collectedActionPoints) resize 0; + // Render nearby actions, unit self actions or vehicle self actions as appropiate if (GVAR(openedMenuType) == 0) then { @@ -132,3 +134,31 @@ if (GVAR(openedMenuType) == 0) then { } else { ACE_player call _fnc_renderSelfActions; }; + +if (count GVAR(collectedActionPoints) > 1) then { + // Do the oclusion pass + + // Order action points according to z + // @todo: after 1.43 is released switch BIS_fnc_sortBy with sort + GVAR(collectedActionPoints) = [GVAR(collectedActionPoints),[],{_x select 0},"ASCEND"] call BIS_fnc_sortBy; + //GVAR(collectedActionPoints) sort true; + + private ["_i","_j","_delta"]; + for [{_i = count GVAR(collectedActionPoints) - 1}, {_i > 0}, {_i = _i - 1}] do { + for [{_j = _i - 1}, {_j >= 0}, {_j = _j - 1}] do { + // Check if action point _i is ocluded by _j + _delta = vectorNormalized ((GVAR(collectedActionPoints) select _i select 1) vectorDiff (GVAR(collectedActionPoints) select _j select 1)); + + // If _i is inside a cone with 20ยบ half angle with origin on _j + if (_delta select 2 > 0.94) exitWith { + GVAR(collectedActionPoints) deleteAt _i; + }; + }; + }; +}; + +// Render the non-ocluded points +{ + EXPLODE_3_PVT(_x,_z,_sPos,_activeActionTree); + [[], _activeActionTree, _sPos, [180,360]] call FUNC(renderMenu); +} forEach GVAR(collectedActionPoints); diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index 4daa4a5c90..913a361941 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -93,11 +93,13 @@ _fnc_print = { // Check if there's something left for rendering if (count _activeActionTree == 0) exitWith {false}; -//EXPLODE_2_PVT(_activeActionTree,_actionData,_actionChildren); - BEGIN_COUNTER(fnc_renderMenus); -[[], _activeActionTree, _sPos, [180,360]] call FUNC(renderMenu); +// IGNORE_PRIVATE_WARNING(_cameraPos,_cameraDir); +_sPos pushBack (((_pos call EFUNC(common,positionToASL)) vectorDiff _cameraPos) vectorDotProduct _cameraDir); + +// Add action point for oclusion and rendering +GVAR(collectedActionPoints) pushBack [_sPos select 2, _sPos, _activeActionTree]; END_COUNTER(fnc_renderMenus); From e6c333bff4baeda7664be651d089d787829813e9 Mon Sep 17 00:00:00 2001 From: esteldunedain Date: Sat, 2 May 2015 14:54:57 -0300 Subject: [PATCH 005/172] Fix oclusion when self-interacting --- addons/interact_menu/functions/fnc_renderBaseMenu.sqf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf index 913a361941..36685a72eb 100644 --- a/addons/interact_menu/functions/fnc_renderBaseMenu.sqf +++ b/addons/interact_menu/functions/fnc_renderBaseMenu.sqf @@ -96,7 +96,11 @@ if (count _activeActionTree == 0) exitWith {false}; BEGIN_COUNTER(fnc_renderMenus); // IGNORE_PRIVATE_WARNING(_cameraPos,_cameraDir); -_sPos pushBack (((_pos call EFUNC(common,positionToASL)) vectorDiff _cameraPos) vectorDotProduct _cameraDir); +if (count _pos > 2) then { + _sPos pushBack (((_pos call EFUNC(common,positionToASL)) vectorDiff _cameraPos) vectorDotProduct _cameraDir); +} else { + _sPos pushBack 0; +}; // Add action point for oclusion and rendering GVAR(collectedActionPoints) pushBack [_sPos select 2, _sPos, _activeActionTree]; From 5f43cffecd105341fbbc470dd87bbc89dfa2828d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 5 May 2015 20:35:08 -0500 Subject: [PATCH 006/172] Sort for mag repack --- addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf index 4ef69044da..67c5c4630b 100644 --- a/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf +++ b/addons/magazinerepack/functions/fnc_simulateRepackEvents.sqf @@ -24,7 +24,8 @@ private ["_newMagFnc", "_time", "_events", "_swapAmmoFnc", "_ammoSwaped", "_lowI PARAMS_3(_fullMagazineCount,_arrayOfAmmoCounts,_isBelt); // Sort Ascending - Don't modify original -_arrayOfAmmoCounts = (+_arrayOfAmmoCounts) call BIS_fnc_sortNum; +_arrayOfAmmoCounts = +_arrayOfAmmoCounts; +_arrayOfAmmoCounts sort true; _newMagFnc = { _time = _time + GVAR(TimePerMagazine); From c2bb6386af70770ebc21977466a2199a6f607e0e Mon Sep 17 00:00:00 2001 From: SAM Date: Thu, 7 May 2015 22:41:44 +0200 Subject: [PATCH 007/172] Added required files for new module --- addons/viewdistance/$PBOPREFIX$ | 1 + addons/viewdistance/CfgEventHandlers.hpp | 6 ++++++ addons/viewdistance/XEH_preInit.sqf | 7 +++++++ addons/viewdistance/config.cpp | 15 +++++++++++++++ addons/viewdistance/functions/fnc_empty.sqf | 3 +++ .../viewdistance/functions/script_component.hpp | 1 + addons/viewdistance/script_component.hpp | 12 ++++++++++++ 7 files changed, 45 insertions(+) create mode 100644 addons/viewdistance/$PBOPREFIX$ create mode 100644 addons/viewdistance/CfgEventHandlers.hpp create mode 100644 addons/viewdistance/XEH_preInit.sqf create mode 100644 addons/viewdistance/config.cpp create mode 100644 addons/viewdistance/functions/fnc_empty.sqf create mode 100644 addons/viewdistance/functions/script_component.hpp create mode 100644 addons/viewdistance/script_component.hpp diff --git a/addons/viewdistance/$PBOPREFIX$ b/addons/viewdistance/$PBOPREFIX$ new file mode 100644 index 0000000000..39789fcaba --- /dev/null +++ b/addons/viewdistance/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\blank \ No newline at end of file diff --git a/addons/viewdistance/CfgEventHandlers.hpp b/addons/viewdistance/CfgEventHandlers.hpp new file mode 100644 index 0000000000..f0a9f14d91 --- /dev/null +++ b/addons/viewdistance/CfgEventHandlers.hpp @@ -0,0 +1,6 @@ + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; diff --git a/addons/viewdistance/XEH_preInit.sqf b/addons/viewdistance/XEH_preInit.sqf new file mode 100644 index 0000000000..69abb46fa9 --- /dev/null +++ b/addons/viewdistance/XEH_preInit.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(empty); + +ADDON = true; diff --git a/addons/viewdistance/config.cpp b/addons/viewdistance/config.cpp new file mode 100644 index 0000000000..a7b7bae6df --- /dev/null +++ b/addons/viewdistance/config.cpp @@ -0,0 +1,15 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {""}; + authorUrl = ""; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" diff --git a/addons/viewdistance/functions/fnc_empty.sqf b/addons/viewdistance/functions/fnc_empty.sqf new file mode 100644 index 0000000000..c60a82b2d8 --- /dev/null +++ b/addons/viewdistance/functions/fnc_empty.sqf @@ -0,0 +1,3 @@ +#include "script_component.hpp" + +diag_log text format["This is here as an example!!!"]; diff --git a/addons/viewdistance/functions/script_component.hpp b/addons/viewdistance/functions/script_component.hpp new file mode 100644 index 0000000000..4b7df89f37 --- /dev/null +++ b/addons/viewdistance/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\viewdistance\script_component.hpp" \ No newline at end of file diff --git a/addons/viewdistance/script_component.hpp b/addons/viewdistance/script_component.hpp new file mode 100644 index 0000000000..79e0e488cc --- /dev/null +++ b/addons/viewdistance/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT viewdistance +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_VIEWDISTANCE + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_VIEWDISTANCE + #define DEBUG_SETTINGS DEBUG_SETTINGS_VIEWDISTANCE +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file From 2c8dddfc473fe156576bd8bba288f0bee00fadd5 Mon Sep 17 00:00:00 2001 From: SAM Date: Fri, 8 May 2015 09:28:48 +0200 Subject: [PATCH 008/172] Adding required files --- addons/viewdistance/ACE_Settings.hpp | 9 +++++++ addons/viewdistance/config.cpp | 5 ++-- .../functions/fnc_changeViewDistance.sqf | 24 +++++++++++++++++++ addons/viewdistance/functions/fnc_empty.sqf | 3 --- 4 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 addons/viewdistance/ACE_Settings.hpp create mode 100644 addons/viewdistance/functions/fnc_changeViewDistance.sqf delete mode 100644 addons/viewdistance/functions/fnc_empty.sqf diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp new file mode 100644 index 0000000000..572358876a --- /dev/null +++ b/addons/viewdistance/ACE_Settings.hpp @@ -0,0 +1,9 @@ +class ACE_Settings { + class GVAR(viewdistance) { + typeName = "SCALAR"; + isClientSettable = 1; + values[] = {1500,2000,2500,3000,3500,4000,5000,6000,7000,8000,9000,10000}; + displayName = "View Distance"; // has to be changed to string table type + description = "Change View Distance"; + }; +}; \ No newline at end of file diff --git a/addons/viewdistance/config.cpp b/addons/viewdistance/config.cpp index a7b7bae6df..dcffe0f257 100644 --- a/addons/viewdistance/config.cpp +++ b/addons/viewdistance/config.cpp @@ -6,10 +6,11 @@ class CfgPatches { weapons[] = {}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_common"}; - author[] = {""}; - authorUrl = ""; + author[] = {"Winter"}; + authorUrl = "https://github.com/Winter259"; VERSION_CONFIG; }; }; #include "CfgEventHandlers.hpp" +#include "ACE_Settings.hpp" \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf new file mode 100644 index 0000000000..4543be000b --- /dev/null +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -0,0 +1,24 @@ +/* + * Author: Winter + * Sets the player's current view distance according to allowed values. + * + * + * Arguments: + * 0: View Distance Setting (SCALAR) + * + * Return Value: + * None + * + * Example: + * [1500] call ace_common_fnc_imanexample + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_new_view_distance"]; + +_new_view_distance = _this select 0; + +player setViewDistance (_new_view_distance); \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_empty.sqf b/addons/viewdistance/functions/fnc_empty.sqf deleted file mode 100644 index c60a82b2d8..0000000000 --- a/addons/viewdistance/functions/fnc_empty.sqf +++ /dev/null @@ -1,3 +0,0 @@ -#include "script_component.hpp" - -diag_log text format["This is here as an example!!!"]; From 6b604c101cf5f2e1b3af60bba85bf7984ddde7e5 Mon Sep 17 00:00:00 2001 From: SAM Date: Fri, 8 May 2015 14:14:15 +0200 Subject: [PATCH 009/172] First working version --- addons/viewdistance/ACE_Settings.hpp | 25 ++++++++--- addons/viewdistance/CfgEventHandlers.hpp | 6 +++ addons/viewdistance/XEH_postInit.sqf | 4 ++ addons/viewdistance/XEH_preInit.sqf | 6 ++- addons/viewdistance/config.cpp | 2 +- .../functions/fnc_changeViewDistance.sqf | 27 +++++++++--- .../functions/fnc_initViewDistance.sqf | 24 +++++++++++ .../functions/fnc_returnViewDistanceValue.sqf | 42 +++++++++++++++++++ 8 files changed, 123 insertions(+), 13 deletions(-) create mode 100644 addons/viewdistance/XEH_postInit.sqf create mode 100644 addons/viewdistance/functions/fnc_initViewDistance.sqf create mode 100644 addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp index 572358876a..48e5f7324e 100644 --- a/addons/viewdistance/ACE_Settings.hpp +++ b/addons/viewdistance/ACE_Settings.hpp @@ -1,9 +1,24 @@ class ACE_Settings { - class GVAR(viewdistance) { + class GVAR(changeAllowed) { + typeName = "BOOL"; + value = 1; + displayName = "Allow View Distance Changing"; + description = "Enables changing in game view distance"; + }; + class GVAR(top_limit) { + typeName = "SCALAR"; + values[] = {0,1,2,3,4,5,6,7,8,9,10,11}; // correspond to the index values + displayName = "View Distance Limit"; + description = "Sets the top limit for all clients"; + }; + class GVAR(newViewDistance) { typeName = "SCALAR"; isClientSettable = 1; - values[] = {1500,2000,2500,3000,3500,4000,5000,6000,7000,8000,9000,10000}; - displayName = "View Distance"; // has to be changed to string table type - description = "Change View Distance"; + //value = 1; + values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; + displayName = "Change View Distance"; + description = "Changes in game view distance"; }; -}; \ No newline at end of file +}; + +// To do: include string table style displayName & description. \ No newline at end of file diff --git a/addons/viewdistance/CfgEventHandlers.hpp b/addons/viewdistance/CfgEventHandlers.hpp index f0a9f14d91..0f1d8878ba 100644 --- a/addons/viewdistance/CfgEventHandlers.hpp +++ b/addons/viewdistance/CfgEventHandlers.hpp @@ -4,3 +4,9 @@ class Extended_PreInit_EventHandlers { init = QUOTE(call COMPILE_FILE(XEH_preInit)); }; }; + +class Extended_PostInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_postInit)); + }; +}; \ No newline at end of file diff --git a/addons/viewdistance/XEH_postInit.sqf b/addons/viewdistance/XEH_postInit.sqf new file mode 100644 index 0000000000..8f1fd94fc3 --- /dev/null +++ b/addons/viewdistance/XEH_postInit.sqf @@ -0,0 +1,4 @@ +#include "script_component.hpp" + +if (!hasInterface || !GVAR(enabled)) exitWith {}; +[] call FUNC(initViewDistance); \ No newline at end of file diff --git a/addons/viewdistance/XEH_preInit.sqf b/addons/viewdistance/XEH_preInit.sqf index 69abb46fa9..4da9b33c83 100644 --- a/addons/viewdistance/XEH_preInit.sqf +++ b/addons/viewdistance/XEH_preInit.sqf @@ -2,6 +2,8 @@ ADDON = false; -PREP(empty); +PREP(returnViewDistanceValue); +PREP(changeViewDistance); +PREP(initViewDistance); -ADDON = true; +ADDON = true; \ No newline at end of file diff --git a/addons/viewdistance/config.cpp b/addons/viewdistance/config.cpp index dcffe0f257..86453c5be3 100644 --- a/addons/viewdistance/config.cpp +++ b/addons/viewdistance/config.cpp @@ -13,4 +13,4 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" -#include "ACE_Settings.hpp" \ No newline at end of file +#include "ACE_Settings.hpp" \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 4543be000b..f28ce70e3d 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -4,21 +4,38 @@ * * * Arguments: - * 0: View Distance Setting (SCALAR) + * None * * Return Value: * None * * Example: - * [1500] call ace_common_fnc_imanexample + * [] call ace_viewdistance_fnc_changeViewDistance; * * Public: No */ #include "script_component.hpp" -private ["_new_view_distance"]; +private ["_new_view_distance_index","_new_view_distance"]; -_new_view_distance = _this select 0; +_new_view_distance_index = GVAR(newViewDistance); -player setViewDistance (_new_view_distance); \ No newline at end of file +_new_view_distance = [_new_view_distance_index] call FUNC(returnViewDistanceValue); + +/* +hint format ["DEBUG: Player: %1 new view distance index: %2 new view distance value: %3",(name player),_new_view_distance_index,_new_view_distance]; +diag_log format ["DEBUG: Player: %1 new view distance index: %2 new view distance value: %3",(name player),_new_view_distance_index,_new_view_distance]; +*/ + + +// To do: add a check against a sever or module top limit here. + +if !GVAR(changeAllowed) then +{ + hint "You cannot change the view distance!" +} +else +{ + setViewDistance _new_view_distance; +}; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_initViewDistance.sqf b/addons/viewdistance/functions/fnc_initViewDistance.sqf new file mode 100644 index 0000000000..2a419fe7fc --- /dev/null +++ b/addons/viewdistance/functions/fnc_initViewDistance.sqf @@ -0,0 +1,24 @@ +/* + * Author: Winter + * Sets the player's current view distance according to allowed values. + * + * + * Arguments: + * 0: View Distance Setting (SCALAR) + * + * Return Value: + * None + * + * Example: + * [1500] call ace_common_fnc_imanexample + * + * Public: No + */ + +#include "script_component.hpp" + +["SettingChanged",{ + if (_this select 0 == QGVAR(newViewDistance)) then { + [] call FUNC(changeViewDistance); + }; +},true] call ace_common_fnc_addEventHandler; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf b/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf new file mode 100644 index 0000000000..7d55062c65 --- /dev/null +++ b/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf @@ -0,0 +1,42 @@ +/* + * Author: Winter + * Returns the view distance value according to the given index + * + * + * Arguments: + * 0: View Distance Index (SCALAR) + * + * Return Value: + * View Distance (SCALAR) + * + * Example: + * [2] call ace_viewdistance_fnc_returnViewDistanceValue; + * + * Public: Yes + */ + +#include "script_component.hpp" + +private ["_index","_return"]; + +_index = _this select 0; +_return = 0; + +switch (_index) do +{ + case 0: {_return = 1500}; + case 1: {_return = 2000}; + case 2: {_return = 2500}; + case 3: {_return = 3000}; + case 4: {_return = 3500}; + case 5: {_return = 4000}; + case 6: {_return = 5000}; + case 7: {_return = 6000}; + case 8: {_return = 7000}; + case 9: {_return = 8000}; + case 10: {_return = 9000}; + case 11: {_return = 10000}; + default {hint "something broke!";}; +}; + +_return; \ No newline at end of file From a5d68f122d6975ec20d051b8599f99e35e5255b8 Mon Sep 17 00:00:00 2001 From: SAM Date: Fri, 8 May 2015 14:49:52 +0200 Subject: [PATCH 010/172] Added working limiter (config based) --- addons/viewdistance/ACE_Settings.hpp | 9 ++--- .../functions/fnc_changeViewDistance.sqf | 34 ++++++++----------- .../functions/fnc_returnViewDistanceValue.sqf | 30 ++++++++-------- 3 files changed, 36 insertions(+), 37 deletions(-) diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp index 48e5f7324e..55b38df7df 100644 --- a/addons/viewdistance/ACE_Settings.hpp +++ b/addons/viewdistance/ACE_Settings.hpp @@ -3,18 +3,19 @@ class ACE_Settings { typeName = "BOOL"; value = 1; displayName = "Allow View Distance Changing"; - description = "Enables changing in game view distance"; + description = "Allows clients to be able to change their view distance"; }; - class GVAR(top_limit) { + class GVAR(topViewDistanceLimit) { typeName = "SCALAR"; + value = 11; // setting the highest number in the array below means no limit. values[] = {0,1,2,3,4,5,6,7,8,9,10,11}; // correspond to the index values - displayName = "View Distance Limit"; + displayName = "Change View Distance Limit"; description = "Sets the top limit for all clients"; }; class GVAR(newViewDistance) { typeName = "SCALAR"; isClientSettable = 1; - //value = 1; + value = 0; // not sure what to set this to. values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; displayName = "Change View Distance"; description = "Changes in game view distance"; diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index f28ce70e3d..a25837bd0f 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -17,25 +17,21 @@ #include "script_component.hpp" -private ["_new_view_distance_index","_new_view_distance"]; +private ["_new_view_distance","_new_view_distance_limit"]; -_new_view_distance_index = GVAR(newViewDistance); +_new_view_distance = [GVAR(newViewDistance)] call FUNC(returnViewDistanceValue); +_view_distance_limit = [GVAR(topViewDistanceLimit)] call FUNC(returnViewDistanceValue); -_new_view_distance = [_new_view_distance_index] call FUNC(returnViewDistanceValue); +if !GVAR(changeAllowed) then { + hint "You are not allowed to change the view distance!"; +} else { + if (_new_view_distance > _view_distance_limit) then { + hint format ["That option is not allowed! The limit is: %1m",_view_distance_limit]; + } + else { + hint format ["View distance successfully changed to: %1m",_new_view_distance]; + setViewDistance _new_view_distance; + }; +}; -/* -hint format ["DEBUG: Player: %1 new view distance index: %2 new view distance value: %3",(name player),_new_view_distance_index,_new_view_distance]; -diag_log format ["DEBUG: Player: %1 new view distance index: %2 new view distance value: %3",(name player),_new_view_distance_index,_new_view_distance]; -*/ - - -// To do: add a check against a sever or module top limit here. - -if !GVAR(changeAllowed) then -{ - hint "You cannot change the view distance!" -} -else -{ - setViewDistance _new_view_distance; -}; \ No newline at end of file +// To do: add a check against a module limit. \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf b/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf index 7d55062c65..ec55a2a755 100644 --- a/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf +++ b/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf @@ -4,10 +4,10 @@ * * * Arguments: - * 0: View Distance Index (SCALAR) + * 0: View Distance Index * * Return Value: - * View Distance (SCALAR) + * View Distance * * Example: * [2] call ace_viewdistance_fnc_returnViewDistanceValue; @@ -22,20 +22,22 @@ private ["_index","_return"]; _index = _this select 0; _return = 0; + +// change to if () exitWith {};? switch (_index) do { - case 0: {_return = 1500}; - case 1: {_return = 2000}; - case 2: {_return = 2500}; - case 3: {_return = 3000}; - case 4: {_return = 3500}; - case 5: {_return = 4000}; - case 6: {_return = 5000}; - case 7: {_return = 6000}; - case 8: {_return = 7000}; - case 9: {_return = 8000}; - case 10: {_return = 9000}; - case 11: {_return = 10000}; + case 0: {_return = 1500;}; + case 1: {_return = 2000;}; + case 2: {_return = 2500;}; + case 3: {_return = 3000;}; + case 4: {_return = 3500;}; + case 5: {_return = 4000;}; + case 6: {_return = 5000;}; + case 7: {_return = 6000;}; + case 8: {_return = 7000;}; + case 9: {_return = 8000;}; + case 10: {_return = 9000;}; + case 11: {_return = 10000;}; default {hint "something broke!";}; }; From bb625aac583e24702e5b09b7591e714e8e9f4448 Mon Sep 17 00:00:00 2001 From: SAM Date: Fri, 8 May 2015 15:27:13 +0200 Subject: [PATCH 011/172] Used ACE common function instead of hint --- .../viewdistance/functions/fnc_changeViewDistance.sqf | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index a25837bd0f..046a483557 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -17,19 +17,22 @@ #include "script_component.hpp" -private ["_new_view_distance","_new_view_distance_limit"]; +private ["_text","_new_view_distance","_view_distance_limit"]; _new_view_distance = [GVAR(newViewDistance)] call FUNC(returnViewDistanceValue); _view_distance_limit = [GVAR(topViewDistanceLimit)] call FUNC(returnViewDistanceValue); if !GVAR(changeAllowed) then { - hint "You are not allowed to change the view distance!"; + _text = "You are not allowed to change the view distance!"; + [_text,2] call EFUNC(common,displayTextStructured); } else { if (_new_view_distance > _view_distance_limit) then { - hint format ["That option is not allowed! The limit is: %1m",_view_distance_limit]; + _text = composeText ["That option is not allowed! The limit is: ",str(_view_distance_limit)]; + [_text,1] call EFUNC(common,displayTextStructured); } else { - hint format ["View distance successfully changed to: %1m",_new_view_distance]; + _text = composeText ["View distance successfully changed to: ",str(_new_view_distance)]; + [_text,1] call EFUNC(common,displayTextStructured); setViewDistance _new_view_distance; }; }; From 5732015370f9ca2c8ac1d9e365c822b2ad442554 Mon Sep 17 00:00:00 2001 From: SAM Date: Fri, 8 May 2015 15:36:47 +0200 Subject: [PATCH 012/172] Added moduleViewDistance file --- addons/viewdistance/XEH_preInit.sqf | 1 + .../functions/fnc_changeViewDistance.sqf | 2 +- .../functions/fnc_initViewDistance.sqf | 8 +++---- .../functions/fnc_moduleViewDistance.sqf | 23 +++++++++++++++++++ 4 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 addons/viewdistance/functions/fnc_moduleViewDistance.sqf diff --git a/addons/viewdistance/XEH_preInit.sqf b/addons/viewdistance/XEH_preInit.sqf index 4da9b33c83..94c52ce76a 100644 --- a/addons/viewdistance/XEH_preInit.sqf +++ b/addons/viewdistance/XEH_preInit.sqf @@ -2,6 +2,7 @@ ADDON = false; +PREP(moduleViewDistance); PREP(returnViewDistanceValue); PREP(changeViewDistance); PREP(initViewDistance); diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 046a483557..f514951c20 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -12,7 +12,7 @@ * Example: * [] call ace_viewdistance_fnc_changeViewDistance; * - * Public: No + * Public: Yes */ #include "script_component.hpp" diff --git a/addons/viewdistance/functions/fnc_initViewDistance.sqf b/addons/viewdistance/functions/fnc_initViewDistance.sqf index 2a419fe7fc..c425338c3f 100644 --- a/addons/viewdistance/functions/fnc_initViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_initViewDistance.sqf @@ -1,18 +1,18 @@ /* * Author: Winter - * Sets the player's current view distance according to allowed values. + * Assigns the Event Handler which fires when a player adjusts their view distance in the menu * * * Arguments: - * 0: View Distance Setting (SCALAR) + * None * * Return Value: * None * * Example: - * [1500] call ace_common_fnc_imanexample + * [] call ace_viewdistance_fnc_initViewDistance; * - * Public: No + * Public: Yes */ #include "script_component.hpp" diff --git a/addons/viewdistance/functions/fnc_moduleViewDistance.sqf b/addons/viewdistance/functions/fnc_moduleViewDistance.sqf new file mode 100644 index 0000000000..5e7d3da94b --- /dev/null +++ b/addons/viewdistance/functions/fnc_moduleViewDistance.sqf @@ -0,0 +1,23 @@ +/* + * Author: Winter + * Initialises the view distance limiter module + * + * + * Arguments: + * + * + * Return Value: + * View Distance Limit + * + * Example: + * + */ + +#include "script_component.hpp" + +if (!isServer) exitWith {}; +/* +PARAMS_2(_logic,_activated); + +if !(_activated) exitWith {}; +*/ \ No newline at end of file From 1f15e68c304a3576b7cba709e13fcafd52be8f33 Mon Sep 17 00:00:00 2001 From: ulteq Date: Fri, 8 May 2015 16:00:41 +0200 Subject: [PATCH 013/172] Global variable cleanup --- addons/advanced_ballistics/XEH_postInit.sqf | 15 +-------------- .../functions/fnc_initializeTerrainExtension.sqf | 4 ++-- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index 8efdd6799b..b59737412a 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -4,24 +4,11 @@ GVAR(currentbulletID) = -1; -GVAR(bulletDatabase) = []; -GVAR(bulletDatabaseStartTime) = []; -GVAR(bulletDatabaseSpeed) = []; -GVAR(bulletDatabaseFrames) = []; -GVAR(bulletDatabaseLastFrame) = []; -GVAR(bulletDatabaseHDeflect) = []; -GVAR(bulletDatabaseSpinDrift) = []; -GVAR(bulletDatabaseOccupiedIndices) = []; -GVAR(bulletDatabaseFreeIndices) = []; - -GVAR(WindInfo) = false; -GVAR(WindInfoStart) = time; - GVAR(Protractor) = false; GVAR(ProtractorStart) = time; GVAR(currentGrid) = 0; -GVAR(INIT_MESSAGE_ENABLED) = false; +GVAR(initMessageEnabled) = false; GVAR(extensionAvailable) = true; /* @TODO: Remove this until versioning is in sync with cmake/build versioning diff --git a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf index 3930526433..93a79138c6 100644 --- a/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf +++ b/addons/advanced_ballistics/functions/fnc_initializeTerrainExtension.sqf @@ -22,7 +22,7 @@ _initStartTime = time; _mapSize = getNumber (configFile >> "CfgWorlds" >> worldName >> "MapSize"); if (("ace_advanced_ballistics" callExtension format["init:%1:%2", worldName, _mapSize]) == "Terrain already initialized") exitWith { - if (GVAR(INIT_MESSAGE_ENABLED)) then { + if (GVAR(initMessageEnabled)) then { systemChat "AdvancedBallistics: Terrain already initialized"; }; }; @@ -40,7 +40,7 @@ GVAR(currentGrid) = 0; _initStartTime = _args select 2; if (GVAR(currentGrid) >= _gridCells) exitWith { - if (GVAR(INIT_MESSAGE_ENABLED)) then { + if (GVAR(initMessageEnabled)) then { systemChat format["AdvancedBallistics: Finished terrain initialization in %1 seconds", ceil(time - _initStartTime)]; }; [_this select 1] call cba_fnc_removePerFrameHandler; From 6cda97e3a0cd540d37052c8aed5fcd368171c6d7 Mon Sep 17 00:00:00 2001 From: SAM Date: Fri, 8 May 2015 16:07:57 +0200 Subject: [PATCH 014/172] Adding required files for module integration --- addons/viewdistance/CfgVehicles.hpp | 20 ++++++++++++++ addons/viewdistance/XEH_postInit.sqf | 1 + .../functions/fnc_changeViewDistance.sqf | 3 +++ .../functions/fnc_moduleViewDistance.sqf | 12 ++++++--- .../functions/fnc_returnViewDistanceLimit.sqf | 26 +++++++++++++++++++ .../functions/fnc_returnViewDistanceValue.sqf | 4 +-- 6 files changed, 61 insertions(+), 5 deletions(-) create mode 100644 addons/viewdistance/CfgVehicles.hpp create mode 100644 addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp new file mode 100644 index 0000000000..a39c94c4c5 --- /dev/null +++ b/addons/viewdistance/CfgVehicles.hpp @@ -0,0 +1,20 @@ +class CfgVehicles { + class Module_F; + class ACE_ModuleViewDistance : Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "View Distance Limit"; + function = QFUNC(moduleViewDistance); + scope = 2; + isGlobal = 1; + //icon = ""; // needs an icon + class Arguments { + class ViewDistanceLimit { + displayName = "View Distance setting limit"; + description = "Sets the limit for how high clients can raise their view distance (< 10,000)"; + typeName = "NUMBER"; + defaultValue = 10000; + }; + }; + }; +}; \ No newline at end of file diff --git a/addons/viewdistance/XEH_postInit.sqf b/addons/viewdistance/XEH_postInit.sqf index 8f1fd94fc3..85cd16d387 100644 --- a/addons/viewdistance/XEH_postInit.sqf +++ b/addons/viewdistance/XEH_postInit.sqf @@ -1,4 +1,5 @@ #include "script_component.hpp" +[] call FUNC(moduleViewDistance); if (!hasInterface || !GVAR(enabled)) exitWith {}; [] call FUNC(initViewDistance); \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index f514951c20..e7529d6116 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -19,9 +19,12 @@ private ["_text","_new_view_distance","_view_distance_limit"]; +// Change the received index number into an actual view distance number as set in the config: _new_view_distance = [GVAR(newViewDistance)] call FUNC(returnViewDistanceValue); + _view_distance_limit = [GVAR(topViewDistanceLimit)] call FUNC(returnViewDistanceValue); + if !GVAR(changeAllowed) then { _text = "You are not allowed to change the view distance!"; [_text,2] call EFUNC(common,displayTextStructured); diff --git a/addons/viewdistance/functions/fnc_moduleViewDistance.sqf b/addons/viewdistance/functions/fnc_moduleViewDistance.sqf index 5e7d3da94b..582db6ea79 100644 --- a/addons/viewdistance/functions/fnc_moduleViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_moduleViewDistance.sqf @@ -15,9 +15,15 @@ #include "script_component.hpp" -if (!isServer) exitWith {}; -/* +if (!isServer) exitWith { + GVAR(modulePresent) = false +}; + PARAMS_2(_logic,_activated); if !(_activated) exitWith {}; -*/ \ No newline at end of file + +GVAR(modulePresent) = true; +publicVariable QGVAR(modulePresent); + +diag_log text "[ACE]: ViewDistance Module Initialized."; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf b/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf new file mode 100644 index 0000000000..cfdb30fe05 --- /dev/null +++ b/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf @@ -0,0 +1,26 @@ +/* + * Author: Winter + * Returns the view distance limit depending on either the config or (if present) the module. + * + * + * Arguments: + * None + * + * Return Value: + * View Distance Limit + * + * Example: + * [] call ace_viewdistance_fnc_returnViewDistanceLimit; + * + * Public: Yes + */ + +#include "script_component.hpp" + +if GVAR(modulePresent) then { + // module always takes priority + _view_distance_limit = +} else { + +}; +// To do: add a check against a module limit. \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf b/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf index ec55a2a755..0c14214371 100644 --- a/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf +++ b/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf @@ -17,9 +17,9 @@ #include "script_component.hpp" -private ["_index","_return"]; +PARAMS_1(_index); -_index = _this select 0; +private ["_return"]; _return = 0; From 9a0fcd4fece4a5580d0c43a7f40c17333208c771 Mon Sep 17 00:00:00 2001 From: ulteq Date: Fri, 8 May 2015 17:20:56 +0200 Subject: [PATCH 015/172] AB config read caching --- addons/advanced_ballistics/XEH_postInit.sqf | 5 + ..._calculateAmmoTemperatureVelocityShift.sqf | 18 +-- ...fnc_calculateBarrelLengthVelocityShift.sqf | 29 ++--- .../functions/fnc_handleFired.sqf | 123 +++++++++++------- 4 files changed, 97 insertions(+), 78 deletions(-) diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index b59737412a..faaa468bc8 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -4,6 +4,11 @@ GVAR(currentbulletID) = -1; +GVAR(AmmoCacheIndex) = []; +GVAR(AmmoCacheData) = []; +GVAR(WeaponCacheIndex) = []; +GVAR(WeaponCacheData) = []; + GVAR(Protractor) = false; GVAR(ProtractorStart) = time; diff --git a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf index c92e679a66..28df9d1d97 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateAmmoTemperatureVelocityShift.sqf @@ -4,7 +4,7 @@ * Calculates the ammo temperature induced muzzle velocity shift * * Arguments: - * 0: ammo - classname + * 0: muzzle velocity shift lookup table - m/s * 1: temperature - degrees celcius * * Return Value: @@ -15,17 +15,11 @@ */ #include "script_component.hpp" -private ["_ammo", "_temperature", "_muzzleVelocityTable", "_muzzleVelocityShift", "_temperatureIndexA", "_temperatureIndexB", "_temperatureRatio"]; -_ammo = _this select 0; -_temperature = _this select 1; +private ["_muzzleVelocityShiftTable", "_temperature", "_muzzleVelocityShift", "_temperatureIndexA", "_temperatureIndexB", "_temperatureRatio"]; +_muzzleVelocityShiftTable = _this select 0; +_temperature = _this select 1; -_muzzleVelocityTable = []; - -if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts")) then { - _muzzleVelocityTable = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts"); -}; - -if (count _muzzleVelocityTable != 11) exitWith { 0 }; +if (count _muzzleVelocityShiftTable != 11) exitWith { 0 }; _temperatureIndexA = floor((_temperature + 15) / 5); _temperatureIndexA = 0 max _temperatureIndexA; @@ -37,6 +31,6 @@ _temperatureIndexB = _temperatureIndexB min 10; _temperatureRatio = ((_temperature + 15) / 5) - floor((_temperature + 15) / 5); -_muzzleVelocityShift = (_muzzleVelocityTable select _temperatureIndexA) * (1 - _temperatureRatio) + (_muzzleVelocityTable select _temperatureIndexB) * _temperatureRatio; +_muzzleVelocityShift = (_muzzleVelocityShiftTable select _temperatureIndexA) * (1 - _temperatureRatio) + (_muzzleVelocityShiftTable select _temperatureIndexB) * _temperatureRatio; _muzzleVelocityShift diff --git a/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf b/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf index b4cbd5bdc0..de037f49bc 100644 --- a/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf +++ b/addons/advanced_ballistics/functions/fnc_calculateBarrelLengthVelocityShift.sqf @@ -4,9 +4,10 @@ * Calculates the muzzle velocity shift caused by different barrel lengths * * Arguments: - * 0: ammo - classname - * 0: weapon - classname - * 1: muzzle velocity - m/s + * 0: barrel length - mm + * 1: muzzle velocity lookup table - m/s + * 2: barrel length lookup table - mm + * 3: muzzle velocity - m/s * * Return Value: * 0: muzzle velocity shift - m/s @@ -16,25 +17,13 @@ */ #include "script_component.hpp" -private ["_ammo", "_weapon", "_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity", "_lowerIndex", "_upperIndex", "_barrelLengthRatio", "_muzzleVelocityNew"]; -_ammo = _this select 0; -_weapon = _this select 1; -_muzzleVelocity = _this select 2; - -_barrelLength = getNumber(configFile >> "cfgWeapons" >> _weapon >> "ACE_barrelLength"); +private ["_barrelLength", "_muzzleVelocityTable", "_barrelLengthTable", "_muzzleVelocity", "_lowerIndex", "_upperIndex", "_barrelLengthRatio", "_muzzleVelocityNew"]; +_barrelLength = _this select 0; +_muzzleVelocityTable = _this select 1; +_barrelLengthTable = _this select 2; +_muzzleVelocity = _this select 3; if (_barrelLength == 0) exitWith { 0 }; - -_muzzleVelocityTable = []; -_barrelLengthTable = []; - -if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_muzzleVelocities")) then { - _muzzleVelocityTable = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_muzzleVelocities"); -}; -if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_barrelLengths")) then { - _barrelLengthTable = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_barrelLengths"); -}; - if (count _muzzleVelocityTable != count _barrelLengthTable) exitWith { 0 }; if (count _muzzleVelocityTable == 0 || count _barrelLengthTable == 0) exitWith { 0 }; if (count _muzzleVelocityTable == 1) exitWith { (_muzzleVelocityTable select 0) - _muzzleVelocity }; diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index f6458b5f41..5862786228 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -19,7 +19,7 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_index", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_bulletMass", "_bulletLength", "_airFriction", "_dragModel", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_ballisticCoefficients", "_velocityBoundaries"]; +private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_AmmoCacheIndex", "_AmmoCacheEntry", "_WeaponCacheIndex", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_barrelLength", "_bulletMass", "_bulletLength", "_airFriction", "_dragModel", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_ballisticCoefficients", "_velocityBoundaries"]; _unit = _this select 0; _weapon = _this select 1; _mode = _this select 3; @@ -40,7 +40,7 @@ if (GVAR(onlyActiveForLocalPlayers) && !(local _unit)) then { // The shooter is non local if (currentWeapon _unit == primaryWeapon _unit && count primaryWeaponItems _unit > 2) then { _opticsName = (primaryWeaponItems _unit) select 2; - _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); + _opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); _abort = _opticType != 2; // We only abort if the non local shooter is not a sniper }; } else { @@ -48,19 +48,83 @@ if (GVAR(onlyActiveForLocalPlayers) && !(local _unit)) then { }; }; //if (!GVAR(vehicleGunnerEnabled) && !(_unit isKindOf "Man")) then { _abort = true; }; // We currently do not have firedEHs on vehicles -if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "cfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; }; +if (GVAR(disabledInFullAutoMode) && getNumber(configFile >> "CfgWeapons" >> _weapon >> _mode >> "autoFire") == 1) then { _abort = true; }; if (_abort || !(GVAR(extensionAvailable))) exitWith { - [_bullet, getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction")] call EFUNC(winddeflection,updateTrajectoryPFH); + [_bullet, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")] call EFUNC(winddeflection,updateTrajectoryPFH); }; -_airFriction = getNumber(configFile >> "cfgAmmo" >> _ammo >> "airFriction"); +_AmmoCacheIndex = GVAR(AmmoCacheIndex) find _ammo; +if (_AmmoCacheIndex == -1) then { + _airFriction = getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction"); + _caliber = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_caliber"); + _bulletLength = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletLength"); + _bulletMass = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletMass"); + _transonicStabilityCoef = 0.5; + if (isNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef")) then { + _transonicStabilityCoef = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef"); + }; + _dragModel = 1; + _ballisticCoefficients = []; + _velocityBoundaries = []; + _atmosphereModel = "ICAO"; + if (isNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_dragModel")) then { + _dragModel = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_dragModel"); + if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then { + _dragModel = 1; + }; + }; + if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ballisticCoefficients")) then { + _ballisticCoefficients = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ballisticCoefficients"); + }; + if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_velocityBoundaries")) then { + _velocityBoundaries = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_velocityBoundaries"); + }; + if (isText(configFile >> "CfgAmmo" >> _ammo >> "ACE_standardAtmosphere")) then { + _atmosphereModel = getText(configFile >> "CfgAmmo" >> _ammo >> "ACE_standardAtmosphere"); + }; + _ammoTempMuzzleVelocityShifts = []; + if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts")) then { + _ammoTempMuzzleVelocityShifts = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts"); + }; + _muzzleVelocityTable = []; + _barrelLengthTable = []; + if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocityTable")) then { + _muzzleVelocityTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocityTable"); + }; + if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengths")) then { + _barrelLengthTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengthTable"); + }; + _AmmoCacheIndex = count GVAR(AmmoCacheIndex); + GVAR(AmmoCacheIndex) pushBack _ammo; + GVAR(AmmoCacheData) pushBack [_ammo, _airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable]; +}; +_AmmoCacheEntry = GVAR(AmmoCacheData) select _AmmoCacheIndex; + +_WeaponCacheIndex = GVAR(WeaponCacheIndex) find _weapon; +if (_WeaponCacheIndex == -1) then { + _barrelTwist = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelTwist"); + _twistDirection = 1; + if (isNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection")) then { + _twistDirection = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection"); + if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then { + _twistDirection = 1; + }; + }; + _barrelLength = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelLength"); + _WeaponCacheIndex = count GVAR(WeaponCacheIndex); + GVAR(WeaponCacheIndex) pushBack _weapon; + GVAR(WeaponCacheData) pushBack [_weapon, _barrelTwist, _twistDirection, _barrelLength]; +}; +_WeaponCacheEntry = GVAR(WeaponCacheData) select _WeaponCacheIndex; + +_airFriction = _AmmoCacheEntry select 1; _bulletVelocity = velocity _bullet; _muzzleVelocity = vectorMagnitude _bulletVelocity; if (GVAR(barrelLengthInfluenceEnabled)) then { - _muzzleVelocityShift = [_ammo, _weapon, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); + _muzzleVelocityShift = [_WeaponCacheEntry select 3, _AmmoCacheEntry select 11, _AmmoCacheEntry select 12, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); if (_muzzleVelocityShift != 0) then { _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bullet setVelocity _bulletVelocity; @@ -70,7 +134,7 @@ if (GVAR(barrelLengthInfluenceEnabled)) then { if (GVAR(ammoTemperatureEnabled)) then { _temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2); - _muzzleVelocityShift = [_ammo, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift); + _muzzleVelocityShift = [_AmmoCacheEntry select 10, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift); if (_muzzleVelocityShift != 0) then { _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bullet setVelocity _bulletVelocity; @@ -85,16 +149,16 @@ if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then { } else { if (currentWeapon ACE_player == primaryWeapon ACE_player && count primaryWeaponItems ACE_player > 2) then { _opticsName = (primaryWeaponItems ACE_player) select 2; - _opticType = getNumber(configFile >> "cfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); + _opticType = getNumber(configFile >> "CfgWeapons" >> _opticsName >> "ItemInfo" >> "opticType"); _bulletTraceVisible = _opticType == 2; }; }; }; -_caliber = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_caliber"); -_bulletLength = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_bulletLength"); -_bulletMass = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_bulletMass"); -_barrelTwist = getNumber(configFile >> "cfgWeapons" >> _weapon >> "ACE_barrelTwist"); +_caliber = _AmmoCacheEntry select 2; +_bulletLength = _AmmoCacheEntry select 3; +_bulletMass = _AmmoCacheEntry select 4; +_barrelTwist = _WeaponCacheEntry select 1; _stabilityFactor = 1.5; if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { @@ -103,42 +167,9 @@ if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) th _stabilityFactor = [_caliber, _bulletLength, _bulletMass, _barrelTwist, _muzzleVelocity, _temperature, _barometricPressure] call FUNC(calculateStabilityFactor); }; -_twistDirection = 1; -if (isNumber(configFile >> "cfgWeapons" >> _weapon >> "ACE_twistDirection")) then { - _twistDirection = getNumber(configFile >> "cfgWeapons" >> _weapon >> "ACE_twistDirection"); - if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then { - _twistDirection = 1; - }; -}; - -_transonicStabilityCoef = 0.5; -if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef")) then { - _transonicStabilityCoef = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef"); -}; - -_dragModel = 1; -_ballisticCoefficients = []; -_velocityBoundaries = []; -_atmosphereModel = "ICAO"; -if (isNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_dragModel")) then { - _dragModel = getNumber(configFile >> "cfgAmmo" >> _ammo >> "ACE_dragModel"); - if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then { - _dragModel = 1; - }; -}; -if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ballisticCoefficients")) then { - _ballisticCoefficients = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_ballisticCoefficients"); -}; -if (isArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_velocityBoundaries")) then { - _velocityBoundaries = getArray(configFile >> "cfgAmmo" >> _ammo >> "ACE_velocityBoundaries"); -}; -if (isText(configFile >> "cfgAmmo" >> _ammo >> "ACE_standardAtmosphere")) then { - _atmosphereModel = getText(configFile >> "cfgAmmo" >> _ammo >> "ACE_standardAtmosphere"); -}; - GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000; -"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _airFriction, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _dragModel, _stabilityFactor, _twistDirection, _muzzleVelocity, _transonicStabilityCoef, getPosASL _bullet, EGVAR(weather,Latitude), EGVAR(weather,currentTemperature), EGVAR(weather,Altitude), EGVAR(weather,currentHumidity), overcast, floor(time), time - floor(time)]; +"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _AmmoCacheEntry select 1, _AmmoCacheEntry select 7, _AmmoCacheEntry select 8, _AmmoCacheEntry select 9, _AmmoCacheEntry select 6, _stabilityFactor, _WeaponCacheEntry select 2, _muzzleVelocity, _AmmoCacheEntry select 5, getPosASL _bullet, EGVAR(weather,Latitude), EGVAR(weather,currentTemperature), EGVAR(weather,Altitude), EGVAR(weather,currentHumidity), overcast, floor(time), time - floor(time)]; [{ private ["_args", "_index", "_bullet", "_caliber", "_bulletTraceVisible", "_bulletVelocity", "_bulletPosition"]; From 45992e5e7fb0fdce0327609ce827230e17f68aa6 Mon Sep 17 00:00:00 2001 From: SAM Date: Fri, 8 May 2015 18:30:28 +0200 Subject: [PATCH 016/172] All working except module returning any. ace_viewdistance_moduleViewDistanceLimit always returning as any. No error in the RPT relating to readSettingfromModule failing --- addons/viewdistance/ACE_Settings.hpp | 2 +- addons/viewdistance/CfgVehicles.hpp | 8 ++--- addons/viewdistance/XEH_postInit.sqf | 3 +- addons/viewdistance/XEH_preInit.sqf | 3 +- addons/viewdistance/config.cpp | 3 +- .../functions/fnc_changeViewDistance.sqf | 28 ++++++---------- .../functions/fnc_initViewDistance.sqf | 4 ++- addons/viewdistance/functions/fnc_module.sqf | 33 +++++++++++++++++++ .../functions/fnc_moduleViewDistance.sqf | 29 ---------------- .../functions/fnc_returnViewDistanceLimit.sqf | 18 +++++++--- .../functions/fnc_returnViewDistanceValue.sqf | 3 +- 11 files changed, 70 insertions(+), 64 deletions(-) create mode 100644 addons/viewdistance/functions/fnc_module.sqf delete mode 100644 addons/viewdistance/functions/fnc_moduleViewDistance.sqf diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp index 55b38df7df..497fe0f330 100644 --- a/addons/viewdistance/ACE_Settings.hpp +++ b/addons/viewdistance/ACE_Settings.hpp @@ -5,7 +5,7 @@ class ACE_Settings { displayName = "Allow View Distance Changing"; description = "Allows clients to be able to change their view distance"; }; - class GVAR(topViewDistanceLimit) { + class GVAR(viewDistanceLimit) { typeName = "SCALAR"; value = 11; // setting the highest number in the array below means no limit. values[] = {0,1,2,3,4,5,6,7,8,9,10,11}; // correspond to the index values diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp index a39c94c4c5..4906edfecf 100644 --- a/addons/viewdistance/CfgVehicles.hpp +++ b/addons/viewdistance/CfgVehicles.hpp @@ -3,16 +3,16 @@ class CfgVehicles { class ACE_ModuleViewDistance : Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "View Distance Limit"; - function = QFUNC(moduleViewDistance); + displayName = "View Distance Limiter"; + function = QFUNC(module); scope = 2; isGlobal = 1; //icon = ""; // needs an icon class Arguments { - class ViewDistanceLimit { + class moduleViewDistanceLimit { displayName = "View Distance setting limit"; description = "Sets the limit for how high clients can raise their view distance (< 10,000)"; - typeName = "NUMBER"; + typeName = "SCALAR"; defaultValue = 10000; }; }; diff --git a/addons/viewdistance/XEH_postInit.sqf b/addons/viewdistance/XEH_postInit.sqf index 85cd16d387..6fffa14cc6 100644 --- a/addons/viewdistance/XEH_postInit.sqf +++ b/addons/viewdistance/XEH_postInit.sqf @@ -1,5 +1,4 @@ #include "script_component.hpp" -[] call FUNC(moduleViewDistance); -if (!hasInterface || !GVAR(enabled)) exitWith {}; +if (!GVAR(changeAllowed)) exitWith {}; // if viewdistance is disabled from config, exit here. [] call FUNC(initViewDistance); \ No newline at end of file diff --git a/addons/viewdistance/XEH_preInit.sqf b/addons/viewdistance/XEH_preInit.sqf index 94c52ce76a..9f66b79e2e 100644 --- a/addons/viewdistance/XEH_preInit.sqf +++ b/addons/viewdistance/XEH_preInit.sqf @@ -2,8 +2,9 @@ ADDON = false; -PREP(moduleViewDistance); +PREP(module); PREP(returnViewDistanceValue); +PREP(returnViewDistanceLimit); PREP(changeViewDistance); PREP(initViewDistance); diff --git a/addons/viewdistance/config.cpp b/addons/viewdistance/config.cpp index 86453c5be3..a1afbcc93f 100644 --- a/addons/viewdistance/config.cpp +++ b/addons/viewdistance/config.cpp @@ -13,4 +13,5 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" -#include "ACE_Settings.hpp" \ No newline at end of file +#include "ACE_Settings.hpp" +#include "CfgVehicles.hpp" \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index e7529d6116..4d35974466 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -22,22 +22,14 @@ private ["_text","_new_view_distance","_view_distance_limit"]; // Change the received index number into an actual view distance number as set in the config: _new_view_distance = [GVAR(newViewDistance)] call FUNC(returnViewDistanceValue); -_view_distance_limit = [GVAR(topViewDistanceLimit)] call FUNC(returnViewDistanceValue); +_view_distance_limit = [] call FUNC(returnViewDistanceLimit); - -if !GVAR(changeAllowed) then { - _text = "You are not allowed to change the view distance!"; - [_text,2] call EFUNC(common,displayTextStructured); -} else { - if (_new_view_distance > _view_distance_limit) then { - _text = composeText ["That option is not allowed! The limit is: ",str(_view_distance_limit)]; - [_text,1] call EFUNC(common,displayTextStructured); - } - else { - _text = composeText ["View distance successfully changed to: ",str(_new_view_distance)]; - [_text,1] call EFUNC(common,displayTextStructured); - setViewDistance _new_view_distance; - }; -}; - -// To do: add a check against a module limit. \ No newline at end of file +if (_new_view_distance > _view_distance_limit) then { + _text = composeText ["That option is not allowed! The limit is: ",str(_view_distance_limit)]; + [_text,1] call EFUNC(common,displayTextStructured); +} +else { + _text = composeText ["View distance successfully changed to: ",str(_new_view_distance)]; + [_text,1] call EFUNC(common,displayTextStructured); + setViewDistance _new_view_distance; +}; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_initViewDistance.sqf b/addons/viewdistance/functions/fnc_initViewDistance.sqf index c425338c3f..5372fdedca 100644 --- a/addons/viewdistance/functions/fnc_initViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_initViewDistance.sqf @@ -14,9 +14,11 @@ * * Public: Yes */ - + #include "script_component.hpp" +if (!hasInterface) exitWith {}; + ["SettingChanged",{ if (_this select 0 == QGVAR(newViewDistance)) then { [] call FUNC(changeViewDistance); diff --git a/addons/viewdistance/functions/fnc_module.sqf b/addons/viewdistance/functions/fnc_module.sqf new file mode 100644 index 0000000000..bf336bc88e --- /dev/null +++ b/addons/viewdistance/functions/fnc_module.sqf @@ -0,0 +1,33 @@ +/* + * Author: Winter + * Initialises the view distance limiter module + * + * + * Arguments: + * 0: logic + * 1: Synchronised Units + * 2: Module Activated + * + * Return Value: + * None + * + * Example: + * + */ + +#include "script_component.hpp" + +if (!isServer) exitWith {}; + +PARAMS_3(_logic,_units,_activated); + +if (!_activated) exitWith { + diag_log text "[ACE]: View Distance Limit Module is placed but NOT active"; +}; + +GVAR(modulePresent) = true; + +[_logic, QGVAR(moduleViewDistanceLimit),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule); + +//hint format["[ACE]: View Distance Limit Module Initialized with limit: %1",GVAR(moduleViewDistanceLimit)]; // only used for debug +diag_log format["[ACE]: View Distance Limit Module Initialized with limit: %1",GVAR(moduleViewDistanceLimit)]; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_moduleViewDistance.sqf b/addons/viewdistance/functions/fnc_moduleViewDistance.sqf deleted file mode 100644 index 582db6ea79..0000000000 --- a/addons/viewdistance/functions/fnc_moduleViewDistance.sqf +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Author: Winter - * Initialises the view distance limiter module - * - * - * Arguments: - * - * - * Return Value: - * View Distance Limit - * - * Example: - * - */ - -#include "script_component.hpp" - -if (!isServer) exitWith { - GVAR(modulePresent) = false -}; - -PARAMS_2(_logic,_activated); - -if !(_activated) exitWith {}; - -GVAR(modulePresent) = true; -publicVariable QGVAR(modulePresent); - -diag_log text "[ACE]: ViewDistance Module Initialized."; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf b/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf index cfdb30fe05..871ac34e67 100644 --- a/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf +++ b/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf @@ -17,10 +17,18 @@ #include "script_component.hpp" -if GVAR(modulePresent) then { - // module always takes priority - _view_distance_limit = +private ["_limit"]; + +_limit = 20000; // unrealistic amount for debug + +if (!isNil QGVAR(moduleViewDistanceLimit)) then { + _limit = GVAR(moduleViewDistanceLimit); // module always takes priority } else { - + // if module is not present, take the value from the config instead + _limit = [GVAR(viewDistanceLimit)] call FUNC(returnViewDistanceValue); // this function converts the array index in the config to it's relevant scalar value. }; -// To do: add a check against a module limit. \ No newline at end of file + +hint format ["[VD] Limit returned from module: %2 Local Limit: %3",GVAR(modulePresent),GVAR(moduleViewDistanceLimit),_limit]; +diag_log format ["[VD] Limit returned from module: %2 Local Limit: %3",GVAR(modulePresent),GVAR(moduleViewDistanceLimit),_limit]; + +_limit; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf b/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf index 0c14214371..5f06256b09 100644 --- a/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf +++ b/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf @@ -22,7 +22,6 @@ PARAMS_1(_index); private ["_return"]; _return = 0; - // change to if () exitWith {};? switch (_index) do { @@ -38,7 +37,7 @@ switch (_index) do case 9: {_return = 8000;}; case 10: {_return = 9000;}; case 11: {_return = 10000;}; - default {hint "something broke!";}; + default {hint "something broke!";}; // should replace with something a bit more graceful }; _return; \ No newline at end of file From 0b4137763d20b5634338c0f24e0f0a4ebffd9bb5 Mon Sep 17 00:00:00 2001 From: SAM Date: Fri, 8 May 2015 18:41:32 +0200 Subject: [PATCH 017/172] Cleaned up code --- addons/viewdistance/ACE_Settings.hpp | 4 ++-- addons/viewdistance/CfgVehicles.hpp | 2 +- addons/viewdistance/XEH_postInit.sqf | 5 ++++- .../viewdistance/functions/fnc_changeViewDistance.sqf | 1 + addons/viewdistance/functions/fnc_initViewDistance.sqf | 1 + addons/viewdistance/functions/fnc_module.sqf | 4 ++-- .../functions/fnc_returnViewDistanceLimit.sqf | 10 +++++----- 7 files changed, 16 insertions(+), 11 deletions(-) diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp index 497fe0f330..d7a9dbb9fc 100644 --- a/addons/viewdistance/ACE_Settings.hpp +++ b/addons/viewdistance/ACE_Settings.hpp @@ -8,7 +8,7 @@ class ACE_Settings { class GVAR(viewDistanceLimit) { typeName = "SCALAR"; value = 11; // setting the highest number in the array below means no limit. - values[] = {0,1,2,3,4,5,6,7,8,9,10,11}; // correspond to the index values + values[] = {0,1,2,3,4,5,6,7,8,9,10,11}; // correspond to the INDEX values displayName = "Change View Distance Limit"; description = "Sets the top limit for all clients"; }; @@ -16,7 +16,7 @@ class ACE_Settings { typeName = "SCALAR"; isClientSettable = 1; value = 0; // not sure what to set this to. - values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; + values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnViewDistanceValue.sqf displayName = "Change View Distance"; description = "Changes in game view distance"; }; diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp index 4906edfecf..38ef214c09 100644 --- a/addons/viewdistance/CfgVehicles.hpp +++ b/addons/viewdistance/CfgVehicles.hpp @@ -11,7 +11,7 @@ class CfgVehicles { class Arguments { class moduleViewDistanceLimit { displayName = "View Distance setting limit"; - description = "Sets the limit for how high clients can raise their view distance (< 10,000)"; + description = "Sets the limit for how high clients can raise their view distance (< 10000)"; typeName = "SCALAR"; defaultValue = 10000; }; diff --git a/addons/viewdistance/XEH_postInit.sqf b/addons/viewdistance/XEH_postInit.sqf index 6fffa14cc6..f5a5079273 100644 --- a/addons/viewdistance/XEH_postInit.sqf +++ b/addons/viewdistance/XEH_postInit.sqf @@ -1,4 +1,7 @@ #include "script_component.hpp" -if (!GVAR(changeAllowed)) exitWith {}; // if viewdistance is disabled from config, exit here. +if (!GVAR(changeAllowed)) exitWith { + // if viewdistance module is disabled from config, exit here. + diag_log format["[ACE]: View Distance is disabled from the config.cpp in the pbo"]; +}; [] call FUNC(initViewDistance); \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 4d35974466..8c017ec1eb 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -22,6 +22,7 @@ private ["_text","_new_view_distance","_view_distance_limit"]; // Change the received index number into an actual view distance number as set in the config: _new_view_distance = [GVAR(newViewDistance)] call FUNC(returnViewDistanceValue); +// Grab the limit, either from the module OR if the module is not valid, the config. _view_distance_limit = [] call FUNC(returnViewDistanceLimit); if (_new_view_distance > _view_distance_limit) then { diff --git a/addons/viewdistance/functions/fnc_initViewDistance.sqf b/addons/viewdistance/functions/fnc_initViewDistance.sqf index 5372fdedca..75ca076ff6 100644 --- a/addons/viewdistance/functions/fnc_initViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_initViewDistance.sqf @@ -19,6 +19,7 @@ if (!hasInterface) exitWith {}; +// Set the EH which waits for the View Distance setting to be changed ["SettingChanged",{ if (_this select 0 == QGVAR(newViewDistance)) then { [] call FUNC(changeViewDistance); diff --git a/addons/viewdistance/functions/fnc_module.sqf b/addons/viewdistance/functions/fnc_module.sqf index bf336bc88e..66c2aed793 100644 --- a/addons/viewdistance/functions/fnc_module.sqf +++ b/addons/viewdistance/functions/fnc_module.sqf @@ -22,12 +22,12 @@ if (!isServer) exitWith {}; PARAMS_3(_logic,_units,_activated); if (!_activated) exitWith { - diag_log text "[ACE]: View Distance Limit Module is placed but NOT active"; + diag_log text "[ACE]: View Distance Limit Module is placed but NOT active."; }; GVAR(modulePresent) = true; [_logic, QGVAR(moduleViewDistanceLimit),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule); -//hint format["[ACE]: View Distance Limit Module Initialized with limit: %1",GVAR(moduleViewDistanceLimit)]; // only used for debug +hint format["[ACE]: View Distance Limit Module Initialized with limit: %1",GVAR(moduleViewDistanceLimit)]; // only used for debug, GVAR(moduleViewDistanceLimit) keeps returning as ANY. Remember to remove before finalising the module. diag_log format["[ACE]: View Distance Limit Module Initialized with limit: %1",GVAR(moduleViewDistanceLimit)]; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf b/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf index 871ac34e67..8ae9e6538d 100644 --- a/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf +++ b/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf @@ -19,16 +19,16 @@ private ["_limit"]; -_limit = 20000; // unrealistic amount for debug +_limit = 20000; // unrealistic amount since A3 max is 10000, helps in debug if (!isNil QGVAR(moduleViewDistanceLimit)) then { - _limit = GVAR(moduleViewDistanceLimit); // module always takes priority + _limit = GVAR(moduleViewDistanceLimit); // module value always takes priority over config } else { - // if module is not present, take the value from the config instead + // If the module is not present, take the value from the config instead _limit = [GVAR(viewDistanceLimit)] call FUNC(returnViewDistanceValue); // this function converts the array index in the config to it's relevant scalar value. }; -hint format ["[VD] Limit returned from module: %2 Local Limit: %3",GVAR(modulePresent),GVAR(moduleViewDistanceLimit),_limit]; -diag_log format ["[VD] Limit returned from module: %2 Local Limit: %3",GVAR(modulePresent),GVAR(moduleViewDistanceLimit),_limit]; +hint format ["[VD] Limit returned from module: %2 Local Limit: %3",GVAR(modulePresent),GVAR(moduleViewDistanceLimit),_limit]; // only used for debug, trying to get the module to work. Remember to remove before finalising pbo +diag_log format ["[VD] Limit returned from module: %2 Local Limit: %3",GVAR(modulePresent),GVAR(moduleViewDistanceLimit),_limit]; // only used for debug, trying to get the module to work. Remember to remove before finalising pbo _limit; \ No newline at end of file From 03fd740f8eebd6b707fd20cfc77c3a7133c77743 Mon Sep 17 00:00:00 2001 From: ulteq Date: Fri, 8 May 2015 18:43:26 +0200 Subject: [PATCH 018/172] Config caching is now done in the uiNamespace --- addons/advanced_ballistics/XEH_postInit.sqf | 5 -- addons/advanced_ballistics/XEH_preInit.sqf | 2 + .../functions/fnc_handleFired.sqf | 83 ++++--------------- .../functions/fnc_readAmmoDataFromConfig.sqf | 64 ++++++++++++++ .../fnc_readWeaponDataFromConfig.sqf | 34 ++++++++ 5 files changed, 114 insertions(+), 74 deletions(-) create mode 100644 addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf create mode 100644 addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf diff --git a/addons/advanced_ballistics/XEH_postInit.sqf b/addons/advanced_ballistics/XEH_postInit.sqf index faaa468bc8..b59737412a 100644 --- a/addons/advanced_ballistics/XEH_postInit.sqf +++ b/addons/advanced_ballistics/XEH_postInit.sqf @@ -4,11 +4,6 @@ GVAR(currentbulletID) = -1; -GVAR(AmmoCacheIndex) = []; -GVAR(AmmoCacheData) = []; -GVAR(WeaponCacheIndex) = []; -GVAR(WeaponCacheData) = []; - GVAR(Protractor) = false; GVAR(ProtractorStart) = time; diff --git a/addons/advanced_ballistics/XEH_preInit.sqf b/addons/advanced_ballistics/XEH_preInit.sqf index 1d19a9c492..b5ffa62fe8 100644 --- a/addons/advanced_ballistics/XEH_preInit.sqf +++ b/addons/advanced_ballistics/XEH_preInit.sqf @@ -13,5 +13,7 @@ PREP(displayProtractor); PREP(handleFired); PREP(initializeTerrainExtension); PREP(initModuleSettings); +PREP(readAmmoDataFromConfig); +PREP(readWeaponDataFromConfig); ADDON = true; diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index 5862786228..73c7a28f32 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -19,7 +19,7 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_AmmoCacheIndex", "_AmmoCacheEntry", "_WeaponCacheIndex", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_barrelLength", "_bulletMass", "_bulletLength", "_airFriction", "_dragModel", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_ballisticCoefficients", "_velocityBoundaries"]; +private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_barrelLength", "_bulletMass", "_bulletLength", "_airFriction", "_dragModel", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_ballisticCoefficients", "_velocityBoundaries"]; _unit = _this select 0; _weapon = _this select 1; _mode = _this select 3; @@ -54,69 +54,14 @@ if (_abort || !(GVAR(extensionAvailable))) exitWith { [_bullet, getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction")] call EFUNC(winddeflection,updateTrajectoryPFH); }; -_AmmoCacheIndex = GVAR(AmmoCacheIndex) find _ammo; -if (_AmmoCacheIndex == -1) then { - _airFriction = getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction"); - _caliber = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_caliber"); - _bulletLength = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletLength"); - _bulletMass = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletMass"); - _transonicStabilityCoef = 0.5; - if (isNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef")) then { - _transonicStabilityCoef = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef"); - }; - _dragModel = 1; - _ballisticCoefficients = []; - _velocityBoundaries = []; - _atmosphereModel = "ICAO"; - if (isNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_dragModel")) then { - _dragModel = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_dragModel"); - if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then { - _dragModel = 1; - }; - }; - if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ballisticCoefficients")) then { - _ballisticCoefficients = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ballisticCoefficients"); - }; - if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_velocityBoundaries")) then { - _velocityBoundaries = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_velocityBoundaries"); - }; - if (isText(configFile >> "CfgAmmo" >> _ammo >> "ACE_standardAtmosphere")) then { - _atmosphereModel = getText(configFile >> "CfgAmmo" >> _ammo >> "ACE_standardAtmosphere"); - }; - _ammoTempMuzzleVelocityShifts = []; - if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts")) then { - _ammoTempMuzzleVelocityShifts = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts"); - }; - _muzzleVelocityTable = []; - _barrelLengthTable = []; - if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocityTable")) then { - _muzzleVelocityTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocityTable"); - }; - if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengths")) then { - _barrelLengthTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengthTable"); - }; - _AmmoCacheIndex = count GVAR(AmmoCacheIndex); - GVAR(AmmoCacheIndex) pushBack _ammo; - GVAR(AmmoCacheData) pushBack [_ammo, _airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable]; +_AmmoCacheEntry = uiNamespace getVariable format[QGVAR(%1), _ammo]; +if (isNil {_AmmoCacheEntry}) then { + _AmmoCacheEntry = _ammo call FUNC(readAmmoDataFromConfig); }; -_AmmoCacheEntry = GVAR(AmmoCacheData) select _AmmoCacheIndex; - -_WeaponCacheIndex = GVAR(WeaponCacheIndex) find _weapon; -if (_WeaponCacheIndex == -1) then { - _barrelTwist = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelTwist"); - _twistDirection = 1; - if (isNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection")) then { - _twistDirection = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection"); - if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then { - _twistDirection = 1; - }; - }; - _barrelLength = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelLength"); - _WeaponCacheIndex = count GVAR(WeaponCacheIndex); - GVAR(WeaponCacheIndex) pushBack _weapon; - GVAR(WeaponCacheData) pushBack [_weapon, _barrelTwist, _twistDirection, _barrelLength]; +_WeaponCacheEntry = uiNamespace getVariable format[QGVAR(%1), _weapon]; +if (isNil {_WeaponCacheEntry}) then { + _WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig); }; -_WeaponCacheEntry = GVAR(WeaponCacheData) select _WeaponCacheIndex; _airFriction = _AmmoCacheEntry select 1; @@ -124,7 +69,7 @@ _bulletVelocity = velocity _bullet; _muzzleVelocity = vectorMagnitude _bulletVelocity; if (GVAR(barrelLengthInfluenceEnabled)) then { - _muzzleVelocityShift = [_WeaponCacheEntry select 3, _AmmoCacheEntry select 11, _AmmoCacheEntry select 12, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); + _muzzleVelocityShift = [_WeaponCacheEntry select 2, _AmmoCacheEntry select 10, _AmmoCacheEntry select 11, _muzzleVelocity] call FUNC(calculateBarrelLengthVelocityShift); if (_muzzleVelocityShift != 0) then { _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bullet setVelocity _bulletVelocity; @@ -134,7 +79,7 @@ if (GVAR(barrelLengthInfluenceEnabled)) then { if (GVAR(ammoTemperatureEnabled)) then { _temperature = GET_TEMPERATURE_AT_HEIGHT((getPosASL _unit) select 2); - _muzzleVelocityShift = [_AmmoCacheEntry select 10, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift); + _muzzleVelocityShift = [_AmmoCacheEntry select 9, _temperature] call FUNC(calculateAmmoTemperatureVelocityShift); if (_muzzleVelocityShift != 0) then { _bulletVelocity = _bulletVelocity vectorAdd ((vectorNormalized _bulletVelocity) vectorMultiply (_muzzleVelocityShift)); _bullet setVelocity _bulletVelocity; @@ -155,10 +100,10 @@ if (GVAR(bulletTraceEnabled) && cameraView == "GUNNER") then { }; }; -_caliber = _AmmoCacheEntry select 2; -_bulletLength = _AmmoCacheEntry select 3; -_bulletMass = _AmmoCacheEntry select 4; -_barrelTwist = _WeaponCacheEntry select 1; +_caliber = _AmmoCacheEntry select 1; +_bulletLength = _AmmoCacheEntry select 2; +_bulletMass = _AmmoCacheEntry select 3; +_barrelTwist = _WeaponCacheEntry select 0; _stabilityFactor = 1.5; if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) then { @@ -169,7 +114,7 @@ if (_caliber > 0 && _bulletLength > 0 && _bulletMass > 0 && _barrelTwist > 0) th GVAR(currentbulletID) = (GVAR(currentbulletID) + 1) % 10000; -"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _AmmoCacheEntry select 1, _AmmoCacheEntry select 7, _AmmoCacheEntry select 8, _AmmoCacheEntry select 9, _AmmoCacheEntry select 6, _stabilityFactor, _WeaponCacheEntry select 2, _muzzleVelocity, _AmmoCacheEntry select 5, getPosASL _bullet, EGVAR(weather,Latitude), EGVAR(weather,currentTemperature), EGVAR(weather,Altitude), EGVAR(weather,currentHumidity), overcast, floor(time), time - floor(time)]; +"ace_advanced_ballistics" callExtension format["new:%1:%2:%3:%4:%5:%6:%7:%8:%9:%10:%11:%12:%13:%14:%15:%16:%17:%18", GVAR(currentbulletID), _AmmoCacheEntry select 0, _AmmoCacheEntry select 6, _AmmoCacheEntry select 7, _AmmoCacheEntry select 8, _AmmoCacheEntry select 5, _stabilityFactor, _WeaponCacheEntry select 1, _muzzleVelocity, _AmmoCacheEntry select 4, getPosASL _bullet, EGVAR(weather,Latitude), EGVAR(weather,currentTemperature), EGVAR(weather,Altitude), EGVAR(weather,currentHumidity), overcast, floor(time), time - floor(time)]; [{ private ["_args", "_index", "_bullet", "_caliber", "_bulletTraceVisible", "_bulletVelocity", "_bulletPosition"]; diff --git a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf new file mode 100644 index 0000000000..7ff94387d1 --- /dev/null +++ b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf @@ -0,0 +1,64 @@ +/* + * Author: Ruthberg + * + * Reads the ammo class config and updates the config cache + * + * Arguments: + * 0: ammo - classname + * + * Return Value: + * 0: [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable] + * + * Return value: + * None + */ +#include "script_component.hpp" + +private ["_ammo", "_airFriction", "_caliber", "_bulletLength", "_bulletMass", "_transonicStabilityCoef", "_dragModel", "_ballisticCoefficients", "_velocityBoundaries", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_result"]; +_ammo = _this; + +_airFriction = getNumber(configFile >> "CfgAmmo" >> _ammo >> "airFriction"); +_caliber = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_caliber"); +_bulletLength = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletLength"); +_bulletMass = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_bulletMass"); +_transonicStabilityCoef = 0.5; +if (isNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef")) then { + _transonicStabilityCoef = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_transonicStabilityCoef"); +}; +_dragModel = 1; +_ballisticCoefficients = []; +_velocityBoundaries = []; +_atmosphereModel = "ICAO"; +if (isNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_dragModel")) then { + _dragModel = getNumber(configFile >> "CfgAmmo" >> _ammo >> "ACE_dragModel"); + if (!(_dragModel in [1, 2, 5, 6, 7, 8])) then { + _dragModel = 1; + }; +}; +if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ballisticCoefficients")) then { + _ballisticCoefficients = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ballisticCoefficients"); +}; +if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_velocityBoundaries")) then { + _velocityBoundaries = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_velocityBoundaries"); +}; +if (isText(configFile >> "CfgAmmo" >> _ammo >> "ACE_standardAtmosphere")) then { + _atmosphereModel = getText(configFile >> "CfgAmmo" >> _ammo >> "ACE_standardAtmosphere"); +}; +_ammoTempMuzzleVelocityShifts = []; +if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts")) then { + _ammoTempMuzzleVelocityShifts = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShifts"); +}; +_muzzleVelocityTable = []; +_barrelLengthTable = []; +if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocityTable")) then { + _muzzleVelocityTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocityTable"); +}; +if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengths")) then { + _barrelLengthTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengthTable"); +}; + +_result = [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable]; + +uiNamespace setVariable [format[QGVAR(%1), _ammo], _result]; + +_result diff --git a/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf new file mode 100644 index 0000000000..cbf8731336 --- /dev/null +++ b/addons/advanced_ballistics/functions/fnc_readWeaponDataFromConfig.sqf @@ -0,0 +1,34 @@ +/* + * Author: Ruthberg + * + * Reads the weapon class config and updates the config cache + * + * Arguments: + * 0: ammo - classname + * + * Return Value: + * 0: [_barrelTwist, _twistDirection, _barrelLength] + * + * Return value: + * None + */ +#include "script_component.hpp" + +private ["_weapon", "_barrelTwist", "_twistDirection", "_barrelLength", "_result"]; +_weapon = _this; + +_barrelTwist = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelTwist"); +_twistDirection = 1; +if (isNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection")) then { + _twistDirection = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_twistDirection"); + if (_twistDirection != -1 && _twistDirection != 0 && _twistDirection != 1) then { + _twistDirection = 1; + }; +}; +_barrelLength = getNumber(configFile >> "CfgWeapons" >> _weapon >> "ACE_barrelLength"); + +_result = [_barrelTwist, _twistDirection, _barrelLength]; + +uiNamespace setVariable [format[QGVAR(%1), _weapon], _result]; + +_result From 96e1e9c59fc9dcc6b50fbc0ad74b72bc55b8a21b Mon Sep 17 00:00:00 2001 From: SAM Date: Fri, 8 May 2015 18:46:30 +0200 Subject: [PATCH 019/172] Added name + email to authors.txt --- AUTHORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.txt b/AUTHORS.txt index 366664efbd..a167a48dce 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -93,3 +93,4 @@ Bla1337 nikolauska adam3adam Professor +Winter From 0a9dbfba871a892b14466dcd50db4004af96ef6a Mon Sep 17 00:00:00 2001 From: ulteq Date: Fri, 8 May 2015 18:47:17 +0200 Subject: [PATCH 020/172] Privates cleanup --- addons/advanced_ballistics/functions/fnc_handleFired.sqf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/advanced_ballistics/functions/fnc_handleFired.sqf b/addons/advanced_ballistics/functions/fnc_handleFired.sqf index 73c7a28f32..5404953bd0 100644 --- a/addons/advanced_ballistics/functions/fnc_handleFired.sqf +++ b/addons/advanced_ballistics/functions/fnc_handleFired.sqf @@ -19,7 +19,7 @@ */ #include "script_component.hpp" -private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_atmosphereModel", "_ammoTempMuzzleVelocityShifts", "_muzzleVelocityTable", "_barrelLengthTable", "_barrelLength", "_bulletMass", "_bulletLength", "_airFriction", "_dragModel", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_twistDirection", "_stabilityFactor", "_transonicStabilityCoef", "_ballisticCoefficients", "_velocityBoundaries"]; +private ["_unit", "_weapon", "_mode", "_ammo", "_magazine", "_caliber", "_bullet", "_abort", "_AmmoCacheEntry", "_WeaponCacheEntry", "_opticsName", "_opticType", "_bulletTraceVisible", "_temperature", "_barometricPressure", "_bulletMass", "_bulletLength", "_muzzleVelocity", "_muzzleVelocityShift", "_bulletVelocity", "_bulletSpeed", "_bulletLength", "_barrelTwist", "_stabilityFactor"]; _unit = _this select 0; _weapon = _this select 1; _mode = _this select 3; @@ -63,8 +63,6 @@ if (isNil {_WeaponCacheEntry}) then { _WeaponCacheEntry = _weapon call FUNC(readWeaponDataFromConfig); }; -_airFriction = _AmmoCacheEntry select 1; - _bulletVelocity = velocity _bullet; _muzzleVelocity = vectorMagnitude _bulletVelocity; From 2a9f4d779da6f3f9d25a132fa233d8cb6efe23fd Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 May 2015 03:09:26 +0200 Subject: [PATCH 021/172] Lowercased beginning of function names --- .../{fnc_AddSelectableItem.sqf => fnc_addSelectableItem.sqf} | 0 .../interaction/functions/{fnc_MoveDown.sqf => fnc_moveDown.sqf} | 0 2 files changed, 0 insertions(+), 0 deletions(-) rename addons/interaction/functions/{fnc_AddSelectableItem.sqf => fnc_addSelectableItem.sqf} (100%) rename addons/interaction/functions/{fnc_MoveDown.sqf => fnc_moveDown.sqf} (100%) diff --git a/addons/interaction/functions/fnc_AddSelectableItem.sqf b/addons/interaction/functions/fnc_addSelectableItem.sqf similarity index 100% rename from addons/interaction/functions/fnc_AddSelectableItem.sqf rename to addons/interaction/functions/fnc_addSelectableItem.sqf diff --git a/addons/interaction/functions/fnc_MoveDown.sqf b/addons/interaction/functions/fnc_moveDown.sqf similarity index 100% rename from addons/interaction/functions/fnc_MoveDown.sqf rename to addons/interaction/functions/fnc_moveDown.sqf From 50d5e845ee517ca28d10393adfe6cf399d8ea0f3 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 May 2015 03:12:28 +0200 Subject: [PATCH 022/172] Lowercased beginning of functions pt2 --- addons/interaction/functions/fnc_moveDown.sqf | 4 ++-- addons/interaction/functions/fnc_openMenuSelectUI.sqf | 2 +- addons/interaction/functions/fnc_prepareSelectMenu.sqf | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/interaction/functions/fnc_moveDown.sqf b/addons/interaction/functions/fnc_moveDown.sqf index eac30e4008..3b7a7074e9 100644 --- a/addons/interaction/functions/fnc_moveDown.sqf +++ b/addons/interaction/functions/fnc_moveDown.sqf @@ -11,8 +11,8 @@ Nothing Example: - 1 call FUNC(MoveDown); - -1 call FUNC(MoveDown); + 1 call FUNC(moveDown); + -1 call FUNC(moveDown); */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_openMenuSelectUI.sqf b/addons/interaction/functions/fnc_openMenuSelectUI.sqf index a13fa6a9f0..55eaba6423 100644 --- a/addons/interaction/functions/fnc_openMenuSelectUI.sqf +++ b/addons/interaction/functions/fnc_openMenuSelectUI.sqf @@ -26,7 +26,7 @@ _actions = [localize "STR_ACE_Interaction_InteractionMenu", localize "STR_ACE_In [_x] call EFUNC(common,getName), QUOTE(PATHTOF(UI\dot_ca.paa)), _forEachIndex - ] call FUNC(AddSelectableItem); + ] call FUNC(addSelectableItem); }; } forEach _cargo; diff --git a/addons/interaction/functions/fnc_prepareSelectMenu.sqf b/addons/interaction/functions/fnc_prepareSelectMenu.sqf index 593f0d4c47..34a1bfea5b 100644 --- a/addons/interaction/functions/fnc_prepareSelectMenu.sqf +++ b/addons/interaction/functions/fnc_prepareSelectMenu.sqf @@ -9,7 +9,7 @@ 1: TEXT - Approve button text Returns: - ARRAY/NUMBER - container object for use with AddSelectableItem. + ARRAY/NUMBER - container object for use with addSelectableItem. Example: ["Select Explosive", "Place"] call FUNC(prepareSelectMenu); From 2ff372e2a1f56801935340684018dbd4c68a870c Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 May 2015 04:47:15 +0200 Subject: [PATCH 023/172] Function headers per Coding Guidelines for Interaction --- .../functions/fnc_addPassengerActions.sqf | 5 +- .../functions/fnc_addPassengersActions.sqf | 7 ++- .../functions/fnc_addSelectableItem.sqf | 34 ++++++------- .../functions/fnc_applyButtons.sqf | 17 ++++++- .../functions/fnc_canBecomeLeader.sqf | 4 +- .../functions/fnc_canInteractWithCivilian.sqf | 19 +++++-- .../functions/fnc_canJoinGroup.sqf | 17 ++++++- .../interaction/functions/fnc_canJoinTeam.sqf | 17 ++++++- .../functions/fnc_canTapShoulder.sqf | 18 ++++++- .../functions/fnc_doBecomeLeader.sqf | 4 +- addons/interaction/functions/fnc_getDoor.sqf | 18 ++++++- .../functions/fnc_getDoorAnimations.sqf | 19 ++++++- addons/interaction/functions/fnc_getDown.sqf | 12 +++-- .../functions/fnc_getSelectedButton.sqf | 16 +++++- .../functions/fnc_getWeaponPos.sqf | 5 +- addons/interaction/functions/fnc_hideMenu.sqf | 30 +++++------ .../functions/fnc_hideMouseHint.sqf | 31 ++++++----- .../interaction/functions/fnc_isInRange.sqf | 14 +++-- addons/interaction/functions/fnc_joinTeam.sqf | 17 ++++++- .../functions/fnc_moduleInteraction.sqf | 14 +++-- addons/interaction/functions/fnc_moveDown.sqf | 29 +++++------ .../interaction/functions/fnc_onButtonUp.sqf | 16 +++++- addons/interaction/functions/fnc_onClick.sqf | 16 +++++- .../functions/fnc_onSelectMenuDblClick.sqf | 16 +++++- addons/interaction/functions/fnc_openDoor.sqf | 17 ++++++- .../functions/fnc_openMenuSelectUI.sqf | 51 ++++++++++++------- .../functions/fnc_openSelectMenu.sqf | 45 ++++++++-------- .../functions/fnc_prepareSelectMenu.sqf | 30 +++++------ addons/interaction/functions/fnc_push.sqf | 15 ++++-- .../interaction/functions/fnc_removeTag.sqf | 16 +++++- addons/interaction/functions/fnc_sendAway.sqf | 32 +++++++----- .../functions/fnc_showMouseHint.sqf | 35 +++++++------ .../functions/fnc_sortOptionsByPriority.sqf | 16 +++++- .../interaction/functions/fnc_tapShoulder.sqf | 17 ++++++- .../functions/fnc_updateTooltipPosition.sqf | 18 ++++++- 35 files changed, 490 insertions(+), 197 deletions(-) diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index 82e3b3b4fb..f17ca649c2 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -2,7 +2,7 @@ * Author: esteldunedain * Mount unit actions inside passenger submenu * - * Argument: + * Arguments: * 0: Vehicle * 1: Player * 3: Parameters @@ -10,6 +10,9 @@ * Return value: * Children actions * + * Example: + * _array = [vehicle, player, [params]] call ace_interaction_fnc_addPassengerAction + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index c446be3737..661c43a643 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -2,7 +2,7 @@ * Author: esteldunedain * Create one action per passenger * - * Argument: + * Arguments: * 0: Vehicle * 1: Player * 3: Parameters @@ -10,6 +10,9 @@ * Return value: * Children actions * + * Example: + * _array = [vehicle, player, [params]] call ace_interaction_fnc_addPassengersActions + * * Public: No */ #include "script_component.hpp" @@ -39,4 +42,4 @@ _actions = []; }; } forEach crew _vehicle; -_actions \ No newline at end of file +_actions diff --git a/addons/interaction/functions/fnc_addSelectableItem.sqf b/addons/interaction/functions/fnc_addSelectableItem.sqf index 498b852635..8f5676b4ca 100644 --- a/addons/interaction/functions/fnc_addSelectableItem.sqf +++ b/addons/interaction/functions/fnc_addSelectableItem.sqf @@ -1,21 +1,21 @@ /* - Author: Garth de Wet (LH) - - Description: - Adds an item to the select menu - - Parameters: - 0: ARRAY/NUMBER - List container - 1: String - Display Name - 2: String - Picture - 3: String/code - data - - Returns: - ARRAY/Number - - Example: -*/ - + * Author: Garth de Wet (LH) + * Adds an item to the select menu + * + * Arguments: + * 0: List container + * 1: Display name + * 2: Picture + * 3: Data + * + * Return value: + * Container + * + * Example: + * _array = [_actions, "Banana", "UI\dot_ca.paa", data] call ace_interaction_fnc_addSelectableItem + * + * Public: No + */ #include "script_component.hpp" private ["_container", "_displayName", "_picture", "_data", "_index"]; diff --git a/addons/interaction/functions/fnc_applyButtons.sqf b/addons/interaction/functions/fnc_applyButtons.sqf index be35b34877..5baa158eb5 100644 --- a/addons/interaction/functions/fnc_applyButtons.sqf +++ b/addons/interaction/functions/fnc_applyButtons.sqf @@ -1,5 +1,18 @@ -// by commy2 - +/* + * Author: commy2 + * Applies buttons + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_applyButtons + * + * Public: No + */ #include "script_component.hpp" private ["_object", "_actions", "_dlgInteractionDialog", "_ctrlInteractionDialog", "_index", "_ctrlInteractionDialogIcon"]; diff --git a/addons/interaction/functions/fnc_canBecomeLeader.sqf b/addons/interaction/functions/fnc_canBecomeLeader.sqf index 11234ad6d7..0bb555c49a 100644 --- a/addons/interaction/functions/fnc_canBecomeLeader.sqf +++ b/addons/interaction/functions/fnc_canBecomeLeader.sqf @@ -7,10 +7,10 @@ * 1: player * * Return Value: - * + * Able to become leader of group * * Example: - * [player, player] call ace_interaction_fnc_canBecomeLeader + * _bool = [player, player] call ace_interaction_fnc_canBecomeLeader * * Public: No */ diff --git a/addons/interaction/functions/fnc_canInteractWithCivilian.sqf b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf index 6408d66aa8..c89f4c9868 100644 --- a/addons/interaction/functions/fnc_canInteractWithCivilian.sqf +++ b/addons/interaction/functions/fnc_canInteractWithCivilian.sqf @@ -1,5 +1,18 @@ -// by commy2 - +/* + * Author: commy2 + * Checks if the player can interact with civilian + * + * Arguments: + * 0: Target + * + * Return value: + * Able to interact with civilian + * + * Example: + * _bool = [target] call ace_interaction_fnc_canInteractWithCivilian + * + * Public: No + */ #include "script_component.hpp" EXPLODE_2_PVT(_this,_unit,_isCivilian); @@ -8,4 +21,4 @@ if (isNil "_isCivilian") then {_isCivilian = true}; alive _unit && [side _unit != side ACE_player, side group _unit == civilian] select _isCivilian -//&& {count (weapons _unit) == 0} \ No newline at end of file +//&& {count (weapons _unit) == 0} diff --git a/addons/interaction/functions/fnc_canJoinGroup.sqf b/addons/interaction/functions/fnc_canJoinGroup.sqf index d299524925..26597ca0a0 100644 --- a/addons/interaction/functions/fnc_canJoinGroup.sqf +++ b/addons/interaction/functions/fnc_canJoinGroup.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * Checks if the player can join a group + * + * Arguments: + * 0: Player + * 1: Target + * + * Return value: + * Able to join a group + * + * Example: + * _bool = [player, target] call ace_interaction_fnc_canJoinGroup + * + * Public: No + */ #include "script_component.hpp" private ["_unit", "_target"]; diff --git a/addons/interaction/functions/fnc_canJoinTeam.sqf b/addons/interaction/functions/fnc_canJoinTeam.sqf index 45f96393a9..4312981978 100644 --- a/addons/interaction/functions/fnc_canJoinTeam.sqf +++ b/addons/interaction/functions/fnc_canJoinTeam.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * Checks if the player can join a team + * + * Arguments: + * 0: Player + * 1: Target + * + * Return value: + * Able to join a team + * + * Example: + * _bool = [player, target] call ace_interaction_fnc_canJoinTeam + * + * Public: No + */ #include "script_component.hpp" private ["_unit", "_target"]; diff --git a/addons/interaction/functions/fnc_canTapShoulder.sqf b/addons/interaction/functions/fnc_canTapShoulder.sqf index 4ea9836117..2be9bf70a9 100644 --- a/addons/interaction/functions/fnc_canTapShoulder.sqf +++ b/addons/interaction/functions/fnc_canTapShoulder.sqf @@ -1,5 +1,19 @@ -// by commy2 - +/* + * Author: commy2 + * Checks if the player can tap a shoulder + * + * Arguments: + * 0: Player + * 1: Target + * + * Return value: + * Able to tap a shoulder + * + * Example: + * _bool = [player, target] call ace_interaction_fnc_canTapShoulder + * + * Public: No + */ #include "script_component.hpp" private ["_unit", "_target"]; diff --git a/addons/interaction/functions/fnc_doBecomeLeader.sqf b/addons/interaction/functions/fnc_doBecomeLeader.sqf index 24bfa66c11..0fd81cbc96 100644 --- a/addons/interaction/functions/fnc_doBecomeLeader.sqf +++ b/addons/interaction/functions/fnc_doBecomeLeader.sqf @@ -3,8 +3,8 @@ * Become Leader of group * * Arguments: - * 0: target - * 1: player + * 0: Target + * 1: Player * * Return Value: * None diff --git a/addons/interaction/functions/fnc_getDoor.sqf b/addons/interaction/functions/fnc_getDoor.sqf index 91c2161d9f..460a325954 100644 --- a/addons/interaction/functions/fnc_getDoor.sqf +++ b/addons/interaction/functions/fnc_getDoor.sqf @@ -1,4 +1,20 @@ -// by commy2 +/* + * Author: commy2 + * Get door + * + * Arguments: + * 0: Distance + * + * Return value: + * House objects and door + * 0: House + * 1: Door Name + * + * Example: + * _array = [player, target] call ace_interaction_fnc_getDoor + * + * Public: No + */ #include "script_component.hpp" private ["_distance", "_position0", "_position1", "_intersections", "_count", "_house", "_door", "_index", "_id"]; diff --git a/addons/interaction/functions/fnc_getDoorAnimations.sqf b/addons/interaction/functions/fnc_getDoorAnimations.sqf index ca59ec177c..cb0b7122b0 100644 --- a/addons/interaction/functions/fnc_getDoorAnimations.sqf +++ b/addons/interaction/functions/fnc_getDoorAnimations.sqf @@ -1,4 +1,21 @@ -// by commy2 +/* + * Author: commy2 + * Get door animations + * + * Arguments: + * 0: House + * 1: Door + * + * Return value: + * Animation and Locked variable + * 0: Animation + * 1: Locked variable + * + * Example: + * _array = [target, "door"] call ace_interaction_fnc_getDoorAnimations + * + * Public: No + */ #include "script_component.hpp" private ["_house", "_door", "_animations", "_lockedVariable"]; diff --git a/addons/interaction/functions/fnc_getDown.sqf b/addons/interaction/functions/fnc_getDown.sqf index ead5dcd290..9e7daecb46 100644 --- a/addons/interaction/functions/fnc_getDown.sqf +++ b/addons/interaction/functions/fnc_getDown.sqf @@ -1,13 +1,17 @@ /* * Author: KoffeinFlummi - * - * Forces a civilian to the ground. (chance of failure). + * Forces a civilian to the ground (with a chance of failure) * * Arguments: - * 0: Unit to be sent away (Object) + * 0: Unit * * Return value: - * none + * None + * + * Example: + * [target] call ace_interaction_fnc_getDown + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_getSelectedButton.sqf b/addons/interaction/functions/fnc_getSelectedButton.sqf index d1c801e1dc..52ba3d67e0 100644 --- a/addons/interaction/functions/fnc_getSelectedButton.sqf +++ b/addons/interaction/functions/fnc_getSelectedButton.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Get selected button + * + * Arguments: + * None + * + * Return value: + * Angle + * + * Example: + * _number = call ace_interaction_fnc_getSelectedButton + * + * Public: No + */ #include "script_component.hpp" #define MIN_DISTANCE 0.0065 diff --git a/addons/interaction/functions/fnc_getWeaponPos.sqf b/addons/interaction/functions/fnc_getWeaponPos.sqf index 477e74f9bf..35ea202b1d 100644 --- a/addons/interaction/functions/fnc_getWeaponPos.sqf +++ b/addons/interaction/functions/fnc_getWeaponPos.sqf @@ -2,12 +2,15 @@ * Author: esteldunedain * Return a suitable position for the action point for the current weapon * - * Argument: + * Arguments: * None * * Return value: * Children actions * + * Example: + * _array = call ace_interaction_fnc_getWeaponPos + * * Public: No */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_hideMenu.sqf b/addons/interaction/functions/fnc_hideMenu.sqf index 54263ef032..89dc49be40 100644 --- a/addons/interaction/functions/fnc_hideMenu.sqf +++ b/addons/interaction/functions/fnc_hideMenu.sqf @@ -1,22 +1,22 @@ /* - Author: Garth de Wet (LH) - - Description: - Closes the Interaction menu - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call FUNC(hideMenu); -*/ + * Author: Garth de Wet (LH) + * Closes the Interaction menu + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_hideMenu + * + * Public: No + */ #include "script_component.hpp" closeDialog 0; (findDisplay 1713999) closeDisplay 1; (uiNameSpace getVariable QGVAR(Flow_Display)) closeDisplay 0; GVAR(MainButton) = nil; -call FUNC(hideMouseHint); \ No newline at end of file +call FUNC(hideMouseHint); diff --git a/addons/interaction/functions/fnc_hideMouseHint.sqf b/addons/interaction/functions/fnc_hideMouseHint.sqf index d910352076..69acba25a2 100644 --- a/addons/interaction/functions/fnc_hideMouseHint.sqf +++ b/addons/interaction/functions/fnc_hideMouseHint.sqf @@ -1,22 +1,21 @@ /* - Author(s): - Garth de Wet (LH) - - Description: - Hides the interaction helper text with the mouse buttons at the bottom middle of the screen - - Parameters: - Nothing - - Returns: - Nothing - - Example: - call FUNC(hideMouseHint); -*/ + * Author: Garth de Wet (LH) + * Hides the interaction helper text with the mouse buttons at the bottom middle of the screen + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_hideMouseHint + * + * Public: No + */ #include "script_component.hpp" if (isNull (uiNamespace getVariable ["ACE_Helper_Display", objNull])) exitWith{}; (QGVAR(InteractionHelper) call BIS_fnc_rscLayer) cutText ["", "PLAIN"]; -showHUD true; \ No newline at end of file +showHUD true; diff --git a/addons/interaction/functions/fnc_isInRange.sqf b/addons/interaction/functions/fnc_isInRange.sqf index 5048b66001..05677d7060 100644 --- a/addons/interaction/functions/fnc_isInRange.sqf +++ b/addons/interaction/functions/fnc_isInRange.sqf @@ -1,14 +1,18 @@ /* * Author: commy2 - * * Check if the vehicle is in range of the player. * - * Argument: - * 0: Vehicke (Object) - * 1: Distance in meters (Number) + * Arguments: + * 0: Vehicle + * 1: Distance in meters * * Return value: - * (Bool) + * Vehicle in range of player + * + * Example: + * _bool = [target, 5] call ace_interaction_fnc_isInRange + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf index 2e4d1f2898..cf6889d90a 100644 --- a/addons/interaction/functions/fnc_joinTeam.sqf +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * Assigns a unit to the team + * + * Arguments: + * 0: Unit + * 1: Team + * + * Return value: + * None + * + * Example: + * [target, "YELLOW"] call ace_interaction_fnc_joinTeam + * + * Public: No + */ #include "script_component.hpp" private ["_unit", "_team", "_message"]; diff --git a/addons/interaction/functions/fnc_moduleInteraction.sqf b/addons/interaction/functions/fnc_moduleInteraction.sqf index 37b7bacba5..925847c028 100644 --- a/addons/interaction/functions/fnc_moduleInteraction.sqf +++ b/addons/interaction/functions/fnc_moduleInteraction.sqf @@ -1,13 +1,19 @@ /* * Author: bux578 - * - * Initializes the Interaction module. + * Initializes the Interaction module * * Arguments: - * Whatever the module provides. (I dunno.) + * 0: Logic + * 1: ??? + * 2: Activation State * - * Return Value: + * Return value: * None + * + * Example: + * [logic, ???, activationState] call ace_interaction_fnc_moduleInteraction + * + * Public: No */ #include "script_component.hpp" diff --git a/addons/interaction/functions/fnc_moveDown.sqf b/addons/interaction/functions/fnc_moveDown.sqf index 3b7a7074e9..eb946a5f10 100644 --- a/addons/interaction/functions/fnc_moveDown.sqf +++ b/addons/interaction/functions/fnc_moveDown.sqf @@ -1,19 +1,18 @@ /* - Author: Garth de Wet (LH) - - Description: - Depending on the passed value, either scrolls down through the list or up. - - Parameters: - NUMBER - Amount to increase current interaction target - - Returns: - Nothing - - Example: - 1 call FUNC(moveDown); - -1 call FUNC(moveDown); -*/ + * Author: Garth de Wet (LH) + * Scrolls through the list down or up + * + * Arguments: + * 0: Amount + * + * Return value: + * None + * + * Example: + * [2] call ace_interaction_fnc_moveDown + * + * Public: No + */ #include "script_component.hpp" #define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) diff --git a/addons/interaction/functions/fnc_onButtonUp.sqf b/addons/interaction/functions/fnc_onButtonUp.sqf index cee524c55f..151ce67c98 100644 --- a/addons/interaction/functions/fnc_onButtonUp.sqf +++ b/addons/interaction/functions/fnc_onButtonUp.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * On button up + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_onButtonUp + * + * Public: No + */ #include "script_component.hpp" private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; diff --git a/addons/interaction/functions/fnc_onClick.sqf b/addons/interaction/functions/fnc_onClick.sqf index 29fffb8b94..6f9882281f 100644 --- a/addons/interaction/functions/fnc_onClick.sqf +++ b/addons/interaction/functions/fnc_onClick.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * On click + * + * Arguments: + * Index + * + * Return value: + * None + * + * Example: + * 5 call ace_interaction_fnc_onClick + * + * Public: No + */ #include "script_component.hpp" private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; diff --git a/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf b/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf index 25d307a2eb..18b69ba40d 100644 --- a/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf +++ b/addons/interaction/functions/fnc_onSelectMenuDblClick.sqf @@ -1,4 +1,18 @@ -// by CorruptedHeart, commy2 +/* + * Author: CorruptedHeart, commy2 + * On select menu double click + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_onSelectMenuDblClick + * + * Public: No + */ #include "script_component.hpp" call compile (lbData [8866, lbCurSel 8866]) call GVAR(SelectAccept); diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index e175e752cb..3e776f3538 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * Opens door + * + * Arguments: + * 0: House + * 1: Door + * + * Return value: + * None + * + * Example: + * [house, "door"] call ace_interaction_fnc_openDoor + * + * Public: No + */ #include "script_component.hpp" private ["_info", "_house", "_door", "_animations", "_lockedVariable"]; diff --git a/addons/interaction/functions/fnc_openMenuSelectUI.sqf b/addons/interaction/functions/fnc_openMenuSelectUI.sqf index 55eaba6423..e755869ed1 100644 --- a/addons/interaction/functions/fnc_openMenuSelectUI.sqf +++ b/addons/interaction/functions/fnc_openMenuSelectUI.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * Opens menu select UI + * + * Arguments: + * 0: Unit + * 1: Vehicle + * + * Return value: + * None + * + * Example: + * [unit, vehicle] call ace_interaction_fnc_openMenuSelectUI + * + * Public: No + */ #include "script_component.hpp" private ["_unit", "_vehicle", "_cargo"]; @@ -20,25 +35,25 @@ _actions = [localize "STR_ACE_Interaction_InteractionMenu", localize "STR_ACE_In // prepare: add all cargo units as options to select menu { - if (_x != _unit) then { - _actions = [ - _actions, - [_x] call EFUNC(common,getName), - QUOTE(PATHTOF(UI\dot_ca.paa)), - _forEachIndex - ] call FUNC(addSelectableItem); - }; + if (_x != _unit) then { + _actions = [ + _actions, + [_x] call EFUNC(common,getName), + QUOTE(PATHTOF(UI\dot_ca.paa)), + _forEachIndex + ] call FUNC(addSelectableItem); + }; } forEach _cargo; // open select menu [ - _actions, - { - call FUNC(hideMenu); - [0, GVAR(InteractionMenu_Crew) select _this, ""] spawn FUNC(showMenu); - GVAR(InteractionMenu_Crew) = nil; - }, - { - call FUNC(hideMenu); - } + _actions, + { + call FUNC(hideMenu); + [0, GVAR(InteractionMenu_Crew) select _this, ""] spawn FUNC(showMenu); + GVAR(InteractionMenu_Crew) = nil; + }, + { + call FUNC(hideMenu); + } ] call FUNC(openSelectMenu); diff --git a/addons/interaction/functions/fnc_openSelectMenu.sqf b/addons/interaction/functions/fnc_openSelectMenu.sqf index de5459f88c..13e02fb044 100644 --- a/addons/interaction/functions/fnc_openSelectMenu.sqf +++ b/addons/interaction/functions/fnc_openSelectMenu.sqf @@ -1,26 +1,27 @@ /* - Author: Garth de Wet (LH) - - Description: - Opens the select menu UI and sets up the UI - - Parameters: - 0: ARRAY - items - ARRAY - 0 = Text - 1 = statement to execute - 2 = condition before execute - 3 = showDisabled - 4 = priority - 5 = icon - 6 = extra variables. Passed to the code. - 1: Code - select action - 2: Code - Cancel Action - Returns: - Nothing - - Example: -*/ + * Author: Garth de Wet (LH) + * Opens the select menu UI and sets up the UI + * + * Arguments: + * 0: Items + * 0: Text + * 1: Statement to execute + * 2: Condition before execute + * 3: showDisabled + * 4: Priority + * 5: Icon + * 6: Extra variables passed to the code + * 1: Select Action + * 2: Cancel Action + * + * Return value: + * None + * + * Example: + * [["text", {statement}, {condition}, showDisabled, priority, "icon", [variables]], {selectAction}, {cancelAction}] call ace_interaction_fnc_openSelectMenu + * + * Public: No + */ #include "script_component.hpp" if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then { diff --git a/addons/interaction/functions/fnc_prepareSelectMenu.sqf b/addons/interaction/functions/fnc_prepareSelectMenu.sqf index 34a1bfea5b..f43ec75c4e 100644 --- a/addons/interaction/functions/fnc_prepareSelectMenu.sqf +++ b/addons/interaction/functions/fnc_prepareSelectMenu.sqf @@ -1,19 +1,19 @@ /* - Author: Garth de Wet (LH) - - Description: - Prepares the select menu for use. - - Parameters: - 0: TEXT - Header text - 1: TEXT - Approve button text - - Returns: - ARRAY/NUMBER - container object for use with addSelectableItem. - - Example: - ["Select Explosive", "Place"] call FUNC(prepareSelectMenu); -*/ + * Author: Garth de Wet (LH) + * Prepares the select menu for use + * + * Arguments: + * 0: Header Text + * 1: Approve Button Text + * + * Return value: + * Container object + * + * Example: + * _array = ["Select Explosive", "Place"] call ace_interaction_fnc_prepareSelectMenu + * + * Public: No + */ #include "script_component.hpp" private ["_buttonAction", "_header", "_buttonText", "_cancelButton"]; diff --git a/addons/interaction/functions/fnc_push.sqf b/addons/interaction/functions/fnc_push.sqf index f52a9d40de..580f687f64 100644 --- a/addons/interaction/functions/fnc_push.sqf +++ b/addons/interaction/functions/fnc_push.sqf @@ -1,22 +1,27 @@ /* * Author: KoffeinFlummi - * - * Pushes a boat away from the player. + * Pushes a boat away from the player * * Arguments: - * 0: Boat (object) - * 1: Velocity (vectorlike array) + * 0: Boat + * 1: Velocity * * Return Value: * None + * + * Example: + * [target, [vector]] call ace_interaction_fnc_push + * + * Public: No */ + #include "script_component.hpp" _boat = _this select 0; _velocity = _this select 1; if !(local _boat) exitWith { - [_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc); + [_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc); }; _boat setVelocity _velocity; diff --git a/addons/interaction/functions/fnc_removeTag.sqf b/addons/interaction/functions/fnc_removeTag.sqf index 0894520149..d1a16bf88b 100644 --- a/addons/interaction/functions/fnc_removeTag.sqf +++ b/addons/interaction/functions/fnc_removeTag.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Removes tag + * + * Arguments: + * None + * + * Return value: + * None + * + * Example: + * call ace_interaction_fnc_removeTag + * + * Public: No + */ #include "script_component.hpp" 0 spawn { diff --git a/addons/interaction/functions/fnc_sendAway.sqf b/addons/interaction/functions/fnc_sendAway.sqf index 5cd6a9d43a..1a48725644 100644 --- a/addons/interaction/functions/fnc_sendAway.sqf +++ b/addons/interaction/functions/fnc_sendAway.sqf @@ -1,14 +1,18 @@ /* * Author: KoffeinFlummi - * - * Sends a civilian crowd away (chance of failure). + * Sends a civilian crowd away with a chance of failure * * Arguments: - * 0: Unit to be sent away (Object) + * 0: Unit * * Return value: - * none -*/ + * None + * + * Example: + * [target] call ace_interaction_fnc_sendAway + * + * Public: No + */ #include "script_component.hpp" #define DISTANCE 50 @@ -21,16 +25,16 @@ _unit = _this select 0; ACE_player playActionNow "GestureGo"; if (count weapons ACE_player > 0) then { - _chance = 0.8; + _chance = 0.8; } else { - _chance = 0.5; + _chance = 0.5; }; { - if (count (weapons _unit) == 0 and random 1 < _chance) then { - [-2, { - (_this select 0) setUnitPos "AUTO"; - (_this select 0) doMove [(getPos (_this select 0) select 0) + DISTANCE * (eyeDirection (_this select 1) select 0), (getPos (_this select 0) select 1) + DISTANCE * (eyeDirection (_this select 1) select 1), 0]; - }, [_x, ACE_player]] call CBA_fnc_globalExecute; - }; -} foreach (_unit nearEntities ["Civilian", RADIUS]); + if (count (weapons _unit) == 0 and random 1 < _chance) then { + [-2, { + (_this select 0) setUnitPos "AUTO"; + (_this select 0) doMove [(getPos (_this select 0) select 0) + DISTANCE * (eyeDirection (_this select 1) select 0), (getPos (_this select 0) select 1) + DISTANCE * (eyeDirection (_this select 1) select 1), 0]; + }, [_x, ACE_player]] call CBA_fnc_globalExecute; + }; +} forEach (_unit nearEntities ["Civilian", RADIUS]); diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index 5cb96a0eae..a64114d009 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -1,21 +1,20 @@ /* - Author(s): - Garth de Wet (LH) - - Description: - Shows the interaction helper text with the mouse buttons at the bottom middle of the screen - - Parameters: - 0: STRING - Left click text - 1: STRING - Right click text - 3: STRING - (Optional) Scroll text - - Returns: - Nothing - - Example: - ["Place Explosive", "Cancel"] call FUNC(showMouseHint); -*/ + * Author: Garth de Wet (LH) + * Shows the interaction helper text with the mouse buttons at the bottom middle of the screen + * + * Arguments: + * 0: Left Click Text + * 1: Right Click Text + * 2: Scroll Text (Optional) + * + * Return value: + * None + * + * Example: + * ["Place Explosive", "Cancel"] call ace_interaction_fnc_showMouseHint + * + * Public: No + */ #include "script_component.hpp" #define GUI_GRID_W (0.025) @@ -51,4 +50,4 @@ if (_scroll == "") exitWith { (_display displayCtrl 1201) ctrlCommit 0; }; (_display displayCtrl 1002) ctrlSetText _scroll; -showHUD false; \ No newline at end of file +showHUD false; diff --git a/addons/interaction/functions/fnc_sortOptionsByPriority.sqf b/addons/interaction/functions/fnc_sortOptionsByPriority.sqf index 28daa4e7e5..ce4c714d79 100644 --- a/addons/interaction/functions/fnc_sortOptionsByPriority.sqf +++ b/addons/interaction/functions/fnc_sortOptionsByPriority.sqf @@ -1,4 +1,18 @@ -// by commy2 +/* + * Author: commy2 + * Sort options by priority + * + * Arguments: + * Actions + * + * Return value: + * None + * + * Example: + * _customActions call ace_interaction_fnc_sortOptionsByPriority + * + * Public: No + */ #include "script_component.hpp" private ["_actions", "_count", "_index", "_actionN", "_actionM"]; diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf index 11fc6b7881..f18c9c2c30 100644 --- a/addons/interaction/functions/fnc_tapShoulder.sqf +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -1,4 +1,19 @@ -// by commy2 +/* + * Author: commy2 + * Taps a shoulder + * + * Arguments: + * 0: Player + * 1: Target + * + * Return value: + * None + * + * Example: + * [player, target] call ace_interaction_fnc_tapShoulder + * + * Public: No + */ #include "script_component.hpp" EXPLODE_3_PVT(_this,_tapper,_target,_shoulderNum); diff --git a/addons/interaction/functions/fnc_updateTooltipPosition.sqf b/addons/interaction/functions/fnc_updateTooltipPosition.sqf index 27148c5aa3..c194102b41 100644 --- a/addons/interaction/functions/fnc_updateTooltipPosition.sqf +++ b/addons/interaction/functions/fnc_updateTooltipPosition.sqf @@ -1,4 +1,20 @@ -// by commy2 +/* + * Author: commy2 + * Updates tooltip's position + * + * Arguments: + * 0: Tooltip Display + * 1: X Coordinate + * 2: Y Coordinate + * + * Return value: + * None + * + * Example: + * [player, 0.5, 0.5] call ace_interaction_fnc_updateTooltipPosition + * + * Public: No + */ #include "script_component.hpp" disableSerialization; From e9abd8c27a423c65aa39fd1ba18014f394194d60 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 May 2015 04:55:41 +0200 Subject: [PATCH 024/172] Fixed lowercasing, improved examples --- addons/interaction/functions/fnc_addPassengerActions.sqf | 2 +- addons/interaction/functions/fnc_addPassengersActions.sqf | 2 +- addons/interaction/functions/fnc_addSelectableItem.sqf | 2 +- addons/interaction/functions/fnc_canBecomeLeader.sqf | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index f17ca649c2..4474378bcc 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -11,7 +11,7 @@ * Children actions * * Example: - * _array = [vehicle, player, [params]] call ace_interaction_fnc_addPassengerAction + * _array = [target, player, [params]] call ace_interaction_fnc_addPassengerAction * * Public: No */ diff --git a/addons/interaction/functions/fnc_addPassengersActions.sqf b/addons/interaction/functions/fnc_addPassengersActions.sqf index 661c43a643..d1565f8d9a 100644 --- a/addons/interaction/functions/fnc_addPassengersActions.sqf +++ b/addons/interaction/functions/fnc_addPassengersActions.sqf @@ -11,7 +11,7 @@ * Children actions * * Example: - * _array = [vehicle, player, [params]] call ace_interaction_fnc_addPassengersActions + * _array = [target, player, [params]] call ace_interaction_fnc_addPassengersActions * * Public: No */ diff --git a/addons/interaction/functions/fnc_addSelectableItem.sqf b/addons/interaction/functions/fnc_addSelectableItem.sqf index 8f5676b4ca..6f1339d25a 100644 --- a/addons/interaction/functions/fnc_addSelectableItem.sqf +++ b/addons/interaction/functions/fnc_addSelectableItem.sqf @@ -12,7 +12,7 @@ * Container * * Example: - * _array = [_actions, "Banana", "UI\dot_ca.paa", data] call ace_interaction_fnc_addSelectableItem + * _array = [_actions, "Banana", "UI\dot_ca.paa", "bananaContents"] call ace_interaction_fnc_addSelectableItem * * Public: No */ diff --git a/addons/interaction/functions/fnc_canBecomeLeader.sqf b/addons/interaction/functions/fnc_canBecomeLeader.sqf index 0bb555c49a..c79f879525 100644 --- a/addons/interaction/functions/fnc_canBecomeLeader.sqf +++ b/addons/interaction/functions/fnc_canBecomeLeader.sqf @@ -3,8 +3,8 @@ * Test if can Become Leader of group * * Arguments: - * 0: target - * 1: player + * 0: Target + * 1: Player * * Return Value: * Able to become leader of group From ae1628ef03f80ca9c3eeaee19ca5684f591a7f78 Mon Sep 17 00:00:00 2001 From: SAM Date: Sat, 9 May 2015 10:41:55 +0200 Subject: [PATCH 025/172] Renamed init file for neatness --- .../functions/{fnc_initViewDistance.sqf => fnc_init.sqf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename addons/viewdistance/functions/{fnc_initViewDistance.sqf => fnc_init.sqf} (100%) diff --git a/addons/viewdistance/functions/fnc_initViewDistance.sqf b/addons/viewdistance/functions/fnc_init.sqf similarity index 100% rename from addons/viewdistance/functions/fnc_initViewDistance.sqf rename to addons/viewdistance/functions/fnc_init.sqf From 9e40e16c4a0ff6436b2c48235bf2510085061c0e Mon Sep 17 00:00:00 2001 From: SAM Date: Sat, 9 May 2015 10:43:20 +0200 Subject: [PATCH 026/172] Adjusted XEH_preinit accordingly --- addons/viewdistance/XEH_preInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/viewdistance/XEH_preInit.sqf b/addons/viewdistance/XEH_preInit.sqf index 9f66b79e2e..ca4a7ac90b 100644 --- a/addons/viewdistance/XEH_preInit.sqf +++ b/addons/viewdistance/XEH_preInit.sqf @@ -6,6 +6,6 @@ PREP(module); PREP(returnViewDistanceValue); PREP(returnViewDistanceLimit); PREP(changeViewDistance); -PREP(initViewDistance); +PREP(init); ADDON = true; \ No newline at end of file From 7201a23d41f23dc35e4e9f936969d73d5c75e659 Mon Sep 17 00:00:00 2001 From: SAM Date: Sat, 9 May 2015 10:44:01 +0200 Subject: [PATCH 027/172] Adjusted post init, removed redundant settings --- addons/viewdistance/ACE_Settings.hpp | 15 +-------------- addons/viewdistance/XEH_postInit.sqf | 6 +----- 2 files changed, 2 insertions(+), 19 deletions(-) diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp index d7a9dbb9fc..d3208b1d88 100644 --- a/addons/viewdistance/ACE_Settings.hpp +++ b/addons/viewdistance/ACE_Settings.hpp @@ -1,18 +1,5 @@ class ACE_Settings { - class GVAR(changeAllowed) { - typeName = "BOOL"; - value = 1; - displayName = "Allow View Distance Changing"; - description = "Allows clients to be able to change their view distance"; - }; - class GVAR(viewDistanceLimit) { - typeName = "SCALAR"; - value = 11; // setting the highest number in the array below means no limit. - values[] = {0,1,2,3,4,5,6,7,8,9,10,11}; // correspond to the INDEX values - displayName = "Change View Distance Limit"; - description = "Sets the top limit for all clients"; - }; - class GVAR(newViewDistance) { + class GVAR(viewDistance) { typeName = "SCALAR"; isClientSettable = 1; value = 0; // not sure what to set this to. diff --git a/addons/viewdistance/XEH_postInit.sqf b/addons/viewdistance/XEH_postInit.sqf index f5a5079273..f5c15322bf 100644 --- a/addons/viewdistance/XEH_postInit.sqf +++ b/addons/viewdistance/XEH_postInit.sqf @@ -1,7 +1,3 @@ #include "script_component.hpp" -if (!GVAR(changeAllowed)) exitWith { - // if viewdistance module is disabled from config, exit here. - diag_log format["[ACE]: View Distance is disabled from the config.cpp in the pbo"]; -}; -[] call FUNC(initViewDistance); \ No newline at end of file +[] call FUNC(init); \ No newline at end of file From bba216ebd2d5382524d4cfd06f352259b4c7cded Mon Sep 17 00:00:00 2001 From: SAM Date: Sat, 9 May 2015 10:53:09 +0200 Subject: [PATCH 028/172] Rewrote switch statement Per @Glowbal's comment --- .../functions/fnc_returnViewDistanceValue.sqf | 30 +++++++++---------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf b/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf index 5f06256b09..86b940d582 100644 --- a/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf +++ b/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf @@ -20,24 +20,22 @@ PARAMS_1(_index); private ["_return"]; -_return = 0; -// change to if () exitWith {};? -switch (_index) do +_return = switch (_index) do { - case 0: {_return = 1500;}; - case 1: {_return = 2000;}; - case 2: {_return = 2500;}; - case 3: {_return = 3000;}; - case 4: {_return = 3500;}; - case 5: {_return = 4000;}; - case 6: {_return = 5000;}; - case 7: {_return = 6000;}; - case 8: {_return = 7000;}; - case 9: {_return = 8000;}; - case 10: {_return = 9000;}; - case 11: {_return = 10000;}; - default {hint "something broke!";}; // should replace with something a bit more graceful + case 0: {1500}; + case 1: {2000}; + case 2: {2500}; + case 3: {3000}; + case 4: {3500}; + case 5: {4000}; + case 6: {5000}; + case 7: {6000}; + case 8: {7000}; + case 9: {8000}; + case 10: {9000}; + case 11: {10000}; + default {1000}; }; _return; \ No newline at end of file From 2dfaaa047a0151cf7b456de74ffd7531bf215e13 Mon Sep 17 00:00:00 2001 From: SAM Date: Sat, 9 May 2015 11:56:27 +0200 Subject: [PATCH 029/172] Reworked limiting system Module limit still not being set properly. --- addons/viewdistance/ACE_Settings.hpp | 10 ++++-- addons/viewdistance/CfgVehicles.hpp | 2 +- addons/viewdistance/XEH_preInit.sqf | 5 ++- .../functions/fnc_changeViewDistance.sqf | 16 ++++----- addons/viewdistance/functions/fnc_init.sqf | 2 +- addons/viewdistance/functions/fnc_module.sqf | 7 ++-- .../functions/fnc_returnViewDistanceLimit.sqf | 34 ------------------- 7 files changed, 22 insertions(+), 54 deletions(-) delete mode 100644 addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp index d3208b1d88..4a400a0b31 100644 --- a/addons/viewdistance/ACE_Settings.hpp +++ b/addons/viewdistance/ACE_Settings.hpp @@ -2,11 +2,17 @@ class ACE_Settings { class GVAR(viewDistance) { typeName = "SCALAR"; isClientSettable = 1; - value = 0; // not sure what to set this to. - values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnViewDistanceValue.sqf + value = 11; // index, NOT value // not sure what to set this to. + values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf displayName = "Change View Distance"; description = "Changes in game view distance"; }; + class GVAR(limit) { + typeName = "SCALAR"; + value = 10000; // Value, NOT index. + displayName = "View Distance Limit"; + description = "Limit for client's view distance set here and can overridden by module"; + }; }; // To do: include string table style displayName & description. \ No newline at end of file diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp index 38ef214c09..d2b014615c 100644 --- a/addons/viewdistance/CfgVehicles.hpp +++ b/addons/viewdistance/CfgVehicles.hpp @@ -13,7 +13,7 @@ class CfgVehicles { displayName = "View Distance setting limit"; description = "Sets the limit for how high clients can raise their view distance (< 10000)"; typeName = "SCALAR"; - defaultValue = 10000; + defaultValue = 5000; }; }; }; diff --git a/addons/viewdistance/XEH_preInit.sqf b/addons/viewdistance/XEH_preInit.sqf index ca4a7ac90b..a46efc7769 100644 --- a/addons/viewdistance/XEH_preInit.sqf +++ b/addons/viewdistance/XEH_preInit.sqf @@ -3,9 +3,8 @@ ADDON = false; PREP(module); -PREP(returnViewDistanceValue); -PREP(returnViewDistanceLimit); -PREP(changeViewDistance); PREP(init); +PREP(returnValue); +PREP(changeViewDistance); ADDON = true; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 8c017ec1eb..b118b29a48 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -20,17 +20,17 @@ private ["_text","_new_view_distance","_view_distance_limit"]; // Change the received index number into an actual view distance number as set in the config: -_new_view_distance = [GVAR(newViewDistance)] call FUNC(returnViewDistanceValue); +_new_view_distance = [GVAR(viewDistance)] call FUNC(returnValue); -// Grab the limit, either from the module OR if the module is not valid, the config. -_view_distance_limit = [] call FUNC(returnViewDistanceLimit); +_view_distance_limit = GVAR(limit); // Grab the limit -if (_new_view_distance > _view_distance_limit) then { - _text = composeText ["That option is not allowed! The limit is: ",str(_view_distance_limit)]; - [_text,1] call EFUNC(common,displayTextStructured); -} -else { +if (_new_view_distance <= _view_distance_limit) then { _text = composeText ["View distance successfully changed to: ",str(_new_view_distance)]; [_text,1] call EFUNC(common,displayTextStructured); setViewDistance _new_view_distance; + setObjectViewDistance (0.8 * _new_view_distance); // maybe make this 0.8 a constant? +} +else { + _text = composeText ["That option is not allowed! The limit is: ",str(_view_distance_limit)]; + [_text,1] call EFUNC(common,displayTextStructured); }; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_init.sqf b/addons/viewdistance/functions/fnc_init.sqf index 75ca076ff6..e9509f3ddd 100644 --- a/addons/viewdistance/functions/fnc_init.sqf +++ b/addons/viewdistance/functions/fnc_init.sqf @@ -21,7 +21,7 @@ if (!hasInterface) exitWith {}; // Set the EH which waits for the View Distance setting to be changed ["SettingChanged",{ - if (_this select 0 == QGVAR(newViewDistance)) then { + if (_this select 0 == QGVAR(viewDistance)) then { [] call FUNC(changeViewDistance); }; },true] call ace_common_fnc_addEventHandler; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_module.sqf b/addons/viewdistance/functions/fnc_module.sqf index 66c2aed793..0e44cd5081 100644 --- a/addons/viewdistance/functions/fnc_module.sqf +++ b/addons/viewdistance/functions/fnc_module.sqf @@ -25,9 +25,6 @@ if (!_activated) exitWith { diag_log text "[ACE]: View Distance Limit Module is placed but NOT active."; }; -GVAR(modulePresent) = true; +diag_log text "[ACE]: View Distance Limit Module Initialized."; -[_logic, QGVAR(moduleViewDistanceLimit),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule); - -hint format["[ACE]: View Distance Limit Module Initialized with limit: %1",GVAR(moduleViewDistanceLimit)]; // only used for debug, GVAR(moduleViewDistanceLimit) keeps returning as ANY. Remember to remove before finalising the module. -diag_log format["[ACE]: View Distance Limit Module Initialized with limit: %1",GVAR(moduleViewDistanceLimit)]; \ No newline at end of file +[_logic, QGVAR(limit),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule); \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf b/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf deleted file mode 100644 index 8ae9e6538d..0000000000 --- a/addons/viewdistance/functions/fnc_returnViewDistanceLimit.sqf +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Author: Winter - * Returns the view distance limit depending on either the config or (if present) the module. - * - * - * Arguments: - * None - * - * Return Value: - * View Distance Limit - * - * Example: - * [] call ace_viewdistance_fnc_returnViewDistanceLimit; - * - * Public: Yes - */ - -#include "script_component.hpp" - -private ["_limit"]; - -_limit = 20000; // unrealistic amount since A3 max is 10000, helps in debug - -if (!isNil QGVAR(moduleViewDistanceLimit)) then { - _limit = GVAR(moduleViewDistanceLimit); // module value always takes priority over config -} else { - // If the module is not present, take the value from the config instead - _limit = [GVAR(viewDistanceLimit)] call FUNC(returnViewDistanceValue); // this function converts the array index in the config to it's relevant scalar value. -}; - -hint format ["[VD] Limit returned from module: %2 Local Limit: %3",GVAR(modulePresent),GVAR(moduleViewDistanceLimit),_limit]; // only used for debug, trying to get the module to work. Remember to remove before finalising pbo -diag_log format ["[VD] Limit returned from module: %2 Local Limit: %3",GVAR(modulePresent),GVAR(moduleViewDistanceLimit),_limit]; // only used for debug, trying to get the module to work. Remember to remove before finalising pbo - -_limit; \ No newline at end of file From f64f76e92f52463bbbb3ccb4cfa96ca872ffc2dd Mon Sep 17 00:00:00 2001 From: SAM Date: Sat, 9 May 2015 12:07:05 +0200 Subject: [PATCH 030/172] Fixed wrong file name --- .../{fnc_returnViewDistanceValue.sqf => fnc_returnValue.sqf} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename addons/viewdistance/functions/{fnc_returnViewDistanceValue.sqf => fnc_returnValue.sqf} (100%) diff --git a/addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf b/addons/viewdistance/functions/fnc_returnValue.sqf similarity index 100% rename from addons/viewdistance/functions/fnc_returnViewDistanceValue.sqf rename to addons/viewdistance/functions/fnc_returnValue.sqf From a9d6fbd841a0141d344a9baf9c70c602bc50fc2f Mon Sep 17 00:00:00 2001 From: SAM Date: Sat, 9 May 2015 12:36:11 +0200 Subject: [PATCH 031/172] Attempting to fix module value not being read --- addons/viewdistance/ACE_Settings.hpp | 2 +- addons/viewdistance/CfgVehicles.hpp | 4 ++-- addons/viewdistance/functions/fnc_changeViewDistance.sqf | 2 ++ addons/viewdistance/functions/fnc_module.sqf | 4 ++-- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp index 4a400a0b31..de1b0226c6 100644 --- a/addons/viewdistance/ACE_Settings.hpp +++ b/addons/viewdistance/ACE_Settings.hpp @@ -9,7 +9,7 @@ class ACE_Settings { }; class GVAR(limit) { typeName = "SCALAR"; - value = 10000; // Value, NOT index. + value = 10000; // Value, NOT index. 10000 is the maximum in A3 displayName = "View Distance Limit"; description = "Limit for client's view distance set here and can overridden by module"; }; diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp index d2b014615c..832b2c55a2 100644 --- a/addons/viewdistance/CfgVehicles.hpp +++ b/addons/viewdistance/CfgVehicles.hpp @@ -10,10 +10,10 @@ class CfgVehicles { //icon = ""; // needs an icon class Arguments { class moduleViewDistanceLimit { - displayName = "View Distance setting limit"; + displayName = "View Distance Limit"; description = "Sets the limit for how high clients can raise their view distance (< 10000)"; typeName = "SCALAR"; - defaultValue = 5000; + defaultValue = 6000; }; }; }; diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index b118b29a48..0a2467bace 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -24,6 +24,8 @@ _new_view_distance = [GVAR(viewDistance)] call FUNC(returnValue); _view_distance_limit = GVAR(limit); // Grab the limit +diag_log format ["[ACE]: DEBUG View Distance change requested: %1 Limit is: %2 Under Limit: %3",_new_view_distance,_view_distance_limit,_new_view_distance<_view_distance_limit]; // ONLY FOR DEBUG, REMOVE LATER ON + if (_new_view_distance <= _view_distance_limit) then { _text = composeText ["View distance successfully changed to: ",str(_new_view_distance)]; [_text,1] call EFUNC(common,displayTextStructured); diff --git a/addons/viewdistance/functions/fnc_module.sqf b/addons/viewdistance/functions/fnc_module.sqf index 0e44cd5081..2ca2a6bd36 100644 --- a/addons/viewdistance/functions/fnc_module.sqf +++ b/addons/viewdistance/functions/fnc_module.sqf @@ -25,6 +25,6 @@ if (!_activated) exitWith { diag_log text "[ACE]: View Distance Limit Module is placed but NOT active."; }; -diag_log text "[ACE]: View Distance Limit Module Initialized."; +[_logic, QGVAR(limit),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(limit),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule); \ No newline at end of file +diag_log format ["[ACE]: View Distance Limit Module Initialized. Limit set by module: %1",GVAR(limit)]; \ No newline at end of file From f4d7c6818bf483f79916ea3c865840ba9253d7af Mon Sep 17 00:00:00 2001 From: SAM Date: Sat, 9 May 2015 13:05:36 +0200 Subject: [PATCH 032/172] Attempted fix #2 --- addons/viewdistance/CfgVehicles.hpp | 6 +++--- addons/viewdistance/XEH_preInit.sqf | 2 +- .../functions/{fnc_module.sqf => fnc_initModule.sqf} | 0 3 files changed, 4 insertions(+), 4 deletions(-) rename addons/viewdistance/functions/{fnc_module.sqf => fnc_initModule.sqf} (100%) diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp index 832b2c55a2..a9a35dcfe4 100644 --- a/addons/viewdistance/CfgVehicles.hpp +++ b/addons/viewdistance/CfgVehicles.hpp @@ -1,10 +1,10 @@ class CfgVehicles { - class Module_F; - class ACE_ModuleViewDistance : Module_F { + class ACE_Module; + class GVAR(ModuleSettings) : ACE_Module { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; + function = QUOTE(DFUNC(initModule)); displayName = "View Distance Limiter"; - function = QFUNC(module); scope = 2; isGlobal = 1; //icon = ""; // needs an icon diff --git a/addons/viewdistance/XEH_preInit.sqf b/addons/viewdistance/XEH_preInit.sqf index a46efc7769..883e393c8a 100644 --- a/addons/viewdistance/XEH_preInit.sqf +++ b/addons/viewdistance/XEH_preInit.sqf @@ -2,7 +2,7 @@ ADDON = false; -PREP(module); +PREP(initModule); PREP(init); PREP(returnValue); PREP(changeViewDistance); diff --git a/addons/viewdistance/functions/fnc_module.sqf b/addons/viewdistance/functions/fnc_initModule.sqf similarity index 100% rename from addons/viewdistance/functions/fnc_module.sqf rename to addons/viewdistance/functions/fnc_initModule.sqf From 8c937a707d194347faf50b74e6abcce2aa6b187f Mon Sep 17 00:00:00 2001 From: bux578 Date: Sat, 9 May 2015 13:49:26 +0200 Subject: [PATCH 033/172] starting to fix switchunits --- addons/switchunits/functions/fnc_initPlayer.sqf | 2 -- addons/switchunits/functions/fnc_startSwitchUnits.sqf | 7 ++----- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/addons/switchunits/functions/fnc_initPlayer.sqf b/addons/switchunits/functions/fnc_initPlayer.sqf index c2857f1091..67669c071c 100644 --- a/addons/switchunits/functions/fnc_initPlayer.sqf +++ b/addons/switchunits/functions/fnc_initPlayer.sqf @@ -17,8 +17,6 @@ #include "script_component.hpp" -private ["_playerUnit", "_sides"]; - PARAMS_2(_playerUnit,_sides); if (vehicle _playerUnit == _playerUnit) then { diff --git a/addons/switchunits/functions/fnc_startSwitchUnits.sqf b/addons/switchunits/functions/fnc_startSwitchUnits.sqf index ef344475b9..7985bfa094 100644 --- a/addons/switchunits/functions/fnc_startSwitchUnits.sqf +++ b/addons/switchunits/functions/fnc_startSwitchUnits.sqf @@ -16,13 +16,10 @@ #include "script_component.hpp" - -private "_player"; -_player = _this select 0; - +PARAMS_1(_player); if (GVAR(EnableSwitchUnits)) then { - private ["_sides"]; + private "_sides"; _sides = []; if(GVAR(SwitchToWest)) then {_sides pushBack west;}; From f1798aa739a66e82acdf8029f51c5b24ba03a332 Mon Sep 17 00:00:00 2001 From: bux578 Date: Sat, 9 May 2015 14:05:58 +0200 Subject: [PATCH 034/172] fix switchunits --- .../functions/fnc_handleMapClick.sqf | 9 ++------- .../switchunits/functions/fnc_switchUnit.sqf | 18 +++++++++--------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/addons/switchunits/functions/fnc_handleMapClick.sqf b/addons/switchunits/functions/fnc_handleMapClick.sqf index bfe36f13ea..e8efa2640f 100644 --- a/addons/switchunits/functions/fnc_handleMapClick.sqf +++ b/addons/switchunits/functions/fnc_handleMapClick.sqf @@ -28,14 +28,9 @@ _sideNearest = []; if ([_x] call FUNC(isValidAi) && (side group _x in _sides)) then { _sideNearest pushBack _x; }; -} forEach (nearestObjects [_pos, ["Man"], 20]); - +} forEach (nearestObjects [_pos, ["Man"], 15]); if (count _sideNearest > 0) then { - private ["_switchUnit"]; - - _switchUnit = _sideNearest select 0; - [ACE_player, _switchUnit] call FUNC(switchUnit); - + [_sideNearest select 0] call FUNC(switchUnit); openMap false; }; diff --git a/addons/switchunits/functions/fnc_switchUnit.sqf b/addons/switchunits/functions/fnc_switchUnit.sqf index b1879b0999..c263bdd721 100644 --- a/addons/switchunits/functions/fnc_switchUnit.sqf +++ b/addons/switchunits/functions/fnc_switchUnit.sqf @@ -32,11 +32,11 @@ if (GVAR(EnableSafeZone)) then { _allNearestPlayers = [position _unit, GVAR(SafeZoneRadius)] call FUNC(nearestPlayers); _nearestEnemyPlayers = [_allNearestPlayers, {((side GVAR(OriginalGroup)) getFriend (side _this) < 0.6) && !(_this getVariable [QGVAR(IsPlayerControlled), false])}] call EFUNC(common,filter); - + if (count _nearestEnemyPlayers > 0) exitWith { _leave = true; }; - + }; // exitWith doesn't exit past the "if(EnableSafeZone)" block @@ -56,14 +56,14 @@ DFUNC(pfhSwitchUnit) = { private ["_args", "_unit", "_oldUnit", "_respawnEhId", "_oldOwner"]; _args = _this select 0; - + _unit = _args select 0; _oldUnit = _args select 1; - - - + + + if (local _unit) exitWith { - + _oldUnit setVariable [QGVAR(IsPlayerControlled), false, true]; _oldUnit setVariable [QGVAR(PlayerControlledName), "", true]; @@ -89,9 +89,9 @@ DFUNC(pfhSwitchUnit) = { }; [localize "STR_ACE_SwitchUnits_SwitchedUnit"] call EFUNC(common,displayTextStructured); - + [(_this select 1)] call cba_fnc_removePerFrameHandler; - + }; }; From cad86280c1600351aba3205248979e2d6fe3935e Mon Sep 17 00:00:00 2001 From: SAM Date: Sat, 9 May 2015 14:51:23 +0200 Subject: [PATCH 035/172] Fixed module value not overriding. --- addons/viewdistance/CfgVehicles.hpp | 4 ++-- addons/viewdistance/functions/fnc_changeViewDistance.sqf | 5 +---- addons/viewdistance/functions/fnc_init.sqf | 2 +- addons/viewdistance/functions/fnc_initModule.sqf | 2 -- 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp index a9a35dcfe4..2a2f85e611 100644 --- a/addons/viewdistance/CfgVehicles.hpp +++ b/addons/viewdistance/CfgVehicles.hpp @@ -12,8 +12,8 @@ class CfgVehicles { class moduleViewDistanceLimit { displayName = "View Distance Limit"; description = "Sets the limit for how high clients can raise their view distance (< 10000)"; - typeName = "SCALAR"; - defaultValue = 6000; + typeName = "NUMBER"; + defaultValue = 10000; }; }; }; diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 0a2467bace..7a92b70748 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -19,13 +19,10 @@ private ["_text","_new_view_distance","_view_distance_limit"]; -// Change the received index number into an actual view distance number as set in the config: +// Change the received index number into an actual view distance: _new_view_distance = [GVAR(viewDistance)] call FUNC(returnValue); - _view_distance_limit = GVAR(limit); // Grab the limit -diag_log format ["[ACE]: DEBUG View Distance change requested: %1 Limit is: %2 Under Limit: %3",_new_view_distance,_view_distance_limit,_new_view_distance<_view_distance_limit]; // ONLY FOR DEBUG, REMOVE LATER ON - if (_new_view_distance <= _view_distance_limit) then { _text = composeText ["View distance successfully changed to: ",str(_new_view_distance)]; [_text,1] call EFUNC(common,displayTextStructured); diff --git a/addons/viewdistance/functions/fnc_init.sqf b/addons/viewdistance/functions/fnc_init.sqf index e9509f3ddd..0d5ec7cf79 100644 --- a/addons/viewdistance/functions/fnc_init.sqf +++ b/addons/viewdistance/functions/fnc_init.sqf @@ -1,6 +1,6 @@ /* * Author: Winter - * Assigns the Event Handler which fires when a player adjusts their view distance in the menu + * Assigns the Event Handler which triggers when a player adjusts their view distance in the menu * * * Arguments: diff --git a/addons/viewdistance/functions/fnc_initModule.sqf b/addons/viewdistance/functions/fnc_initModule.sqf index 2ca2a6bd36..6dd7105439 100644 --- a/addons/viewdistance/functions/fnc_initModule.sqf +++ b/addons/viewdistance/functions/fnc_initModule.sqf @@ -10,8 +10,6 @@ * * Return Value: * None - * - * Example: * */ From 737b1cc2160291a88ceb98da34f57b2335a28e6c Mon Sep 17 00:00:00 2001 From: SAM Date: Sat, 9 May 2015 18:42:02 +0200 Subject: [PATCH 036/172] Renamed variable limit to limitViewDistance For future limiting of terraingrid --- addons/viewdistance/ACE_Settings.hpp | 2 +- addons/viewdistance/functions/fnc_changeViewDistance.sqf | 2 +- addons/viewdistance/functions/fnc_initModule.sqf | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp index de1b0226c6..6572e4790e 100644 --- a/addons/viewdistance/ACE_Settings.hpp +++ b/addons/viewdistance/ACE_Settings.hpp @@ -7,7 +7,7 @@ class ACE_Settings { displayName = "Change View Distance"; description = "Changes in game view distance"; }; - class GVAR(limit) { + class GVAR(limitViewDistance) { typeName = "SCALAR"; value = 10000; // Value, NOT index. 10000 is the maximum in A3 displayName = "View Distance Limit"; diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 7a92b70748..f1274343d8 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -21,7 +21,7 @@ private ["_text","_new_view_distance","_view_distance_limit"]; // Change the received index number into an actual view distance: _new_view_distance = [GVAR(viewDistance)] call FUNC(returnValue); -_view_distance_limit = GVAR(limit); // Grab the limit +_view_distance_limit = GVAR(limitViewDistance); // Grab the limit if (_new_view_distance <= _view_distance_limit) then { _text = composeText ["View distance successfully changed to: ",str(_new_view_distance)]; diff --git a/addons/viewdistance/functions/fnc_initModule.sqf b/addons/viewdistance/functions/fnc_initModule.sqf index 6dd7105439..cff8e9685f 100644 --- a/addons/viewdistance/functions/fnc_initModule.sqf +++ b/addons/viewdistance/functions/fnc_initModule.sqf @@ -23,6 +23,6 @@ if (!_activated) exitWith { diag_log text "[ACE]: View Distance Limit Module is placed but NOT active."; }; -[_logic, QGVAR(limit),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(limitViewDistance),"moduleViewDistanceLimit"] call EFUNC(common,readSettingFromModule); -diag_log format ["[ACE]: View Distance Limit Module Initialized. Limit set by module: %1",GVAR(limit)]; \ No newline at end of file +diag_log format ["[ACE]: View Distance Limit Module Initialized. Limit set by module: %1",GVAR(limitViewDistance)]; \ No newline at end of file From e56089737b5ca6ae4509c5e0a1a96c28526629b3 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sat, 9 May 2015 10:30:58 -0700 Subject: [PATCH 037/172] $NOBIN$ mode now respects the signature key blacklist --- tools/make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/make.py b/tools/make.py index f3d71f3f34..4c8ba2f5b2 100644 --- a/tools/make.py +++ b/tools/make.py @@ -969,7 +969,7 @@ See the make.cfg file for additional build options. raise print_error("Could not rename built PBO with prefix.") # Sign result - if key: + if (key and not "ace_{}.pbo".format(module) in signature_blacklist): print("Signing with {}.".format(key)) if pbo_name_prefix: ret = subprocess.call([dssignfile, key, os.path.join(module_root, release_dir, project, "addons", pbo_name_prefix + module + ".pbo")]) From ec2d3ff99d2dfe4cef3f588ca5f8717ecfa22e9b Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sat, 9 May 2015 11:05:35 -0700 Subject: [PATCH 038/172] add some debug --- tools/make.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tools/make.py b/tools/make.py index 4c8ba2f5b2..3db62337a8 100644 --- a/tools/make.py +++ b/tools/make.py @@ -102,6 +102,8 @@ def get_directory_hash(directory): traceback.print_exc() return -2 + retVal = directory_hash.hexdigest() + #print_yellow("Hash Value for {} is {}".format(directory,retVal)) return directory_hash.hexdigest() # Copyright (c) Andrรฉ Burgaud From 21ea66746380c25180b6fad3f24df1d0f4fad59b Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sat, 9 May 2015 11:07:27 -0700 Subject: [PATCH 039/172] $NOBIN$ file must not be a zero-byte file in order to affect the cache to trigger a proper rebuild. --- addons/common/config - Copy.cpp | 167 ++++++++++++++++++++++++++++++++ addons/config.cpp | 167 ++++++++++++++++++++++++++++++++ optionals/server/$NOBIN$ | 1 + server.md5 | 2 + server2.md5 | 3 + server3.md5 | 3 + tools/vm_build.py | 6 ++ 7 files changed, 349 insertions(+) create mode 100644 addons/common/config - Copy.cpp create mode 100644 addons/config.cpp create mode 100644 server.md5 create mode 100644 server2.md5 create mode 100644 server3.md5 create mode 100644 tools/vm_build.py diff --git a/addons/common/config - Copy.cpp b/addons/common/config - Copy.cpp new file mode 100644 index 0000000000..27647f8d00 --- /dev/null +++ b/addons/common/config - Copy.cpp @@ -0,0 +1,167 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_Box_Misc", "ACE_bananaItem"}; + weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_main"}; + author[] = {"KoffeinFlummi"}; + authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" + +#include "CfgSounds.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" +#include "CfgMagazines.hpp" + +#include "CfgActions.hpp" +#include "CfgMoves.hpp" +#include "CfgVoice.hpp" +#include "CfgUnitInsignia.hpp" + +class ACE_Rsc_Display_Base { + idd = -1; + type = 0; + style = 48; + name = ""; + duration = 999999; + fadeIn = 0; + fadeOut = 0; + font = "TahomaB"; + size = 1; + colorBackground[] = {1, 1, 1, 0}; + colorText[] = {1, 1, 1, 1}; +}; + +class ACE_Rsc_Control_Base { + idc = 1; + type = 0; + style = 48; + access = 0; + lineSpacing = 0; + moving = 1; + text = ""; + size = 1; + sizeEx = 0; + font = "TahomaB"; + colorBackground[] = {1, 1, 1, 0}; + colorText[] = {1, 1, 1, 1}; + x = 0; + y = 0; + w = 0; + h = 0; +}; + +class ACE_Settings { + /* + *class GVAR(sampleSetting) { + * Value + * value = 1; + * + * Type (SCALAR, BOOL, STRING, ARRAY, COLOR) + * typeName = "SCALAR"; + * + * Force the setting? + * force = 0; + * + * Does it appear on the options menu? + * isClientSettable = 1; + * + * The following settings only apply when isClientSettable == 1 + * Stringtable entry with the setting name + * displayName = "$STR_ACE_Common_SettingName"; + * + * Stringtable entry with the setting description + * description = "$STR_ACE_Common_SettingDescription"; + * + * Stringtable entries that describe the options + * Only applies if typeName == "SCALAR"; + * values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; + *}; + */ + class GVAR(forceAllSettings) { + value = 0; + typeName = "BOOL"; + }; + /*class GVAR(enableNumberHotkeys) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Common_EnableNumberHotkeys"; + };*/ + class GVAR(settingFeedbackIcons) { + value = 1; + typeName = "SCALAR"; + force = 0; + isClientSettable = 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; + isClientSettable = 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"; + isClientSettable = 1; + displayName = "$STR_ACE_Common_SettingDisplayTextColorName"; + description = "$STR_ACE_Common_SettingDisplayTextColorDesc"; + }; + class GVAR(displayTextFontColor) { + value[] = {1,1,1,1}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = "$STR_ACE_Common_SettingDisplayTextFontColorName"; + description = "$STR_ACE_Common_SettingDisplayTextFontColorDesc"; + }; +}; + +#include "define.hpp" +#include +#include +#include + +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}; + }; + }; + }; +}; + +/* +// check dll +class RscStandardDisplay; +class RscDisplayMain: RscStandardDisplay { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayMain"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_5('header','tail',{0},{},_this select 0)] call COMPILE_FILE(functions\fnc_errorMessage)); +}; +*/ + +class ACE_Extensions { + extensions[] = {}; +}; diff --git a/addons/config.cpp b/addons/config.cpp new file mode 100644 index 0000000000..27647f8d00 --- /dev/null +++ b/addons/config.cpp @@ -0,0 +1,167 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {"ACE_Box_Misc", "ACE_bananaItem"}; + weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_main"}; + author[] = {"KoffeinFlummi"}; + authorUrl = "https://github.com/KoffeinFlummi/"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" + +#include "CfgSounds.hpp" +#include "CfgVehicles.hpp" +#include "CfgWeapons.hpp" +#include "CfgMagazines.hpp" + +#include "CfgActions.hpp" +#include "CfgMoves.hpp" +#include "CfgVoice.hpp" +#include "CfgUnitInsignia.hpp" + +class ACE_Rsc_Display_Base { + idd = -1; + type = 0; + style = 48; + name = ""; + duration = 999999; + fadeIn = 0; + fadeOut = 0; + font = "TahomaB"; + size = 1; + colorBackground[] = {1, 1, 1, 0}; + colorText[] = {1, 1, 1, 1}; +}; + +class ACE_Rsc_Control_Base { + idc = 1; + type = 0; + style = 48; + access = 0; + lineSpacing = 0; + moving = 1; + text = ""; + size = 1; + sizeEx = 0; + font = "TahomaB"; + colorBackground[] = {1, 1, 1, 0}; + colorText[] = {1, 1, 1, 1}; + x = 0; + y = 0; + w = 0; + h = 0; +}; + +class ACE_Settings { + /* + *class GVAR(sampleSetting) { + * Value + * value = 1; + * + * Type (SCALAR, BOOL, STRING, ARRAY, COLOR) + * typeName = "SCALAR"; + * + * Force the setting? + * force = 0; + * + * Does it appear on the options menu? + * isClientSettable = 1; + * + * The following settings only apply when isClientSettable == 1 + * Stringtable entry with the setting name + * displayName = "$STR_ACE_Common_SettingName"; + * + * Stringtable entry with the setting description + * description = "$STR_ACE_Common_SettingDescription"; + * + * Stringtable entries that describe the options + * Only applies if typeName == "SCALAR"; + * values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; + *}; + */ + class GVAR(forceAllSettings) { + value = 0; + typeName = "BOOL"; + }; + /*class GVAR(enableNumberHotkeys) { + value = 1; + typeName = "BOOL"; + isClientSettable = 1; + displayName = "$STR_ACE_Common_EnableNumberHotkeys"; + };*/ + class GVAR(settingFeedbackIcons) { + value = 1; + typeName = "SCALAR"; + force = 0; + isClientSettable = 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; + isClientSettable = 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"; + isClientSettable = 1; + displayName = "$STR_ACE_Common_SettingDisplayTextColorName"; + description = "$STR_ACE_Common_SettingDisplayTextColorDesc"; + }; + class GVAR(displayTextFontColor) { + value[] = {1,1,1,1}; + typeName = "COLOR"; + isClientSettable = 1; + displayName = "$STR_ACE_Common_SettingDisplayTextFontColorName"; + description = "$STR_ACE_Common_SettingDisplayTextFontColorDesc"; + }; +}; + +#include "define.hpp" +#include +#include +#include + +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}; + }; + }; + }; +}; + +/* +// check dll +class RscStandardDisplay; +class RscDisplayMain: RscStandardDisplay { + onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayMain"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_5('header','tail',{0},{},_this select 0)] call COMPILE_FILE(functions\fnc_errorMessage)); +}; +*/ + +class ACE_Extensions { + extensions[] = {}; +}; diff --git a/optionals/server/$NOBIN$ b/optionals/server/$NOBIN$ index e69de29bb2..c2037c2142 100644 --- a/optionals/server/$NOBIN$ +++ b/optionals/server/$NOBIN$ @@ -0,0 +1 @@ +NOBIN \ No newline at end of file diff --git a/server.md5 b/server.md5 new file mode 100644 index 0000000000..4b55677c68 --- /dev/null +++ b/server.md5 @@ -0,0 +1,2 @@ +9f932a56f6d56912c3ed64583086c699 *server\config.cpp +a0d9c8926a9c729e96bb6f5e83072526 *server\script_component.hpp diff --git a/server2.md5 b/server2.md5 new file mode 100644 index 0000000000..e5a17d9cc0 --- /dev/null +++ b/server2.md5 @@ -0,0 +1,3 @@ +d41d8cd98f00b204e9800998ecf8427e *server\$NOBIN$ +9f932a56f6d56912c3ed64583086c699 *server\config.cpp +a0d9c8926a9c729e96bb6f5e83072526 *server\script_component.hpp diff --git a/server3.md5 b/server3.md5 new file mode 100644 index 0000000000..8c7d3ace7c --- /dev/null +++ b/server3.md5 @@ -0,0 +1,3 @@ +76717b52157b1d55caa07359c789c148 *server\$NOBIN$ +9f932a56f6d56912c3ed64583086c699 *server\config.cpp +a0d9c8926a9c729e96bb6f5e83072526 *server\script_component.hpp diff --git a/tools/vm_build.py b/tools/vm_build.py new file mode 100644 index 0000000000..1d43c6ee30 --- /dev/null +++ b/tools/vm_build.py @@ -0,0 +1,6 @@ +import subprocess +try: + result = subprocess.call("python make.py checkexternal test") + print (result) +except: + raise \ No newline at end of file From 70e1310d28c10adf8ec0e6ac5cca5d609ced9463 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sat, 9 May 2015 11:29:42 -0700 Subject: [PATCH 040/172] Give builders a clue where to look to find what the cause for the error may be. #1051 --- tools/make.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/make.py b/tools/make.py index 3db62337a8..a3651b74a7 100644 --- a/tools/make.py +++ b/tools/make.py @@ -985,7 +985,7 @@ See the make.cfg file for additional build options. if not build_successful: print_error("pboProject return code == {}".format(str(ret))) - print_error("Module not successfully built/signed.") + print_error("Module not successfully built/signed. Check your {}temp\{}_packing.log for more info.".format(work_drive,module)) print ("Resuming build...") continue @@ -1057,7 +1057,7 @@ See the make.cfg file for additional build options. build_successful = True if not build_successful: - print_error("Module not successfully built.") + print_error("Module not successfully built. Check your {}temp\{}_packing.log for more info.".format(work_drive,module)) # Back to the root os.chdir(make_root) From 071f40eb2fff9d9bd094959cb9d3d94f01f3610a Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sat, 9 May 2015 12:13:03 -0700 Subject: [PATCH 041/172] Remove obsolete *.dll files #1038 --- tools/make.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tools/make.py b/tools/make.py index a3651b74a7..e90beb7703 100644 --- a/tools/make.py +++ b/tools/make.py @@ -661,6 +661,7 @@ See the make.cfg file for additional build options. module_root_parent = os.path.abspath(os.path.join(os.path.join(work_drive, prefix), os.pardir)) module_root = cfg.get(make_target, "module_root", fallback=os.path.join(make_root_parent, "addons")) optionals_root = os.path.join(module_root_parent, "optionals") + extensions_root = os.path.join(module_root_parent, "extensions") print_green ("module_root: {}".format(module_root)) if (os.path.isdir(module_root)): @@ -807,6 +808,18 @@ See the make.cfg file for additional build options. print_yellow("Removing obsolete file => {}".format(file)) purge(obsolete_check_path,fileName+"\..",fileName+".*") + obsolete_check_path = os.path.join(module_root, release_dir, project) + for file in os.listdir(obsolete_check_path): + if (file.endswith(".dll") and os.path.isfile(os.path.join(obsolete_check_path,file))): + if check_for_obsolete_pbos(extensions_root, file): + fileName = os.path.splitext(file)[0] + print_yellow("Removing obsolete file => {}".format(file)) + try: + os.remove(os.path.join(obsolete_check_path,file)) + except: + print_error("\nFailed to delete {}".format(os.path.join(obsolete_check_path,file))) + pass + # For each module, prep files and then build. print_blue("\nBuilding...") for module in modules: From f685ec2257f2eba28b9ea7e02b17d2cbebc0c22a Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 9 May 2015 20:24:39 +0100 Subject: [PATCH 042/172] added zeus changes module --- addons/zeus/$PBOPREFIX$ | 1 + addons/zeus/CfgEventHandlers.hpp | 6 + addons/zeus/XEH_preInit.sqf | 7 + addons/zeus/config.cpp | 22 ++ .../zeus/functions/fnc_bi_moduleCurator.sqf | 310 ++++++++++++++++++ addons/zeus/functions/script_component.hpp | 1 + addons/zeus/script_component.hpp | 12 + 7 files changed, 359 insertions(+) create mode 100644 addons/zeus/$PBOPREFIX$ create mode 100644 addons/zeus/CfgEventHandlers.hpp create mode 100644 addons/zeus/XEH_preInit.sqf create mode 100644 addons/zeus/config.cpp create mode 100644 addons/zeus/functions/fnc_bi_moduleCurator.sqf create mode 100644 addons/zeus/functions/script_component.hpp create mode 100644 addons/zeus/script_component.hpp diff --git a/addons/zeus/$PBOPREFIX$ b/addons/zeus/$PBOPREFIX$ new file mode 100644 index 0000000000..ae5a20d62d --- /dev/null +++ b/addons/zeus/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\zeus \ No newline at end of file diff --git a/addons/zeus/CfgEventHandlers.hpp b/addons/zeus/CfgEventHandlers.hpp new file mode 100644 index 0000000000..f0a9f14d91 --- /dev/null +++ b/addons/zeus/CfgEventHandlers.hpp @@ -0,0 +1,6 @@ + +class Extended_PreInit_EventHandlers { + class ADDON { + init = QUOTE(call COMPILE_FILE(XEH_preInit)); + }; +}; diff --git a/addons/zeus/XEH_preInit.sqf b/addons/zeus/XEH_preInit.sqf new file mode 100644 index 0000000000..2574706239 --- /dev/null +++ b/addons/zeus/XEH_preInit.sqf @@ -0,0 +1,7 @@ +#include "script_component.hpp" + +ADDON = false; + +PREP(bi_moduleCurator); + +ADDON = true; diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp new file mode 100644 index 0000000000..84d3077a96 --- /dev/null +++ b/addons/zeus/config.cpp @@ -0,0 +1,22 @@ +#include "script_component.hpp" + +class CfgPatches { + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_common"}; + author[] = {"SilentSpike"}; + authorUrl = "https://github.com/SilentSpike"; + VERSION_CONFIG; + }; +}; + +#include "CfgEventHandlers.hpp" + +class CfgVehicles { + class Module_F; + class ModuleCurator_F: Module_F { + function = QUOTE(FUNC(bi_moduleCurator)); + }; +}; \ No newline at end of file diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf new file mode 100644 index 0000000000..80f9be5bc1 --- /dev/null +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -0,0 +1,310 @@ +/* +* Author: Bohemia Interactive +* Module function for initalizing zeus +* Edited to remove eagle and global ascension message +* +* Arguments: +* 0: The logic object +* +* Return Value: +* nil +* +* Public: No +*/ + +#include "script_component.hpp" + +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if (_activated) then { + + //--- Terminate when not created on the server + if (!isserver && local _logic && isnull (getassignedcuratorunit _logic)) exitwith { + [format ["%1 is trying to create curator logic ModuleCurator_F",profilename],"bis_fnc_error",false] call bis_fnc_mp; + deletevehicle _logic; + }; + + //--- Get curator owner + _ownerVar = _logic getvariable ["owner",""]; + _ownerUID = parsenumber _ownerVar; + if (cheatsenabled) then { + _ownerVarArray = toarray _ownerVar; + _ownerVarArray resize 3; + if (tostring _ownerVarArray == "DEV") then {_ownerUID = 1;}; + }; + if (_ownerVar == "" && !ismultiplayer) then { + ["Curator owner not defined, player used instead in singleplayer."] call bis_fnc_error; + _ownerVar = player call bis_fnc_objectvar; + }; + if (_ownerUID > 0 && !ismultiplayer) then { + _ownerVar = player call bis_fnc_objectvar; + }; + _isAdmin = _ownerVar == "#adminLogged" || _ownerVar == "#adminVoted"; + + //--- Wipe out the variable so clients can't access it + _logic setvariable ["owner",nil]; + + //--- Server + if (isserver) then { + + //--- Prepare admin variable + _adminVar = ""; + if (_isAdmin) then { + _letters = ["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]; + _adminVar = "admin_"; + for "_i" from 0 to 9 do {_adminVar = _adminVar + (_letters call bis_fnc_selectrandom);}; + _logic setvariable ["adminVar",_adminVar,true]; + }; + + //--- Get allowed addons + _addonsType = _logic getvariable ["Addons",0]; + _addons = []; + switch _addonsType do { + + //--- All (including unofficial ones) + case 3: { + _cfgPatches = configfile >> "cfgpatches"; + for "_i" from 0 to (count _cfgPatches - 1) do { + _class = _cfgPatches select _i; + if (isclass _class) then {_addons set [count _addons,configname _class];}; + }; + _addons call bis_fnc_activateaddons; + removeallcuratoraddons _logic; + _logic addcuratoraddons _addons; + }; + + //--- All active + case 2: {}; + + //--- All mission + case 1: { + _addonsList = []; + { + _addonsList = _addonsList + (unitaddons typeof _x); + } foreach (entities "all"); + removeallcuratoraddons _logic; + _logic addcuratoraddons _addonsList; + }; + + //--- None + case 0: { + removeallcuratoraddons _logic; + }; + }; + + //--- Handle ownership + [_logic,_ownerVar,_ownerUID,_adminVar] spawn { + scriptname "BIS_fnc_moduleCurator: Owner"; + + _logic = _this select 0; + _ownerVar = _this select 1; + _ownerUID = _this select 2; + _adminVar = _this select 3; + + if (_adminVar != "") then {_ownerVar = _adminVar;}; + + _forced = _logic getvariable ["forced",0] > 0; + _name = _logic getvariable ["name",""]; + if (_name == "") then {_name = localize "STR_A3_curator";}; + + //--- Wait until mission starts + waituntil {time > 0}; + + //--- Refresh addon list, so it's broadcasted to clients + _addons = curatoraddons _logic; + removeAllCuratorAddons _logic; + _logic addcuratoraddons _addons; + + while {true} do { + //--- Wait for player to become Zeus + switch true do { + case (_ownerUID > 0): { + waituntil { + sleep 0.01; + {getplayeruid _x == _ownerVar} count playableunits > 0 + }; + }; + default { + waituntil {isplayer (missionnamespace getvariable [_ownerVar,objnull])}; + }; + }; + + //--- Assign + _player = objnull; + switch true do { + case (_ownerUID > 0): { + { + if (getplayeruid _x == _ownerVar) exitwith {_player = _x;}; + } foreach playableunits; + }; + default { + _player = missionnamespace getvariable [_ownerVar,objnull]; + }; + }; + + waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic)}; + waituntil {_player assignCurator _logic; getassignedcuratorunit _logic == _player}; + + //--- Add radio channels + { + _x radiochanneladd [_player]; + } foreach (_logic getvariable ["channels",[]]); + + [_logic,"curatorUnitAssigned",[_logic,_player]] call bis_fnc_callscriptedeventhandler; + + //--- Forced interface + //if (_forced) then { + // [[true,true],"bis_fnc_forceCuratorInterface",_player] call bis_fnc_mp; + //}; + + //--- Wait for player to stop being Zeus + switch true do { + case (_ownerUID > 0): { + waituntil { + sleep 0.01; + {getplayeruid _x == _ownerVar} count playableunits == 0 + }; + }; + default { + waituntil {_player != missionnamespace getvariable [_ownerVar,objnull]}; + }; + }; + + //--- Add radio channels + { + _x radiochannelremove [_player]; + } foreach (_logic getvariable ["channels",[]]); + + //--- Unassign + waituntil {unassigncurator _logic; isnull (getassignedcuratorunit _logic)}; + }; + }; + + //--- Activated all future addons + _addons = []; + { + if (typeof _x == "ModuleCuratorAddAddons_F") then { + _paramAddons = call compile ("[" + (_x getvariable ["addons",""]) + "]"); + { + if !(_x in _addons) then {_addons set [count _addons,_x];}; + { + if !(_x in _addons) then {_addons set [count _addons,_x];}; + } foreach (unitaddons _x); + } foreach _paramAddons; + }; + } foreach (synchronizedobjects _logic); + _addons call bis_fnc_activateaddons; + + //--- Locality changed + _logic addeventhandler [ + "local", + { + _logic = _this select 0; + _bird = _logic getvariable ["bird",objnull]; + _bird setowner owner _logic; + } + ]; + }; + + //--- Player + if (hasinterface) then { + waituntil {local player}; + _serverCommand = if (_ownerVar == "#adminLogged") then {"#shutdown"} else {"#kick"}; + + //--- Black effect until the interface is open + _forced = _logic getvariable ["forced",0] > 0; + if (_forced) then { + _isCurator = switch true do { + case (_ownerUID > 0): { + getplayeruid player == _ownerVar + }; + case (_isAdmin): { + isserver || servercommandavailable _serverCommand + }; + default { + player == missionnamespace getvariable [_ownerVar,objnull] + }; + }; + if (_isCurator) then { + [true,true] spawn bis_fnc_forceCuratorInterface; + ("RscDisplayCurator" call bis_fnc_rscLayer) cuttext ["","black in",1e10]; + }; + }; + + //--- Check if player is server admin + if (_isAdmin) then { + _adminVar = _logic getvariable ["adminVar",""]; + _logic setvariable ["adminVar",nil]; + if (isserver) then { + //--- Host + missionnamespace setvariable [_adminVar,player]; + } else { + //--- Client + [_logic,_adminVar,_serverCommand] spawn { + scriptname "BIS_fnc_moduleCurator: Admin check"; + + _logic = _this select 0; + _adminVar = _this select 1; + _serverCommand = _this select 2; + while {true} do { + waituntil {sleep 0.1; servercommandavailable _serverCommand}; + missionnamespace setvariable [_adminVar,player]; + publicvariable _adminVar; + _respawn = player addeventhandler ["respawn",format ["%1 = _this select 0; publicvariable '%1';",_adminVar]]; + + waituntil {sleep 0.1; !servercommandavailable _serverCommand}; + missionnamespace setvariable [_adminVar,objnull]; + publicvariable _adminVar; + player removeeventhandler ["respawn",_respawn]; + }; + }; + }; + }; + + [_logic] spawn { + _logic = _this select 0; + sleep 1; + waituntil {alive player}; + + //--- Show warning when Zeus key is not assigned + if (count (actionkeys "curatorInterface") == 0) then { + [ + format [ + localize "str_a3_cfgvehicles_modulecurator_f_keyNotAssigned", + (["IGUI","WARNING_RGB"] call bis_fnc_displaycolorget) call bis_fnc_colorRGBAtoHTML + ] + ] call bis_fnc_guiMessage; + }; + + //--- Show hint about pinging for players + if ( + isnil {profilenamespace getvariable "bis_fnc_curatorPinged_done"} + && + {isTutHintsEnabled} + && + {isnull getassignedcuratorlogic player} + && + {player in curatoreditableobjects _logic} + ) then { + sleep 0.5; + [["Curator","Ping"]] call bis_fnc_advHint; + }; + }; + + //--- Add local event handlers + _logic addeventhandler ["curatorFeedbackMessage",{_this call bis_fnc_showCuratorFeedbackMessage;}]; + _logic addeventhandler ["curatorPinged",{_this call bis_fnc_curatorPinged;}]; + _logic addeventhandler ["curatorObjectPlaced",{_this call bis_fnc_curatorObjectPlaced;}]; + _logic addeventhandler ["curatorObjectEdited",{_this call bis_fnc_curatorObjectEdited;}]; + _logic addeventhandler ["curatorWaypointPlaced",{_this call bis_fnc_curatorWaypointPlaced;}]; + + _logic addeventhandler ["curatorObjectDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addeventhandler ["curatorGroupDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addeventhandler ["curatorWaypointDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + _logic addeventhandler ["curatorMarkerDoubleClicked",{(_this select 1) call bis_fnc_showCuratorAttributes;}]; + + player call bis_fnc_curatorRespawn; + }; +}; diff --git a/addons/zeus/functions/script_component.hpp b/addons/zeus/functions/script_component.hpp new file mode 100644 index 0000000000..35453cc4e8 --- /dev/null +++ b/addons/zeus/functions/script_component.hpp @@ -0,0 +1 @@ +#include "\z\ace\addons\zeus\script_component.hpp" \ No newline at end of file diff --git a/addons/zeus/script_component.hpp b/addons/zeus/script_component.hpp new file mode 100644 index 0000000000..d5a4ec1bcc --- /dev/null +++ b/addons/zeus/script_component.hpp @@ -0,0 +1,12 @@ +#define COMPONENT zeus +#include "\z\ace\addons\main\script_mod.hpp" + +#ifdef DEBUG_ENABLED_ZEUS + #define DEBUG_MODE_FULL +#endif + +#ifdef DEBUG_SETTINGS_ZEUS + #define DEBUG_SETTINGS DEBUG_SETTINGS_ZEUS +#endif + +#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file From 079b8489cea079d5ef409e2182473a3823a0133b Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 9 May 2015 20:30:49 +0100 Subject: [PATCH 043/172] Missing spaces :wink: --- .../zeus/functions/fnc_bi_moduleCurator.sqf | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 80f9be5bc1..86f9bc781a 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -1,16 +1,16 @@ /* -* Author: Bohemia Interactive -* Module function for initalizing zeus -* Edited to remove eagle and global ascension message -* -* Arguments: -* 0: The logic object -* -* Return Value: -* nil -* -* Public: No -*/ + * Author: Bohemia Interactive + * Module function for initalizing zeus + * Edited to remove eagle and global ascension message + * + * Arguments: + * 0: The logic object + * + * Return Value: + * nil + * + * Public: No + */ #include "script_component.hpp" From 3544ee57f8fe91116e7acb2ebfcae184b3805660 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 9 May 2015 20:35:07 +0100 Subject: [PATCH 044/172] Added removed script within comments --- .../zeus/functions/fnc_bi_moduleCurator.sqf | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 86f9bc781a..36110ac4fe 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -152,6 +152,15 @@ if (_activated) then { _x radiochanneladd [_player]; } foreach (_logic getvariable ["channels",[]]); + /* Removed by ACE + //--- Sent notification to all assigned players + { + if (isplayer _x) then { + [["CuratorAssign",[_name,name _player]],"bis_fnc_showNotification",_x] call bis_fnc_mp; + }; + } foreach (curatoreditableobjects _logic); + */ + [_logic,"curatorUnitAssigned",[_logic,_player]] call bis_fnc_callscriptedeventhandler; //--- Forced interface @@ -182,6 +191,15 @@ if (_activated) then { }; }; + /* Removed by ACE + //--- Create bird + _birdType = _logic getvariable ["birdType","eagle_f"]; + if (_birdType != "") then { + _bird = createvehicle [_birdType,[100,100,100],[],0,"none"]; + _logic setvariable ["bird",_bird,true]; + }; + */ + //--- Activated all future addons _addons = []; { @@ -307,4 +325,4 @@ if (_activated) then { player call bis_fnc_curatorRespawn; }; -}; +}; \ No newline at end of file From 2e3e203d9f68a44699c96ca300ac52f4f5295b9d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 9 May 2015 14:41:46 -0500 Subject: [PATCH 045/172] #1081 - Fix binocular dupe binocs are weapons and items at the same time. need to properly drop binocs because stuff like deisgnator can have ammo --- addons/disarming/functions/fnc_disarmDropItems.sqf | 14 ++++++++++++-- addons/disarming/functions/fnc_getAllGearUnit.sqf | 2 +- .../disarming/functions/fnc_showItemsInListbox.sqf | 8 ++++---- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/addons/disarming/functions/fnc_disarmDropItems.sqf b/addons/disarming/functions/fnc_disarmDropItems.sqf index 2cb3e89b5d..cb5da77dd6 100644 --- a/addons/disarming/functions/fnc_disarmDropItems.sqf +++ b/addons/disarming/functions/fnc_disarmDropItems.sqf @@ -102,7 +102,7 @@ if (!([_targetMagazinesStart, _targetMagazinesEnd, _holderMagazinesStart, _holde //Remove Items, Assigned Items and NVG _holderItemsStart = getitemCargo _holder; -_targetItemsStart = (assignedItems _target) + (items _target); +_targetItemsStart = (assignedItems _target) + (items _target) - (weapons _target); if ((headgear _target) != "") then {_targetItemsStart pushBack (headgear _target);}; if ((goggles _target) != "") then {_targetItemsStart pushBack (goggles _target);}; @@ -132,7 +132,7 @@ _addToCrateCount = []; } forEach _addToCrateClassnames; _holderItemsEnd = getitemCargo _holder; -_targetItemsEnd = (assignedItems _target) + (items _target); +_targetItemsEnd = (assignedItems _target) + (items _target) - (weapons _target); if ((headgear _target) != "") then {_targetItemsEnd pushBack (headgear _target);}; if ((goggles _target) != "") then {_targetItemsEnd pushBack (goggles _target);}; @@ -146,6 +146,16 @@ if ((([_holderItemsEnd select 1] call _fncSumArray) - ([_holderItemsStart select [_caller, _target, "Debug: Items Not Added to Holder"] call FUNC(eventTargetFinish); }; +//Script drop uniforms/vest if empty +if (((uniform _target) != "") && {(uniform _target) in _listOfItemsToRemove} && {(uniformItems _target) isEqualTo []}) then { + _holder addItemCargoGlobal [(uniform _target), 1]; + removeUniform _target; +}; +if (((vest _target) != "") && {(vest _target) in _listOfItemsToRemove} && {(vestItems _target) isEqualTo []}) then { + _holder addItemCargoGlobal [(vest _target), 1]; + removeVest _target; +}; + //If holder is still empty, it will be 'garbage collected' while we wait for the drop 'action' to take place //So add a dummy item and just remove at the end diff --git a/addons/disarming/functions/fnc_getAllGearUnit.sqf b/addons/disarming/functions/fnc_getAllGearUnit.sqf index a319c006ee..99d4b2d7f2 100644 --- a/addons/disarming/functions/fnc_getAllGearUnit.sqf +++ b/addons/disarming/functions/fnc_getAllGearUnit.sqf @@ -19,7 +19,7 @@ PARAMS_1(_target); private ["_allItems", "_classnamesCount", "_index", "_uniqueClassnames"]; -_allItems = ((weapons _target) + (magazines _target) + (items _target) + (assignedItems _target)); +_allItems = (((items _target) + (assignedItems _target)) - (weapons _target)) + (weapons _target) + (magazines _target); if ((backpack _target) != "") then { _allItems pushBack (backpack _target); diff --git a/addons/disarming/functions/fnc_showItemsInListbox.sqf b/addons/disarming/functions/fnc_showItemsInListbox.sqf index 5c809de4a2..b36e53e820 100644 --- a/addons/disarming/functions/fnc_showItemsInListbox.sqf +++ b/addons/disarming/functions/fnc_showItemsInListbox.sqf @@ -28,7 +28,7 @@ private ["_classname", "_count", "_displayName", "_picture"]; _classname = _x; _count = (_itemsCountArray select 1) select _forEachIndex; - if (_classname != DUMMY_ITEM) then { //Don't show the dummy potato + if ((_classname != DUMMY_ITEM) && {_classname != "ACE_FakePrimaryWeapon"}) then { //Don't show the dummy potato or fake weapon switch (true) do { case (isClass (configFile >> "CfgWeapons" >> _classname)): { @@ -53,8 +53,8 @@ private ["_classname", "_count", "_displayName", "_picture"]; }; _listBoxCtrl lbAdd format ["%1", _displayName]; - _listBoxCtrl lbSetData [_forEachIndex, _classname]; - _listBoxCtrl lbSetPicture [_forEachIndex, _picture]; - _listBoxCtrl lbSetTextRight [_forEachIndex, str _count]; + _listBoxCtrl lbSetData [((lbSize _listBoxCtrl) - 1), _classname]; + _listBoxCtrl lbSetPicture [((lbSize _listBoxCtrl) - 1), _picture]; + _listBoxCtrl lbSetTextRight [((lbSize _listBoxCtrl) - 1), str _count]; }; } forEach (_itemsCountArray select 0); From 633e94a1141766c8947ac1ae5103a6bbed744305 Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 May 2015 22:14:00 +0200 Subject: [PATCH 046/172] CBA Macros to Interaction functions --- .../functions/fnc_addPassengerActions.sqf | 4 ++-- .../functions/fnc_addSelectableItem.sqf | 8 ++------ .../interaction/functions/fnc_canJoinGroup.sqf | 5 +---- addons/interaction/functions/fnc_canJoinTeam.sqf | 5 +---- .../interaction/functions/fnc_canTapShoulder.sqf | 5 +---- addons/interaction/functions/fnc_getDoor.sqf | 5 +++-- .../functions/fnc_getDoorAnimations.sqf | 5 ++--- addons/interaction/functions/fnc_getDown.sqf | 6 +++--- .../interaction/functions/fnc_getWeaponPos.sqf | 2 +- addons/interaction/functions/fnc_isInRange.sqf | 5 ++--- addons/interaction/functions/fnc_joinTeam.sqf | 5 ++--- .../functions/fnc_moduleInteraction.sqf | 2 ++ addons/interaction/functions/fnc_moveDown.sqf | 2 ++ addons/interaction/functions/fnc_onButtonUp.sqf | 4 +--- addons/interaction/functions/fnc_onClick.sqf | 3 +-- addons/interaction/functions/fnc_openDoor.sqf | 8 +++----- .../functions/fnc_openMenuSelectUI.sqf | 16 +++++++--------- .../interaction/functions/fnc_openSelectMenu.sqf | 9 ++++++--- .../functions/fnc_prepareSelectMenu.sqf | 7 ++++--- addons/interaction/functions/fnc_push.sqf | 3 +-- addons/interaction/functions/fnc_removeTag.sqf | 2 ++ addons/interaction/functions/fnc_sendAway.sqf | 4 ++-- .../interaction/functions/fnc_showMouseHint.sqf | 12 ++++++------ addons/interaction/functions/fnc_tapShoulder.sqf | 2 +- .../functions/fnc_updateTooltipPosition.sqf | 8 +++++--- 25 files changed, 63 insertions(+), 74 deletions(-) diff --git a/addons/interaction/functions/fnc_addPassengerActions.sqf b/addons/interaction/functions/fnc_addPassengerActions.sqf index 4474378bcc..914edeed28 100644 --- a/addons/interaction/functions/fnc_addPassengerActions.sqf +++ b/addons/interaction/functions/fnc_addPassengerActions.sqf @@ -18,9 +18,9 @@ #include "script_component.hpp" EXPLODE_3_PVT(_this,_vehicle,_player,_parameters); +EXPLODE_1_PVT(_parameters,_unit); -private ["_unit","_actions"]; -_unit = _parameters select 0; +private ["_varName", "_actionTrees", "_actions"]; _varName = format [QEGVAR(interact_menu,Act_%1), typeOf _unit]; _actionTrees = missionNamespace getVariable [_varName, []]; diff --git a/addons/interaction/functions/fnc_addSelectableItem.sqf b/addons/interaction/functions/fnc_addSelectableItem.sqf index 6f1339d25a..4875ba2c97 100644 --- a/addons/interaction/functions/fnc_addSelectableItem.sqf +++ b/addons/interaction/functions/fnc_addSelectableItem.sqf @@ -18,17 +18,13 @@ */ #include "script_component.hpp" -private ["_container", "_displayName", "_picture", "_data", "_index"]; - -_container = _this select 0; -_displayName = _this select 1; -_picture = _this select 2; -_data = _this select 3; +PARAMS_4(_container,_displayName,_picture,_data); if (_picture == "" || _picture == "PictureThing") then { _picture = QUOTE(PATHTOF(UI\dot_ca.paa)); }; +private ["_index"]; _index = lbAdd [_container, _displayName]; lbSetData [_container, _index, str _data]; lbSetPicture [_container, _index, _picture]; diff --git a/addons/interaction/functions/fnc_canJoinGroup.sqf b/addons/interaction/functions/fnc_canJoinGroup.sqf index 26597ca0a0..33b4623c4c 100644 --- a/addons/interaction/functions/fnc_canJoinGroup.sqf +++ b/addons/interaction/functions/fnc_canJoinGroup.sqf @@ -16,10 +16,7 @@ */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +PARAMS_2(_unit,_target); alive _target && {!(_target getVariable ["ACE_isUnconscious", false])} diff --git a/addons/interaction/functions/fnc_canJoinTeam.sqf b/addons/interaction/functions/fnc_canJoinTeam.sqf index 4312981978..ba894c7a13 100644 --- a/addons/interaction/functions/fnc_canJoinTeam.sqf +++ b/addons/interaction/functions/fnc_canJoinTeam.sqf @@ -16,10 +16,7 @@ */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +PARAMS_2(_unit,_target); alive _target && {!(_target getVariable ["ACE_isUnconscious", false])} diff --git a/addons/interaction/functions/fnc_canTapShoulder.sqf b/addons/interaction/functions/fnc_canTapShoulder.sqf index 2be9bf70a9..1b48d3280d 100644 --- a/addons/interaction/functions/fnc_canTapShoulder.sqf +++ b/addons/interaction/functions/fnc_canTapShoulder.sqf @@ -16,10 +16,7 @@ */ #include "script_component.hpp" -private ["_unit", "_target"]; - -_unit = _this select 0; -_target = _this select 1; +PARAMS_2(_unit,_target); _target isKindOf "CAManBase" && {alive _target} && diff --git a/addons/interaction/functions/fnc_getDoor.sqf b/addons/interaction/functions/fnc_getDoor.sqf index 460a325954..fdf1447828 100644 --- a/addons/interaction/functions/fnc_getDoor.sqf +++ b/addons/interaction/functions/fnc_getDoor.sqf @@ -17,9 +17,9 @@ */ #include "script_component.hpp" -private ["_distance", "_position0", "_position1", "_intersections", "_count", "_house", "_door", "_index", "_id"]; +PARAMS_1(_distance); -_distance = _this select 0; +private ["_position0", "_position1", "_intersections", "_count", "_house", "_door"]; _position0 = positionCameraToWorld [0, 0, 0]; _position1 = positionCameraToWorld [0, 0, _distance]; @@ -38,4 +38,5 @@ _intersections = [_house, "GEOM"] intersect [_position0, _position1]; _door = _intersections select 0 select 0; if (isNil "_door") exitWith {[_house, ""]}; + [_house, _door] diff --git a/addons/interaction/functions/fnc_getDoorAnimations.sqf b/addons/interaction/functions/fnc_getDoorAnimations.sqf index cb0b7122b0..6f85ef644b 100644 --- a/addons/interaction/functions/fnc_getDoorAnimations.sqf +++ b/addons/interaction/functions/fnc_getDoorAnimations.sqf @@ -18,10 +18,9 @@ */ #include "script_component.hpp" -private ["_house", "_door", "_animations", "_lockedVariable"]; +PARAMS_2(_house,_door); -_house = _this select 0; -_door = _this select 1; +private ["_index", "_animations", "_lockedVariable"]; _index = [ "door_1", diff --git a/addons/interaction/functions/fnc_getDown.sqf b/addons/interaction/functions/fnc_getDown.sqf index 9e7daecb46..09d651eadf 100644 --- a/addons/interaction/functions/fnc_getDown.sqf +++ b/addons/interaction/functions/fnc_getDown.sqf @@ -17,9 +17,9 @@ #define RADIUS 10 -private ["_unit", "_chance", "_x"]; +PARAMS_1(_unit); -_unit = _this select 0; +private ["_chance", "_x"]; ACE_player playActionNow "GestureGo"; // put something else here. @@ -35,4 +35,4 @@ if (count (weapons ACE_player) > 0) then { _this setUnitPos "DOWN"; }, _x] call CBA_fnc_globalExecute; }; -} foreach (_unit nearEntities ["Civilian", RADIUS]); +} forEach (_unit nearEntities ["Civilian", RADIUS]); diff --git a/addons/interaction/functions/fnc_getWeaponPos.sqf b/addons/interaction/functions/fnc_getWeaponPos.sqf index 35ea202b1d..1e3c8b32ec 100644 --- a/addons/interaction/functions/fnc_getWeaponPos.sqf +++ b/addons/interaction/functions/fnc_getWeaponPos.sqf @@ -16,7 +16,7 @@ #include "script_component.hpp" // IGNORE_PRIVATE_WARNING(_target); -private ["_weaponDir","_refSystem"]; +private ["_weaponDir", "_refSystem"]; _weaponDir = _target weaponDirection currentWeapon _target; _refSystem = _weaponDir call EFUNC(common,createOrthonormalReference); diff --git a/addons/interaction/functions/fnc_isInRange.sqf b/addons/interaction/functions/fnc_isInRange.sqf index 05677d7060..490ddf05e5 100644 --- a/addons/interaction/functions/fnc_isInRange.sqf +++ b/addons/interaction/functions/fnc_isInRange.sqf @@ -16,10 +16,9 @@ */ #include "script_component.hpp" -private ["_vehicle", "_distance", "_player"]; +PARAMS_2(_vehicle,_distance); -_vehicle = _this select 0; -_distance = _this select 1; +private ["_player", "_position0", "_position1"]; _player = ACE_player; diff --git a/addons/interaction/functions/fnc_joinTeam.sqf b/addons/interaction/functions/fnc_joinTeam.sqf index cf6889d90a..cd2ea8c880 100644 --- a/addons/interaction/functions/fnc_joinTeam.sqf +++ b/addons/interaction/functions/fnc_joinTeam.sqf @@ -16,10 +16,9 @@ */ #include "script_component.hpp" -private ["_unit", "_team", "_message"]; +PARAMS_2(_unit,_team); -_unit = _this select 0; -_team = _this select 1; +private ["_message"]; _unit setVariable [QGVAR(assignedFireTeam), _team, true]; [_unit, format ["{_this assignTeam '%1'}", _team]] call EFUNC(common,execRemoteFnc); diff --git a/addons/interaction/functions/fnc_moduleInteraction.sqf b/addons/interaction/functions/fnc_moduleInteraction.sqf index 925847c028..bd02093aa0 100644 --- a/addons/interaction/functions/fnc_moduleInteraction.sqf +++ b/addons/interaction/functions/fnc_moduleInteraction.sqf @@ -17,6 +17,8 @@ */ #include "script_component.hpp" +private ["_logic", "_activated"]; + _logic = _this select 0; _activated = _this select 2; diff --git a/addons/interaction/functions/fnc_moveDown.sqf b/addons/interaction/functions/fnc_moveDown.sqf index eb946a5f10..f2e675b256 100644 --- a/addons/interaction/functions/fnc_moveDown.sqf +++ b/addons/interaction/functions/fnc_moveDown.sqf @@ -15,6 +15,8 @@ */ #include "script_component.hpp" +private ["_count", "_player", "_vehicle", "_dlgInteractionDialog", "_top", "_i", "", "_ctrl", "_index", "_action", "_color", "_current", "_infoText"]; + #define CLAMP(x,low,high) (if(x > high)then{high}else{if(x < low)then{low}else{x}}) if (isNil QGVAR(MainButton)) exitWith{}; if (isNil QGVAR(Buttons)) exitWith{}; diff --git a/addons/interaction/functions/fnc_onButtonUp.sqf b/addons/interaction/functions/fnc_onButtonUp.sqf index 151ce67c98..da1b55b613 100644 --- a/addons/interaction/functions/fnc_onButtonUp.sqf +++ b/addons/interaction/functions/fnc_onButtonUp.sqf @@ -15,7 +15,7 @@ */ #include "script_component.hpp" -private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; +private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_statement", "_condition", "_conditionShow", "_distance"]; _player = ACE_player; _vehicle = vehicle _player; @@ -34,11 +34,9 @@ _action = if (_index != -1 && {_index < _count}) then { closeDialog 0; - _statement = _action select 1; _condition = _action select 2; _conditionShow = _action select 7; -_exceptions = _action select 8;// _distance = _action select 9; if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { diff --git a/addons/interaction/functions/fnc_onClick.sqf b/addons/interaction/functions/fnc_onClick.sqf index 6f9882281f..a240823710 100644 --- a/addons/interaction/functions/fnc_onClick.sqf +++ b/addons/interaction/functions/fnc_onClick.sqf @@ -14,7 +14,7 @@ * Public: No */ #include "script_component.hpp" -private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_exceptions", "_distance"]; +private ["_player", "_vehicle", "_target", "_count", "_index", "_action", "_subMenu", "_statement", "_condition", "_conditionShow", "_distance"]; _player = ACE_player; _vehicle = vehicle _player; @@ -43,7 +43,6 @@ if (count _subMenu < 2) then { _statement = _action select 1; _condition = _action select 2; _conditionShow = _action select 7; - _exceptions = _action select 8;// _distance = _action select 9; if ((_distance == 0 || {[GVAR(Target), _distance] call FUNC(isInRange)}) && {[_target, _player] call _condition} && {[_target, _player] call _conditionShow}) then { diff --git a/addons/interaction/functions/fnc_openDoor.sqf b/addons/interaction/functions/fnc_openDoor.sqf index 3e776f3538..6b34c49ca9 100644 --- a/addons/interaction/functions/fnc_openDoor.sqf +++ b/addons/interaction/functions/fnc_openDoor.sqf @@ -16,19 +16,17 @@ */ #include "script_component.hpp" -private ["_info", "_house", "_door", "_animations", "_lockedVariable"]; +private ["_info", "_animations", "_phase", "_position", "_time", "_usedMouseWheel"]; _info = [2] call FUNC(getDoor); -_house = _info select 0; -_door = _info select 1; +EXPLODE_2_PVT(_info,_house,_door); if (isNull _house) exitWith {}; _animations = [_house, _door] call FUNC(getDoorAnimations); -_lockedVariable = _animations select 1; -_animations = _animations select 0; +EXPLODE_2_PVT(_animations,_animations,_lockedVariable); if (count _animations == 0) exitWith {}; diff --git a/addons/interaction/functions/fnc_openMenuSelectUI.sqf b/addons/interaction/functions/fnc_openMenuSelectUI.sqf index e755869ed1..e1b6a30df1 100644 --- a/addons/interaction/functions/fnc_openMenuSelectUI.sqf +++ b/addons/interaction/functions/fnc_openMenuSelectUI.sqf @@ -16,24 +16,22 @@ */ #include "script_component.hpp" -private ["_unit", "_vehicle", "_cargo"]; +PARAMS_2(_unit,_vehicle); -_unit = _this select 0; -_vehicle = _this select 1; +private ["_cargo", "_actions"]; -// allow interaction with all cargo slots and all ffv slots +// Allow interaction with all cargo slots and all FFV slots _cargo = [_vehicle, ["cargo", "ffv"], true] call EFUNC(common,getVehicleCrew); -// you can only interact if you are in cargo or ffv yourself. exit otherwise +// You can only interact if you are in cargo or FFV yourself. exit otherwise if !(_unit in _cargo) exitWith {}; GVAR(InteractionMenu_Crew) = _cargo; -// prepare: add header and "OK" button to select menu -private "_actions"; +// Prepare: add header and "OK" button to select menu _actions = [localize "STR_ACE_Interaction_InteractionMenu", localize "STR_ACE_Interaction_Interact"] call FUNC(prepareSelectMenu); -// prepare: add all cargo units as options to select menu +// Prepare: add all cargo units as options to select menu { if (_x != _unit) then { _actions = [ @@ -45,7 +43,7 @@ _actions = [localize "STR_ACE_Interaction_InteractionMenu", localize "STR_ACE_In }; } forEach _cargo; -// open select menu +// Open select menu [ _actions, { diff --git a/addons/interaction/functions/fnc_openSelectMenu.sqf b/addons/interaction/functions/fnc_openSelectMenu.sqf index 13e02fb044..a12ceefa6c 100644 --- a/addons/interaction/functions/fnc_openSelectMenu.sqf +++ b/addons/interaction/functions/fnc_openSelectMenu.sqf @@ -27,11 +27,14 @@ if (!(profileNamespace getVariable [QGVAR(FlowMenu), false])) then { GVAR(SelectAccept) = _this select 1; GVAR(SelectCancel) = _this select 2; - buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // cancel - buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // accept + buttonSetAction [8855, QUOTE( call GVAR(SelectCancel); )]; // Cancel + buttonSetAction [8860, QUOTE( (call compile (lbData [ARR_2(8866, lbCurSel 8866)])) call GVAR(SelectAccept); )]; // Accept lbSetCurSel [8866, 0]; }else{ - _customActions = _this select 0; + PARAMS_1(_customActions); + + private ["_count", "_action"]; + _count = count _customActions; if (_count == 0) exitWith {}; _customActions call FUNC(sortOptionsByPriority); diff --git a/addons/interaction/functions/fnc_prepareSelectMenu.sqf b/addons/interaction/functions/fnc_prepareSelectMenu.sqf index f43ec75c4e..05b1bc8e35 100644 --- a/addons/interaction/functions/fnc_prepareSelectMenu.sqf +++ b/addons/interaction/functions/fnc_prepareSelectMenu.sqf @@ -16,13 +16,14 @@ */ #include "script_component.hpp" -private ["_buttonAction", "_header", "_buttonText", "_cancelButton"]; +PARAMS_2(_header,_buttonText); + closeDialog 0; -_header = _this select 0; -_buttonText = _this select 1; + if (isNil "_buttonText" or {_buttonText == ""}) then { _buttonText = localize "STR_ACE_Interaction_MakeSelection"; }; + createDialog "RscACE_SelectAnItem"; ctrlSetText [8860, _buttonText]; ctrlSetText [8870, _header]; diff --git a/addons/interaction/functions/fnc_push.sqf b/addons/interaction/functions/fnc_push.sqf index 580f687f64..946a5118be 100644 --- a/addons/interaction/functions/fnc_push.sqf +++ b/addons/interaction/functions/fnc_push.sqf @@ -17,8 +17,7 @@ #include "script_component.hpp" -_boat = _this select 0; -_velocity = _this select 1; +PARAMS_2(_boat,_velocity); if !(local _boat) exitWith { [_this, QUOTE(FUNC(push)), _boat] call EFUNC(common,execRemoteFnc); diff --git a/addons/interaction/functions/fnc_removeTag.sqf b/addons/interaction/functions/fnc_removeTag.sqf index d1a16bf88b..b017c203b2 100644 --- a/addons/interaction/functions/fnc_removeTag.sqf +++ b/addons/interaction/functions/fnc_removeTag.sqf @@ -16,6 +16,8 @@ #include "script_component.hpp" 0 spawn { + private ["_index"]; + waitUntil {player getVariable ["ACE_Name", ""] != ""}; _name = player getVariable ["ACE_Name", ""]; diff --git a/addons/interaction/functions/fnc_sendAway.sqf b/addons/interaction/functions/fnc_sendAway.sqf index 1a48725644..0dd106de08 100644 --- a/addons/interaction/functions/fnc_sendAway.sqf +++ b/addons/interaction/functions/fnc_sendAway.sqf @@ -18,9 +18,9 @@ #define DISTANCE 50 #define RADIUS 10 -private ["_unit", "_chance", "_x"]; +PARAMS_1(_unit); -_unit = _this select 0; +private ["_chance", "_x"]; ACE_player playActionNow "GestureGo"; diff --git a/addons/interaction/functions/fnc_showMouseHint.sqf b/addons/interaction/functions/fnc_showMouseHint.sqf index a64114d009..e3a9b45f94 100644 --- a/addons/interaction/functions/fnc_showMouseHint.sqf +++ b/addons/interaction/functions/fnc_showMouseHint.sqf @@ -19,9 +19,10 @@ #define GUI_GRID_W (0.025) #define GUI_GRID_H (0.04) -private ["_leftClick", "_rightClick", "_scroll"]; -_leftClick = _this select 0; -_rightClick = _this select 1; + +private ["_scroll", "_display"]; + +PARAMS_2(_leftClick,_rightClick); _scroll = ""; if (count _this > 2) then { _scroll = _this select 2; @@ -43,9 +44,8 @@ if (isNull _display) exitWith{}; if (_scroll == "") exitWith { (_display displayCtrl 1002) ctrlShow false; (_display displayCtrl 1202) ctrlShow false; - - (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H]; - (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H]; + (_display displayCtrl 1001) ctrlSetPosition [21 * GUI_GRID_W, 18 * GUI_GRID_H, 8 * GUI_GRID_W, 1.5 * GUI_GRID_H]; + (_display displayCtrl 1201) ctrlSetPosition [20 * GUI_GRID_W, 18.5 * GUI_GRID_H, 1 * GUI_GRID_W, 1 * GUI_GRID_H]; (_display displayCtrl 1001) ctrlCommit 0; (_display displayCtrl 1201) ctrlCommit 0; }; diff --git a/addons/interaction/functions/fnc_tapShoulder.sqf b/addons/interaction/functions/fnc_tapShoulder.sqf index f18c9c2c30..510fa4497f 100644 --- a/addons/interaction/functions/fnc_tapShoulder.sqf +++ b/addons/interaction/functions/fnc_tapShoulder.sqf @@ -28,7 +28,7 @@ if (_target != ACE_player) exitWith { addCamShake [4, 0.5, 5]; -private "_message"; +private ["_message"]; //localize is converting the escaped <> symbols, so just add them here instead of in the stringtable if (_shoulderNum == 0) then { _message = format ["%1 >", (localize "STR_ACE_Interaction_YouWereTappedRight")]; diff --git a/addons/interaction/functions/fnc_updateTooltipPosition.sqf b/addons/interaction/functions/fnc_updateTooltipPosition.sqf index c194102b41..27eb36e976 100644 --- a/addons/interaction/functions/fnc_updateTooltipPosition.sqf +++ b/addons/interaction/functions/fnc_updateTooltipPosition.sqf @@ -17,12 +17,14 @@ */ #include "script_component.hpp" +PARAMS_3(_tooltip,_coordinateX,_coordinateY); + disableSerialization; -_ctrl = ctrlParent (_this select 0) displayCtrl 40; +_ctrl = ctrlParent _tooltip displayCtrl 40; _ctrl ctrlSetPosition [ - (_this select 1) + 0.01 * safezoneW, - (_this select 2) + 0.01 * safezoneH, + _coordinateX + 0.01 * safezoneW, + _coordinateY + 0.01 * safezoneH, 2.0 / 16 * safezoneW, 0.3 / 9 * safezoneH ]; From 1a2e7d0596e0fb2bf7746839882d52aa6f10ed3a Mon Sep 17 00:00:00 2001 From: jonpas Date: Sat, 9 May 2015 22:25:48 +0200 Subject: [PATCH 047/172] Tabs to Spaces, Removed unused GUI class --- addons/interaction/CfgVehicles.hpp | 1084 ++++++++++++++-------------- addons/interaction/Menu_Config.hpp | 324 +++++---- addons/interaction/README.md | 1 - addons/interaction/config.cpp | 30 +- 4 files changed, 716 insertions(+), 723 deletions(-) diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 5548311718..5afaf21c28 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -1,566 +1,564 @@ class CfgVehicles { - - class Module_F; - class ACE_ModuleInteraction: Module_F { - author = "$STR_ACE_Common_ACETeam"; - category = "ACE"; - displayName = "Interaction System"; - function = "ACE_Interaction_fnc_moduleInteraction"; - scope = 2; - isGlobal = 1; - icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa); - class Arguments { - class EnableTeamManagement { - displayName = "Enable Team Management"; - description = "Should players be allowed to use the Team Management Menu? Default: Yes"; - typeName = "BOOL"; - class values { - class Yes { default = 1; name = "Yes"; value = 1;}; - class No { name = "No"; value = 0; }; + class Module_F; + class ACE_ModuleInteraction: Module_F { + author = "$STR_ACE_Common_ACETeam"; + category = "ACE"; + displayName = "Interaction System"; + function = "ACE_Interaction_fnc_moduleInteraction"; + scope = 2; + isGlobal = 1; + icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa); + class Arguments { + class EnableTeamManagement { + displayName = "Enable Team Management"; + description = "Should players be allowed to use the Team Management Menu? Default: Yes"; + typeName = "BOOL"; + class values { + class Yes { default = 1; name = "Yes"; value = 1;}; + class No { name = "No"; value = 0; }; + }; + }; }; - }; - }; - }; - - class Man; - class CAManBase: Man { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - distance = 4; - condition = QUOTE(true); - statement = ""; - icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; - selection = "pelvis"; - - class ACE_TeamManagement { - displayName = "$STR_ACE_Interaction_TeamManagement"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {GVAR(EnableTeamManagement)}); - statement = ""; - showDisabled = 0; - priority = 3.2; - icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "M"; - - class ACE_AssignTeamRed { - displayName = "$STR_ACE_Interaction_AssignTeamRed"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); - statement = QUOTE([ARR_2(_target,'RED')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_red_ca.paa); - priority = 2.4; - hotkey = "R"; - }; - class ACE_AssignTeamGreen { - displayName = "$STR_ACE_Interaction_AssignTeamGreen"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); - statement = QUOTE([ARR_2(_target,'GREEN')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_green_ca.paa); - priority = 2.3; - hotkey = "G"; - }; - class ACE_AssignTeamBlue { - displayName = "$STR_ACE_Interaction_AssignTeamBlue"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); - statement = QUOTE([ARR_2(_target,'BLUE')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_blue_ca.paa); - priority = 2.2; - hotkey = "B"; - }; - class ACE_AssignTeamYellow { - displayName = "$STR_ACE_Interaction_AssignTeamYellow"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); - statement = QUOTE([ARR_2(_target,'YELLOW')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_yellow_ca.paa); - priority = 2.1; - hotkey = "Y"; - }; - - class ACE_UnassignTeam { - displayName = "$STR_ACE_Interaction_LeaveTeam"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'}); - statement = QUOTE([ARR_2(_target,'MAIN')] call DFUNC(joinTeam)); - showDisabled = 1; - icon = PATHTOF(UI\team\team_white_ca.paa); - priority = 2.5; - hotkey = "N"; - }; - }; - - class ACE_JoinGroup { - displayName = "$STR_ACE_Interaction_JoinGroup"; - condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinGroup)); - statement = QUOTE([_player] joinSilent group _target); - showDisabled = 0; - priority = 2.6; - icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "J"; - }; - - class ACE_GetDown { - displayName = "$STR_ACE_Interaction_GetDown"; - condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); - statement = QUOTE([_target] call DFUNC(getDown)); - showDisabled = 0; - priority = 2.2; - }; - class ACE_SendAway { - displayName = "$STR_ACE_Interaction_SendAway"; - condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); - statement = QUOTE([_target] call DFUNC(sendAway)); - showDisabled = 0; - priority = 2.0; - }; - class ACE_Pardon { - displayName = "$STR_ACE_Interaction_Pardon"; - condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target}); - statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc)); - showDisabled = 0; - priority = 2.5; - }; - }; - class ACE_Torso { - displayName = "$STR_ACE_Interaction_Torso"; - selection = "spine3"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_Head { - displayName = "$STR_ACE_Interaction_Head"; - selection = "pilot"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_ArmLeft { - displayName = "$STR_ACE_Interaction_ArmLeft"; - selection = "LeftForeArm"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_ArmRight { - displayName = "$STR_ACE_Interaction_ArmRight"; - selection = "RightForeArm"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_LegLeft { - displayName = "$STR_ACE_Interaction_LegLeft"; - selection = "LKnee"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_LegRight { - displayName = "$STR_ACE_Interaction_LegRight"; - selection = "RKnee"; - distance = 1.50; - condition = ""; - statement = ""; - }; - class ACE_Weapon { - displayName = "$STR_ACE_Interaction_Weapon"; - position = QUOTE(call FUNC(getWeaponPos)); - distance = 1.50; - condition = ""; - statement = ""; - }; - - class ACE_TapShoulderRight { - displayName = "$STR_ACE_Interaction_TapShoulder"; - selection = "rightshoulder"; - distance = 2.0; - condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); - statement = QUOTE([ARR_3(_player, _target, 0)] call DFUNC(tapShoulder)); - }; - 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)); - }; }; - class ACE_SelfActions { - class ACE_TeamManagement { - displayName = "$STR_ACE_Interaction_TeamManagement"; - condition = QUOTE(GVAR(EnableTeamManagement)); - exceptions[] = {"isNotInside"}; - statement = ""; - showDisabled = 1; - priority = 3.2; - icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "M"; + class Man; + class CAManBase: Man { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + distance = 4; + condition = QUOTE(true); + statement = ""; + icon = "\a3\ui_f\data\IGUI\Cfg\Actions\eject_ca.paa"; + selection = "pelvis"; - class ACE_JoinTeamRed { - displayName = "$STR_ACE_Interaction_JoinTeamRed"; - condition = QUOTE(true); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'RED')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.4; - icon = PATHTOF(UI\team\team_red_ca.paa); - hotkey = "R"; - }; - class ACE_JoinTeamGreen { - displayName = "$STR_ACE_Interaction_JoinTeamGreen"; - condition = QUOTE(true); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'GREEN')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.3; - icon = PATHTOF(UI\team\team_green_ca.paa); - hotkey = "G"; - }; - class ACE_JoinTeamBlue { - displayName = "$STR_ACE_Interaction_JoinTeamBlue"; - condition = QUOTE(true); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'BLUE')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.2; - icon = PATHTOF(UI\team\team_blue_ca.paa); - hotkey = "B"; - }; - class ACE_JoinTeamYellow { - displayName = "$STR_ACE_Interaction_JoinTeamYellow"; - condition = QUOTE(true); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'YELLOW')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.1; - icon = PATHTOF(UI\team\team_yellow_ca.paa); - hotkey = "Y"; + class ACE_TeamManagement { + displayName = "$STR_ACE_Interaction_TeamManagement"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {GVAR(EnableTeamManagement)}); + statement = ""; + showDisabled = 0; + priority = 3.2; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "M"; + + class ACE_AssignTeamRed { + displayName = "$STR_ACE_Interaction_AssignTeamRed"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + statement = QUOTE([ARR_2(_target,'RED')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_red_ca.paa); + priority = 2.4; + hotkey = "R"; + }; + class ACE_AssignTeamGreen { + displayName = "$STR_ACE_Interaction_AssignTeamGreen"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + statement = QUOTE([ARR_2(_target,'GREEN')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_green_ca.paa); + priority = 2.3; + hotkey = "G"; + }; + class ACE_AssignTeamBlue { + displayName = "$STR_ACE_Interaction_AssignTeamBlue"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + statement = QUOTE([ARR_2(_target,'BLUE')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_blue_ca.paa); + priority = 2.2; + hotkey = "B"; + }; + class ACE_AssignTeamYellow { + displayName = "$STR_ACE_Interaction_AssignTeamYellow"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam)); + statement = QUOTE([ARR_2(_target,'YELLOW')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_yellow_ca.paa); + priority = 2.1; + hotkey = "Y"; + }; + + class ACE_UnassignTeam { + displayName = "$STR_ACE_Interaction_LeaveTeam"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinTeam) && {assignedTeam _target != 'MAIN'}); + statement = QUOTE([ARR_2(_target,'MAIN')] call DFUNC(joinTeam)); + showDisabled = 1; + icon = PATHTOF(UI\team\team_white_ca.paa); + priority = 2.5; + hotkey = "N"; + }; + }; + + class ACE_JoinGroup { + displayName = "$STR_ACE_Interaction_JoinGroup"; + condition = QUOTE([ARR_2(_player,_target)] call DFUNC(canJoinGroup)); + statement = QUOTE([_player] joinSilent group _target); + showDisabled = 0; + priority = 2.6; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "J"; + }; + + class ACE_GetDown { + displayName = "$STR_ACE_Interaction_GetDown"; + condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); + statement = QUOTE([_target] call DFUNC(getDown)); + showDisabled = 0; + priority = 2.2; + }; + class ACE_SendAway { + displayName = "$STR_ACE_Interaction_SendAway"; + condition = QUOTE([_target] call DFUNC(canInteractWithCivilian)); + statement = QUOTE([_target] call DFUNC(sendAway)); + showDisabled = 0; + priority = 2.0; + }; + class ACE_Pardon { + displayName = "$STR_ACE_Interaction_Pardon"; + condition = QUOTE(rating _target < -2000 && {alive _target} && {side group _player == side group _target}); + statement = QUOTE([ARR_3(_target,'{_this addRating -rating _this}',_target)] call DEFUNC(common,execRemoteFnc)); + showDisabled = 0; + priority = 2.5; + }; + }; + class ACE_Torso { + displayName = "$STR_ACE_Interaction_Torso"; + selection = "spine3"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_Head { + displayName = "$STR_ACE_Interaction_Head"; + selection = "pilot"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_ArmLeft { + displayName = "$STR_ACE_Interaction_ArmLeft"; + selection = "LeftForeArm"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_ArmRight { + displayName = "$STR_ACE_Interaction_ArmRight"; + selection = "RightForeArm"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_LegLeft { + displayName = "$STR_ACE_Interaction_LegLeft"; + selection = "LKnee"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_LegRight { + displayName = "$STR_ACE_Interaction_LegRight"; + selection = "RKnee"; + distance = 1.50; + condition = ""; + statement = ""; + }; + class ACE_Weapon { + displayName = "$STR_ACE_Interaction_Weapon"; + position = QUOTE(call FUNC(getWeaponPos)); + distance = 1.50; + condition = ""; + statement = ""; + }; + + class ACE_TapShoulderRight { + displayName = "$STR_ACE_Interaction_TapShoulder"; + selection = "rightshoulder"; + distance = 2.0; + condition = QUOTE([ARR_2(_player, _target)] call DFUNC(canTapShoulder)); + statement = QUOTE([ARR_3(_player, _target, 0)] call DFUNC(tapShoulder)); + }; + 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)); + }; }; - class ACE_LeaveTeam { - displayName = "$STR_ACE_Interaction_LeaveTeam"; - condition = QUOTE(assignedTeam _player != 'MAIN'); - exceptions[] = {"isNotInside"}; - statement = QUOTE([ARR_2(_player,'MAIN')] call DFUNC(joinTeam)); - showDisabled = 1; - priority = 2.5; - icon = PATHTOF(UI\team\team_white_ca.paa); - hotkey = "N"; - }; - class ACE_BecomeLeader { - displayName = "$STR_ACE_Interaction_BecomeLeader"; - condition = QUOTE(_this call DFUNC(canBecomeLeader)); - exceptions[] = {"isNotInside"}; - statement = QUOTE(_this call DFUNC(doBecomeLeader)); - showDisabled = 1; - priority = 1.0; - icon = PATHTOF(UI\team\team_white_ca.paa); - hotkey = "L"; - }; - class ACE_LeaveGroup { - displayName = "$STR_ACE_Interaction_LeaveGroup"; - condition = QUOTE(count (units group _player) > 1); - exceptions[] = {"isNotInside"}; - statement = QUOTE(_oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup;); - showDisabled = 1; - priority = 1.2; - icon = PATHTOF(UI\team\team_management_ca.paa); - hotkey = "M"; - }; - }; + class ACE_SelfActions { + class ACE_TeamManagement { + displayName = "$STR_ACE_Interaction_TeamManagement"; + condition = QUOTE(GVAR(EnableTeamManagement)); + exceptions[] = {"isNotInside"}; + statement = ""; + showDisabled = 1; + priority = 3.2; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "M"; - class ACE_Gestures { - displayName = "$STR_ACE_Interaction_Gestures"; - condition = "canStand _target"; - statement = ""; - showDisabled = 1; - priority = 3.5; - icon = PATHTOF(UI\gestures_ca.paa); - hotkey = "G"; + class ACE_JoinTeamRed { + displayName = "$STR_ACE_Interaction_JoinTeamRed"; + condition = QUOTE(true); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_2(_player,'RED')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.4; + icon = PATHTOF(UI\team\team_red_ca.paa); + hotkey = "R"; + }; + class ACE_JoinTeamGreen { + displayName = "$STR_ACE_Interaction_JoinTeamGreen"; + condition = QUOTE(true); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_2(_player,'GREEN')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.3; + icon = PATHTOF(UI\team\team_green_ca.paa); + hotkey = "G"; + }; + class ACE_JoinTeamBlue { + displayName = "$STR_ACE_Interaction_JoinTeamBlue"; + condition = QUOTE(true); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_2(_player,'BLUE')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.2; + icon = PATHTOF(UI\team\team_blue_ca.paa); + hotkey = "B"; + }; + class ACE_JoinTeamYellow { + displayName = "$STR_ACE_Interaction_JoinTeamYellow"; + condition = QUOTE(true); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_2(_player,'YELLOW')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.1; + icon = PATHTOF(UI\team\team_yellow_ca.paa); + hotkey = "Y"; + }; - /*class ACE_Gesture_Advance { - displayName = "$STR_ACE_Interaction_Gestures_Attack"; - condition = "canStand _target"; - statement = "_target playActionNow 'gestureAttack';"; - showDisabled = 1; - priority = 2.0; - };*/ - class ACE_Gesture_Advance { - displayName = "$STR_ACE_Interaction_Gestures_Advance"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureAdvance';); - showDisabled = 1; - priority = 1.9; - hotkey = "1"; - }; - class ACE_Gesture_Go { - displayName = "$STR_ACE_Interaction_Gestures_Go"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow ([ARR_2('gestureGo','gestureGoB')] select floor random 2);); - showDisabled = 1; - priority = 1.8; - hotkey = "2"; - }; - class ACE_Gesture_Follow { - displayName = "$STR_ACE_Interaction_Gestures_Follow"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureFollow';); - showDisabled = 1; - priority = 1.7; - hotkey = "3"; - }; - /*class ACE_Gesture_Point { - displayName = "$STR_ACE_Interaction_Gestures_Point"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gesturePoint';); - showDisabled = 1; - priority = 1.6; - };*/ - class ACE_Gesture_Up { - displayName = "$STR_ACE_Interaction_Gestures_Up"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureUp';); - showDisabled = 1; - priority = 1.5; - hotkey = "4"; - }; - class ACE_Gesture_Cover { - displayName = "$STR_ACE_Interaction_Gestures_Cover"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureCover';); - showDisabled = 1; - priority = 1.4; - hotkey = "5"; - }; - class ACE_Gesture_CeaseFire { - displayName = "$STR_ACE_Interaction_Gestures_Cease_Fire"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureCeaseFire';); - showDisabled = 1; - priority = 1.3; - hotkey = "6"; - }; - class ACE_Gesture_Freeze { - displayName = "$STR_ACE_Interaction_Gestures_Freeze"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureFreeze';); - showDisabled = 1; - priority = 1.2; - hotkey = "7"; - }; - class ACE_Gesture_Yes { - displayName = "$STR_ACE_Interaction_Gestures_Yes"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow ([ARR_2('gestureYes','gestureNod')] select floor random 2);); - showDisabled = 1; - priority = 1.1; - hotkey = "8"; - }; - class ACE_Gesture_No { - displayName = "$STR_ACE_Interaction_Gestures_No"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow 'gestureNo';); - showDisabled = 1; - priority = 1.0; - hotkey = "9"; - }; - class ACE_Gesture_Hi { - displayName = "$STR_ACE_Interaction_Gestures_Hi"; - condition = QUOTE(canStand _target); - statement = QUOTE(_target playActionNow ([ARR_3('gestureHi','gestureHiB','gestureHiC')] select floor random 3);); - showDisabled = 1; - priority = 0.9; - hotkey = "0"; - }; - }; + class ACE_LeaveTeam { + displayName = "$STR_ACE_Interaction_LeaveTeam"; + condition = QUOTE(assignedTeam _player != 'MAIN'); + exceptions[] = {"isNotInside"}; + statement = QUOTE([ARR_2(_player,'MAIN')] call DFUNC(joinTeam)); + showDisabled = 1; + priority = 2.5; + icon = PATHTOF(UI\team\team_white_ca.paa); + hotkey = "N"; + }; + class ACE_BecomeLeader { + displayName = "$STR_ACE_Interaction_BecomeLeader"; + condition = QUOTE(_this call DFUNC(canBecomeLeader)); + exceptions[] = {"isNotInside"}; + statement = QUOTE(_this call DFUNC(doBecomeLeader)); + showDisabled = 1; + priority = 1.0; + icon = PATHTOF(UI\team\team_white_ca.paa); + hotkey = "L"; + }; + class ACE_LeaveGroup { + displayName = "$STR_ACE_Interaction_LeaveGroup"; + condition = QUOTE(count (units group _player) > 1); + exceptions[] = {"isNotInside"}; + statement = QUOTE(_oldGroup = units group _player; _newGroup = createGroup side _player; [_player] joinSilent _newGroup; {_player reveal _x} forEach _oldGroup;); + showDisabled = 1; + priority = 1.2; + icon = PATHTOF(UI\team\team_management_ca.paa); + hotkey = "M"; + }; + }; - class ACE_Equipment { - displayName = "$STR_ACE_Interaction_Equipment"; - condition = QUOTE(true); - exceptions[] = {"isNotInside","notOnMap"}; - statement = ""; - showDisabled = 1; - priority = 4.5; - icon = ""; // @todo - hotkey = "E"; - }; - }; - }; + class ACE_Gestures { + displayName = "$STR_ACE_Interaction_Gestures"; + condition = "canStand _target"; + statement = ""; + showDisabled = 1; + priority = 3.5; + icon = PATHTOF(UI\gestures_ca.paa); + hotkey = "G"; - class LandVehicle; - class Car: LandVehicle { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class Tank: LandVehicle { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; + /*class ACE_Gesture_Advance { + displayName = "$STR_ACE_Interaction_Gestures_Attack"; + condition = "canStand _target"; + statement = "_target playActionNow 'gestureAttack';"; + showDisabled = 1; + priority = 2.0; + };*/ + class ACE_Gesture_Advance { + displayName = "$STR_ACE_Interaction_Gestures_Advance"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureAdvance';); + showDisabled = 1; + priority = 1.9; + hotkey = "1"; + }; + class ACE_Gesture_Go { + displayName = "$STR_ACE_Interaction_Gestures_Go"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow ([ARR_2('gestureGo','gestureGoB')] select floor random 2);); + showDisabled = 1; + priority = 1.8; + hotkey = "2"; + }; + class ACE_Gesture_Follow { + displayName = "$STR_ACE_Interaction_Gestures_Follow"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureFollow';); + showDisabled = 1; + priority = 1.7; + hotkey = "3"; + }; + /*class ACE_Gesture_Point { + displayName = "$STR_ACE_Interaction_Gestures_Point"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gesturePoint';); + showDisabled = 1; + priority = 1.6; + };*/ + class ACE_Gesture_Up { + displayName = "$STR_ACE_Interaction_Gestures_Up"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureUp';); + showDisabled = 1; + priority = 1.5; + hotkey = "4"; + }; + class ACE_Gesture_Cover { + displayName = "$STR_ACE_Interaction_Gestures_Cover"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureCover';); + showDisabled = 1; + priority = 1.4; + hotkey = "5"; + }; + class ACE_Gesture_CeaseFire { + displayName = "$STR_ACE_Interaction_Gestures_Cease_Fire"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureCeaseFire';); + showDisabled = 1; + priority = 1.3; + hotkey = "6"; + }; + class ACE_Gesture_Freeze { + displayName = "$STR_ACE_Interaction_Gestures_Freeze"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureFreeze';); + showDisabled = 1; + priority = 1.2; + hotkey = "7"; + }; + class ACE_Gesture_Yes { + displayName = "$STR_ACE_Interaction_Gestures_Yes"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow ([ARR_2('gestureYes','gestureNod')] select floor random 2);); + showDisabled = 1; + priority = 1.1; + hotkey = "8"; + }; + class ACE_Gesture_No { + displayName = "$STR_ACE_Interaction_Gestures_No"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow 'gestureNo';); + showDisabled = 1; + priority = 1.0; + hotkey = "9"; + }; + class ACE_Gesture_Hi { + displayName = "$STR_ACE_Interaction_Gestures_Hi"; + condition = QUOTE(canStand _target); + statement = QUOTE(_target playActionNow ([ARR_3('gestureHi','gestureHiB','gestureHiC')] select floor random 3);); + showDisabled = 1; + priority = 0.9; + hotkey = "0"; + }; + }; - class Air; - class Helicopter: Air { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + class ACE_Equipment { + displayName = "$STR_ACE_Interaction_Equipment"; + condition = QUOTE(true); + exceptions[] = {"isNotInside","notOnMap"}; + statement = ""; + showDisabled = 1; + priority = 4.5; + icon = ""; // @todo + hotkey = "E"; + }; }; - }; }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class Plane: Air { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + + class LandVehicle; + class Car: LandVehicle { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - - class Ship; - class Ship_F: Ship { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 10; - condition = "true"; - - class ACE_Push { - displayName = "$STR_ACE_Interaction_Push"; - distance = 6; - condition = QUOTE(getMass _target < 1000 && {alive _target}); - statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call DFUNC(push);); - showDisabled = 0; - priority = -1; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; }; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + class Tank: LandVehicle { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; }; - }; - }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - - class StaticWeapon: LandVehicle { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = "gunnerview"; - distance = 2; - condition = "true"; - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; }; - }; }; - class ACE_SelfActions { - class ACE_Passengers { - displayName = "$STR_ACE_Interaction_Passengers"; - condition = "true"; - statement = ""; - insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); - }; - }; - }; - class thingX; - class ReammoBox_F: thingX { - class ACE_Actions { - class ACE_MainActions { - displayName = "$STR_ACE_Interaction_MainAction"; - selection = ""; - distance = 2; - condition = "true"; - }; + class Air; + class Helicopter: Air { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class Plane: Air { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; }; - class ACE_SelfActions {}; - }; + class Ship; + class Ship_F: Ship { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 10; + condition = "true"; + + class ACE_Push { + displayName = "$STR_ACE_Interaction_Push"; + distance = 6; + condition = QUOTE(getMass _target < 1000 && {alive _target}); + statement = QUOTE([ARR_2(_target, [ARR_3(2 * (vectorDir _player select 0), 2 * (vectorDir _player select 1), 0.5)])] call DFUNC(push);); + showDisabled = 0; + priority = -1; + }; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + + class StaticWeapon: LandVehicle { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = "gunnerview"; + distance = 2; + condition = "true"; + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + class ACE_SelfActions { + class ACE_Passengers { + displayName = "$STR_ACE_Interaction_Passengers"; + condition = "true"; + statement = ""; + insertChildren = QUOTE(_this call DFUNC(addPassengersActions)); + }; + }; + }; + + class thingX; + class ReammoBox_F: thingX { + class ACE_Actions { + class ACE_MainActions { + displayName = "$STR_ACE_Interaction_MainAction"; + selection = ""; + distance = 2; + condition = "true"; + }; + }; + class ACE_SelfActions {}; + }; }; diff --git a/addons/interaction/Menu_Config.hpp b/addons/interaction/Menu_Config.hpp index 38f12066e0..790874a1ac 100644 --- a/addons/interaction/Menu_Config.hpp +++ b/addons/interaction/Menu_Config.hpp @@ -1,46 +1,44 @@ - #define HSPACE 0.5-2.0/16/2 #define VSPACE 0.5-0.3/9/2 -class RscStructuredText; class ACE_Interaction_Button_Base { - tooltip = ""; - //action = "ACE_Interaction_isMousePressed = true;(findDisplay 1713999) closeDisplay 1;_action = ACE_Interaction_Buttons select ACE_Interaction_SelectedButton;ACE_Interaction_SelectedButton = -1; if (call (_action select 2)) then {call (_action select 1)};"; - action = ""; + tooltip = ""; + //action = "ACE_Interaction_isMousePressed = true;(findDisplay 1713999) closeDisplay 1;_action = ACE_Interaction_Buttons select ACE_Interaction_SelectedButton;ACE_Interaction_SelectedButton = -1; if (call (_action select 2)) then {call (_action select 1)};"; + action = ""; - idc = -1; - access = 0; - type = 1; - text = ""; - font = "PuristaMedium"; - sizeEx = "0.8 / 40 / (getResolution select 5)"; - shadow = 2; + idc = -1; + access = 0; + type = 1; + text = ""; + font = "PuristaMedium"; + sizeEx = "0.8 / 40 / (getResolution select 5)"; + shadow = 2; - style = 2; - x = 0; - y = 0; - w = 2.0 / 16 * safezoneW; - h = 0.3 / 9 * safezoneH; + style = 2; + x = 0; + y = 0; + w = 2.0 / 16 * safezoneW; + h = 0.3 / 9 * safezoneH; - offsetX = 0.003; - offsetY = 0.003; - offsetPressedX = 0.002; - offsetPressedY = 0.002; - borderSize = 0; + offsetX = 0.003; + offsetY = 0.003; + offsetPressedX = 0.002; + offsetPressedY = 0.002; + borderSize = 0; - colorText[] = {1,1,1,1}; - colorDisabled[] = {0.5,0.5,0.5,1}; - colorBackground[] = {0,0,0,0.8}; - colorBackgroundDisabled[] = {0,0,0,0.8}; - colorBackgroundActive[] = {1,1,1,0}; - colorFocused[] = {1,1,1,1}; - colorShadow[] = {0,0,0,0}; - colorBorder[] = {1,1,1,0.8}; + colorText[] = {1,1,1,1}; + colorDisabled[] = {0.5,0.5,0.5,1}; + colorBackground[] = {0,0,0,0.8}; + colorBackgroundDisabled[] = {0,0,0,0.8}; + colorBackgroundActive[] = {1,1,1,0}; + colorFocused[] = {1,1,1,1}; + colorShadow[] = {0,0,0,0}; + colorBorder[] = {1,1,1,0.8}; - soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1}; - soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1}; - soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; - soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; + soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1}; + soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1}; + soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1}; + soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1}; }; class RscListbox; @@ -49,86 +47,86 @@ class RscText; #define X_OFFSET 0.2 class RscACE_SelectAnItem { - idd = 8854; - movingEnable = 0; - class controls { - class back:IGUIBack { - x = X_OFFSET; - y = 0; - w = 0.6; - h = 0.71; - colorBackground[] = {0, 0, 0, 0.2}; - }; - class header: RscText{ - idc = 8870; - x = X_OFFSET + 0.005; - y = 0.005; - w = 0.59; - h = 0.05; - style = 0x02; - text = ""; - }; - class itemList:RscListBox { - onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick"; - idc = 8866; - x = X_OFFSET + 0.005; - w = 0.59; - h = 0.54; - y = 0.06; - }; + idd = 8854; + movingEnable = 0; + class controls { + class back:IGUIBack { + x = X_OFFSET; + y = 0; + w = 0.6; + h = 0.71; + colorBackground[] = {0, 0, 0, 0.2}; + }; + class header: RscText{ + idc = 8870; + x = X_OFFSET + 0.005; + y = 0.005; + w = 0.59; + h = 0.05; + style = 0x02; + text = ""; + }; + class itemList:RscListBox { + onMouseButtonDblClick = "_this call ACE_Interaction_fnc_onSelectMenuDblClick"; + idc = 8866; + x = X_OFFSET + 0.005; + w = 0.59; + h = 0.54; + y = 0.06; + }; - class cancelBtnBackground: ACE_Interaction_Button_Base { - type = 0; - style = 2; - idc = -1; - colorBackground[] = {0,0,0,0.5}; - colorBackgroundDisabled[] = {0,0,0,0.5}; - x = X_OFFSET + 0.005; - w = 0.15; - h = 0.1; - y = 0.605; - }; - class approveBtnBackground: ACE_Interaction_Button_Base { - type = 0; - style = 2; - idc = -1; - colorBackground[] = {0,0,0,0.5}; - colorBackgroundDisabled[] = {0,0,0,0.5}; - x = X_OFFSET + 0.445; - y = 0.605; - h = 0.1; - w = 0.15; - }; + class cancelBtnBackground: ACE_Interaction_Button_Base { + type = 0; + style = 2; + idc = -1; + colorBackground[] = {0,0,0,0.5}; + colorBackgroundDisabled[] = {0,0,0,0.5}; + x = X_OFFSET + 0.005; + w = 0.15; + h = 0.1; + y = 0.605; + }; + class approveBtnBackground: ACE_Interaction_Button_Base { + type = 0; + style = 2; + idc = -1; + colorBackground[] = {0,0,0,0.5}; + colorBackgroundDisabled[] = {0,0,0,0.5}; + x = X_OFFSET + 0.445; + y = 0.605; + h = 0.1; + w = 0.15; + }; - class cancelBtn: ACE_Interaction_Button_Base { - idc = 8855; - x = X_OFFSET + 0.005; - w = 0.15; - h = 0.1; - y = 0.605; - style = 2; - text = $STR_ACE_Interaction_Back; //$STR_ACE_Interaction_CancelSelection; - action = "call ACE_Interaction_fnc_hideMenu;"; //'Default' call ACE_Interaction_fnc_openMenu; 'Default' call ACE_Interaction_fnc_openMenuSelf; - colorBackground[] = {0,0,0,0}; - colorBackgroundDisabled[] = {0,0,0,0}; - colorBackgroundActive[] = {1,1,1,0.2}; - colorFocused[] = {0,0,0,0}; + class cancelBtn: ACE_Interaction_Button_Base { + idc = 8855; + x = X_OFFSET + 0.005; + w = 0.15; + h = 0.1; + y = 0.605; + style = 2; + text = $STR_ACE_Interaction_Back; //$STR_ACE_Interaction_CancelSelection; + action = "call ACE_Interaction_fnc_hideMenu;"; //'Default' call ACE_Interaction_fnc_openMenu; 'Default' call ACE_Interaction_fnc_openMenuSelf; + colorBackground[] = {0,0,0,0}; + colorBackgroundDisabled[] = {0,0,0,0}; + colorBackgroundActive[] = {1,1,1,0.2}; + colorFocused[] = {0,0,0,0}; + }; + class approveBtn: ACE_Interaction_Button_Base { + idc = 8860; + x = X_OFFSET + 0.445; + y = 0.605; + h = 0.1; + w = 0.15; + style = 2; + text = $STR_ACE_Interaction_MakeSelection; + action = "call ACE_Interaction_fnc_hideMenu;"; + colorBackground[] = {0,0,0,0}; + colorBackgroundDisabled[] = {0,0,0,0}; + colorBackgroundActive[] = {1,1,1,0.2}; + colorFocused[] = {0,0,0,0}; + }; }; - class approveBtn: ACE_Interaction_Button_Base { - idc = 8860; - x = X_OFFSET + 0.445; - y = 0.605; - h = 0.1; - w = 0.15; - style = 2; - text = $STR_ACE_Interaction_MakeSelection; - action = "call ACE_Interaction_fnc_hideMenu;"; - colorBackground[] = {0,0,0,0}; - colorBackgroundDisabled[] = {0,0,0,0}; - colorBackgroundActive[] = {1,1,1,0.2}; - colorFocused[] = {0,0,0,0}; - }; - }; }; #define GUI_GRID_W (0.025) @@ -136,64 +134,64 @@ class RscACE_SelectAnItem { class RscPicture; class RscInteractionIcon: RscPicture { - x = 19.25 * GUI_GRID_W; - y = 15.75 * GUI_GRID_H; - w = 2*GUI_GRID_H; - h = 2*GUI_GRID_H; + x = 19.25 * GUI_GRID_W; + y = 15.75 * GUI_GRID_H; + w = 2*GUI_GRID_H; + h = 2*GUI_GRID_H; }; class RscInteractionHelperIcon: RscInteractionIcon { - x = 20 * GUI_GRID_W; - y = 16 * GUI_GRID_H; - w = GUI_GRID_H; - h = GUI_GRID_H; + x = 20 * GUI_GRID_W; + y = 16 * GUI_GRID_H; + w = GUI_GRID_H; + h = GUI_GRID_H; }; class RscInteractionText: RscText{ - x = 21 * GUI_GRID_W; - y = 16 * GUI_GRID_H; - w = 8 * GUI_GRID_W; - h = 1.5 * GUI_GRID_H; + x = 21 * GUI_GRID_W; + y = 16 * GUI_GRID_H; + w = 8 * GUI_GRID_W; + h = 1.5 * GUI_GRID_H; }; class RscTitles { - class GVAR(InteractionHelper) { - idd = 9930; - enableSimulation = 1; - movingEnable = 0; - fadeIn=0.5; - fadeOut=0.5; - duration = 10e10; - onLoad = "uiNamespace setVariable ['ACE_Helper_Display', _this select 0];"; + class GVAR(InteractionHelper) { + idd = 9930; + enableSimulation = 1; + movingEnable = 0; + fadeIn=0.5; + fadeOut=0.5; + duration = 10e10; + onLoad = "uiNamespace setVariable ['ACE_Helper_Display', _this select 0];"; - class controls { - class SelectIcon: RscInteractionHelperIcon{ - idc = 1200; - text = PATHTOF(UI\mouse_left_ca.paa); - y = 17.5 * GUI_GRID_H; - }; - class SelectText: RscInteractionText{ - idc = 1000; - y = 17 * GUI_GRID_H; - text = $STR_ACE_Interaction_MakeSelection; - }; - class GoBackIcon: RscInteractionHelperIcon{ - idc = 1201; - text = PATHTOF(UI\mouse_right_ca.paa); - y = 19.5 * GUI_GRID_H; - }; - class GoBackText: RscInteractionText{ - idc = 1001; - y = 19 * GUI_GRID_H; - text = $STR_ACE_Interaction_Back; - }; - class ScrollIcon: RscInteractionHelperIcon{ - idc = 1202; - text = PATHTOF(UI\mouse_scroll_ca.paa); - y = 18.5 * GUI_GRID_H; - }; - class ScrollText: RscInteractionText{ - idc = 1002; - y = 18 * GUI_GRID_H; - text = $STR_ACE_Interaction_ScrollHint; - }; + class controls { + class SelectIcon: RscInteractionHelperIcon{ + idc = 1200; + text = PATHTOF(UI\mouse_left_ca.paa); + y = 17.5 * GUI_GRID_H; + }; + class SelectText: RscInteractionText{ + idc = 1000; + y = 17 * GUI_GRID_H; + text = $STR_ACE_Interaction_MakeSelection; + }; + class GoBackIcon: RscInteractionHelperIcon{ + idc = 1201; + text = PATHTOF(UI\mouse_right_ca.paa); + y = 19.5 * GUI_GRID_H; + }; + class GoBackText: RscInteractionText{ + idc = 1001; + y = 19 * GUI_GRID_H; + text = $STR_ACE_Interaction_Back; + }; + class ScrollIcon: RscInteractionHelperIcon{ + idc = 1202; + text = PATHTOF(UI\mouse_scroll_ca.paa); + y = 18.5 * GUI_GRID_H; + }; + class ScrollText: RscInteractionText{ + idc = 1002; + y = 18 * GUI_GRID_H; + text = $STR_ACE_Interaction_ScrollHint; + }; + }; }; - }; }; diff --git a/addons/interaction/README.md b/addons/interaction/README.md index 92401b2547..8e841e9a58 100644 --- a/addons/interaction/README.md +++ b/addons/interaction/README.md @@ -3,7 +3,6 @@ ace_interaction Provides interaction options between units. - ## Maintainers The people responsible for merging changes to this component or answering potential questions. diff --git a/addons/interaction/config.cpp b/addons/interaction/config.cpp index cfca73a90b..7d10e1bef5 100644 --- a/addons/interaction/config.cpp +++ b/addons/interaction/config.cpp @@ -1,26 +1,24 @@ #include "script_component.hpp" class CfgPatches { - class ADDON { - units[] = {}; - weapons[] = {}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_interact_menu"}; - author[] = {"commy2", "KoffeinFlummi", "esteldunedain", "bux578"}; - authorUrl = "https://github.com/commy2/"; - VERSION_CONFIG; - }; + class ADDON { + units[] = {}; + weapons[] = {}; + requiredVersion = REQUIRED_VERSION; + requiredAddons[] = {"ace_interact_menu"}; + author[] = {"commy2", "KoffeinFlummi", "esteldunedain", "bux578"}; + authorUrl = "https://github.com/commy2/"; + VERSION_CONFIG; + }; }; #include "CfgEventHandlers.hpp" - #include "CfgVehicles.hpp" - -#include +#include "Menu_Config.hpp" class ACE_Settings { - class GVAR(EnableTeamManagement) { - value = 1; - typeName = "BOOL"; - }; + class GVAR(EnableTeamManagement) { + value = 1; + typeName = "BOOL"; + }; }; From 212b8528fa289fc44a1f68feaeeeb31df4320664 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sat, 9 May 2015 21:30:52 +0100 Subject: [PATCH 048/172] Bird locality code no longer needed --- addons/zeus/functions/fnc_bi_moduleCurator.sqf | 2 ++ 1 file changed, 2 insertions(+) diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 36110ac4fe..640ca7cead 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -215,6 +215,7 @@ if (_activated) then { } foreach (synchronizedobjects _logic); _addons call bis_fnc_activateaddons; + /* Removed by ACE //--- Locality changed _logic addeventhandler [ "local", @@ -224,6 +225,7 @@ if (_activated) then { _bird setowner owner _logic; } ]; + */ }; //--- Player From 2da2794e205243f72ee93df86330d94630c9dc9d Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sat, 9 May 2015 17:08:47 -0500 Subject: [PATCH 049/172] ACE_isUnique config for mags instead of static list --- addons/disarming/functions/fnc_disarmDropItems.sqf | 4 ++-- addons/disarming/script_component.hpp | 1 - addons/vehiclelock/CfgMagazines.hpp | 1 + 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/disarming/functions/fnc_disarmDropItems.sqf b/addons/disarming/functions/fnc_disarmDropItems.sqf index cb5da77dd6..bc9abbf127 100644 --- a/addons/disarming/functions/fnc_disarmDropItems.sqf +++ b/addons/disarming/functions/fnc_disarmDropItems.sqf @@ -79,7 +79,7 @@ _holderMagazinesStart = magazinesAmmoCargo _holder; { EXPLODE_2_PVT(_x,_xClassname,_xAmmo); - if ((_xClassname in _listOfItemsToRemove) && {!(_xClassname in UNIQUE_MAGAZINES)}) then { + if ((_xClassname in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> _xClassname >> "ACE_isUnique")) == 0}) then { _holder addMagazineAmmoCargo [_xClassname, 1, _xAmmo]; _target removeMagazine _xClassname; }; @@ -89,7 +89,7 @@ _targetMagazinesEnd = magazinesAmmo _target; _holderMagazinesEnd = magazinesAmmoCargo _holder; //Verify Mags dropped from unit: -if ( ({((_x select 0) in _listOfItemsToRemove) && {!((_x select 0) in UNIQUE_MAGAZINES)}} count _targetMagazinesEnd) != 0) exitWith { +if (({((_x select 0) in _listOfItemsToRemove) && {(getNumber (configFile >> "CfgMagazines" >> (_x select 0) >> "ACE_isUnique")) == 0}} count _targetMagazinesEnd) != 0) exitWith { _holder setVariable [QGVAR(holderInUse), false]; [_caller, _target, "Debug: Didn't Remove Magazines"] call FUNC(eventTargetFinish); }; diff --git a/addons/disarming/script_component.hpp b/addons/disarming/script_component.hpp index d9bec366dc..9a1ef9156b 100644 --- a/addons/disarming/script_component.hpp +++ b/addons/disarming/script_component.hpp @@ -13,4 +13,3 @@ #define DISARM_CONTAINER "GroundWeaponHolder" #define DUMMY_ITEM "ACE_DebugPotato" -#define UNIQUE_MAGAZINES ["ACE_key_customKeyMagazine"] \ No newline at end of file diff --git a/addons/vehiclelock/CfgMagazines.hpp b/addons/vehiclelock/CfgMagazines.hpp index 100df8065b..d57e8fff6f 100644 --- a/addons/vehiclelock/CfgMagazines.hpp +++ b/addons/vehiclelock/CfgMagazines.hpp @@ -6,5 +6,6 @@ class CfgMagazines { descriptionShort = "$STR_ACE_Vehicle_Item_Custom_Description"; count = 1; mass = 0; + ACE_isUnique = 1; }; }; From b3833c665d4adbf37d8c18a566ae5276b0224c77 Mon Sep 17 00:00:00 2001 From: jaynus Date: Sat, 9 May 2015 22:53:20 -0700 Subject: [PATCH 050/172] Time magic. --- addons/common/XEH_preInit.sqf | 9 +++++++++ addons/common/functions/fnc_timePFH.sqf | 26 +++++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 addons/common/functions/fnc_timePFH.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 5c2ad1e592..881d77e156 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -312,6 +312,15 @@ if (hasInterface) then { }, 0, []] call cba_fnc_addPerFrameHandler; }; +// Time handling +ACE_time = diag_tickTime; +ACE_realTime = diag_tickTime; +ACE_virtualTime = diag_tickTime; +ACE_gameTime = time; + +PREP(timePFH); +[FUNC(timePFH), 0, []] call cba_fnc_addPerFrameHandler; + // Init toHex [0] call FUNC(toHex); diff --git a/addons/common/functions/fnc_timePFH.sqf b/addons/common/functions/fnc_timePFH.sqf new file mode 100644 index 0000000000..7f1c815bac --- /dev/null +++ b/addons/common/functions/fnc_timePFH.sqf @@ -0,0 +1,26 @@ +//#define DEBUG_MODE_FULL +#include "script_component.hpp" + +private["_lastTime", "_lastRealTime", "_lastVirtualTime", "_lastGameTime", "_delta"]; + +_lastTime = ACE_time; +_lastRealTime = ACE_realTime; +_lastVirtualTime = ACE_virtualTime; +_lastGameTime = ACE_gameTime; +_lastPausedTime = ACE_pausedTime; +_lastVirtualPausedTime = ACE_virtualPausedTime; + +ACE_gameTime = time; +ACE_realTime = diag_tickTime; + +_delta = ACE_realTime - _lastRealTime; +if(time <= _lastGameTime) then { + // Game is paused or not running + ACE_pausedTime = ACE_pausedTime + _delta; + ACE_virtualPausedTime = ACE_pausedTime + (_delta * accTime); +} else { + // Time is updating + ACE_virtualTime = _lastVirtualTime + (_delta * accTime); + ACE_time = ACE_realTime + _delta; +}; + From 8e34b99c0f6969764b834c7c19cb58d50caf008f Mon Sep 17 00:00:00 2001 From: jaynus Date: Sat, 9 May 2015 23:09:33 -0700 Subject: [PATCH 051/172] Optimization of variables. --- addons/common/functions/fnc_timePFH.sqf | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/addons/common/functions/fnc_timePFH.sqf b/addons/common/functions/fnc_timePFH.sqf index 7f1c815bac..a3732c614f 100644 --- a/addons/common/functions/fnc_timePFH.sqf +++ b/addons/common/functions/fnc_timePFH.sqf @@ -3,24 +3,22 @@ private["_lastTime", "_lastRealTime", "_lastVirtualTime", "_lastGameTime", "_delta"]; -_lastTime = ACE_time; _lastRealTime = ACE_realTime; -_lastVirtualTime = ACE_virtualTime; _lastGameTime = ACE_gameTime; -_lastPausedTime = ACE_pausedTime; -_lastVirtualPausedTime = ACE_virtualPausedTime; ACE_gameTime = time; ACE_realTime = diag_tickTime; _delta = ACE_realTime - _lastRealTime; if(time <= _lastGameTime) then { + ACE_paused = true; // Game is paused or not running ACE_pausedTime = ACE_pausedTime + _delta; ACE_virtualPausedTime = ACE_pausedTime + (_delta * accTime); } else { + ACE_paused = false; // Time is updating - ACE_virtualTime = _lastVirtualTime + (_delta * accTime); - ACE_time = ACE_realTime + _delta; + ACE_virtualTime = ACE_virtualTime + (_delta * accTime); + ACE_time = ACE_time + _delta; }; From 7fb7b04a85dc37a254931ba1f22bf407671fdf5a Mon Sep 17 00:00:00 2001 From: jaynus Date: Sat, 9 May 2015 23:13:02 -0700 Subject: [PATCH 052/172] And one final bugfix for fast machines. --- addons/common/functions/fnc_timePFH.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_timePFH.sqf b/addons/common/functions/fnc_timePFH.sqf index a3732c614f..e8f0be1efd 100644 --- a/addons/common/functions/fnc_timePFH.sqf +++ b/addons/common/functions/fnc_timePFH.sqf @@ -10,7 +10,7 @@ ACE_gameTime = time; ACE_realTime = diag_tickTime; _delta = ACE_realTime - _lastRealTime; -if(time <= _lastGameTime) then { +if(ACE_gameTime <= _lastGameTime) then { ACE_paused = true; // Game is paused or not running ACE_pausedTime = ACE_pausedTime + _delta; From 59adf928622b3917dfb9e288e10c01ff2b2343eb Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 10 May 2015 01:47:50 -0500 Subject: [PATCH 053/172] Fix not being able to UnSurrender (currentWeapon) --- addons/captives/functions/fnc_canSurrender.sqf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/captives/functions/fnc_canSurrender.sqf b/addons/captives/functions/fnc_canSurrender.sqf index 3b810a0c5c..9ba7cf6de0 100644 --- a/addons/captives/functions/fnc_canSurrender.sqf +++ b/addons/captives/functions/fnc_canSurrender.sqf @@ -1,6 +1,6 @@ /* * Author: PabstMirror - * Checks the conditions for being able to surrender + * Checks the conditions for being able switch surrender states * * Arguments: * 0: caller (player) @@ -18,14 +18,14 @@ PARAMS_2(_unit,_newSurrenderState); -if (currentWeapon _unit != "") exitWith {false}; - private "_returnValue"; _returnValue = if (_newSurrenderState) then { - !(_unit getVariable [QGVAR(isSurrendering), false]); //Not currently surrendering + //no weapon equiped AND not currently surrendering and + (currentWeapon _unit == "") && {!(_unit getVariable [QGVAR(isSurrendering), false])} } else { - (_unit getVariable [QGVAR(isSurrendering), false]); //is Surrendering + //is Surrendering + (_unit getVariable [QGVAR(isSurrendering), false]) }; _returnValue From d32e1024d359e4cc427e6c86334e97cb2ae8798f Mon Sep 17 00:00:00 2001 From: ulteq Date: Sun, 10 May 2015 11:09:14 +0200 Subject: [PATCH 054/172] Fixed a typo --- .../functions/fnc_readAmmoDataFromConfig.sqf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf index 7ff94387d1..10e7e60df2 100644 --- a/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf +++ b/addons/advanced_ballistics/functions/fnc_readAmmoDataFromConfig.sqf @@ -50,11 +50,11 @@ if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_ammoTempMuzzleVelocityShift }; _muzzleVelocityTable = []; _barrelLengthTable = []; -if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocityTable")) then { - _muzzleVelocityTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocityTable"); +if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocities")) then { + _muzzleVelocityTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_muzzleVelocities"); }; if (isArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengths")) then { - _barrelLengthTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengthTable"); + _barrelLengthTable = getArray(configFile >> "CfgAmmo" >> _ammo >> "ACE_barrelLengths"); }; _result = [_airFriction, _caliber, _bulletLength, _bulletMass, _transonicStabilityCoef, _dragModel, _ballisticCoefficients, _velocityBoundaries, _atmosphereModel, _ammoTempMuzzleVelocityShifts, _muzzleVelocityTable, _barrelLengthTable]; From 69648f0e1b2a213cae8100749b167871a84e6dbe Mon Sep 17 00:00:00 2001 From: SAM Date: Sun, 10 May 2015 12:00:19 +0200 Subject: [PATCH 055/172] Added adaptive view distance depending on vehicle --- addons/viewdistance/ACE_Settings.hpp | 36 ++++++++++++++++--- addons/viewdistance/CfgVehicles.hpp | 8 ++++- addons/viewdistance/XEH_preInit.sqf | 1 + .../functions/fnc_adaptViewDistance.sqf | 35 ++++++++++++++++++ .../functions/fnc_changeViewDistance.sqf | 21 +++++++---- addons/viewdistance/functions/fnc_init.sqf | 18 +++++++--- 6 files changed, 103 insertions(+), 16 deletions(-) create mode 100644 addons/viewdistance/functions/fnc_adaptViewDistance.sqf diff --git a/addons/viewdistance/ACE_Settings.hpp b/addons/viewdistance/ACE_Settings.hpp index 6572e4790e..46f7a8955a 100644 --- a/addons/viewdistance/ACE_Settings.hpp +++ b/addons/viewdistance/ACE_Settings.hpp @@ -1,11 +1,27 @@ class ACE_Settings { - class GVAR(viewDistance) { + class GVAR(viewDistanceOnFoot) { typeName = "SCALAR"; isClientSettable = 1; - value = 11; // index, NOT value // not sure what to set this to. + value = 11; // index, NOT value // Can set it to client's actual viewdistance in the init function once ACE_Settings supports numbers (if ever). values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf - displayName = "Change View Distance"; - description = "Changes in game view distance"; + displayName = "Client View Distance (On Foot)"; + description = "Changes in game view distance when the player is on foot."; + }; + class GVAR(viewDistanceLandVehicle) { + typeName = "SCALAR"; + isClientSettable = 1; + value = 11; // index, NOT value + values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf + displayName = "Client View Distance (Land Vehicle)"; + description = "Changes in game view distance when the player is in a land vehicle."; + }; + class GVAR(viewDistanceAirVehicle) { + typeName = "SCALAR"; + isClientSettable = 1; + value = 11; // index, NOT value + values[] = {"1500","2000","2500","3000","3500","4000","5000","6000","7000","8000","9000","10000"}; // Values also need to be changed in functions/fnc_returnValue.sqf + displayName = "Client View Distance (Air Vehicle)"; + description = "Changes in game view distance when the player is in an air vehicle."; }; class GVAR(limitViewDistance) { typeName = "SCALAR"; @@ -13,6 +29,18 @@ class ACE_Settings { displayName = "View Distance Limit"; description = "Limit for client's view distance set here and can overridden by module"; }; + class GVAR(terrainGrid) { + typeName = "SCALAR"; + value = 10; // MP default as found in: https://community.bistudio.com/wiki/setTerrainGrid + displayName = "Client Terrain Grid"; + description = "Changes in game terrain grid"; + }; + class GVAR(shadows) { + typeName = "SCALAR"; + value = 200; // MP default as found in: https://community.bistudio.com/wiki/setObjectViewDistance + displayName = "Client Shadows distance"; + description = "Changes in game shadows"; + }; }; // To do: include string table style displayName & description. \ No newline at end of file diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp index 2a2f85e611..99897f5441 100644 --- a/addons/viewdistance/CfgVehicles.hpp +++ b/addons/viewdistance/CfgVehicles.hpp @@ -11,10 +11,16 @@ class CfgVehicles { class Arguments { class moduleViewDistanceLimit { displayName = "View Distance Limit"; - description = "Sets the limit for how high clients can raise their view distance (< 10000)"; + description = "Sets the limit for how high clients can raise their view distance (<= 10000)"; typeName = "NUMBER"; defaultValue = 10000; }; + class moduleTerrainGridLimit { + displayName = "Terrain Grid Limit"; + description = "Sets the limit for how high clients can raise their terrain grid (<= 50)"; + typeName = "NUMBER"; + defaultValue = 50; // range is 3.125 - 50 Reference: https://community.bistudio.com/wiki/setTerrainGrid + }; }; }; }; \ No newline at end of file diff --git a/addons/viewdistance/XEH_preInit.sqf b/addons/viewdistance/XEH_preInit.sqf index 883e393c8a..a44fab6169 100644 --- a/addons/viewdistance/XEH_preInit.sqf +++ b/addons/viewdistance/XEH_preInit.sqf @@ -6,5 +6,6 @@ PREP(initModule); PREP(init); PREP(returnValue); PREP(changeViewDistance); +PREP(adaptViewDistance); ADDON = true; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf new file mode 100644 index 0000000000..bc56955893 --- /dev/null +++ b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf @@ -0,0 +1,35 @@ +/* + * Author: Winter + * Sets the player's current view distance according to whether s/he is on foot, in a land vehicle or in an air vehicle. + * + * + * Arguments: + * None + * + * Return Value: + * None + * + * Example: + * [] call ace_viewdistance_fnc_adaptViewDistance; + * + * Public: Yes + */ + +#include "script_component.hpp" + +private["_land_vehicle","_air_vehicle"]; + +_land_vehicle = (vehicle player) isKindOf "LandVehicle"; +_air_vehicle = (vehicle player) isKindOf "Air"; + +if (!_land_vehicle && !_air_vehicle) exitWith { + [GVAR(viewDistanceOnFoot),true] call FUNC(changeViewDistance); +}; + +if (_land_vehicle) exitWith { + [GVAR(viewDistanceLandVehicle),true] call FUNC(changeViewDistance); +}; + +if (_air_vehicle) exitWith { + [GVAR(viewDistanceAirVehicle),true] call FUNC(changeViewDistance); +}; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index f1274343d8..596c86d521 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -4,7 +4,8 @@ * * * Arguments: - * None + * 0: View Distance setting INDEX + * 1: Show Prompt * * Return Value: * None @@ -18,18 +19,24 @@ #include "script_component.hpp" private ["_text","_new_view_distance","_view_distance_limit"]; +PARAMS_2(_index_requested,_prompt); -// Change the received index number into an actual view distance: -_new_view_distance = [GVAR(viewDistance)] call FUNC(returnValue); +_new_view_distance = [_index_requested] call FUNC(returnValue); // change the index into an actual view distance value _view_distance_limit = GVAR(limitViewDistance); // Grab the limit if (_new_view_distance <= _view_distance_limit) then { - _text = composeText ["View distance successfully changed to: ",str(_new_view_distance)]; - [_text,1] call EFUNC(common,displayTextStructured); + if (_prompt) then { + _text = composeText ["View distance: ",str(_new_view_distance)]; + [_text,1] call EFUNC(common,displayTextStructured); + }; setViewDistance _new_view_distance; setObjectViewDistance (0.8 * _new_view_distance); // maybe make this 0.8 a constant? } else { - _text = composeText ["That option is not allowed! The limit is: ",str(_view_distance_limit)]; - [_text,1] call EFUNC(common,displayTextStructured); + if (_prompt) then { + _text = composeText ["That option is invalid! The limit is: ",str(_view_distance_limit)]; + [_text,1] call EFUNC(common,displayTextStructured); + setViewDistance _view_distance_limit; + setObjectViewDistance (0.8 * _view_distance_limit); // maybe make this 0.8 a constant? + }; }; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_init.sqf b/addons/viewdistance/functions/fnc_init.sqf index 0d5ec7cf79..72fc2ee0e6 100644 --- a/addons/viewdistance/functions/fnc_init.sqf +++ b/addons/viewdistance/functions/fnc_init.sqf @@ -19,9 +19,19 @@ if (!hasInterface) exitWith {}; -// Set the EH which waits for the View Distance setting to be changed +if (viewDistance > GVAR(limitViewDistance)) then { + setViewDistance GVAR(limitViewDistance); // force the view distance down to the limit. + setObjectViewDistance (0.8 * GVAR(limitViewDistance)); +} else { + [] call FUNC(adaptViewDistance); // adapt view distance in the beginning according to whether client is on foot or vehicle. +}; + +// Set the EH which waits for any of the view distance settings to be changed (avoids the player having to enter or leave their vehicle for the changes to have effect.) ["SettingChanged",{ - if (_this select 0 == QGVAR(viewDistance)) then { - [] call FUNC(changeViewDistance); + if ((_this select 0 == QGVAR(viewDistanceOnFoot)) || (_this select 0 == QGVAR(viewDistanceLandVehicle)) || (_this select 0 == QGVAR(viewDistanceAirVehicle))) then { + [] call FUNC(adaptViewDistance); }; -},true] call ace_common_fnc_addEventHandler; \ No newline at end of file +},true] call ace_common_fnc_addEventHandler; + +// Set the EH which waits for a vehicle change to automatically swap to On Foot/In Land Vehicle/In Air Vehicle +["playerVehicleChanged",{[] call FUNC(adaptViewDistance)},true] call ace_common_fnc_addEventHandler; \ No newline at end of file From c05a91f5308d0f0ab63059c2ef17f67d73308d1c Mon Sep 17 00:00:00 2001 From: SAM Date: Sun, 10 May 2015 12:15:34 +0200 Subject: [PATCH 056/172] Suppress prompts when changing vehicle. They're only shown when the player changes the setting. --- .../viewdistance/functions/fnc_adaptViewDistance.sqf | 10 ++++++---- .../viewdistance/functions/fnc_changeViewDistance.sqf | 2 +- addons/viewdistance/functions/fnc_init.sqf | 8 ++++---- 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf index bc56955893..946c601fc8 100644 --- a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf @@ -4,7 +4,7 @@ * * * Arguments: - * None + * 0: Show Prompt * * Return Value: * None @@ -17,19 +17,21 @@ #include "script_component.hpp" +PARAMS_1(_show_prompt); + private["_land_vehicle","_air_vehicle"]; _land_vehicle = (vehicle player) isKindOf "LandVehicle"; _air_vehicle = (vehicle player) isKindOf "Air"; if (!_land_vehicle && !_air_vehicle) exitWith { - [GVAR(viewDistanceOnFoot),true] call FUNC(changeViewDistance); + [GVAR(viewDistanceOnFoot),_show_prompt] call FUNC(changeViewDistance); }; if (_land_vehicle) exitWith { - [GVAR(viewDistanceLandVehicle),true] call FUNC(changeViewDistance); + [GVAR(viewDistanceLandVehicle),_show_prompt] call FUNC(changeViewDistance); }; if (_air_vehicle) exitWith { - [GVAR(viewDistanceAirVehicle),true] call FUNC(changeViewDistance); + [GVAR(viewDistanceAirVehicle),_show_prompt] call FUNC(changeViewDistance); }; \ No newline at end of file diff --git a/addons/viewdistance/functions/fnc_changeViewDistance.sqf b/addons/viewdistance/functions/fnc_changeViewDistance.sqf index 596c86d521..bf5f610c0d 100644 --- a/addons/viewdistance/functions/fnc_changeViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_changeViewDistance.sqf @@ -26,7 +26,7 @@ _view_distance_limit = GVAR(limitViewDistance); // Grab the limit if (_new_view_distance <= _view_distance_limit) then { if (_prompt) then { - _text = composeText ["View distance: ",str(_new_view_distance)]; + _text = composeText ["View distance successfully changed to: ",str(_new_view_distance)]; [_text,1] call EFUNC(common,displayTextStructured); }; setViewDistance _new_view_distance; diff --git a/addons/viewdistance/functions/fnc_init.sqf b/addons/viewdistance/functions/fnc_init.sqf index 72fc2ee0e6..07befd157c 100644 --- a/addons/viewdistance/functions/fnc_init.sqf +++ b/addons/viewdistance/functions/fnc_init.sqf @@ -23,15 +23,15 @@ if (viewDistance > GVAR(limitViewDistance)) then { setViewDistance GVAR(limitViewDistance); // force the view distance down to the limit. setObjectViewDistance (0.8 * GVAR(limitViewDistance)); } else { - [] call FUNC(adaptViewDistance); // adapt view distance in the beginning according to whether client is on foot or vehicle. + [true] call FUNC(adaptViewDistance); // adapt view distance in the beginning according to whether client is on foot or vehicle. }; -// Set the EH which waits for any of the view distance settings to be changed (avoids the player having to enter or leave their vehicle for the changes to have effect.) +// Set the EH which waits for any of the view distance settings to be changed, avoids the player having to enter or leave a vehicle for the changes to have effect. ["SettingChanged",{ if ((_this select 0 == QGVAR(viewDistanceOnFoot)) || (_this select 0 == QGVAR(viewDistanceLandVehicle)) || (_this select 0 == QGVAR(viewDistanceAirVehicle))) then { - [] call FUNC(adaptViewDistance); + [true] call FUNC(adaptViewDistance); }; },true] call ace_common_fnc_addEventHandler; // Set the EH which waits for a vehicle change to automatically swap to On Foot/In Land Vehicle/In Air Vehicle -["playerVehicleChanged",{[] call FUNC(adaptViewDistance)},true] call ace_common_fnc_addEventHandler; \ No newline at end of file +["playerVehicleChanged",{[false] call FUNC(adaptViewDistance)},true] call ace_common_fnc_addEventHandler; \ No newline at end of file From 2ce133675a6a946a69f3686d0742881b41889aa6 Mon Sep 17 00:00:00 2001 From: SAM Date: Sun, 10 May 2015 12:28:58 +0200 Subject: [PATCH 057/172] Removed terrain grid related configs --- addons/viewdistance/CfgVehicles.hpp | 6 ------ 1 file changed, 6 deletions(-) diff --git a/addons/viewdistance/CfgVehicles.hpp b/addons/viewdistance/CfgVehicles.hpp index 99897f5441..870c669601 100644 --- a/addons/viewdistance/CfgVehicles.hpp +++ b/addons/viewdistance/CfgVehicles.hpp @@ -15,12 +15,6 @@ class CfgVehicles { typeName = "NUMBER"; defaultValue = 10000; }; - class moduleTerrainGridLimit { - displayName = "Terrain Grid Limit"; - description = "Sets the limit for how high clients can raise their terrain grid (<= 50)"; - typeName = "NUMBER"; - defaultValue = 50; // range is 3.125 - 50 Reference: https://community.bistudio.com/wiki/setTerrainGrid - }; }; }; }; \ No newline at end of file From 6a6681872cc1f3d29009c1fa666deed8eec4647b Mon Sep 17 00:00:00 2001 From: SAM Date: Sun, 10 May 2015 12:54:53 +0200 Subject: [PATCH 058/172] Replaced player with ACE_player --- addons/viewdistance/functions/fnc_adaptViewDistance.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf index 946c601fc8..c81b522747 100644 --- a/addons/viewdistance/functions/fnc_adaptViewDistance.sqf +++ b/addons/viewdistance/functions/fnc_adaptViewDistance.sqf @@ -21,8 +21,8 @@ PARAMS_1(_show_prompt); private["_land_vehicle","_air_vehicle"]; -_land_vehicle = (vehicle player) isKindOf "LandVehicle"; -_air_vehicle = (vehicle player) isKindOf "Air"; +_land_vehicle = (vehicle ACE_player) isKindOf "LandVehicle"; +_air_vehicle = (vehicle ACE_player) isKindOf "Air"; if (!_land_vehicle && !_air_vehicle) exitWith { [GVAR(viewDistanceOnFoot),_show_prompt] call FUNC(changeViewDistance); From 283768fabb2da7e5741a3c305be449bff8e07699 Mon Sep 17 00:00:00 2001 From: SAM Date: Sun, 10 May 2015 12:56:05 +0200 Subject: [PATCH 059/172] Fixed code style in switch statement --- .../functions/fnc_returnValue.sqf | 29 +++++++++---------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/addons/viewdistance/functions/fnc_returnValue.sqf b/addons/viewdistance/functions/fnc_returnValue.sqf index 86b940d582..80e82feee2 100644 --- a/addons/viewdistance/functions/fnc_returnValue.sqf +++ b/addons/viewdistance/functions/fnc_returnValue.sqf @@ -21,21 +21,20 @@ PARAMS_1(_index); private ["_return"]; -_return = switch (_index) do -{ - case 0: {1500}; - case 1: {2000}; - case 2: {2500}; - case 3: {3000}; - case 4: {3500}; - case 5: {4000}; - case 6: {5000}; - case 7: {6000}; - case 8: {7000}; - case 9: {8000}; - case 10: {9000}; - case 11: {10000}; - default {1000}; +_return = switch (_index) do { + case 0: {1500}; + case 1: {2000}; + case 2: {2500}; + case 3: {3000}; + case 4: {3500}; + case 5: {4000}; + case 6: {5000}; + case 7: {6000}; + case 8: {7000}; + case 9: {8000}; + case 10: {9000}; + case 11: {10000}; + default {1000}; }; _return; \ No newline at end of file From 495e94f3f0071d2355e6af636c6bb15a3ac768b9 Mon Sep 17 00:00:00 2001 From: SAM Date: Sun, 10 May 2015 13:04:08 +0200 Subject: [PATCH 060/172] Merged fnc_init.sqf into XEH_postInit.sqf --- addons/viewdistance/XEH_postInit.sqf | 19 ++++++++++- addons/viewdistance/XEH_preInit.sqf | 1 - addons/viewdistance/functions/fnc_init.sqf | 37 ---------------------- 3 files changed, 18 insertions(+), 39 deletions(-) delete mode 100644 addons/viewdistance/functions/fnc_init.sqf diff --git a/addons/viewdistance/XEH_postInit.sqf b/addons/viewdistance/XEH_postInit.sqf index f5c15322bf..d3924666c2 100644 --- a/addons/viewdistance/XEH_postInit.sqf +++ b/addons/viewdistance/XEH_postInit.sqf @@ -1,3 +1,20 @@ #include "script_component.hpp" -[] call FUNC(init); \ No newline at end of file +if (!hasInterface) exitWith {}; + +if (viewDistance > GVAR(limitViewDistance)) then { + setViewDistance GVAR(limitViewDistance); // force the view distance down to the limit. + setObjectViewDistance (0.8 * GVAR(limitViewDistance)); +} else { + [true] call FUNC(adaptViewDistance); // adapt view distance in the beginning according to whether client is on foot or vehicle. +}; + +// Set the EH which waits for any of the view distance settings to be changed, avoids the player having to enter or leave a vehicle for the changes to have effect. +["SettingChanged",{ + if ((_this select 0 == QGVAR(viewDistanceOnFoot)) || (_this select 0 == QGVAR(viewDistanceLandVehicle)) || (_this select 0 == QGVAR(viewDistanceAirVehicle))) then { + [true] call FUNC(adaptViewDistance); + }; +},true] call ace_common_fnc_addEventHandler; + +// Set the EH which waits for a vehicle change to automatically swap to On Foot/In Land Vehicle/In Air Vehicle +["playerVehicleChanged",{[false] call FUNC(adaptViewDistance)},true] call ace_common_fnc_addEventHandler; \ No newline at end of file diff --git a/addons/viewdistance/XEH_preInit.sqf b/addons/viewdistance/XEH_preInit.sqf index a44fab6169..a55e0a3075 100644 --- a/addons/viewdistance/XEH_preInit.sqf +++ b/addons/viewdistance/XEH_preInit.sqf @@ -3,7 +3,6 @@ ADDON = false; PREP(initModule); -PREP(init); PREP(returnValue); PREP(changeViewDistance); PREP(adaptViewDistance); diff --git a/addons/viewdistance/functions/fnc_init.sqf b/addons/viewdistance/functions/fnc_init.sqf deleted file mode 100644 index 07befd157c..0000000000 --- a/addons/viewdistance/functions/fnc_init.sqf +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Author: Winter - * Assigns the Event Handler which triggers when a player adjusts their view distance in the menu - * - * - * Arguments: - * None - * - * Return Value: - * None - * - * Example: - * [] call ace_viewdistance_fnc_initViewDistance; - * - * Public: Yes - */ - -#include "script_component.hpp" - -if (!hasInterface) exitWith {}; - -if (viewDistance > GVAR(limitViewDistance)) then { - setViewDistance GVAR(limitViewDistance); // force the view distance down to the limit. - setObjectViewDistance (0.8 * GVAR(limitViewDistance)); -} else { - [true] call FUNC(adaptViewDistance); // adapt view distance in the beginning according to whether client is on foot or vehicle. -}; - -// Set the EH which waits for any of the view distance settings to be changed, avoids the player having to enter or leave a vehicle for the changes to have effect. -["SettingChanged",{ - if ((_this select 0 == QGVAR(viewDistanceOnFoot)) || (_this select 0 == QGVAR(viewDistanceLandVehicle)) || (_this select 0 == QGVAR(viewDistanceAirVehicle))) then { - [true] call FUNC(adaptViewDistance); - }; -},true] call ace_common_fnc_addEventHandler; - -// Set the EH which waits for a vehicle change to automatically swap to On Foot/In Land Vehicle/In Air Vehicle -["playerVehicleChanged",{[false] call FUNC(adaptViewDistance)},true] call ace_common_fnc_addEventHandler; \ No newline at end of file From cb64f7d1a9276d1bf256e66039b57f2b3f281cc5 Mon Sep 17 00:00:00 2001 From: SAM Date: Sun, 10 May 2015 13:28:18 +0200 Subject: [PATCH 061/172] Adjusted PBOPREFIX --- addons/viewdistance/$PBOPREFIX$ | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/viewdistance/$PBOPREFIX$ b/addons/viewdistance/$PBOPREFIX$ index 39789fcaba..278df54db3 100644 --- a/addons/viewdistance/$PBOPREFIX$ +++ b/addons/viewdistance/$PBOPREFIX$ @@ -1 +1 @@ -z\ace\addons\blank \ No newline at end of file +z\ace\addons\viewdistance \ No newline at end of file From 235534292f316dc3d85463b70191d1dc6d04f463 Mon Sep 17 00:00:00 2001 From: ulteq Date: Sun, 10 May 2015 16:31:56 +0200 Subject: [PATCH 062/172] Rifle dispersion overhaul: *Added dispersion values for the new marksmen rifles (when needed) *Overworked some of the (ridiculous) existing values *Made use of the vanilla values whenever possible --- addons/ballistics/CfgWeapons.hpp | 175 ++++++++++++++++--------------- 1 file changed, 92 insertions(+), 83 deletions(-) diff --git a/addons/ballistics/CfgWeapons.hpp b/addons/ballistics/CfgWeapons.hpp index 34c18a90dd..15f70d643d 100644 --- a/addons/ballistics/CfgWeapons.hpp +++ b/addons/ballistics/CfgWeapons.hpp @@ -1,16 +1,13 @@ +class Single; +class Burst; +class FullAuto; class Mode_SemiAuto; +class Mode_Burst; class Mode_FullAuto; class CfgWeapons { - class DMR_02_base_F; - class DMR_03_base_F; - class DMR_04_base_F; - class DMR_05_base_F; - class DMR_06_base_F; - class GM6_base_F; class LMG_RCWS; - class LRR_base_F; class MGun; class MGunCore; class MMG_01_base_F; @@ -22,19 +19,83 @@ class CfgWeapons { /* Long Rifles */ + class GM6_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + }; + + class LRR_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.00020; // radians. Equal to 0.70 MOA. + }; + }; + + class DMR_06_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + + class FullAuto: Mode_FullAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + }; + + class DMR_05_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + + class FullAuto: Mode_FullAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + }; + + class DMR_04_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + }; + + class DMR_03_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.00032; // radians. Equal to 1.10 MOA. + }; + + class FullAuto: Mode_FullAuto { + dispersion = 0.00032; // radians. Equal to 1.10 MOA. + }; + }; + + class DMR_02_base_F: Rifle_Long_Base_F { + class Single: Mode_SemiAuto { + dispersion = 0.000262; // radians. Equal to 0.90 MOA. + }; + }; + + class DMR_01_base_F: Rifle_Long_Base_F { + class WeaponSlotsInfo: WeaponSlotsInfo { + class MuzzleSlot: MuzzleSlot { + compatibleItems[] += {"ACE_muzzle_mzls_B"}; + }; + }; + class Single: Mode_SemiAuto { + dispersion = 0.0004; // radians. Equal to 1.375 MOA. + }; + }; + class EBR_base_F: Rifle_Long_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { class MuzzleSlot: MuzzleSlot { compatibleItems[] += {"ACE_muzzle_mzls_B"}; }; }; - }; - - class DMR_01_base_F: Rifle_Long_Base_F { - class WeaponSlotsInfo: WeaponSlotsInfo { - class MuzzleSlot: MuzzleSlot { - compatibleItems[] += {"ACE_muzzle_mzls_B"}; - }; + class Single: Mode_SemiAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. + }; + + class FullAuto: Mode_FullAuto { + dispersion = 0.00029; // radians. Equal to 1.00 MOA. }; }; @@ -46,14 +107,6 @@ class CfgWeapons { compatibleItems[] += {"ACE_muzzle_mzls_H"}; }; }; - class Single: Mode_SemiAuto { - dispersion = 0.000800; // radians. Equal to 2.75 MOA. - // Based on widely cited 2 MOA figure for new 5.56 ACR. - }; - - class FullAuto: Mode_FullAuto { - dispersion = 0.00147; // radians. Equal to 5.1 MOA. - }; }; class arifle_MX_SW_F: arifle_MX_Base_F { magazines[] = { @@ -74,14 +127,6 @@ class CfgWeapons { compatibleItems[] = {"muzzle_snds_H","muzzle_snds_H_SW","ACE_muzzle_mzls_H"}; }; }; - class Single: Mode_SemiAuto { - dispersion = 0.000800; // radians. Equal to 2.75 MOA. - // Based on widely cited 2 MOA figure for new 5.56 ACR. - }; - - class manual: FullAuto { - dispersion = 0.00147; // radians. Equal to 5.1 MOA. - }; }; class arifle_MXM_F: arifle_MX_Base_F { magazines[] = { @@ -95,12 +140,11 @@ class CfgWeapons { ACE_barrelTwist=228.6; ACE_barrelLength=457.2; class Single: Single { - dispersion = 0.00029; // radians. Equal to 1 MOA. - // 6.5mm is easily capable of this in a half-tuned rifle. + dispersion = 0.000436; // radians. Equal to 1.50 MOA. }; class FullAuto: FullAuto { - dispersion = 0.000800; // radians. Equal to 2.75 MOA. + dispersion = 0.000436; // radians. Equal to 1.50 MOA. }; }; @@ -112,15 +156,6 @@ class CfgWeapons { compatibleItems[] += {"ACE_muzzle_mzls_H"}; }; }; - class Single: Mode_SemiAuto { - dispersion = 0.000800; // radians. Equal to 2.75 MOA. - // Based on widely cited 2 MOA figure for new 5.56 ACR? - // Use your imagination for fictional weapons! - }; - - class FullAuto: Mode_FullAuto { - dispersion = 0.00147; // radians. Equal to 5.1 MOA. - }; }; @@ -139,13 +174,6 @@ class CfgWeapons { }; ACE_barrelTwist=177.8; ACE_barrelLength=317.5; - class manual: Mode_FullAuto { - dispersion = 0.00175; // radians. Equal to 6 MOA. - }; - - class Single: manual { - dispersion = 0.00175; // radians. Equal to 6 MOA. - }; }; class LMG_Zafir_F: Rifle_Long_Base_F { initSpeed = -1.0; @@ -156,13 +184,6 @@ class CfgWeapons { }; ACE_barrelTwist=304.8; ACE_barrelLength=459.74; - class FullAuto: Mode_FullAuto { - dispersion = 0.00175; // radians. Equal to 6 MOA. - }; - - class Single: Mode_SemiAuto { - dispersion = 0.00175; // radians. Equal to 6 MOA. - }; }; @@ -173,13 +194,6 @@ class CfgWeapons { compatibleItems[] += {"ACE_muzzle_mzls_L"}; }; }; - class Single: Mode_SemiAuto { - dispersion = 0.000727; // radians. Equal to 2.5 MOA, about the limit of mass-produced M855. - }; - - class FullAuto: Mode_FullAuto { - dispersion = 0.00147; // radians. Equal to 5.1 MOA. - }; }; class mk20_base_F: Rifle_Base_F { class WeaponSlotsInfo: WeaponSlotsInfo { @@ -187,14 +201,6 @@ class CfgWeapons { compatibleItems[] += {"ACE_muzzle_mzls_L"}; }; }; - class Single: Mode_SemiAuto { - dispersion = 0.0008727; // radians. Equal to 3 MOA, about the limit of mass-produced M855 plus - // some extra for these worn out Greek Army service rifles. - }; - - class FullAuto: Mode_FullAuto { - dispersion = 0.00147; // radians. Equal to 5.1 MOA. - }; }; @@ -202,12 +208,15 @@ class CfgWeapons { class SDAR_base_F: Rifle_Base_F { initSpeed = -0.989; class Single: Mode_SemiAuto { - dispersion = 0.0008727; // radians. Equal to 3 MOA, about the limit of mass-produced M855 plus - // some extra because Kel-Tec. + dispersion = 0.0008727; // radians. Equal to 3 MOA. }; + class Burst: Mode_Burst { + dispersion = 0.0008727; // radians. Equal to 3 MOA. + }; + class FullAuto: Mode_FullAuto { - dispersion = 0.00147; // radians. Equal to 5.1 MOA. + dispersion = 0.0008727; // radians. Equal to 3 MOA. }; }; class pdw2000_base_F: Rifle_Base_F { @@ -642,7 +651,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.9f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -675,7 +684,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.9f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -708,7 +717,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.9f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -741,7 +750,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.9f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -774,7 +783,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.9f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -807,7 +816,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.9f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -840,7 +849,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.9f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -873,7 +882,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.9f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -906,7 +915,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.8f"; + dispersionCoef = "0.9f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; From e0c658560bc50c9cc6d7ce1b11c8db0410432c92 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 10 May 2015 15:33:03 +0100 Subject: [PATCH 063/172] Added myself to authors.txt --- AUTHORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.txt b/AUTHORS.txt index 366664efbd..f1f1db5755 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -72,6 +72,7 @@ Raspu86 Riccardo Petricca Robert Boklahรกnics ramius86 +SilentSpike simon84 Sniperwolf572 Tachi From 1cc5bd1c506d6c6a540bef89d7b1d81856e755aa Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sun, 10 May 2015 07:41:24 -0700 Subject: [PATCH 064/172] removing unneeded debug files --- addons/common/config - Copy.cpp | 167 -------------------------------- server.md5 | 2 - server2.md5 | 3 - server3.md5 | 3 - tools/vm_build.py | 6 -- 5 files changed, 181 deletions(-) delete mode 100644 addons/common/config - Copy.cpp delete mode 100644 server.md5 delete mode 100644 server2.md5 delete mode 100644 server3.md5 delete mode 100644 tools/vm_build.py diff --git a/addons/common/config - Copy.cpp b/addons/common/config - Copy.cpp deleted file mode 100644 index 27647f8d00..0000000000 --- a/addons/common/config - Copy.cpp +++ /dev/null @@ -1,167 +0,0 @@ -#include "script_component.hpp" - -class CfgPatches { - class ADDON { - units[] = {"ACE_Box_Misc", "ACE_bananaItem"}; - weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_main"}; - author[] = {"KoffeinFlummi"}; - authorUrl = "https://github.com/KoffeinFlummi/"; - VERSION_CONFIG; - }; -}; - -#include "CfgEventHandlers.hpp" - -#include "CfgSounds.hpp" -#include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" -#include "CfgMagazines.hpp" - -#include "CfgActions.hpp" -#include "CfgMoves.hpp" -#include "CfgVoice.hpp" -#include "CfgUnitInsignia.hpp" - -class ACE_Rsc_Display_Base { - idd = -1; - type = 0; - style = 48; - name = ""; - duration = 999999; - fadeIn = 0; - fadeOut = 0; - font = "TahomaB"; - size = 1; - colorBackground[] = {1, 1, 1, 0}; - colorText[] = {1, 1, 1, 1}; -}; - -class ACE_Rsc_Control_Base { - idc = 1; - type = 0; - style = 48; - access = 0; - lineSpacing = 0; - moving = 1; - text = ""; - size = 1; - sizeEx = 0; - font = "TahomaB"; - colorBackground[] = {1, 1, 1, 0}; - colorText[] = {1, 1, 1, 1}; - x = 0; - y = 0; - w = 0; - h = 0; -}; - -class ACE_Settings { - /* - *class GVAR(sampleSetting) { - * Value - * value = 1; - * - * Type (SCALAR, BOOL, STRING, ARRAY, COLOR) - * typeName = "SCALAR"; - * - * Force the setting? - * force = 0; - * - * Does it appear on the options menu? - * isClientSettable = 1; - * - * The following settings only apply when isClientSettable == 1 - * Stringtable entry with the setting name - * displayName = "$STR_ACE_Common_SettingName"; - * - * Stringtable entry with the setting description - * description = "$STR_ACE_Common_SettingDescription"; - * - * Stringtable entries that describe the options - * Only applies if typeName == "SCALAR"; - * values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; - *}; - */ - class GVAR(forceAllSettings) { - value = 0; - typeName = "BOOL"; - }; - /*class GVAR(enableNumberHotkeys) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Common_EnableNumberHotkeys"; - };*/ - class GVAR(settingFeedbackIcons) { - value = 1; - typeName = "SCALAR"; - force = 0; - isClientSettable = 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; - isClientSettable = 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"; - isClientSettable = 1; - displayName = "$STR_ACE_Common_SettingDisplayTextColorName"; - description = "$STR_ACE_Common_SettingDisplayTextColorDesc"; - }; - class GVAR(displayTextFontColor) { - value[] = {1,1,1,1}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_Common_SettingDisplayTextFontColorName"; - description = "$STR_ACE_Common_SettingDisplayTextFontColorDesc"; - }; -}; - -#include "define.hpp" -#include -#include -#include - -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}; - }; - }; - }; -}; - -/* -// check dll -class RscStandardDisplay; -class RscDisplayMain: RscStandardDisplay { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayMain"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_5('header','tail',{0},{},_this select 0)] call COMPILE_FILE(functions\fnc_errorMessage)); -}; -*/ - -class ACE_Extensions { - extensions[] = {}; -}; diff --git a/server.md5 b/server.md5 deleted file mode 100644 index 4b55677c68..0000000000 --- a/server.md5 +++ /dev/null @@ -1,2 +0,0 @@ -9f932a56f6d56912c3ed64583086c699 *server\config.cpp -a0d9c8926a9c729e96bb6f5e83072526 *server\script_component.hpp diff --git a/server2.md5 b/server2.md5 deleted file mode 100644 index e5a17d9cc0..0000000000 --- a/server2.md5 +++ /dev/null @@ -1,3 +0,0 @@ -d41d8cd98f00b204e9800998ecf8427e *server\$NOBIN$ -9f932a56f6d56912c3ed64583086c699 *server\config.cpp -a0d9c8926a9c729e96bb6f5e83072526 *server\script_component.hpp diff --git a/server3.md5 b/server3.md5 deleted file mode 100644 index 8c7d3ace7c..0000000000 --- a/server3.md5 +++ /dev/null @@ -1,3 +0,0 @@ -76717b52157b1d55caa07359c789c148 *server\$NOBIN$ -9f932a56f6d56912c3ed64583086c699 *server\config.cpp -a0d9c8926a9c729e96bb6f5e83072526 *server\script_component.hpp diff --git a/tools/vm_build.py b/tools/vm_build.py deleted file mode 100644 index 1d43c6ee30..0000000000 --- a/tools/vm_build.py +++ /dev/null @@ -1,6 +0,0 @@ -import subprocess -try: - result = subprocess.call("python make.py checkexternal test") - print (result) -except: - raise \ No newline at end of file From 318b2437f9db0513ec9a42bc202d5f6f48eebc2a Mon Sep 17 00:00:00 2001 From: jaynus Date: Sun, 10 May 2015 07:42:53 -0700 Subject: [PATCH 065/172] Applied virtual time acceleration to the master ACE_time. Created ACE_tickTime macro, to provide same-frame millisecond resolution. --- addons/common/XEH_preInit.sqf | 1 + addons/common/functions/fnc_timePFH.sqf | 7 ++++--- addons/main/script_macros.hpp | 4 ++++ 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 881d77e156..cb688a419e 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -316,6 +316,7 @@ if (hasInterface) then { ACE_time = diag_tickTime; ACE_realTime = diag_tickTime; ACE_virtualTime = diag_tickTime; +ACE_tickTime = diag_tickTime; ACE_gameTime = time; PREP(timePFH); diff --git a/addons/common/functions/fnc_timePFH.sqf b/addons/common/functions/fnc_timePFH.sqf index e8f0be1efd..968df846cc 100644 --- a/addons/common/functions/fnc_timePFH.sqf +++ b/addons/common/functions/fnc_timePFH.sqf @@ -7,9 +7,9 @@ _lastRealTime = ACE_realTime; _lastGameTime = ACE_gameTime; ACE_gameTime = time; -ACE_realTime = diag_tickTime; +ACE_tickTime = diag_tickTime; -_delta = ACE_realTime - _lastRealTime; +_delta = ACE_tickTime - _lastRealTime; if(ACE_gameTime <= _lastGameTime) then { ACE_paused = true; // Game is paused or not running @@ -18,7 +18,8 @@ if(ACE_gameTime <= _lastGameTime) then { } else { ACE_paused = false; // Time is updating + ACE_realTime = ACE_realTime + _delta; ACE_virtualTime = ACE_virtualTime + (_delta * accTime); - ACE_time = ACE_time + _delta; + ACE_time = ACE_virtualTime; }; diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index d4b6739918..416cc6981f 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -82,4 +82,8 @@ #define HASHLIST_SET(hashList, index, value) ([hashList, index, value, __FILE__, __LINE__] call EFUNC(common,hashListSet)) #define HASHLIST_PUSH(hashList, value) ([hashList, value, __FILE__, __LINE__] call EFUNC(common,hashListPush)) +// Time functions for accuracy per frame +#define ACE_tickTime (ACE_tickTime + (diag_tickTime - ACE_tickTime)) + + #include "script_debug.hpp" \ No newline at end of file From e1c3c40cddac38d0db0565e74d83ba2c4fbde7e6 Mon Sep 17 00:00:00 2001 From: jaynus Date: Sun, 10 May 2015 07:50:58 -0700 Subject: [PATCH 066/172] I need more coffee. this should be more accurate. --- addons/common/XEH_preInit.sqf | 2 +- addons/common/functions/fnc_timePFH.sqf | 4 ++-- addons/main/script_macros.hpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index cb688a419e..8c51ef95d5 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -316,7 +316,7 @@ if (hasInterface) then { ACE_time = diag_tickTime; ACE_realTime = diag_tickTime; ACE_virtualTime = diag_tickTime; -ACE_tickTime = diag_tickTime; +ACE_diagTime = diag_tickTime; ACE_gameTime = time; PREP(timePFH); diff --git a/addons/common/functions/fnc_timePFH.sqf b/addons/common/functions/fnc_timePFH.sqf index 968df846cc..ee8fe4a9bb 100644 --- a/addons/common/functions/fnc_timePFH.sqf +++ b/addons/common/functions/fnc_timePFH.sqf @@ -7,9 +7,9 @@ _lastRealTime = ACE_realTime; _lastGameTime = ACE_gameTime; ACE_gameTime = time; -ACE_tickTime = diag_tickTime; +ACE_diagTime = diag_tickTime; -_delta = ACE_tickTime - _lastRealTime; +_delta = ACE_diagTime - _lastRealTime; if(ACE_gameTime <= _lastGameTime) then { ACE_paused = true; // Game is paused or not running diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 416cc6981f..860e21a54a 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -83,7 +83,7 @@ #define HASHLIST_PUSH(hashList, value) ([hashList, value, __FILE__, __LINE__] call EFUNC(common,hashListPush)) // Time functions for accuracy per frame -#define ACE_tickTime (ACE_tickTime + (diag_tickTime - ACE_tickTime)) +#define ACE_tickTime (ACE_diagTime + (diag_tickTime - ACE_diagTime)) #include "script_debug.hpp" \ No newline at end of file From c39b5931c705e6f73ac0a129ee74c65472efb252 Mon Sep 17 00:00:00 2001 From: jaynus Date: Sun, 10 May 2015 07:56:14 -0700 Subject: [PATCH 067/172] ACE tickTime based on ACE_time. --- addons/main/script_macros.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/main/script_macros.hpp b/addons/main/script_macros.hpp index 860e21a54a..175e5f63c7 100644 --- a/addons/main/script_macros.hpp +++ b/addons/main/script_macros.hpp @@ -83,7 +83,7 @@ #define HASHLIST_PUSH(hashList, value) ([hashList, value, __FILE__, __LINE__] call EFUNC(common,hashListPush)) // Time functions for accuracy per frame -#define ACE_tickTime (ACE_diagTime + (diag_tickTime - ACE_diagTime)) +#define ACE_tickTime (ACE_time + (diag_tickTime - ACE_diagTime)) #include "script_debug.hpp" \ No newline at end of file From 7012b32b558973ff0c62b90c384c1f6e885ae96a Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sun, 10 May 2015 07:56:56 -0700 Subject: [PATCH 068/172] Display the most likely resolution to the Error FAILED TO DETERMINE COMMIT ID. --- tools/make.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/make.py b/tools/make.py index e90beb7703..387332a666 100644 --- a/tools/make.py +++ b/tools/make.py @@ -610,6 +610,7 @@ See the make.cfg file for additional build options. key_name = str(key_name+"-"+commit_id) except: print_error("FAILED TO DETERMINE COMMIT ID.") + print_yellow("Verify that \GIT\BIN or \GIT\CMD is in your system path or user path.") commit_id = "NOGIT" cfg = configparser.ConfigParser(); From eaa0f16e3038c4d21261cb9de5e584daa2e4eba4 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 10 May 2015 17:17:17 +0100 Subject: [PATCH 069/172] Transferring rest of function files --- addons/zeus/functions/fnc_bi_moduleMine.sqf | 18 +++ .../functions/fnc_bi_moduleProjectile.sqf | 141 +++++++++++++++++ .../functions/fnc_bi_moduleRemoteControl.sqf | 149 ++++++++++++++++++ 3 files changed, 308 insertions(+) create mode 100644 addons/zeus/functions/fnc_bi_moduleMine.sqf create mode 100644 addons/zeus/functions/fnc_bi_moduleProjectile.sqf create mode 100644 addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf new file mode 100644 index 0000000000..68e798df3a --- /dev/null +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -0,0 +1,18 @@ +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if (_activated) then { + _explosive = gettext (configfile >> "cfgvehicles" >> typeof _logic >> "explosive"); + if (_explosive != "") then { + _explosive = createvehicle [_explosive,position _logic,[],0,"none"]; + _explosive attachto [_logic]; + + //--- Show hint to curator who placed the object + [[["Curator","PlaceMines"],nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",_logic] call bis_fnc_mp; + + waituntil {sleep 0.1; isnull _explosive || isnull _logic || !alive _logic}; + if (isnull _logic) then {deletevehicle _explosive;} else {_explosive setdamage 1;}; + deletevehicle _logic; + }; +}; \ No newline at end of file diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf new file mode 100644 index 0000000000..7d9a8301f4 --- /dev/null +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -0,0 +1,141 @@ +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if ({local _x} count (objectcurators _logic) > 0) then { + //--- Reveal the circle to curators + _logic hideobject false; + _logic setpos position _logic; +}; +if !(isserver) exitwith {}; + +if (_activated) then { + _ammo = _logic getvariable ["type",gettext (configfile >> "cfgvehicles" >> typeof _logic >> "ammo")]; + if (_ammo != "") then { + _cfgAmmo = configfile >> "cfgammo" >> _ammo; + //if !(isclass _cfgAmmo) exitwith {["CfgAmmo class '%1' not found.",_ammo] call bis_fnc_error;}; + _dirVar = _fnc_scriptname + typeof _logic; + _logic setdir (missionnamespace getvariable [_dirVar,direction _logic]); //--- Restore custom direction + _pos = getposatl _logic; + _posAmmo = +_pos; + _posAmmo set [2,0]; + _dir = direction _logic; + _simulation = tolower gettext (configfile >> "cfgammo" >> _ammo >> "simulation"); + _altitude = 0; + _velocity = []; + _attach = false; + _radio = ""; + _delay = 60; + _sound = ""; + _soundSourceClass = ""; + _hint = []; + _shakeStrength = 0; + _shakeRadius = 0; + switch (_simulation) do { + case "shotshell": { + _altitude = 1000; + _velocity = [0,0,-100]; + _radio = "SentGenIncoming"; + _sounds = if (getnumber (_cfgAmmo >> "hit") < 200) then {["mortar1","mortar2"]} else {["shell1","shell2","shell3","shell4"]}; + _sound = _sounds call bis_fnc_selectrandom; + _hint = ["Curator","PlaceOrdnance"]; + _shakeStrength = 0.01; + _shakeRadius = 300; + }; + case "shotsubmunitions": { + _posAmmo = [_posAmmo,500,_dir + 180] call bis_fnc_relpos; + _altitude = 1000 - ((getterrainheightasl _posAmmo) - (getterrainheightasl _pos)); + _posAmmo set [2,_altitude]; + _velocity = [sin _dir * 68,cos _dir * 68,-100]; + _radio = "SentGenIncoming"; + _hint = ["Curator","PlaceOrdnance"]; + _shakeStrength = 0.02; + _shakeRadius = 500; + }; + case "shotilluminating": { + _altitude = 66; + _velocity = [wind select 0,wind select 1,30]; + _sound = "SN_Flare_Fired_4"; + _soundSourceClass = "SoundFlareLoop_F"; + }; + case "shotnvgmarker"; + case "shotsmokex": { + _altitude = 0; + _velocity = [0,0,0]; + _attach = true; + }; + default {["Ammo simulation '%1' is not supported",_simulation] call bis_fnc_error;}; + }; + if (count _hint > 0) then { + [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectcurators _logic] call bis_fnc_mp; + }; + if (count _velocity == 3) then { + _altitude = (_logic getvariable ["altitude",_altitude]) call bis_fnc_parsenumber; + _radio = _logic getvariable ["radio",_radio]; + + //--- Create projectile + _posAmmo set [2,_altitude]; + _projectile = createvehicle [_ammo,_posAmmo,[],0,"none"]; + _projectile setpos _posAmmo; + _projectile setvelocity _velocity; + if (_attach) then {_projectile attachto [_logic,[0,0,_altitude]];}; + + //--- Play sound + if (_sound != "") then {[[_logic,_sound,"say3D"],"bis_fnc_sayMessage"] call bis_fnc_mp;}; + + //--- Create sound source + _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull}; + + //--- Update + if (_attach) then { + waituntil { + _soundSource setposatl getposatl _projectile; + sleep 1; + isnull _projectile || isnull _logic + }; + } else { + waituntil { + _soundSource setposatl getposatl _projectile; + + if (getposatl _logic distance _pos > 0 || direction _logic != _dir) then { + _posNew = getposasl _logic; + _dirDiff = direction _logic - _dir; + _posNew = [_posNew,[getposasl _projectile,_pos] call bis_fnc_distance2d,direction _logic + 180] call bis_fnc_relpos; + _posNew set [2,getposasl _projectile select 2]; + _projectile setvelocity ([velocity _projectile,-_dirDiff] call bis_fnc_rotatevector2d); + _projectile setposasl _posNew; + _pos = getposatl _logic; + _dir = direction _logic; + missionnamespace setvariable [_dirVar,_dir]; + }; + sleep 0.1; + isnull _projectile || isnull _logic + }; + }; + deletevehicle _projectile; + deletevehicle _soundSource; + if (count objectcurators _logic > 0) then { + + //--- Delete curator spawned logic + if (_shakeStrength > 0) then { + if (_simulation == "shotsubmunitions") then {sleep 0.5;}; + [[_shakeStrength,0.7,[position _logic,_shakeRadius]],"bis_fnc_shakeCuratorCamera"] call bis_fnc_mp; + }; + deletevehicle _logic; + } else { + + //--- Repeat to achieve permanent effect + _repeat = _logic getvariable ["repeat",0] > 0; + if (_repeat) then { + [_logic,_units,_activated] call bis_fnc_moduleprojectile; + } else { + deletevehicle _logic; + }; + }; + } else { + deletevehicle _logic; + }; + } else { + ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeof _logic] call bis_fnc_error; + }; +}; \ No newline at end of file diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf new file mode 100644 index 0000000000..cbf1ae69c2 --- /dev/null +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -0,0 +1,149 @@ +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if (_activated && local _logic && !isnull curatorcamera) then { + + //--- Terminate when remote control is already in progress + if !(isnull (missionnamespace getvariable ["bis_fnc_moduleRemoteControl_unit",objnull])) exitwith {}; + + //--- Get unit under cursor + _unit = objnull; + _mouseOver = missionnamespace getvariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; + if ((_mouseOver select 0) == typename objnull) then {_unit = _mouseOver select 1;}; + _unit = effectivecommander _unit; + + //--- Check if the unit is suitable + _error = ""; + if !(side group _unit in [east,west,resistance,civilian]) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorEmpty";}; + if (isplayer _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer";}; + if !(alive _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorDestroyed";}; + if (isnull _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorNull";}; + if !(isnull (_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull])) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; + + if (_error == "") then { + _unit spawn { + scriptname "bis_fnc_moduleRemoteControl: Loop"; + _unit = _this; + _vehicle = vehicle _unit; + _vehicleRole = str assignedvehiclerole _unit; + + bis_fnc_moduleRemoteControl_unit = _unit; + _unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true]; + + _blur = ppeffectcreate ["RadialBlur",144]; + _blur ppeffectenable true; + _blur ppeffectadjust [0,0,0.3,0.3]; + _blur ppeffectcommit 0; + _blur ppeffectadjust [0.03,0.03,0.1,0.1]; + _blur ppeffectcommit 1; + + _cam = "camera" camcreate getposatl curatorcamera; + _cam cameraeffect ["internal","back"]; + _cam campreparetarget (screentoworld [0.5,0.5]); + _cam camcommitprepared 0; + _cam campreparetarget _unit; + _cam campreparefov 0.1; + _cam camcommitprepared 1; + sleep 0.75; + + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",0.25]; + sleep 0.25; + + //--- Wait for interface to close + (finddisplay 312) closedisplay 2; + waituntil {isnull curatorcamera}; + + //--- Switch + player remotecontrol _unit; + if (cameraon != _vehicle) then { + _vehicle switchcamera cameraview; + }; + + ppeffectdestroy _blur; + _cam cameraeffect ["terminate","back"]; + camdestroy _cam; + + _color = ppeffectcreate ["colorCorrections",1896]; + _color ppeffectenable true; + _color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.0,0,0,0,0.5,1]]; + _color ppeffectcommit 0; + + _curator = getassignedcuratorlogic player; + [_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,true]] call bis_fnc_callScriptedEventHandler; + [["Curator","RemoteControl"],nil,nil,nil,nil,nil,nil,true] call bis_fnc_advHint; + + sleep 0.3; + _color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.85,0,0,0,0.5,1]]; + _color ppeffectcommit 0.3; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",0.5]; + + //--- Back to player + _vehicle = vehicle _unit; + _vehicleRole = str assignedvehiclerole _unit; + _rating = rating player; + waituntil { + //--- Refresh when vehicle or vehicle role changes + if ((vehicle _unit != _vehicle || str assignedvehiclerole _unit != _vehicleRole) && {alive _unit}) then { + player remotecontrol _unit; + _vehicle = vehicle _unit; + _vehicleRole = str assignedvehiclerole _unit; + }; + if (rating player < _rating) then { + player addrating (-rating player + _rating); + }; + sleep 0.01; + !isnull curatorcamera + || + {cameraon == vehicle player} + || + {!alive _unit} //--- Also isnull check, objNull is not alive + || + {isnull getassignedcuratorlogic player} + //|| + //{_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] != player} //--- Another curator stole the unit + }; + + player addrating (-rating player + _rating); + objnull remotecontrol _unit; + _unit setvariable ["bis_fnc_moduleRemoteControl_owner",nil,true]; + + //--- Death screen + if ( + isnull curatorcamera + && + {cameraon != vehicle player} + && + {!isnull _unit} + && + {!isnull getassignedcuratorlogic player} + //&& + //{(_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] == player)} + ) then { + sleep 2; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",1]; + sleep 1; + }; + _unitPos = getposatl _unit; + _camPos = [_unitPos,10,direction _unit + 180] call bis_fnc_relpos; + _camPos set [2,(_unitPos select 2) + (getterrainheightasl _unitPos) - (getterrainheightasl _camPos) + 10]; + //[_camPos,_unit] call bis_fnc_setcuratorcamera; + (getassignedcuratorlogic player) setvariable ["bis_fnc_modulecuratorsetcamera_params",[_camPos,_unit]]; + + sleep 0.1; //--- Engine needs a delay in case controlled unit was deleted + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1e10]; + opencuratorinterface; + ppeffectdestroy _color; + + waituntil {!isnull curatorcamera}; + player switchcamera cameraview; + bis_fnc_moduleRemoteControl_unit = nil; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1]; + [_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,false]] call bis_fnc_callScriptedEventHandler; + sleep 0.01; + }; + } else { + [objnull,_error] call bis_fnc_showCuratorFeedbackMessage; + }; + deletevehicle _logic; +}; \ No newline at end of file From 9dd163ac3da97d7605f0906d189ef1b895315887 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 10 May 2015 17:21:18 +0100 Subject: [PATCH 070/172] Use moduleProjectile with ballistics support --- .../functions/fnc_bi_moduleProjectile.sqf | 303 +++++++++++------- 1 file changed, 179 insertions(+), 124 deletions(-) diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index 7d9a8301f4..e6b98588a6 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -1,141 +1,196 @@ +/* + * Author: Bohemia Interactive + * Module function for spawning projectiles + * Used by Curator artillery modules etc + * Edited to remove radio warning (also retiained ballistics support) + * + * Arguments: + * 0: The logic object + * + * Return Value: + * nil + * + * Public: No + */ + +_fnc_scriptNameParentTemp = if !(isnil '_fnc_scriptName') then {_fnc_scriptName} else {'BIS_fnc_moduleProjectile'}; +private ['_fnc_scriptNameParent']; +_fnc_scriptNameParent = _fnc_scriptNameParentTemp; +_fnc_scriptNameParentTemp = nil; + +private ['_fnc_scriptName']; +_fnc_scriptName = 'BIS_fnc_moduleProjectile'; +scriptname _fnc_scriptName; + +private ["_logic", "_units", "_activated"]; _logic = _this select 0; _units = _this select 1; _activated = _this select 2; if ({local _x} count (objectcurators _logic) > 0) then { - //--- Reveal the circle to curators - _logic hideobject false; - _logic setpos position _logic; + //--- Reveal the circle to curators + _logic hideobject false; + _logic setpos position _logic; }; if !(isserver) exitwith {}; if (_activated) then { - _ammo = _logic getvariable ["type",gettext (configfile >> "cfgvehicles" >> typeof _logic >> "ammo")]; - if (_ammo != "") then { - _cfgAmmo = configfile >> "cfgammo" >> _ammo; - //if !(isclass _cfgAmmo) exitwith {["CfgAmmo class '%1' not found.",_ammo] call bis_fnc_error;}; - _dirVar = _fnc_scriptname + typeof _logic; - _logic setdir (missionnamespace getvariable [_dirVar,direction _logic]); //--- Restore custom direction - _pos = getposatl _logic; - _posAmmo = +_pos; - _posAmmo set [2,0]; - _dir = direction _logic; - _simulation = tolower gettext (configfile >> "cfgammo" >> _ammo >> "simulation"); - _altitude = 0; - _velocity = []; - _attach = false; - _radio = ""; - _delay = 60; - _sound = ""; - _soundSourceClass = ""; - _hint = []; - _shakeStrength = 0; - _shakeRadius = 0; - switch (_simulation) do { - case "shotshell": { - _altitude = 1000; - _velocity = [0,0,-100]; - _radio = "SentGenIncoming"; - _sounds = if (getnumber (_cfgAmmo >> "hit") < 200) then {["mortar1","mortar2"]} else {["shell1","shell2","shell3","shell4"]}; - _sound = _sounds call bis_fnc_selectrandom; - _hint = ["Curator","PlaceOrdnance"]; - _shakeStrength = 0.01; - _shakeRadius = 300; - }; - case "shotsubmunitions": { - _posAmmo = [_posAmmo,500,_dir + 180] call bis_fnc_relpos; - _altitude = 1000 - ((getterrainheightasl _posAmmo) - (getterrainheightasl _pos)); - _posAmmo set [2,_altitude]; - _velocity = [sin _dir * 68,cos _dir * 68,-100]; - _radio = "SentGenIncoming"; - _hint = ["Curator","PlaceOrdnance"]; - _shakeStrength = 0.02; - _shakeRadius = 500; - }; - case "shotilluminating": { - _altitude = 66; - _velocity = [wind select 0,wind select 1,30]; - _sound = "SN_Flare_Fired_4"; - _soundSourceClass = "SoundFlareLoop_F"; - }; - case "shotnvgmarker"; - case "shotsmokex": { - _altitude = 0; - _velocity = [0,0,0]; - _attach = true; - }; - default {["Ammo simulation '%1' is not supported",_simulation] call bis_fnc_error;}; - }; - if (count _hint > 0) then { - [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectcurators _logic] call bis_fnc_mp; - }; - if (count _velocity == 3) then { - _altitude = (_logic getvariable ["altitude",_altitude]) call bis_fnc_parsenumber; - _radio = _logic getvariable ["radio",_radio]; + _ammo = _logic getvariable ["type",gettext (configfile >> "cfgvehicles" >> typeof _logic >> "ammo")]; + if (_ammo != "") then { + _cfgAmmo = configfile >> "cfgammo" >> _ammo; + //if !(isclass _cfgAmmo) exitwith {["CfgAmmo class '%1' not found.",_ammo] call bis_fnc_error;}; + _dirVar = _fnc_scriptname + typeof _logic; + _logic setdir (missionnamespace getvariable [_dirVar,direction _logic]); //--- Restore custom direction + _pos = getposatl _logic; + _posAmmo = +_pos; + _posAmmo set [2,0]; + _dir = direction _logic; + _simulation = tolower gettext (configfile >> "cfgammo" >> _ammo >> "simulation"); + _altitude = 0; + _velocity = []; + _attach = false; + _radio = ""; + _delay = 60; + _sound = ""; + _soundSourceClass = ""; + _hint = []; + _shakeStrength = 0; + _shakeRadius = 0; + switch (_simulation) do { + case "shotshell": { + _altitude = 1000; + _velocity = [0,0,-100]; + _radio = "SentGenIncoming"; + _sounds = if (getnumber (_cfgAmmo >> "hit") < 200) then {["mortar1","mortar2"]} else {["shell1","shell2","shell3","shell4"]}; + _sound = _sounds call bis_fnc_selectrandom; + _hint = ["Curator","PlaceOrdnance"]; + _shakeStrength = 0.01; + _shakeRadius = 300; + }; + case "shotsubmunitions": { + _posAmmo = [_posAmmo,500,_dir + 180] call bis_fnc_relpos; + _altitude = 1000 - ((getterrainheightasl _posAmmo) - (getterrainheightasl _pos)); + _posAmmo set [2,_altitude]; + _velocity = [sin _dir * 68,cos _dir * 68,-100]; + _radio = "SentGenIncoming"; + _hint = ["Curator","PlaceOrdnance"]; + _shakeStrength = 0.02; + _shakeRadius = 500; + }; + case "shotilluminating": { + _altitude = 66; + _velocity = [wind select 0,wind select 1,30]; + _sound = "SN_Flare_Fired_4"; + _soundSourceClass = "SoundFlareLoop_F"; + }; + case "shotnvgmarker"; + case "shotsmokex": { + _altitude = 0; + _velocity = [0,0,0]; + _attach = true; + }; + default {["Ammo simulation '%1' is not supported",_simulation] call bis_fnc_error;}; + }; + /* Removed by ACE + _fnc_playRadio = { + if (_radio != "") then { + _entities = (getposatl _logic) nearentities ["All",100]; + _sides = []; + { + if (isplayer _x) then { + _side = side group _x; + if (_side in [east,west,resistance,civilian]) then { + //--- Play radio (only if it wasn't played recently) + if (time > _x getvariable ["BIS_fnc_moduleProjectile_radio",-_delay]) then { + [[_side,_radio,"side"],"bis_fnc_sayMessage",_x] call bis_fnc_mp; + _x setvariable ["BIS_fnc_moduleProjectile_radio",time + _delay]; + }; + }; + }; + } foreach _entities; + }; + }; + */ + if (count _hint > 0) then { + [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectcurators _logic] call bis_fnc_mp; + }; + if (count _velocity == 3) then { + _altitude = (_logic getvariable ["altitude",_altitude]) call bis_fnc_parsenumber; + _radio = _logic getvariable ["radio",_radio]; - //--- Create projectile - _posAmmo set [2,_altitude]; - _projectile = createvehicle [_ammo,_posAmmo,[],0,"none"]; - _projectile setpos _posAmmo; - _projectile setvelocity _velocity; - if (_attach) then {_projectile attachto [_logic,[0,0,_altitude]];}; + //--- Create projectile + _posAmmo set [2,_altitude]; + _projectile = createvehicle [_ammo,_posAmmo,[],0,"none"]; + _projectile setpos _posAmmo; + _projectile setvelocity _velocity; + if (_attach) then {_projectile attachto [_logic,[0,0,_altitude]];}; - //--- Play sound - if (_sound != "") then {[[_logic,_sound,"say3D"],"bis_fnc_sayMessage"] call bis_fnc_mp;}; + // This is our addition to this function + if (!isnil "ace_frag_fnc_addManualTrack") then { + [_projectile] call ace_frag_fnc_addManualTrack + }; - //--- Create sound source - _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull}; + //--- Play sound + if (_sound != "") then {[[_logic,_sound,"say3D"],"bis_fnc_sayMessage"] call bis_fnc_mp;}; - //--- Update - if (_attach) then { - waituntil { - _soundSource setposatl getposatl _projectile; - sleep 1; - isnull _projectile || isnull _logic - }; - } else { - waituntil { - _soundSource setposatl getposatl _projectile; + //--- Create sound source + _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull}; - if (getposatl _logic distance _pos > 0 || direction _logic != _dir) then { - _posNew = getposasl _logic; - _dirDiff = direction _logic - _dir; - _posNew = [_posNew,[getposasl _projectile,_pos] call bis_fnc_distance2d,direction _logic + 180] call bis_fnc_relpos; - _posNew set [2,getposasl _projectile select 2]; - _projectile setvelocity ([velocity _projectile,-_dirDiff] call bis_fnc_rotatevector2d); - _projectile setposasl _posNew; - _pos = getposatl _logic; - _dir = direction _logic; - missionnamespace setvariable [_dirVar,_dir]; - }; - sleep 0.1; - isnull _projectile || isnull _logic - }; - }; - deletevehicle _projectile; - deletevehicle _soundSource; - if (count objectcurators _logic > 0) then { + /* Removed by ACE + //--- Play radio warning + [] call _fnc_playRadio; + */ - //--- Delete curator spawned logic - if (_shakeStrength > 0) then { - if (_simulation == "shotsubmunitions") then {sleep 0.5;}; - [[_shakeStrength,0.7,[position _logic,_shakeRadius]],"bis_fnc_shakeCuratorCamera"] call bis_fnc_mp; - }; - deletevehicle _logic; - } else { + //--- Update + if (_attach) then { + waituntil { + _soundSource setposatl getposatl _projectile; + sleep 1; + isnull _projectile || isnull _logic + }; + } else { + waituntil { + _soundSource setposatl getposatl _projectile; - //--- Repeat to achieve permanent effect - _repeat = _logic getvariable ["repeat",0] > 0; - if (_repeat) then { - [_logic,_units,_activated] call bis_fnc_moduleprojectile; - } else { - deletevehicle _logic; - }; - }; - } else { - deletevehicle _logic; - }; - } else { - ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeof _logic] call bis_fnc_error; - }; + if (getposatl _logic distance _pos > 0 || direction _logic != _dir) then { + _posNew = getposasl _logic; + _dirDiff = direction _logic - _dir; + _posNew = [_posNew,[getposasl _projectile,_pos] call bis_fnc_distance2d,direction _logic + 180] call bis_fnc_relpos; + _posNew set [2,getposasl _projectile select 2]; + _projectile setvelocity ([velocity _projectile,-_dirDiff] call bis_fnc_rotatevector2d); + _projectile setposasl _posNew; + _pos = getposatl _logic; + _dir = direction _logic; + missionnamespace setvariable [_dirVar,_dir]; + }; + sleep 0.1; + isnull _projectile || isnull _logic + }; + }; + deletevehicle _projectile; + deletevehicle _soundSource; + if (count objectcurators _logic > 0) then { + + //--- Delete curator spawned logic + if (_shakeStrength > 0) then { + if (_simulation == "shotsubmunitions") then {sleep 0.5;}; + [[_shakeStrength,0.7,[position _logic,_shakeRadius]],"bis_fnc_shakeCuratorCamera"] call bis_fnc_mp; + }; + deletevehicle _logic; + } else { + + //--- Repeat to achieve permanent effect + _repeat = _logic getvariable ["repeat",0] > 0; + if (_repeat) then { + [_logic,_units,_activated] call bis_fnc_moduleprojectile; + } else { + deletevehicle _logic; + }; + }; + } else { + deletevehicle _logic; + }; + } else { + ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeof _logic] call bis_fnc_error; + }; }; \ No newline at end of file From 5166e73cc0cd21b6c12e20aedb83cb7971913636 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 10 May 2015 17:26:24 +0100 Subject: [PATCH 071/172] Added commented out code and function prep --- addons/zeus/XEH_preInit.sqf | 3 + addons/zeus/functions/fnc_bi_moduleMine.sqf | 31 ++- .../functions/fnc_bi_moduleRemoteControl.sqf | 253 +++++++++--------- 3 files changed, 153 insertions(+), 134 deletions(-) diff --git a/addons/zeus/XEH_preInit.sqf b/addons/zeus/XEH_preInit.sqf index 2574706239..726f6923b3 100644 --- a/addons/zeus/XEH_preInit.sqf +++ b/addons/zeus/XEH_preInit.sqf @@ -3,5 +3,8 @@ ADDON = false; PREP(bi_moduleCurator); +PREP(bi_moduleMine); +PREP(bi_moduleProjectile); +PREP(bi_moduleRemoteControl); ADDON = true; diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf index 68e798df3a..c3ce200a62 100644 --- a/addons/zeus/functions/fnc_bi_moduleMine.sqf +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -3,16 +3,27 @@ _units = _this select 1; _activated = _this select 2; if (_activated) then { - _explosive = gettext (configfile >> "cfgvehicles" >> typeof _logic >> "explosive"); - if (_explosive != "") then { - _explosive = createvehicle [_explosive,position _logic,[],0,"none"]; - _explosive attachto [_logic]; + _explosive = gettext (configfile >> "cfgvehicles" >> typeof _logic >> "explosive"); + if (_explosive != "") then { + _explosive = createvehicle [_explosive,position _logic,[],0,"none"]; + _explosive attachto [_logic]; - //--- Show hint to curator who placed the object - [[["Curator","PlaceMines"],nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",_logic] call bis_fnc_mp; + /* Removed by ACE + //--- Reveal the mine to curator's side + { + _side = (getassignedcuratorunit _x) call bis_fnc_objectSide; + _side revealmine _explosive; + } foreach (objectcurators _logic); - waituntil {sleep 0.1; isnull _explosive || isnull _logic || !alive _logic}; - if (isnull _logic) then {deletevehicle _explosive;} else {_explosive setdamage 1;}; - deletevehicle _logic; - }; + //--- Mark minefields in the map + [] spawn bis_fnc_drawMinefields; + */ + + //--- Show hint to curator who placed the object + [[["Curator","PlaceMines"],nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",_logic] call bis_fnc_mp; + + waituntil {sleep 0.1; isnull _explosive || isnull _logic || !alive _logic}; + if (isnull _logic) then {deletevehicle _explosive;} else {_explosive setdamage 1;}; + deletevehicle _logic; + }; }; \ No newline at end of file diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index cbf1ae69c2..6289089d5e 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -4,146 +4,151 @@ _activated = _this select 2; if (_activated && local _logic && !isnull curatorcamera) then { - //--- Terminate when remote control is already in progress - if !(isnull (missionnamespace getvariable ["bis_fnc_moduleRemoteControl_unit",objnull])) exitwith {}; + //--- Terminate when remote control is already in progress + if !(isnull (missionnamespace getvariable ["bis_fnc_moduleRemoteControl_unit",objnull])) exitwith {}; - //--- Get unit under cursor - _unit = objnull; - _mouseOver = missionnamespace getvariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; - if ((_mouseOver select 0) == typename objnull) then {_unit = _mouseOver select 1;}; - _unit = effectivecommander _unit; + //--- Get unit under cursor + _unit = objnull; + _mouseOver = missionnamespace getvariable ["bis_fnc_curatorObjectPlaced_mouseOver",[""]]; + if ((_mouseOver select 0) == typename objnull) then {_unit = _mouseOver select 1;}; + _unit = effectivecommander _unit; - //--- Check if the unit is suitable - _error = ""; - if !(side group _unit in [east,west,resistance,civilian]) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorEmpty";}; - if (isplayer _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer";}; - if !(alive _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorDestroyed";}; - if (isnull _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorNull";}; - if !(isnull (_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull])) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; + //--- Check if the unit is suitable + _error = ""; + if !(side group _unit in [east,west,resistance,civilian]) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorEmpty";}; + if (isplayer _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorPlayer";}; + if !(alive _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorDestroyed";}; + if (isnull _unit) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorNull";}; + if !(isnull (_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull])) then {_error = localize "str_a3_cfgvehicles_moduleremotecontrol_f_errorControl";}; - if (_error == "") then { - _unit spawn { - scriptname "bis_fnc_moduleRemoteControl: Loop"; - _unit = _this; - _vehicle = vehicle _unit; - _vehicleRole = str assignedvehiclerole _unit; + if (_error == "") then { + _unit spawn { + scriptname "bis_fnc_moduleRemoteControl: Loop"; + _unit = _this; + _vehicle = vehicle _unit; + _vehicleRole = str assignedvehiclerole _unit; - bis_fnc_moduleRemoteControl_unit = _unit; - _unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true]; + bis_fnc_moduleRemoteControl_unit = _unit; + _unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true]; - _blur = ppeffectcreate ["RadialBlur",144]; - _blur ppeffectenable true; - _blur ppeffectadjust [0,0,0.3,0.3]; - _blur ppeffectcommit 0; - _blur ppeffectadjust [0.03,0.03,0.1,0.1]; - _blur ppeffectcommit 1; + /* Removed by ACE + //--- Play wind cue to all players + [format ["wind%1",ceil random 5],"bis_fnc_playsound"] call bis_fnc_mp; + */ - _cam = "camera" camcreate getposatl curatorcamera; - _cam cameraeffect ["internal","back"]; - _cam campreparetarget (screentoworld [0.5,0.5]); - _cam camcommitprepared 0; - _cam campreparetarget _unit; - _cam campreparefov 0.1; - _cam camcommitprepared 1; - sleep 0.75; + _blur = ppeffectcreate ["RadialBlur",144]; + _blur ppeffectenable true; + _blur ppeffectadjust [0,0,0.3,0.3]; + _blur ppeffectcommit 0; + _blur ppeffectadjust [0.03,0.03,0.1,0.1]; + _blur ppeffectcommit 1; - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",0.25]; - sleep 0.25; + _cam = "camera" camcreate getposatl curatorcamera; + _cam cameraeffect ["internal","back"]; + _cam campreparetarget (screentoworld [0.5,0.5]); + _cam camcommitprepared 0; + _cam campreparetarget _unit; + _cam campreparefov 0.1; + _cam camcommitprepared 1; + sleep 0.75; - //--- Wait for interface to close - (finddisplay 312) closedisplay 2; - waituntil {isnull curatorcamera}; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",0.25]; + sleep 0.25; - //--- Switch - player remotecontrol _unit; - if (cameraon != _vehicle) then { - _vehicle switchcamera cameraview; - }; + //--- Wait for interface to close + (finddisplay 312) closedisplay 2; + waituntil {isnull curatorcamera}; - ppeffectdestroy _blur; - _cam cameraeffect ["terminate","back"]; - camdestroy _cam; + //--- Switch + player remotecontrol _unit; + if (cameraon != _vehicle) then { + _vehicle switchcamera cameraview; + }; - _color = ppeffectcreate ["colorCorrections",1896]; - _color ppeffectenable true; - _color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.0,0,0,0,0.5,1]]; - _color ppeffectcommit 0; + ppeffectdestroy _blur; + _cam cameraeffect ["terminate","back"]; + camdestroy _cam; - _curator = getassignedcuratorlogic player; - [_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,true]] call bis_fnc_callScriptedEventHandler; - [["Curator","RemoteControl"],nil,nil,nil,nil,nil,nil,true] call bis_fnc_advHint; + _color = ppeffectcreate ["colorCorrections",1896]; + _color ppeffectenable true; + _color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.0,0,0,0,0.5,1]]; + _color ppeffectcommit 0; - sleep 0.3; - _color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.85,0,0,0,0.5,1]]; - _color ppeffectcommit 0.3; - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",0.5]; + _curator = getassignedcuratorlogic player; + [_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,true]] call bis_fnc_callScriptedEventHandler; + [["Curator","RemoteControl"],nil,nil,nil,nil,nil,nil,true] call bis_fnc_advHint; - //--- Back to player - _vehicle = vehicle _unit; - _vehicleRole = str assignedvehiclerole _unit; - _rating = rating player; - waituntil { - //--- Refresh when vehicle or vehicle role changes - if ((vehicle _unit != _vehicle || str assignedvehiclerole _unit != _vehicleRole) && {alive _unit}) then { - player remotecontrol _unit; - _vehicle = vehicle _unit; - _vehicleRole = str assignedvehiclerole _unit; - }; - if (rating player < _rating) then { - player addrating (-rating player + _rating); - }; - sleep 0.01; - !isnull curatorcamera - || - {cameraon == vehicle player} - || - {!alive _unit} //--- Also isnull check, objNull is not alive - || - {isnull getassignedcuratorlogic player} - //|| - //{_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] != player} //--- Another curator stole the unit - }; + sleep 0.3; + _color ppeffectadjust [1,1,0,[0,0,0,1],[1,1,1,1],[0,0,0,0],[0.9,0.85,0,0,0,0.5,1]]; + _color ppeffectcommit 0.3; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",0.5]; - player addrating (-rating player + _rating); - objnull remotecontrol _unit; - _unit setvariable ["bis_fnc_moduleRemoteControl_owner",nil,true]; + //--- Back to player + _vehicle = vehicle _unit; + _vehicleRole = str assignedvehiclerole _unit; + _rating = rating player; + waituntil { + //--- Refresh when vehicle or vehicle role changes + if ((vehicle _unit != _vehicle || str assignedvehiclerole _unit != _vehicleRole) && {alive _unit}) then { + player remotecontrol _unit; + _vehicle = vehicle _unit; + _vehicleRole = str assignedvehiclerole _unit; + }; + if (rating player < _rating) then { + player addrating (-rating player + _rating); + }; + sleep 0.01; + !isnull curatorcamera + || + {cameraon == vehicle player} + || + {!alive _unit} //--- Also isnull check, objNull is not alive + || + {isnull getassignedcuratorlogic player} + //|| + //{_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] != player} //--- Another curator stole the unit + }; - //--- Death screen - if ( - isnull curatorcamera - && - {cameraon != vehicle player} - && - {!isnull _unit} - && - {!isnull getassignedcuratorlogic player} - //&& - //{(_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] == player)} - ) then { - sleep 2; - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",1]; - sleep 1; - }; - _unitPos = getposatl _unit; - _camPos = [_unitPos,10,direction _unit + 180] call bis_fnc_relpos; - _camPos set [2,(_unitPos select 2) + (getterrainheightasl _unitPos) - (getterrainheightasl _camPos) + 10]; - //[_camPos,_unit] call bis_fnc_setcuratorcamera; - (getassignedcuratorlogic player) setvariable ["bis_fnc_modulecuratorsetcamera_params",[_camPos,_unit]]; + player addrating (-rating player + _rating); + objnull remotecontrol _unit; + _unit setvariable ["bis_fnc_moduleRemoteControl_owner",nil,true]; - sleep 0.1; //--- Engine needs a delay in case controlled unit was deleted - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1e10]; - opencuratorinterface; - ppeffectdestroy _color; + //--- Death screen + if ( + isnull curatorcamera + && + {cameraon != vehicle player} + && + {!isnull _unit} + && + {!isnull getassignedcuratorlogic player} + //&& + //{(_unit getvariable ["bis_fnc_moduleRemoteControl_owner",objnull] == player)} + ) then { + sleep 2; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black out",1]; + sleep 1; + }; + _unitPos = getposatl _unit; + _camPos = [_unitPos,10,direction _unit + 180] call bis_fnc_relpos; + _camPos set [2,(_unitPos select 2) + (getterrainheightasl _unitPos) - (getterrainheightasl _camPos) + 10]; + //[_camPos,_unit] call bis_fnc_setcuratorcamera; + (getassignedcuratorlogic player) setvariable ["bis_fnc_modulecuratorsetcamera_params",[_camPos,_unit]]; - waituntil {!isnull curatorcamera}; - player switchcamera cameraview; - bis_fnc_moduleRemoteControl_unit = nil; - ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1]; - [_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,false]] call bis_fnc_callScriptedEventHandler; - sleep 0.01; - }; - } else { - [objnull,_error] call bis_fnc_showCuratorFeedbackMessage; - }; - deletevehicle _logic; + sleep 0.1; //--- Engine needs a delay in case controlled unit was deleted + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1e10]; + opencuratorinterface; + ppeffectdestroy _color; + + waituntil {!isnull curatorcamera}; + player switchcamera cameraview; + bis_fnc_moduleRemoteControl_unit = nil; + ("bis_fnc_moduleRemoteCurator" call bis_fnc_rscLayer) cuttext ["","black in",1]; + [_curator,"curatorObjectRemoteControlled",[_curator,player,_unit,false]] call bis_fnc_callScriptedEventHandler; + sleep 0.01; + }; + } else { + [objnull,_error] call bis_fnc_showCuratorFeedbackMessage; + }; + deletevehicle _logic; }; \ No newline at end of file From a40277f6f12b0d6228d0a24d837d7d5935c778b9 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 10 May 2015 17:32:01 +0100 Subject: [PATCH 072/172] Module configs and function headers --- addons/zeus/config.cpp | 10 ++++++++++ addons/zeus/functions/fnc_bi_moduleCurator.sqf | 2 -- addons/zeus/functions/fnc_bi_moduleMine.sqf | 14 ++++++++++++++ .../zeus/functions/fnc_bi_moduleRemoteControl.sqf | 14 ++++++++++++++ 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 84d3077a96..3da43d935e 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -16,7 +16,17 @@ class CfgPatches { class CfgVehicles { class Module_F; + class ModuleEmpty_F; class ModuleCurator_F: Module_F { function = QUOTE(FUNC(bi_moduleCurator)); }; + class ModuleMine_F: ModuleEmpty_F { + function = QUOTE(FUNC(bi_moduleMine)); + }; + class ModuleOrdnance_F: Module_F { + function = QUOTE(FUNC(bi_moduleProjectile)); + }; + class ModuleRemoteControl_F: Module_F { + function = QUOTE(FUNC(bi_moduleRemoteControl)); + }; }; \ No newline at end of file diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 640ca7cead..2203cb7f3a 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -12,8 +12,6 @@ * Public: No */ -#include "script_component.hpp" - _logic = _this select 0; _units = _this select 1; _activated = _this select 2; diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf index c3ce200a62..d8142c078d 100644 --- a/addons/zeus/functions/fnc_bi_moduleMine.sqf +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -1,3 +1,17 @@ +/* + * Author: Bohemia Interactive + * Module function for spawning mines + * Edited to remove forced map markers and mines being revealed to players + * + * Arguments: + * 0: The logic object + * + * Return Value: + * nil + * + * Public: No + */ + _logic = _this select 0; _units = _this select 1; _activated = _this select 2; diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index 6289089d5e..bf73a8863e 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -1,3 +1,17 @@ +/* + * Author: Bohemia Interactive + * Module function for remote controlling units as zeus + * Edited to remove global wind sound + * + * Arguments: + * 0: The logic object + * + * Return Value: + * nil + * + * Public: No + */ + _logic = _this select 0; _units = _this select 1; _activated = _this select 2; From c1c10f43b266cc2b7863c441243d1ffb1ed5a822 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 10 May 2015 17:41:43 +0100 Subject: [PATCH 073/172] Fixed typo --- addons/zeus/functions/fnc_bi_moduleProjectile.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index e6b98588a6..afb3f6e4bc 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -2,7 +2,7 @@ * Author: Bohemia Interactive * Module function for spawning projectiles * Used by Curator artillery modules etc - * Edited to remove radio warning (also retiained ballistics support) + * Edited to remove radio warning (also retains ballistics support added by ACE_Modules) * * Arguments: * 0: The logic object From 82f3c65c31ad5788dea8cd7b9e577be638034668 Mon Sep 17 00:00:00 2001 From: ulteq Date: Sun, 10 May 2015 20:06:27 +0200 Subject: [PATCH 074/172] Tuned down the dispersion reduction of suppressors some more --- addons/ballistics/CfgWeapons.hpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/addons/ballistics/CfgWeapons.hpp b/addons/ballistics/CfgWeapons.hpp index 15f70d643d..dfe485c205 100644 --- a/addons/ballistics/CfgWeapons.hpp +++ b/addons/ballistics/CfgWeapons.hpp @@ -651,7 +651,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.9f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -684,7 +684,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.9f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -717,7 +717,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.9f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -750,7 +750,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.9f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -783,7 +783,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.9f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -816,7 +816,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.9f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -849,7 +849,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.9f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -882,7 +882,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.9f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; @@ -915,7 +915,7 @@ class CfgWeapons { }; class MuzzleCoef { - dispersionCoef = "0.9f"; + dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; recoilCoef = "1.0f"; From d321ed27538dff41b76c0887db0243192cee93c8 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 10 May 2015 19:56:35 +0100 Subject: [PATCH 075/172] Changed function variable to match other medical vehicle functions --- addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf index 539d428da0..670818b1f3 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf @@ -44,7 +44,7 @@ if (!isNull _logic) then { if (!isnil "_x") then { if (typeName _x == typeName objNull) then { if (local _x) then { - _x setvariable [QGVAR(medicClass), _setting, true]; + _x setvariable [QGVAR(isMedic), _setting, true]; }; }; }; @@ -54,7 +54,7 @@ if (!isNull _logic) then { if (!isnil "_x") then { if (typeName _x == typeName objNull) then { if (local _x) then { - _x setvariable [QGVAR(medicClass), _setting, true]; + _x setvariable [QGVAR(isMedic), _setting, true]; }; }; }; From 09c19e4ec2bb6343e09cc60931498eed7781ba4b Mon Sep 17 00:00:00 2001 From: ulteq Date: Sun, 10 May 2015 20:58:36 +0200 Subject: [PATCH 076/172] Subtle recoil reduction when using a suppressor --- addons/ballistics/CfgWeapons.hpp | 36 ++++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/addons/ballistics/CfgWeapons.hpp b/addons/ballistics/CfgWeapons.hpp index dfe485c205..571112697a 100644 --- a/addons/ballistics/CfgWeapons.hpp +++ b/addons/ballistics/CfgWeapons.hpp @@ -654,8 +654,8 @@ class CfgWeapons { dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -687,8 +687,8 @@ class CfgWeapons { dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -720,8 +720,8 @@ class CfgWeapons { dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -753,8 +753,8 @@ class CfgWeapons { dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -786,8 +786,8 @@ class CfgWeapons { dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -819,8 +819,8 @@ class CfgWeapons { dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -852,8 +852,8 @@ class CfgWeapons { dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -885,8 +885,8 @@ class CfgWeapons { dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; @@ -918,8 +918,8 @@ class CfgWeapons { dispersionCoef = "0.95f"; artilleryDispersionCoef = "1.0f"; fireLightCoef = "0.5f"; - recoilCoef = "1.0f"; - recoilProneCoef = "1.0f"; + recoilCoef = "0.95f"; + recoilProneCoef = "0.95f"; minRangeCoef = "1.0f"; minRangeProbabCoef = "1.0f"; midRangeCoef = "1.0f"; From 518cfdab9e4c460c2ef6ce088993eea34757f90d Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 10 May 2015 20:19:32 +0100 Subject: [PATCH 077/172] isMedic -> medicClass --- addons/medical/functions/fnc_isInMedicalVehicle.sqf | 2 +- addons/medical/functions/fnc_isMedicalVehicle.sqf | 2 +- addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/addons/medical/functions/fnc_isInMedicalVehicle.sqf b/addons/medical/functions/fnc_isInMedicalVehicle.sqf index cffc24410d..5422ce8e1f 100644 --- a/addons/medical/functions/fnc_isInMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_isInMedicalVehicle.sqf @@ -21,4 +21,4 @@ _vehicle = vehicle _unit; if (_unit == _vehicle) exitWith {false}; if (_unit in [driver _vehicle, gunner _vehicle, commander _vehicle]) exitWith {false}; -_vehicle getVariable [QGVAR(isMedic), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant") == 1] +_vehicle getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant") == 1] diff --git a/addons/medical/functions/fnc_isMedicalVehicle.sqf b/addons/medical/functions/fnc_isMedicalVehicle.sqf index 7be406e556..5635700fe0 100644 --- a/addons/medical/functions/fnc_isMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_isMedicalVehicle.sqf @@ -15,4 +15,4 @@ private ["_vehicle"]; _vehicle = _this select 0; -_vehicle getVariable [QGVAR(isMedic), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant") == 1] +_vehicle getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant") == 1] diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf index 670818b1f3..539d428da0 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf @@ -44,7 +44,7 @@ if (!isNull _logic) then { if (!isnil "_x") then { if (typeName _x == typeName objNull) then { if (local _x) then { - _x setvariable [QGVAR(isMedic), _setting, true]; + _x setvariable [QGVAR(medicClass), _setting, true]; }; }; }; @@ -54,7 +54,7 @@ if (!isNull _logic) then { if (!isnil "_x") then { if (typeName _x == typeName objNull) then { if (local _x) then { - _x setvariable [QGVAR(isMedic), _setting, true]; + _x setvariable [QGVAR(medicClass), _setting, true]; }; }; }; From eff5ce03d67919d499dd072f46134da7b02291dc Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Sun, 10 May 2015 20:58:17 +0100 Subject: [PATCH 078/172] false -> 0 --- addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf index 539d428da0..af6de73ce1 100644 --- a/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_moduleAssignMedicalVehicle.sqf @@ -37,7 +37,7 @@ if (!isNull _logic) then { _list = "[" + _nilCheckPassedList + "]"; _parsedList = [] call compile _list; - _setting = _logic getvariable ["enabled", false]; + _setting = _logic getvariable ["enabled", 0]; _objects = synchronizedObjects _logic; if (!(_objects isEqualTo []) && _parsedList isEqualTo []) then { { From 2e91f4527323d887503d300a5319b28b43f16ee9 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Sun, 10 May 2015 16:57:05 -0500 Subject: [PATCH 079/172] #1104 - Fix legend in editor --- addons/map/config.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/addons/map/config.cpp b/addons/map/config.cpp index 927d9aeb0f..9d75eaa5c8 100644 --- a/addons/map/config.cpp +++ b/addons/map/config.cpp @@ -87,6 +87,22 @@ class RscMapControl { sizeExGrid = 0.032; }; +class RscMap; +class RscDisplayArcadeMap_Layout_2: RscMap { //"Traditional" Editor: + class controlsBackground { + class CA_Map: RscMapControl { + #include "MapTweaks.hpp" + }; + }; +}; +class RscDisplayArcadeMap_Layout_6: RscMap { //"Streamlined" Editor: + class controlsBackground { + class CA_Map: RscMapControl { + #include "MapTweaks.hpp" + }; + }; +}; + // REGULAR MAP class RscDisplayMainMap { // Tweak map styling From 97105c5b0761018f1424efa8e0e72e522a4b7337 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sun, 10 May 2015 18:16:27 -0700 Subject: [PATCH 080/172] Change ACE is version stamp. Example. You will now see ACE is version 3.0.0.2 Initial prep for showing Commit ID for each PBO in #1105 --- tools/make.py | 130 ++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 95 insertions(+), 35 deletions(-) diff --git a/tools/make.py b/tools/make.py index 387332a666..f6fde50440 100644 --- a/tools/make.py +++ b/tools/make.py @@ -55,14 +55,18 @@ if sys.platform == "win32": import winreg ######## GLOBALS ######### +ACE_VERSION = "3.0.0.3" work_drive = "" module_root = "" +make_root = "" release_dir = "" module_root_parent = "" optionals_root = "" -key_name = "ace_3.0.0" +key_name = "ace" key = "" dssignfile = "" +prefix = "ace" +pbo_name_prefix = "ace_" signature_blacklist = ["ace_server.pbo"] ############################################################################### @@ -466,7 +470,7 @@ def check_for_obsolete_pbos(addonspath, file): return False -def config_restore(modulePath): +def addon_restore(modulePath): #PABST: cleanup config BS (you could comment this out to see the "de-macroed" cpp #print_green("\Pabst! (restoring): {}".format(os.path.join(modulePath, "config.cpp"))) try: @@ -478,10 +482,88 @@ def config_restore(modulePath): os.remove(os.path.join(modulePath, "config.bin")) if os.path.isfile(os.path.join(modulePath, "texHeaders.bin")): os.remove(os.path.join(modulePath, "texHeaders.bin")) + if os.path.isfile(os.path.join(modulePath, "$PBOPREFIX$.backup")): + if os.path.isfile(os.path.join(modulePath, "$PBOPREFIX$")): + os.remove(os.path.join(modulePath, "$PBOPREFIX$")) + os.rename(os.path.join(modulePath, "$PBOPREFIX$.backup"), os.path.join(modulePath, "$PBOPREFIX$")) except: print_yellow("Some error occurred. Check your addon folder {} for integrity".format(modulePath)) return True + + +def get_ace_version(): + global ACE_VERSION + #do the magic based on https://github.com/acemod/ACE3/issues/806#issuecomment-95639048 + return ACE_VERSION + +def get_private_keyname(commitID,module="main"): + global pbo_name_prefix + + aceVersion = get_ace_version() + keyName = str("{prefix}{version}-{commit_id}".format(prefix=pbo_name_prefix,version=aceVersion,commit_id=commitID)) + print_yellow(keyName) + return keyName + + +def get_commit_ID(): + # Get latest commit ID + global make_root + curDir = os.getcwd() + try: + gitpath = os.path.join(os.path.dirname(make_root), ".git") + assert os.path.exists(gitpath) + os.chdir(make_root) + + commit_id = subprocess.check_output(["git", "rev-parse", "HEAD"]) + commit_id = str(commit_id, "utf-8")[:8] + except: + print_error("FAILED TO DETERMINE COMMIT ID.") + print_yellow("Verify that \GIT\BIN or \GIT\CMD is in your system path or user path.") + commit_id = "NOGIT" + raise + finally: + pass + os.chdir(curDir) + + print_yellow("COMMIT ID set to {}".format(commit_id)) + return commit_id + + +def version_stamp_pboprefix(module,commitID): + ### Update pboPrefix with the correct version stamp. Use commit_id as the build number. + global work_drive + global prefix + + try: + configpath = os.path.join(work_drive, prefix, module, "$PBOPREFIX$") + shutil.copyfile(configpath, os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")) + + f = open(configpath, "r") + configtext = f.read() + f.close() + + if configtext: + #patchestext = re.search(r"class CfgPatches\n\{(.*?)\n\}", configtext, re.DOTALL).group(1) + #patchestext = re.sub(r'version(.*?)="(.*?)"', r'version\1="\2-{}"'.format(commit_id), patchestext) + #configtext = re.sub(r"class CfgPatches\n\{(.*?)\n\}", "class CfgPatches\n{"+patchestext+"\n}", configtext, flags=re.DOTALL) + f = open(configpath, "w") + f.write(configtext) + f.close() + else: + os.remove(os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) + os.rename(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup"), os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) + except: + raise + print_error("Failed to include build number") + return False + finally: + if os.path.isfile(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")): + if os.path.isfile(os.path.join(work_drive, prefix, module, "$PBOPREFIX$")): + os.remove(os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) + os.rename(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup"), os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) + + return True ############################################################################### @@ -489,14 +571,18 @@ def main(argv): """Build an Arma addon suite in a directory from rules in a make.cfg file.""" print_blue("\nmake.py for Arma, modified for Advanced Combat Environment v{}".format(__version__)) + global ACE_VERSION global work_drive global module_root + global make_root global release_dir global module_root_parent global optionals_root global key_name global key global dssignfile + global prefix + global pbo_name_prefix if sys.platform != "win32": print_error("Non-Windows platform (Cygwin?). Please re-run from cmd.") @@ -600,18 +686,7 @@ See the make.cfg file for additional build options. make_root_parent = os.path.abspath(os.path.join(os.getcwd(), os.pardir)) os.chdir(make_root) - # Get latest commit ID - try: - gitpath = os.path.join(os.path.dirname(make_root), ".git") - assert os.path.exists(gitpath) - commit_id = subprocess.check_output(["git", "rev-parse", "HEAD"]) - commit_id = str(commit_id, "utf-8")[:8] - key_name = str(key_name+"-"+commit_id) - except: - print_error("FAILED TO DETERMINE COMMIT ID.") - print_yellow("Verify that \GIT\BIN or \GIT\CMD is in your system path or user path.") - commit_id = "NOGIT" cfg = configparser.ConfigParser(); try: @@ -665,6 +740,10 @@ See the make.cfg file for additional build options. extensions_root = os.path.join(module_root_parent, "extensions") print_green ("module_root: {}".format(module_root)) + + commit_id = get_commit_ID() + key_name = versionStamp = get_private_keyname(commit_id) + if (os.path.isdir(module_root)): os.chdir(module_root) else: @@ -934,27 +1013,7 @@ See the make.cfg file for additional build options. shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - # Include build number - try: - configpath = os.path.join(work_drive, prefix, module, "config.cpp") - f = open(configpath, "r") - configtext = f.read() - f.close() - - if configtext: - patchestext = re.search(r"class CfgPatches\n\{(.*?)\n\}", configtext, re.DOTALL).group(1) - patchestext = re.sub(r'version(.*?)="(.*?)"', r'version\1="\2-{}"'.format(commit_id), patchestext) - configtext = re.sub(r"class CfgPatches\n\{(.*?)\n\}", "class CfgPatches\n{"+patchestext+"\n}", configtext, flags=re.DOTALL) - f = open(configpath, "w") - f.write(configtext) - f.close() - else: - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - os.rename(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - except: - raise - print_error("Failed to include build number") - continue + version_stamp_pboprefix(module,commit_id) if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): print_green("$NOBIN$ Found. Proceeding with non-binarizing!") @@ -1013,7 +1072,7 @@ See the make.cfg file for additional build options. print ("Resuming build...") continue finally: - config_restore(os.path.join(work_drive, prefix, module)) + addon_restore(os.path.join(work_drive, prefix, module)) elif build_tool== "addonbuilder": # Detect $NOBIN$ and do not binarize if found. @@ -1092,6 +1151,7 @@ See the make.cfg file for additional build options. except: print_yellow("Cancel or some error detected.") + finally: copy_important_files(module_root_parent,os.path.join(release_dir, "@ace")) cleanup_optionals(optionals_modules) From 2ffc38ddd204ef340dfe7bfa081fb174c7fd48f8 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sun, 10 May 2015 18:21:01 -0700 Subject: [PATCH 081/172] Do not build common every time #1105 --- tools/make.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/make.py b/tools/make.py index f6fde50440..8bc4c50eb2 100644 --- a/tools/make.py +++ b/tools/make.py @@ -913,10 +913,6 @@ See the make.cfg file for additional build options. else: old_sha = "" - #We always build ACE_common so we can properly show the correct version stamp in the RPT file. - if module == "common": - old_sha = "" - # Hash the module new_sha = get_directory_hash(os.path.join(module_root, module)) From 097d0cb8ed0d3088efa624c6ea3b7a74f770d893 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sun, 10 May 2015 19:44:24 -0700 Subject: [PATCH 082/172] Update $PBOPREFIX$ with Commit ID for each PBO #1105 --- tools/make.py | 40 ++++++++++++++++++++++++++++++---------- 1 file changed, 30 insertions(+), 10 deletions(-) diff --git a/tools/make.py b/tools/make.py index 8bc4c50eb2..76233f9120 100644 --- a/tools/make.py +++ b/tools/make.py @@ -497,6 +497,7 @@ def get_ace_version(): #do the magic based on https://github.com/acemod/ACE3/issues/806#issuecomment-95639048 return ACE_VERSION + def get_private_keyname(commitID,module="main"): global pbo_name_prefix @@ -544,19 +545,38 @@ def version_stamp_pboprefix(module,commitID): f.close() if configtext: - #patchestext = re.search(r"class CfgPatches\n\{(.*?)\n\}", configtext, re.DOTALL).group(1) - #patchestext = re.sub(r'version(.*?)="(.*?)"', r'version\1="\2-{}"'.format(commit_id), patchestext) - #configtext = re.sub(r"class CfgPatches\n\{(.*?)\n\}", "class CfgPatches\n{"+patchestext+"\n}", configtext, flags=re.DOTALL) - f = open(configpath, "w") - f.write(configtext) - f.close() - else: - os.remove(os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) - os.rename(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup"), os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) + patchestext = re.search(r"version.*?=.*?$", configtext, re.DOTALL) + print("{}".format(patchestext)) + if patchestext: + if configtext: + print("configtext before ==> {}".format(configtext)) + patchestext = re.search(r"(version.*?=)(.*?)$", configtext, re.DOTALL).group(1) + print("patchestext before ==> {}".format(patchestext)) + #patchestext1 = re.sub(r'version(.*?)="(.*?)"$', r'version\1=" {}"'.format(commitID), patchestext) + #print("patchestext after ==> {}".format(patchestext1)) + print("commitID ==> {}".format(commitID)) + configtext = re.sub(r"version(.*?)=(.*?)$", "version = {}\n".format(commitID), configtext, flags=re.DOTALL) + print("configtext after ==> {}".format(configtext)) + f = open(configpath, "w") + f.write(configtext) + f.close() + os.remove(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")) + else: + os.remove(os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) + os.rename(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup"), os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) + else: + if configtext: + #append version info + f = open(configpath, "a") + f.write("\nversion = {}".format(commitID)) + f.close() + os.remove(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")) + except: - raise print_error("Failed to include build number") + raise return False + finally: if os.path.isfile(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")): if os.path.isfile(os.path.join(work_drive, prefix, module, "$PBOPREFIX$")): From 4d56e6317cb132879b549b9ec44080dfe9e3c149 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sun, 10 May 2015 19:58:32 -0700 Subject: [PATCH 083/172] Warn builder for missing $PBOPREFIX$ #1105 --- tools/make.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tools/make.py b/tools/make.py index 76233f9120..89ba17a0c1 100644 --- a/tools/make.py +++ b/tools/make.py @@ -538,8 +538,16 @@ def version_stamp_pboprefix(module,commitID): try: configpath = os.path.join(work_drive, prefix, module, "$PBOPREFIX$") - shutil.copyfile(configpath, os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")) - + if os.path.isfile(configpath): + shutil.copyfile(configpath, os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")) + else: + print_error("$PBOPREFIX$ Does not exist for module: {}.".format(module)) + return False + except: + print_error("Error updating $PBOPREFIX$ for module {}.") + return False + + try: f = open(configpath, "r") configtext = f.read() f.close() From 0e36e56c1c05d42bed54fa05f44662eba5d7a867 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sun, 10 May 2015 22:12:57 -0700 Subject: [PATCH 084/172] Proper handling $PBOPREFIX$ backups and cleanup if canceled. #1105 --- tools/make.py | 36 ++++++++++++++++-------------------- 1 file changed, 16 insertions(+), 20 deletions(-) diff --git a/tools/make.py b/tools/make.py index 89ba17a0c1..3d70c28f0a 100644 --- a/tools/make.py +++ b/tools/make.py @@ -533,20 +533,12 @@ def get_commit_ID(): def version_stamp_pboprefix(module,commitID): ### Update pboPrefix with the correct version stamp. Use commit_id as the build number. + #This function will not handle any $PBOPREFIX$ backup or cleanup. global work_drive global prefix - try: - configpath = os.path.join(work_drive, prefix, module, "$PBOPREFIX$") - if os.path.isfile(configpath): - shutil.copyfile(configpath, os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")) - else: - print_error("$PBOPREFIX$ Does not exist for module: {}.".format(module)) - return False - except: - print_error("Error updating $PBOPREFIX$ for module {}.") - return False - + configpath = os.path.join(work_drive, prefix, module, "$PBOPREFIX$") + try: f = open(configpath, "r") configtext = f.read() @@ -568,7 +560,6 @@ def version_stamp_pboprefix(module,commitID): f = open(configpath, "w") f.write(configtext) f.close() - os.remove(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")) else: os.remove(os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) os.rename(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup"), os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) @@ -578,19 +569,14 @@ def version_stamp_pboprefix(module,commitID): f = open(configpath, "a") f.write("\nversion = {}".format(commitID)) f.close() - os.remove(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")) - + else: + os.remove(os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) + os.rename(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup"), os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) except: print_error("Failed to include build number") raise return False - finally: - if os.path.isfile(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")): - if os.path.isfile(os.path.join(work_drive, prefix, module, "$PBOPREFIX$")): - os.remove(os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) - os.rename(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup"), os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) - return True ############################################################################### @@ -1018,6 +1004,16 @@ See the make.cfg file for additional build options. if build_tool == "pboproject": try: #PABST: Convert config (run the macro'd config.cpp through CfgConvert twice to produce a de-macro'd cpp that pboProject can read without fucking up: + try: + configpath = os.path.join(work_drive, prefix, module, "$PBOPREFIX$") + if os.path.isfile(configpath): + shutil.copyfile(configpath, os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")) + else: + print_error("$PBOPREFIX$ Does not exist for module: {}.".format(module)) + return False + except: + print_error("Error creating backup of $PBOPREFIX$ for module {}.") + shutil.copyfile(os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.backup")) os.chdir("P:\\") From d03203d3d5ecd129af47cadce8d4b5f7c8f232aa Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sun, 10 May 2015 22:20:29 -0700 Subject: [PATCH 085/172] remove debug #1105 --- tools/make.py | 8 -------- 1 file changed, 8 deletions(-) diff --git a/tools/make.py b/tools/make.py index 3d70c28f0a..a4f0062c30 100644 --- a/tools/make.py +++ b/tools/make.py @@ -503,7 +503,6 @@ def get_private_keyname(commitID,module="main"): aceVersion = get_ace_version() keyName = str("{prefix}{version}-{commit_id}".format(prefix=pbo_name_prefix,version=aceVersion,commit_id=commitID)) - print_yellow(keyName) return keyName @@ -546,17 +545,10 @@ def version_stamp_pboprefix(module,commitID): if configtext: patchestext = re.search(r"version.*?=.*?$", configtext, re.DOTALL) - print("{}".format(patchestext)) if patchestext: if configtext: - print("configtext before ==> {}".format(configtext)) patchestext = re.search(r"(version.*?=)(.*?)$", configtext, re.DOTALL).group(1) - print("patchestext before ==> {}".format(patchestext)) - #patchestext1 = re.sub(r'version(.*?)="(.*?)"$', r'version\1=" {}"'.format(commitID), patchestext) - #print("patchestext after ==> {}".format(patchestext1)) - print("commitID ==> {}".format(commitID)) configtext = re.sub(r"version(.*?)=(.*?)$", "version = {}\n".format(commitID), configtext, flags=re.DOTALL) - print("configtext after ==> {}".format(configtext)) f = open(configpath, "w") f.write(configtext) f.close() From 46cabb14adc0b7306288efe46eb3e5ee0a529810 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Sun, 10 May 2015 23:49:40 -0700 Subject: [PATCH 086/172] Remove unnecessary return so that it can move to the next PBO after missing $PBOPREFIX$ #1105 --- tools/make.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/make.py b/tools/make.py index a4f0062c30..940579ffc2 100644 --- a/tools/make.py +++ b/tools/make.py @@ -1002,7 +1002,7 @@ See the make.cfg file for additional build options. shutil.copyfile(configpath, os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")) else: print_error("$PBOPREFIX$ Does not exist for module: {}.".format(module)) - return False + except: print_error("Error creating backup of $PBOPREFIX$ for module {}.") From cf6846dac2c24c6a2db19c0ba7374083c939581f Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Mon, 11 May 2015 00:34:32 -0700 Subject: [PATCH 087/172] Improve exception handling #1105 --- tools/make.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tools/make.py b/tools/make.py index 940579ffc2..e45c029ccc 100644 --- a/tools/make.py +++ b/tools/make.py @@ -564,9 +564,8 @@ def version_stamp_pboprefix(module,commitID): else: os.remove(os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) os.rename(os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup"), os.path.join(work_drive, prefix, module, "$PBOPREFIX$")) - except: - print_error("Failed to include build number") - raise + except Exception as e: + print_error("Failed to include build number: {}".format(e)) return False return True From b03333c9e8fb03febd5ee17ee98ce868c251bfb1 Mon Sep 17 00:00:00 2001 From: ulteq Date: Mon, 11 May 2015 10:59:07 +0200 Subject: [PATCH 088/172] Moved all wind calculations into the weather module --- addons/advanced_ballistics/XEH_preInit.sqf | 2 - .../functions/fnc_calculateWindSpeed.sqf | 78 -------- addons/config.cpp | 167 ------------------ addons/kestrel4500/XEH_preInit.sqf | 1 - .../functions/fnc_calculateWindSpeed.sqf | 68 ------- .../functions/fnc_measureWindSpeed.sqf | 7 +- addons/weather/XEH_preInit.sqf | 2 + addons/weather/config.cpp | 4 +- .../fnc_calculateRoughnessLength.sqf | 0 .../functions/fnc_calculateWindSpeed.sqf | 90 ++++++++++ .../weather/functions/fnc_displayWindInfo.sqf | 13 +- 11 files changed, 104 insertions(+), 328 deletions(-) delete mode 100644 addons/advanced_ballistics/functions/fnc_calculateWindSpeed.sqf delete mode 100644 addons/config.cpp delete mode 100644 addons/kestrel4500/functions/fnc_calculateWindSpeed.sqf rename addons/{advanced_ballistics => weather}/functions/fnc_calculateRoughnessLength.sqf (100%) create mode 100644 addons/weather/functions/fnc_calculateWindSpeed.sqf diff --git a/addons/advanced_ballistics/XEH_preInit.sqf b/addons/advanced_ballistics/XEH_preInit.sqf index 1d19a9c492..6fdd849b12 100644 --- a/addons/advanced_ballistics/XEH_preInit.sqf +++ b/addons/advanced_ballistics/XEH_preInit.sqf @@ -6,9 +6,7 @@ PREP(calculateAmmoTemperatureVelocityShift); PREP(calculateAtmosphericCorrection); PREP(calculateBarrelLengthVelocityShift); PREP(calculateRetardation); -PREP(calculateRoughnessLength); PREP(calculateStabilityFactor); -PREP(calculateWindSpeed); PREP(displayProtractor); PREP(handleFired); PREP(initializeTerrainExtension); diff --git a/addons/advanced_ballistics/functions/fnc_calculateWindSpeed.sqf b/addons/advanced_ballistics/functions/fnc_calculateWindSpeed.sqf deleted file mode 100644 index e7b0a322e8..0000000000 --- a/addons/advanced_ballistics/functions/fnc_calculateWindSpeed.sqf +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Author: Ruthberg - * - * Calculates the true wind speed at a given world position - * - * Arguments: - * 0: _this - world position - * - * Return Value: - * 0: wind speed - m/s - * - * Public: No - */ -#include "script_component.hpp" - -private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"]; - -fnc_polar2vect = { - private ["_mag2D"]; - _mag2D = (_this select 0) * cos((_this select 2)); - [_mag2D * sin((_this select 1)), _mag2D * cos((_this select 1)), (_this select 0) * sin((_this select 2))]; -}; - -_windSpeed = vectorMagnitude ACE_wind; -_windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); - -// Wind gradient -if (_windSpeed > 0.05) then { - _height = (ASLToATL _this) select 2; - _height = 0 max _height min 20; - if (_height < 20) then { - _roughnessLength = _this call FUNC(calculateRoughnessLength); - _windSpeed = _windSpeed * ln(_height / _roughnessLength) / ln(20 / _roughnessLength); - }; -}; - -// Terrain effect on wind -if (_windSpeed > 0.05) then { - _newWindSpeed = 0; - { - _windSource = [100, _windDir + 180, _x] call fnc_polar2vect; - if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 9) * _windSpeed; - }; - _windSource = [100, _windDir + 180 + _x, 0] call fnc_polar2vect; - if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 9) * _windSpeed; - }; - _windSource = [100, _windDir + 180 - _x, 0] call fnc_polar2vect; - if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 9) * _windSpeed; - }; - } forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - _windSpeed = _newWindSpeed; -}; - -// Obstacle effect on wind -if (_windSpeed > 0.05) then { - _newWindSpeed = 0; - { - _windSource = [20, _windDir + 180, _x] call fnc_polar2vect; - if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 2) * _windSpeed; - }; - _windSource = [20, _windDir + 180 + _x, 0] call fnc_polar2vect; - if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 2) * _windSpeed; - }; - _windSource = [20, _windDir + 180 - _x, 0] call fnc_polar2vect; - if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 2) * _windSpeed; - }; - } forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]; - _windSpeed = _newWindSpeed; -}; -_windSpeed = 0 max _windSpeed; - -_windSpeed diff --git a/addons/config.cpp b/addons/config.cpp deleted file mode 100644 index 27647f8d00..0000000000 --- a/addons/config.cpp +++ /dev/null @@ -1,167 +0,0 @@ -#include "script_component.hpp" - -class CfgPatches { - class ADDON { - units[] = {"ACE_Box_Misc", "ACE_bananaItem"}; - weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_main"}; - author[] = {"KoffeinFlummi"}; - authorUrl = "https://github.com/KoffeinFlummi/"; - VERSION_CONFIG; - }; -}; - -#include "CfgEventHandlers.hpp" - -#include "CfgSounds.hpp" -#include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" -#include "CfgMagazines.hpp" - -#include "CfgActions.hpp" -#include "CfgMoves.hpp" -#include "CfgVoice.hpp" -#include "CfgUnitInsignia.hpp" - -class ACE_Rsc_Display_Base { - idd = -1; - type = 0; - style = 48; - name = ""; - duration = 999999; - fadeIn = 0; - fadeOut = 0; - font = "TahomaB"; - size = 1; - colorBackground[] = {1, 1, 1, 0}; - colorText[] = {1, 1, 1, 1}; -}; - -class ACE_Rsc_Control_Base { - idc = 1; - type = 0; - style = 48; - access = 0; - lineSpacing = 0; - moving = 1; - text = ""; - size = 1; - sizeEx = 0; - font = "TahomaB"; - colorBackground[] = {1, 1, 1, 0}; - colorText[] = {1, 1, 1, 1}; - x = 0; - y = 0; - w = 0; - h = 0; -}; - -class ACE_Settings { - /* - *class GVAR(sampleSetting) { - * Value - * value = 1; - * - * Type (SCALAR, BOOL, STRING, ARRAY, COLOR) - * typeName = "SCALAR"; - * - * Force the setting? - * force = 0; - * - * Does it appear on the options menu? - * isClientSettable = 1; - * - * The following settings only apply when isClientSettable == 1 - * Stringtable entry with the setting name - * displayName = "$STR_ACE_Common_SettingName"; - * - * Stringtable entry with the setting description - * description = "$STR_ACE_Common_SettingDescription"; - * - * Stringtable entries that describe the options - * Only applies if typeName == "SCALAR"; - * values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; - *}; - */ - class GVAR(forceAllSettings) { - value = 0; - typeName = "BOOL"; - }; - /*class GVAR(enableNumberHotkeys) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Common_EnableNumberHotkeys"; - };*/ - class GVAR(settingFeedbackIcons) { - value = 1; - typeName = "SCALAR"; - force = 0; - isClientSettable = 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; - isClientSettable = 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"; - isClientSettable = 1; - displayName = "$STR_ACE_Common_SettingDisplayTextColorName"; - description = "$STR_ACE_Common_SettingDisplayTextColorDesc"; - }; - class GVAR(displayTextFontColor) { - value[] = {1,1,1,1}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_Common_SettingDisplayTextFontColorName"; - description = "$STR_ACE_Common_SettingDisplayTextFontColorDesc"; - }; -}; - -#include "define.hpp" -#include -#include -#include - -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}; - }; - }; - }; -}; - -/* -// check dll -class RscStandardDisplay; -class RscDisplayMain: RscStandardDisplay { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayMain"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_5('header','tail',{0},{},_this select 0)] call COMPILE_FILE(functions\fnc_errorMessage)); -}; -*/ - -class ACE_Extensions { - extensions[] = {}; -}; diff --git a/addons/kestrel4500/XEH_preInit.sqf b/addons/kestrel4500/XEH_preInit.sqf index 2d5e211a54..4e29b9bdbf 100644 --- a/addons/kestrel4500/XEH_preInit.sqf +++ b/addons/kestrel4500/XEH_preInit.sqf @@ -3,7 +3,6 @@ ADDON = false; PREP(buttonPressed); -PREP(calculateWindSpeed); PREP(canShow); PREP(collectData); PREP(createKestrelDialog); diff --git a/addons/kestrel4500/functions/fnc_calculateWindSpeed.sqf b/addons/kestrel4500/functions/fnc_calculateWindSpeed.sqf deleted file mode 100644 index 8267f7f729..0000000000 --- a/addons/kestrel4500/functions/fnc_calculateWindSpeed.sqf +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Author: Ruthberg - * - * Calculates the wind speed at a given world position - * - * Arguments: - * 0: _this - world position - * - * Return Value: - * 0: wind speed - m/s - * - * Public: No - */ -#include "script_component.hpp" - -private ["_windSpeed", "_windDir", "_newWindSpeed", "_windSource"]; - -fnc_polar2vect = { - private ["_mag2D"]; - _mag2D = (_this select 0) * cos((_this select 2)); - [_mag2D * sin((_this select 1)), _mag2D * cos((_this select 1)), (_this select 0) * sin((_this select 2))]; -}; - -_windSpeed = vectorMagnitude ACE_wind; -_windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); - -// Terrain effect on wind -if (_windSpeed > 0.05) then { - _newWindSpeed = 0; - { - _windSource = [100, _windDir + 180, _x] call fnc_polar2vect; - if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 9) * _windSpeed; - }; - _windSource = [100, _windDir + 180 + _x, 0] call fnc_polar2vect; - if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 9) * _windSpeed; - }; - _windSource = [100, _windDir + 180 - _x, 0] call fnc_polar2vect; - if (!(terrainIntersectASL [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 9) * _windSpeed; - }; - } forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; - _windSpeed = _newWindSpeed; -}; - -// Obstacle effect on wind -if (_windSpeed > 0.05) then { - _newWindSpeed = 0; - { - _windSource = [20, _windDir + 180, _x] call fnc_polar2vect; - if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 2) * _windSpeed; - }; - _windSource = [20, _windDir + 180 + _x, 0] call fnc_polar2vect; - if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 2) * _windSpeed; - }; - _windSource = [20, _windDir + 180 - _x, 0] call fnc_polar2vect; - if (!(lineIntersects [_this, _this vectorAdd _windSource])) exitWith { - _newWindSpeed = cos(_x * 2) * _windSpeed; - }; - } forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]; - _windSpeed = _newWindSpeed; -}; -_windSpeed = 0 max _windSpeed; - -_windSpeed diff --git a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf index eb718906aa..73b4e228d6 100644 --- a/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf +++ b/addons/kestrel4500/functions/fnc_measureWindSpeed.sqf @@ -19,12 +19,13 @@ private ["_playerDir", "_windSpeed", "_windDir"]; _playerDir = getDir ACE_player; _windSpeed = vectorMagnitude ACE_wind; _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); - if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { - _windSpeed = (eyePos ACE_player) call EFUNC(advanced_ballistics,calculateWindSpeed); + // With wind gradient + _windSpeed = [eyePos ACE_player, true, true, true] call EFUNC(weather,calculateWindSpeed); _windSpeed = abs(cos(_playerDir - _windDir)) * _windSpeed; } else { - _windSpeed = (eyePos ACE_player) call FUNC(calculateWindSpeed); + // Without wind gradient + _windSpeed = [eyePos ACE_player, false, true, true] call EFUNC(weather,calculateWindSpeed); }; if (_windSpeed > 0.3 || {GVAR(MeasuredWindSpeed) > 0.1 && _windSpeed > 0.125}) then { diff --git a/addons/weather/XEH_preInit.sqf b/addons/weather/XEH_preInit.sqf index 0f49226432..6e6e008a67 100644 --- a/addons/weather/XEH_preInit.sqf +++ b/addons/weather/XEH_preInit.sqf @@ -5,6 +5,8 @@ ADDON = false; PREP(calculateAirDensity); PREP(calculateBarometricPressure); +PREP(calculateRoughnessLength); +PREP(calculateWindSpeed); PREP(displayWindInfo); PREP(getMapData); PREP(getWind); diff --git a/addons/weather/config.cpp b/addons/weather/config.cpp index 39cf223518..18059fe9e8 100644 --- a/addons/weather/config.cpp +++ b/addons/weather/config.cpp @@ -5,8 +5,8 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; - author[] = {"q1184", "Rocko", "esteldunedain","Ruthberg"}; + requiredAddons[] = {"ace_common", "ace_modules"}; + author[] = {"q1184", "Rocko", "esteldunedain", "Ruthberg"}; VERSION_CONFIG; }; }; diff --git a/addons/advanced_ballistics/functions/fnc_calculateRoughnessLength.sqf b/addons/weather/functions/fnc_calculateRoughnessLength.sqf similarity index 100% rename from addons/advanced_ballistics/functions/fnc_calculateRoughnessLength.sqf rename to addons/weather/functions/fnc_calculateRoughnessLength.sqf diff --git a/addons/weather/functions/fnc_calculateWindSpeed.sqf b/addons/weather/functions/fnc_calculateWindSpeed.sqf new file mode 100644 index 0000000000..b5cde4e959 --- /dev/null +++ b/addons/weather/functions/fnc_calculateWindSpeed.sqf @@ -0,0 +1,90 @@ +/* + * Author: Ruthberg + * + * Calculates the true wind speed at a given world position + * + * Arguments: + * 0: world position - posASL + * 1: Account for wind gradient + * 2: Account for terrain + * 3: Account for obstacles + * + * Return Value: + * 0: wind speed - m/s + * + * Public: No + */ +#include "script_component.hpp" + +private ["_windSpeed", "_windDir", "_height", "_newWindSpeed", "_windSource", "_roughnessLength"]; + +EXPLODE_4_PVT(_this,_position,_windGradientEnabled,_terrainEffectEnabled,_obstacleEffectEnabled); + +fnc_polar2vect = { + private ["_mag2D"]; + _mag2D = (_this select 0) * cos((_this select 2)); + [_mag2D * sin((_this select 1)), _mag2D * cos((_this select 1)), (_this select 0) * sin((_this select 2))]; +}; + +_windSpeed = vectorMagnitude ACE_wind; +_windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); + +// Wind gradient +if (_windGradientEnabled) then { + if (_windSpeed > 0.05) then { + _height = (ASLToATL _position) select 2; + _height = 0 max _height min 20; + if (_height < 20) then { + _roughnessLength = _position call FUNC(calculateRoughnessLength); + _windSpeed = _windSpeed * abs(ln(_height / _roughnessLength) / ln(20 / _roughnessLength)); + }; + }; +}; + +// Terrain effect on wind +if (_terrainEffectEnabled) then { + if (_windSpeed > 0.05) then { + _newWindSpeed = 0; + { + _windSource = [100, _windDir + 180, _x] call fnc_polar2vect; + if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 9) * _windSpeed; + }; + _windSource = [100, _windDir + 180 + _x, 0] call fnc_polar2vect; + if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 9) * _windSpeed; + }; + _windSource = [100, _windDir + 180 - _x, 0] call fnc_polar2vect; + if (!(terrainIntersectASL [_position, _position vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 9) * _windSpeed; + }; + } forEach [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; + _windSpeed = _newWindSpeed; + }; +}; + +// Obstacle effect on wind +if (_obstacleEffectEnabled) then { + if (_windSpeed > 0.05) then { + _newWindSpeed = 0; + { + _windSource = [20, _windDir + 180, _x] call fnc_polar2vect; + if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 2) * _windSpeed; + }; + _windSource = [20, _windDir + 180 + _x, 0] call fnc_polar2vect; + if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 2) * _windSpeed; + }; + _windSource = [20, _windDir + 180 - _x, 0] call fnc_polar2vect; + if (!(lineIntersects [_position, _position vectorAdd _windSource])) exitWith { + _newWindSpeed = cos(_x * 2) * _windSpeed; + }; + } forEach [0, 5, 10, 15, 20, 25, 30, 35, 40, 45]; + _windSpeed = _newWindSpeed; + }; +}; + +_windSpeed = 0 max _windSpeed; + +_windSpeed diff --git a/addons/weather/functions/fnc_displayWindInfo.sqf b/addons/weather/functions/fnc_displayWindInfo.sqf index 7996503719..e81463f41a 100644 --- a/addons/weather/functions/fnc_displayWindInfo.sqf +++ b/addons/weather/functions/fnc_displayWindInfo.sqf @@ -38,15 +38,14 @@ GVAR(WindInfo) = true; _windIndex = 12; _windColor = [1, 1, 1, 1]; - - // Toogle behaviour depending on ace_advanced_ballistics being used or not - // @todo, check ACE_AB is actually enabled - _windSpeed = if (isClass (configFile >> "CfgPatches" >> "ACE_Advanced_Ballistics")) then { - (eyePos ACE_player) call EFUNC(advanced_ballistics,calculateWindSpeed); + _windSpeed = if (missionNamespace getVariable [QEGVAR(advanced_ballistics,enabled), false]) then { + // With wind gradient + [eyePos ACE_player, true, true, true] call FUNC(calculateWindSpeed); } else { - vectorMagnitude ACE_wind; + // Without wind gradient + [eyePos ACE_player, false, true, true] call FUNC(calculateWindSpeed); }; - + if (_windSpeed > 0.2) then { _playerDir = getDir ACE_player; _windDir = (ACE_wind select 0) atan2 (ACE_wind select 1); From 519aba57b57ce5bdcc3edbd8cd3d16d58189b820 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 11 May 2015 14:45:37 +0100 Subject: [PATCH 089/172] Transfered ballistics support (as discussed with glowbal) --- addons/modules/XEH_preInit.sqf | 1 - addons/modules/config.cpp | 5 +- .../functions/fnc_bi_moduleProjectile.sqf | 191 ------------------ 3 files changed, 1 insertion(+), 196 deletions(-) delete mode 100644 addons/modules/functions/fnc_bi_moduleProjectile.sqf diff --git a/addons/modules/XEH_preInit.sqf b/addons/modules/XEH_preInit.sqf index dfbbe2c2b9..7573d34352 100644 --- a/addons/modules/XEH_preInit.sqf +++ b/addons/modules/XEH_preInit.sqf @@ -3,7 +3,6 @@ ADDON = false; PREP(moduleInit); -PREP(bi_moduleProjectile); GVAR(moduleInitCollection) = []; diff --git a/addons/modules/config.cpp b/addons/modules/config.cpp index 4fc3b8b60d..c5880e7bb1 100644 --- a/addons/modules/config.cpp +++ b/addons/modules/config.cpp @@ -23,9 +23,6 @@ class CfgVehicles { init = QUOTE(_this call DFUNC(moduleInit)); }; }; - class ModuleOrdnance_F: Module_F { - function = "ace_modules_fnc_bi_moduleProjectile"; - }; }; -#include "CfgEventHandlers.hpp" +#include "CfgEventHandlers.hpp" \ No newline at end of file diff --git a/addons/modules/functions/fnc_bi_moduleProjectile.sqf b/addons/modules/functions/fnc_bi_moduleProjectile.sqf deleted file mode 100644 index 56e3eb9883..0000000000 --- a/addons/modules/functions/fnc_bi_moduleProjectile.sqf +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Author: Bohemia Interactive - * Module function for spawning projectiles - * Used by Curator artillery modules etc - * - * Arguments: - * 0: The logic object - * - * Return Value: - * nil - * - * Public: No - */ - -_fnc_scriptNameParentTemp = if !(isnil '_fnc_scriptName') then {_fnc_scriptName} else {'BIS_fnc_moduleProjectile'}; -private ['_fnc_scriptNameParent']; -_fnc_scriptNameParent = _fnc_scriptNameParentTemp; -_fnc_scriptNameParentTemp = nil; - -private ['_fnc_scriptName']; -_fnc_scriptName = 'BIS_fnc_moduleProjectile'; -scriptname _fnc_scriptName; - -private ["_logic", "_units", "_activated"]; -_logic = _this select 0; -_units = _this select 1; -_activated = _this select 2; - -if ({local _x} count (objectcurators _logic) > 0) then { - //--- Reveal the circle to curators - _logic hideobject false; - _logic setpos position _logic; -}; -if !(isserver) exitwith {}; - -if (_activated) then { - _ammo = _logic getvariable ["type",gettext (configfile >> "cfgvehicles" >> typeof _logic >> "ammo")]; - if (_ammo != "") then { - _cfgAmmo = configfile >> "cfgammo" >> _ammo; - //if !(isclass _cfgAmmo) exitwith {["CfgAmmo class '%1' not found.",_ammo] call bis_fnc_error;}; - _dirVar = _fnc_scriptname + typeof _logic; - _logic setdir (missionnamespace getvariable [_dirVar,direction _logic]); //--- Restore custom direction - _pos = getposatl _logic; - _posAmmo = +_pos; - _posAmmo set [2,0]; - _dir = direction _logic; - _simulation = tolower gettext (configfile >> "cfgammo" >> _ammo >> "simulation"); - _altitude = 0; - _velocity = []; - _attach = false; - _radio = ""; - _delay = 60; - _sound = ""; - _soundSourceClass = ""; - _hint = []; - _shakeStrength = 0; - _shakeRadius = 0; - switch (_simulation) do { - case "shotshell": { - _altitude = 1000; - _velocity = [0,0,-100]; - _radio = "SentGenIncoming"; - _sounds = if (getnumber (_cfgAmmo >> "hit") < 200) then {["mortar1","mortar2"]} else {["shell1","shell2","shell3","shell4"]}; - _sound = _sounds call bis_fnc_selectrandom; - _hint = ["Curator","PlaceOrdnance"]; - _shakeStrength = 0.01; - _shakeRadius = 300; - }; - case "shotsubmunitions": { - _posAmmo = [_posAmmo,500,_dir + 180] call bis_fnc_relpos; - _altitude = 1000 - ((getterrainheightasl _posAmmo) - (getterrainheightasl _pos)); - _posAmmo set [2,_altitude]; - _velocity = [sin _dir * 68,cos _dir * 68,-100]; - _radio = "SentGenIncoming"; - _hint = ["Curator","PlaceOrdnance"]; - _shakeStrength = 0.02; - _shakeRadius = 500; - }; - case "shotilluminating": { - _altitude = 66; - _velocity = [wind select 0,wind select 1,30]; - _sound = "SN_Flare_Fired_4"; - _soundSourceClass = "SoundFlareLoop_F"; - }; - case "shotnvgmarker"; - case "shotsmokex": { - _altitude = 0; - _velocity = [0,0,0]; - _attach = true; - }; - default {["Ammo simulation '%1' is not supported",_simulation] call bis_fnc_error;}; - }; - _fnc_playRadio = { - if (_radio != "") then { - _entities = (getposatl _logic) nearentities ["All",100]; - _sides = []; - { - if (isplayer _x) then { - _side = side group _x; - if (_side in [east,west,resistance,civilian]) then { - //--- Play radio (only if it wasn't played recently) - if (time > _x getvariable ["BIS_fnc_moduleProjectile_radio",-_delay]) then { - [[_side,_radio,"side"],"bis_fnc_sayMessage",_x] call bis_fnc_mp; - _x setvariable ["BIS_fnc_moduleProjectile_radio",time + _delay]; - }; - }; - }; - } foreach _entities; - }; - }; - if (count _hint > 0) then { - [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectcurators _logic] call bis_fnc_mp; - }; - if (count _velocity == 3) then { - _altitude = (_logic getvariable ["altitude",_altitude]) call bis_fnc_parsenumber; - _radio = _logic getvariable ["radio",_radio]; - - //--- Create projectile - _posAmmo set [2,_altitude]; - _projectile = createvehicle [_ammo,_posAmmo,[],0,"none"]; - _projectile setpos _posAmmo; - _projectile setvelocity _velocity; - if (_attach) then {_projectile attachto [_logic,[0,0,_altitude]];}; - - // This is our addition to this function - if (!isnil "ace_frag_fnc_addManualTrack") then { - [_projectile] call ace_frag_fnc_addManualTrack - }; - - //--- Play sound - if (_sound != "") then {[[_logic,_sound,"say3D"],"bis_fnc_sayMessage"] call bis_fnc_mp;}; - - //--- Create sound source - _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull}; - - //--- Play radio warning - [] call _fnc_playRadio; - - //--- Update - if (_attach) then { - waituntil { - _soundSource setposatl getposatl _projectile; - sleep 1; - isnull _projectile || isnull _logic - }; - } else { - waituntil { - _soundSource setposatl getposatl _projectile; - - if (getposatl _logic distance _pos > 0 || direction _logic != _dir) then { - _posNew = getposasl _logic; - _dirDiff = direction _logic - _dir; - _posNew = [_posNew,[getposasl _projectile,_pos] call bis_fnc_distance2d,direction _logic + 180] call bis_fnc_relpos; - _posNew set [2,getposasl _projectile select 2]; - _projectile setvelocity ([velocity _projectile,-_dirDiff] call bis_fnc_rotatevector2d); - _projectile setposasl _posNew; - _pos = getposatl _logic; - _dir = direction _logic; - missionnamespace setvariable [_dirVar,_dir]; - }; - sleep 0.1; - isnull _projectile || isnull _logic - }; - }; - deletevehicle _projectile; - deletevehicle _soundSource; - if (count objectcurators _logic > 0) then { - - //--- Delete curator spawned logic - if (_shakeStrength > 0) then { - if (_simulation == "shotsubmunitions") then {sleep 0.5;}; - [[_shakeStrength,0.7,[position _logic,_shakeRadius]],"bis_fnc_shakeCuratorCamera"] call bis_fnc_mp; - }; - deletevehicle _logic; - } else { - - //--- Repeat to achieve permanent effect - _repeat = _logic getvariable ["repeat",0] > 0; - if (_repeat) then { - [_logic,_units,_activated] call bis_fnc_moduleprojectile; - } else { - deletevehicle _logic; - }; - }; - } else { - deletevehicle _logic; - }; - } else { - ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeof _logic] call bis_fnc_error; - }; -}; From 3118666f8093dcbe2496182777e056caaef8125e Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 11 May 2015 16:02:24 +0100 Subject: [PATCH 090/172] Added settings module to config Started functionality --- .../functions/fnc_readSettingFromModule.sqf | 2 +- addons/zeus/CfgFactionClasses.hpp | 6 ++ addons/zeus/CfgVehicles.hpp | 80 +++++++++++++++++++ addons/zeus/XEH_preInit.sqf | 1 + addons/zeus/config.cpp | 21 +---- .../functions/fnc_bi_moduleProjectile.sqf | 2 +- .../zeus/functions/fnc_moduleZeusSettings.sqf | 29 +++++++ 7 files changed, 121 insertions(+), 20 deletions(-) create mode 100644 addons/zeus/CfgFactionClasses.hpp create mode 100644 addons/zeus/CfgVehicles.hpp create mode 100644 addons/zeus/functions/fnc_moduleZeusSettings.sqf diff --git a/addons/common/functions/fnc_readSettingFromModule.sqf b/addons/common/functions/fnc_readSettingFromModule.sqf index c92bb4ab94..518df8ed43 100644 --- a/addons/common/functions/fnc_readSettingFromModule.sqf +++ b/addons/common/functions/fnc_readSettingFromModule.sqf @@ -24,4 +24,4 @@ if (isNil {_logic getVariable _moduleVariable}) exitWith { }; // Set the setting globally and force it -[_settingName, _logic getVariable _moduleVariable, true, true] call FUNC(setSetting); +[_settingName, _logic getVariable _moduleVariable, true, true] call FUNC(setSetting); \ No newline at end of file diff --git a/addons/zeus/CfgFactionClasses.hpp b/addons/zeus/CfgFactionClasses.hpp new file mode 100644 index 0000000000..5d4fe23018 --- /dev/null +++ b/addons/zeus/CfgFactionClasses.hpp @@ -0,0 +1,6 @@ +class CfgFactionClasses { + class NO_CATEGORY; + class ADDON: NO_CATEGORY { + displayName = "ACE Zeus"; + }; +}; \ No newline at end of file diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp new file mode 100644 index 0000000000..41289e44db --- /dev/null +++ b/addons/zeus/CfgVehicles.hpp @@ -0,0 +1,80 @@ +class CfgVehicles { + class Module_F; + class ModuleEmpty_F; + class ACE_Module; + + class GVAR(moduleZeusSettings): ACE_Module { + scope = 2; + displayName = "Zeus Settings [ACE]"; + icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); + category = "ACE_zeus"; + function = QUOTE(DFUNC(moduleZeusSettings)); + functionPriority = 1; + isGlobal = 1; + isTriggerActivated = 0; + author = "SilentSpike"; + class Arguments { + class zeusAscension { + displayName = "Enable Ascension Messages"; + description = "Display a global popup message when a player is assigned as Zeus."; + typeName = "BOOL"; + defaultValue = 1; + }; + class zeusBird { + displayName = "Enable Eagle"; + description = "Spawn an eagle that follows the Zeus camera."; + typeName = "BOOL"; + defaultValue = 1; + }; + class radioOrdnance { + displayName = "Ordnance Radio Warning"; + description = "Play a radio warning when Zeus uses ordnance."; + typeName = "BOOL"; + defaultValue = 1; + }; + class revealMines { + displayName = "Reveal Mines"; + description = "Do you want to reveal mines placed by Zeus?"; + typeName = "NUMBER"; + class values { + class disable { + name = "Disabled"; + value = 0; + }; + class partial { + name = "Reveal to sides friendly with Zeus unit"; + value = 1; + }; + class full { + name = "Add map markers and reveal to sides friendly with Zeus unit"; + value = 2; + default = 1; + }; + }; + }; + class remoteWind { + displayName = "Reveal Remote Control"; + description = "Play a wind sound when Zeus remote controls a unit."; + typeName = "BOOL"; + defaultValue = 1; + }; + }; + class ModuleDescription { + description = "Provides control over various aspects of Zeus."; + sync[] = {}; + }; + }; + + class ModuleCurator_F: Module_F { + function = QUOTE(DFUNC(bi_moduleCurator)); + }; + class ModuleMine_F: ModuleEmpty_F { + function = QUOTE(DFUNC(bi_moduleMine)); + }; + class ModuleOrdnance_F: Module_F { + function = QUOTE(DFUNC(bi_moduleProjectile)); + }; + class ModuleRemoteControl_F: Module_F { + function = QUOTE(DFUNC(bi_moduleRemoteControl)); + }; +}; \ No newline at end of file diff --git a/addons/zeus/XEH_preInit.sqf b/addons/zeus/XEH_preInit.sqf index 726f6923b3..e7bb1b96a5 100644 --- a/addons/zeus/XEH_preInit.sqf +++ b/addons/zeus/XEH_preInit.sqf @@ -6,5 +6,6 @@ PREP(bi_moduleCurator); PREP(bi_moduleMine); PREP(bi_moduleProjectile); PREP(bi_moduleRemoteControl); +PREP(moduleZeusSettings); ADDON = true; diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index 3da43d935e..e469ae7aaa 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_common"}; + requiredAddons[] = {"ace_common","ace_modules"}; author[] = {"SilentSpike"}; authorUrl = "https://github.com/SilentSpike"; VERSION_CONFIG; @@ -13,20 +13,5 @@ class CfgPatches { }; #include "CfgEventHandlers.hpp" - -class CfgVehicles { - class Module_F; - class ModuleEmpty_F; - class ModuleCurator_F: Module_F { - function = QUOTE(FUNC(bi_moduleCurator)); - }; - class ModuleMine_F: ModuleEmpty_F { - function = QUOTE(FUNC(bi_moduleMine)); - }; - class ModuleOrdnance_F: Module_F { - function = QUOTE(FUNC(bi_moduleProjectile)); - }; - class ModuleRemoteControl_F: Module_F { - function = QUOTE(FUNC(bi_moduleRemoteControl)); - }; -}; \ No newline at end of file +#include "CfgFactionClasses.hpp" +#include "CfgVehicles.hpp" \ No newline at end of file diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index afb3f6e4bc..fbae16e00d 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -2,7 +2,7 @@ * Author: Bohemia Interactive * Module function for spawning projectiles * Used by Curator artillery modules etc - * Edited to remove radio warning (also retains ballistics support added by ACE_Modules) + * Edited to remove radio warning and add ballistics support * * Arguments: * 0: The logic object diff --git a/addons/zeus/functions/fnc_moduleZeusSettings.sqf b/addons/zeus/functions/fnc_moduleZeusSettings.sqf new file mode 100644 index 0000000000..94dc0d966a --- /dev/null +++ b/addons/zeus/functions/fnc_moduleZeusSettings.sqf @@ -0,0 +1,29 @@ +/* + * Author: SilentSpike + * Module for adjusting various aspects of zeus + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +private ["_logic", "_units", "_activated"]; +_logic = _this select 0; +_units = _this select 1; +_activated = _this select 2; + +if !(_activated) exitWith {}; + +[_logic, QGVAR(settingAscension), "zeusAscension"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(settingBird), "zeusBird"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(settingOrdnance), "radioOrdnance"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(settingMines), "revealMines"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(settingWind), "remoteWind"] call EFUNC(common,readSettingFromModule); \ No newline at end of file From 755581be4084f8393b49bbf8343f09fea493afa0 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 11 May 2015 16:23:46 +0100 Subject: [PATCH 091/172] Changed BI functions to check for settings --- .../zeus/functions/fnc_bi_moduleCurator.sqf | 55 ++++++++++--------- addons/zeus/functions/fnc_bi_moduleMine.sqf | 22 +++++--- .../functions/fnc_bi_moduleProjectile.sqf | 11 ++-- .../functions/fnc_bi_moduleRemoteControl.sqf | 9 +-- .../zeus/functions/fnc_moduleZeusSettings.sqf | 10 ++-- 5 files changed, 57 insertions(+), 50 deletions(-) diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 2203cb7f3a..333053c8eb 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -150,14 +150,15 @@ if (_activated) then { _x radiochanneladd [_player]; } foreach (_logic getvariable ["channels",[]]); - /* Removed by ACE - //--- Sent notification to all assigned players - { - if (isplayer _x) then { - [["CuratorAssign",[_name,name _player]],"bis_fnc_showNotification",_x] call bis_fnc_mp; - }; - } foreach (curatoreditableobjects _logic); - */ + // Added by ACE_zeus to toggle ascension messages + if (GETMVAR(QGVAR(zeusAscension),true)) then { + //--- Sent notification to all assigned players + { + if (isplayer _x) then { + [["CuratorAssign",[_name,name _player]],"bis_fnc_showNotification",_x] call bis_fnc_mp; + }; + } foreach (curatoreditableobjects _logic); + }; [_logic,"curatorUnitAssigned",[_logic,_player]] call bis_fnc_callscriptedeventhandler; @@ -189,14 +190,15 @@ if (_activated) then { }; }; - /* Removed by ACE - //--- Create bird - _birdType = _logic getvariable ["birdType","eagle_f"]; - if (_birdType != "") then { - _bird = createvehicle [_birdType,[100,100,100],[],0,"none"]; - _logic setvariable ["bird",_bird,true]; + // Added by ACE_zeus to toggle eagle + if (GETMVAR(QGVAR(zeusBird),true)) then { + //--- Create bird + _birdType = _logic getvariable ["birdType","eagle_f"]; + if (_birdType != "") then { + _bird = createvehicle [_birdType,[100,100,100],[],0,"none"]; + _logic setvariable ["bird",_bird,true]; + }; }; - */ //--- Activated all future addons _addons = []; @@ -213,17 +215,18 @@ if (_activated) then { } foreach (synchronizedobjects _logic); _addons call bis_fnc_activateaddons; - /* Removed by ACE - //--- Locality changed - _logic addeventhandler [ - "local", - { - _logic = _this select 0; - _bird = _logic getvariable ["bird",objnull]; - _bird setowner owner _logic; - } - ]; - */ + // Added by ACE_zeus to toggle eagle + if (GETMVAR(QGVAR(zeusBird),true)) then { + //--- Locality changed + _logic addeventhandler [ + "local", + { + _logic = _this select 0; + _bird = _logic getvariable ["bird",objnull]; + _bird setowner owner _logic; + } + ]; + }; }; //--- Player diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf index d8142c078d..df1c55dbf1 100644 --- a/addons/zeus/functions/fnc_bi_moduleMine.sqf +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -22,16 +22,20 @@ if (_activated) then { _explosive = createvehicle [_explosive,position _logic,[],0,"none"]; _explosive attachto [_logic]; - /* Removed by ACE - //--- Reveal the mine to curator's side - { - _side = (getassignedcuratorunit _x) call bis_fnc_objectSide; - _side revealmine _explosive; - } foreach (objectcurators _logic); + // Added by ACE_zeus to control if mines are revealed + _revealMines = GETMVAR(QGVAR(revealMines),2); + if (_revealMines > 0) then { + //--- Reveal the mine to curator's side + { + _side = (getassignedcuratorunit _x) call bis_fnc_objectSide; + _side revealmine _explosive; + } foreach (objectcurators _logic); - //--- Mark minefields in the map - [] spawn bis_fnc_drawMinefields; - */ + if (_revealMines > 1) then { + //--- Mark minefields in the map + [] spawn bis_fnc_drawMinefields; + }; + }; //--- Show hint to curator who placed the object [[["Curator","PlaceMines"],nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",_logic] call bis_fnc_mp; diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index fbae16e00d..047f5ac5eb 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -91,7 +91,6 @@ if (_activated) then { }; default {["Ammo simulation '%1' is not supported",_simulation] call bis_fnc_error;}; }; - /* Removed by ACE _fnc_playRadio = { if (_radio != "") then { _entities = (getposatl _logic) nearentities ["All",100]; @@ -110,7 +109,6 @@ if (_activated) then { } foreach _entities; }; }; - */ if (count _hint > 0) then { [[_hint,nil,nil,nil,nil,nil,nil,true],"bis_fnc_advHint",objectcurators _logic] call bis_fnc_mp; }; @@ -136,10 +134,11 @@ if (_activated) then { //--- Create sound source _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull}; - /* Removed by ACE - //--- Play radio warning - [] call _fnc_playRadio; - */ + // Added by ACE_zeus to toggle ordnance radio message + if (GETMVAR(QGVAR(radioOrdnance),true)) then { + //--- Play radio warning + [] call _fnc_playRadio; + }; //--- Update if (_attach) then { diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index bf73a8863e..e57ee98b5c 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -45,10 +45,11 @@ if (_activated && local _logic && !isnull curatorcamera) then { bis_fnc_moduleRemoteControl_unit = _unit; _unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true]; - /* Removed by ACE - //--- Play wind cue to all players - [format ["wind%1",ceil random 5],"bis_fnc_playsound"] call bis_fnc_mp; - */ + // Added by ACE_zeus to toggle remote control wind sound + if (GETMVAR(QGVAR(remoteWind),true)) then { + //--- Play wind cue to all players + [format ["wind%1",ceil random 5],"bis_fnc_playsound"] call bis_fnc_mp; + }; _blur = ppeffectcreate ["RadialBlur",144]; _blur ppeffectenable true; diff --git a/addons/zeus/functions/fnc_moduleZeusSettings.sqf b/addons/zeus/functions/fnc_moduleZeusSettings.sqf index 94dc0d966a..5963d7216c 100644 --- a/addons/zeus/functions/fnc_moduleZeusSettings.sqf +++ b/addons/zeus/functions/fnc_moduleZeusSettings.sqf @@ -22,8 +22,8 @@ _activated = _this select 2; if !(_activated) exitWith {}; -[_logic, QGVAR(settingAscension), "zeusAscension"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(settingBird), "zeusBird"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(settingOrdnance), "radioOrdnance"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(settingMines), "revealMines"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(settingWind), "remoteWind"] call EFUNC(common,readSettingFromModule); \ No newline at end of file +[_logic, QGVAR(zeusAscension), "zeusAscension"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(zeusBird), "zeusBird"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(radioOrdnance), "radioOrdnance"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(revealMines), "revealMines"] call EFUNC(common,readSettingFromModule); +[_logic, QGVAR(remoteWind), "remoteWind"] call EFUNC(common,readSettingFromModule); \ No newline at end of file From e16ea007e401f15c18bcbbcdedd6171bd8dc3699 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 11 May 2015 16:30:46 +0100 Subject: [PATCH 092/172] Add ACE settings --- addons/zeus/ACE_Settings.hpp | 23 +++++++++++++++++++++++ addons/zeus/CfgVehicles.hpp | 2 +- addons/zeus/config.cpp | 3 ++- 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 addons/zeus/ACE_Settings.hpp diff --git a/addons/zeus/ACE_Settings.hpp b/addons/zeus/ACE_Settings.hpp new file mode 100644 index 0000000000..7221e51f34 --- /dev/null +++ b/addons/zeus/ACE_Settings.hpp @@ -0,0 +1,23 @@ +class ACE_Settings { + class GVAR(zeusAscension) { + typeName = "BOOL"; + value = 1; + }; + class GVAR(zeusBird) { + typeName = "BOOL"; + value = 1; + }; + class GVAR(radioOrdnance) { + typeName = "BOOL"; + value = 1; + }; + class GVAR(revealMines) { + typeName = "SCALAR"; + value = 2; + values[] = {"Disabled", "Partially", "Fully"}; + }; + class GVAR(remoteWind) { + typeName = "BOOL"; + value = 1; + }; +}; diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 41289e44db..8952571f2a 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -6,7 +6,7 @@ class CfgVehicles { class GVAR(moduleZeusSettings): ACE_Module { scope = 2; displayName = "Zeus Settings [ACE]"; - icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); + //icon = QUOTE(PATHTOF(iconGoesHere)); category = "ACE_zeus"; function = QUOTE(DFUNC(moduleZeusSettings)); functionPriority = 1; diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index e469ae7aaa..cea8c64f76 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -14,4 +14,5 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgFactionClasses.hpp" -#include "CfgVehicles.hpp" \ No newline at end of file +#include "CfgVehicles.hpp" +#include "ACE_Settings.hpp" \ No newline at end of file From 0b3d3b8793f7c3c9e02633e794125e1c14d19dc5 Mon Sep 17 00:00:00 2001 From: ulteq Date: Mon, 11 May 2015 17:37:08 +0200 Subject: [PATCH 093/172] Added missing PBOPREFIX files --- addons/advanced_ballistics/$PBOPREFIX$ | 1 + addons/atragmx/$PBOPREFIX$ | 1 + addons/kestrel4500/$PBOPREFIX$ | 1 + addons/nightvision/$PBOPREFIX$ | 1 + addons/winddeflection/$PBOPREFIX$ | 1 + 5 files changed, 5 insertions(+) create mode 100644 addons/advanced_ballistics/$PBOPREFIX$ create mode 100644 addons/atragmx/$PBOPREFIX$ create mode 100644 addons/kestrel4500/$PBOPREFIX$ create mode 100644 addons/nightvision/$PBOPREFIX$ create mode 100644 addons/winddeflection/$PBOPREFIX$ diff --git a/addons/advanced_ballistics/$PBOPREFIX$ b/addons/advanced_ballistics/$PBOPREFIX$ new file mode 100644 index 0000000000..1ab65b7c32 --- /dev/null +++ b/addons/advanced_ballistics/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\advanced_ballistics \ No newline at end of file diff --git a/addons/atragmx/$PBOPREFIX$ b/addons/atragmx/$PBOPREFIX$ new file mode 100644 index 0000000000..c42e89e22d --- /dev/null +++ b/addons/atragmx/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\atragmx \ No newline at end of file diff --git a/addons/kestrel4500/$PBOPREFIX$ b/addons/kestrel4500/$PBOPREFIX$ new file mode 100644 index 0000000000..15660502ce --- /dev/null +++ b/addons/kestrel4500/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\kestrel4500 \ No newline at end of file diff --git a/addons/nightvision/$PBOPREFIX$ b/addons/nightvision/$PBOPREFIX$ new file mode 100644 index 0000000000..4a3d560db5 --- /dev/null +++ b/addons/nightvision/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\nightvision \ No newline at end of file diff --git a/addons/winddeflection/$PBOPREFIX$ b/addons/winddeflection/$PBOPREFIX$ new file mode 100644 index 0000000000..e36be56aec --- /dev/null +++ b/addons/winddeflection/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\winddeflection \ No newline at end of file From 0bae8471c58c16f9f5e1359beb47f72316a3cce2 Mon Sep 17 00:00:00 2001 From: ulteq Date: Mon, 11 May 2015 17:43:48 +0200 Subject: [PATCH 094/172] Added more missing PBOPREFIX files --- optionals/compat_asdg/$PBOPREFIX$ | 1 + optionals/compat_cup/$PBOPREFIX$ | 1 + optionals/compat_hlc_ar15/$PBOPREFIX$ | 1 + optionals/compat_hlc_wp_mp5/$PBOPREFIX$ | 1 + optionals/compat_hlcmods_ak/$PBOPREFIX$ | 1 + optionals/compat_hlcmods_aug/$PBOPREFIX$ | 1 + optionals/compat_hlcmods_core/$PBOPREFIX$ | 1 + optionals/compat_hlcmods_fal/$PBOPREFIX$ | 1 + optionals/compat_hlcmods_g3/$PBOPREFIX$ | 1 + optionals/compat_hlcmods_m14/$PBOPREFIX$ | 1 + optionals/compat_hlcmods_m60e4/$PBOPREFIX$ | 1 + optionals/compat_rh_acc/$PBOPREFIX$ | 1 + optionals/compat_rh_de/$PBOPREFIX$ | 1 + optionals/compat_rh_m4/$PBOPREFIX$ | 1 + optionals/compat_rh_pdw/$PBOPREFIX$ | 1 + optionals/compat_rhs_afrf3/$PBOPREFIX$ | 1 + optionals/compat_rhs_usf3/$PBOPREFIX$ | 1 + optionals/compat_rksl_pm_ii/$PBOPREFIX$ | 1 + optionals/server/$PBOPREFIX$ | 1 + 19 files changed, 19 insertions(+) create mode 100644 optionals/compat_asdg/$PBOPREFIX$ create mode 100644 optionals/compat_cup/$PBOPREFIX$ create mode 100644 optionals/compat_hlc_ar15/$PBOPREFIX$ create mode 100644 optionals/compat_hlc_wp_mp5/$PBOPREFIX$ create mode 100644 optionals/compat_hlcmods_ak/$PBOPREFIX$ create mode 100644 optionals/compat_hlcmods_aug/$PBOPREFIX$ create mode 100644 optionals/compat_hlcmods_core/$PBOPREFIX$ create mode 100644 optionals/compat_hlcmods_fal/$PBOPREFIX$ create mode 100644 optionals/compat_hlcmods_g3/$PBOPREFIX$ create mode 100644 optionals/compat_hlcmods_m14/$PBOPREFIX$ create mode 100644 optionals/compat_hlcmods_m60e4/$PBOPREFIX$ create mode 100644 optionals/compat_rh_acc/$PBOPREFIX$ create mode 100644 optionals/compat_rh_de/$PBOPREFIX$ create mode 100644 optionals/compat_rh_m4/$PBOPREFIX$ create mode 100644 optionals/compat_rh_pdw/$PBOPREFIX$ create mode 100644 optionals/compat_rhs_afrf3/$PBOPREFIX$ create mode 100644 optionals/compat_rhs_usf3/$PBOPREFIX$ create mode 100644 optionals/compat_rksl_pm_ii/$PBOPREFIX$ create mode 100644 optionals/server/$PBOPREFIX$ diff --git a/optionals/compat_asdg/$PBOPREFIX$ b/optionals/compat_asdg/$PBOPREFIX$ new file mode 100644 index 0000000000..0ba5166c16 --- /dev/null +++ b/optionals/compat_asdg/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_asdg \ No newline at end of file diff --git a/optionals/compat_cup/$PBOPREFIX$ b/optionals/compat_cup/$PBOPREFIX$ new file mode 100644 index 0000000000..42044805ba --- /dev/null +++ b/optionals/compat_cup/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_cup \ No newline at end of file diff --git a/optionals/compat_hlc_ar15/$PBOPREFIX$ b/optionals/compat_hlc_ar15/$PBOPREFIX$ new file mode 100644 index 0000000000..1151a9959c --- /dev/null +++ b/optionals/compat_hlc_ar15/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_hlc_ar15 \ No newline at end of file diff --git a/optionals/compat_hlc_wp_mp5/$PBOPREFIX$ b/optionals/compat_hlc_wp_mp5/$PBOPREFIX$ new file mode 100644 index 0000000000..397f5e9e6b --- /dev/null +++ b/optionals/compat_hlc_wp_mp5/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_hlc_wp_mp5 \ No newline at end of file diff --git a/optionals/compat_hlcmods_ak/$PBOPREFIX$ b/optionals/compat_hlcmods_ak/$PBOPREFIX$ new file mode 100644 index 0000000000..d1d239c6d5 --- /dev/null +++ b/optionals/compat_hlcmods_ak/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_hlcmods_ak \ No newline at end of file diff --git a/optionals/compat_hlcmods_aug/$PBOPREFIX$ b/optionals/compat_hlcmods_aug/$PBOPREFIX$ new file mode 100644 index 0000000000..6b917cc98c --- /dev/null +++ b/optionals/compat_hlcmods_aug/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_hlcmods_aug \ No newline at end of file diff --git a/optionals/compat_hlcmods_core/$PBOPREFIX$ b/optionals/compat_hlcmods_core/$PBOPREFIX$ new file mode 100644 index 0000000000..9c9e9061e1 --- /dev/null +++ b/optionals/compat_hlcmods_core/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_hlcmods_core \ No newline at end of file diff --git a/optionals/compat_hlcmods_fal/$PBOPREFIX$ b/optionals/compat_hlcmods_fal/$PBOPREFIX$ new file mode 100644 index 0000000000..91bbe75e96 --- /dev/null +++ b/optionals/compat_hlcmods_fal/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_hlcmods_fal \ No newline at end of file diff --git a/optionals/compat_hlcmods_g3/$PBOPREFIX$ b/optionals/compat_hlcmods_g3/$PBOPREFIX$ new file mode 100644 index 0000000000..ff5b23f6ea --- /dev/null +++ b/optionals/compat_hlcmods_g3/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_hlcmods_g3 \ No newline at end of file diff --git a/optionals/compat_hlcmods_m14/$PBOPREFIX$ b/optionals/compat_hlcmods_m14/$PBOPREFIX$ new file mode 100644 index 0000000000..9542452ad0 --- /dev/null +++ b/optionals/compat_hlcmods_m14/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_hlcmods_m14 \ No newline at end of file diff --git a/optionals/compat_hlcmods_m60e4/$PBOPREFIX$ b/optionals/compat_hlcmods_m60e4/$PBOPREFIX$ new file mode 100644 index 0000000000..73c943fe8f --- /dev/null +++ b/optionals/compat_hlcmods_m60e4/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_hlcmods_m60e4 \ No newline at end of file diff --git a/optionals/compat_rh_acc/$PBOPREFIX$ b/optionals/compat_rh_acc/$PBOPREFIX$ new file mode 100644 index 0000000000..0b6e3940dd --- /dev/null +++ b/optionals/compat_rh_acc/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_rh_acc \ No newline at end of file diff --git a/optionals/compat_rh_de/$PBOPREFIX$ b/optionals/compat_rh_de/$PBOPREFIX$ new file mode 100644 index 0000000000..7d6056b8b4 --- /dev/null +++ b/optionals/compat_rh_de/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_rh_de \ No newline at end of file diff --git a/optionals/compat_rh_m4/$PBOPREFIX$ b/optionals/compat_rh_m4/$PBOPREFIX$ new file mode 100644 index 0000000000..a8d524952e --- /dev/null +++ b/optionals/compat_rh_m4/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_rh_m4 \ No newline at end of file diff --git a/optionals/compat_rh_pdw/$PBOPREFIX$ b/optionals/compat_rh_pdw/$PBOPREFIX$ new file mode 100644 index 0000000000..24f07d7987 --- /dev/null +++ b/optionals/compat_rh_pdw/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_rh_pdw \ No newline at end of file diff --git a/optionals/compat_rhs_afrf3/$PBOPREFIX$ b/optionals/compat_rhs_afrf3/$PBOPREFIX$ new file mode 100644 index 0000000000..db0e884853 --- /dev/null +++ b/optionals/compat_rhs_afrf3/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_rhs_afrf3 \ No newline at end of file diff --git a/optionals/compat_rhs_usf3/$PBOPREFIX$ b/optionals/compat_rhs_usf3/$PBOPREFIX$ new file mode 100644 index 0000000000..5d837d06d7 --- /dev/null +++ b/optionals/compat_rhs_usf3/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_rhs_usf3 \ No newline at end of file diff --git a/optionals/compat_rksl_pm_ii/$PBOPREFIX$ b/optionals/compat_rksl_pm_ii/$PBOPREFIX$ new file mode 100644 index 0000000000..2d73d5ce66 --- /dev/null +++ b/optionals/compat_rksl_pm_ii/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\compat_rksl_pm_ii \ No newline at end of file diff --git a/optionals/server/$PBOPREFIX$ b/optionals/server/$PBOPREFIX$ new file mode 100644 index 0000000000..67fa39d646 --- /dev/null +++ b/optionals/server/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\server \ No newline at end of file From 695e775cd752fa795d85c7645ff33c8f322c7ad6 Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 11 May 2015 09:01:16 -0700 Subject: [PATCH 095/172] Change 'ace_serverconfig' to 'ace_server' --- optionals/server/script_component.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/optionals/server/script_component.hpp b/optionals/server/script_component.hpp index f044c9601a..a17615ebbc 100644 --- a/optionals/server/script_component.hpp +++ b/optionals/server/script_component.hpp @@ -1,12 +1,12 @@ #define COMPONENT serverconfig #include "\z\ace\Addons\main\script_mod.hpp" -#ifdef DEBUG_ENABLED_SERVERCONFIG +#ifdef DEBUG_ENABLED_SERVER #define DEBUG_MODE_FULL #endif -#ifdef DEBUG_SETTINGS_SERVERCONFIG - #define DEBUG_SETTINGS DEBUG_SETTINGS_SERVERCONFIG +#ifdef DEBUG_SETTINGS_SERVER + #define DEBUG_SETTINGS DEBUG_SETTINGS_SERVER #endif #include "\z\ace\Addons\main\script_macros.hpp" From 9660978b92eb035b967c087e4e86b5cf376bc887 Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 11 May 2015 09:02:13 -0700 Subject: [PATCH 096/172] Changed: search for ace_server, not ace_serverconfig --- addons/common/scripts/Version/checkVersionNumber.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/common/scripts/Version/checkVersionNumber.sqf b/addons/common/scripts/Version/checkVersionNumber.sqf index 1bc002153c..74f130596a 100644 --- a/addons/common/scripts/Version/checkVersionNumber.sqf +++ b/addons/common/scripts/Version/checkVersionNumber.sqf @@ -47,7 +47,7 @@ if (!isServer) then { _index = _files find _x; if (_index == -1) then { - if (_x != "ace_serverconfig") then {_missingAddons pushBack _x;}; + if (_x != "ace_server") then {_missingAddons pushBack _x;}; } else { _clientVersion = _versions select _index; From 192a02ce563d897280c8b4941ac0d37636346c8d Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 11 May 2015 09:03:09 -0700 Subject: [PATCH 097/172] No really, change it. --- optionals/server/script_component.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/optionals/server/script_component.hpp b/optionals/server/script_component.hpp index a17615ebbc..18afd814f7 100644 --- a/optionals/server/script_component.hpp +++ b/optionals/server/script_component.hpp @@ -1,4 +1,4 @@ -#define COMPONENT serverconfig +#define COMPONENT server #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_SERVER From b09ebc9c795704eb0d3c4d10dc6f1442ab574b3d Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 11 May 2015 17:08:25 +0100 Subject: [PATCH 098/172] QGVAR was meant to be GVAR Improved module text Forgot about script_component --- addons/zeus/ACE_Settings.hpp | 8 +++---- addons/zeus/CfgVehicles.hpp | 24 +++++++++---------- .../zeus/functions/fnc_bi_moduleCurator.sqf | 8 ++++--- addons/zeus/functions/fnc_bi_moduleMine.sqf | 4 +++- .../functions/fnc_bi_moduleProjectile.sqf | 4 +++- .../functions/fnc_bi_moduleRemoteControl.sqf | 4 +++- 6 files changed, 30 insertions(+), 22 deletions(-) diff --git a/addons/zeus/ACE_Settings.hpp b/addons/zeus/ACE_Settings.hpp index 7221e51f34..179a211664 100644 --- a/addons/zeus/ACE_Settings.hpp +++ b/addons/zeus/ACE_Settings.hpp @@ -7,6 +7,10 @@ class ACE_Settings { typeName = "BOOL"; value = 1; }; + class GVAR(remoteWind) { + typeName = "BOOL"; + value = 1; + }; class GVAR(radioOrdnance) { typeName = "BOOL"; value = 1; @@ -16,8 +20,4 @@ class ACE_Settings { value = 2; values[] = {"Disabled", "Partially", "Fully"}; }; - class GVAR(remoteWind) { - typeName = "BOOL"; - value = 1; - }; }; diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 8952571f2a..53c859309a 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -15,17 +15,23 @@ class CfgVehicles { author = "SilentSpike"; class Arguments { class zeusAscension { - displayName = "Enable Ascension Messages"; - description = "Display a global popup message when a player is assigned as Zeus."; + displayName = "Ascension Messages"; + description = "Display global popup messages when a player is assigned as Zeus."; typeName = "BOOL"; defaultValue = 1; }; class zeusBird { - displayName = "Enable Eagle"; + displayName = "Zeus Eagle"; description = "Spawn an eagle that follows the Zeus camera."; typeName = "BOOL"; defaultValue = 1; }; + class remoteWind { + displayName = "Wind Sounds"; + description = "Play wind sounds when Zeus remote controls a unit."; + typeName = "BOOL"; + defaultValue = 1; + }; class radioOrdnance { displayName = "Ordnance Radio Warning"; description = "Play a radio warning when Zeus uses ordnance."; @@ -34,7 +40,7 @@ class CfgVehicles { }; class revealMines { displayName = "Reveal Mines"; - description = "Do you want to reveal mines placed by Zeus?"; + description = "Reveal mines to allies and/or place map markers."; typeName = "NUMBER"; class values { class disable { @@ -42,22 +48,16 @@ class CfgVehicles { value = 0; }; class partial { - name = "Reveal to sides friendly with Zeus unit"; + name = "Reveal to Allies"; value = 1; }; class full { - name = "Add map markers and reveal to sides friendly with Zeus unit"; + name = "Allies + Map Markers"; value = 2; default = 1; }; }; }; - class remoteWind { - displayName = "Reveal Remote Control"; - description = "Play a wind sound when Zeus remote controls a unit."; - typeName = "BOOL"; - defaultValue = 1; - }; }; class ModuleDescription { description = "Provides control over various aspects of Zeus."; diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 333053c8eb..92375d3114 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -12,6 +12,8 @@ * Public: No */ +#include "script_component.hpp" + _logic = _this select 0; _units = _this select 1; _activated = _this select 2; @@ -151,7 +153,7 @@ if (_activated) then { } foreach (_logic getvariable ["channels",[]]); // Added by ACE_zeus to toggle ascension messages - if (GETMVAR(QGVAR(zeusAscension),true)) then { + if (GETMVAR(GVAR(zeusAscension),true)) then { //--- Sent notification to all assigned players { if (isplayer _x) then { @@ -191,7 +193,7 @@ if (_activated) then { }; // Added by ACE_zeus to toggle eagle - if (GETMVAR(QGVAR(zeusBird),true)) then { + if (GETMVAR(GVAR(zeusBird),true)) then { //--- Create bird _birdType = _logic getvariable ["birdType","eagle_f"]; if (_birdType != "") then { @@ -216,7 +218,7 @@ if (_activated) then { _addons call bis_fnc_activateaddons; // Added by ACE_zeus to toggle eagle - if (GETMVAR(QGVAR(zeusBird),true)) then { + if (GETMVAR(GVAR(zeusBird),true)) then { //--- Locality changed _logic addeventhandler [ "local", diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf index df1c55dbf1..73395f48c2 100644 --- a/addons/zeus/functions/fnc_bi_moduleMine.sqf +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -12,6 +12,8 @@ * Public: No */ +#include "script_component.hpp" + _logic = _this select 0; _units = _this select 1; _activated = _this select 2; @@ -23,7 +25,7 @@ if (_activated) then { _explosive attachto [_logic]; // Added by ACE_zeus to control if mines are revealed - _revealMines = GETMVAR(QGVAR(revealMines),2); + _revealMines = GETMVAR(GVAR(revealMines),2); if (_revealMines > 0) then { //--- Reveal the mine to curator's side { diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index 047f5ac5eb..29a329ade5 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -13,6 +13,8 @@ * Public: No */ +#include "script_component.hpp" + _fnc_scriptNameParentTemp = if !(isnil '_fnc_scriptName') then {_fnc_scriptName} else {'BIS_fnc_moduleProjectile'}; private ['_fnc_scriptNameParent']; _fnc_scriptNameParent = _fnc_scriptNameParentTemp; @@ -135,7 +137,7 @@ if (_activated) then { _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull}; // Added by ACE_zeus to toggle ordnance radio message - if (GETMVAR(QGVAR(radioOrdnance),true)) then { + if (GETMVAR(GVAR(radioOrdnance),true)) then { //--- Play radio warning [] call _fnc_playRadio; }; diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index e57ee98b5c..557d13f81f 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -12,6 +12,8 @@ * Public: No */ +#include "script_component.hpp" + _logic = _this select 0; _units = _this select 1; _activated = _this select 2; @@ -46,7 +48,7 @@ if (_activated && local _logic && !isnull curatorcamera) then { _unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true]; // Added by ACE_zeus to toggle remote control wind sound - if (GETMVAR(QGVAR(remoteWind),true)) then { + if (GETMVAR(GVAR(remoteWind),true)) then { //--- Play wind cue to all players [format ["wind%1",ceil random 5],"bis_fnc_playsound"] call bis_fnc_mp; }; From a7a76d69ae0eeb1c2b82a44d0419a6b4fe205ac9 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Mon, 11 May 2015 09:48:47 -0700 Subject: [PATCH 099/172] Read ACE VERSION from main/script_mod.hpp #1105 --- tools/make.py | 34 +++++++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/tools/make.py b/tools/make.py index e45c029ccc..09b5b4671d 100644 --- a/tools/make.py +++ b/tools/make.py @@ -55,7 +55,7 @@ if sys.platform == "win32": import winreg ######## GLOBALS ######### -ACE_VERSION = "3.0.0.3" +ACE_VERSION = "3.0.0" work_drive = "" module_root = "" make_root = "" @@ -494,7 +494,35 @@ def addon_restore(modulePath): def get_ace_version(): global ACE_VERSION + versionStamp = ACE_VERSION #do the magic based on https://github.com/acemod/ACE3/issues/806#issuecomment-95639048 + + try: + scriptModPath = os.path.join(work_drive, prefix, "main\script_mod.hpp") + + if os.path.isfile(scriptModPath): + f = open(scriptModPath, "r") + hpptext = f.read() + f.close() + + if hpptext: + majorText = re.search(r"#define MAJOR (.*\b)", hpptext).group(1) + minorText = re.search(r"#define MINOR (.*\b)", hpptext).group(1) + patchlvlText = re.search(r"#define PATCHLVL (.*\b)", hpptext).group(1) + buildText = re.search(r"#define BUILD (.*\b)", hpptext).group(1) + + if majorText: + versionStamp = "{major}.{minor}.{patchlvl}.{build}".format(major=majorText,minor=minorText,patchlvl=patchlvlText,build=buildText) + + else: + print_error("A Critical file seems to be missing or inaccessible: {}".format(scriptModPath)) + return 0 + + except Exception as e: + print_error("Get_Ace_Version error: {}".format(e)) + + print_yellow("ACE VERSION set to {}".format(versionStamp)) + ACE_VERSION = versionStamp return ACE_VERSION @@ -569,6 +597,7 @@ def version_stamp_pboprefix(module,commitID): return False return True + ############################################################################### @@ -743,11 +772,10 @@ See the make.cfg file for additional build options. module_root = cfg.get(make_target, "module_root", fallback=os.path.join(make_root_parent, "addons")) optionals_root = os.path.join(module_root_parent, "optionals") extensions_root = os.path.join(module_root_parent, "extensions") - print_green ("module_root: {}".format(module_root)) - commit_id = get_commit_ID() key_name = versionStamp = get_private_keyname(commit_id) + print_green ("module_root: {}".format(module_root)) if (os.path.isdir(module_root)): os.chdir(module_root) From c0e2af2e6634430af3ed4ce19359942f13dc2112 Mon Sep 17 00:00:00 2001 From: commy2 Date: Mon, 11 May 2015 18:50:04 +0200 Subject: [PATCH 100/172] quotes in config arrays --- addons/thermals/config.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/thermals/config.cpp b/addons/thermals/config.cpp index 252a440535..07d19d1b50 100644 --- a/addons/thermals/config.cpp +++ b/addons/thermals/config.cpp @@ -5,7 +5,7 @@ class CfgPatches { units[] = {}; weapons[] = {}; requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {ace_common}; + requiredAddons[] = {"ace_common"}; author[] = {"[TF]Nkey"}; authorUrl = "https://github.com/michail-nikolaev/"; VERSION_CONFIG; From 5092d586fd6191389fa7fa646ac4a712e2dcf93c Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Mon, 11 May 2015 10:06:40 -0700 Subject: [PATCH 101/172] Exception handling and clean up. #1105 --- addons/config.cpp | 167 ---------------------------------------------- tools/make.py | 9 ++- 2 files changed, 7 insertions(+), 169 deletions(-) delete mode 100644 addons/config.cpp diff --git a/addons/config.cpp b/addons/config.cpp deleted file mode 100644 index 27647f8d00..0000000000 --- a/addons/config.cpp +++ /dev/null @@ -1,167 +0,0 @@ -#include "script_component.hpp" - -class CfgPatches { - class ADDON { - units[] = {"ACE_Box_Misc", "ACE_bananaItem"}; - weapons[] = {"ACE_ItemCore","ACE_FakePrimaryWeapon", "ACE_Banana"}; - requiredVersion = REQUIRED_VERSION; - requiredAddons[] = {"ace_main"}; - author[] = {"KoffeinFlummi"}; - authorUrl = "https://github.com/KoffeinFlummi/"; - VERSION_CONFIG; - }; -}; - -#include "CfgEventHandlers.hpp" - -#include "CfgSounds.hpp" -#include "CfgVehicles.hpp" -#include "CfgWeapons.hpp" -#include "CfgMagazines.hpp" - -#include "CfgActions.hpp" -#include "CfgMoves.hpp" -#include "CfgVoice.hpp" -#include "CfgUnitInsignia.hpp" - -class ACE_Rsc_Display_Base { - idd = -1; - type = 0; - style = 48; - name = ""; - duration = 999999; - fadeIn = 0; - fadeOut = 0; - font = "TahomaB"; - size = 1; - colorBackground[] = {1, 1, 1, 0}; - colorText[] = {1, 1, 1, 1}; -}; - -class ACE_Rsc_Control_Base { - idc = 1; - type = 0; - style = 48; - access = 0; - lineSpacing = 0; - moving = 1; - text = ""; - size = 1; - sizeEx = 0; - font = "TahomaB"; - colorBackground[] = {1, 1, 1, 0}; - colorText[] = {1, 1, 1, 1}; - x = 0; - y = 0; - w = 0; - h = 0; -}; - -class ACE_Settings { - /* - *class GVAR(sampleSetting) { - * Value - * value = 1; - * - * Type (SCALAR, BOOL, STRING, ARRAY, COLOR) - * typeName = "SCALAR"; - * - * Force the setting? - * force = 0; - * - * Does it appear on the options menu? - * isClientSettable = 1; - * - * The following settings only apply when isClientSettable == 1 - * Stringtable entry with the setting name - * displayName = "$STR_ACE_Common_SettingName"; - * - * Stringtable entry with the setting description - * description = "$STR_ACE_Common_SettingDescription"; - * - * Stringtable entries that describe the options - * Only applies if typeName == "SCALAR"; - * values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; - *}; - */ - class GVAR(forceAllSettings) { - value = 0; - typeName = "BOOL"; - }; - /*class GVAR(enableNumberHotkeys) { - value = 1; - typeName = "BOOL"; - isClientSettable = 1; - displayName = "$STR_ACE_Common_EnableNumberHotkeys"; - };*/ - class GVAR(settingFeedbackIcons) { - value = 1; - typeName = "SCALAR"; - force = 0; - isClientSettable = 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; - isClientSettable = 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"; - isClientSettable = 1; - displayName = "$STR_ACE_Common_SettingDisplayTextColorName"; - description = "$STR_ACE_Common_SettingDisplayTextColorDesc"; - }; - class GVAR(displayTextFontColor) { - value[] = {1,1,1,1}; - typeName = "COLOR"; - isClientSettable = 1; - displayName = "$STR_ACE_Common_SettingDisplayTextFontColorName"; - description = "$STR_ACE_Common_SettingDisplayTextFontColorDesc"; - }; -}; - -#include "define.hpp" -#include -#include -#include - -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}; - }; - }; - }; -}; - -/* -// check dll -class RscStandardDisplay; -class RscDisplayMain: RscStandardDisplay { - onLoad = QUOTE([ARR_4(""onLoad"",_this,""RscDisplayMain"",'GUI')] call (uinamespace getvariable 'BIS_fnc_initDisplay'); [ARR_5('header','tail',{0},{},_this select 0)] call COMPILE_FILE(functions\fnc_errorMessage)); -}; -*/ - -class ACE_Extensions { - extensions[] = {}; -}; diff --git a/tools/make.py b/tools/make.py index 09b5b4671d..1138f782b2 100644 --- a/tools/make.py +++ b/tools/make.py @@ -516,11 +516,16 @@ def get_ace_version(): else: print_error("A Critical file seems to be missing or inaccessible: {}".format(scriptModPath)) - return 0 + raise FileNotFoundError("File Not Found: {}".format(scriptModPath)) except Exception as e: print_error("Get_Ace_Version error: {}".format(e)) - + print_error("Check the integrity of the file: {}".format(scriptModPath)) + versionStamp = ACE_VERSION + print_error("Resetting to the default version stamp: {}".format(versionStamp)) + input("Press Enter to continue...") + print("Resuming build...") + print_yellow("ACE VERSION set to {}".format(versionStamp)) ACE_VERSION = versionStamp return ACE_VERSION From 7cf52d13ca80c673fde07321d91d92f033ee9096 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 11 May 2015 18:06:01 +0100 Subject: [PATCH 102/172] Disable zeus settings by default Fixed newline characters --- addons/common/functions/fnc_readSettingFromModule.sqf | 2 +- addons/zeus/ACE_Settings.hpp | 10 +++++----- addons/zeus/CfgFactionClasses.hpp | 2 +- addons/zeus/CfgVehicles.hpp | 2 +- addons/zeus/config.cpp | 2 +- addons/zeus/functions/fnc_bi_moduleCurator.sqf | 8 ++++---- addons/zeus/functions/fnc_bi_moduleMine.sqf | 7 +++---- addons/zeus/functions/fnc_bi_moduleProjectile.sqf | 4 ++-- addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf | 4 ++-- addons/zeus/functions/fnc_moduleZeusSettings.sqf | 2 +- addons/zeus/script_component.hpp | 2 +- 11 files changed, 22 insertions(+), 23 deletions(-) diff --git a/addons/common/functions/fnc_readSettingFromModule.sqf b/addons/common/functions/fnc_readSettingFromModule.sqf index 518df8ed43..c92bb4ab94 100644 --- a/addons/common/functions/fnc_readSettingFromModule.sqf +++ b/addons/common/functions/fnc_readSettingFromModule.sqf @@ -24,4 +24,4 @@ if (isNil {_logic getVariable _moduleVariable}) exitWith { }; // Set the setting globally and force it -[_settingName, _logic getVariable _moduleVariable, true, true] call FUNC(setSetting); \ No newline at end of file +[_settingName, _logic getVariable _moduleVariable, true, true] call FUNC(setSetting); diff --git a/addons/zeus/ACE_Settings.hpp b/addons/zeus/ACE_Settings.hpp index 179a211664..536790ba26 100644 --- a/addons/zeus/ACE_Settings.hpp +++ b/addons/zeus/ACE_Settings.hpp @@ -1,23 +1,23 @@ class ACE_Settings { class GVAR(zeusAscension) { typeName = "BOOL"; - value = 1; + value = 0; }; class GVAR(zeusBird) { typeName = "BOOL"; - value = 1; + value = 0; }; class GVAR(remoteWind) { typeName = "BOOL"; - value = 1; + value = 0; }; class GVAR(radioOrdnance) { typeName = "BOOL"; - value = 1; + value = 0; }; class GVAR(revealMines) { typeName = "SCALAR"; - value = 2; + value = 0; values[] = {"Disabled", "Partially", "Fully"}; }; }; diff --git a/addons/zeus/CfgFactionClasses.hpp b/addons/zeus/CfgFactionClasses.hpp index 5d4fe23018..bf34546727 100644 --- a/addons/zeus/CfgFactionClasses.hpp +++ b/addons/zeus/CfgFactionClasses.hpp @@ -3,4 +3,4 @@ class CfgFactionClasses { class ADDON: NO_CATEGORY { displayName = "ACE Zeus"; }; -}; \ No newline at end of file +}; diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index 53c859309a..a7671232a7 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -77,4 +77,4 @@ class CfgVehicles { class ModuleRemoteControl_F: Module_F { function = QUOTE(DFUNC(bi_moduleRemoteControl)); }; -}; \ No newline at end of file +}; diff --git a/addons/zeus/config.cpp b/addons/zeus/config.cpp index cea8c64f76..4bdc1cd5e1 100644 --- a/addons/zeus/config.cpp +++ b/addons/zeus/config.cpp @@ -15,4 +15,4 @@ class CfgPatches { #include "CfgEventHandlers.hpp" #include "CfgFactionClasses.hpp" #include "CfgVehicles.hpp" -#include "ACE_Settings.hpp" \ No newline at end of file +#include "ACE_Settings.hpp" diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index 92375d3114..a2ccf537bc 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -153,7 +153,7 @@ if (_activated) then { } foreach (_logic getvariable ["channels",[]]); // Added by ACE_zeus to toggle ascension messages - if (GETMVAR(GVAR(zeusAscension),true)) then { + if GVAR(zeusAscension) then { //--- Sent notification to all assigned players { if (isplayer _x) then { @@ -193,7 +193,7 @@ if (_activated) then { }; // Added by ACE_zeus to toggle eagle - if (GETMVAR(GVAR(zeusBird),true)) then { + if GVAR(zeusBird) then { //--- Create bird _birdType = _logic getvariable ["birdType","eagle_f"]; if (_birdType != "") then { @@ -218,7 +218,7 @@ if (_activated) then { _addons call bis_fnc_activateaddons; // Added by ACE_zeus to toggle eagle - if (GETMVAR(GVAR(zeusBird),true)) then { + if GVAR(zeusBird) then { //--- Locality changed _logic addeventhandler [ "local", @@ -330,4 +330,4 @@ if (_activated) then { player call bis_fnc_curatorRespawn; }; -}; \ No newline at end of file +}; diff --git a/addons/zeus/functions/fnc_bi_moduleMine.sqf b/addons/zeus/functions/fnc_bi_moduleMine.sqf index 73395f48c2..b5063c7fed 100644 --- a/addons/zeus/functions/fnc_bi_moduleMine.sqf +++ b/addons/zeus/functions/fnc_bi_moduleMine.sqf @@ -25,15 +25,14 @@ if (_activated) then { _explosive attachto [_logic]; // Added by ACE_zeus to control if mines are revealed - _revealMines = GETMVAR(GVAR(revealMines),2); - if (_revealMines > 0) then { + if (GVAR(revealMines) > 0) then { //--- Reveal the mine to curator's side { _side = (getassignedcuratorunit _x) call bis_fnc_objectSide; _side revealmine _explosive; } foreach (objectcurators _logic); - if (_revealMines > 1) then { + if (GVAR(revealMines) > 1) then { //--- Mark minefields in the map [] spawn bis_fnc_drawMinefields; }; @@ -46,4 +45,4 @@ if (_activated) then { if (isnull _logic) then {deletevehicle _explosive;} else {_explosive setdamage 1;}; deletevehicle _logic; }; -}; \ No newline at end of file +}; diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index 29a329ade5..c4d0277388 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -137,7 +137,7 @@ if (_activated) then { _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull}; // Added by ACE_zeus to toggle ordnance radio message - if (GETMVAR(GVAR(radioOrdnance),true)) then { + if GVAR(radioOrdnance) then { //--- Play radio warning [] call _fnc_playRadio; }; @@ -194,4 +194,4 @@ if (_activated) then { } else { ["Cannot create projectile, 'ammo' config attribute is missing in %1",typeof _logic] call bis_fnc_error; }; -}; \ No newline at end of file +}; diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index 557d13f81f..3efbaa0775 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -48,7 +48,7 @@ if (_activated && local _logic && !isnull curatorcamera) then { _unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true]; // Added by ACE_zeus to toggle remote control wind sound - if (GETMVAR(GVAR(remoteWind),true)) then { + if GVAR(remoteWind) then { //--- Play wind cue to all players [format ["wind%1",ceil random 5],"bis_fnc_playsound"] call bis_fnc_mp; }; @@ -168,4 +168,4 @@ if (_activated && local _logic && !isnull curatorcamera) then { [objnull,_error] call bis_fnc_showCuratorFeedbackMessage; }; deletevehicle _logic; -}; \ No newline at end of file +}; diff --git a/addons/zeus/functions/fnc_moduleZeusSettings.sqf b/addons/zeus/functions/fnc_moduleZeusSettings.sqf index 5963d7216c..3a582f7196 100644 --- a/addons/zeus/functions/fnc_moduleZeusSettings.sqf +++ b/addons/zeus/functions/fnc_moduleZeusSettings.sqf @@ -26,4 +26,4 @@ if !(_activated) exitWith {}; [_logic, QGVAR(zeusBird), "zeusBird"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(radioOrdnance), "radioOrdnance"] call EFUNC(common,readSettingFromModule); [_logic, QGVAR(revealMines), "revealMines"] call EFUNC(common,readSettingFromModule); -[_logic, QGVAR(remoteWind), "remoteWind"] call EFUNC(common,readSettingFromModule); \ No newline at end of file +[_logic, QGVAR(remoteWind), "remoteWind"] call EFUNC(common,readSettingFromModule); diff --git a/addons/zeus/script_component.hpp b/addons/zeus/script_component.hpp index d5a4ec1bcc..7211b28f7d 100644 --- a/addons/zeus/script_component.hpp +++ b/addons/zeus/script_component.hpp @@ -9,4 +9,4 @@ #define DEBUG_SETTINGS DEBUG_SETTINGS_ZEUS #endif -#include "\z\ace\addons\main\script_macros.hpp" \ No newline at end of file +#include "\z\ace\addons\main\script_macros.hpp" From 59d6e84fc0f254f768c10bda46f738c619c9594f Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Mon, 11 May 2015 10:43:05 -0700 Subject: [PATCH 103/172] Use abbreviated public key to minimize a BI bug. REFERENCE: http://feedback.arma3.com/view.php?id=22133 Always copy public key in case it is missing from the release folder. #1105 --- tools/make.py | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/tools/make.py b/tools/make.py index 1138f782b2..317e80db59 100644 --- a/tools/make.py +++ b/tools/make.py @@ -897,23 +897,27 @@ See the make.cfg file for additional build options. else: print_error("Failed to create key!") - try: - print("Copying public key to release directory.") - try: - os.makedirs(os.path.join(module_root, release_dir, project, "keys")) - except: - pass - - shutil.copyfile(os.path.join(private_key_path, key_name + ".bikey"), os.path.join(module_root, release_dir, project, "keys", key_name + ".bikey")) - - except: - print_error("Could not copy key to release directory.") - raise else: print_green("\nNOTE: Using key {}".format(os.path.join(private_key_path, key_name + ".biprivatekey"))) + try: + print("Copying public key to release directory.") + + try: + os.makedirs(os.path.join(module_root, release_dir, project, "keys")) + except: + pass + + # Use biKeyNameAbrev to attempt to minimize problems from this BI Bug REFERENCE: http://feedback.arma3.com/view.php?id=22133 + biKeyNameAbrev = key_name.split("-")[0] + shutil.copyfile(os.path.join(private_key_path, key_name + ".bikey"), os.path.join(module_root, release_dir, project, "keys", biKeyNameAbrev + ".bikey")) + + except: + print_error("Could not copy key to release directory.") + raise + key = os.path.join(private_key_path, key_name + ".biprivatekey") # Remove any obsolete files. From f6cdad62cad352491c9d5e4a6b6b53a5e75cc09e Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Mon, 11 May 2015 19:04:04 +0100 Subject: [PATCH 104/172] Added parenthesis --- addons/zeus/functions/fnc_bi_moduleCurator.sqf | 6 +++--- addons/zeus/functions/fnc_bi_moduleProjectile.sqf | 2 +- addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/zeus/functions/fnc_bi_moduleCurator.sqf b/addons/zeus/functions/fnc_bi_moduleCurator.sqf index a2ccf537bc..9ae35a4ce4 100644 --- a/addons/zeus/functions/fnc_bi_moduleCurator.sqf +++ b/addons/zeus/functions/fnc_bi_moduleCurator.sqf @@ -153,7 +153,7 @@ if (_activated) then { } foreach (_logic getvariable ["channels",[]]); // Added by ACE_zeus to toggle ascension messages - if GVAR(zeusAscension) then { + if (GVAR(zeusAscension)) then { //--- Sent notification to all assigned players { if (isplayer _x) then { @@ -193,7 +193,7 @@ if (_activated) then { }; // Added by ACE_zeus to toggle eagle - if GVAR(zeusBird) then { + if (GVAR(zeusBird)) then { //--- Create bird _birdType = _logic getvariable ["birdType","eagle_f"]; if (_birdType != "") then { @@ -218,7 +218,7 @@ if (_activated) then { _addons call bis_fnc_activateaddons; // Added by ACE_zeus to toggle eagle - if GVAR(zeusBird) then { + if (GVAR(zeusBird)) then { //--- Locality changed _logic addeventhandler [ "local", diff --git a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf index c4d0277388..6e2ee35387 100644 --- a/addons/zeus/functions/fnc_bi_moduleProjectile.sqf +++ b/addons/zeus/functions/fnc_bi_moduleProjectile.sqf @@ -137,7 +137,7 @@ if (_activated) then { _soundSource = if (_soundSourceClass != "") then {createSoundSource [_soundSourceClass,_pos,[],0]} else {objnull}; // Added by ACE_zeus to toggle ordnance radio message - if GVAR(radioOrdnance) then { + if (GVAR(radioOrdnance)) then { //--- Play radio warning [] call _fnc_playRadio; }; diff --git a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf index 3efbaa0775..57b325b585 100644 --- a/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf +++ b/addons/zeus/functions/fnc_bi_moduleRemoteControl.sqf @@ -48,7 +48,7 @@ if (_activated && local _logic && !isnull curatorcamera) then { _unit setvariable ["bis_fnc_moduleRemoteControl_owner",player,true]; // Added by ACE_zeus to toggle remote control wind sound - if GVAR(remoteWind) then { + if (GVAR(remoteWind)) then { //--- Play wind cue to all players [format ["wind%1",ceil random 5],"bis_fnc_playsound"] call bis_fnc_mp; }; From 50abf643593f0f9bd4d91d91ab5bc03ff86f7e8a Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Mon, 11 May 2015 12:53:49 -0700 Subject: [PATCH 105/172] Do not execute CfgConvert if $NOBIN$ is found. #1107 --- tools/make.py | 85 +++++++++++++++++++++++++++++++++------------------ 1 file changed, 56 insertions(+), 29 deletions(-) diff --git a/tools/make.py b/tools/make.py index 317e80db59..ce92e72ea7 100644 --- a/tools/make.py +++ b/tools/make.py @@ -56,6 +56,7 @@ if sys.platform == "win32": ######## GLOBALS ######### ACE_VERSION = "3.0.0" +arma3tools_path = "" work_drive = "" module_root = "" make_root = "" @@ -470,6 +471,55 @@ def check_for_obsolete_pbos(addonspath, file): return False +def backup_config(module): + #PABST: Convert config (run the macro'd config.cpp through CfgConvert twice to produce a de-macro'd cpp that pboProject can read without fucking up: + global work_drive + global prefix + + try: + configpath = os.path.join(work_drive, prefix, module, "$PBOPREFIX$") + if os.path.isfile(configpath): + shutil.copyfile(configpath, os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")) + else: + print_error("$PBOPREFIX$ Does not exist for module: {}.".format(module)) + + except: + print_error("Error creating backup of $PBOPREFIX$ for module {}.".format(module)) + + try: + shutil.copyfile(os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.backup")) + os.chdir(work_drive) + except: + print_error("Error creating backup of config.cpp for module {}.".format(module)) + + return True + +def convert_config(module): + try: + global work_drive + global prefix + global arma3tools_path + + cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-bin", "-dst", os.path.join(work_drive, prefix, module, "config.bin"), os.path.join(work_drive, prefix, module, "config.cpp")] + ret = subprocess.call(cmd) + if ret != 0: + print_error("CfgConvert -bin return code == {}. Usually means there is a syntax error within the config.cpp file.".format(str(ret))) + os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) + shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) + + cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-txt", "-dst", os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.bin")] + ret = subprocess.call(cmd) + if ret != 0: + print_error("CfgConvert -txt return code == {}. Usually means there is a syntax error within the config.cpp file.".format(str(ret))) + os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) + shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) + except Exception as e: + print_error("Exception from convert_config=>CfgConvert: {}".format(e)) + return False + + return True + + def addon_restore(modulePath): #PABST: cleanup config BS (you could comment this out to see the "de-macroed" cpp #print_green("\Pabst! (restoring): {}".format(os.path.join(modulePath, "config.cpp"))) @@ -611,6 +661,7 @@ def main(argv): print_blue("\nmake.py for Arma, modified for Advanced Combat Environment v{}".format(__version__)) global ACE_VERSION + global arma3tools_path global work_drive global module_root global make_root @@ -1031,39 +1082,15 @@ See the make.cfg file for additional build options. build_successful = False if build_tool == "pboproject": try: - #PABST: Convert config (run the macro'd config.cpp through CfgConvert twice to produce a de-macro'd cpp that pboProject can read without fucking up: - try: - configpath = os.path.join(work_drive, prefix, module, "$PBOPREFIX$") - if os.path.isfile(configpath): - shutil.copyfile(configpath, os.path.join(work_drive, prefix, module, "$PBOPREFIX$.backup")) - else: - print_error("$PBOPREFIX$ Does not exist for module: {}.".format(module)) - - except: - print_error("Error creating backup of $PBOPREFIX$ for module {}.") - - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.backup")) - - os.chdir("P:\\") - - cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-bin", "-dst", os.path.join(work_drive, prefix, module, "config.bin"), os.path.join(work_drive, prefix, module, "config.cpp")] - ret = subprocess.call(cmd) - if ret != 0: - print_error("CfgConvert -bin return code == {}. Usually means there is a syntax error within the config.cpp file.".format(str(ret))) - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) - - cmd = [os.path.join(arma3tools_path, "CfgConvert", "CfgConvert.exe"), "-txt", "-dst", os.path.join(work_drive, prefix, module, "config.cpp"), os.path.join(work_drive, prefix, module, "config.bin")] - ret = subprocess.call(cmd) - if ret != 0: - print_error("CfgConvert -txt return code == {}. Usually means there is a syntax error within the config.cpp file.".format(str(ret))) - os.remove(os.path.join(work_drive, prefix, module, "config.cpp")) - shutil.copyfile(os.path.join(work_drive, prefix, module, "config.backup"), os.path.join(work_drive, prefix, module, "config.cpp")) + nobinFilePath = os.path.join(work_drive, prefix, module, "$NOBIN$") + if (not os.path.isfile(nobinFilePath)): + backup_config(module) + convert_config(module) version_stamp_pboprefix(module,commit_id) - if os.path.isfile(os.path.join(work_drive, prefix, module, "$NOBIN$")): + if os.path.isfile(nobinFilePath): print_green("$NOBIN$ Found. Proceeding with non-binarizing!") cmd = [makepboTool, "-P","-A","-L","-N","-G", os.path.join(work_drive, prefix, module),os.path.join(module_root, release_dir, project,"addons")] From 991ecdfe010ffd366839c5d088e668c2a8ef30ae Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 11 May 2015 13:37:50 -0700 Subject: [PATCH 106/172] Removed: Debug sidechat in laser seeker code. --- .../functions/fnc_seekerFindLaserSpot.sqf | 74 +++++++++---------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf index 77713eb591..346aec837e 100644 --- a/addons/laser/functions/fnc_seekerFindLaserSpot.sqf +++ b/addons/laser/functions/fnc_seekerFindLaserSpot.sqf @@ -1,32 +1,32 @@ -/* - * Author: Nou - * Turn a laser designator on. - * - * Arguments: - * 0: Position of seeker (ASL) - * 1: Direction vector (will be normalized) - * 2: Seeker FOV in degrees - * 3: Seeker wavelength sensitivity range, [1550,1550] is common eye safe. - * 4: Seeker laser code. - * - * Return value: - * Array, [Strongest compatible laser spot ASL pos, owner object] Nil array values if nothing found. - */ - -#include "script_component.hpp" - -private ["_pos", "_seekerWavelengths", "_seekerCode", "_spots", "_buckets", "_excludes", "_bucketIndex", "_finalPos", "_owner", "_obj", "_x", "_method"]; -private ["_emitterWavelength", "_laserCode", "_divergence", "_laser", "_laserPos", "_laserDir", "_res", "_bucketPos", "_bucketList", "_c", "_forEachIndex", "_index"]; -private ["_testPos", "_finalBuckets", "_largest", "_largestIndex", "_finalBucket", "_owners", "_avgX", "_avgY", "_avgZ", "_count", "_maxOwner", "_maxOwnerIndex", "_finalOwner"]; -private["_dir", "_seekerCos", "_seekerFov", "_testDotProduct", "_testPoint", "_testPointVector"]; - -_pos = _this select 0; -_dir = vectorNormalized (_this select 1); +/* + * Author: Nou + * Turn a laser designator on. + * + * Arguments: + * 0: Position of seeker (ASL) + * 1: Direction vector (will be normalized) + * 2: Seeker FOV in degrees + * 3: Seeker wavelength sensitivity range, [1550,1550] is common eye safe. + * 4: Seeker laser code. + * + * Return value: + * Array, [Strongest compatible laser spot ASL pos, owner object] Nil array values if nothing found. + */ + +#include "script_component.hpp" + +private ["_pos", "_seekerWavelengths", "_seekerCode", "_spots", "_buckets", "_excludes", "_bucketIndex", "_finalPos", "_owner", "_obj", "_x", "_method"]; +private ["_emitterWavelength", "_laserCode", "_divergence", "_laser", "_laserPos", "_laserDir", "_res", "_bucketPos", "_bucketList", "_c", "_forEachIndex", "_index"]; +private ["_testPos", "_finalBuckets", "_largest", "_largestIndex", "_finalBucket", "_owners", "_avgX", "_avgY", "_avgZ", "_count", "_maxOwner", "_maxOwnerIndex", "_finalOwner"]; +private["_dir", "_seekerCos", "_seekerFov", "_testDotProduct", "_testPoint", "_testPointVector"]; + +_pos = _this select 0; +_dir = vectorNormalized (_this select 1); _seekerFov = _this select 2; _seekerWavelengths = _this select 3; -_seekerCode = _this select 4; - - +_seekerCode = _this select 4; + + _seekerCos = cos _seekerFov; _spots = []; @@ -47,9 +47,9 @@ _finalOwner = nil; _laser = []; if(IS_CODE(_method)) then { _laser = _x call _method; - } else { - if(IS_STRING(_method)) then { - _laser = _x call (missionNamespace getVariable [_method, {}]); + } else { + if(IS_STRING(_method)) then { + _laser = _x call (missionNamespace getVariable [_method, {}]); } else { if(IS_ARRAY(_method)) then { if(count _method == 2) then { @@ -59,18 +59,18 @@ _finalOwner = nil; _laser = [ATLtoASL (_obj modelToWorldVisual (_method select 0)), (ATLtoASL (_obj modelToWorldVisual (_method select 1))) vectorFromTo (ATLtoASL (_obj modelToWorldVisual (_method select 2)))]; }; }; - }; + }; }; }; _laserPos = _laser select 0; _laserDir = _laser select 1; _res = [_laserPos, _laserDir, _divergence] call FUNC(shootCone); - { - _testPoint = _x select 0; - _testPointVector = vectorNormalized (_testPoint vectorDiff _pos); - _testDotProduct = _dir vectorDotProduct _testPointVector; + { + _testPoint = _x select 0; + _testPointVector = vectorNormalized (_testPoint vectorDiff _pos); + _testDotProduct = _dir vectorDotProduct _testPointVector; if(_testDotProduct > _seekerCos) then { - _spots pushBack [_testPoint, _owner]; + _spots pushBack [_testPoint, _owner]; }; } forEach (_res select 2); }; @@ -128,7 +128,7 @@ if((count _spots) > 0) then { _avgY = 0; _avgZ = 0; { - player sideChat format["x: %1", _x]; + //player sideChat format["x: %1", _x]; _avgX = _avgX + ((_x select 0) select 0); _avgY = _avgY + ((_x select 0) select 1); _avgZ = _avgZ + ((_x select 0) select 2); From 8e7763af0820bf31fae7dd27d47c03f9399c1de7 Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 11 May 2015 13:50:24 -0700 Subject: [PATCH 107/172] Removed: systemChat debug in captive --- addons/captives/XEH_postInit.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/captives/XEH_postInit.sqf b/addons/captives/XEH_postInit.sqf index f91f24025e..da2192d3d6 100644 --- a/addons/captives/XEH_postInit.sqf +++ b/addons/captives/XEH_postInit.sqf @@ -11,7 +11,7 @@ if (isServer) then { _escortedUnit = _disconnectedPlayer getVariable [QGVAR(escortedUnit), objNull]; if ((!isNull _escortedUnit) && {(attachedTo _escortedUnit) == _disconnectedPlayer}) then { detach _escortedUnit; - systemChat "debug: DC detach"; + //systemChat "debug: DC detach"; }; if (_disconnectedPlayer getVariable [QGVAR(isEscorting), false]) then { _disconnectedPlayer setVariable [QGVAR(isEscorting), false, true]; From ef836d119125b422b1951a22c2aba8c215cfceba Mon Sep 17 00:00:00 2001 From: VKing Date: Mon, 11 May 2015 23:17:17 +0200 Subject: [PATCH 108/172] Hacked order to fix order of comanche zoom levels --- addons/aircraft/Heli_Attack_01_base_F.hpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/addons/aircraft/Heli_Attack_01_base_F.hpp b/addons/aircraft/Heli_Attack_01_base_F.hpp index 14ca7ef7cd..3566336353 100644 --- a/addons/aircraft/Heli_Attack_01_base_F.hpp +++ b/addons/aircraft/Heli_Attack_01_base_F.hpp @@ -891,8 +891,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { class OpticsIn { - class WideUnstabalized - { + class Wide { // Wide Unstabilized opticsDisplayName = "WU"; initAngleX = 0; minAngleX = -35; @@ -910,8 +909,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F"; }; - class Wide - { + class Medium: Wide { // Wide Stabilized opticsDisplayName = "W"; initAngleX = 0; minAngleX = -35; @@ -929,8 +927,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F"; }; - class Medium: Wide - { + class Narrow: Wide { // Medium Stabilized opticsDisplayName = "M"; initFov = 0.093; minFov = 0.093; @@ -940,8 +937,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_medium_F"; }; - class Narrow: Wide - { + class Narrower: Wide { // Narrow Stabilized opticsDisplayName = "N"; initFov = 0.029; minFov = 0.029; @@ -952,8 +948,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; }; - class Narrower: Wide - { + class Narrowest: Wide { // Narrower Stabilized opticsDisplayName = "Z"; initFov = 0.01; minFov = 0.01; From e75c4594e61f8b5744cefed0f1020a26e6f3b641 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Mon, 11 May 2015 15:17:44 -0700 Subject: [PATCH 109/172] Added missing $PBOPREFIX$ for respawn --- addons/respawn/$PBOPREFIX$ | 1 + 1 file changed, 1 insertion(+) create mode 100644 addons/respawn/$PBOPREFIX$ diff --git a/addons/respawn/$PBOPREFIX$ b/addons/respawn/$PBOPREFIX$ new file mode 100644 index 0000000000..072ffe81e3 --- /dev/null +++ b/addons/respawn/$PBOPREFIX$ @@ -0,0 +1 @@ +z\ace\addons\respawn \ No newline at end of file From 7efe8ccba52551893ddb0028af8c463ed3cff232 Mon Sep 17 00:00:00 2001 From: jaynus Date: Mon, 11 May 2015 16:44:17 -0700 Subject: [PATCH 110/172] Added: waveHeightAt Function, refs #1024 for use. --- addons/common/XEH_preInit.sqf | 1 + addons/common/functions/fnc_waveHeightAt.sqf | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 addons/common/functions/fnc_waveHeightAt.sqf diff --git a/addons/common/XEH_preInit.sqf b/addons/common/XEH_preInit.sqf index 5c2ad1e592..8230a4eb0b 100644 --- a/addons/common/XEH_preInit.sqf +++ b/addons/common/XEH_preInit.sqf @@ -183,6 +183,7 @@ PREP(unmuteUnit); PREP(useItem); PREP(useMagazine); PREP(waitAndExecute); +PREP(waveHeightAt); PREP(translateToWeaponSpace); PREP(translateToModelSpace); diff --git a/addons/common/functions/fnc_waveHeightAt.sqf b/addons/common/functions/fnc_waveHeightAt.sqf new file mode 100644 index 0000000000..fbfe5fb241 --- /dev/null +++ b/addons/common/functions/fnc_waveHeightAt.sqf @@ -0,0 +1,19 @@ +/* + * Author: jaynus + * + * Gets the wave height at a specific location. Uses a logic, so may be performance iffy + * + * Arguments: + * 0: Position ASL to get height at + * + * Return Value: + * Wave height in meters + * + */ + +if(isNil QGVAR(waveHeightLogic)) then { + GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0]; +}; +GVAR(waveHeightLogic) setPosASL (_this select 0); + +(((getPosASLW GVAR(waveHeightLogic)) select 2) - ((getPosASL GVAR(waveHeightLogic)) select 2)) \ No newline at end of file From ddbb6ab2bb0a846d4e998bc6db36045f59eab9fc Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Mon, 11 May 2015 23:51:42 -0500 Subject: [PATCH 111/172] #1119 - Manually sync ammo globably on belt reload. --- addons/reload/XEH_postInit.sqf | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/addons/reload/XEH_postInit.sqf b/addons/reload/XEH_postInit.sqf index 149317c136..4444fe1e34 100644 --- a/addons/reload/XEH_postInit.sqf +++ b/addons/reload/XEH_postInit.sqf @@ -18,6 +18,11 @@ if !(hasInterface) exitWith {}; {false}, [19, [false, true, false]], false] call cba_fnc_addKeybind; +["setAmmoSync", { + //To propagate the setAmmo change, do it on all clients + PARAMS_3(_unit,_weapon,_ammo); + _unit setAmmo [_weapon, _ammo]; +}] call EFUNC(common,addEventhandler); // Listen for attempts to link ammo ["linkedAmmo", { @@ -45,7 +50,7 @@ if !(hasInterface) exitWith {}; // Add the ammo _ammoAdded = _ammoMissing min (_magazine select 1); - _receiver setAmmo [currentWeapon _receiver, _ammoCount + _ammoAdded]; + ["setAmmoSync", [_receiver, (currentWeapon _receiver), (_ammoCount + _ammoAdded)]] call EFUNC(common,globalEvent); if ((_magazine select 1) - _ammoAdded > 0) then { ["returnedAmmo", [_giver], [_giver,_receiver,[_magazineType,(_magazine select 1) - _ammoAdded]]] call EFUNC(common,targetEvent); From 228786f3ad5758a63f96376e4d3a6f2c02146f13 Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Tue, 12 May 2015 12:26:24 +0100 Subject: [PATCH 112/172] Putting the bird in its cage --- addons/zeus/CfgVehicles.hpp | 2 +- addons/zeus/XEH_preInit.sqf | 1 + .../zeus/functions/fnc_moduleCuratorDelay.sqf | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 addons/zeus/functions/fnc_moduleCuratorDelay.sqf diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index a7671232a7..a1f71f405a 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -66,7 +66,7 @@ class CfgVehicles { }; class ModuleCurator_F: Module_F { - function = QUOTE(DFUNC(bi_moduleCurator)); + function = QUOTE(DFUNC(moduleCuratorDelay)); }; class ModuleMine_F: ModuleEmpty_F { function = QUOTE(DFUNC(bi_moduleMine)); diff --git a/addons/zeus/XEH_preInit.sqf b/addons/zeus/XEH_preInit.sqf index e7bb1b96a5..5841245e65 100644 --- a/addons/zeus/XEH_preInit.sqf +++ b/addons/zeus/XEH_preInit.sqf @@ -6,6 +6,7 @@ PREP(bi_moduleCurator); PREP(bi_moduleMine); PREP(bi_moduleProjectile); PREP(bi_moduleRemoteControl); +PREP(moduleCuratorDelay); PREP(moduleZeusSettings); ADDON = true; diff --git a/addons/zeus/functions/fnc_moduleCuratorDelay.sqf b/addons/zeus/functions/fnc_moduleCuratorDelay.sqf new file mode 100644 index 0000000000..734cf1a999 --- /dev/null +++ b/addons/zeus/functions/fnc_moduleCuratorDelay.sqf @@ -0,0 +1,19 @@ +/* + * Author: SilentSpike + * Function that delays the execution of the curator module function + * Allows ascension and bird settings to be set by module beforehand + * + * Arguments: + * 0: The module logic + * 1: units + * 2: activated + * + * Return Value: + * None + * + * Public: No + */ + +#include "script_component.hpp" + +[{_this spawn DFUNC(bi_moduleCurator);},_this] call EFUNC(common,execNextFrame); From 3ddc8569bb581a644c144abc8ed4bf3bc6e34bf8 Mon Sep 17 00:00:00 2001 From: VKing Date: Tue, 12 May 2015 15:53:49 +0200 Subject: [PATCH 113/172] Made better with Pabstology (tm) --- addons/aircraft/Heli_Attack_01_base_F.hpp | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/addons/aircraft/Heli_Attack_01_base_F.hpp b/addons/aircraft/Heli_Attack_01_base_F.hpp index 3566336353..26a4605910 100644 --- a/addons/aircraft/Heli_Attack_01_base_F.hpp +++ b/addons/aircraft/Heli_Attack_01_base_F.hpp @@ -891,8 +891,12 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { class OpticsIn { - class Wide { // Wide Unstabilized - opticsDisplayName = "WU"; + delete Narrow; + delete Medium; + delete Wide; + + class ACE_WideUnstabilized { + opticsDisplayName = "W NS"; initAngleX = 0; minAngleX = -35; maxAngleX = 10; @@ -909,7 +913,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F"; }; - class Medium: Wide { // Wide Stabilized + class ACE_Wide: ACE_WideUnstabilized { opticsDisplayName = "W"; initAngleX = 0; minAngleX = -35; @@ -927,7 +931,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_wide_F"; }; - class Narrow: Wide { // Medium Stabilized + class ACE_Medium: ACE_Wide { opticsDisplayName = "M"; initFov = 0.093; minFov = 0.093; @@ -937,7 +941,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { horizontallyStabilized = 1; gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_medium_F"; }; - class Narrower: Wide { // Narrow Stabilized + class ACE_Narrow: ACE_Wide { opticsDisplayName = "N"; initFov = 0.029; minFov = 0.029; @@ -948,7 +952,7 @@ class Heli_Attack_01_base_F: Helicopter_Base_F { gunnerOpticsModel = "\A3\Weapons_F_Beta\Reticle\Heli_Attack_01_Optics_Gunner_narrow_F"; }; - class Narrowest: Wide { // Narrower Stabilized + class ACE_Narrower: ACE_Wide { opticsDisplayName = "Z"; initFov = 0.01; minFov = 0.01; From 66f5ed43c0cacfdc5c066eb33a2549f095a87751 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Tue, 12 May 2015 07:05:48 -0700 Subject: [PATCH 114/172] More help on certain errors in make.py --- tools/make.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/make.py b/tools/make.py index ce92e72ea7..b461d77946 100644 --- a/tools/make.py +++ b/tools/make.py @@ -1224,8 +1224,9 @@ See the make.cfg file for additional build options. if build_successful: cache[module] = new_sha - except: - print_yellow("Cancel or some error detected.") + except Exception as e: + print_yellow("Cancel or some error detected: {}".format(e)) + finally: copy_important_files(module_root_parent,os.path.join(release_dir, "@ace")) From ab580dd1c7bb0dba710a42f0193bb312eceac0c0 Mon Sep 17 00:00:00 2001 From: ViperMaul Date: Tue, 12 May 2015 07:08:45 -0700 Subject: [PATCH 115/172] Set version number to 3.0.0.3 --- addons/main/script_mod.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/main/script_mod.hpp b/addons/main/script_mod.hpp index 5777d7223e..c4bd23f779 100644 --- a/addons/main/script_mod.hpp +++ b/addons/main/script_mod.hpp @@ -6,7 +6,7 @@ #define MAJOR 3 #define MINOR 0 #define PATCHLVL 0 -#define BUILD 2 +#define BUILD 3 #define VERSION MAJOR.MINOR.PATCHLVL.BUILD #define VERSION_AR MAJOR,MINOR,PATCHLVL,BUILD From 6a821715a04b3f8f4f57c41859ec12adbcf66542 Mon Sep 17 00:00:00 2001 From: Grzegorz Sikora Date: Tue, 12 May 2015 00:24:12 +0200 Subject: [PATCH 116/172] Stringtable modules Conflicts: addons/missionmodules/CfgVehicles.hpp addons/respawn/CfgVehicles.hpp --- addons/advanced_ballistics/CfgVehicles.hpp | 43 +- addons/advanced_ballistics/stringtable.xml | 80 ++++ addons/ballistics/CfgVehicles.hpp | 2 +- addons/ballistics/stringtable.xml | 6 +- addons/captives/CfgVehicles.hpp | 6 +- addons/captives/stringtable.xml | 8 + addons/common/CfgVehicles.hpp | 40 +- addons/common/config.cpp | 4 +- addons/common/stringtable.xml | 60 +++ addons/explosives/CfgModule.hpp | 28 +- addons/explosives/stringtable.xml | 32 ++ addons/hearing/CfgVehicles.hpp | 13 +- addons/hearing/stringtable.xml | 24 ++ addons/interaction/CfgVehicles.hpp | 13 +- addons/interaction/stringtable.xml | 34 +- addons/map/CfgVehicles.hpp | 56 +-- addons/map/stringtable.xml | 77 +++- addons/medical/CfgFactionClasses.hpp | 2 +- addons/medical/CfgVehicles.hpp | 219 +++++----- addons/medical/config.cpp | 2 +- .../functions/fnc_actionCheckPulseLocal.sqf | 2 +- addons/medical/stringtable.xml | 378 +++++++++++++++++- addons/microdagr/CfgVehicles.hpp | 18 +- addons/microdagr/stringtable.xml | 28 ++ addons/missileguidance/ACE_Settings.hpp | 2 +- addons/missileguidance/stringtable.xml | 12 + addons/missionmodules/CfgFactionClasses.hpp | 2 +- addons/missionmodules/CfgVehicles.hpp | 34 +- addons/missionmodules/stringtable.xml | 73 ++++ addons/mk6mortar/CfgVehicles.hpp | 18 +- addons/mk6mortar/stringtable.xml | 32 ++ addons/nametags/CfgVehicles.hpp | 44 +- addons/nametags/config.cpp | 6 +- addons/nametags/stringtable.xml | 96 +++++ addons/optionsmenu/CfgVehicles.hpp | 10 +- addons/optionsmenu/stringtable.xml | 44 ++ addons/respawn/CfgVehicleClasses.hpp | 2 +- addons/respawn/CfgVehicles.hpp | 42 +- addons/respawn/stringtable.xml | 56 +++ addons/switchunits/CfgVehicles.hpp | 51 +-- addons/switchunits/stringtable.xml | 64 +++ addons/vehiclelock/CfgVehicles.hpp | 28 +- addons/vehiclelock/stringtable.xml | 52 +++ addons/weather/CfgVehicles.hpp | 31 +- addons/weather/stringtable.xml | 56 +++ addons/winddeflection/CfgVehicles.hpp | 23 +- addons/winddeflection/stringtable.xml | 40 ++ 47 files changed, 1656 insertions(+), 337 deletions(-) create mode 100644 addons/missionmodules/stringtable.xml diff --git a/addons/advanced_ballistics/CfgVehicles.hpp b/addons/advanced_ballistics/CfgVehicles.hpp index fda4b9a8ff..4e42f35f72 100644 --- a/addons/advanced_ballistics/CfgVehicles.hpp +++ b/addons/advanced_ballistics/CfgVehicles.hpp @@ -2,7 +2,7 @@ class CfgVehicles { class ACE_Module; class GVAR(ModuleSettings): ACE_Module { scope = 2; - displayName = "Advanced Ballistics"; + displayName = "$STR_ACE_AdvancedBallistics_DisplayName"; icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa)); category = "ACE"; function = QUOTE(DFUNC(initModuleSettings)); @@ -12,26 +12,26 @@ class CfgVehicles { author = "Ruthberg"; class Arguments { class enabled { - displayName = "Advanced Ballistics"; - description = "Enables advanced ballistics"; + displayName = "$STR_ACE_AdvancedBallistics_enabled_DisplayName"; + description = "$STR_ACE_AdvancedBallistics_enabled_Description"; typeName = "BOOL"; defaultValue = 0; }; class alwaysSimulateForSnipers { - displayName = "Always Enabled For Snipers"; - description = "Always enables advanced ballistics when high power optics are used"; + displayName = "$STR_ACE_AdvancedBallistics_alwaysSimulateForSnipers_DisplayName"; + description = "$STR_ACE_AdvancedBallistics_alwaysSimulateForSnipers_Description"; typeName = "BOOL"; defaultValue = 1; }; class disabledInFullAutoMode { - displayName = "Disabled In FullAuto Mode"; - description = "Disables the advanced ballistics during full auto fire"; + displayName = "$STR_ACE_AdvancedBallistics_disabledInFullAutoMod_DisplayName"; + description = "$STR_ACE_AdvancedBallistics_disabledInFullAutoMod_Description"; typeName = "BOOL"; defaultValue = 0; }; class onlyActiveForLocalPlayers { - displayName = "Disabled For Non Local Players"; - description = "Disables the advanced ballistics for bullets coming from other players (enable this if you encounter frame drops during heavy firefights in multiplayer)"; + displayName = "$STR_ACE_AdvancedBallistics_onlyActiveForLocalPlayers_DisplayName"; + description = "$STR_ACE_AdvancedBallistics_onlyActiveForLocalPlayers_Description"; typeName = "BOOL"; defaultValue = 1; }; @@ -44,35 +44,38 @@ class CfgVehicles { }; */ class ammoTemperatureEnabled { - displayName = "Enable Ammo Temperature Simulation"; - description = "Muzzle velocity varies with ammo temperature"; + displayName = "$STR_ACE_AdvancedBallistics_ammoTemperatureEnabled_DisplayName"; + description = "$STR_ACE_AdvancedBallistics_ammoTemperatureEnabled_Description"; typeName = "BOOL"; defaultValue = 1; }; class barrelLengthInfluenceEnabled { - displayName = "Enable Barrel Length Simulation"; - description = "Muzzle velocity varies with barrel length"; + displayName = "$STR_ACE_AdvancedBallistics_barrelLengthInfluenceEnabled_DisplayName"; + description = "$STR_ACE_AdvancedBallistics_barrelLengthInfluenceEnabled_Description"; typeName = "BOOL"; defaultValue = 1; }; class bulletTraceEnabled { - displayName = "Enable Bullet Trace Effect"; - description = "Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics)"; + displayName = "$STR_ACE_AdvancedBallistics_bulletTraceEnabled_DisplayName"; + description = "$STR_ACE_AdvancedBallistics_bulletTraceEnabled_Description"; typeName = "BOOL"; defaultValue = 1; }; class simulationInterval { - displayName = "Simulation Interval"; - description = "Defines the interval between every calculation step"; + displayName = "$STR_ACE_AdvancedBallistics_simulationInterval_DisplayName"; + description = "$STR_ACE_AdvancedBallistics_simulationInterval_Description"; typeName = "NUMBER"; defaultValue = 0.0; }; class simulationRadius { - displayName = "Simulation Radius"; - description = "Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles"; + displayName = "$STR_ACE_AdvancedBallistics_simulationRadius_DisplayName"; + description = "$STR_ACE_AdvancedBallistics_simulationRadius_Description"; typeName = "NUMBER"; defaultValue = 3000; }; }; + class ModuleDescription { + description = "$STR_ACE_AdvancedBallistics_Description"; + }; }; -}; +}; \ No newline at end of file diff --git a/addons/advanced_ballistics/stringtable.xml b/addons/advanced_ballistics/stringtable.xml index 0de8071754..565e4bd801 100644 --- a/addons/advanced_ballistics/stringtable.xml +++ b/addons/advanced_ballistics/stringtable.xml @@ -25,5 +25,85 @@ Zobrazit รบhlomฤ›r Mostrar Transferidor + + Advanced Ballistics + Zaawansowana balistyka + + + Advanced Ballistics + Zaawansowana balistyka + + + Enables advanced ballistics + Aktywuje zaawansowanฤ… balistykฤ™ + + + Always Enabled For Snipers + Zawsze akt. dla snajp. + + + Always enables advanced ballistics when high power optics are used + Aktywuje zaawansowanฤ… balistykฤ™ zawsze, kiedy uลผywana jest optyka + + + Disabled In FullAuto Mode + Wyล‚. podczas ognia auto. + + + Disables the advanced ballistics during full auto fire + Dezaktywuje zaawansowanฤ… balistykฤ™ podczas ognia automatycznego + + + Disabled For Non Local Players + Wyล‚ฤ…cz dla nielok. graczy + + + Disables the advanced ballistics for bullets coming from other players (enable this if you encounter frame drops during heavy firefights in multiplayer) + Dezaktywuje zaawansowanฤ… balistykฤ™ dla pociskรณw pochodzฤ…cych od innych graczy(aktywuj tฤ… opcjฤ™ jeลผeli odczuwasz spadki FPS podczas sporych strzelanin w MP) + + + Enable Ammo Temperature Simulation + Symulacja temp. amunicji + + + Muzzle velocity varies with ammo temperature + Prฤ™dkoล›ฤ‡ wylotowa pocisku jest zaleลผna od temperatury amunicji + + + Enable Barrel Length Simulation + Symulacja dล‚ugoล›ci lufy + + + Muzzle velocity varies with barrel length + Prฤ™dkoล›ฤ‡ wylotowa pocisku jest zaleลผna od dล‚ugoล›ci lufy + + + Enable Bullet Trace Effect + Efekt smugi pocisku + + + Enables a bullet trace effect to high caliber bullets (only visible when looking through high power optics) + Aktywuje efekt smugi pocisku dla pociskรณw wysokokalibrowych (widoczne tylko podczas patrzenia przez optykฤ™) + + + Simulation Interval + Interwaล‚ symulacji + + + Defines the interval between every calculation step + Okreล›la interwaล‚ pomiฤ™dzy kaลผdym krokiem kalkulacji + + + Simulation Radius + Zasiฤ™g symulacji + + + Defines the radius around the player (in meters) at which advanced ballistics are applied to projectiles + Okreล›la obszar naokoล‚o gracza (w metrach), na ktรณrym zaawansowana balistyka jest aplikowana dla pociskรณw + + + + Moduล‚ ten pozwala aktywowaฤ‡ zaawansowanฤ… balistykฤ™ biorฤ…cฤ… przy obliczeniach trajektorii lotu pocisku pod uwagฤ™ takie rzeczy jak temperatura powietrza, ciล›nienie atmosferyczne, wilgotnoล›ฤ‡ powietrza, siล‚y Coriolisa i Eotvosa, grawitacjฤ™ a takลผe broล„ z jakiej wykonywany jest strzaล‚ oraz rodzaj amunicji. Wszystko to sprowadza siฤ™ na bardzo dokล‚adne odwzorowanie balistyki. + \ No newline at end of file diff --git a/addons/ballistics/CfgVehicles.hpp b/addons/ballistics/CfgVehicles.hpp index 82e7fef5e3..0ad697d91e 100644 --- a/addons/ballistics/CfgVehicles.hpp +++ b/addons/ballistics/CfgVehicles.hpp @@ -190,7 +190,7 @@ class CfgVehicles { class ACE_Box_Ammo: NATO_Box_Base { scope = 2; accuracy = 1000; - displayName = "[ACE] Ammo Supply Crate"; + displayName = "$STR_ACE_AmmoSupplyCrate_DisplayName"; model = "\A3\weapons_F\AmmoBoxes\AmmoBox_F"; author = "$STR_ACE_Common_ACETeam"; class TransportMagazines { diff --git a/addons/ballistics/stringtable.xml b/addons/ballistics/stringtable.xml index 7c6d9c85ad..85ac44b4de 100644 --- a/addons/ballistics/stringtable.xml +++ b/addons/ballistics/stringtable.xml @@ -1592,5 +1592,9 @@ Calibre: 12.7x99mm (AMAX)<br/>Cartuchos: 5 Kaliber: 12,7x99mm (AMAX)<br />Lรถvedรฉkek: 5 + + [ACE] Ammo Supply Crate + [ACE] Skrzynka z amunicjฤ… + - \ No newline at end of file + diff --git a/addons/captives/CfgVehicles.hpp b/addons/captives/CfgVehicles.hpp index 1e2eb3f201..91c47824fd 100644 --- a/addons/captives/CfgVehicles.hpp +++ b/addons/captives/CfgVehicles.hpp @@ -161,7 +161,7 @@ class CfgVehicles { class GVAR(ModuleSurrender): Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "Make Unit Surrender"; + displayName = "$STR_ACE_Captives_ModuleSurrender_DisplayName"; //Make Unit Surrender function = QUOTE(DFUNC(moduleSurrender)); scope = 2; //show in editor scopeCurator = 2; //show in zeus @@ -172,8 +172,8 @@ class CfgVehicles { functionPriority = 0; class Arguments {}; class ModuleDescription: ModuleDescription { - description = "Sync a unit to make them surrender.
Source: ace_captives"; + description = "$STR_ACE_Captives_ModuleSurrender_Description"; //Sync a unit to make them surrender.
Source: ace_captives sync[] = {"AnyAI"}; }; }; -}; +}; \ No newline at end of file diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index def173c55b..07cf780e19 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -193,5 +193,13 @@ Semmi sincs az egรฉr alatt Nessuna selezione + + Make Unit Surrender + Poddaj siฤ™! + + + Sync a unit to make them surrender.<br />Source: ace_captives + Zsynchronizuj z jednostkฤ… aby sprawiฤ‡ by siฤ™ poddaล‚a<br />ลนrรณdล‚o: ace_captives + diff --git a/addons/common/CfgVehicles.hpp b/addons/common/CfgVehicles.hpp index 5a00c038e7..70d84b376c 100644 --- a/addons/common/CfgVehicles.hpp +++ b/addons/common/CfgVehicles.hpp @@ -25,72 +25,82 @@ class CfgVehicles { // += needs a non inherited entry in that class, otherwise it simply overwrites //#include - class Module_F; - class ACE_ModuleCheckPBOs: Module_F { + class Logic; + class Module_F: Logic { + class ModuleDescription {}; + }; + class ACE_ModuleCheckPBOs: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "Check PBOs"; + displayName = "$STR_ACE_Common_CheckPBO_DisplayName"; function = QFUNC(moduleCheckPBOs); scope = 2; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_CheckPBO_ca.paa)); class Arguments { class Action { - displayName = "Action"; - description = "What to do with people who do not have the right PBOs?"; + displayName = "$STR_ACE_Common_CheckPBO_Action_DisplayName"; + description = "$STR_ACE_Common_CheckPBO_Action_Description"; class values { class WarnOnce { default = 1; - name = "Warn once"; + name = "$STR_ACE_Common_CheckPBO_Action_WarnOnce"; value = 0; }; class Warn { - name = "Warn (permanent)"; + name = "$STR_ACE_Common_CheckPBO_Action_WarnPerm"; value = 1; }; class Kick { - name = "Kick"; + name = "$STR_ACE_Common_CheckPBO_Action_Kick"; value = 2; }; }; }; class CheckAll { - displayName = "Check all addons"; - description = "Check all addons instead of only those of ACE?"; + displayName = "$STR_ACE_Common_CheckPBO_CheckAll_DisplayName"; + description = "$STR_ACE_Common_CheckPBO_CheckAll_Description"; typeName = "BOOL"; class values { class WarnOnce { default = 1; - name = "No"; + name = "$STR_ACE_Common_CheckPBO_CheckAll_No"; value = 0; }; class Warn { - name = "Yes"; + name = "$STR_ACE_Common_CheckPBO_CheckAll_Yes"; value = 1; }; }; }; class Whitelist { - displayName = "Whitelist"; - description = "What addons are allowed regardless?"; + displayName = "$STR_ACE_Common_CheckPBO_Whitelist_DisplayName"; + description = "$STR_ACE_Common_CheckPBO_Whitelist_Description"; typeName = "STRING"; class values { default = "[]"; }; }; }; + class ModuleDescription: ModuleDescription { + description = "$STR_ACE_Common_CheckPBO_Description"; + }; }; class ACE_ModuleLSDVehicles: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "LSD Vehicles"; + displayName = "$STR_ACE_Common_LSDVehicles_DisplayName"; function = "ACE_Common_fnc_moduleLSDVehicles"; scope = 2; icon = QUOTE(PATHTOF(UI\Icon_Module_LSD_ca.paa)); isGlobal = 1; class Arguments { }; + class ModuleDescription: ModuleDescription { + description = "$STR_ACE_Common_LSDVehicles_Description"; + sync[] = {"AnyVehicle"}; + }; }; class Box_NATO_Support_F; diff --git a/addons/common/config.cpp b/addons/common/config.cpp index 27647f8d00..3f1e5a6308 100644 --- a/addons/common/config.cpp +++ b/addons/common/config.cpp @@ -101,7 +101,7 @@ class ACE_Settings { isClientSettable = 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"}; + values[] = {"$STR_ACE_Common_Hide", "$STR_ACE_Common_TopRightDown", "$STR_ACE_Common_TopRightLeft", "$STR_ACE_Common_TopLeftDown", "$STR_ACE_Common_TopLeftRight"}; }; class GVAR(SettingProgressBarLocation) { value = 0; @@ -110,7 +110,7 @@ class ACE_Settings { isClientSettable = 1; displayName = "$STR_ACE_Common_SettingProgressbarLocationName"; description = "$STR_ACE_Common_SettingProgressbarLocationDesc"; - values[] = {"Top", "Bottom"}; + values[] = {"$STR_ACE_Common_Top", "$STR_ACE_Common_Bottom"}; }; class GVAR(displayTextColor) { value[] = {0,0,0,0.1}; diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 8d28704362..4ddc0112d8 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -470,5 +470,65 @@ Une banane est un fruit qui, d'un point de vue botanique, fait partie du groupe des baies. Produite par plusieurs sortes de grandes plantes ร  fleurs herbacรฉes du type Musa. A banana รฉ uma fruta comestรญvel, botanicamente uma baga, produzida por vรกrios tipos de plantas herbรกceas grandes do genero Musa. + + Check PBOs + Sprawdzaj PBO + + + + Sprawdzaj spรณjnoล›ฤ‡ addonรณw z serwerem + + + Action + Akcja + + + What to do with people who do not have the right PBOs? + Co zrobiฤ‡ z graczami, ktรณrzy nie majฤ… wล‚aล›ciwych PBO? + + + Warn once + Ostrzeลผ raz + + + Warn (permanent) + Ostrzeลผenie (permanentne) + + + Kick + Kick + + + Check all addons + Sprawdลบ wsz. addony + + + Check all addons instead of only those of ACE? + Sprawdzaj wszystkie addony czy tylko te z ACE? + + + No + Tylko ACE + + + Yes + Wszystkie + + + Whitelist + Biaล‚a lista + + + What addons are allowed regardless? + Jakie addony sฤ… dozwolone? + + + LSD Vehicles + Pojazdy LSD + + + Adds LSD effect to synchronized vehicle + Dodaje efekt LSD pod zsynchronizowany pojazd + diff --git a/addons/explosives/CfgModule.hpp b/addons/explosives/CfgModule.hpp index b4f7b65a83..50b59fc55d 100644 --- a/addons/explosives/CfgModule.hpp +++ b/addons/explosives/CfgModule.hpp @@ -1,44 +1,50 @@ -class Module_F; +class Logic; +class Module_F: Logic { + class ModuleDescription {}; +}; class ACE_ModuleExplosive: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "Explosive System"; + displayName = "$STR_ACE_Explosive_Module_DisplayName"; function = QUOTE(FUNC(module)); scope = 2; isGlobal = 1; icon = PATHTOF(UI\Icon_Module_Explosives_ca.paa); class Arguments { class RequireSpecialist { - displayName = "Require specialists?"; - description = "Require explosive specialists to disable explosives? Default: No"; + displayName = "$STR_ACE_Explosive_RequireSpecialist_DisplayName"; + description = "$STR_ACE_Explosive_RequireSpecialist_Description"; typeName = "BOOL"; class values { class Yes { - name = "Yes"; + name = "$STR_ACE_Explosive_Yes"; value = 1; }; class No { default = 1; - name = "No"; + name = "$STR_ACE_Explosive_No"; value = 0; }; }; }; class PunishNonSpecialists { - displayName = "Punish non-specialists?"; - description = "Increase the time it takes to complete actions for non-specialists? Default: Yes"; + displayName = "$STR_ACE_Explosive_PunishNonSpecialists_DisplayName"; + description = "$STR_ACE_Explosive_PunishNonSpecialists_Description"; typeName = "BOOL"; class values { class Yes { default = 1; - name = "Yes"; + name = "$STR_ACE_Explosive_Yes"; value = 1; }; class No { - name = "No"; + name = "$STR_ACE_Explosive_No"; value = 0; }; }; }; }; -}; + class ModuleDescription: ModuleDescription { + description = "$STR_ACE_Explosive_Module_Description"; + }; +}; \ No newline at end of file diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index 9d885c236c..5eb5d28512 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -505,5 +505,37 @@ Raccogli Pegar + + Explosive System + System ล‚adunkรณw wybuchowych + + + Require specialists? + Wymagaj specjalistรณw? + + + Require explosive specialists to disable explosives? Default: No + Wymagaฤ‡ saperรณw do rozbrajania ล‚adunkรณw wybuchowych? Domyล›lnie: Nie + + + Yes + Tak + + + No + Nie + + + Punish non-specialists? + Karaj nie-specjalistรณw? + + + Increase the time it takes to complete actions for non-specialists? Default: Yes + Zwiฤ™kszyฤ‡ iloล›ฤ‡ wymaganego czasu do ukoล„czenia akcji dla nie-specjalistรณw? Domyล›lnie: Tak + + + + Moduล‚ ten pozwala dostosowaฤ‡ opcje zwiฤ…zane z ล‚adunkami wybuchowymi, ich podkล‚adaniem oraz rozbrajaniem. + diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index 6c77255384..d20d067981 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -98,21 +98,24 @@ class CfgVehicles { class ACE_ModuleHearing: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "Hearing"; + displayName = "$STR_ACE_Hearing_Module_DisplayName"; //Hearing function = QFUNC(moduleHearing); scope = 2; isGlobal = 1; icon = PATHTOF(UI\Icon_Module_Hearing_ca.paa); class Arguments { class EnableCombatDeafness { - displayName = "Enable combat deafness?"; - description = "Enable combat deafness?"; + displayName = "$STR_ACE_Hearing_CombatDeafness_DisplayName"; //Enable combat deafness? + description = "$STR_ACE_Hearing_CombatDeafness_Description"; //Enable combat deafness? typeName = "BOOL"; class values { - class Yes { name = "Yes"; value = 1; default = 1; }; - class No { name = "No"; value = 0; }; + class Yes { name = "$STR_ACE_Hearing_CombatDeafness_Yes"; value = 1; default = 1; }; //yes + class No { name = "$STR_ACE_Hearing_CombatDeafness_No"; value = 0; }; //no }; }; + }; + class ModuleDescription { + description = "$STR_ACE_Hearing_Module_Description"; }; }; }; diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index e6f59604a3..e532768fd9 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -109,5 +109,29 @@ Disabilita i fischi nelle orecchie Desabilitar zumbido de ouvidos + + Hearing + Sล‚uch + + + Enable combat deafness? + Wล‚. gล‚uchotฤ™ bojowฤ… + + + Enable combat deafness? + Moลผliwoล›ฤ‡ chwilowej utraty sล‚uchu przy gล‚oล›nych wystrzaล‚ach i jednoczesnym braku wล‚oลผonych stoperรณw + + + Yes + Tak + + + No + Nie + + + + Gล‚uchota bojowa pojawia siฤ™ w momentach, kiedy stoimy w pobliลผu broni wielkokalibrowej bez ochrony sล‚uchu, lub np. podczas ostrzaล‚u artyleryjskiego. Moduล‚ ten pozwala na wล‚ฤ…czenie lub wyล‚ฤ…czenie tego efektu. + diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 5548311718..9968c490e1 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -4,21 +4,24 @@ class CfgVehicles { class ACE_ModuleInteraction: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "Interaction System"; + displayName = "$STR_ACE_InteractionSystem_Module_DisplayName"; function = "ACE_Interaction_fnc_moduleInteraction"; scope = 2; isGlobal = 1; icon = PATHTOF(UI\Icon_Module_Interaction_ca.paa); class Arguments { class EnableTeamManagement { - displayName = "Enable Team Management"; - description = "Should players be allowed to use the Team Management Menu? Default: Yes"; + displayName = "$STR_ACE_InteractionSystem_EnableTeamManagement_DisplayName"; + description = "$STR_ACE_InteractionSystem_EnableTeamManagement_Description"; typeName = "BOOL"; class values { - class Yes { default = 1; name = "Yes"; value = 1;}; - class No { name = "No"; value = 0; }; + class Yes { default = 1; name = "$STR_ACE_InteractionSystem_EnableTeamManagement_Yes"; value = 1;}; + class No { name = "$STR_ACE_InteractionSystem_EnableTeamManagement_No"; value = 0; }; }; }; + }; + class ModuleDescription { + description = "$STR_ACE_InteractionSystem_Module_Description"; }; }; diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 32a901507b..153b94a1d9 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -522,7 +522,7 @@ Rot Rojo Rouge - Czerwony + Czerwonych ฤŒervenรฝ ะšั€ะฐัะฝั‹ะน Vermelha @@ -534,7 +534,7 @@ Grรผn Verde Vert - Zielony + Zielonych Zelenรฝ ะ—ะตะปะตะฝั‹ะน Verde @@ -546,7 +546,7 @@ Blau Azul Bleu - Niebieski + Niebieskich Modrรฝ ะกะธะฝะธะน Azul @@ -558,7 +558,7 @@ Gelb Amarillo Jaune - ลปรณล‚ty + ลปรณล‚tych ลฝlutรฝ ะ–ั‘ะปั‚ั‹ะน Amarela @@ -666,7 +666,7 @@ Du bist Gruppe %1 beigetreten Te has unido al equipo %1 Tu as rejoint l'รฉquipe %1 - Doล‚ฤ…czyล‚eล› do druลผyny %1 + Doล‚ฤ…czyล‚eล› do %1 Pล™ipojil ses do %1 tรฝmu ะ’ั‹ ะฟั€ะธัะพะตะดะธะฝะธะปะธััŒ ะบ ะณั€ัƒะฟะฟะต %1 Vocรช uniu-se ร  Equipe %1 @@ -793,5 +793,29 @@ Passeggeri Passageiros + + Interaction System + System interakcji + + + Enable Team Management + Wล‚. zarzฤ…dzanie druลผynฤ… + + + Should players be allowed to use the Team Management Menu? Default: Yes + Czy gracze mogฤ… korzystaฤ‡ z menu zarzฤ…dzania druลผynฤ…? Domyล›lnie: Tak + + + Yes + Tak + + + No + Nie + + + + Na zarzฤ…dzanie druลผynฤ… skล‚ada siฤ™: przydziaล‚ kolorรณw dla czล‚onkรณw druลผyny, przejmowanie dowodzenia, doล‚ฤ…czanie/opuszczanie druลผyn. + diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 612cadb006..150ac23930 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -3,74 +3,80 @@ class CfgVehicles { class ACE_ModuleMap: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "Map"; + displayName = "$STR_ACE_Map_Module_DisplayName"; function = QFUNC(moduleMap); scope = 2; isGlobal = 1; icon = PATHTOF(UI\Icon_Module_Map_ca.paa); class Arguments { class MapIllumination { - displayName = "Map illumination?"; - description = "Calculate dynamic map illumination based on light conditions?"; + displayName = "$STR_ACE_Map_MapIllumination_DisplayName"; + description = "$STR_ACE_Map_MapIllumination_Description"; typeName = "BOOL"; class values { - class Yes { name = "Yes"; value = 1; default = 1; }; - class No { name = "No"; value = 0; }; + class Yes { name = "$STR_ACE_Map_Yes"; value = 1; default = 1; }; + class No { name = "$STR_ACE_Map_No"; value = 0; }; }; }; class MapShake { - displayName = "Map shake?"; - description = "Make map shake when walking?"; + displayName = "$STR_ACE_Map_MapShake_DisplayName"; + description = "$STR_ACE_Map_MapShake_Description"; typeName = "BOOL"; class values { - class Yes { name = "Yes"; value = 1; default = 1;}; - class No { name = "No"; value = 0; }; + class Yes { name = "$STR_ACE_Map_Yes"; value = 1; default = 1;}; + class No { name = "$STR_ACE_Map_No"; value = 0; }; }; }; class MapLimitZoom { - displayName = "Limit map zoom?"; - description = "Limit the amount of zoom available for the map?"; + displayName = "$STR_ACE_Map_MapLimitZoom_DisplayName"; + description = "$STR_ACE_Map_MapLimitZoom_Description"; typeName = "BOOL"; class values { - class Yes { name = "Yes"; value = 1; }; - class No { name = "No"; value = 0; default = 1;}; + class Yes { name = "$STR_ACE_Map_Yes"; value = 1; }; + class No { name = "$STR_ACE_Map_No"; value = 0; default = 1;}; }; }; class MapShowCursorCoordinates { - displayName = "Show cursor coordinates?"; - description = "Show the grid coordinates on the mouse pointer?"; + displayName = "$STR_ACE_Map_MapShowCursorCoordinates_DisplayName"; + description = "$STR_ACE_Map_MapShowCursorCoordinates_Description"; typeName = "BOOL"; class values { - class Yes { name = "Yes"; value = 1; }; - class No { name = "No"; value = 0; default = 1;}; + class Yes { name = "$STR_ACE_Map_Yes"; value = 1; }; + class No { name = "$STR_ACE_Map_No"; value = 0; default = 1;}; }; }; + }; + class ModuleDescription { + description = "$STR_ACE_Map_Module_Description"; }; }; class ACE_ModuleBlueForceTracking: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "Blue Force Tracking"; + displayName = "$STR_ACE_Map_BFT_Module_DisplayName"; function = QFUNC(blueForceTrackingModule); scope = 2; isGlobal = 1; icon = PATHTOF(UI\Icon_Module_BFTracking_ca.paa); class Arguments { class Interval { - displayName = "Interval"; - description = "How often the markers should be refreshed (in seconds)"; + displayName = "$STR_ACE_Map_BFT_Interval_DisplayName"; + description = "$STR_ACE_Map_BFT_Interval_Description"; defaultValue = 1; }; class HideAiGroups { - displayName = "Hide AI groups?"; - description = "Hide markers for 'AI only' groups?"; + displayName = "$STR_ACE_Map_BFT_HideAiGroups_DisplayName"; + description = "$STR_ACE_Map_BFT_HideAiGroups_Description"; typeName = "BOOL"; class values { - class Yes { name = "Yes"; value = 1; }; - class No { name = "No"; value = 0; default = 1; }; + class Yes { name = "$STR_ACE_Map_Yes"; value = 1; }; + class No { name = "$STR_ACE_Map_No"; value = 0; default = 1; }; }; }; + }; + class ModuleDescription { + description = "$STR_ACE_Map_BFT_Module_Description"; }; }; -}; +}; \ No newline at end of file diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 4423bbcfb4..0c25016653 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -1,6 +1,77 @@ ๏ปฟ - - - + + + Map + Mapa + + + Map illumination? + Oล›wietlenie mapy + + + Calculate dynamic map illumination based on light conditions? + Oblicza dynamiczne oล›wietlenie mapy bazujฤ…ce na warunkach oล›wietleniowych + + + Yes + Tak + + + No + Nie + + + Map shake? + Drลผenie mapy + + + Make map shake when walking? + Ekran mapy drลผy podczas ruchu + + + Limit map zoom? + Ograniczony zoom + + + Limit the amount of zoom available for the map? + Ogranicza maksymalny stopieล„ przybliลผenia mapy + + + Show cursor coordinates? + Koordynaty pod kursorem + + + Show the grid coordinates on the mouse pointer? + Pokazuje pod kursorem koordynaty wskazanego kwadratu mapy + + + + Moduล‚ ten pozwala dostosowaฤ‡ opcje widoku ekranu mapy. + + + Blue Force Tracking + Blue Force Tracking + + + Interval + Interwaล‚ + + + How often the markers should be refreshed (in seconds) + Jak czฤ™sto markery powinny byฤ‡ odล›wieลผane (w sekundach) + + + Hide AI groups? + Ukryj grupy AI + + + Hide markers for 'AI only' groups? + Ukrywa markery dla grup zล‚oลผonych tylko z AI + + + + Pozwala ล›ledziฤ‡ na mapie pozycje sojuszniczych jednostek za pomocฤ… markerรณw BFT. + + \ No newline at end of file diff --git a/addons/medical/CfgFactionClasses.hpp b/addons/medical/CfgFactionClasses.hpp index e98b1f84ec..67e3404e91 100644 --- a/addons/medical/CfgFactionClasses.hpp +++ b/addons/medical/CfgFactionClasses.hpp @@ -1,6 +1,6 @@ class CfgFactionClasses { class NO_CATEGORY; class ADDON: NO_CATEGORY { - displayName = "ACE Medical"; + displayName = "$STR_ACE_Medical_Category_DisplayName"; }; }; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 4054a2ee1e..aac43de0ed 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -12,7 +12,7 @@ class CfgVehicles { // TODO localization for all the modules class ACE_moduleMedicalSettings: ACE_Module { scope = 2; - displayName = "Medical Settings [ACE]"; + displayName = "$STR_ACE_MedicalSettings_Module_DisplayName"; icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); category = "ACE_medical"; function = QUOTE(DFUNC(moduleMedicalSettings)); @@ -22,78 +22,78 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; class Arguments { class level { - displayName = "Medical Level"; - description = "What is the medical simulation level?"; + displayName = "$STR_ACE_MedicalSettings_level_DisplayName"; + description = "$STR_ACE_MedicalSettings_level_Description"; typeName = "NUMBER"; class values { class normal { - name = "Basic"; + name = "$STR_ACE_MedicalSettings_basic"; value = 1; default = 1; }; class full { - name = "Advanced"; + name = "$STR_ACE_MedicalSettings_advanced"; value = 2; }; }; }; class medicSetting { - displayName = "Medics setting"; - description = "What is the level of detail prefered for medics?"; + displayName = "$STR_ACE_MedicalSettings_medicSetting_DisplayName"; + description = "$STR_ACE_MedicalSettings_medicSetting_Description"; typeName = "NUMBER"; class values { class disable { - name = "Disable medics"; + name = "$STR_ACE_MedicalSettings_medicSetting_disable"; value = 0; }; class normal { - name = "Normal"; + name = "$STR_ACE_MedicalSettings_basic"; value = 1; default = 1; }; class full { - name = "Advanced"; + name = "$STR_ACE_MedicalSettings_advanced"; value = 2; }; }; }; class allowLitterCreation { - displayName = "Enable Litter"; - description = "Enable litter being created upon treatment"; + displayName = "$STR_ACE_MedicalSettings_allowLitterCreation_DisplayName"; + description = "$STR_ACE_MedicalSettings_allowLitterCreation_Description"; typeName = "BOOL"; defaultValue = 1; }; class litterCleanUpDelay { - displayName = "Life time of litter objects"; - description = "How long should litter objects stay? In seconds. -1 is forever."; + displayName = "$STR_ACE_MedicalSettings_litterCleanUpDelay_DisplayName"; + description = "$STR_ACE_MedicalSettings_litterCleanUpDelay_Description"; typeName = "NUMBER"; defaultValue = 1800; }; class enableScreams { - displayName = "Enable Screams"; - description = "Enable screaming by injuried units"; + displayName = "$STR_ACE_MedicalSettings_enableScreams_DisplayName"; + description = "$STR_ACE_MedicalSettings_enableScreams_Description"; typeName = "BOOL"; defaultValue = 1; }; class playerDamageThreshold { - displayName = "Player Damage"; - description = "What is the damage a player can take before being killed?"; + displayName = "$STR_ACE_MedicalSettings_playerDamageThreshold_DisplayName"; + description = "$STR_ACE_MedicalSettings_playerDamageThreshold_Description"; typeName = "NUMBER"; defaultValue = 1; }; class AIDamageThreshold { - displayName = "AI Damage"; - description = "What is the damage an AI can take before being killed?"; + displayName = "$STR_ACE_MedicalSettings_AIDamageThreshold_DisplayName"; + description = "$STR_ACE_MedicalSettings_AIDamageThreshold_Description"; typeName = "NUMBER"; defaultValue = 1; }; class enableUnconsciousnessAI { - displayName = "AI Unconsciousness"; - description = "Allow AI to go unconscious"; + displayName = "$STR_ACE_MedicalSettings_enableUnconsciousnessAI_DisplayName"; + description = "$STR_ACE_MedicalSettings_enableUnconsciousnessAI_Description"; typeName = "NUMBER"; class values { class disable { - name = "Disabled"; + name = "$STR_ACE_Medical_disabled"; value = 0; }; class normal { @@ -102,45 +102,45 @@ class CfgVehicles { default = 1; }; class full { - name = "Enabled"; + name = "$STR_ACE_Medical_enabled"; value = 2; }; }; }; class preventInstaDeath { - displayName = "Prevent instant death"; - description = "Have a unit move to unconscious instead of death"; + displayName = "$STR_ACE_MedicalSettings_preventInstaDeath_DisplayName"; + description = "$STR_ACE_MedicalSettings_preventInstaDeath_Description"; typeName = "BOOL"; defaultValue = 0; }; class bleedingCoefficient { - displayName = "Bleeding coefficient"; - description = "Coefficient to modify the bleeding speed"; + displayName = "$STR_ACE_MedicalSettings_bleedingCoefficient_DisplayName"; + description = "$STR_ACE_MedicalSettings_bleedingCoefficient_Description"; typeName = "NUMBER"; defaultValue = 1; }; class painCoefficient { - displayName = "Pain coefficient"; - description = "Coefficient to modify the pain intensity"; + displayName = "$STR_ACE_MedicalSettings_painCoefficient_DisplayName"; + description = "$STR_ACE_MedicalSettings_painCoefficient_Description"; typeName = "NUMBER"; defaultValue = 1; }; class keepLocalSettingsSynced { - displayName = "Sync status"; - description = "Keep unit status synced. Recommended on."; + displayName = "$STR_ACE_MedicalSettings_keepLocalSettingsSynced_DisplayName"; + description = "$STR_ACE_MedicalSettings_keepLocalSettingsSynced_Description"; typeName = "BOOL"; defaultValue = 1; }; }; class ModuleDescription { - description = "Provides a medical system for both players and AI."; + description = "$STR_ACE_MedicalSettings_Module_Description"; sync[] = {}; }; }; class ACE_moduleAdvancedMedicalSettings: ACE_Module { scope = 2; - displayName = "Advanced Medical Settings [ACE]"; + displayName = "$STR_ACE_AdvancedMedicalSettings_Module_DisplayName"; icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); category = "ACE_medical"; function = QUOTE(FUNC(moduleAdvancedMedicalSettings)); @@ -151,80 +151,80 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; class Arguments { class enableFor { - displayName = "Enabled for"; - description = "Select what units the advanced medical system will be enabled for"; + displayName = "$STR_ACE_AdvancedMedicalSettings_enableFor_DisplayName"; + description = "$STR_ACE_AdvancedMedicalSettings_enableFor_Description"; typeName = "NUMBER"; class values { class playableUnits { - name = "Players only."; + name = "$STR_ACE_Medical_playeronly"; value = 0; default = 1; }; class playableUnitsAndAI { - name = "Players and AI"; + name = "$STR_ACE_Medical_playersandai"; value = 1; }; }; }; class enableAdvancedWounds { - displayName = "Enable Advanced wounds"; - description = "Allow reopening of bandaged wounds?"; + displayName = "$STR_ACE_AdvancedMedicalSettings_enableAdvancedWounds_DisplayName"; + description = "$STR_ACE_AdvancedMedicalSettings_enableAdvancedWounds_Description"; typeName = "BOOL"; defaultValue = 0; }; class enableVehicleCrashes { - displayName = "Vehicle Crashes"; - description = "Do units take damage from a vehicle crash?"; + displayName = "$STR_ACE_AdvancedMedicalSettings_enableVehicleCrashes_DisplayName"; + description = "$STR_ACE_AdvancedMedicalSettings_enableVehicleCrashes_Description"; typeName = "BOOL"; defaultValue = 1; }; class medicSetting_PAK { - displayName = "Allow PAK"; - description = "Who can use the PAK for full heal?"; + displayName = "$STR_ACE_AdvancedMedicalSettings_medicSetting_PAK_DisplayName"; + description = "$STR_ACE_AdvancedMedicalSettings_medicSetting_PAK_Description"; typeName = "NUMBER"; class values { - class anyone { name = "Anyone"; value = 0; }; - class Medic { name = "Medics only"; value = 1; default = 1; }; - class Special { name = "Doctors only"; value = 2; }; + class anyone { name = "$STR_ACE_AdvancedMedicalSettings_anyone"; value = 0; }; + class Medic { name = "$STR_ACE_AdvancedMedicalSettings_Medic"; value = 1; default = 1; }; + class Special { name = "$STR_ACE_AdvancedMedicalSettings_Special"; value = 2; }; }; }; class consumeItem_PAK { - displayName = "Remove PAK on use"; - description = "Should PAK be removed on usage?"; + displayName = "$STR_ACE_AdvancedMedicalSettings_consumeItem_PAK_DisplayName"; + description = "$STR_ACE_AdvancedMedicalSettings_consumeItem_PAK_Description"; typeName = "NUMBER"; class values { - class keep { name = "No"; value = 0; }; - class remove { name = "Yes"; value = 1; default = 1; }; + class keep { name = "$STR_ACE_Medical_No"; value = 0; }; + class remove { name = "$STR_ACE_Medical_Yes"; value = 1; default = 1; }; }; }; class useLocation_PAK { - displayName = "Locations PAK"; - description = "Where can the personal aid kit be used?"; + displayName = "$STR_ACE_AdvancedMedicalSettings_useLocation_PAK_DisplayName"; + description = "$STR_ACE_AdvancedMedicalSettings_useLocation_PAK_Description"; typeName = "NUMBER"; class values { - class anywhere { name = "Anywhere"; value = 0; }; - class vehicle { name = "Medical Vehicles"; value = 1; }; - class facility { name = "Medical facility"; value = 2; }; - class vehicleAndFacility { name = "Vehicles & facility"; value = 3; default = 1; }; - class disabled { name = "Disabled"; value = 4;}; + class anywhere { name = "$STR_ACE_AdvancedMedicalSettings_anywhere"; value = 0; }; + class vehicle { name = "$STR_ACE_AdvancedMedicalSettings_vehicle"; value = 1; }; + class facility { name = "$STR_ACE_AdvancedMedicalSettings_facility"; value = 2; }; + class vehicleAndFacility { name = "$STR_ACE_AdvancedMedicalSettings_vehicleAndFacility"; value = 3; default = 1; }; + class disabled { name = "$STR_ACE_AdvancedMedicalSettings_disabled"; value = 4;}; }; }; class medicSetting_SurgicalKit: medicSetting_PAK { - displayName = "Allow Surgical kit (Adv)"; - description = "Who can use the surgical kit?"; + displayName = "$STR_ACE_AdvancedMedicalSettings_medicSetting_SurgicalKit_DisplayName"; + description = "$STR_ACE_AdvancedMedicalSettings_medicSetting_SurgicalKit_Description"; }; class consumeItem_SurgicalKit: consumeItem_PAK { - displayName = "Remove Surgical kit (Adv)"; - description = "Should Surgical kit be removed on usage?"; + displayName = "$STR_ACE_AdvancedMedicalSettings_consumeItem_SurgicalKit_DisplayName"; + description = "$STR_ACE_AdvancedMedicalSettings_consumeItem_SurgicalKit_Description"; }; class useLocation_SurgicalKit: useLocation_PAK { - displayName = "Locations Surgical kit (Adv)"; - description = "Where can the Surgical kit be used?"; + displayName = "$STR_ACE_AdvancedMedicalSettings_useLocation_SurgicalKit_DisplayName"; + description = "$STR_ACE_AdvancedMedicalSettings_useLocation_SurgicalKit_Description"; }; }; class ModuleDescription { - description = "Configure the treatment settings from ACE Medical"; + description = "$STR_ACE_AdvancedMedicalSettings_Module_Description"; sync[] = {}; }; }; @@ -232,7 +232,7 @@ class CfgVehicles { class ACE_moduleReviveSettings: ACE_Module { scope = 2; - displayName = "Revive Settings [ACE]"; + displayName = "$STR_ACE_ReviveSettings_Module_DisplayName"; icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); category = "ACE_medical"; function = QUOTE(DFUNC(moduleReviveSettings)); @@ -242,37 +242,37 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; class Arguments { class enableRevive { - displayName = "Enable Revive"; - description = "Enable a basic revive system"; + displayName = "$STR_ACE_ReviveSettings_enableRevive_DisplayName"; + description = "$STR_ACE_ReviveSettings_enableRevive_Description"; typeName = "NUMBER"; defaultValue = 0; class values { - class disable { name = "Disabled"; value = 0; default = 1;}; - class playerOnly { name = "Player only"; value = 1; }; - class playerAndAI { name = "Player & AI"; value = 2; }; + class disable { name = "$STR_ACE_Medical_disabled"; value = 0; default = 1;}; + class playerOnly { name = "$STR_ACE_Medical_playeronly"; value = 1; }; + class playerAndAI { name = "$STR_ACE_Medical_playersandai"; value = 2; }; }; }; class maxReviveTime { - displayName = "Max Revive time"; - description = "Max amount of seconds a unit can spend in revive state"; + displayName = "$STR_ACE_ReviveSettings_maxReviveTime_DisplayName"; + description = "$STR_ACE_ReviveSettings_maxReviveTime_Description"; typeName = "NUMBER"; defaultValue = 120; }; class amountOfReviveLives { - displayName = "Max Revive lives"; - description = "Max amount of lives a unit. 0 or -1 is disabled."; + displayName = "$STR_ACE_ReviveSettings_amountOfReviveLives_DisplayName"; + description = "$STR_ACE_ReviveSettings_amountOfReviveLives_Description"; typeName = "NUMBER"; defaultValue = -1; }; }; class ModuleDescription { - description = "Provides a medical system for both players and AI."; + description = "$STR_ACE_ReviveSettings_Module_Description"; sync[] = {}; }; }; class ACE_moduleAssignMedicRoles: Module_F { scope = 2; - displayName = "Set Medic Class [ACE]"; + displayName = "$STR_ACE_AssignMedicRoles_Module_DisplayName"; icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); category = "ACE_medical"; function = QUOTE(FUNC(moduleAssignMedicRoles)); @@ -283,41 +283,41 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; class Arguments { class EnableList { - displayName = "List"; - description = "List of unit names that will be classified as medic, separated by commas."; + displayName = "$STR_ACE_AssignMedicRoles_EnableList_DisplayName"; + description = "$STR_ACE_AssignMedicRoles_EnableList_Description"; defaultValue = ""; typeName = "STRING"; }; class role { - displayName = "Is Medic"; - description = "Medics allow for more advanced treatment in case of Advanced Medic roles enabled"; + displayName = "$STR_ACE_AssignMedicRoles_role_DisplayName"; + description = "$STR_ACE_AssignMedicRoles_role_Description"; typeName = "NUMBER"; class values { class none { - name = "None"; + name = "$STR_ACE_AssignMedicRoles_role_none"; value = 0; }; class medic { - name = "Regular medic"; + name = "$STR_ACE_AssignMedicRoles_role_medic"; value = 1; default = 1; }; class doctor { - name = "Doctor (Only Advanced Medics)"; + name = "$STR_ACE_AssignMedicRoles_role_doctor"; value = 2; }; }; }; }; class ModuleDescription { - description = "Assigns the ACE medic class to a unit"; + description = "$STR_ACE_AssignMedicRoles_Module_Description"; sync[] = {}; }; }; class ACE_moduleAssignMedicVehicle: Module_F { scope = 2; - displayName = "Set Medical Vehicle [ACE]"; + displayName = "$STR_ACE_AssignMedicVehicle_Module_DisplayName"; icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); category = "ACE_medical"; function = QUOTE(FUNC(moduleAssignMedicalVehicle)); @@ -328,22 +328,22 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; class Arguments { class EnableList { - displayName = "List"; - description = "List of vehicles that will be classified as medical vehicle, separated by commas."; + displayName = "$STR_ACE_AssignMedicVehicle_EnableList_DisplayName"; + description = "$STR_ACE_AssignMedicVehicle_EnableList_Description"; defaultValue = ""; typeName = "STRING"; }; class enabled { - displayName = "Is Medical Vehicle"; - description = "Whatever or not the objects in the list will be a medical vehicle."; + displayName = "$STR_ACE_AssignMedicVehicle_enabled_DisplayName"; + description = "$STR_ACE_AssignMedicVehicle_enabled_Description"; typeName = "NUMBER"; class values { class none { - name = "No"; + name = "$STR_ACE_Medical_No"; value = 0; }; class medic { - name = "Yes"; + name = "$STR_ACE_Medical_Yes"; value = 1; default = 1; }; @@ -351,13 +351,13 @@ class CfgVehicles { }; }; class ModuleDescription { - description = "Assigns the ACE medic class to a unit"; + description = "$STR_ACE_AssignMedicVehicle_Module_Description"; sync[] = {}; }; }; class ACE_moduleAssignMedicalFacility: Module_F { scope = 2; - displayName = "Set Medical Facility [ACE]"; + displayName = "$STR_ACE_AssignMedicalFacility_Module_DisplayName"; icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); category = "ACE_medical"; function = QUOTE(FUNC(moduleAssignMedicalFacility)); @@ -368,13 +368,13 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; class Arguments { class enabled { - displayName = "Is Medical Facility"; - description = "Registers an object as a medical facility for CMS"; + displayName = "$STR_ACE_AssignMedicalFacility_enabled_DisplayName"; + description = "$STR_ACE_AssignMedicalFacility_enabled_Description"; typeName = "BOOL"; }; }; class ModuleDescription { - description = "Defines an object as a medical facility for CMS. This allows for more advanced treatments. Can be used on buildings and vehicles. "; + description = "$STR_ACE_AssignMedicalFacility_Module_Description"; sync[] = {}; }; }; @@ -897,7 +897,7 @@ class CfgVehicles { class ACE_medicalSupplyCrate: NATO_Box_Base { scope = 2; accuracy = 1000; - displayName = "[ACE] Medical Supply Crate (Basic)"; + displayName = "$STR_ACE_medicalSupplyCrate"; model = PATHTOF(data\ace_medcrate.p3d); author = "$STR_ACE_Common_ACETeam"; class TransportItems { @@ -932,7 +932,7 @@ class CfgVehicles { }; }; class ACE_medicalSupplyCrate_advanced: ACE_medicalSupplyCrate { - displayName = "[ACE] Medical Supply Crate (Advanced)"; + displayName = "$STR_ACE_medicalSupplyCrate_advanced"; class TransportItems { class ACE_fieldDressing { name = "ACE_fieldDressing"; @@ -1017,3 +1017,24 @@ class CfgVehicles { }; }; }; + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/medical/config.cpp b/addons/medical/config.cpp index 566de29f91..cd0fe0e66c 100644 --- a/addons/medical/config.cpp +++ b/addons/medical/config.cpp @@ -6,7 +6,7 @@ class CfgPatches { weapons[] = {"ACE_fieldDressing", "ACE_packingBandage", "ACE_elasticBandage", "ACE_tourniquet", "ACE_morphine", "ACE_atropine", "ACE_epinephrine", "ACE_plasmaIV", "ACE_plasmaIV_500", "ACE_plasmaIV_250", "ACE_bloodIV", "ACE_bloodIV_500", "ACE_bloodIV_250", "ACE_salineIV", "ACE_salineIV_500", "ACE_salineIV_250", "ACE_quikclot", "ACE_personalAidKit", "ACE_surgicalKit", "ACE_bodyBag"}; requiredVersion = REQUIRED_VERSION; requiredAddons[] = {"ace_interaction","ace_modules", "ace_apl"}; - author[] = {"Glowbal", "KoffienFlummi"}; + author[] = {"Glowbal", "KoffeinFlummi"}; authorUrl = ""; VERSION_CONFIG; }; diff --git a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf index 85e9bee828..b283068ec7 100644 --- a/addons/medical/functions/fnc_actionCheckPulseLocal.sqf +++ b/addons/medical/functions/fnc_actionCheckPulseLocal.sqf @@ -24,7 +24,7 @@ if (!alive _unit) then { _heartRate = 0; }; _heartRateOutput = "STR_ACE_Medical_Check_Pulse_Output_5"; -_logOutPut = "No heart rate"; +_logOutPut = localize "STR_ACE_Medical_Check_Pulse_None"; if (_heartRate > 1.0) then { if ([_caller] call FUNC(isMedic)) then { diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 215d9ae766..50f3d67110 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -1290,7 +1290,7 @@ Trousse chirurgicale ะฅะธั€ัƒั€ะณะธั‡ะตัะบะธะน ะฝะฐะฑะพั€ Kit quirรบrgico - Zestaw do szycia ran + Zestaw chirurgiczny Operationsset Sebรฉszeti kรฉszlet Kit chirurgico @@ -1585,6 +1585,10 @@ %1 zkontroloval srdeฤnรญ tep: %2 %1 verificou a frequรชncia cardรญaca: %2 + + None + Brak + Weak Schwach @@ -2701,5 +2705,377 @@ ะกะฝัั‚ะธะต ะถะณัƒั‚ะฐ ... Togliendo il laccio emostatico ... + + ACE Medical + ACE Opcje medyczne + + + Medical Settings [ACE] + Ustawienia medyczne [ACE] + + + Medical Level + Poziom medyczny + + + What is the medical simulation level? + Jaki jest poziom symulacji medycznej? + + + Basic + Podstawowy + + + Advanced + Zaawansowany + + + Medics setting + Poziom medykรณw + + + What is the level of detail prefered for medics? + Jaki jest poziom detali medycznych wyล›wietlanych dla medykรณw? + + + Disable medics + Wyล‚ฤ…cz medykรณw + + + Enable Litter + Aktywuj odpadki + + + Enable litter being created upon treatment + Twรณrz odpadki medyczne podczas leczenia + + + Life time of litter objects + Dล‚ugoล›ฤ‡ ลผycia odpadkรณw + + + How long should litter objects stay? In seconds. -1 is forever. + Ile czasu musi upล‚ynฤ…ฤ‡, aby odpadki zaczฤ™ล‚y znikaฤ‡? W sekundach. -1 dla nieskoล„czonoล›ci. + + + Enable Screams + Aktywuj wrzaski + + + Enable screaming by injuried units + Aktywuj wrzeszczenie z bรณlu przez ranne jednostki + + + Player Damage + Prรณg obraลผeล„ graczy + + + What is the damage a player can take before being killed? + Jaki jest prรณg obraลผeล„, jakie gracz moลผe otrzymaฤ‡ zanim zostanie zabity? + + + AI Damage + Prรณg obraลผeล„ AI + + + What is the damage an AI can take before being killed? + Jaki jest prรณg obraลผeล„, jakie AI moลผe otrzymaฤ‡ zanim zostanie zabite? + + + AI Unconsciousness + Nieprzytomnoล›ฤ‡ AI + + + Allow AI to go unconscious + Czy AI moลผe byฤ‡ nieprzytomne od odniesionych obraลผeล„? + + + Disabled + Wyล‚ฤ…czone + + + Enabled + Wล‚ฤ…czone + + + Prevent instant death + Wyล‚. natychmiast. ล›mierฤ‡ + + + Have a unit move to unconscious instead of death + Spraw, aby jednostka zostaล‚a przeniesiona do stanu nieprzytomnoล›ci zamiast ginฤ…ฤ‡ na miejscu od ล›miertelnych obraลผeล„ + + + Bleeding coefficient + Mnoลผnik krwawienia + + + Coefficient to modify the bleeding speed + Mnoลผnik modyfikujฤ…cy prฤ™dkoล›ฤ‡ wykrwawiania siฤ™ + + + Pain coefficient + Mnoลผnik bรณlu + + + Coefficient to modify the pain intensity + Mnoลผnik modyfikujฤ…cy intensywnoล›ฤ‡ bรณlu + + + Sync status + Synchronizuj status + + + Keep unit status synced. Recommended on. + Utrzymuj synchronizacjฤ™ statusu jednostek. Zalecane zostawienie tej opcji wล‚ฤ…czonej. + + + Provides a medical system for both players and AI. + Moduล‚ ten dostarcza system medyczny dla graczy oraz AI. + + + Advanced Medical Settings [ACE] + Zaawansowane ustawienia medyczne [ACE] + + + Enabled for + Aktywne dla + + + Select what units the advanced medical system will be enabled for + Wybierz dla kogo zaawansowany system medyczny bฤ™dzie aktywny + + + Players only + Tylko dla graczy + + + Players and AI + Gracze oraz AI + + + Enable Advanced wounds + Akt. zaawansowane rany + + + Allow reopening of bandaged wounds? + Pozwรณl na otwieranie siฤ™ zabandaลผowanych ran? + + + Vehicle Crashes + Obraลผenia od kolizji + + + Do units take damage from a vehicle crash? + Czy jednostki otrzymujฤ… obraลผenia w wyniku kolizji pojazdรณw? + + + Allow PAK + Ust. apteczek osobistych + + + Who can use the PAK for full heal? + Kto moลผe skorzystaฤ‡ z apteczki osobistej w celu peล‚nego uleczenia? + + + Anyone + Wszyscy + + + Medics only + Tylko medycy + + + Doctors only + Tylko doktorzy + + + Remove PAK on use + Usuล„ apteczkฤ™ po uลผyciu + + + Should PAK be removed on usage? + Czy apteczka osobista powinna zniknฤ…ฤ‡ z ekwipunku po jej uลผyciu? + + + No + Nie + + + Yes + Tak + + + Locations PAK + Ogr. apteczek osobistych + + + Where can the personal aid kit be used? + Gdzie moลผna korzystaฤ‡ z apteczek osobistych? + + + Anywhere + Wszฤ™dzie + + + Medical vehicles + Pojazdy medyczne + + + Medical facility + Budynki medyczne + + + Vehicles & facility + Pojazdy i budynki medyczne + + + Disabled + Wyล‚ฤ…czone + + + Allow Surgical kit (Adv) + Ust. zestawu chirurg. + + + Who can use the surgical kit? + Kto moลผe skorzystaฤ‡ z zestawu chirurgicznego w celu zszycia ran? + + + Remove Surgical kit (Adv) + Usuล„ zest. chir. po uลผyciu + + + Should Surgical kit be removed on usage? + Czy zestaw chirurgiczny powinien zniknฤ…ฤ‡ z ekwipunku po jego uลผyciu? + + + Locations Surgical kit (Adv) + Ogr. zestawu chirurg. + + + Where can the Surgical kit be used? + Gdzie moลผna korzystaฤ‡ z zestawu chirurgicznego? + + + Configure the treatment settings from ACE Medical + Skonfiguruj zaawansowane ustawienia leczenia systemu medycznego ACE + + + Revive Settings [ACE] + Ustawienia wskrzeszania [ACE] + + + Enable Revive + Aktywuj wskrzeszanie + + + Enable a basic revive system + Aktywuj podstawowy system wskrzeszania + + + Max Revive time + Maks. czas agonii + + + Max amount of seconds a unit can spend in revive state + Maksymalna dล‚ugoล›ฤ‡ agonii w sekundach (czas na wskrzeszenie) + + + Max Revive lives + Maks. iloล›ฤ‡ wskrzeszeล„ + + + Max amount of lives a unit. 0 or -1 is disabled. + Maksymalna iloล›ฤ‡ wskrzeszeล„. Wpisz 0 lub -1 aby wyล‚ฤ…czyฤ‡. + + + Provides a medical system for both players and AI. + Moduล‚ ten aktywuje podstawowy system wskrzeszania. Jednostka po otrzymaniu ล›miertelnych obraลผeล„ przechodzi do stanu agonii, ktรณra trwa okreล›lonฤ… dล‚ugoล›ฤ‡ czasu. W tym czasie aby wskrzesiฤ‡ i jednoczeล›nie odratowaฤ‡ jednostkฤ™ naleลผy opatrzeฤ‡ jej rany i wykonaฤ‡ RKO. + + + Set Medic Class [ACE] + Ustaw klasฤ™ medyka [ACE] + + + List + Lista + + + List of unit names that will be classified as medic, separated by commas. + Lista nazw jednostek, ktรณre sฤ… sklasyfikowane jako medycy, oddzielone przecinkami. + + + Is Medic + Klasa medyczna + + + + + + + None + ลปadna + + + Regular medic + Zwykล‚y medyk + + + Doctor (Only Advanced Medics) + Doktor (tylko zaawansowani medycy) + + + Assigns the ACE medic class to a unit + Moduล‚ ten przypisuje klasฤ™ medyka ACE do jednostek. + + + Set Medical Vehicle [ACE] + Ustaw pojazd medyczny [ACE] + + + List + Lista + + + List of vehicles that will be classified as medical vehicle, separated by commas. + Lista nazw pojazdรณw, ktรณre sฤ… sklasyfikowane jako pojazdy medyczne, oddzielone przecinkami. + + + Is Medical Vehicle + Jest pojazdem med. + + + Whatever or not the objects in the list will be a medical vehicle. + Czy pojazdy z tej listy sฤ… pojazdami medycznymi. + + + Assigns the ACE medic class to a unit + Moduล‚ ten pozwala na przypisanie danym pojazdom statusu pojazdรณw medycznych. Wewnฤ…trz takiego pojazdu moลผna wykonywaฤ‡ zaawansowane zabiegi medyczne. + + + Set Medical Facility [ACE] + Ustaw budynek medyczny [ACE] + + + Is Medical Facility + Jest budynkiem med. + + + Registers an object as a medical facility + Przypisuje danemu obiektowi status budynku medycznego + + + Defines an object as a medical facility. This allows for more advanced treatments. Can be used on buildings and vehicles. + Moduล‚ ten pozwala przypisaฤ‡ status budynku medycznego danemu obiektowi. Budynek taki pozwala na wykonywanie zaawansowanych zabiegรณw medycznych. Moลผe byฤ‡ uลผyte na pojazdach i budynkach. + + + [ACE] Medical Supply Crate (Basic) + [ACE] Skrzynka z zapasami medycznymi (podstawowa) + + + [ACE] Medical Supply Crate (Advanced) + [ACE] Skrzynka z zapasami medycznymi (zaawansowana) + diff --git a/addons/microdagr/CfgVehicles.hpp b/addons/microdagr/CfgVehicles.hpp index 833f7bd2f6..dc4ae7d237 100644 --- a/addons/microdagr/CfgVehicles.hpp +++ b/addons/microdagr/CfgVehicles.hpp @@ -44,7 +44,7 @@ class CfgVehicles { class GVAR(dagrModule): Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "MicroDAGR Map Fill"; + displayName = "$STR_ACE_Dagr_Module_DisplayName"; function = QFUNC(moduleMapFill); scope = 2; isGlobal = 1; @@ -52,18 +52,18 @@ class CfgVehicles { functionPriority = 0; class Arguments { class MapDataAvailable { - displayName = "MicroDAGR Map Fill"; // Argument label - description = "How much map data is filled on MicroDAGR's "; // Tooltip description - typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" + displayName = "$STR_ACE_Dagr_MapDataAvailable_DisplayName"; + description = "$STR_ACE_Dagr_MapDataAvailable_Description"; + typeName = "NUMBER"; class values { - class None {name = "Full Satellite + Buildings"; value = MAP_DETAIL_SAT; default = 1;}; - class Side {name = "Topographical + Roads"; value = MAP_DETAIL_TOPOROADS;}; - class Unique {name = "None (Cannot use map view)"; value = MAP_DETAIL_NONE;}; + class None {name = "$STR_ACE_Dagr_None"; value = MAP_DETAIL_SAT; default = 1;}; + class Side {name = "$STR_ACE_Dagr_Side"; value = MAP_DETAIL_TOPOROADS;}; + class Unique {name = "$STR_ACE_Dagr_Unique"; value = MAP_DETAIL_NONE;}; }; }; }; class ModuleDescription: ModuleDescription { - description = "Controls how much data is filled on the microDAGR items. Less data restricts the map view to show less on the minimap.
Source: microDAGR.pbo"; + description = "$STR_ACE_Dagr_Module_Description"; }; }; @@ -73,4 +73,4 @@ class CfgVehicles { MACRO_ADDITEM(ACE_microDAGR,10); }; }; -}; +}; \ No newline at end of file diff --git a/addons/microdagr/stringtable.xml b/addons/microdagr/stringtable.xml index af2b303f2b..c8fa993b46 100644 --- a/addons/microdagr/stringtable.xml +++ b/addons/microdagr/stringtable.xml @@ -301,5 +301,33 @@ Chiudi MicroDAGR Fechar MicroDAGR + + MicroDAGR Map Fill + Wypeล‚nienie mapy MicroDAGR + + + MicroDAGR Map Fill + Wypeล‚nienie mapy MicroDAGR + + + How much map data is filled on MicroDAGR's + Jak duลผa czฤ™ล›ฤ‡ informacji mapy jest zaล‚adowana do MicroDAGR? + + + Full Satellite + Buildings + Peล‚na satelitarna + budynki + + + Topographical + Roads + Topograficzna + drogi + + + None (Cannot use map view) + ลปadna (wyล‚ฤ…cza ekran mapy) + + + Controls how much data is filled on the microDAGR items. Less data restricts the map view to show less on the minimap.<br />Source: microDAGR.pbo + Moduล‚ ten pozwala kontrolowaฤ‡ jak duลผa iloล›ฤ‡ informacji jest zaล‚adowana do przedmiotรณw MicroDAGR. Mniejsza iloล›ฤ‡ danych ogranicza widok mapy pokazujฤ…c mniej rzeczy na minimapie.<br />ลนrรณdล‚o: microDAGR.pbo + diff --git a/addons/missileguidance/ACE_Settings.hpp b/addons/missileguidance/ACE_Settings.hpp index d489ef15f3..c04e6c080c 100644 --- a/addons/missileguidance/ACE_Settings.hpp +++ b/addons/missileguidance/ACE_Settings.hpp @@ -5,6 +5,6 @@ class ACE_Settings { isClientSettable = 1; displayName = "$STR_ACE_MissileGuidance"; description = "$STR_ACE_MissileGuidance_Desc"; - values[] = {"Off", "Player Only", "Player and AI"}; + values[] = {"$STR_ACE_MissileGuidance_Off", "$STR_ACE_MissileGuidance_PlayerOnly", "$STR_ACE_MissileGuidance_PlayerAndAi"}; }; }; \ No newline at end of file diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index dcb2be486c..3c551493a5 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -97,5 +97,17 @@ Hellfire II AGM-114K lรฉzer-irรกnyรญtott rakรฉta ะฃะฟั€ะฐะฒะปัะตะผะฐั ั€ะฐะบะตั‚ะฐ ะปะฐะทะตั€ะฝะพะณะพ ะฝะฐะฒะตะดะตะฝะธั Hellfire II AGM-114K + + Off + Wyล‚ฤ…cz + + + Player Only + Tylko gracz + + + Player and AI + Gracz oraz AI + diff --git a/addons/missionmodules/CfgFactionClasses.hpp b/addons/missionmodules/CfgFactionClasses.hpp index 792f4d31e3..6f320805fb 100644 --- a/addons/missionmodules/CfgFactionClasses.hpp +++ b/addons/missionmodules/CfgFactionClasses.hpp @@ -1,6 +1,6 @@ class CfgFactionClasses { class NO_CATEGORY; class ACE_missionModules: NO_CATEGORY { - displayName = "ACE Mission Modules"; + displayName = "$STR_ACE_MissionModules_Category_DisplayName"; }; }; \ No newline at end of file diff --git a/addons/missionmodules/CfgVehicles.hpp b/addons/missionmodules/CfgVehicles.hpp index 35a937c660..a08e78f17b 100644 --- a/addons/missionmodules/CfgVehicles.hpp +++ b/addons/missionmodules/CfgVehicles.hpp @@ -8,7 +8,7 @@ class CfgVehicles { // TODO make a curator variant for this class ACE_moduleAmbianceSound: Module_F { scope = 2; - displayName = "Ambiance Sounds [ACE]"; + displayName = "$STR_ACE_MissionModules_AmbianceSounds_DisplayName"; icon = QUOTE(PATHTOF(UI\Icon_Module_Ambient_Sounds_ca.paa)); category = "ACE_missionModules"; function = QUOTE(FUNC(moduleAmbianceSound)); @@ -18,51 +18,51 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; class Arguments { class soundFiles { - displayName = "Sounds"; - description = "Class names of the ambiance sounds to be played. Seperated by ','"; + displayName = "$STR_ACE_MissionModules_AmbianceSounds_soundFiles_DisplayName"; + description = "$STR_ACE_MissionModules_AmbianceSounds_soundFiles_Description"; typeName = "STRING"; defaultValue = ""; }; class minimalDistance { - displayName = "Minimal Distance"; - description = "Used for calculating a random position and sets the minimal distance between the players and the played sound file(s)"; + displayName = "$STR_ACE_MissionModules_AmbianceSounds_minimalDistance_DisplayName"; + description = "$STR_ACE_MissionModules_AmbianceSounds_minimalDistance_Description"; typeName = "NUMBER"; defaultValue = 400; }; class maximalDistance { - displayName = "Maximum Distance"; - description = "Used for calculating a random position and sets the maximum distance between the players and the played sound file(s)"; + displayName = "$STR_ACE_MissionModules_AmbianceSounds_maximalDistance_DisplayName"; + description = "$STR_ACE_MissionModules_AmbianceSounds_maximalDistance_Description"; typeName = "NUMBER"; defaultValue = 900; }; class minimalDelay { - displayName = "Minimal Delay"; - description = "Minimal delay between sounds played"; + displayName = "$STR_ACE_MissionModules_AmbianceSounds_minimalDelay_DisplayName"; + description = "$STR_ACE_MissionModules_AmbianceSounds_minimalDelay_Description"; typeName = "NUMBER"; defaultValue = 10; }; class maximalDelay { - displayName = "Maximum Delay"; - description = "Maximum delay between sounds played"; + displayName = "$STR_ACE_MissionModules_AmbianceSounds_maximalDelay_DisplayName"; + description = "$STR_ACE_MissionModules_AmbianceSounds_maximalDelay_Description"; typeName = "NUMBER"; defaultValue = 170; }; class followPlayers { - displayName = "Follow Players"; - description = "Follow players. If set to false, loop will play sounds only nearby logic position."; + displayName = "$STR_ACE_MissionModules_AmbianceSounds_followPlayers_DisplayName"; + description = "$STR_ACE_MissionModules_AmbianceSounds_followPlayers_Description"; typeName = "BOOL"; defaultValue = 0; }; class soundVolume { - displayName = "Volume"; - description = "The volume of the sounds played"; + displayName = "$STR_ACE_MissionModules_AmbianceSounds_soundVolume_DisplayName"; + description = "$STR_ACE_MissionModules_AmbianceSounds_soundVolume_Description"; typeName = "NUMBER"; defaultValue = 1; }; }; class ModuleDescription { - description = "Ambiance sounds loop (synced across MP)"; + description = "$STR_ACE_MissionModules_AmbianceSounds_Description"; sync[] = {}; }; }; -}; +}; \ No newline at end of file diff --git a/addons/missionmodules/stringtable.xml b/addons/missionmodules/stringtable.xml new file mode 100644 index 0000000000..12d70602c2 --- /dev/null +++ b/addons/missionmodules/stringtable.xml @@ -0,0 +1,73 @@ + + + + + ACE Mission Modules + ACE Moduล‚y misji + + + Ambiance Sounds [ACE] + Dลบwiฤ™ki [ACE] + + + Sounds + Dลบwiฤ™ki + + + Classnames of the ambiance sounds played. Seperated by ','. + Classname-y dลบwiฤ™kรณw do odtwarzania. Oddzielone przy uลผyciu ','. + + + Minimal Distance + Minimalny dystans + + + Minimal Distance + Minimalny dystans + + + Maximal Distance + Maksymalny dystans + + + Maximal Distance + Maksymalny dystans + + + Minimal Delay + Minimalne opรณลบnienie + + + Minimal Delay between sounds played + Minimalne opรณลบnienie pomiฤ™dzy odtwarzanymi dลบwiฤ™kami + + + Maximal Delay + Maksymalne opรณลบnienie + + + Maximal Delay between sounds played + Maksymalne opรณลบnienie pomiฤ™dzy odtwarzanymi dลบwiฤ™kami + + + Follow Players + Podฤ…ลผaj za graczami + + + Follow players. If set to false, loop will play sounds only nearby logic position. + Podฤ…ลผaj za graczami. Jeลผeli ustawione na 'Nie', pฤ™tla bฤ™dzie odtwarzana tylko w pobliลผu pozycji logiki. + + + Volume + Gล‚oล›noล›ฤ‡ + + + The volume of the sounds played + Gล‚oล›noล›ฤ‡ odtwarzanych dลบwiฤ™kรณw + + + Ambiance sounds loop (synced across MP) + Pฤ™tla odtwarzania dzwiฤ™kรณw (synchronizowana na MP) + + + \ No newline at end of file diff --git a/addons/mk6mortar/CfgVehicles.hpp b/addons/mk6mortar/CfgVehicles.hpp index baf74fa2c4..e4a9d0f2a5 100644 --- a/addons/mk6mortar/CfgVehicles.hpp +++ b/addons/mk6mortar/CfgVehicles.hpp @@ -50,7 +50,7 @@ class CfgVehicles { class GVAR(module): Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "MK6 Settings"; + displayName = "$STR_ACE_mk6mortar_Module_DisplayName"; function = QFUNC(moduleInit); scope = 2; isGlobal = 0; @@ -58,26 +58,26 @@ class CfgVehicles { functionPriority = 0; class Arguments { class airResistanceEnabled { - displayName = "Air Resistance"; - description = "For Player Shots, Model Air Resistance and Wind Effects"; + displayName = "$STR_ACE_mk6mortar_airResistanceEnabled_DisplayName"; + description = "$STR_ACE_mk6mortar_airResistanceEnabled_Description"; typeName = "BOOL"; defaultValue = 1; }; class allowComputerRangefinder { - displayName = "Allow MK6 Computer"; - description = "Show the Computer and Rangefinder (these NEED to be removed if you enable air resistance)"; + displayName = "$STR_ACE_mk6mortar_allowComputerRangefinder_DisplayName"; + description = "$STR_ACE_mk6mortar_allowComputerRangefinder_Description"; typeName = "BOOL"; defaultValue = 0; }; class allowCompass { - displayName = "Allow MK6 Compass"; - description = "Show the MK6 Digital Compass"; + displayName = "$STR_ACE_mk6mortar_allowCompass_DisplayName"; + description = "$STR_ACE_mk6mortar_allowCompass_Description"; typeName = "BOOL"; defaultValue = 1; }; }; class ModuleDescription: ModuleDescription { - description = ""; + description = "$STR_ACE_mk6mortar_Module_Description"; }; }; -}; +}; \ No newline at end of file diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index fd2fe4aa4c..37c7d322ad 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -49,5 +49,37 @@ Nabรญt Carica + + MK6 Settings + Moลบdzierz MK6 - Ustawienia + + + Air Resistance + Opรณr powietrza + + + For Player Shots, Model Air Resistance and Wind Effects + Modeluj opรณr powietrza oraz wpล‚yw wiatru na tor lotu pocisku dla strzaล‚รณw z moลบdzierza MK6 przez graczy + + + Allow MK6 Computer + Komputer MK6 + + + Show the Computer and Rangefinder (these NEED to be removed if you enable air resistance) + Zezwรณl na komputer i dalmierz (opcja ta MUSI zostaฤ‡ wyล‚ฤ…czona jeลผeli aktywowaล‚eล› opรณr powietrza) + + + Allow MK6 Compass + Kompas MK6 + + + Show the MK6 Digital Compass + Pokaลผ kompas MK6 + + + + Moduล‚ ten pozwala dostosowaฤ‡ ustawienia moลบdzierza MK6. + diff --git a/addons/nametags/CfgVehicles.hpp b/addons/nametags/CfgVehicles.hpp index ec005c8218..3619df195f 100644 --- a/addons/nametags/CfgVehicles.hpp +++ b/addons/nametags/CfgVehicles.hpp @@ -1,69 +1,75 @@ class CfgVehicles { - class Module_F; + class Logic; + class Module_F: Logic { + class ModuleDescription {}; + }; class ACE_ModuleNameTags : Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "Name Tags"; + displayName = "$STR_ACE_NameTags_Module_DisplayName"; function = QFUNC(moduleNameTags); scope = 2; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_NameTags_ca.paa)); class Arguments { class PlayerNamesViewDistance { - displayName = "Player Names View Dist."; - description = "Distance in meters at which player names are shown. Default: 5"; + displayName = "$STR_ACE_NameTags_PlayerNamesViewDistance_DisplayName"; + description = "$STR_ACE_NameTags_PlayerNamesViewDistance_Description"; typeName = "NUMBER"; defaultValue = 5; }; class showNamesForAI { - displayName = "Show name tags for AI?"; - description = "Show the name and rank tags for friendly AI units? Default: Do not force"; + displayName = "$STR_ACE_NameTags_showNamesForAI_DisplayName"; + description = "$STR_ACE_NameTags_showNamesForAI_Description"; typeName = "NUMBER"; class values { class DoNotForce { default = 1; - name = "Do Not Force"; + name = "$STR_ACE_NameTags_DoNotForce"; value = -1; }; class ForceHide { - name = "Force Hide"; + name = "$STR_ACE_NameTags_ForceHide"; value = 0; }; class ForceShow { - name = "Force show"; + name = "$STR_ACE_NameTags_ForceShow"; value = 1; }; }; }; class showVehicleCrewInfo { - displayName = "Show crew info?"; - description = "Show vehicle crew info, or by default allows players to choose it on their own. Default: Do Not Force"; + displayName = "$STR_ACE_NameTags_showVehicleCrewInfo_DisplayName"; + description = "$STR_ACE_NameTags_showVehicleCrewInfo_Description"; typeName = "NUMBER"; class values { class DoNotForce { default = 1; - name = "Do Not Force"; + name = "$STR_ACE_NameTags_DoNotForce"; value = -1; }; class ForceHide { - name = "Force Hide"; + name = "$STR_ACE_NameTags_ForceHide"; value = 0; }; class ForceShow { - name = "Force Show"; + name = "$STR_ACE_NameTags_ForceShow"; value = 1; }; }; }; class showCursorTagForVehicles { - displayName = "Show for Vehicles"; - description = "Show cursor NameTag for vehicle commander (only if client has name tags enabled)Default: No"; + displayName = "$STR_ACE_NameTags_showCursorTagForVehicles_DisplayName"; + description = "$STR_ACE_NameTags_showCursorTagForVehicles_Description"; typeName = "BOOL"; class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; + class Yes {name = "$STR_ACE_NameTags_Yes"; value = 1;}; + class No {default = 1; name = "$STR_ACE_NameTags_No"; value = 0;}; }; }; + }; + class ModuleDescription: ModuleDescription { + description = "$STR_ACE_NameTags_Module_Description"; }; }; -}; +}; \ No newline at end of file diff --git a/addons/nametags/config.cpp b/addons/nametags/config.cpp index dce054a9ec..7a0086bfb6 100644 --- a/addons/nametags/config.cpp +++ b/addons/nametags/config.cpp @@ -27,7 +27,8 @@ class ACE_Settings { typeName = "SCALAR"; isClientSettable = 1; displayName = "$STR_ACE_NameTags_ShowPlayerNames"; - values[] = {"Disabled", "Enabled", "Only Cursor", "Only On Keypress", "Only Cursor and KeyPress"}; + description = "$STR_ACE_NameTags_ShowPlayerNames_Desc"; + values[] = {"$STR_ACE_Common_Disabled", "$STR_ACE_Common_Enabled", "$STR_ACE_Common_OnlyCursor", "$STR_ACE_Common_OnlyOnKeypress", "$STR_ACE_Common_OnlyCursorAndKeyPress"}; }; class GVAR(showPlayerRanks) { value = 1; @@ -57,7 +58,8 @@ class ACE_Settings { typeName = "SCALAR"; isClientSettable = 1; displayName = "$STR_ACE_NameTags_ShowSoundWaves"; - values[] = {"Disabled", "Use Nametag settings", "Always Show All"}; + description = "$STR_ACE_NameTags_ShowSoundWaves_Desc"; + values[] = {"$STR_ACE_Common_Disabled", "$STR_ACE_Common_NameTagSettings", "$STR_ACE_Common_AlwaysShowAll"}; }; class GVAR(PlayerNamesViewDistance) { value = 5; diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index 8daae5cd5d..251e8eba9a 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -109,5 +109,101 @@ Colore dei nomi non appartenenti al gruppo Cor padrรฃo do nome (unidades fora do grupo) + + Name Tags + Ustawienia imion + + + Player Names View Dist. + Zasiฤ™g imion graczy + + + Distance in meters at which player names are shown. Default: 5 + Dystans w metrach, na ktรณrym wyล›wietlane sฤ… imiona graczy. Domyล›lnie: 5 + + + Show name tags for AI? + Imiona AI + + + Show the name and rank tags for friendly AI units? Default: Do not force + Pokaลผ imiona i rangi przyjaznych jednostek AI? Domyล›lnie: Nie wymuszaj + + + Do Not Force + Nie wymuszaj + + + Force Hide + Wymuล› ukrycie + + + Force show + Wymuล› wyล›wietlanie + + + Show crew info? + Pokaลผ zaล‚ogฤ™ + + + Show vehicle crew info, or by default allows players to choose it on their own. Default: Do Not Force + Pokaลผ informacje o obsadzie pojazdu, lub pozwรณl graczom ustawiฤ‡ tฤ… opcje wedล‚ug wล‚asnego uznania. Domyล›lnie: Nie wymuszaj + + + Show for Vehicles + Pokaลผ dla pojazdรณw + + + Show cursor NameTag for vehicle commander (only if client has name tags enabled)Default: No + Pokazuj imiฤ™ dowรณdcy pojazdu nad pojazdem (tylko jeลผeli klient ma wล‚ฤ…czone imiona graczy). Domyล›lnie: Nie + + + Yes + Tak + + + No + Nie + + + + Moduล‚ ten pozwala dostosowaฤ‡ ustawienia i zasiฤ™g wyล›wietlania imion. + + + Disabled + Wyล‚ฤ…czone + + + Enabled + Wล‚ฤ…czone + + + Only Cursor + Tylko pod kursorem + + + Only On Keypress + Tylko po wciล›niฤ™ciu klawisza + + + Only Cursor and KeyPress + Tylko pod kursorem i po wciล›niฤ™ciu klawisza + + + Use Nametag settings + Uลผyj ustawieล„ imion + + + Always Show All + Zawsze pokazuj wszystkie + + + + Opcja ta pozwala dostosowaฤ‡ sposรณb wyล›wietlania imion nad gล‚owami graczy. Opcja "Tylko po wciล›niฤ™ciu klawisza" wyล›wietla imiona tylko przytrzymania klawisza "Modyfikator" dostฤ™pnego w menu ustawieล„ addonรณw -> ACE3. + + + + Opcja ta pozwala dostosowaฤ‡ sposรณb wyล›wietlania efektu fal dลบwiฤ™kowych nad gล‚owami mรณwiฤ…cych graczy, wyล›wietlanych po przytrzymaniu klawisza PTT. Opcja ta wspรณล‚pracuje z TFAR oraz ACRE2. + diff --git a/addons/optionsmenu/CfgVehicles.hpp b/addons/optionsmenu/CfgVehicles.hpp index 2a19aa2966..52895acb66 100644 --- a/addons/optionsmenu/CfgVehicles.hpp +++ b/addons/optionsmenu/CfgVehicles.hpp @@ -1,9 +1,8 @@ class CfgVehicles { class ACE_Module; - // TODO localization for all the modules class ACE_moduleAllowConfigExport: ACE_Module { scope = 2; - displayName = "Allow Config Export [ACE]"; + displayName = "$STR_AllowConfigExport_Module_DisplayName"; //icon = ""; category = "ACE"; function = QUOTE(DFUNC(moduleAllowConfigExport)); @@ -13,16 +12,15 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; class Arguments { class allowconfigurationExport { - displayName = "Allow"; - description = "Allow export of all settings to a server config formatted."; + displayName = "$STR_AllowConfigExport_allowconfigurationExport_DisplayName"; + description = "$STR_AllowConfigExport_allowconfigurationExport_Description"; typeName = "BOOL"; defaultValue = 1; }; }; class ModuleDescription { - description = "When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard."; + description = "$STR_AllowConfigExport_Module_Description"; sync[] = {}; }; }; - }; \ No newline at end of file diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index d5de0c1426..3b649aa6c7 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -241,5 +241,49 @@ Escalar o menu de opรงรตes Proporzioni della interfaccia utente + + Allow Config Export [ACE] + Pozwรณl na eksport ustawieล„ [ACE] + + + Allow + Zezwรณl + + + Allow export of all settings to a server config formatted. + Zezwรณl na eksport wszystkich ustawieล„ do formatu konfiguracji serwera. + + + When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard. + Jeลผeli ustawione na zezwรณl, wtedy bฤ™dziesz mieฤ‡ dostฤ™p do ekranu modyfikacji wszystich ustawieล„ i zmiennych ACE, a takลผe bฤ™dziesz mieฤ‡ moลผliwoล›ฤ‡ eksportu tychลผe ustawieล„ do formatu rozpoznawalnego przez userconfig serwera. Klikniฤ™cie opcji Eksportuj skopiuje wszystkie ustawienia do schowka. Dziaล‚a tylko w trybie SP. + + + Hide + Ukryj + + + Top right, downwards + Po prawej u gรณry, w dรณล‚ + + + Top right, to the left + Po prawej u gรณry, do lewej + + + Top left, downwards + Po lewej u gรณry, w dรณล‚ + + + Top left, to the right + Po lewej u gรณry, do prawej + + + Top + Gรณra + + + Bottom + Dรณล‚ + diff --git a/addons/respawn/CfgVehicleClasses.hpp b/addons/respawn/CfgVehicleClasses.hpp index 8d4eeb139c..19ed9fede8 100644 --- a/addons/respawn/CfgVehicleClasses.hpp +++ b/addons/respawn/CfgVehicleClasses.hpp @@ -1,5 +1,5 @@ class CfgVehicleClasses { class GVAR(Rallypoints) { - displayName = "ACE Respawn"; + displayName = "$STR_ACE_Respawn_EditorCategory"; }; }; diff --git a/addons/respawn/CfgVehicles.hpp b/addons/respawn/CfgVehicles.hpp index 2f963a12d3..07ef054b0d 100644 --- a/addons/respawn/CfgVehicles.hpp +++ b/addons/respawn/CfgVehicles.hpp @@ -1,9 +1,12 @@ class CfgVehicles { - class Module_F; + class Logic; + class Module_F: Logic { + class ModuleDescription {}; + }; class ACE_ModuleRespawn: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "Respawn System"; + displayName = "$STR_ACE_Respawn_Module_DisplayName"; function = QFUNC(module); scope = 2; isGlobal = 1; @@ -11,43 +14,60 @@ class CfgVehicles { class Arguments { class SavePreDeathGear { - displayName = "Save Gear?"; - description = "Respawn with the gear a soldier had just before his death?"; + displayName = "$STR_ACE_Respawn_SavePreDeathGear_DisplayName"; + description = "$STR_ACE_Respawn_SavePreDeathGear_Description"; typeName = "BOOL"; - defaultValue = 0; + + class values { + class Yes { name = "$STR_ACE_Respawn_Yes"; value = 1; }; + class No { default = 1; name = "$STR_ACE_Respawn_No"; value = 0; }; + }; }; class RemoveDeadBodiesDisconnected { - displayName = "Remove bodies?"; - description = "Remove player bodies after disconnect?"; + displayName = "$STR_ACE_Respawn_RemoveDeadBodiesDisconnected_DisplayName"; + description = "$STR_ACE_Respawn_RemoveDeadBodiesDisconnected_Description"; typeName = "BOOL"; - defaultValue = 1; + + class values { + class Yes { default = 1; name = "$STR_ACE_Respawn_Yes"; value = 1; }; + class No { name = "$STR_ACE_Respawn_No"; value = 0; }; + }; }; + }; + class ModuleDescription: ModuleDescription { + description = "$STR_ACE_Respawn_Module_Description"; }; }; class ACE_ModuleFriendlyFire: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "Friendly Fire Messages"; + displayName = "$STR_ACE_FriendlyFire_Module_DisplayName"; function = QFUNC(moduleFriendlyFire); scope = 2; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_FriendlyFire_ca.paa)); class Arguments {}; + class ModuleDescription: ModuleDescription { + description = "$STR_ACE_FriendlyFire_Module_Description"; + }; }; class ACE_ModuleRallypoint: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "Rallypoint System"; + displayName = "$STR_ACE_Rallypoint_Module_DisplayName"; function = QFUNC(moduleRallypoint); scope = 2; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_Rallypoint_ca.paa)); class Arguments {}; + class ModuleDescription: ModuleDescription { + description = "$STR_ACE_Rallypoint_Module_Description"; + }; }; // team leader @@ -55,7 +75,7 @@ class CfgVehicles { class CAManBase : Man { class ACE_SelfActions { class ACE_MoveRallypoint { - displayName = "Move Rallypoint"; + displayName = "$STR_ACE_Rallypoint_MoveRallypoint"; condition = QUOTE([ARR_2(_player, side group _player)] call FUNC(canMoveRallypoint)); statement = QUOTE([ARR_2(_player, side group _player)] call FUNC(moveRallypoint)); showDisabled = 0; diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index 539bb4b530..a9965dd2a4 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -145,5 +145,61 @@ Rallypoint Nezรกvislรฝ Ponto de encontro Independente + + Respawn System + System odrodzenia + + + Save Gear? + Zapisaฤ‡ ekwipunek? + + + Respawn with the gear a soldier had just before his death? + Odradzaj z ekwipunkiem jaki ลผoล‚nierz miaล‚ tuลผ przed swojฤ… ล›mierciฤ…? + + + Yes + Tak + + + No + Nie + + + Remove bodies? + Usuwaฤ‡ ciaล‚a? + + + Remove player bodies after disconnect? + Usuwaj ciaล‚a graczy po rozล‚ฤ…czeniu z serwera? + + + + Moduล‚ ten pozwala dostosowaฤ‡ ustawienia odrodzenia (respawnu). + + + Friendly Fire Messages + Wiadomoล›ci Friendly Fire + + + + Uลผycie tego moduล‚u na misji spowoduje wyล›wietlenie wiadomoล›ci na czacie w przypadku, kiedy zostanie popeล‚niony friendly fire - wyล›wietlona zostanie wtedy wiadomoล›ฤ‡ kto kogo zabiล‚. + + + Rallypoint System + System punktu zbiรณrki + + + + Moduล‚ ten pozwala zastosowaฤ‡ na misji "punkt zbiรณrki", do ktรณrego moลผna szybko przeteleportowaฤ‡ siฤ™ z "bazy". Wymaga postawienia odpowiednich obiektรณw na mapie - bazy oraz flagi. Obydwa dostฤ™pne sฤ… w kategorii Puste -> ACE Odrodzenie. + + + Move Rallypoint + Przenieล› punkt zbiรณrki + + + ACE Respawn + ACE Odrodzenie + diff --git a/addons/switchunits/CfgVehicles.hpp b/addons/switchunits/CfgVehicles.hpp index 429970b1a0..1e041a3f4f 100644 --- a/addons/switchunits/CfgVehicles.hpp +++ b/addons/switchunits/CfgVehicles.hpp @@ -3,63 +3,66 @@ class CfgVehicles { class ACE_ModuleSwitchUnits: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "SwitchUnits System"; + displayName = "$STR_ACE_SwitchUnits_Module_DisplayName"; function = FUNC(module); scope = 2; isGlobal = 1; icon = QUOTE(PATHTOF(UI\Icon_Module_SwitchUnits_ca.paa)); class Arguments { class SwitchToWest { - displayName = "Switch to West?"; - description = "Allow switching to west units?"; + displayName = "$STR_ACE_SwitchUnits_SwitchToWest_DisplayName"; + description = "$STR_ACE_SwitchUnits_SwitchToWest_Description"; typeName = "BOOL"; class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; + class Yes {name = "$STR_ACE_SwitchUnits_Yes"; value = 1;}; + class No {default = 1; name = "$STR_ACE_SwitchUnits_Yes"; value = 0;}; }; }; class SwitchToEast { - displayName = "Switch to East?"; - description = "Allow switching to east units?"; + displayName = "$STR_ACE_SwitchUnits_SwitchToEast_DisplayName"; + description = "$STR_ACE_SwitchUnits_SwitchToEast_Description"; typeName = "BOOL"; class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; + class Yes {name = "$STR_ACE_SwitchUnits_Yes"; value = 1;}; + class No {default = 1; name = "$STR_ACE_SwitchUnits_No"; value = 0;}; }; }; class SwitchToIndependent { - displayName = "Switch to Independent?"; - description = "Allow switching to independent units?"; + displayName = "$STR_ACE_SwitchUnits_SwitchToIndependent_DisplayName"; + description = "$STR_ACE_SwitchUnits_SwitchToIndependent_Description"; typeName = "BOOL"; class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; + class Yes {name = "$STR_ACE_SwitchUnits_Yes"; value = 1;}; + class No {default = 1; name = "$STR_ACE_SwitchUnits_No"; value = 0;}; }; }; class SwitchToCivilian { - displayName = "Switch to Civilian?"; - description = "Allow switching to civilian units?"; + displayName = "$STR_ACE_SwitchUnits_SwitchToCivilian_DisplayName"; + description = "$STR_ACE_SwitchUnits_SwitchToCivilian_Description"; typeName = "BOOL"; class values { - class Yes {name = "Yes"; value = 1;}; - class No {default = 1; name = "No"; value = 0;}; + class Yes {name = "$STR_ACE_SwitchUnits_Yes"; value = 1;}; + class No {default = 1; name = "$STR_ACE_SwitchUnits_No"; value = 0;}; }; }; class EnableSafeZone { - displayName = "Enable Safe Zone?"; - description = "Enable a safe zone around enemy units? Players can't switch to units inside of the safe zone."; + displayName = "$STR_ACE_SwitchUnits_EnableSafeZone_DisplayName"; + description = "$STR_ACE_SwitchUnits_EnableSafeZone_Description"; typeName = "BOOL"; class values { - class Yes {default = 1; name = "Yes"; value = 1;}; - class No {name = "No"; value = 0;}; + class Yes {default = 1; name = "$STR_ACE_SwitchUnits_Yes"; value = 1;}; + class No {name = "$STR_ACE_SwitchUnits_No"; value = 0;}; }; }; class SafeZoneRadius { - displayName = "Safe Zone Radius"; - description = "The safe zone around players from a different team. Default: 200"; + displayName = "$STR_ACE_SwitchUnits_SafeZoneRadius_DisplayName"; + description = "$STR_ACE_SwitchUnits_SafeZoneRadius_Description"; typeName = "NUMBER"; defaultValue = 100; }; + }; + class ModuleDescription { + description = "$STR_ACE_SwitchUnits_Module_Description"; }; }; -}; +}; \ No newline at end of file diff --git a/addons/switchunits/stringtable.xml b/addons/switchunits/stringtable.xml index 8121e3e61e..c1e7fc2d57 100644 --- a/addons/switchunits/stringtable.xml +++ b/addons/switchunits/stringtable.xml @@ -25,5 +25,69 @@ Questa unitร  รจ troppo vicina al nemico. Essa unidade estรก muito perta do inimigo. + + Yes + Tak + + + No + Nie + + + SwitchUnits System + System zmiany stron + + + Switch to West? + Zmiana na Zachรณd? + + + Allow switching to west units? + Pozwoliฤ‡ zmieniaฤ‡ graczom stronฤ™ na Zachรณd? + + + Switch to East? + Zmiana na Wschรณd? + + + Allow switching to east units? + Pozwoliฤ‡ zmieniaฤ‡ graczom stronฤ™ na Wschรณd? + + + Switch to Independent? + Zmiana na Ruch Oporu? + + + Allow switching to independent units? + Pozwoliฤ‡ zmieniaฤ‡ stronฤ™ na Ruch Oporu? + + + Switch to Civilian? + Zmiana na Cywili? + + + Allow switching to civilian units? + Pozwoliฤ‡ zmieniaฤ‡ stronฤ™ na Cywili? + + + Enable Safe Zone? + Aktywuj bezp. strefฤ™? + + + Enable a safe zone around enemy units? Players can't switch to units inside of the safe zone. + Aktywuje bezpiecznฤ… strefฤ™ wokรณล‚ jednostek przeciwnika. Gracze nie mogฤ… zmieniaฤ‡ strony wewnฤ…trz tej strefy. + + + Safe Zone Radius + Promieล„ bezp. strefy + + + The safe zone around players from a different team. Default: 200 + Promieล„ bezpiecznej strefy wokรณล‚ graczy z innych druลผyn. Domyล›lnie: 200 + + + + + diff --git a/addons/vehiclelock/CfgVehicles.hpp b/addons/vehiclelock/CfgVehicles.hpp index 94bcf34317..8436657676 100644 --- a/addons/vehiclelock/CfgVehicles.hpp +++ b/addons/vehiclelock/CfgVehicles.hpp @@ -69,7 +69,7 @@ class CfgVehicles { class ACE_VehicleLock_ModuleSetup: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "Vehicle Lock Setup"; + displayName = "$STR_ACE_VehicleLock_Module_DisplayName"; function = QFUNC(moduleInit); scope = 2; isGlobal = 0; @@ -77,37 +77,37 @@ class CfgVehicles { functionPriority = 0; class Arguments { class LockVehicleInventory { - displayName = "Lock Vehicle Inventory"; - description = "Locks the inventory of locked vehicles"; + displayName = "$STR_ACE_VehicleLock_LockVehicleInventory_DisplayName"; + description = "$STR_ACE_VehicleLock_LockVehicleInventory_Description"; typeName = "BOOL"; defaultValue = 0; }; class VehicleStartingLockState { - displayName = "Vehicle Starting Lock State"; // Argument label - description = "Set lock state for all vehicles (removes ambiguous lock states)"; // Tooltip description + displayName = "$STR_ACE_VehicleLock_VehicleStartingLockState_DisplayName"; // Argument label + description = "$STR_ACE_VehicleLock_VehicleStartingLockState_Description"; // Tooltip description typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" class values { - class None {name = "As Is"; value = 0; default = 1;}; - class Side {name = "Locked"; value = 1;}; - class Unique {name = "Unlocked"; value = 2;}; + class None {name = "$STR_ACE_VehicleLock_VehicleStartingLockState_AsIs"; value = 0; default = 1;}; + class Side {name = "$STR_ACE_VehicleLock_VehicleStartingLockState_Locked"; value = 1;}; + class Unique {name = "$STR_ACE_VehicleLock_VehicleStartingLockState_Unlocked"; value = 2;}; }; }; class DefaultLockpickStrength { - displayName = "Default Lockpick Strength"; - description = "Default Time to lockpick (in seconds). Default: 10"; + displayName = "$STR_ACE_VehicleLock_DefaultLockpickStrength_DisplayName"; + description = "$STR_ACE_VehicleLock_DefaultLockpickStrength_Description"; typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" defaultValue = "10"; // Default text filled in the input box }; }; class ModuleDescription: ModuleDescription { - description = "Settings for lockpick strength and initial vehicle lock state. Removes ambiguous lock states.
Source: vehiclelock.pbo"; + description = "$STR_ACE_VehicleLock_Module_Description"; }; }; class ACE_VehicleLock_ModuleSyncedAssign: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "Vehicle Key Assign"; + displayName = "$STR_ACE_VehicleLock_VehicleKeyAssign_Module_DisplayName"; function = QFUNC(moduleSync); scope = 2; isGlobal = 0; @@ -115,8 +115,8 @@ class CfgVehicles { functionPriority = 0; class Arguments {}; class ModuleDescription: ModuleDescription { - description = "Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Only valid for objects present at mission start.
Source: vehiclelock.pbo"; + description = "$STR_ACE_VehicleLock_VehicleKeyAssign_Module_Description"; sync[] = {"AnyPlayer", "AnyVehicle"}; }; }; -}; +}; \ No newline at end of file diff --git a/addons/vehiclelock/stringtable.xml b/addons/vehiclelock/stringtable.xml index 6ccfc8347b..4738d045df 100644 --- a/addons/vehiclelock/stringtable.xml +++ b/addons/vehiclelock/stringtable.xml @@ -133,5 +133,57 @@ Una chaive che apr ela maggior parte dei veicoli civili Uma chave que abre a maioria dos veรญculos civis. + + Vehicle Lock Setup + Ustawienie blokady pojazdรณw + + + Lock Vehicle Inventory + Zablokuj ekwipunek pojazdu + + + Locks the inventory of locked vehicles + Blokuje dostฤ™p do ekwipunku pojazdu + + + Vehicle Starting Lock State + Poczฤ…tkowy stan blok. poj. + + + Set lock state for all vehicles (removes ambiguous lock states) + Ustawia poczฤ…tkowy stan blokady dla wszystkich pojazdรณw (usuwa dwuznaczne stany blokady) + + + As Is + Jak jest + + + Locked + Zablokowany + + + Unlocked + Odblokowany + + + Default Lockpick Strength + Czas wล‚amywania + + + Default Time to lockpick (in seconds). Default: 10 + Domyล›lny czas potrzebny na otwarcie pojazdu (w sekundach). Domyล›lnie: 10 + + + Settings for lockpick strength and initial vehicle lock state. Removes ambiguous lock states.<br />Source: vehiclelock.pbo + Ustawienia czasu wล‚amywania oraz domyล›lnego stanu blokady pojazdรณw. Wyล‚ฤ…cza dwuznaczne ustawienia blokady. Moduล‚ ten umoลผliwia wiฤ™c np. zamkniฤ™cie pojazdรณw przeciwnika na klucz tak, ลผe gracze bez odpowiedniego sprzฤ™tu (wytrycha) nie bฤ™dฤ… mogli ich uลผywaฤ‡.<br />ลนrรณdล‚o: vehiclelock.pbo + + + Vehicle Key Assign + Przydziaล‚ kluczyka do pojazdu + + + Sync with vehicles and players. Will handout custom keys to players for every synced vehicle. Only valid for objects present at mission start.<br />Source: vehiclelock.pbo + Zsynchronizuj z pojazdami i graczami. Rozda klucze dla graczy dla kaลผdego zsynchronizowanego pojazdu. Dziaล‚a tylko na pojazdy obecne na misji od samego poczฤ…tku (postawione w edytorze).<br />ลนrรณdล‚o: vehiclelock.pbo + diff --git a/addons/weather/CfgVehicles.hpp b/addons/weather/CfgVehicles.hpp index 3de925e446..d2b5bddcba 100644 --- a/addons/weather/CfgVehicles.hpp +++ b/addons/weather/CfgVehicles.hpp @@ -2,7 +2,7 @@ class CfgVehicles { class ACE_Module; class GVAR(ModuleSettings): ACE_Module { scope = 2; - displayName = "Weather"; + displayName = "$STR_ACE_Weather_Module_DisplayName"; icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa)); category = "ACE"; function = QUOTE(DFUNC(initModuleSettings)); @@ -12,41 +12,44 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; class Arguments { class enableServerController { - displayName = "Weather propagation"; - description = "Enables sever side weather propagation"; + displayName = "$STR_ACE_Weather_enableServerController_DisplayName"; + description = "$STR_ACE_Weather_enableServerController_Description"; typeName = "BOOL"; defaultValue = 1; }; class useACEWeather { - displayName = "ACE Weather"; - description = "Overrides the default weather (editor, mission settings) with ACE weather (map based)"; + displayName = "$STR_ACE_Weather_useACEWeather_DisplayName"; + description = "$STR_ACE_Weather_useACEWeather_Description"; typeName = "BOOL"; defaultValue = 1; }; class syncRain { - displayName = "Sync Rain"; - description = "Synchronizes rain"; + displayName = "$STR_ACE_Weather_syncRain_DisplayName"; + description = "$STR_ACE_Weather_syncRain_Description"; typeName = "BOOL"; defaultValue = 1; }; class syncWind { - displayName = "Sync Wind"; - description = "Synchronizes wind"; + displayName = "$STR_ACE_Weather_syncWind_DisplayName"; + description = "$STR_ACE_Weather_syncWind_Description"; typeName = "BOOL"; defaultValue = 1; }; class syncMisc { - displayName = "Sync Misc"; - description = "Synchronizes lightnings, rainbow, fog, ..."; + displayName = "$STR_ACE_Weather_syncMisc_DisplayName"; + description = "$STR_ACE_Weather_syncMisc_Description"; typeName = "BOOL"; defaultValue = 1; }; class serverUpdateInterval { - displayName = "Update Interval"; - description = "Defines the interval (seconds) between weather updates"; + displayName = "$STR_ACE_Weather_serverUpdateInterval_DisplayName"; + description = "$STR_ACE_Weather_serverUpdateInterval_Description"; typeName = "NUMBER"; defaultValue = 60; }; }; + class ModuleDescription { + description = "$STR_ACE_Weather_Module_Description"; + }; }; -}; +}; \ No newline at end of file diff --git a/addons/weather/stringtable.xml b/addons/weather/stringtable.xml index 2008fc7bc1..02c0964e03 100644 --- a/addons/weather/stringtable.xml +++ b/addons/weather/stringtable.xml @@ -13,5 +13,61 @@ Zobrazit informace o vฤ›tru Mostrar informaรงรฃo do vento + + Weather + Pogoda + + + Multiplayer synchronized ACE weather module + Synchronizowana pogoda ACE + + + Weather propagation + Zmiany pogody + + + Enables server side weather propagation + Aktywuje zmiany pogody po stronie serwera + + + ACE Weather + Pogoda ACE + + + Overrides the default weather (editor, mission settings) with ACE weather (map based) + Nadpisuje domyล›lne ustawienia pogody (edytor, wywiad) przy uลผyciu pogody ACE (zaleลผna od mapy) + + + Sync Rain + Synchronizuj deszcz + + + Synchronizes rain + Synchronizuje deszcz + + + Sync Wind + Synchronizuj wiatr + + + Synchronizes wind + Synchronizuje wiatr + + + Sync Misc + Synchronizuj rรณลผne + + + Synchronizes lightnings, rainbow, fog, ... + Synchronizuje pioruny, tฤ™cze, mgล‚ฤ™, ... + + + Update Interval + Interwaล‚ aktualizacji + + + Defines the interval (seconds) between weather updates + Okreล›la interwaล‚ (sekundy) pomiฤ™dzy aktualizacjami pogody + \ No newline at end of file diff --git a/addons/winddeflection/CfgVehicles.hpp b/addons/winddeflection/CfgVehicles.hpp index 1c24c0a386..2ce9421071 100644 --- a/addons/winddeflection/CfgVehicles.hpp +++ b/addons/winddeflection/CfgVehicles.hpp @@ -2,7 +2,7 @@ class CfgVehicles { class ACE_Module; class GVAR(ModuleSettings): ACE_Module { scope = 2; - displayName = "Wind Deflection"; + displayName = "$STR_ACE_WEATHER_WINDDEFLECTION_DISPLAYNAME"; //WIND DEFLECTION icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa)); category = "ACE"; function = QUOTE(DFUNC(initModuleSettings)); @@ -12,29 +12,32 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; class Arguments { class enabled { - displayName = "Wind Deflection"; - description = "Enables wind deflection"; + displayName = "$STR_ACE_WEATHER_DEFLECTIONMODULE_DISPLAYNAME"; + description = "$STR_ACE_WEATHER_DEFLECTIONMODULE_DESCRIPTION"; typeName = "BOOL"; defaultValue = 1; }; class vehicleEnabled { - displayName = "Vehicle Enabled"; - description = "Enables wind deflection for static/vehicle gunners"; + displayName = "$STR_ACE_WEATHER_VEHICLEENABLED_DISPLAYNAME"; + description = "$STR_ACE_WEATHER_VEHICLEENABLED_DESCRIPTION"; typeName = "BOOL"; defaultValue = 1; }; class simulationInterval { - displayName = "Simulation Interval"; - description = "Defines the interval between every calculation step"; + displayName = "$STR_ACE_WEATHER_SIMULATIONINTERVAL_DISPLAYNAME"; + description = "$STR_ACE_WEATHER_SIMULATIONINTERVAL_DESCRIPTION"; typeName = "NUMBER"; defaultValue = 0.05; }; class simulationRadius { - displayName = "Simulation Radius"; - description = "Defines the radius around the player (in meters) at which projectiles are wind deflected"; + displayName = "$STR_ACE_WEATHER_SIMULATIONRADIUS_DISPLAYNAME"; + description = "$STR_ACE_WEATHER_SIMULATIONRADIUS_DESCRIPTION"; typeName = "NUMBER"; defaultValue = 3000; }; }; + class ModuleDescription { + description = "$STR_ACE_WEATHER_WINDDEFLECTION_DESCRIPTION"; + }; }; -}; +}; \ No newline at end of file diff --git a/addons/winddeflection/stringtable.xml b/addons/winddeflection/stringtable.xml index 4ebcc81bee..515591bd32 100644 --- a/addons/winddeflection/stringtable.xml +++ b/addons/winddeflection/stringtable.xml @@ -62,6 +62,46 @@ Umiditร : %1% Humidade: %1% + + Wind Deflection + Wpล‚yw wiatru + + + Wind Deflection + Wpล‚yw wiatru + + + Enables wind deflection + Aktywuje wpล‚yw wiatru na trajektoriฤ™ lotu pociskรณw + + + Vehicle Enabled + Wล‚ฤ…czone dla pojazdรณw + + + Enables wind deflection for static/vehicle gunners + Aktywuje wpล‚yw wiatru na trajektoriฤ™ lotu pociskรณw dla broni statycznej i na pojazdach + + + Simulation Interval + Interwaล‚ symulacji + + + Defines the interval between every calculation step + Okreล›la interwaล‚ pomiฤ™dzy kaลผdym krokiem kalkulacji + + + Simulation Radius + Zasiฤ™g symulacji + + + Defines the radius around the player (in meters) at which projectiles are wind deflected + Okreล›la obszar naokoล‚o gracza (w metrach), na ktรณrym pociski sฤ… znoszone przez wiatr + + + Wind influence on projectiles trajectory + Wpล‚yw wiatru na trajektoriฤ™ lotu pociskรณw + From 156bba33213e09f8a6a9368d86ae6fdad151ed2f Mon Sep 17 00:00:00 2001 From: Grzegorz Sikora Date: Sat, 9 May 2015 20:37:57 +0200 Subject: [PATCH 117/172] Yes/No to BOOL Conflicts: addons/common/CfgVehicles.hpp addons/common/stringtable.xml addons/explosives/stringtable.xml addons/hearing/CfgVehicles.hpp addons/hearing/stringtable.xml addons/interaction/stringtable.xml addons/map/CfgVehicles.hpp addons/map/stringtable.xml addons/medical/CfgVehicles.hpp addons/medical/stringtable.xml addons/nametags/stringtable.xml addons/respawn/stringtable.xml addons/switchunits/CfgVehicles.hpp addons/switchunits/stringtable.xml Conflicts: addons/common/CfgVehicles.hpp addons/common/stringtable.xml addons/explosives/stringtable.xml addons/hearing/stringtable.xml addons/interaction/stringtable.xml addons/map/CfgVehicles.hpp addons/map/stringtable.xml addons/medical/CfgVehicles.hpp addons/medical/stringtable.xml addons/nametags/stringtable.xml addons/respawn/stringtable.xml addons/switchunits/CfgVehicles.hpp addons/switchunits/stringtable.xml --- addons/common/CfgVehicles.hpp | 14 ++------- addons/common/stringtable.xml | 22 +++++--------- addons/explosives/CfgModule.hpp | 24 ++------------- addons/explosives/stringtable.xml | 24 +++++---------- addons/hearing/CfgVehicles.hpp | 11 +++---- addons/hearing/stringtable.xml | 12 ++------ addons/interaction/CfgVehicles.hpp | 5 +--- addons/interaction/stringtable.xml | 38 +++++++---------------- addons/map/CfgVehicles.hpp | 26 ++++------------ addons/map/stringtable.xml | 8 ----- addons/medical/CfgVehicles.hpp | 44 ++++----------------------- addons/medical/stringtable.xml | 48 ++++++++++-------------------- addons/nametags/CfgVehicles.hpp | 5 +--- addons/nametags/stringtable.xml | 34 ++++++++------------- addons/respawn/CfgVehicles.hpp | 12 ++------ addons/respawn/stringtable.xml | 10 ------- addons/switchunits/CfgVehicles.hpp | 25 ++++------------ addons/switchunits/stringtable.xml | 8 ----- 18 files changed, 85 insertions(+), 285 deletions(-) diff --git a/addons/common/CfgVehicles.hpp b/addons/common/CfgVehicles.hpp index 70d84b376c..65bf2d7058 100644 --- a/addons/common/CfgVehicles.hpp +++ b/addons/common/CfgVehicles.hpp @@ -61,17 +61,7 @@ class CfgVehicles { displayName = "$STR_ACE_Common_CheckPBO_CheckAll_DisplayName"; description = "$STR_ACE_Common_CheckPBO_CheckAll_Description"; typeName = "BOOL"; - class values { - class WarnOnce { - default = 1; - name = "$STR_ACE_Common_CheckPBO_CheckAll_No"; - value = 0; - }; - class Warn { - name = "$STR_ACE_Common_CheckPBO_CheckAll_Yes"; - value = 1; - }; - }; + defaultValue = 0; }; class Whitelist { displayName = "$STR_ACE_Common_CheckPBO_Whitelist_DisplayName"; @@ -134,4 +124,4 @@ class CfgVehicles { }; }; }; -}; +}; \ No newline at end of file diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 4ddc0112d8..5b908a9133 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -275,7 +275,7 @@ Dรฉsactiver menu commande ะ’ั‹ะบะปัŽั‡ะธั‚ัŒ ะบะพะผะฐะฝะดะฝะพะต ะผะตะฝัŽ Parancsnoki menรผ kikapcsolรกsa - Disabilita menรน di comando + Disabilita Menรน di comando Desabilitar menu de comando @@ -308,11 +308,11 @@ Aceptar peticiones Akceptuj proล›by Pล™ijmout ลพรกdost + Accetta Richieste Accepter requรชte ะŸั€ะธะฝัั‚ัŒ ะทะฐะฟั€ะพัั‹ Kรฉrรฉsek elfogadรกsa Aceitar Pedido - Accetta la richiesta Decline Requests @@ -320,11 +320,11 @@ Rechazar peticiones Ignoruj proล›by Zamรญtnout ลพรกdost + Rifiuta Richieste ะžั‚ะบะปะพะฝะธั‚ัŒ ะทะฐะฟั€ะพัั‹ Rejeter requรชte Kรฉrรฉsek elutasรญtรกsa Rejeitar pedido - Rifiuta la richiesta Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions. @@ -402,7 +402,7 @@ Hint Background color Hintergrundfarbe der Hinweise Color de fondo de las notificaciones - Colore di sfondo dei suggerimenti + Colore di sfondo dei Suggerimenti ะฆะฒะตั‚ ั„ะพะฝะฐ ะฒัะฟะปั‹ะฒะฐัŽั‰ะธั… ะฟะพะดัะบะฐะทะพะบ Kolor tล‚a powiadomieล„ Notification: couleur de l'arriรจre plan @@ -414,7 +414,7 @@ The color of the background from the ACE hints. Die Hintergrundfarbe der ACE-Hinweise. El color de fondo de las notificaciones del ACE - Il colore di sfondo dei suggerimenti di ACE. + Il colore di sfondo dei suggerimenti dell'ACE. ะฆะฒะตั‚ ั„ะพะฝะฐ ะฒัะฟะปั‹ะฒะฐัŽั‰ะธั… ะฟะพะดัะบะฐะทะพะบ ะะกะ•. Kolor tล‚a dla powiadomieล„ ACE Notification ACE: couleur de l'arriรจre plan @@ -426,7 +426,7 @@ Hint text font color Textfarbe der Hinweise Color del texto de las notificaciones - Il colore del testo dei suggerimenti + Il colore del Testo dei Suggerimenti ะฆะฒะตั‚ ัˆั€ะธั„ั‚ะฐ ะฒัะฟะปั‹ะฒะฐัŽั‰ะธั… ะฟะพะดัะบะฐะทะพะบ Kolor tekstu powiadomieล„ Notification: couleur du texte @@ -438,7 +438,7 @@ 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. Wรคhle die Textfarbe fรผr ACE-Hinweise. Die gewรคhlte Farbe wird als Standartfarbe der Hinweise angezeigt, wenn der Hinweis selbst keine spezifische Farbe hat. El color del texto de las notificaciones del ACE. Este es el color predeterminado para todo el texto que se muestra a travรฉs del sistema de notificaciones del ACE, si el texto de notificaciรณn no tiene otro color especificado. - Il colore del testo dei suggerimenti di ACE. Questo รจ il colore predefinito per tutto il testo mostrato dal sistema di suggerimenti di ACE quando il colore del testo non ha altro colore specificato. + Il colore del testo dei suggerimenti dell'ACE. Questo รจ il colore standard per tutti i caratteri mostrati dal sistema di suggerimenti dell'ACE, se il colore del testo non รจ specificato. ะฆะฒะตั‚ ัˆั€ะธั„ั‚ะฐ ั‚ะตะบัั‚ะฐ ะฒัะฟะปั‹ะฒะฐัŽั‰ะธั… ะฟะพะดัะบะฐะทะพะบ ะะกะ•. ะญั‚ะพั‚ ั†ะฒะตั‚ ัะฒะปัะตั‚ัั ัั‚ะฐะฝะดะฐั€ั‚ะฝั‹ะผ ะดะปั ะฒัะตะณะพ ั‚ะตะบัั‚ะฐ, ั‚ั€ะฐะฝัะปะธั€ัƒัŽั‰ะตะณะพัั ั‡ะตั€ะตะท ัะธัั‚ะตะผัƒ ะฟะพะดัะบะฐะทะพะบ ะะกะ•, ะตัะปะธ ะฝะต ัƒัั‚ะฐะฝะพะฒะปะตะฝะพ ะดั€ัƒะณะพะณะพ ั†ะฒะตั‚ะฐ ะดะปั ั‚ะตะบัั‚ะฐ ะฟะพะดัะบะฐะทะพะบ. Kolor tekstu dla powiadomieล„ ACE. Ten kolor jest domyล›lnym dla wszystkich tekstรณw wyล›wietlanych poprzez System Powiadomieล„ ACE, jeลผeli dla powiadomienia nie okreล›lono innego koloru. Notification ACE: couleur du texte. C'est la couleur par dรฉfaut de tout texte affichรฉ dans les notifications ACE, si aucune couleur n'est spรฉcifiรฉe pour les notifications @@ -506,14 +506,6 @@ Check all addons instead of only those of ACE? Sprawdzaj wszystkie addony czy tylko te z ACE? - - No - Tylko ACE - - - Yes - Wszystkie - Whitelist Biaล‚a lista diff --git a/addons/explosives/CfgModule.hpp b/addons/explosives/CfgModule.hpp index 50b59fc55d..9159babc2d 100644 --- a/addons/explosives/CfgModule.hpp +++ b/addons/explosives/CfgModule.hpp @@ -15,33 +15,13 @@ class ACE_ModuleExplosive: Module_F { displayName = "$STR_ACE_Explosive_RequireSpecialist_DisplayName"; description = "$STR_ACE_Explosive_RequireSpecialist_Description"; typeName = "BOOL"; - class values { - class Yes { - name = "$STR_ACE_Explosive_Yes"; - value = 1; - }; - class No { - default = 1; - name = "$STR_ACE_Explosive_No"; - value = 0; - }; - }; + defaultValue = 0; }; class PunishNonSpecialists { displayName = "$STR_ACE_Explosive_PunishNonSpecialists_DisplayName"; description = "$STR_ACE_Explosive_PunishNonSpecialists_Description"; typeName = "BOOL"; - class values { - class Yes { - default = 1; - name = "$STR_ACE_Explosive_Yes"; - value = 1; - }; - class No { - name = "$STR_ACE_Explosive_No"; - value = 0; - }; - }; + defaultValue = 1; }; }; class ModuleDescription: ModuleDescription { diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index 5eb5d28512..42b5160030 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -1,4 +1,4 @@ -๏ปฟ + @@ -368,7 +368,7 @@ Wybierz zapalnik Sรฉlectionner une mise ร  feu Zvolit Detonรกtor - Seleziona un attivatore + Seleziona un Attivatore Gyรบjtรณeszkรถz kivรกlasztรกsa Selecionar um Gatilho ะ’ั‹ะฑะตั€ะธั‚ะต ะดะตั‚ะพะฝะฐั‚ะพั€ @@ -392,7 +392,7 @@ Druckplatte Plaque de pression Nรกลกlapnรก nรกstraha - Piastra a pressione + Piastra a Pressione Nyomรณlap Placa de pressรฃo ะะฐะถะธะผะฝะฐั ะฟะปะธั‚ะฐ @@ -404,7 +404,7 @@ Stolperdraht Fil de dรฉtente Nรกstraลพnรฝ drรกt - Filo a inciampo + Filo a Inciampo Botlรณdrรณt Linha de traรงรฃo ะ ะฐัั‚ัะถะบะฐ @@ -440,7 +440,7 @@ Infrarotsensor (Seitenangriff) Capteur IR (de flanc) IR Znaฤkovaฤ (Vรฝbuch stranou) - Sensore IR (attacco laterale) + Sensore IR (Attacco laterale) Infravรถrรถs szenzor (Side Attack) Sensor infravermelho (ataque lateral) ะ˜ะš ัะตะฝัะพั€ (ะดะตั‚ะพะฝะฐั†ะธั ะฒะฑะพะบ) @@ -452,7 +452,7 @@ Magnetfeldsensor (Bodenangriff) Capteur magnรฉtique (par le bas) Magnetickรฝ Senzor (Vรฝbuch ze spoda) - Sensore Magnetico di Prossimitร  (attacco inferiore) + Sensore Magnetico di Prossimitร  (Attacco inferiore) Mรกgneses mezล‘ รฉrzรฉkelล‘ (Bottom Attack) Influรชncia magnรฉtica (ataque inferior) ะœะฐะณะฝะธั‚ะฝั‹ะน ัะตะฝัะพั€ (ะดะตั‚ะพะฝะฐั†ะธั ะฒะฒะตั€ั…) @@ -462,7 +462,7 @@ Keine Sprengladungen auf diesem Auslรถser. Ningรบn explosivo en el detonador. Pas d'explosif ร  mettre ร  feu. - Nessun esplosivo + Nessun esplosivo sul sensore. ลฝรกdnรก vรฝbuลกnina k odpรกlenรญ. Nincs robbanรณanyag a gyรบjtรณeszkรถzhรถz kรถtve. Brak ล‚adunkรณw na zapalnik. @@ -491,7 +491,7 @@ Robbanรณanyagok tรกvoli robbantรกsรกhoz Usado para detonar remotamente o explosivo quando solto. ะ˜ัะฟะพะปัŒะทัƒะตั‚ัั ะดะปั ะดะธัั‚ะฐะฝั†ะธะพะฝะฝะพะณะพ ะฟะพะดั€ั‹ะฒะฐ, ะฟะพัะปะต ัะผะตั€ั‚ะธ ะพะฟะตั€ะฐั‚ะพั€ะฐ. - Usato per attivare a distanza esplosivi al momento del rilascio + Usato per attivare esplosivi al momento del rilascio Pick up @@ -517,14 +517,6 @@ Require explosive specialists to disable explosives? Default: No Wymagaฤ‡ saperรณw do rozbrajania ล‚adunkรณw wybuchowych? Domyล›lnie: Nie - - Yes - Tak - - - No - Nie - Punish non-specialists? Karaj nie-specjalistรณw? diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index d20d067981..6cec04a242 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -98,20 +98,17 @@ class CfgVehicles { class ACE_ModuleHearing: Module_F { author = "$STR_ACE_Common_ACETeam"; category = "ACE"; - displayName = "$STR_ACE_Hearing_Module_DisplayName"; //Hearing + displayName = "$STR_ACE_Hearing_Module_DisplayName"; function = QFUNC(moduleHearing); scope = 2; isGlobal = 1; icon = PATHTOF(UI\Icon_Module_Hearing_ca.paa); class Arguments { class EnableCombatDeafness { - displayName = "$STR_ACE_Hearing_CombatDeafness_DisplayName"; //Enable combat deafness? - description = "$STR_ACE_Hearing_CombatDeafness_Description"; //Enable combat deafness? + displayName = "$STR_ACE_Hearing_CombatDeafness_DisplayName"; + description = "$STR_ACE_Hearing_CombatDeafness_Description"; typeName = "BOOL"; - class values { - class Yes { name = "$STR_ACE_Hearing_CombatDeafness_Yes"; value = 1; default = 1; }; //yes - class No { name = "$STR_ACE_Hearing_CombatDeafness_No"; value = 0; }; //no - }; + defaultValue = 1; }; }; class ModuleDescription { diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index e532768fd9..ae7bea38a2 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -106,7 +106,7 @@ Vypnout pรญskรกnรญ v uลกรญch Wyล‚ฤ…cz dzwonienie w uszach Fรผlcsengรฉs letiltรกsa - Disabilita i fischi nelle orecchie + Disabilita il ronzio Desabilitar zumbido de ouvidos @@ -121,17 +121,9 @@ Enable combat deafness? Moลผliwoล›ฤ‡ chwilowej utraty sล‚uchu przy gล‚oล›nych wystrzaล‚ach i jednoczesnym braku wล‚oลผonych stoperรณw - - Yes - Tak - - - No - Nie - Gล‚uchota bojowa pojawia siฤ™ w momentach, kiedy stoimy w pobliลผu broni wielkokalibrowej bez ochrony sล‚uchu, lub np. podczas ostrzaล‚u artyleryjskiego. Moduล‚ ten pozwala na wล‚ฤ…czenie lub wyล‚ฤ…czenie tego efektu. - + \ No newline at end of file diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 9968c490e1..03466c1986 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -14,10 +14,7 @@ class CfgVehicles { displayName = "$STR_ACE_InteractionSystem_EnableTeamManagement_DisplayName"; description = "$STR_ACE_InteractionSystem_EnableTeamManagement_Description"; typeName = "BOOL"; - class values { - class Yes { default = 1; name = "$STR_ACE_InteractionSystem_EnableTeamManagement_Yes"; value = 1;}; - class No { name = "$STR_ACE_InteractionSystem_EnableTeamManagement_No"; value = 0; }; - }; + defaultValue = 1; }; }; class ModuleDescription { diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 153b94a1d9..0e6e89b74c 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -1,4 +1,4 @@ -๏ปฟ + @@ -119,7 +119,7 @@ ะœะตะฝัŽ ะฒะทะฐะธะผะพะดะตะนัั‚ะฒะธั (ั ัะพะฑะพะน) Cselekvล‘ menรผ (sajรกt) Menu de Interaรงรฃo (Individual) - Menรน interazione (individuale) + Menรน interazione (Individuale) Open / Close Door @@ -263,7 +263,7 @@ ะ–ะตัั‚ั‹ Kรฉzjelek Gestos - Gesti + Segnali gestuali Attack @@ -443,7 +443,7 @@ Nฤ›kdo tฤ› poklepal na PRAVร‰ rameno ะ’ะฐั ะฟะพั…ะปะพะฟะฐะปะธ ะฟะพ ะŸะ ะะ’ะžะœะฃ ะฟะปะตั‡ัƒ Vocรช foi tocado no ombro - Ti รจ stato dato un colpetto sulla spalla destra + Ti รจ stato dato un colpetto sulla spalla You were tapped on the LEFT shoulder. @@ -455,7 +455,7 @@ Nฤ›kdo tฤ› poklepal na LEVร‰ rameno ะ’ะฐั ะฟะพั…ะปะพะฟะฐะปะธ ะฟะพ ะ›ะ•ะ’ะžะœะฃ ะฟะปะตั‡ัƒ Vocรช foi tocado no ombro. - Ti รจ stato dato un colpetto sulla spalla sinistra + Ti รจ stato dato un colpetto sulla spalla Cancel @@ -503,7 +503,7 @@ A fรถldre! ะ›ะพะถะธััŒ! Abaixe-se! - A terra! + A Terra! Team Management @@ -575,7 +575,6 @@ Pล™iล™adit k ฤervenรฝm ะะฐะทะฝะฐั‡ะธั‚ัŒ ะฒ ะšั€ะฐัะฝัƒัŽ ะณั€ัƒะฟะฟัƒ Assigner ร  rouge - Assegna al team rosso Assign Green @@ -587,7 +586,6 @@ Pล™iล™adit k zelenรฝm ะะฐะทะฝะฐั‡ะธั‚ัŒ ะฒ ะ—ะตะปะตะฝัƒัŽ ะณั€ัƒะฟะฟัƒ Assigner ร  vert - Assegna al team verde Assign Blue @@ -599,7 +597,6 @@ Pล™iล™adit k modrรฝm ะะฐะทะฝะฐั‡ะธั‚ัŒ ะฒ ะกะธะฝัŽัŽ ะณั€ัƒะฟะฟัƒ Assigner ร  bleu - Assegna al team blu Assign Yellow @@ -611,7 +608,6 @@ Pล™iล™adit ke ลพlutรฝm ะะฐะทะฝะฐั‡ะธั‚ัŒ ะฒ ะ–ะตะปั‚ัƒัŽ ะณั€ัƒะฟะฟัƒ Assigner ร  jaune - Assegna al team giallo Join Red @@ -623,7 +619,6 @@ Pล™ipojit k ฤervenรฝm ะŸั€ะธัะพะตะดะธะฝะธั‚ัŒัั ะบ ะšั€ะฐัะฝะพะน ะณั€ัƒะฟะฟะต Rejoindre rouge - Unirsi al team rosso Join Green @@ -635,7 +630,6 @@ Pล™ipojit k zelenรฝm ะŸั€ะธัะพะตะดะธะฝะธั‚ัŒัั ะบ ะ—ะตะปะตะฝะพะน ะณั€ัƒะฟะฟะต Rejoindre vert - Unirsi al team verde Join Blue @@ -647,7 +641,6 @@ Pล™ipojit k modrรฝm ะŸั€ะธัะพะตะดะธะฝะธั‚ัŒัั ะบ ะกะธะฝะตะน ะณั€ัƒะฟะฟะต Rejoindre bleu - Unirsi al team blu Join Yellow @@ -659,7 +652,6 @@ Pล™ipojit ke ลพlutรฝm ะŸั€ะธัะพะตะดะธะฝะธั‚ัŒัั ะบ ะ–ั‘ะปั‚ะพะน ะณั€ัƒะฟะฟะต Rejoindre jaune - Unirsi al team giallo You joined Team %1 @@ -729,7 +721,7 @@ Tecla modificadora ะšะปะฐะฒะธัˆะฐ-ะผะพะดะธั„ะธะบะฐั‚ะพั€ Tecla Modificadora - Tasto modifica + Modifica tasto Mรณdosรญtรณ billentyลฑ Modifikรกtor @@ -743,7 +735,7 @@ Hatรณtรกvolsรกgon kรญvรผl Poza zasiฤ™giem Mimo dosah - Fuori limite + Non in raggio Equipment @@ -766,8 +758,8 @@ Odstrฤit Tolรกs ะขะพะปะบะฐั‚ัŒ + Spingi Empurrar - Spingere Interact @@ -778,7 +770,7 @@ Interakcja Interactuar Cselekvรฉs - Interagire + Interagisci Interagir @@ -805,17 +797,9 @@ Should players be allowed to use the Team Management Menu? Default: Yes Czy gracze mogฤ… korzystaฤ‡ z menu zarzฤ…dzania druลผynฤ…? Domyล›lnie: Tak - - Yes - Tak - - - No - Nie - Na zarzฤ…dzanie druลผynฤ… skล‚ada siฤ™: przydziaล‚ kolorรณw dla czล‚onkรณw druลผyny, przejmowanie dowodzenia, doล‚ฤ…czanie/opuszczanie druลผyn. - + \ No newline at end of file diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 150ac23930..849549e3d1 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -13,37 +13,25 @@ class CfgVehicles { displayName = "$STR_ACE_Map_MapIllumination_DisplayName"; description = "$STR_ACE_Map_MapIllumination_Description"; typeName = "BOOL"; - class values { - class Yes { name = "$STR_ACE_Map_Yes"; value = 1; default = 1; }; - class No { name = "$STR_ACE_Map_No"; value = 0; }; - }; + defaultValue = 1; }; class MapShake { displayName = "$STR_ACE_Map_MapShake_DisplayName"; description = "$STR_ACE_Map_MapShake_Description"; typeName = "BOOL"; - class values { - class Yes { name = "$STR_ACE_Map_Yes"; value = 1; default = 1;}; - class No { name = "$STR_ACE_Map_No"; value = 0; }; - }; + defaultValue = 1; }; class MapLimitZoom { displayName = "$STR_ACE_Map_MapLimitZoom_DisplayName"; description = "$STR_ACE_Map_MapLimitZoom_Description"; typeName = "BOOL"; - class values { - class Yes { name = "$STR_ACE_Map_Yes"; value = 1; }; - class No { name = "$STR_ACE_Map_No"; value = 0; default = 1;}; - }; + defaultValue = 0; }; class MapShowCursorCoordinates { displayName = "$STR_ACE_Map_MapShowCursorCoordinates_DisplayName"; description = "$STR_ACE_Map_MapShowCursorCoordinates_Description"; typeName = "BOOL"; - class values { - class Yes { name = "$STR_ACE_Map_Yes"; value = 1; }; - class No { name = "$STR_ACE_Map_No"; value = 0; default = 1;}; - }; + defaultValue = 0; }; }; class ModuleDescription { @@ -63,16 +51,14 @@ class CfgVehicles { class Interval { displayName = "$STR_ACE_Map_BFT_Interval_DisplayName"; description = "$STR_ACE_Map_BFT_Interval_Description"; + typeName = "NUMBER"; defaultValue = 1; }; class HideAiGroups { displayName = "$STR_ACE_Map_BFT_HideAiGroups_DisplayName"; description = "$STR_ACE_Map_BFT_HideAiGroups_Description"; typeName = "BOOL"; - class values { - class Yes { name = "$STR_ACE_Map_Yes"; value = 1; }; - class No { name = "$STR_ACE_Map_No"; value = 0; default = 1; }; - }; + defaultValue = 0; }; }; class ModuleDescription { diff --git a/addons/map/stringtable.xml b/addons/map/stringtable.xml index 0c25016653..c93ff4c286 100644 --- a/addons/map/stringtable.xml +++ b/addons/map/stringtable.xml @@ -13,14 +13,6 @@ Calculate dynamic map illumination based on light conditions? Oblicza dynamiczne oล›wietlenie mapy bazujฤ…ce na warunkach oล›wietleniowych - - Yes - Tak - - - No - Nie - Map shake? Drลผenie mapy diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index aac43de0ed..6c37c5cfd9 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -191,11 +191,8 @@ class CfgVehicles { class consumeItem_PAK { displayName = "$STR_ACE_AdvancedMedicalSettings_consumeItem_PAK_DisplayName"; description = "$STR_ACE_AdvancedMedicalSettings_consumeItem_PAK_Description"; - typeName = "NUMBER"; - class values { - class keep { name = "$STR_ACE_Medical_No"; value = 0; }; - class remove { name = "$STR_ACE_Medical_Yes"; value = 1; default = 1; }; - }; + typeName = "BOOL"; + defaultValue = 1; }; class useLocation_PAK { displayName = "$STR_ACE_AdvancedMedicalSettings_useLocation_PAK_DisplayName"; @@ -336,18 +333,8 @@ class CfgVehicles { class enabled { displayName = "$STR_ACE_AssignMedicVehicle_enabled_DisplayName"; description = "$STR_ACE_AssignMedicVehicle_enabled_Description"; - typeName = "NUMBER"; - class values { - class none { - name = "$STR_ACE_Medical_No"; - value = 0; - }; - class medic { - name = "$STR_ACE_Medical_Yes"; - value = 1; - default = 1; - }; - }; + typeName = "BOOL"; + defaultValue = 1; }; }; class ModuleDescription { @@ -1016,25 +1003,4 @@ class CfgVehicles { }; }; }; -}; - - - - - - - - - - - - - - - - - - - - - +}; \ No newline at end of file diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 50f3d67110..0eb23d57d4 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -83,7 +83,7 @@ Injecter de la morphine Morfium beadรกsa Injetar Morfina - Inietta morfina + Inietta Morfina Transfuse Blood @@ -95,7 +95,7 @@ Transfusion Infรบziรณ (vรฉr) Transfundir Sangue - Trasfusione di sangue + Effettua trasfusione di sangue Transfuse Plasma @@ -106,7 +106,7 @@ Transfuser du Plasma ะŸะตั€ะตะปะธั‚ัŒ ะฟะปะฐะทะผัƒ Infรบziรณ (vรฉrplazma) - Trasfusione di Plasma + Effettua trasfusione di plasma Transfundir Plasma @@ -118,7 +118,7 @@ Transfuser de la solution saline ะŸะตั€ะตะปะธั‚ัŒ ั„ะธะทั€ะฐัั‚ะฒะพั€ Infรบziรณ (sรณs vรญz) - Trasfusione di soluzione salina + Effettua trasfusione di soluzione salina Transfundir Soro @@ -274,7 +274,7 @@ Transfusion de saline ... ะŸะตั€ะตะปะธะฒะฐะฝะธะต ั„ะธะทั€ะฐัั‚ะฒะพั€ะฐ ... Infรบziรณ sรณs vizzel ... - Effettuo la rasfusione di soluzione salina + Effettuo la rasfusione di salina Transfundindo Soro... @@ -370,7 +370,7 @@ QuikClot Hรฉmostatique QuikClot - QuikClot (polvere emostatica) + QuikClot(polvere emostatica) QuikClot @@ -632,7 +632,7 @@ Natychmiastowy Urgence Immรฉdiate Sofort - Okamลพitรฝ + Okamลพiรฝ Azonnali Immediata Imediato @@ -801,7 +801,7 @@ Bandage fait d'un matรฉriel spรฉcial utilisรฉ pour couvrir une blessure, qui peut etre appliquรฉ dรจs que le saignement a รฉtรฉ stoppรฉ. Opatrunek materiaล‚owy, uลผywany do przykrywania ran, zakล‚adany na ranฤ™ po zatamowaniu krwawienia. Egy kรผlรถnleges anyagรบ kรถtszer sebek betakarรกsรกra, amelyet a vรฉrzรฉs elรกllรญtรกsa utรกn helyeznek fel. - Una benda apposita, utilizzata per coprire una ferita, la quale viene applicata su di essa una volta fermata l'emorragia. + Una benda apposita, utilizzata per coprire una ferita, la quale รจ applicata sopra di essa una volta fermata l'emorragia. Uma curativo, material especรญfico para cobrir um ferimento que รฉ aplicado assim que o sangramento รฉ estancando. Obvaz je vhodnรฝm zpลฏsobem upravenรฝ sterilnรญ materiรกl, urฤenรฝ k pล™ekrytรญ rรกny, pล™รญpadnฤ› k fixaci poranฤ›nรญ. @@ -825,7 +825,7 @@ Utilisรฉ pour couvrir des blessures de taille moyenne ร  grande. Arrรชte l'hรฉmorragies Uลผywany w celu opatrywania ล›rednich i duลผych ran oraz tamowania krwawienia. Kรถzepestล‘l nagyig terjedล‘ sebek betakarรกsรกra รฉs vรฉrzรฉs elรกllรญtรกsรกra hasznรกlt kรถtszer - Usato su ferite medie o larghe per fermare emorragie. + Usato su medie o larghe ferite per fermare emorragie. Usado para o preenchimento de cavidades geradas por ferimentos mรฉdios e grandes e estancar o sangramento. Pouลพรญvรก se k zastavenรญ stล™ednรญch aลพ silnฤ›jลกรญch krvรกcenรญ @@ -850,7 +850,7 @@ Bandaลผ (elastyczny) Obvaz (elastickรฝ) Rรถgzรญtรณ kรถtszer - Benda (elastica) + Benda (Elastica) Bandagem (Elรกstica) @@ -861,7 +861,7 @@ Bandage compressif รฉlastique Zestaw bandaลผy elastycznych. Rugalmas kรถtszercsomag, "rรถgzรญtล‘" - Kit di bendaggio, elastico + Kit bendaggio, elastico Kit de Bandagem, Elรกstica Sada obvazลฏ, Elastickรก @@ -873,7 +873,7 @@ Elastyczna opaska podtrzymujฤ…ca opatrunek oraz usztywniajฤ…ca okolice stawรณw. Brinda una compresiรณn uniforme y ofrece soporte extra a una zona lesionada Egyenletes nyomรกst รฉs tรกmogatรกst biztosรญt a sebesรผlt felรผletnek. - Permette di comprimere e aiutare la zone ferita. + Permette di comprimevere e aiutare la zone ferita. Esta bandagem pode ser utilizada para comprimir o ferimento e diminuir o sangramento e garantir que o ferimento nรฃo abra em movimento. Hodรญ se k fixaฤnรญm รบฤelลฏm a to i v oblastech kloubลฏ. @@ -958,7 +958,7 @@ Atropin Autoinjektor Autoinjektor atropin Atropin autoinjektor - Autoiniettore di atropina + Autoiniettore di Atropina Auto-injetor de Atropina @@ -994,7 +994,7 @@ Epiniphrin Autoinjektor Autoinjektor adrenalin Epinefrin autoinjektor - Autoiniettore di epinefrina + Autoiniettore di Epinefrina Auto-injetor de epinefrina @@ -1271,7 +1271,6 @@ Elsล‘segรฉlycsomag, terepen valรณ sebvarrรกshoz รฉs haladรณ ellรกtรกshoz Kit de primeiros socorros para sutura ou tratamentos avanรงados Osobnรญ lรฉkรกrniฤka obsahuje zdravotnickรฝ materiรกl umoลพลˆujรญcรญ ลกitรญ a pokroฤilejลกรญ oลกetล™ovรกnรญ ranฤ›nรฝch v poli - Pronto soccorso personale da campo per mettersi i punti o per trattamenti avanzati. Use Personal Aid Kit @@ -1283,7 +1282,6 @@ Elsล‘segรฉlycsomag hasznรกlata Usar o kit de primeiros socorros Pouลพรญt osobnรญ lรฉkรกrniฤku - Usa il pronto soccorso personale Surgical Kit @@ -1783,7 +1781,7 @@ He's lost some blood - Ha perso sangue + Ha perso molto sangue Ha perdido un poco de sangre ะ•ัั‚ัŒ ะบั€ะพะฒะพะฟะพั‚ะตั€ั Er hat etwas Blut verloren @@ -1803,7 +1801,6 @@ Il a perdu beaucoup de sang Ztratil hodnฤ› krve Ele perdeu muito sangue - Ha perso molto sangue He hasn't lost blood @@ -2247,7 +2244,6 @@ Styl menu (Zdravotnรญ) Estilo do menu (Mรฉdico) Menรผ stรญlusa (Orvosi) - Stile del menรน (medico) Select the type of menu you prefer; default 3d selections or radial. @@ -2259,7 +2255,6 @@ Selecione o tipo de menu que vocรช prefere; padrรฃo seleรงรตes 3d ou radial. Vรกlaszd ki a neked megfelelล‘ menรผt: Alapรฉrtelmezett 3D vรกlogatรกs, vagy kerek. Zvolte typ menu: zรกkladnรญ 3D vรฝbฤ›r nebo kruhovรฝ - Seleziona il tipo di menรน che preferisci: selezione 3d predefinita o radiale. Selections (3d) @@ -2271,7 +2266,6 @@ Seleรงรฃo (3d) Vรกlasztรฉkok (3D) 3D vรฝbฤ›r - Selezione (3D) Radial @@ -2283,7 +2277,6 @@ Radial Kerek Kruhovรฝ - Radiale Scrape @@ -2691,7 +2684,6 @@ Tratando ... Tratando... Oลกetล™uji ... - Curando ... Removing Tourniquet ... @@ -2703,7 +2695,6 @@ ร‰rszorรญtรณ eltรกvolรญtรกsa ... Sundavรกm ลกkrtidlo ... ะกะฝัั‚ะธะต ะถะณัƒั‚ะฐ ... - Togliendo il laccio emostatico ... ACE Medical @@ -2897,14 +2888,6 @@ Should PAK be removed on usage? Czy apteczka osobista powinna zniknฤ…ฤ‡ z ekwipunku po jej uลผyciu? - - No - Nie - - - Yes - Tak - Locations PAK Ogr. apteczek osobistych @@ -3079,3 +3062,4 @@ + \ No newline at end of file diff --git a/addons/nametags/CfgVehicles.hpp b/addons/nametags/CfgVehicles.hpp index 3619df195f..a4ef577ecf 100644 --- a/addons/nametags/CfgVehicles.hpp +++ b/addons/nametags/CfgVehicles.hpp @@ -62,10 +62,7 @@ class CfgVehicles { displayName = "$STR_ACE_NameTags_showCursorTagForVehicles_DisplayName"; description = "$STR_ACE_NameTags_showCursorTagForVehicles_Description"; typeName = "BOOL"; - class values { - class Yes {name = "$STR_ACE_NameTags_Yes"; value = 1;}; - class No {default = 1; name = "$STR_ACE_NameTags_No"; value = 0;}; - }; + defaultValue = 0; }; }; class ModuleDescription: ModuleDescription { diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index 251e8eba9a..070257e807 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -70,8 +70,8 @@ Zobrazit info o posรกdce vozidla ะŸะพะบะฐะทั‹ะฒะฐั‚ัŒ ะธะฝั„ะพั€ะผะฐั†ะธัŽ ะพะฑ ัะบะธะฟะฐะถะต Jรกrmลฑ-legรฉnysรฉg adatainak mutatรกsa + Mostra le informazioni sull'equipaggio del veicolo Mostrar tripulantes - Mostra l'elenco del personale a bordo Show name tags for AI units @@ -82,7 +82,7 @@ Wyล›wietl imiona jednostek AI Afficher les noms des IA Nรฉvcรญmkรฉk mutatรกsa MI-egysรฉgeknรฉl - Mostra i nomi delle le unitร  AI + Mostra le tag nomi per le unitร  AI Mostrar nomes para unidades de IA @@ -94,7 +94,7 @@ Pokaลผ fale dลบwiฤ™kowe (wymagana opcja Pokaลผ imiona graczy) Afficher "qui parle" (si noms affichรฉs) "Hanghullรกmok" mutatรกsa (a nevek mutatรกsa szรผksรฉges) - Mostra movimento audio (richiede mostra nomi abilitato) + Mostra barra movimento audio (richiede mostra nomi abilitato) Mostrar onda sonora (requer nome de jogadores) @@ -106,7 +106,7 @@ Couleur d'affichage par dรฉfaut (si dans aucun groupe) Standardnรญ barva jmenovek (pro neฤleny jednotky) Alap nรฉvcรญmke-szรญn (csoporton kรญvรผli szemรฉlyek) - Colore dei nomi non appartenenti al gruppo + Colore nametag di default (membri non del gruppo) Cor padrรฃo do nome (unidades fora do grupo) @@ -157,51 +157,43 @@ Show cursor NameTag for vehicle commander (only if client has name tags enabled)Default: No Pokazuj imiฤ™ dowรณdcy pojazdu nad pojazdem (tylko jeลผeli klient ma wล‚ฤ…czone imiona graczy). Domyล›lnie: Nie - - Yes - Tak - - - No - Nie - Moduล‚ ten pozwala dostosowaฤ‡ ustawienia i zasiฤ™g wyล›wietlania imion. - + Disabled Wyล‚ฤ…czone - + Enabled Wล‚ฤ…czone - + Only Cursor Tylko pod kursorem - + Only On Keypress Tylko po wciล›niฤ™ciu klawisza - + Only Cursor and KeyPress Tylko pod kursorem i po wciล›niฤ™ciu klawisza - + Use Nametag settings Uลผyj ustawieล„ imion - + Always Show All Zawsze pokazuj wszystkie - + Opcja ta pozwala dostosowaฤ‡ sposรณb wyล›wietlania imion nad gล‚owami graczy. Opcja "Tylko po wciล›niฤ™ciu klawisza" wyล›wietla imiona tylko przytrzymania klawisza "Modyfikator" dostฤ™pnego w menu ustawieล„ addonรณw -> ACE3. - + Opcja ta pozwala dostosowaฤ‡ sposรณb wyล›wietlania efektu fal dลบwiฤ™kowych nad gล‚owami mรณwiฤ…cych graczy, wyล›wietlanych po przytrzymaniu klawisza PTT. Opcja ta wspรณล‚pracuje z TFAR oraz ACRE2. diff --git a/addons/respawn/CfgVehicles.hpp b/addons/respawn/CfgVehicles.hpp index 07ef054b0d..00f0bd4493 100644 --- a/addons/respawn/CfgVehicles.hpp +++ b/addons/respawn/CfgVehicles.hpp @@ -17,22 +17,14 @@ class CfgVehicles { displayName = "$STR_ACE_Respawn_SavePreDeathGear_DisplayName"; description = "$STR_ACE_Respawn_SavePreDeathGear_Description"; typeName = "BOOL"; - - class values { - class Yes { name = "$STR_ACE_Respawn_Yes"; value = 1; }; - class No { default = 1; name = "$STR_ACE_Respawn_No"; value = 0; }; - }; + defaultValue = 0; }; class RemoveDeadBodiesDisconnected { displayName = "$STR_ACE_Respawn_RemoveDeadBodiesDisconnected_DisplayName"; description = "$STR_ACE_Respawn_RemoveDeadBodiesDisconnected_Description"; typeName = "BOOL"; - - class values { - class Yes { default = 1; name = "$STR_ACE_Respawn_Yes"; value = 1; }; - class No { name = "$STR_ACE_Respawn_No"; value = 0; }; - }; + defaultValue = 1; }; }; class ModuleDescription: ModuleDescription { diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index a9965dd2a4..5351d0f3bc 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -35,7 +35,6 @@ Tรฉlรฉportation ร  la base Teletransportar para a Base Bรกzisra teleportรกlรกs - Teleporta alla base Teleport to Rallypoint @@ -47,7 +46,6 @@ Tรฉlรฉporation au point de ralliement Teletransportar para o ponto de encontro Gyรผlekezล‘pontra teleportรกlรกs - Teleporta al rallypoint Teleported to Base @@ -157,14 +155,6 @@ Respawn with the gear a soldier had just before his death? Odradzaj z ekwipunkiem jaki ลผoล‚nierz miaล‚ tuลผ przed swojฤ… ล›mierciฤ…? - - Yes - Tak - - - No - Nie - Remove bodies? Usuwaฤ‡ ciaล‚a? diff --git a/addons/switchunits/CfgVehicles.hpp b/addons/switchunits/CfgVehicles.hpp index 1e041a3f4f..48271c6428 100644 --- a/addons/switchunits/CfgVehicles.hpp +++ b/addons/switchunits/CfgVehicles.hpp @@ -13,46 +13,31 @@ class CfgVehicles { displayName = "$STR_ACE_SwitchUnits_SwitchToWest_DisplayName"; description = "$STR_ACE_SwitchUnits_SwitchToWest_Description"; typeName = "BOOL"; - class values { - class Yes {name = "$STR_ACE_SwitchUnits_Yes"; value = 1;}; - class No {default = 1; name = "$STR_ACE_SwitchUnits_Yes"; value = 0;}; - }; + defaultValue = 0; }; class SwitchToEast { displayName = "$STR_ACE_SwitchUnits_SwitchToEast_DisplayName"; description = "$STR_ACE_SwitchUnits_SwitchToEast_Description"; typeName = "BOOL"; - class values { - class Yes {name = "$STR_ACE_SwitchUnits_Yes"; value = 1;}; - class No {default = 1; name = "$STR_ACE_SwitchUnits_No"; value = 0;}; - }; + defaultValue = 0; }; class SwitchToIndependent { displayName = "$STR_ACE_SwitchUnits_SwitchToIndependent_DisplayName"; description = "$STR_ACE_SwitchUnits_SwitchToIndependent_Description"; typeName = "BOOL"; - class values { - class Yes {name = "$STR_ACE_SwitchUnits_Yes"; value = 1;}; - class No {default = 1; name = "$STR_ACE_SwitchUnits_No"; value = 0;}; - }; + defaultValue = 0; }; class SwitchToCivilian { displayName = "$STR_ACE_SwitchUnits_SwitchToCivilian_DisplayName"; description = "$STR_ACE_SwitchUnits_SwitchToCivilian_Description"; typeName = "BOOL"; - class values { - class Yes {name = "$STR_ACE_SwitchUnits_Yes"; value = 1;}; - class No {default = 1; name = "$STR_ACE_SwitchUnits_No"; value = 0;}; - }; + defaultValue = 0; }; class EnableSafeZone { displayName = "$STR_ACE_SwitchUnits_EnableSafeZone_DisplayName"; description = "$STR_ACE_SwitchUnits_EnableSafeZone_Description"; typeName = "BOOL"; - class values { - class Yes {default = 1; name = "$STR_ACE_SwitchUnits_Yes"; value = 1;}; - class No {name = "$STR_ACE_SwitchUnits_No"; value = 0;}; - }; + defaultValue = 1; }; class SafeZoneRadius { displayName = "$STR_ACE_SwitchUnits_SafeZoneRadius_DisplayName"; diff --git a/addons/switchunits/stringtable.xml b/addons/switchunits/stringtable.xml index c1e7fc2d57..cdde0f8ff1 100644 --- a/addons/switchunits/stringtable.xml +++ b/addons/switchunits/stringtable.xml @@ -25,14 +25,6 @@ Questa unitร  รจ troppo vicina al nemico. Essa unidade estรก muito perta do inimigo. - - Yes - Tak - - - No - Nie - SwitchUnits System System zmiany stron From 63c5308cd95a5396626f0986c71c6b9e060ed131 Mon Sep 17 00:00:00 2001 From: Grzegorz Sikora Date: Sat, 9 May 2015 20:43:55 +0200 Subject: [PATCH 118/172] Missed one Yes/no to BOOL --- addons/vehiclelock/CfgVehicles.hpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/addons/vehiclelock/CfgVehicles.hpp b/addons/vehiclelock/CfgVehicles.hpp index 8436657676..60cb67d4c4 100644 --- a/addons/vehiclelock/CfgVehicles.hpp +++ b/addons/vehiclelock/CfgVehicles.hpp @@ -83,9 +83,9 @@ class CfgVehicles { defaultValue = 0; }; class VehicleStartingLockState { - displayName = "$STR_ACE_VehicleLock_VehicleStartingLockState_DisplayName"; // Argument label - description = "$STR_ACE_VehicleLock_VehicleStartingLockState_Description"; // Tooltip description - typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" + displayName = "$STR_ACE_VehicleLock_VehicleStartingLockState_DisplayName"; + description = "$STR_ACE_VehicleLock_VehicleStartingLockState_Description"; + typeName = "NUMBER"; class values { class None {name = "$STR_ACE_VehicleLock_VehicleStartingLockState_AsIs"; value = 0; default = 1;}; class Side {name = "$STR_ACE_VehicleLock_VehicleStartingLockState_Locked"; value = 1;}; @@ -95,8 +95,8 @@ class CfgVehicles { class DefaultLockpickStrength { displayName = "$STR_ACE_VehicleLock_DefaultLockpickStrength_DisplayName"; description = "$STR_ACE_VehicleLock_DefaultLockpickStrength_Description"; - typeName = "NUMBER"; // Value type, can be "NUMBER", "STRING" or "BOOL" - defaultValue = "10"; // Default text filled in the input box + typeName = "NUMBER"; + defaultValue = "10"; }; }; class ModuleDescription: ModuleDescription { From 5bbf875ef28a6afa912936f14e17eac51efc9f5f Mon Sep 17 00:00:00 2001 From: GieNkoV Date: Tue, 12 May 2015 04:54:23 +0200 Subject: [PATCH 119/172] Tabs removed Conflicts: addons/missileguidance/stringtable.xml addons/optionsmenu/stringtable.xml --- addons/missileguidance/stringtable.xml | 226 +++++----- addons/optionsmenu/stringtable.xml | 577 ++++++++++++------------- 2 files changed, 401 insertions(+), 402 deletions(-) diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index 3c551493a5..ef9bdeea26 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -1,113 +1,113 @@ -๏ปฟ - - - - Advanced Missile Guidance - Guiado Avanzado de Misiles - Guidage avancรฉ de missile - Zaawansowane naprowadzanie rakiet - Erweitertes Raketenlenksystem - Pokroฤilรฉ ล™รญzenรญ stล™el - Guida missili avanzata - Avanรงado Missile Guidance - Fejlett rakรฉtairรกnyรญtรณ - ะŸั€ะพะดะฒะธะฝัƒั‚ะพะต ะฝะฐะฒะตะดะตะฝะธะต ั€ะฐะบะตั‚ - - - Advanced missile guidance, or AMG, provides multiple enhancements to missile locking and firing. It is also a framework required for missile weapon types. - Zaawansowane namierzanie rakiet, lub ZNR, dostarcza wiele poprawek do systemu namierzania rakiet oraz dodaje nowe tryby strzaล‚u. Jest to wymagana opcja dla broni rakietowych. - Guida dei missili avanzata, o AMG, offre diversi miglioramenti alla teleguida di missili. E' anche un sistema necessario per i tipi di armi missile. - ะŸั€ะพะดะฒะธะฝัƒั‚ะพะต ะฝะฐะฒะตะดะตะฝะธะต ั€ะฐะบะตั‚, ะธะปะธ ะŸะะ , ะพะฑะตัะฟะตั‡ะธะฒะฐะตั‚ ะผะฝะพะถะตัั‚ะฒะพ ัƒัะพะฒะตั€ัˆะตัั‚ะฒะพะฒะฐะฝะธะน ะดะปั ะฝะฐะฒะตะดะตะฝะธั ะธ ัั‚ั€ะตะปัŒะฑั‹ ั€ะฐะบะตั‚. ะขะฐะบะถะต, ัั‚ะพ ัะธัั‚ะตะผะฐ, ะฝะตะพะฑั…ะพะดะธะผะฐั ะดะปั ะฒัะตั… ั€ะฐะบะตั‚ะฝั‹ั… ั‚ะธะฟะพะฒ ะพั€ัƒะถะธั. - Guiado Avanzado de Misiles, o AMG en sus siglas en inglรฉs, ofrece mรบltiples mejoras en el fijado y disparo de misiles. Es tambiรฉn un sistema requerido para armas de tipo misil. - Das Erweiterte Raketenlenksystem, auch ERls genannt, bietet viele Verbesserungen zum Aufschalten und Feuern mittels gelenkten Raketen. - Le guidage avancรฉ de missile, ou AMG en anglais, apporte de multiple amรฉliorations au verouillage et au tir de missiles. C'est aussi un framework requis pour tout arme de type missile. - A fejlett rakรฉtairรกnyรญtรณ (vagy AMG) tรถbbfรฉle mรณdosรญtรกst tartalmaz a rakรฉtรกk cรฉlkรถvetรฉsรฉhez รฉs tรผzelรฉsรฉhez. Ez egy szรผksรฉges keresztrendszer a rakรฉta-alapรบ fegyverekhez. - Orientaรงรฃo avanรงada de mรญsseis ou OAM, fornece vรกrios aprimoramentos para travamento de mรญsseis e disparos. Tambรฉm รฉ um sistema requerido para disparar armas que utilizem mรญsseis. - Pokoฤilรฉ navรกdฤ›nรญ raket (AMG) poskytuje nฤ›kolik vylepลกenรญ pro lepลกรญ zamฤ›ล™enรญ a nรกslednou stล™elbu. Je to prvek vyลพadovanรฝ u typu zbranรญ jako jsou rakety. - - - Hydra-70 DAGR Missile - Misil Hydra-70 DAGR - Hydra-70 DAGR - Hydra-70 DAGR - Hydra-70 DAGR Rackete - Hydra-70 DAGR - Missile Hydra-70 DAGR - Mรญssil Hydra-70 DAGR - Hydra-70 DAGR rakรฉta - Hydra-70 DAGR - - - DAGR - DAGR - DAGR - DAGR - DAGR - DAGR - DAGR - DAGR - DAGR - DAGR - - - Hydra-70 DAGR Laser Guided Missile - Misil guiado por lรกser Hydra-70 DAGR - Missile ร  guidage laser Hydra-70 DAGR - Laserowo naprowadzana rakieta Hydra-70 DAGR - Hydra-70 DAGR lasergelenkte Rakete - Hydra-70 DAGR laserem navรกdฤ›nรก stล™ela - Hydra-70 DAGR missile guida laser - Mรญssil guiado a laser Hydra-70 DAGR - Hydra-70 DAGR lรฉzer-irรกnyรญtott rakรฉta - ะฃะฟั€ะฐะฒะปัะตะผะฐั ั€ะฐะบะตั‚ะฐ ะปะฐะทะตั€ะฝะพะณะพ ะฝะฐะฒะตะดะตะฝะธั Hydra-70 DAGR - - - Hellfire II AGM-114K Missile - Misil Hellfire II AGM-114K - Hellfire II AGM-114K - Hellfire II AGM-114K - Hellfire II AGM-114K - Hellfire II AGM-114K - Missile Hellfire II AGM-114K - Mรญssil Hellfire II AGM-114K - Hellfire II AGM-114K rakรฉta - Hellfire II AGM-114K - - - AGM-114K - AGM-114K - AGM-114K - AGM-114K - AGM-114K - AGM-114K - AGM-114K - AGM-114K - AGM-114K - AGM-114K - - - Hellfire II AGM-114K Laser Guided Missile - Misil guiado por lรกser Hellfire II AGM-114K - Missile ร  guidage laser Hellfire II AGM-114K - Laserowo naprowadzana rakieta Hellfire II AGM-114K - Hellfire II AGM-114K Lasergelenkte Rakete - Hellfire II AGM-114K laserem navรกdฤ›nรก stล™ela - Missile guida laser Hellfire II AGM-114K - Mรญssil guiado a laser Hellfire II AGM-114K - Hellfire II AGM-114K lรฉzer-irรกnyรญtott rakรฉta - ะฃะฟั€ะฐะฒะปัะตะผะฐั ั€ะฐะบะตั‚ะฐ ะปะฐะทะตั€ะฝะพะณะพ ะฝะฐะฒะตะดะตะฝะธั Hellfire II AGM-114K - - - Off - Wyล‚ฤ…cz - - - Player Only - Tylko gracz - - - Player and AI - Gracz oraz AI - - - +๏ปฟ + + + + Advanced Missile Guidance + Guiado Avanzado de Misiles + Guidage avancรฉ de missile + Zaawansowane naprowadzanie rakiet + Erweitertes Raketenlenksystem + Pokroฤilรฉ ล™รญzenรญ stล™el + Guida missili avanzata + Avanรงado Missile Guidance + Fejlett rakรฉtairรกnyรญtรณ + ะŸั€ะพะดะฒะธะฝัƒั‚ะพะต ะฝะฐะฒะตะดะตะฝะธะต ั€ะฐะบะตั‚ + + + Advanced missile guidance, or AMG, provides multiple enhancements to missile locking and firing. It is also a framework required for missile weapon types. + Zaawansowane namierzanie rakiet, lub ZNR, dostarcza wiele poprawek do systemu namierzania rakiet oraz dodaje nowe tryby strzaล‚u. Jest to wymagana opcja dla broni rakietowych. + Guida dei missili avanzata, o AMG, offre diversi miglioramenti alla teleguida di missili. E' anche un sistema necessario per i tipi di armi missile. + ะŸั€ะพะดะฒะธะฝัƒั‚ะพะต ะฝะฐะฒะตะดะตะฝะธะต ั€ะฐะบะตั‚, ะธะปะธ ะŸะะ , ะพะฑะตัะฟะตั‡ะธะฒะฐะตั‚ ะผะฝะพะถะตัั‚ะฒะพ ัƒัะพะฒะตั€ัˆะตัั‚ะฒะพะฒะฐะฝะธะน ะดะปั ะฝะฐะฒะตะดะตะฝะธั ะธ ัั‚ั€ะตะปัŒะฑั‹ ั€ะฐะบะตั‚. ะขะฐะบะถะต, ัั‚ะพ ัะธัั‚ะตะผะฐ, ะฝะตะพะฑั…ะพะดะธะผะฐั ะดะปั ะฒัะตั… ั€ะฐะบะตั‚ะฝั‹ั… ั‚ะธะฟะพะฒ ะพั€ัƒะถะธั. + Guiado Avanzado de Misiles, o AMG en sus siglas en inglรฉs, ofrece mรบltiples mejoras en el fijado y disparo de misiles. Es tambiรฉn un sistema requerido para armas de tipo misil. + Das Erweiterte Raketenlenksystem, auch ERls genannt, bietet viele Verbesserungen zum Aufschalten und Feuern mittels gelenkten Raketen. + Le guidage avancรฉ de missile, ou AMG en anglais, apporte de multiple amรฉliorations au verouillage et au tir de missiles. C'est aussi un framework requis pour tout arme de type missile. + A fejlett rakรฉtairรกnyรญtรณ (vagy AMG) tรถbbfรฉle mรณdosรญtรกst tartalmaz a rakรฉtรกk cรฉlkรถvetรฉsรฉhez รฉs tรผzelรฉsรฉhez. Ez egy szรผksรฉges keresztrendszer a rakรฉta-alapรบ fegyverekhez. + Orientaรงรฃo avanรงada de mรญsseis ou OAM, fornece vรกrios aprimoramentos para travamento de mรญsseis e disparos. Tambรฉm รฉ um sistema requerido para disparar armas que utilizem mรญsseis. + Pokoฤilรฉ navรกdฤ›nรญ raket (AMG) poskytuje nฤ›kolik vylepลกenรญ pro lepลกรญ zamฤ›ล™enรญ a nรกslednou stล™elbu. Je to prvek vyลพadovanรฝ u typu zbranรญ jako jsou rakety. + + + Hydra-70 DAGR Missile + Misil Hydra-70 DAGR + Hydra-70 DAGR + Hydra-70 DAGR + Hydra-70 DAGR Rackete + Hydra-70 DAGR + Missile Hydra-70 DAGR + Mรญssil Hydra-70 DAGR + Hydra-70 DAGR rakรฉta + Hydra-70 DAGR + + + DAGR + DAGR + DAGR + DAGR + DAGR + DAGR + DAGR + DAGR + DAGR + DAGR + + + Hydra-70 DAGR Laser Guided Missile + Misil guiado por lรกser Hydra-70 DAGR + Missile ร  guidage laser Hydra-70 DAGR + Laserowo naprowadzana rakieta Hydra-70 DAGR + Hydra-70 DAGR lasergelenkte Rakete + Hydra-70 DAGR laserem navรกdฤ›nรก stล™ela + Hydra-70 DAGR missile guida laser + Mรญssil guiado a laser Hydra-70 DAGR + Hydra-70 DAGR lรฉzer-irรกnyรญtott rakรฉta + ะฃะฟั€ะฐะฒะปัะตะผะฐั ั€ะฐะบะตั‚ะฐ ะปะฐะทะตั€ะฝะพะณะพ ะฝะฐะฒะตะดะตะฝะธั Hydra-70 DAGR + + + Hellfire II AGM-114K Missile + Misil Hellfire II AGM-114K + Hellfire II AGM-114K + Hellfire II AGM-114K + Hellfire II AGM-114K + Hellfire II AGM-114K + Missile Hellfire II AGM-114K + Mรญssil Hellfire II AGM-114K + Hellfire II AGM-114K rakรฉta + Hellfire II AGM-114K + + + AGM-114K + AGM-114K + AGM-114K + AGM-114K + AGM-114K + AGM-114K + AGM-114K + AGM-114K + AGM-114K + AGM-114K + + + Hellfire II AGM-114K Laser Guided Missile + Misil guiado por lรกser Hellfire II AGM-114K + Missile ร  guidage laser Hellfire II AGM-114K + Laserowo naprowadzana rakieta Hellfire II AGM-114K + Hellfire II AGM-114K Lasergelenkte Rakete + Hellfire II AGM-114K laserem navรกdฤ›nรก stล™ela + Missile guida laser Hellfire II AGM-114K + Mรญssil guiado a laser Hellfire II AGM-114K + Hellfire II AGM-114K lรฉzer-irรกnyรญtott rakรฉta + ะฃะฟั€ะฐะฒะปัะตะผะฐั ั€ะฐะบะตั‚ะฐ ะปะฐะทะตั€ะฝะพะณะพ ะฝะฐะฒะตะดะตะฝะธั Hellfire II AGM-114K + + + Off + Wyล‚ฤ…cz + + + Player Only + Tylko gracz + + + Player and AI + Gracz oraz AI + + + diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index 3b649aa6c7..f14a97b460 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -1,289 +1,288 @@ -๏ปฟ - - - - ACE Options - ACE Optionen - Opciones ACE - Ustawienia ACE - ACE Nastavenรญ - Options ACE - ACE ะะฐัั‚ั€ะพะนะบะธ - Opรงรตes do ACE - ACE Beรกllรญtรกsok - Opzioni ACE - - - Fix Animation - Behebe Animation - Arreglar animaciรณn - ะคะธะบั ะฐะฝะธะผะฐั†ะธะธ - Opravit animace - Napraw animacjฤ™ - Corriger animation - Animรกciรณk kijavรญtรกsa - Fixa l'animazione - Arrumar Animaรงรฃo - - - Reset All - Alles zurรผcksetzen - Reiniciar todo - ะŸะพะปะฝั‹ะน ัะฑั€ะพั - Vyresetovat vลกe - Resetuj wszystko - Dรฉfaut - Minden visszaรกllรญtรกsa - Resetta tutto - Resetar Tudo - - - Colors - Couleurs - Farben - Colores - ะฆะฒะตั‚ะฐ - Barvy - Kolory - Szรญnek - Colori - Cores - - - Options - Optionen - Opciones - Opcje - Nastavenรญ - Options - ะะฐัั‚ั€ะพะนะบะธ - Opรงรตes - Beรกllรญtรกsok - Opzioni - - - Values - Valores - ะ—ะฝะฐั‡ะตะฝะธั - Hodnoty - Wartoล›ci - Valeurs - Werte - ร‰rtรฉkek - Valori - Valores - - - Yes - Ja - Si - Tak - Ano - Oui - ะ”ะฐ - Igen - Sim - Si - - - No - Nein - No - Nie - Ne - Non - ะะตั‚ - Nem - Nรฃo - No - - - Setting: - Nastavenรญ: - Einstellung: - ะฃัั‚ะฐะฝะพะฒะบะธ: - Ajuste: - Ustaw: - Paramรจtres - Opciรณ: - Parametri: - Opรงรฃo: - - - Export - Exportieren - Exportar - ะญะบัะฟะพั€ั‚ - Exportovat - Eksport - Exporter - Exportรกlรกs - Esporta - Exportar - - - Open Export Menu - ร–ffne Exportmenรผ - Abrir menรบ de exportaciรณn - ะžั‚ะบั€ั‹ั‚ัŒ ะผะตะฝัŽ ัะบัะฟะพั€ั‚ะฐ - Otevล™รญt exportovacรญ menu - Otwรณrz menu eksportowania - Ouvrir le menu d'exportation - Exportรกlรกsi menรผ megnyitรกsa - Apri menรน esportazione - Abrir menu de exportaรงรฃo - - - String input. - Zeichenketteneingabe - Introducir cadena de texto. - ะกั‚ั€ะพั‡ะฝั‹ะน ะฒะฒะพะด. - Wpisywanie tekstu. - Vklรกdรกnรญ textu. - Entrรฉe - String bevitel. - Stringa di unput. - Input de String - - - Array. Seperate elements by using ,. - Array. Teile unterschiedliche Elemente mit ,. - Matriz. Separa elementos usando ,. - ะœะฐััะธะฒ. ะ ะฐะทะดะตะปัะนั‚ะต ัะปะตะผะตะฝั‹, ะธัะฟะพะปัŒะทัƒั ะทะฐะฟัั‚ัƒัŽ. - Tablica. Oddziel elementy uลผywajฤ…c ,. - Tableau. Sรฉparation par ,. - Tabulka. Oddฤ›l elementy pouลพitรญm ,. - Array. Vรกlasszad el az elemeket vesszล‘vel. - Array. Separa gli elementi usando ,. - Vetor. Separe elementos usando *,*. - - - Number - Zahl - Nรบmero - ะงะธัะปะพ - ฤŒรญslo - Cyfra - Nombre - Szรกm - Numero - Nรบmero - - - Uknown input type - Unbekannter Eingabetyp - Tipo de entrada desconocida - ะะตะธะทะฒะตัั‚ะฝั‹ะน ั‚ะธะฟ ะฒะฒะพะดะฐ - Neznรกmรฝ vstup - Nieznany rodzaj danych - Type d'entrรฉe inconnue - Ismeretlen beviteli tรญpus - Input inserito sconosciuto - Tipo desonhecido de input - - - Save input - Speichere Eingabe - Guardar entrada - ะกะพั…ั€ะฐะฝะธั‚ัŒ ะฒะฒะพะด - Uloลพit vstup - Zapisz dane - Sauvegarder - Bevitel elmentรฉse - Salva input - Salvar input - - - Include Client Settings - SchlieรŸe Client-Einstellungen ein - Incluir configuraciรณn de cliente - ะ’ะบะปัŽั‡ะธั‚ัŒ ะฝะฐัั‚ั€ะพะนะบะธ ะบะปะธะตะฝั‚ะฐ - Zahrnout nastavenรญ klienta - Zawrzyj ustawienia klienta - Inclure paramรจtres client - Kliens-beรกllรญtรกsok mellรฉklรฉse - Includi i parametri del client - Incluir opรงรตes do cliente - - - Exclude Client Settings - SchlieรŸe Client-Einstellungen aus - Excluir configuraciรณn de cliente - ะ˜ัะบะปัŽั‡ะธั‚ัŒ ะฝะฐัั‚ั€ะพะนะบะธ ะบะปะธะตะฝั‚ะฐ - Nezahrnout nastavenรญ klienta - Wyklucz ustawienia klienta - Exclure paramรจtres client - Kliens-beรกllรญtรกsok elhagyรกsa - Escludi i parametri del client - Excluir opรงรตes do cliente - - - Settings exported to clipboard - Einstellungen in die Zwischenablage exportiert - Configuraciรณn exportada al portapapeles - ะะฐัั‚ั€ะพะนะบะธ ัะบัะฟะพั€ั‚ะธั€ะพะฒะฐะฝั‹ ะฒ ะฑัƒั„ะตั€ ะพะฑะผะตะฝะฐ - Nastevenรญ exportovรกna do schrรกnky - Ustawienia wyeksportowano do schowka - Paramรจtres exportรฉs dans le presse papier - Beรกllรญtรกsok exportรกlva a vรกgรณlapba - Parametri esportati alla clipboard - Opรงรตes exportadas para o clipboard. - - - Option Menu UI Scaling - Menu option: taille de l'UI - Skalowanie UI menu ustawieล„ - Mฤ›ล™รญtko UI v menu nastavenรญ - ะ ะฐะทะผะตั€ ะธะฝั‚ะตั€ั„ะตะนัะฐ ะผะตะฝัŽ ะฝะฐัั‚ั€ะพะนะบะธ - Opciรณn de escalado del menรบ IU - UI Skalierung - Beรกllรญtรกsmenรผ kezelล‘felรผletรฉnek skรกlรกzรกsa - Escalar o menu de opรงรตes - Proporzioni della interfaccia utente - - - Allow Config Export [ACE] - Pozwรณl na eksport ustawieล„ [ACE] - - - Allow - Zezwรณl - - - Allow export of all settings to a server config formatted. - Zezwรณl na eksport wszystkich ustawieล„ do formatu konfiguracji serwera. - - - When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard. - Jeลผeli ustawione na zezwรณl, wtedy bฤ™dziesz mieฤ‡ dostฤ™p do ekranu modyfikacji wszystich ustawieล„ i zmiennych ACE, a takลผe bฤ™dziesz mieฤ‡ moลผliwoล›ฤ‡ eksportu tychลผe ustawieล„ do formatu rozpoznawalnego przez userconfig serwera. Klikniฤ™cie opcji Eksportuj skopiuje wszystkie ustawienia do schowka. Dziaล‚a tylko w trybie SP. - - - Hide - Ukryj - - - Top right, downwards - Po prawej u gรณry, w dรณล‚ - - - Top right, to the left - Po prawej u gรณry, do lewej - - - Top left, downwards - Po lewej u gรณry, w dรณล‚ - - - Top left, to the right - Po lewej u gรณry, do prawej - - - Top - Gรณra - - - Bottom - Dรณล‚ - - - +๏ปฟ + + + + ACE Options + ACE Optionen + Opciones ACE + Ustawienia ACE + ACE Nastavenรญ + Options ACE + ACE ะะฐัั‚ั€ะพะนะบะธ + Opรงรตes do ACE + ACE Beรกllรญtรกsok + Opzioni ACE + + + Fix Animation + Behebe Animation + Arreglar animaciรณn + ะคะธะบั ะฐะฝะธะผะฐั†ะธะธ + Opravit animace + Napraw animacjฤ™ + Corriger animation + Animรกciรณk kijavรญtรกsa + Fixa l'animazione + Arrumar Animaรงรฃo + + + Reset All + Alles zurรผcksetzen + Reiniciar todo + ะŸะพะปะฝั‹ะน ัะฑั€ะพั + Vyresetovat vลกe + Resetuj wszystko + Dรฉfaut + Minden visszaรกllรญtรกsa + Resetta tutto + Resetar Tudo + + + Colors + Couleurs + Farben + Colores + ะฆะฒะตั‚ะฐ + Barvy + Kolory + Szรญnek + Colori + Cores + + + Options + Optionen + Opciones + Opcje + Nastavenรญ + Options + ะะฐัั‚ั€ะพะนะบะธ + Opรงรตes + Beรกllรญtรกsok + Opzioni + + + Values + Valores + ะ—ะฝะฐั‡ะตะฝะธั + Hodnoty + Wartoล›ci + Valeurs + Werte + ร‰rtรฉkek + Valori + Valores + + + Yes + Ja + Si + Tak + Ano + Oui + ะ”ะฐ + Igen + Sim + Si + + + No + Nein + No + Nie + Ne + Non + ะะตั‚ + Nem + Nรฃo + No + + + Setting: + Nastavenรญ: + Einstellung: + ะฃัั‚ะฐะฝะพะฒะบะธ: + Ajuste: + Ustaw: + Paramรจtres + Opciรณ: + Parametri: + Opรงรฃo: + + + Export + Exportieren + Exportar + ะญะบัะฟะพั€ั‚ + Exportovat + Eksport + Exporter + Exportรกlรกs + Esporta + Exportar + + + Open Export Menu + ร–ffne Exportmenรผ + Abrir menรบ de exportaciรณn + ะžั‚ะบั€ั‹ั‚ัŒ ะผะตะฝัŽ ัะบัะฟะพั€ั‚ะฐ + Otevล™รญt exportovacรญ menu + Otwรณrz menu eksportowania + Ouvrir le menu d'exportation + Exportรกlรกsi menรผ megnyitรกsa + Apri menรน esportazione + Abrir menu de exportaรงรฃo + + + String input. + Zeichenketteneingabe + Introducir cadena de texto. + ะกั‚ั€ะพั‡ะฝั‹ะน ะฒะฒะพะด. + Wpisywanie tekstu. + Vklรกdรกnรญ textu. + Entrรฉe + String bevitel. + Stringa di unput. + Input de String + + + Array. Seperate elements by using ,. + Array. Teile unterschiedliche Elemente mit ,. + Matriz. Separa elementos usando ,. + ะœะฐััะธะฒ. ะ ะฐะทะดะตะปัะนั‚ะต ัะปะตะผะตะฝั‹, ะธัะฟะพะปัŒะทัƒั ะทะฐะฟัั‚ัƒัŽ. + Tablica. Oddziel elementy uลผywajฤ…c ,. + Tableau. Sรฉparation par ,. + Tabulka. Oddฤ›l elementy pouลพitรญm ,. + Array. Vรกlasszad el az elemeket vesszล‘vel. + Array. Separa gli elementi usando ,. + Vetor. Separe elementos usando *,*. + + + Number + Zahl + Nรบmero + ะงะธัะปะพ + ฤŒรญslo + Cyfra + Nombre + Szรกm + Numero + Nรบmero + + + Uknown input type + Unbekannter Eingabetyp + Tipo de entrada desconocida + ะะตะธะทะฒะตัั‚ะฝั‹ะน ั‚ะธะฟ ะฒะฒะพะดะฐ + Neznรกmรฝ vstup + Nieznany rodzaj danych + Type d'entrรฉe inconnue + Ismeretlen beviteli tรญpus + Input inserito sconosciuto + Tipo desonhecido de input + + + Save input + Speichere Eingabe + Guardar entrada + ะกะพั…ั€ะฐะฝะธั‚ัŒ ะฒะฒะพะด + Uloลพit vstup + Zapisz dane + Sauvegarder + Bevitel elmentรฉse + Salva input + Salvar input + + + Include Client Settings + SchlieรŸe Client-Einstellungen ein + Incluir configuraciรณn de cliente + ะ’ะบะปัŽั‡ะธั‚ัŒ ะฝะฐัั‚ั€ะพะนะบะธ ะบะปะธะตะฝั‚ะฐ + Zahrnout nastavenรญ klienta + Zawrzyj ustawienia klienta + Inclure paramรจtres client + Kliens-beรกllรญtรกsok mellรฉklรฉse + Includi i parametri del client + Incluir opรงรตes do cliente + + + Exclude Client Settings + SchlieรŸe Client-Einstellungen aus + Excluir configuraciรณn de cliente + ะ˜ัะบะปัŽั‡ะธั‚ัŒ ะฝะฐัั‚ั€ะพะนะบะธ ะบะปะธะตะฝั‚ะฐ + Nezahrnout nastavenรญ klienta + Wyklucz ustawienia klienta + Exclure paramรจtres client + Kliens-beรกllรญtรกsok elhagyรกsa + Escludi i parametri del client + Excluir opรงรตes do cliente + + + Settings exported to clipboard + Einstellungen in die Zwischenablage exportiert + Configuraciรณn exportada al portapapeles + ะะฐัั‚ั€ะพะนะบะธ ัะบัะฟะพั€ั‚ะธั€ะพะฒะฐะฝั‹ ะฒ ะฑัƒั„ะตั€ ะพะฑะผะตะฝะฐ + Nastevenรญ exportovรกna do schrรกnky + Ustawienia wyeksportowano do schowka + Paramรจtres exportรฉs dans le presse papier + Beรกllรญtรกsok exportรกlva a vรกgรณlapba + Parametri esportati alla clipboard + Opรงรตes exportadas para o clipboard. + + + Option Menu UI Scaling + Menu option: taille de l'UI + Skalowanie UI menu ustawieล„ + Mฤ›ล™รญtko UI v menu nastavenรญ + ะ ะฐะทะผะตั€ ะธะฝั‚ะตั€ั„ะตะนัะฐ ะผะตะฝัŽ ะฝะฐัั‚ั€ะพะนะบะธ + Opciรณn de escalado del menรบ IU + UI Skalierung + Beรกllรญtรกsmenรผ kezelล‘felรผletรฉnek skรกlรกzรกsa + Escalar o menu de opรงรตes + + + Allow Config Export [ACE] + Pozwรณl na eksport ustawieล„ [ACE] + + + Allow + Zezwรณl + + + Allow export of all settings to a server config formatted. + Zezwรณl na eksport wszystkich ustawieล„ do formatu konfiguracji serwera. + + + When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard. + Jeลผeli ustawione na zezwรณl, wtedy bฤ™dziesz mieฤ‡ dostฤ™p do ekranu modyfikacji wszystich ustawieล„ i zmiennych ACE, a takลผe bฤ™dziesz mieฤ‡ moลผliwoล›ฤ‡ eksportu tychลผe ustawieล„ do formatu rozpoznawalnego przez userconfig serwera. Klikniฤ™cie opcji Eksportuj skopiuje wszystkie ustawienia do schowka. Dziaล‚a tylko w trybie SP. + + + Hide + Ukryj + + + Top right, downwards + Po prawej u gรณry, w dรณล‚ + + + Top right, to the left + Po prawej u gรณry, do lewej + + + Top left, downwards + Po lewej u gรณry, w dรณล‚ + + + Top left, to the right + Po lewej u gรณry, do prawej + + + Top + Gรณra + + + Bottom + Dรณล‚ + + + From 44466e8be8c201ba880ee7f806ae9df9842a6122 Mon Sep 17 00:00:00 2001 From: Grzegorz Sikora Date: Tue, 12 May 2015 02:29:32 +0200 Subject: [PATCH 120/172] Remove tabs and repair errors @Glowbal found Conflicts: addons/map/CfgVehicles.hpp addons/medical/CfgVehicles.hpp Conflicts: addons/map/CfgVehicles.hpp addons/medical/CfgVehicles.hpp addons/optionsmenu/stringtable.xml --- addons/captives/stringtable.xml | 8 + addons/common/CfgVehicles.hpp | 8 +- addons/explosives/CfgModule.hpp | 4 +- addons/hearing/CfgVehicles.hpp | 2 +- addons/interaction/CfgVehicles.hpp | 2 +- addons/javelin/CfgVehicles.hpp | 10 +- addons/javelin/CfgWeapons.hpp | 6 +- addons/map/CfgVehicles.hpp | 6 +- addons/medical/CfgVehicles.hpp | 26 +- addons/medical/stringtable.xml | 374 +++++++++++++++- addons/missionmodules/stringtable.xml | 20 +- addons/mk6mortar/script_component.hpp | 4 +- addons/mk6mortar/stringtable.xml | 32 ++ addons/nametags/CfgVehicles.hpp | 2 +- addons/optionsmenu/stringtable.xml | 620 ++++++++++++++------------ addons/respawn/CfgVehicles.hpp | 6 +- addons/switchunits/CfgVehicles.hpp | 4 +- addons/winddeflection/CfgVehicles.hpp | 24 +- addons/winddeflection/stringtable.xml | 20 +- 19 files changed, 824 insertions(+), 354 deletions(-) diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 07cf780e19..0d01cbafc6 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -201,5 +201,13 @@ Sync a unit to make them surrender.<br />Source: ace_captives Zsynchronizuj z jednostkฤ… aby sprawiฤ‡ by siฤ™ poddaล‚a<br />ลนrรณdล‚o: ace_captives + + Make Unit Surrender + Poddaj siฤ™! + + + Sync a unit to make them surrender.<br />Source: ace_captives + Zsynchronizuj z jednostkฤ… aby sprawiฤ‡ by siฤ™ poddaล‚a<br />ลนrรณdล‚o: ace_captives + diff --git a/addons/common/CfgVehicles.hpp b/addons/common/CfgVehicles.hpp index 65bf2d7058..1adf622494 100644 --- a/addons/common/CfgVehicles.hpp +++ b/addons/common/CfgVehicles.hpp @@ -74,7 +74,7 @@ class CfgVehicles { }; class ModuleDescription: ModuleDescription { description = "$STR_ACE_Common_CheckPBO_Description"; - }; + }; }; class ACE_ModuleLSDVehicles: Module_F { @@ -89,8 +89,8 @@ class CfgVehicles { }; class ModuleDescription: ModuleDescription { description = "$STR_ACE_Common_LSDVehicles_Description"; - sync[] = {"AnyVehicle"}; - }; + sync[] = {"AnyVehicle"}; + }; }; class Box_NATO_Support_F; @@ -124,4 +124,4 @@ class CfgVehicles { }; }; }; -}; \ No newline at end of file +}; diff --git a/addons/explosives/CfgModule.hpp b/addons/explosives/CfgModule.hpp index 9159babc2d..52f70ea3af 100644 --- a/addons/explosives/CfgModule.hpp +++ b/addons/explosives/CfgModule.hpp @@ -24,7 +24,7 @@ class ACE_ModuleExplosive: Module_F { defaultValue = 1; }; }; - class ModuleDescription: ModuleDescription { - description = "$STR_ACE_Explosive_Module_Description"; + class ModuleDescription: ModuleDescription { + description = "$STR_ACE_Explosive_Module_Description"; }; }; \ No newline at end of file diff --git a/addons/hearing/CfgVehicles.hpp b/addons/hearing/CfgVehicles.hpp index 6cec04a242..16bb47014a 100644 --- a/addons/hearing/CfgVehicles.hpp +++ b/addons/hearing/CfgVehicles.hpp @@ -111,7 +111,7 @@ class CfgVehicles { defaultValue = 1; }; }; - class ModuleDescription { + class ModuleDescription { description = "$STR_ACE_Hearing_Module_Description"; }; }; diff --git a/addons/interaction/CfgVehicles.hpp b/addons/interaction/CfgVehicles.hpp index 03466c1986..deb8a4d800 100644 --- a/addons/interaction/CfgVehicles.hpp +++ b/addons/interaction/CfgVehicles.hpp @@ -17,7 +17,7 @@ class CfgVehicles { defaultValue = 1; }; }; - class ModuleDescription { + class ModuleDescription { description = "$STR_ACE_InteractionSystem_Module_Description"; }; }; diff --git a/addons/javelin/CfgVehicles.hpp b/addons/javelin/CfgVehicles.hpp index 48781036ad..1cd527089d 100644 --- a/addons/javelin/CfgVehicles.hpp +++ b/addons/javelin/CfgVehicles.hpp @@ -16,7 +16,7 @@ class CfgVehicles { class MainTurret : MainTurret { weapons[] = { QGVAR(Titan_Static) }; magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; - + turretInfoType = "ACE_RscOptics_javelin"; gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d); opticsZoomMin = 0.08333; @@ -29,12 +29,12 @@ class CfgVehicles { }; }; }; - class O_static_AT_F: AT_01_base_F { + class O_static_AT_F: AT_01_base_F { class Turrets : Turrets { class MainTurret : MainTurret { weapons[] = { QGVAR(Titan_Static) }; magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; - + turretInfoType = "ACE_RscOptics_javelin"; gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d); opticsZoomMin = 0.08333; @@ -47,12 +47,12 @@ class CfgVehicles { }; }; }; - class I_static_AT_F: AT_01_base_F { + class I_static_AT_F: AT_01_base_F { class Turrets : Turrets { class MainTurret : MainTurret { weapons[] = { QGVAR(Titan_Static) }; magazines[] = {"1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles","1Rnd_GAT_missiles"}; - + turretInfoType = "ACE_RscOptics_javelin"; gunnerOpticsModel = PATHTOF(data\reticle_titan.p3d); opticsZoomMin = 0.08333; diff --git a/addons/javelin/CfgWeapons.hpp b/addons/javelin/CfgWeapons.hpp index 1bbf713b3b..75aaf7c332 100644 --- a/addons/javelin/CfgWeapons.hpp +++ b/addons/javelin/CfgWeapons.hpp @@ -38,7 +38,7 @@ class CfgWeapons { lockingTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1}; }; - class launch_I_Titan_short_F: launch_Titan_short_base { + class launch_I_Titan_short_F: launch_Titan_short_base { GVAR(enabled) = 1; weaponInfoType = "ACE_RscOptics_javelin"; modelOptics = PATHTOF(data\reticle_titan.p3d); @@ -48,7 +48,7 @@ class CfgWeapons { lockingTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1}; }; - class launch_O_Titan_short_F: launch_Titan_short_base { + class launch_O_Titan_short_F: launch_Titan_short_base { GVAR(enabled) = 1; weaponInfoType = "ACE_RscOptics_javelin"; modelOptics = PATHTOF(data\reticle_titan.p3d); @@ -59,7 +59,7 @@ class CfgWeapons { lockingTargetSound[] = {"",0,1}; lockedTargetSound[] = {"",0,1}; }; - class launch_Titan_short_F: launch_Titan_short_base { + class launch_Titan_short_F: launch_Titan_short_base { GVAR(enabled) = 1; weaponInfoType = "ACE_RscOptics_javelin"; modelOptics = PATHTOF(data\reticle_titan.p3d); diff --git a/addons/map/CfgVehicles.hpp b/addons/map/CfgVehicles.hpp index 849549e3d1..a5194e015e 100644 --- a/addons/map/CfgVehicles.hpp +++ b/addons/map/CfgVehicles.hpp @@ -34,7 +34,7 @@ class CfgVehicles { defaultValue = 0; }; }; - class ModuleDescription { + class ModuleDescription { description = "$STR_ACE_Map_Module_Description"; }; }; @@ -51,7 +51,7 @@ class CfgVehicles { class Interval { displayName = "$STR_ACE_Map_BFT_Interval_DisplayName"; description = "$STR_ACE_Map_BFT_Interval_Description"; - typeName = "NUMBER"; + typeName = "NUMBER"; defaultValue = 1; }; class HideAiGroups { @@ -61,7 +61,7 @@ class CfgVehicles { defaultValue = 0; }; }; - class ModuleDescription { + class ModuleDescription { description = "$STR_ACE_Map_BFT_Module_Description"; }; }; diff --git a/addons/medical/CfgVehicles.hpp b/addons/medical/CfgVehicles.hpp index 6c37c5cfd9..e0a6fbcfa0 100644 --- a/addons/medical/CfgVehicles.hpp +++ b/addons/medical/CfgVehicles.hpp @@ -9,7 +9,6 @@ class CfgVehicles { }; }; class ACE_Module; - // TODO localization for all the modules class ACE_moduleMedicalSettings: ACE_Module { scope = 2; displayName = "$STR_ACE_MedicalSettings_Module_DisplayName"; @@ -191,8 +190,12 @@ class CfgVehicles { class consumeItem_PAK { displayName = "$STR_ACE_AdvancedMedicalSettings_consumeItem_PAK_DisplayName"; description = "$STR_ACE_AdvancedMedicalSettings_consumeItem_PAK_Description"; - typeName = "BOOL"; - defaultValue = 1; + + typeName = "NUMBER"; + class values { + class keep { name = "$STR_ACE_Medical_No"; value = 0; }; + class remove { name = "$STR_ACE_Medical_Yes"; value = 1; default = 1; }; + }; }; class useLocation_PAK { displayName = "$STR_ACE_AdvancedMedicalSettings_useLocation_PAK_DisplayName"; @@ -333,8 +336,19 @@ class CfgVehicles { class enabled { displayName = "$STR_ACE_AssignMedicVehicle_enabled_DisplayName"; description = "$STR_ACE_AssignMedicVehicle_enabled_Description"; - typeName = "BOOL"; - defaultValue = 1; + + typeName = "NUMBER"; + class values { + class none { + name = "$STR_ACE_Medical_No"; + value = 0; + }; + class medic { + name = "$STR_ACE_Medical_Yes"; + value = 1; + default = 1; + }; + }; }; }; class ModuleDescription { @@ -1003,4 +1017,4 @@ class CfgVehicles { }; }; }; -}; \ No newline at end of file +}; diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 0eb23d57d4..e522e215ef 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -3060,6 +3060,378 @@ [ACE] Medical Supply Crate (Advanced) [ACE] Skrzynka z zapasami medycznymi (zaawansowana) + + ACE Medical + ACE Opcje medyczne + + + Medical Settings [ACE] + Ustawienia medyczne [ACE] + + + Medical Level + Poziom medyczny + + + What is the medical simulation level? + Jaki jest poziom symulacji medycznej? + + + Basic + Podstawowy + + + Advanced + Zaawansowany + + + Medics setting + Poziom medykรณw + + + What is the level of detail prefered for medics? + Jaki jest poziom detali medycznych wyล›wietlanych dla medykรณw? + + + Disable medics + Wyล‚ฤ…cz medykรณw + + + Enable Litter + Aktywuj odpadki + + + Enable litter being created upon treatment + Twรณrz odpadki medyczne podczas leczenia + + + Life time of litter objects + Dล‚ugoล›ฤ‡ ลผycia odpadkรณw + + + How long should litter objects stay? In seconds. -1 is forever. + Ile czasu musi upล‚ynฤ…ฤ‡, aby odpadki zaczฤ™ล‚y znikaฤ‡? W sekundach. -1 dla nieskoล„czonoล›ci. + + + Enable Screams + Aktywuj wrzaski + + + Enable screaming by injuried units + Aktywuj wrzeszczenie z bรณlu przez ranne jednostki + + + Player Damage + Prรณg obraลผeล„ graczy + + + What is the damage a player can take before being killed? + Jaki jest prรณg obraลผeล„, jakie gracz moลผe otrzymaฤ‡ zanim zostanie zabity? + + + AI Damage + Prรณg obraลผeล„ AI + + + What is the damage an AI can take before being killed? + Jaki jest prรณg obraลผeล„, jakie AI moลผe otrzymaฤ‡ zanim zostanie zabite? + + + AI Unconsciousness + Nieprzytomnoล›ฤ‡ AI + + + Allow AI to go unconscious + Czy AI moลผe byฤ‡ nieprzytomne od odniesionych obraลผeล„? + + + Disabled + Wyล‚ฤ…czone + + + Enabled + Wล‚ฤ…czone + + + Prevent instant death + Wyล‚. natychmiast. ล›mierฤ‡ + + + Have a unit move to unconscious instead of death + Spraw, aby jednostka zostaล‚a przeniesiona do stanu nieprzytomnoล›ci zamiast ginฤ…ฤ‡ na miejscu od ล›miertelnych obraลผeล„ + + + Bleeding coefficient + Mnoลผnik krwawienia + + + Coefficient to modify the bleeding speed + Mnoลผnik modyfikujฤ…cy prฤ™dkoล›ฤ‡ wykrwawiania siฤ™ + + + Pain coefficient + Mnoลผnik bรณlu + + + Coefficient to modify the pain intensity + Mnoลผnik modyfikujฤ…cy intensywnoล›ฤ‡ bรณlu + + + Sync status + Synchronizuj status + + + Keep unit status synced. Recommended on. + Utrzymuj synchronizacjฤ™ statusu jednostek. Zalecane zostawienie tej opcji wล‚ฤ…czonej. + + + Provides a medical system for both players and AI. + Moduล‚ ten dostarcza system medyczny dla graczy oraz AI. + + + Advanced Medical Settings [ACE] + Zaawansowane ustawienia medyczne [ACE] + + + Enabled for + Aktywne dla + + + Select what units the advanced medical system will be enabled for + Wybierz dla kogo zaawansowany system medyczny bฤ™dzie aktywny + + + Players only + Tylko dla graczy + + + Players and AI + Gracze oraz AI + + + Enable Advanced wounds + Akt. zaawansowane rany + + + Allow reopening of bandaged wounds? + Pozwรณl na otwieranie siฤ™ zabandaลผowanych ran? + + + Vehicle Crashes + Obraลผenia od kolizji + + + Do units take damage from a vehicle crash? + Czy jednostki otrzymujฤ… obraลผenia w wyniku kolizji pojazdรณw? + + + Allow PAK + Ust. apteczek osobistych + + + Who can use the PAK for full heal? + Kto moลผe skorzystaฤ‡ z apteczki osobistej w celu peล‚nego uleczenia? + + + Anyone + Wszyscy + + + Medics only + Tylko medycy + + + Doctors only + Tylko doktorzy + + + Remove PAK on use + Usuล„ apteczkฤ™ po uลผyciu + + + Should PAK be removed on usage? + Czy apteczka osobista powinna zniknฤ…ฤ‡ z ekwipunku po jej uลผyciu? + + + No + Nie + + + Yes + Tak + + + Locations PAK + Ogr. apteczek osobistych + + + Where can the personal aid kit be used? + Gdzie moลผna korzystaฤ‡ z apteczek osobistych? + + + Anywhere + Wszฤ™dzie + + + Medical vehicles + Pojazdy medyczne + + + Medical facility + Budynki medyczne + + + Vehicles & facility + Pojazdy i budynki medyczne + + + Disabled + Wyล‚ฤ…czone + + + Allow Surgical kit (Adv) + Ust. zestawu chirurg. + + + Who can use the surgical kit? + Kto moลผe skorzystaฤ‡ z zestawu chirurgicznego w celu zszycia ran? + + + Remove Surgical kit (Adv) + Usuล„ zest. chir. po uลผyciu + + + Should Surgical kit be removed on usage? + Czy zestaw chirurgiczny powinien zniknฤ…ฤ‡ z ekwipunku po jego uลผyciu? + + + Locations Surgical kit (Adv) + Ogr. zestawu chirurg. + + + Where can the Surgical kit be used? + Gdzie moลผna korzystaฤ‡ z zestawu chirurgicznego? + + + Configure the treatment settings from ACE Medical + Skonfiguruj zaawansowane ustawienia leczenia systemu medycznego ACE + + + Revive Settings [ACE] + Ustawienia wskrzeszania [ACE] + + + Enable Revive + Aktywuj wskrzeszanie + + + Enable a basic revive system + Aktywuj podstawowy system wskrzeszania + + + Max Revive time + Maks. czas agonii + + + Max amount of seconds a unit can spend in revive state + Maksymalna dล‚ugoล›ฤ‡ agonii w sekundach (czas na wskrzeszenie) + + + Max Revive lives + Maks. iloล›ฤ‡ wskrzeszeล„ + + + Max amount of lives a unit. 0 or -1 is disabled. + Maksymalna iloล›ฤ‡ wskrzeszeล„. Wpisz 0 lub -1 aby wyล‚ฤ…czyฤ‡. + + + Provides a medical system for both players and AI. + Moduล‚ ten aktywuje podstawowy system wskrzeszania. Jednostka po otrzymaniu ล›miertelnych obraลผeล„ przechodzi do stanu agonii, ktรณra trwa okreล›lonฤ… dล‚ugoล›ฤ‡ czasu. W tym czasie aby wskrzesiฤ‡ i jednoczeล›nie odratowaฤ‡ jednostkฤ™ naleลผy opatrzeฤ‡ jej rany i wykonaฤ‡ RKO. + + + Set Medic Class [ACE] + Ustaw klasฤ™ medyka [ACE] + + + List + Lista + + + List of unit names that will be classified as medic, separated by commas. + Lista nazw jednostek, ktรณre sฤ… sklasyfikowane jako medycy, oddzielone przecinkami. + + + Is Medic + Klasa medyczna + + + + + + + None + ลปadna + + + Regular medic + Zwykล‚y medyk + + + Doctor (Only Advanced Medics) + Doktor (tylko zaawansowani medycy) + + + Assigns the ACE medic class to a unit + Moduล‚ ten przypisuje klasฤ™ medyka ACE do jednostek. + + + Set Medical Vehicle [ACE] + Ustaw pojazd medyczny [ACE] + + + List + Lista + + + List of vehicles that will be classified as medical vehicle, separated by commas. + Lista nazw pojazdรณw, ktรณre sฤ… sklasyfikowane jako pojazdy medyczne, oddzielone przecinkami. + + + Is Medical Vehicle + Jest pojazdem med. + + + Whatever or not the objects in the list will be a medical vehicle. + Czy pojazdy z tej listy sฤ… pojazdami medycznymi. + + + Assigns the ACE medic class to a unit + Moduล‚ ten pozwala na przypisanie danym pojazdom statusu pojazdรณw medycznych. Wewnฤ…trz takiego pojazdu moลผna wykonywaฤ‡ zaawansowane zabiegi medyczne. + + + Set Medical Facility [ACE] + Ustaw budynek medyczny [ACE] + + + Is Medical Facility + Jest budynkiem med. + + + Registers an object as a medical facility + Przypisuje danemu obiektowi status budynku medycznego + + + Defines an object as a medical facility. This allows for more advanced treatments. Can be used on buildings and vehicles. + Moduล‚ ten pozwala przypisaฤ‡ status budynku medycznego danemu obiektowi. Budynek taki pozwala na wykonywanie zaawansowanych zabiegรณw medycznych. Moลผe byฤ‡ uลผyte na pojazdach i budynkach. + + + [ACE] Medical Supply Crate (Basic) + [ACE] Skrzynka z zapasami medycznymi (podstawowa) + + + [ACE] Medical Supply Crate (Advanced) + [ACE] Skrzynka z zapasami medycznymi (zaawansowana) + - \ No newline at end of file + diff --git a/addons/missionmodules/stringtable.xml b/addons/missionmodules/stringtable.xml index 12d70602c2..1532827378 100644 --- a/addons/missionmodules/stringtable.xml +++ b/addons/missionmodules/stringtable.xml @@ -14,39 +14,39 @@ Dลบwiฤ™ki - Classnames of the ambiance sounds played. Seperated by ','. - Classname-y dลบwiฤ™kรณw do odtwarzania. Oddzielone przy uลผyciu ','. + Class names of the ambiance sounds to be played. Seperated by ',' + Class name-y dลบwiฤ™kรณw do odtwarzania. Oddzielone przy uลผyciu ',' Minimal Distance Minimalny dystans - Minimal Distance - Minimalny dystans + Used for calculating a random position and sets the minimal distance between the players and the played sound file(s) + Uลผywany do obliczania losowej pozycji a takลผe ustawia minimalny dystans pomiฤ™dzy graczami a odtwarzanymi plikami dลบwiฤ™kowymi - Maximal Distance + Maximum Distance Maksymalny dystans - Maximal Distance - Maksymalny dystans + Used for calculating a random position and sets the maximum distance between the players and the played sound file(s) + Uลผywany do obliczania losowej pozycji a takลผe ustawia maksymalny dystans pomiฤ™dzy graczami a odtwarzanymi plikami dลบwiฤ™kowymi Minimal Delay Minimalne opรณลบnienie - Minimal Delay between sounds played + Minimal delay between sounds played Minimalne opรณลบnienie pomiฤ™dzy odtwarzanymi dลบwiฤ™kami - Maximal Delay + Maximum Delay Maksymalne opรณลบnienie - Maximal Delay between sounds played + Maximum delay between sounds played Maksymalne opรณลบnienie pomiฤ™dzy odtwarzanymi dลบwiฤ™kami diff --git a/addons/mk6mortar/script_component.hpp b/addons/mk6mortar/script_component.hpp index cb74d552de..e1d56d087e 100644 --- a/addons/mk6mortar/script_component.hpp +++ b/addons/mk6mortar/script_component.hpp @@ -2,11 +2,11 @@ #include "\z\ace\Addons\main\script_mod.hpp" #ifdef DEBUG_ENABLED_MK6MORTAR - #define DEBUG_MODE_FULL + #define DEBUG_MODE_FULL #endif #ifdef DEBUG_SETTINGS_MK6MORTAR - #define DEBUG_SETTINGS DEBUG_SETTINGS_MK6MORTAR + #define DEBUG_SETTINGS DEBUG_SETTINGS_MK6MORTAR #endif #include "\z\ace\Addons\main\script_macros.hpp" diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index 37c7d322ad..cb4a7c5376 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -81,5 +81,37 @@ Moduล‚ ten pozwala dostosowaฤ‡ ustawienia moลบdzierza MK6. + + MK6 Settings + Moลบdzierz MK6 - Ustawienia + + + Air Resistance + Opรณr powietrza + + + For Player Shots, Model Air Resistance and Wind Effects + Modeluj opรณr powietrza oraz wpล‚yw wiatru na tor lotu pocisku dla strzaล‚รณw z moลบdzierza MK6 przez graczy + + + Allow MK6 Computer + Komputer MK6 + + + Show the Computer and Rangefinder (these NEED to be removed if you enable air resistance) + Zezwรณl na komputer i dalmierz (opcja ta MUSI zostaฤ‡ wyล‚ฤ…czona jeลผeli aktywowaล‚eล› opรณr powietrza) + + + Allow MK6 Compass + Kompas MK6 + + + Show the MK6 Digital Compass + Pokaลผ kompas MK6 + + + + Moduล‚ ten pozwala dostosowaฤ‡ ustawienia moลบdzierza MK6. + diff --git a/addons/nametags/CfgVehicles.hpp b/addons/nametags/CfgVehicles.hpp index a4ef577ecf..fabd3b09cb 100644 --- a/addons/nametags/CfgVehicles.hpp +++ b/addons/nametags/CfgVehicles.hpp @@ -65,7 +65,7 @@ class CfgVehicles { defaultValue = 0; }; }; - class ModuleDescription: ModuleDescription { + class ModuleDescription: ModuleDescription { description = "$STR_ACE_NameTags_Module_Description"; }; }; diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index f14a97b460..495db21df7 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -1,288 +1,332 @@ -๏ปฟ - - - - ACE Options - ACE Optionen - Opciones ACE - Ustawienia ACE - ACE Nastavenรญ - Options ACE - ACE ะะฐัั‚ั€ะพะนะบะธ - Opรงรตes do ACE - ACE Beรกllรญtรกsok - Opzioni ACE - - - Fix Animation - Behebe Animation - Arreglar animaciรณn - ะคะธะบั ะฐะฝะธะผะฐั†ะธะธ - Opravit animace - Napraw animacjฤ™ - Corriger animation - Animรกciรณk kijavรญtรกsa - Fixa l'animazione - Arrumar Animaรงรฃo - - - Reset All - Alles zurรผcksetzen - Reiniciar todo - ะŸะพะปะฝั‹ะน ัะฑั€ะพั - Vyresetovat vลกe - Resetuj wszystko - Dรฉfaut - Minden visszaรกllรญtรกsa - Resetta tutto - Resetar Tudo - - - Colors - Couleurs - Farben - Colores - ะฆะฒะตั‚ะฐ - Barvy - Kolory - Szรญnek - Colori - Cores - - - Options - Optionen - Opciones - Opcje - Nastavenรญ - Options - ะะฐัั‚ั€ะพะนะบะธ - Opรงรตes - Beรกllรญtรกsok - Opzioni - - - Values - Valores - ะ—ะฝะฐั‡ะตะฝะธั - Hodnoty - Wartoล›ci - Valeurs - Werte - ร‰rtรฉkek - Valori - Valores - - - Yes - Ja - Si - Tak - Ano - Oui - ะ”ะฐ - Igen - Sim - Si - - - No - Nein - No - Nie - Ne - Non - ะะตั‚ - Nem - Nรฃo - No - - - Setting: - Nastavenรญ: - Einstellung: - ะฃัั‚ะฐะฝะพะฒะบะธ: - Ajuste: - Ustaw: - Paramรจtres - Opciรณ: - Parametri: - Opรงรฃo: - - - Export - Exportieren - Exportar - ะญะบัะฟะพั€ั‚ - Exportovat - Eksport - Exporter - Exportรกlรกs - Esporta - Exportar - - - Open Export Menu - ร–ffne Exportmenรผ - Abrir menรบ de exportaciรณn - ะžั‚ะบั€ั‹ั‚ัŒ ะผะตะฝัŽ ัะบัะฟะพั€ั‚ะฐ - Otevล™รญt exportovacรญ menu - Otwรณrz menu eksportowania - Ouvrir le menu d'exportation - Exportรกlรกsi menรผ megnyitรกsa - Apri menรน esportazione - Abrir menu de exportaรงรฃo - - - String input. - Zeichenketteneingabe - Introducir cadena de texto. - ะกั‚ั€ะพั‡ะฝั‹ะน ะฒะฒะพะด. - Wpisywanie tekstu. - Vklรกdรกnรญ textu. - Entrรฉe - String bevitel. - Stringa di unput. - Input de String - - - Array. Seperate elements by using ,. - Array. Teile unterschiedliche Elemente mit ,. - Matriz. Separa elementos usando ,. - ะœะฐััะธะฒ. ะ ะฐะทะดะตะปัะนั‚ะต ัะปะตะผะตะฝั‹, ะธัะฟะพะปัŒะทัƒั ะทะฐะฟัั‚ัƒัŽ. - Tablica. Oddziel elementy uลผywajฤ…c ,. - Tableau. Sรฉparation par ,. - Tabulka. Oddฤ›l elementy pouลพitรญm ,. - Array. Vรกlasszad el az elemeket vesszล‘vel. - Array. Separa gli elementi usando ,. - Vetor. Separe elementos usando *,*. - - - Number - Zahl - Nรบmero - ะงะธัะปะพ - ฤŒรญslo - Cyfra - Nombre - Szรกm - Numero - Nรบmero - - - Uknown input type - Unbekannter Eingabetyp - Tipo de entrada desconocida - ะะตะธะทะฒะตัั‚ะฝั‹ะน ั‚ะธะฟ ะฒะฒะพะดะฐ - Neznรกmรฝ vstup - Nieznany rodzaj danych - Type d'entrรฉe inconnue - Ismeretlen beviteli tรญpus - Input inserito sconosciuto - Tipo desonhecido de input - - - Save input - Speichere Eingabe - Guardar entrada - ะกะพั…ั€ะฐะฝะธั‚ัŒ ะฒะฒะพะด - Uloลพit vstup - Zapisz dane - Sauvegarder - Bevitel elmentรฉse - Salva input - Salvar input - - - Include Client Settings - SchlieรŸe Client-Einstellungen ein - Incluir configuraciรณn de cliente - ะ’ะบะปัŽั‡ะธั‚ัŒ ะฝะฐัั‚ั€ะพะนะบะธ ะบะปะธะตะฝั‚ะฐ - Zahrnout nastavenรญ klienta - Zawrzyj ustawienia klienta - Inclure paramรจtres client - Kliens-beรกllรญtรกsok mellรฉklรฉse - Includi i parametri del client - Incluir opรงรตes do cliente - - - Exclude Client Settings - SchlieรŸe Client-Einstellungen aus - Excluir configuraciรณn de cliente - ะ˜ัะบะปัŽั‡ะธั‚ัŒ ะฝะฐัั‚ั€ะพะนะบะธ ะบะปะธะตะฝั‚ะฐ - Nezahrnout nastavenรญ klienta - Wyklucz ustawienia klienta - Exclure paramรจtres client - Kliens-beรกllรญtรกsok elhagyรกsa - Escludi i parametri del client - Excluir opรงรตes do cliente - - - Settings exported to clipboard - Einstellungen in die Zwischenablage exportiert - Configuraciรณn exportada al portapapeles - ะะฐัั‚ั€ะพะนะบะธ ัะบัะฟะพั€ั‚ะธั€ะพะฒะฐะฝั‹ ะฒ ะฑัƒั„ะตั€ ะพะฑะผะตะฝะฐ - Nastevenรญ exportovรกna do schrรกnky - Ustawienia wyeksportowano do schowka - Paramรจtres exportรฉs dans le presse papier - Beรกllรญtรกsok exportรกlva a vรกgรณlapba - Parametri esportati alla clipboard - Opรงรตes exportadas para o clipboard. - - - Option Menu UI Scaling - Menu option: taille de l'UI - Skalowanie UI menu ustawieล„ - Mฤ›ล™รญtko UI v menu nastavenรญ - ะ ะฐะทะผะตั€ ะธะฝั‚ะตั€ั„ะตะนัะฐ ะผะตะฝัŽ ะฝะฐัั‚ั€ะพะนะบะธ - Opciรณn de escalado del menรบ IU - UI Skalierung - Beรกllรญtรกsmenรผ kezelล‘felรผletรฉnek skรกlรกzรกsa - Escalar o menu de opรงรตes - - - Allow Config Export [ACE] - Pozwรณl na eksport ustawieล„ [ACE] - - - Allow - Zezwรณl - - - Allow export of all settings to a server config formatted. - Zezwรณl na eksport wszystkich ustawieล„ do formatu konfiguracji serwera. - - - When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard. - Jeลผeli ustawione na zezwรณl, wtedy bฤ™dziesz mieฤ‡ dostฤ™p do ekranu modyfikacji wszystich ustawieล„ i zmiennych ACE, a takลผe bฤ™dziesz mieฤ‡ moลผliwoล›ฤ‡ eksportu tychลผe ustawieล„ do formatu rozpoznawalnego przez userconfig serwera. Klikniฤ™cie opcji Eksportuj skopiuje wszystkie ustawienia do schowka. Dziaล‚a tylko w trybie SP. - - - Hide - Ukryj - - - Top right, downwards - Po prawej u gรณry, w dรณล‚ - - - Top right, to the left - Po prawej u gรณry, do lewej - - - Top left, downwards - Po lewej u gรณry, w dรณล‚ - - - Top left, to the right - Po lewej u gรณry, do prawej - - - Top - Gรณra - - - Bottom - Dรณล‚ - - - +๏ปฟ + + + + ACE Options + ACE Optionen + Opciones ACE + Ustawienia ACE + ACE Nastavenรญ + Options ACE + ACE ะะฐัั‚ั€ะพะนะบะธ + Opรงรตes do ACE + ACE Beรกllรญtรกsok + Opzioni ACE + + + Fix Animation + Behebe Animation + Arreglar animaciรณn + ะคะธะบั ะฐะฝะธะผะฐั†ะธะธ + Opravit animace + Napraw animacjฤ™ + Corriger animation + Animรกciรณk kijavรญtรกsa + Fixa l'animazione + Arrumar Animaรงรฃo + + + Reset All + Alles zurรผcksetzen + Reiniciar todo + ะŸะพะปะฝั‹ะน ัะฑั€ะพั + Vyresetovat vลกe + Resetuj wszystko + Dรฉfaut + Minden visszaรกllรญtรกsa + Resetta tutto + Resetar Tudo + + + Colors + Couleurs + Farben + Colores + ะฆะฒะตั‚ะฐ + Barvy + Kolory + Szรญnek + Colori + Cores + + + Options + Optionen + Opciones + Opcje + Nastavenรญ + Options + ะะฐัั‚ั€ะพะนะบะธ + Opรงรตes + Beรกllรญtรกsok + Opzioni + + + Values + Valores + ะ—ะฝะฐั‡ะตะฝะธั + Hodnoty + Wartoล›ci + Valeurs + Werte + ร‰rtรฉkek + Valori + Valores + + + Yes + Ja + Si + Tak + Ano + Oui + ะ”ะฐ + Igen + Sim + Si + + + No + Nein + No + Nie + Ne + Non + ะะตั‚ + Nem + Nรฃo + No + + + Setting: + Nastavenรญ: + Einstellung: + ะฃัั‚ะฐะฝะพะฒะบะธ: + Ajuste: + Ustaw: + Paramรจtres + Opciรณ: + Parametri: + Opรงรฃo: + + + Export + Exportieren + Exportar + ะญะบัะฟะพั€ั‚ + Exportovat + Eksport + Exporter + Exportรกlรกs + Esporta + Exportar + + + Open Export Menu + ร–ffne Exportmenรผ + Abrir menรบ de exportaciรณn + ะžั‚ะบั€ั‹ั‚ัŒ ะผะตะฝัŽ ัะบัะฟะพั€ั‚ะฐ + Otevล™รญt exportovacรญ menu + Otwรณrz menu eksportowania + Ouvrir le menu d'exportation + Exportรกlรกsi menรผ megnyitรกsa + Apri menรน esportazione + Abrir menu de exportaรงรฃo + + + String input. + Zeichenketteneingabe + Introducir cadena de texto. + ะกั‚ั€ะพั‡ะฝั‹ะน ะฒะฒะพะด. + Wpisywanie tekstu. + Vklรกdรกnรญ textu. + Entrรฉe + String bevitel. + Stringa di unput. + Input de String + + + Array. Seperate elements by using ,. + Array. Teile unterschiedliche Elemente mit ,. + Matriz. Separa elementos usando ,. + ะœะฐััะธะฒ. ะ ะฐะทะดะตะปัะนั‚ะต ัะปะตะผะตะฝั‹, ะธัะฟะพะปัŒะทัƒั ะทะฐะฟัั‚ัƒัŽ. + Tablica. Oddziel elementy uลผywajฤ…c ,. + Tableau. Sรฉparation par ,. + Tabulka. Oddฤ›l elementy pouลพitรญm ,. + Array. Vรกlasszad el az elemeket vesszล‘vel. + Array. Separa gli elementi usando ,. + Vetor. Separe elementos usando *,*. + + + Number + Zahl + Nรบmero + ะงะธัะปะพ + ฤŒรญslo + Cyfra + Nombre + Szรกm + Numero + Nรบmero + + + Uknown input type + Unbekannter Eingabetyp + Tipo de entrada desconocida + ะะตะธะทะฒะตัั‚ะฝั‹ะน ั‚ะธะฟ ะฒะฒะพะดะฐ + Neznรกmรฝ vstup + Nieznany rodzaj danych + Type d'entrรฉe inconnue + Ismeretlen beviteli tรญpus + Input inserito sconosciuto + Tipo desonhecido de input + + + Save input + Speichere Eingabe + Guardar entrada + ะกะพั…ั€ะฐะฝะธั‚ัŒ ะฒะฒะพะด + Uloลพit vstup + Zapisz dane + Sauvegarder + Bevitel elmentรฉse + Salva input + Salvar input + + + Include Client Settings + SchlieรŸe Client-Einstellungen ein + Incluir configuraciรณn de cliente + ะ’ะบะปัŽั‡ะธั‚ัŒ ะฝะฐัั‚ั€ะพะนะบะธ ะบะปะธะตะฝั‚ะฐ + Zahrnout nastavenรญ klienta + Zawrzyj ustawienia klienta + Inclure paramรจtres client + Kliens-beรกllรญtรกsok mellรฉklรฉse + Includi i parametri del client + Incluir opรงรตes do cliente + + + Exclude Client Settings + SchlieรŸe Client-Einstellungen aus + Excluir configuraciรณn de cliente + ะ˜ัะบะปัŽั‡ะธั‚ัŒ ะฝะฐัั‚ั€ะพะนะบะธ ะบะปะธะตะฝั‚ะฐ + Nezahrnout nastavenรญ klienta + Wyklucz ustawienia klienta + Exclure paramรจtres client + Kliens-beรกllรญtรกsok elhagyรกsa + Escludi i parametri del client + Excluir opรงรตes do cliente + + + Settings exported to clipboard + Einstellungen in die Zwischenablage exportiert + Configuraciรณn exportada al portapapeles + ะะฐัั‚ั€ะพะนะบะธ ัะบัะฟะพั€ั‚ะธั€ะพะฒะฐะฝั‹ ะฒ ะฑัƒั„ะตั€ ะพะฑะผะตะฝะฐ + Nastevenรญ exportovรกna do schrรกnky + Ustawienia wyeksportowano do schowka + Paramรจtres exportรฉs dans le presse papier + Beรกllรญtรกsok exportรกlva a vรกgรณlapba + Parametri esportati alla clipboard + Opรงรตes exportadas para o clipboard. + + + Option Menu UI Scaling + Menu option: taille de l'UI + Skalowanie UI menu ustawieล„ + Mฤ›ล™รญtko UI v menu nastavenรญ + ะ ะฐะทะผะตั€ ะธะฝั‚ะตั€ั„ะตะนัะฐ ะผะตะฝัŽ ะฝะฐัั‚ั€ะพะนะบะธ + Opciรณn de escalado del menรบ IU + UI Skalierung + Beรกllรญtรกsmenรผ kezelล‘felรผletรฉnek skรกlรกzรกsa + Escalar o menu de opรงรตes + + + Allow Config Export [ACE] + Pozwรณl na eksport ustawieล„ [ACE] + + + Allow + Zezwรณl + + + Allow export of all settings to a server config formatted. + Zezwรณl na eksport wszystkich ustawieล„ do formatu konfiguracji serwera. + + + When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard. + Jeลผeli ustawione na zezwรณl, wtedy bฤ™dziesz mieฤ‡ dostฤ™p do ekranu modyfikacji wszystich ustawieล„ i zmiennych ACE, a takลผe bฤ™dziesz mieฤ‡ moลผliwoล›ฤ‡ eksportu tychลผe ustawieล„ do formatu rozpoznawalnego przez userconfig serwera. Klikniฤ™cie opcji Eksportuj skopiuje wszystkie ustawienia do schowka. Dziaล‚a tylko w trybie SP. + + + Hide + Ukryj + + + Top right, downwards + Po prawej u gรณry, w dรณล‚ + + + Top right, to the left + Po prawej u gรณry, do lewej + + + Top left, downwards + Po lewej u gรณry, w dรณล‚ + + + Top left, to the right + Po lewej u gรณry, do prawej + + + Top + Gรณra + + + Bottom + Dรณล‚ + + + Allow Config Export [ACE] + Pozwรณl na eksport ustawieล„ [ACE] + + + Allow + Zezwรณl + + + Allow export of all settings to a server config formatted. + Zezwรณl na eksport wszystkich ustawieล„ do formatu konfiguracji serwera. + + + When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard. + Jeลผeli ustawione na zezwรณl, wtedy bฤ™dziesz mieฤ‡ dostฤ™p do ekranu modyfikacji wszystich ustawieล„ i zmiennych ACE, a takลผe bฤ™dziesz mieฤ‡ moลผliwoล›ฤ‡ eksportu tychลผe ustawieล„ do formatu rozpoznawalnego przez userconfig serwera. Klikniฤ™cie opcji Eksportuj skopiuje wszystkie ustawienia do schowka. Dziaล‚a tylko w trybie SP. + + + Hide + Ukryj + + + Top right, downwards + Po prawej u gรณry, w dรณล‚ + + + Top right, to the left + Po prawej u gรณry, do lewej + + + Top left, downwards + Po lewej u gรณry, w dรณล‚ + + + Top left, to the right + Po lewej u gรณry, do prawej + + + Top + Gรณra + + + Bottom + Dรณล‚ + + + diff --git a/addons/respawn/CfgVehicles.hpp b/addons/respawn/CfgVehicles.hpp index 00f0bd4493..e90f4ba08e 100644 --- a/addons/respawn/CfgVehicles.hpp +++ b/addons/respawn/CfgVehicles.hpp @@ -27,7 +27,7 @@ class CfgVehicles { defaultValue = 1; }; }; - class ModuleDescription: ModuleDescription { + class ModuleDescription: ModuleDescription { description = "$STR_ACE_Respawn_Module_Description"; }; }; @@ -42,7 +42,7 @@ class CfgVehicles { icon = QUOTE(PATHTOF(UI\Icon_Module_FriendlyFire_ca.paa)); class Arguments {}; - class ModuleDescription: ModuleDescription { + class ModuleDescription: ModuleDescription { description = "$STR_ACE_FriendlyFire_Module_Description"; }; }; @@ -57,7 +57,7 @@ class CfgVehicles { icon = QUOTE(PATHTOF(UI\Icon_Module_Rallypoint_ca.paa)); class Arguments {}; - class ModuleDescription: ModuleDescription { + class ModuleDescription: ModuleDescription { description = "$STR_ACE_Rallypoint_Module_Description"; }; }; diff --git a/addons/switchunits/CfgVehicles.hpp b/addons/switchunits/CfgVehicles.hpp index 48271c6428..0f76c78568 100644 --- a/addons/switchunits/CfgVehicles.hpp +++ b/addons/switchunits/CfgVehicles.hpp @@ -46,8 +46,8 @@ class CfgVehicles { defaultValue = 100; }; }; - class ModuleDescription { - description = "$STR_ACE_SwitchUnits_Module_Description"; + class ModuleDescription { + description = "$STR_ACE_SwitchUnits_Module_Description"; }; }; }; \ No newline at end of file diff --git a/addons/winddeflection/CfgVehicles.hpp b/addons/winddeflection/CfgVehicles.hpp index 2ce9421071..f7e2a33980 100644 --- a/addons/winddeflection/CfgVehicles.hpp +++ b/addons/winddeflection/CfgVehicles.hpp @@ -2,7 +2,7 @@ class CfgVehicles { class ACE_Module; class GVAR(ModuleSettings): ACE_Module { scope = 2; - displayName = "$STR_ACE_WEATHER_WINDDEFLECTION_DISPLAYNAME"; //WIND DEFLECTION + displayName = "$STR_ACE_Weather_windDeflection_DisplayName"; icon = QUOTE(PATHTOF(UI\Icon_Module_Wind_ca.paa)); category = "ACE"; function = QUOTE(DFUNC(initModuleSettings)); @@ -12,32 +12,32 @@ class CfgVehicles { author = "$STR_ACE_Common_ACETeam"; class Arguments { class enabled { - displayName = "$STR_ACE_WEATHER_DEFLECTIONMODULE_DISPLAYNAME"; - description = "$STR_ACE_WEATHER_DEFLECTIONMODULE_DESCRIPTION"; + displayName = "$STR_ACE_Weather_deflectionModule_DisplayName"; + description = "$STR_ACE_Weather_deflectionModule_Description"; typeName = "BOOL"; defaultValue = 1; }; class vehicleEnabled { - displayName = "$STR_ACE_WEATHER_VEHICLEENABLED_DISPLAYNAME"; - description = "$STR_ACE_WEATHER_VEHICLEENABLED_DESCRIPTION"; + displayName = "$STR_ACE_Weather_vehicleEnabled_DisplayName"; + description = "$STR_ACE_Weather_vehicleEnabled_Description"; typeName = "BOOL"; defaultValue = 1; }; class simulationInterval { - displayName = "$STR_ACE_WEATHER_SIMULATIONINTERVAL_DISPLAYNAME"; - description = "$STR_ACE_WEATHER_SIMULATIONINTERVAL_DESCRIPTION"; + displayName = "$STR_ACE_Weather_simulationInterval_DisplayName"; + description = "$STR_ACE_Weather_simulationInterval_Description"; typeName = "NUMBER"; defaultValue = 0.05; }; class simulationRadius { - displayName = "$STR_ACE_WEATHER_SIMULATIONRADIUS_DISPLAYNAME"; - description = "$STR_ACE_WEATHER_SIMULATIONRADIUS_DESCRIPTION"; + displayName = "$STR_ACE_Weather_simulationRadius_DisplayName"; + description = "$STR_ACE_Weather_simulationRadius_Description"; typeName = "NUMBER"; defaultValue = 3000; }; }; - class ModuleDescription { - description = "$STR_ACE_WEATHER_WINDDEFLECTION_DESCRIPTION"; - }; + class ModuleDescription { + description = "$STR_ACE_Weather_windDeflection_Description"; + }; }; }; \ No newline at end of file diff --git a/addons/winddeflection/stringtable.xml b/addons/winddeflection/stringtable.xml index 515591bd32..806bf4c449 100644 --- a/addons/winddeflection/stringtable.xml +++ b/addons/winddeflection/stringtable.xml @@ -62,43 +62,43 @@ Umiditร : %1% Humidade: %1% - + Wind Deflection Wpล‚yw wiatru - + Wind Deflection Wpล‚yw wiatru - + Enables wind deflection Aktywuje wpล‚yw wiatru na trajektoriฤ™ lotu pociskรณw - + Vehicle Enabled Wล‚ฤ…czone dla pojazdรณw - + Enables wind deflection for static/vehicle gunners Aktywuje wpล‚yw wiatru na trajektoriฤ™ lotu pociskรณw dla broni statycznej i na pojazdach - + Simulation Interval Interwaล‚ symulacji - + Defines the interval between every calculation step Okreล›la interwaล‚ pomiฤ™dzy kaลผdym krokiem kalkulacji - + Simulation Radius Zasiฤ™g symulacji - + Defines the radius around the player (in meters) at which projectiles are wind deflected Okreล›la obszar naokoล‚o gracza (w metrach), na ktรณrym pociski sฤ… znoszone przez wiatr - + Wind influence on projectiles trajectory Wpล‚yw wiatru na trajektoriฤ™ lotu pociskรณw From bc72c71e8e193fe6ab359906d6f41fc7b5b41cc4 Mon Sep 17 00:00:00 2001 From: GieNkoV Date: Tue, 12 May 2015 19:11:56 +0200 Subject: [PATCH 121/172] Fix small errors inside stringtables --- addons/common/stringtable.xml | 12 +- addons/explosives/stringtable.xml | 14 +- addons/hearing/stringtable.xml | 2 +- addons/interaction/stringtable.xml | 26 ++- addons/medical/stringtable.xml | 45 ++--- addons/missileguidance/stringtable.xml | 226 ++++++++++++------------- addons/optionsmenu/stringtable.xml | 1 + 7 files changed, 170 insertions(+), 156 deletions(-) diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 5b908a9133..8f5ebe7191 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -275,7 +275,7 @@ Dรฉsactiver menu commande ะ’ั‹ะบะปัŽั‡ะธั‚ัŒ ะบะพะผะฐะฝะดะฝะพะต ะผะตะฝัŽ Parancsnoki menรผ kikapcsolรกsa - Disabilita Menรน di comando + Disabilita menรน di comando Desabilitar menu de comando @@ -308,7 +308,7 @@ Aceptar peticiones Akceptuj proล›by Pล™ijmout ลพรกdost - Accetta Richieste + Accetta la richiesta Accepter requรชte ะŸั€ะธะฝัั‚ัŒ ะทะฐะฟั€ะพัั‹ Kรฉrรฉsek elfogadรกsa @@ -320,7 +320,7 @@ Rechazar peticiones Ignoruj proล›by Zamรญtnout ลพรกdost - Rifiuta Richieste + Rifiuta la richiesta ะžั‚ะบะปะพะฝะธั‚ัŒ ะทะฐะฟั€ะพัั‹ Rejeter requรชte Kรฉrรฉsek elutasรญtรกsa @@ -402,7 +402,7 @@ Hint Background color Hintergrundfarbe der Hinweise Color de fondo de las notificaciones - Colore di sfondo dei Suggerimenti + Colore di sfondo dei suggerimenti ะฆะฒะตั‚ ั„ะพะฝะฐ ะฒัะฟะปั‹ะฒะฐัŽั‰ะธั… ะฟะพะดัะบะฐะทะพะบ Kolor tล‚a powiadomieล„ Notification: couleur de l'arriรจre plan @@ -414,7 +414,7 @@ The color of the background from the ACE hints. Die Hintergrundfarbe der ACE-Hinweise. El color de fondo de las notificaciones del ACE - Il colore di sfondo dei suggerimenti dell'ACE. + Il colore di sfondo dei suggerimenti di ACE. ะฆะฒะตั‚ ั„ะพะฝะฐ ะฒัะฟะปั‹ะฒะฐัŽั‰ะธั… ะฟะพะดัะบะฐะทะพะบ ะะกะ•. Kolor tล‚a dla powiadomieล„ ACE Notification ACE: couleur de l'arriรจre plan @@ -426,7 +426,7 @@ Hint text font color Textfarbe der Hinweise Color del texto de las notificaciones - Il colore del Testo dei Suggerimenti + Il colore del testo dei suggerimenti ะฆะฒะตั‚ ัˆั€ะธั„ั‚ะฐ ะฒัะฟะปั‹ะฒะฐัŽั‰ะธั… ะฟะพะดัะบะฐะทะพะบ Kolor tekstu powiadomieล„ Notification: couleur du texte diff --git a/addons/explosives/stringtable.xml b/addons/explosives/stringtable.xml index 42b5160030..5f5076175d 100644 --- a/addons/explosives/stringtable.xml +++ b/addons/explosives/stringtable.xml @@ -368,7 +368,7 @@ Wybierz zapalnik Sรฉlectionner une mise ร  feu Zvolit Detonรกtor - Seleziona un Attivatore + Seleziona un attivatore Gyรบjtรณeszkรถz kivรกlasztรกsa Selecionar um Gatilho ะ’ั‹ะฑะตั€ะธั‚ะต ะดะตั‚ะพะฝะฐั‚ะพั€ @@ -392,7 +392,7 @@ Druckplatte Plaque de pression Nรกลกlapnรก nรกstraha - Piastra a Pressione + Piastra a pressione Nyomรณlap Placa de pressรฃo ะะฐะถะธะผะฝะฐั ะฟะปะธั‚ะฐ @@ -404,7 +404,7 @@ Stolperdraht Fil de dรฉtente Nรกstraลพnรฝ drรกt - Filo a Inciampo + Filo a inciampo Botlรณdrรณt Linha de traรงรฃo ะ ะฐัั‚ัะถะบะฐ @@ -440,7 +440,7 @@ Infrarotsensor (Seitenangriff) Capteur IR (de flanc) IR Znaฤkovaฤ (Vรฝbuch stranou) - Sensore IR (Attacco laterale) + Sensore IR (attacco laterale) Infravรถrรถs szenzor (Side Attack) Sensor infravermelho (ataque lateral) ะ˜ะš ัะตะฝัะพั€ (ะดะตั‚ะพะฝะฐั†ะธั ะฒะฑะพะบ) @@ -452,7 +452,7 @@ Magnetfeldsensor (Bodenangriff) Capteur magnรฉtique (par le bas) Magnetickรฝ Senzor (Vรฝbuch ze spoda) - Sensore Magnetico di Prossimitร  (Attacco inferiore) + Sensore Magnetico di Prossimitร  (attacco inferiore) Mรกgneses mezล‘ รฉrzรฉkelล‘ (Bottom Attack) Influรชncia magnรฉtica (ataque inferior) ะœะฐะณะฝะธั‚ะฝั‹ะน ัะตะฝัะพั€ (ะดะตั‚ะพะฝะฐั†ะธั ะฒะฒะตั€ั…) @@ -462,7 +462,7 @@ Keine Sprengladungen auf diesem Auslรถser. Ningรบn explosivo en el detonador. Pas d'explosif ร  mettre ร  feu. - Nessun esplosivo sul sensore. + Nessun esplosivo ลฝรกdnรก vรฝbuลกnina k odpรกlenรญ. Nincs robbanรณanyag a gyรบjtรณeszkรถzhรถz kรถtve. Brak ล‚adunkรณw na zapalnik. @@ -491,7 +491,7 @@ Robbanรณanyagok tรกvoli robbantรกsรกhoz Usado para detonar remotamente o explosivo quando solto. ะ˜ัะฟะพะปัŒะทัƒะตั‚ัั ะดะปั ะดะธัั‚ะฐะฝั†ะธะพะฝะฝะพะณะพ ะฟะพะดั€ั‹ะฒะฐ, ะฟะพัะปะต ัะผะตั€ั‚ะธ ะพะฟะตั€ะฐั‚ะพั€ะฐ. - Usato per attivare esplosivi al momento del rilascio + Usato per attivare a distanza esplosivi al momento del rilascio Pick up diff --git a/addons/hearing/stringtable.xml b/addons/hearing/stringtable.xml index ae7bea38a2..9e960f6d63 100644 --- a/addons/hearing/stringtable.xml +++ b/addons/hearing/stringtable.xml @@ -106,7 +106,7 @@ Vypnout pรญskรกnรญ v uลกรญch Wyล‚ฤ…cz dzwonienie w uszach Fรผlcsengรฉs letiltรกsa - Disabilita il ronzio + Disabilita i fischi nelle orecchie Desabilitar zumbido de ouvidos diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 0e6e89b74c..19296083a6 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -119,7 +119,7 @@ ะœะตะฝัŽ ะฒะทะฐะธะผะพะดะตะนัั‚ะฒะธั (ั ัะพะฑะพะน) Cselekvล‘ menรผ (sajรกt) Menu de Interaรงรฃo (Individual) - Menรน interazione (Individuale) + Menรน interazione (individuale) Open / Close Door @@ -263,7 +263,7 @@ ะ–ะตัั‚ั‹ Kรฉzjelek Gestos - Segnali gestuali + Gesti Attack @@ -443,7 +443,7 @@ Nฤ›kdo tฤ› poklepal na PRAVร‰ rameno ะ’ะฐั ะฟะพั…ะปะพะฟะฐะปะธ ะฟะพ ะŸะ ะะ’ะžะœะฃ ะฟะปะตั‡ัƒ Vocรช foi tocado no ombro - Ti รจ stato dato un colpetto sulla spalla + Ti รจ stato dato un colpetto sulla spalla destra You were tapped on the LEFT shoulder. @@ -455,7 +455,7 @@ Nฤ›kdo tฤ› poklepal na LEVร‰ rameno ะ’ะฐั ะฟะพั…ะปะพะฟะฐะปะธ ะฟะพ ะ›ะ•ะ’ะžะœะฃ ะฟะปะตั‡ัƒ Vocรช foi tocado no ombro. - Ti รจ stato dato un colpetto sulla spalla + Ti รจ stato dato un colpetto sulla spalla sinistra Cancel @@ -503,7 +503,7 @@ A fรถldre! ะ›ะพะถะธััŒ! Abaixe-se! - A Terra! + A terra! Team Management @@ -575,6 +575,7 @@ Pล™iล™adit k ฤervenรฝm ะะฐะทะฝะฐั‡ะธั‚ัŒ ะฒ ะšั€ะฐัะฝัƒัŽ ะณั€ัƒะฟะฟัƒ Assigner ร  rouge + Assegna al team rosso Assign Green @@ -586,6 +587,7 @@ Pล™iล™adit k zelenรฝm ะะฐะทะฝะฐั‡ะธั‚ัŒ ะฒ ะ—ะตะปะตะฝัƒัŽ ะณั€ัƒะฟะฟัƒ Assigner ร  vert + Assegna al team verde Assign Blue @@ -597,6 +599,7 @@ Pล™iล™adit k modrรฝm ะะฐะทะฝะฐั‡ะธั‚ัŒ ะฒ ะกะธะฝัŽัŽ ะณั€ัƒะฟะฟัƒ Assigner ร  bleu + Assegna al team blu Assign Yellow @@ -608,6 +611,7 @@ Pล™iล™adit ke ลพlutรฝm ะะฐะทะฝะฐั‡ะธั‚ัŒ ะฒ ะ–ะตะปั‚ัƒัŽ ะณั€ัƒะฟะฟัƒ Assigner ร  jaune + Assegna al team giallo Join Red @@ -619,6 +623,7 @@ Pล™ipojit k ฤervenรฝm ะŸั€ะธัะพะตะดะธะฝะธั‚ัŒัั ะบ ะšั€ะฐัะฝะพะน ะณั€ัƒะฟะฟะต Rejoindre rouge + Unirsi al team rosso Join Green @@ -630,6 +635,7 @@ Pล™ipojit k zelenรฝm ะŸั€ะธัะพะตะดะธะฝะธั‚ัŒัั ะบ ะ—ะตะปะตะฝะพะน ะณั€ัƒะฟะฟะต Rejoindre vert + Unirsi al team verde Join Blue @@ -641,6 +647,7 @@ Pล™ipojit k modrรฝm ะŸั€ะธัะพะตะดะธะฝะธั‚ัŒัั ะบ ะกะธะฝะตะน ะณั€ัƒะฟะฟะต Rejoindre bleu + Unirsi al team blu Join Yellow @@ -652,6 +659,7 @@ Pล™ipojit ke ลพlutรฝm ะŸั€ะธัะพะตะดะธะฝะธั‚ัŒัั ะบ ะ–ั‘ะปั‚ะพะน ะณั€ัƒะฟะฟะต Rejoindre jaune + Unirsi al team giallo You joined Team %1 @@ -721,7 +729,7 @@ Tecla modificadora ะšะปะฐะฒะธัˆะฐ-ะผะพะดะธั„ะธะบะฐั‚ะพั€ Tecla Modificadora - Modifica tasto + Tasto modifica Mรณdosรญtรณ billentyลฑ Modifikรกtor @@ -735,7 +743,7 @@ Hatรณtรกvolsรกgon kรญvรผl Poza zasiฤ™giem Mimo dosah - Non in raggio + Fuori limite Equipment @@ -758,8 +766,8 @@ Odstrฤit Tolรกs ะขะพะปะบะฐั‚ัŒ - Spingi Empurrar + Spingere Interact @@ -770,7 +778,7 @@ Interakcja Interactuar Cselekvรฉs - Interagisci + Interagire Interagir diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index e522e215ef..9cfc7e15d5 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -83,7 +83,7 @@ Injecter de la morphine Morfium beadรกsa Injetar Morfina - Inietta Morfina + Inietta morfina Transfuse Blood @@ -95,7 +95,7 @@ Transfusion Infรบziรณ (vรฉr) Transfundir Sangue - Effettua trasfusione di sangue + Trasfusione di sangue Transfuse Plasma @@ -106,7 +106,7 @@ Transfuser du Plasma ะŸะตั€ะตะปะธั‚ัŒ ะฟะปะฐะทะผัƒ Infรบziรณ (vรฉrplazma) - Effettua trasfusione di plasma + Trasfusione di Plasma Transfundir Plasma @@ -118,7 +118,7 @@ Transfuser de la solution saline ะŸะตั€ะตะปะธั‚ัŒ ั„ะธะทั€ะฐัั‚ะฒะพั€ Infรบziรณ (sรณs vรญz) - Effettua trasfusione di soluzione salina + Trasfusione di soluzione salina Transfundir Soro @@ -274,7 +274,7 @@ Transfusion de saline ... ะŸะตั€ะตะปะธะฒะฐะฝะธะต ั„ะธะทั€ะฐัั‚ะฒะพั€ะฐ ... Infรบziรณ sรณs vizzel ... - Effettuo la rasfusione di salina + Effettuo la rasfusione di soluzione salina Transfundindo Soro... @@ -370,7 +370,7 @@ QuikClot Hรฉmostatique QuikClot - QuikClot(polvere emostatica) + QuikClot (polvere emostatica) QuikClot @@ -632,7 +632,7 @@ Natychmiastowy Urgence Immรฉdiate Sofort - Okamลพiรฝ + Okamลพitรฝ Azonnali Immediata Imediato @@ -801,7 +801,7 @@ Bandage fait d'un matรฉriel spรฉcial utilisรฉ pour couvrir une blessure, qui peut etre appliquรฉ dรจs que le saignement a รฉtรฉ stoppรฉ. Opatrunek materiaล‚owy, uลผywany do przykrywania ran, zakล‚adany na ranฤ™ po zatamowaniu krwawienia. Egy kรผlรถnleges anyagรบ kรถtszer sebek betakarรกsรกra, amelyet a vรฉrzรฉs elรกllรญtรกsa utรกn helyeznek fel. - Una benda apposita, utilizzata per coprire una ferita, la quale รจ applicata sopra di essa una volta fermata l'emorragia. + Una benda apposita, utilizzata per coprire una ferita, la quale viene applicata su di essa una volta fermata l'emorragia. Uma curativo, material especรญfico para cobrir um ferimento que รฉ aplicado assim que o sangramento รฉ estancando. Obvaz je vhodnรฝm zpลฏsobem upravenรฝ sterilnรญ materiรกl, urฤenรฝ k pล™ekrytรญ rรกny, pล™รญpadnฤ› k fixaci poranฤ›nรญ. @@ -825,7 +825,7 @@ Utilisรฉ pour couvrir des blessures de taille moyenne ร  grande. Arrรชte l'hรฉmorragies Uลผywany w celu opatrywania ล›rednich i duลผych ran oraz tamowania krwawienia. Kรถzepestล‘l nagyig terjedล‘ sebek betakarรกsรกra รฉs vรฉrzรฉs elรกllรญtรกsรกra hasznรกlt kรถtszer - Usato su medie o larghe ferite per fermare emorragie. + Usato su ferite medie o larghe per fermare emorragie. Usado para o preenchimento de cavidades geradas por ferimentos mรฉdios e grandes e estancar o sangramento. Pouลพรญvรก se k zastavenรญ stล™ednรญch aลพ silnฤ›jลกรญch krvรกcenรญ @@ -850,7 +850,7 @@ Bandaลผ (elastyczny) Obvaz (elastickรฝ) Rรถgzรญtรณ kรถtszer - Benda (Elastica) + Benda (elastica) Bandagem (Elรกstica) @@ -861,7 +861,7 @@ Bandage compressif รฉlastique Zestaw bandaลผy elastycznych. Rugalmas kรถtszercsomag, "rรถgzรญtล‘" - Kit bendaggio, elastico + Kit di bendaggio, elastico Kit de Bandagem, Elรกstica Sada obvazลฏ, Elastickรก @@ -873,7 +873,7 @@ Elastyczna opaska podtrzymujฤ…ca opatrunek oraz usztywniajฤ…ca okolice stawรณw. Brinda una compresiรณn uniforme y ofrece soporte extra a una zona lesionada Egyenletes nyomรกst รฉs tรกmogatรกst biztosรญt a sebesรผlt felรผletnek. - Permette di comprimevere e aiutare la zone ferita. + Permette di comprimere e aiutare la zone ferita. Esta bandagem pode ser utilizada para comprimir o ferimento e diminuir o sangramento e garantir que o ferimento nรฃo abra em movimento. Hodรญ se k fixaฤnรญm รบฤelลฏm a to i v oblastech kloubลฏ. @@ -958,7 +958,7 @@ Atropin Autoinjektor Autoinjektor atropin Atropin autoinjektor - Autoiniettore di Atropina + Autoiniettore di atropina Auto-injetor de Atropina @@ -994,7 +994,7 @@ Epiniphrin Autoinjektor Autoinjektor adrenalin Epinefrin autoinjektor - Autoiniettore di Epinefrina + Autoiniettore di epinefrina Auto-injetor de epinefrina @@ -1271,6 +1271,7 @@ Elsล‘segรฉlycsomag, terepen valรณ sebvarrรกshoz รฉs haladรณ ellรกtรกshoz Kit de primeiros socorros para sutura ou tratamentos avanรงados Osobnรญ lรฉkรกrniฤka obsahuje zdravotnickรฝ materiรกl umoลพลˆujรญcรญ ลกitรญ a pokroฤilejลกรญ oลกetล™ovรกnรญ ranฤ›nรฝch v poli + Pronto soccorso personale da campo per mettersi i punti o per trattamenti avanzati. Use Personal Aid Kit @@ -1282,13 +1283,14 @@ Elsล‘segรฉlycsomag hasznรกlata Usar o kit de primeiros socorros Pouลพรญt osobnรญ lรฉkรกrniฤku + Usa il pronto soccorso personale Surgical Kit Trousse chirurgicale ะฅะธั€ัƒั€ะณะธั‡ะตัะบะธะน ะฝะฐะฑะพั€ Kit quirรบrgico - Zestaw chirurgiczny + Zestaw do szycia ran Operationsset Sebรฉszeti kรฉszlet Kit chirurgico @@ -1583,10 +1585,6 @@ %1 zkontroloval srdeฤnรญ tep: %2 %1 verificou a frequรชncia cardรญaca: %2 - - None - Brak - Weak Schwach @@ -1781,7 +1779,7 @@ He's lost some blood - Ha perso molto sangue + Ha perso sangue Ha perdido un poco de sangre ะ•ัั‚ัŒ ะบั€ะพะฒะพะฟะพั‚ะตั€ั Er hat etwas Blut verloren @@ -1801,6 +1799,7 @@ Il a perdu beaucoup de sang Ztratil hodnฤ› krve Ele perdeu muito sangue + Ha perso molto sangue He hasn't lost blood @@ -2244,6 +2243,7 @@ Styl menu (Zdravotnรญ) Estilo do menu (Mรฉdico) Menรผ stรญlusa (Orvosi) + Stile del menรน (medico) Select the type of menu you prefer; default 3d selections or radial. @@ -2255,6 +2255,7 @@ Selecione o tipo de menu que vocรช prefere; padrรฃo seleรงรตes 3d ou radial. Vรกlaszd ki a neked megfelelล‘ menรผt: Alapรฉrtelmezett 3D vรกlogatรกs, vagy kerek. Zvolte typ menu: zรกkladnรญ 3D vรฝbฤ›r nebo kruhovรฝ + Seleziona il tipo di menรน che preferisci: selezione 3d predefinita o radiale. Selections (3d) @@ -2266,6 +2267,7 @@ Seleรงรฃo (3d) Vรกlasztรฉkok (3D) 3D vรฝbฤ›r + Selezione (3D) Radial @@ -2277,6 +2279,7 @@ Radial Kerek Kruhovรฝ + Radiale Scrape @@ -2684,6 +2687,7 @@ Tratando ... Tratando... Oลกetล™uji ... + Curando ... Removing Tourniquet ... @@ -2695,6 +2699,7 @@ ร‰rszorรญtรณ eltรกvolรญtรกsa ... Sundavรกm ลกkrtidlo ... ะกะฝัั‚ะธะต ะถะณัƒั‚ะฐ ... + Togliendo il laccio emostatico ... ACE Medical diff --git a/addons/missileguidance/stringtable.xml b/addons/missileguidance/stringtable.xml index ef9bdeea26..24149e61a0 100644 --- a/addons/missileguidance/stringtable.xml +++ b/addons/missileguidance/stringtable.xml @@ -1,113 +1,113 @@ -๏ปฟ - - - - Advanced Missile Guidance - Guiado Avanzado de Misiles - Guidage avancรฉ de missile - Zaawansowane naprowadzanie rakiet - Erweitertes Raketenlenksystem - Pokroฤilรฉ ล™รญzenรญ stล™el - Guida missili avanzata - Avanรงado Missile Guidance - Fejlett rakรฉtairรกnyรญtรณ - ะŸั€ะพะดะฒะธะฝัƒั‚ะพะต ะฝะฐะฒะตะดะตะฝะธะต ั€ะฐะบะตั‚ - - - Advanced missile guidance, or AMG, provides multiple enhancements to missile locking and firing. It is also a framework required for missile weapon types. - Zaawansowane namierzanie rakiet, lub ZNR, dostarcza wiele poprawek do systemu namierzania rakiet oraz dodaje nowe tryby strzaล‚u. Jest to wymagana opcja dla broni rakietowych. - Guida dei missili avanzata, o AMG, offre diversi miglioramenti alla teleguida di missili. E' anche un sistema necessario per i tipi di armi missile. - ะŸั€ะพะดะฒะธะฝัƒั‚ะพะต ะฝะฐะฒะตะดะตะฝะธะต ั€ะฐะบะตั‚, ะธะปะธ ะŸะะ , ะพะฑะตัะฟะตั‡ะธะฒะฐะตั‚ ะผะฝะพะถะตัั‚ะฒะพ ัƒัะพะฒะตั€ัˆะตัั‚ะฒะพะฒะฐะฝะธะน ะดะปั ะฝะฐะฒะตะดะตะฝะธั ะธ ัั‚ั€ะตะปัŒะฑั‹ ั€ะฐะบะตั‚. ะขะฐะบะถะต, ัั‚ะพ ัะธัั‚ะตะผะฐ, ะฝะตะพะฑั…ะพะดะธะผะฐั ะดะปั ะฒัะตั… ั€ะฐะบะตั‚ะฝั‹ั… ั‚ะธะฟะพะฒ ะพั€ัƒะถะธั. - Guiado Avanzado de Misiles, o AMG en sus siglas en inglรฉs, ofrece mรบltiples mejoras en el fijado y disparo de misiles. Es tambiรฉn un sistema requerido para armas de tipo misil. - Das Erweiterte Raketenlenksystem, auch ERls genannt, bietet viele Verbesserungen zum Aufschalten und Feuern mittels gelenkten Raketen. - Le guidage avancรฉ de missile, ou AMG en anglais, apporte de multiple amรฉliorations au verouillage et au tir de missiles. C'est aussi un framework requis pour tout arme de type missile. - A fejlett rakรฉtairรกnyรญtรณ (vagy AMG) tรถbbfรฉle mรณdosรญtรกst tartalmaz a rakรฉtรกk cรฉlkรถvetรฉsรฉhez รฉs tรผzelรฉsรฉhez. Ez egy szรผksรฉges keresztrendszer a rakรฉta-alapรบ fegyverekhez. - Orientaรงรฃo avanรงada de mรญsseis ou OAM, fornece vรกrios aprimoramentos para travamento de mรญsseis e disparos. Tambรฉm รฉ um sistema requerido para disparar armas que utilizem mรญsseis. - Pokoฤilรฉ navรกdฤ›nรญ raket (AMG) poskytuje nฤ›kolik vylepลกenรญ pro lepลกรญ zamฤ›ล™enรญ a nรกslednou stล™elbu. Je to prvek vyลพadovanรฝ u typu zbranรญ jako jsou rakety. - - - Hydra-70 DAGR Missile - Misil Hydra-70 DAGR - Hydra-70 DAGR - Hydra-70 DAGR - Hydra-70 DAGR Rackete - Hydra-70 DAGR - Missile Hydra-70 DAGR - Mรญssil Hydra-70 DAGR - Hydra-70 DAGR rakรฉta - Hydra-70 DAGR - - - DAGR - DAGR - DAGR - DAGR - DAGR - DAGR - DAGR - DAGR - DAGR - DAGR - - - Hydra-70 DAGR Laser Guided Missile - Misil guiado por lรกser Hydra-70 DAGR - Missile ร  guidage laser Hydra-70 DAGR - Laserowo naprowadzana rakieta Hydra-70 DAGR - Hydra-70 DAGR lasergelenkte Rakete - Hydra-70 DAGR laserem navรกdฤ›nรก stล™ela - Hydra-70 DAGR missile guida laser - Mรญssil guiado a laser Hydra-70 DAGR - Hydra-70 DAGR lรฉzer-irรกnyรญtott rakรฉta - ะฃะฟั€ะฐะฒะปัะตะผะฐั ั€ะฐะบะตั‚ะฐ ะปะฐะทะตั€ะฝะพะณะพ ะฝะฐะฒะตะดะตะฝะธั Hydra-70 DAGR - - - Hellfire II AGM-114K Missile - Misil Hellfire II AGM-114K - Hellfire II AGM-114K - Hellfire II AGM-114K - Hellfire II AGM-114K - Hellfire II AGM-114K - Missile Hellfire II AGM-114K - Mรญssil Hellfire II AGM-114K - Hellfire II AGM-114K rakรฉta - Hellfire II AGM-114K - - - AGM-114K - AGM-114K - AGM-114K - AGM-114K - AGM-114K - AGM-114K - AGM-114K - AGM-114K - AGM-114K - AGM-114K - - - Hellfire II AGM-114K Laser Guided Missile - Misil guiado por lรกser Hellfire II AGM-114K - Missile ร  guidage laser Hellfire II AGM-114K - Laserowo naprowadzana rakieta Hellfire II AGM-114K - Hellfire II AGM-114K Lasergelenkte Rakete - Hellfire II AGM-114K laserem navรกdฤ›nรก stล™ela - Missile guida laser Hellfire II AGM-114K - Mรญssil guiado a laser Hellfire II AGM-114K - Hellfire II AGM-114K lรฉzer-irรกnyรญtott rakรฉta - ะฃะฟั€ะฐะฒะปัะตะผะฐั ั€ะฐะบะตั‚ะฐ ะปะฐะทะตั€ะฝะพะณะพ ะฝะฐะฒะตะดะตะฝะธั Hellfire II AGM-114K - - - Off - Wyล‚ฤ…cz - - - Player Only - Tylko gracz - - - Player and AI - Gracz oraz AI - - - +๏ปฟ + + + + Advanced Missile Guidance + Guiado Avanzado de Misiles + Guidage avancรฉ de missile + Zaawansowane naprowadzanie rakiet + Erweitertes Raketenlenksystem + Pokroฤilรฉ ล™รญzenรญ stล™el + Guida missili avanzata + Avanรงado Missile Guidance + Fejlett rakรฉtairรกnyรญtรณ + ะŸั€ะพะดะฒะธะฝัƒั‚ะพะต ะฝะฐะฒะตะดะตะฝะธะต ั€ะฐะบะตั‚ + + + Advanced missile guidance, or AMG, provides multiple enhancements to missile locking and firing. It is also a framework required for missile weapon types. + Zaawansowane namierzanie rakiet, lub ZNR, dostarcza wiele poprawek do systemu namierzania rakiet oraz dodaje nowe tryby strzaล‚u. Jest to wymagana opcja dla broni rakietowych. + Guida dei missili avanzata, o AMG, offre diversi miglioramenti alla teleguida di missili. E' anche un sistema necessario per i tipi di armi missile. + ะŸั€ะพะดะฒะธะฝัƒั‚ะพะต ะฝะฐะฒะตะดะตะฝะธะต ั€ะฐะบะตั‚, ะธะปะธ ะŸะะ , ะพะฑะตัะฟะตั‡ะธะฒะฐะตั‚ ะผะฝะพะถะตัั‚ะฒะพ ัƒัะพะฒะตั€ัˆะตัั‚ะฒะพะฒะฐะฝะธะน ะดะปั ะฝะฐะฒะตะดะตะฝะธั ะธ ัั‚ั€ะตะปัŒะฑั‹ ั€ะฐะบะตั‚. ะขะฐะบะถะต, ัั‚ะพ ัะธัั‚ะตะผะฐ, ะฝะตะพะฑั…ะพะดะธะผะฐั ะดะปั ะฒัะตั… ั€ะฐะบะตั‚ะฝั‹ั… ั‚ะธะฟะพะฒ ะพั€ัƒะถะธั. + Guiado Avanzado de Misiles, o AMG en sus siglas en inglรฉs, ofrece mรบltiples mejoras en el fijado y disparo de misiles. Es tambiรฉn un sistema requerido para armas de tipo misil. + Das Erweiterte Raketenlenksystem, auch ERls genannt, bietet viele Verbesserungen zum Aufschalten und Feuern mittels gelenkten Raketen. + Le guidage avancรฉ de missile, ou AMG en anglais, apporte de multiple amรฉliorations au verouillage et au tir de missiles. C'est aussi un framework requis pour tout arme de type missile. + A fejlett rakรฉtairรกnyรญtรณ (vagy AMG) tรถbbfรฉle mรณdosรญtรกst tartalmaz a rakรฉtรกk cรฉlkรถvetรฉsรฉhez รฉs tรผzelรฉsรฉhez. Ez egy szรผksรฉges keresztrendszer a rakรฉta-alapรบ fegyverekhez. + Orientaรงรฃo avanรงada de mรญsseis ou OAM, fornece vรกrios aprimoramentos para travamento de mรญsseis e disparos. Tambรฉm รฉ um sistema requerido para disparar armas que utilizem mรญsseis. + Pokoฤilรฉ navรกdฤ›nรญ raket (AMG) poskytuje nฤ›kolik vylepลกenรญ pro lepลกรญ zamฤ›ล™enรญ a nรกslednou stล™elbu. Je to prvek vyลพadovanรฝ u typu zbranรญ jako jsou rakety. + + + Hydra-70 DAGR Missile + Misil Hydra-70 DAGR + Hydra-70 DAGR + Hydra-70 DAGR + Hydra-70 DAGR Rackete + Hydra-70 DAGR + Missile Hydra-70 DAGR + Mรญssil Hydra-70 DAGR + Hydra-70 DAGR rakรฉta + Hydra-70 DAGR + + + DAGR + DAGR + DAGR + DAGR + DAGR + DAGR + DAGR + DAGR + DAGR + DAGR + + + Hydra-70 DAGR Laser Guided Missile + Misil guiado por lรกser Hydra-70 DAGR + Missile ร  guidage laser Hydra-70 DAGR + Laserowo naprowadzana rakieta Hydra-70 DAGR + Hydra-70 DAGR lasergelenkte Rakete + Hydra-70 DAGR laserem navรกdฤ›nรก stล™ela + Hydra-70 DAGR missile guida laser + Mรญssil guiado a laser Hydra-70 DAGR + Hydra-70 DAGR lรฉzer-irรกnyรญtott rakรฉta + ะฃะฟั€ะฐะฒะปัะตะผะฐั ั€ะฐะบะตั‚ะฐ ะปะฐะทะตั€ะฝะพะณะพ ะฝะฐะฒะตะดะตะฝะธั Hydra-70 DAGR + + + Hellfire II AGM-114K Missile + Misil Hellfire II AGM-114K + Hellfire II AGM-114K + Hellfire II AGM-114K + Hellfire II AGM-114K + Hellfire II AGM-114K + Missile Hellfire II AGM-114K + Mรญssil Hellfire II AGM-114K + Hellfire II AGM-114K rakรฉta + Hellfire II AGM-114K + + + AGM-114K + AGM-114K + AGM-114K + AGM-114K + AGM-114K + AGM-114K + AGM-114K + AGM-114K + AGM-114K + AGM-114K + + + Hellfire II AGM-114K Laser Guided Missile + Misil guiado por lรกser Hellfire II AGM-114K + Missile ร  guidage laser Hellfire II AGM-114K + Laserowo naprowadzana rakieta Hellfire II AGM-114K + Hellfire II AGM-114K Lasergelenkte Rakete + Hellfire II AGM-114K laserem navรกdฤ›nรก stล™ela + Missile guida laser Hellfire II AGM-114K + Mรญssil guiado a laser Hellfire II AGM-114K + Hellfire II AGM-114K lรฉzer-irรกnyรญtott rakรฉta + ะฃะฟั€ะฐะฒะปัะตะผะฐั ั€ะฐะบะตั‚ะฐ ะปะฐะทะตั€ะฝะพะณะพ ะฝะฐะฒะตะดะตะฝะธั Hellfire II AGM-114K + + + Off + Wyล‚ฤ…cz + + + Player Only + Tylko gracz + + + Player and AI + Gracz oraz AI + + + diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index 495db21df7..aa78e83645 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -239,6 +239,7 @@ UI Skalierung Beรกllรญtรกsmenรผ kezelล‘felรผletรฉnek skรกlรกzรกsa Escalar o menu de opรงรตes + Proporzioni della interfaccia utente Allow Config Export [ACE] From ed1acd8c15089324690a4a476d542abed27f38ee Mon Sep 17 00:00:00 2001 From: GieNkoV Date: Tue, 12 May 2015 19:42:35 +0200 Subject: [PATCH 122/172] Some small errors fixed #2 Mainly tabs and wrong italian strings (got those from newest master) --- addons/common/stringtable.xml | 6 +++--- addons/interaction/stringtable.xml | 18 +++++++++--------- addons/nametags/stringtable.xml | 8 ++++---- addons/optionsmenu/stringtable.xml | 16 ++++++++-------- addons/respawn/stringtable.xml | 2 ++ 5 files changed, 26 insertions(+), 24 deletions(-) diff --git a/addons/common/stringtable.xml b/addons/common/stringtable.xml index 8f5ebe7191..1b960de982 100644 --- a/addons/common/stringtable.xml +++ b/addons/common/stringtable.xml @@ -308,11 +308,11 @@ Aceptar peticiones Akceptuj proล›by Pล™ijmout ลพรกdost - Accetta la richiesta Accepter requรชte ะŸั€ะธะฝัั‚ัŒ ะทะฐะฟั€ะพัั‹ Kรฉrรฉsek elfogadรกsa Aceitar Pedido + Accetta la richiesta Decline Requests @@ -320,11 +320,11 @@ Rechazar peticiones Ignoruj proล›by Zamรญtnout ลพรกdost - Rifiuta la richiesta ะžั‚ะบะปะพะฝะธั‚ัŒ ะทะฐะฟั€ะพัั‹ Rejeter requรชte Kรฉrรฉsek elutasรญtรกsa Rejeitar pedido + Rifiuta la richiesta Accept Requests send by other players. These can be requests to use / share equipment, perform certain actions. @@ -438,7 +438,7 @@ 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. Wรคhle die Textfarbe fรผr ACE-Hinweise. Die gewรคhlte Farbe wird als Standartfarbe der Hinweise angezeigt, wenn der Hinweis selbst keine spezifische Farbe hat. El color del texto de las notificaciones del ACE. Este es el color predeterminado para todo el texto que se muestra a travรฉs del sistema de notificaciones del ACE, si el texto de notificaciรณn no tiene otro color especificado. - Il colore del testo dei suggerimenti dell'ACE. Questo รจ il colore standard per tutti i caratteri mostrati dal sistema di suggerimenti dell'ACE, se il colore del testo non รจ specificato. + Il colore del testo dei suggerimenti di ACE. Questo รจ il colore predefinito per tutto il testo mostrato dal sistema di suggerimenti di ACE quando il colore del testo non ha altro colore specificato. ะฆะฒะตั‚ ัˆั€ะธั„ั‚ะฐ ั‚ะตะบัั‚ะฐ ะฒัะฟะปั‹ะฒะฐัŽั‰ะธั… ะฟะพะดัะบะฐะทะพะบ ะะกะ•. ะญั‚ะพั‚ ั†ะฒะตั‚ ัะฒะปัะตั‚ัั ัั‚ะฐะฝะดะฐั€ั‚ะฝั‹ะผ ะดะปั ะฒัะตะณะพ ั‚ะตะบัั‚ะฐ, ั‚ั€ะฐะฝัะปะธั€ัƒัŽั‰ะตะณะพัั ั‡ะตั€ะตะท ัะธัั‚ะตะผัƒ ะฟะพะดัะบะฐะทะพะบ ะะกะ•, ะตัะปะธ ะฝะต ัƒัั‚ะฐะฝะพะฒะปะตะฝะพ ะดั€ัƒะณะพะณะพ ั†ะฒะตั‚ะฐ ะดะปั ั‚ะตะบัั‚ะฐ ะฟะพะดัะบะฐะทะพะบ. Kolor tekstu dla powiadomieล„ ACE. Ten kolor jest domyล›lnym dla wszystkich tekstรณw wyล›wietlanych poprzez System Powiadomieล„ ACE, jeลผeli dla powiadomienia nie okreล›lono innego koloru. Notification ACE: couleur du texte. C'est la couleur par dรฉfaut de tout texte affichรฉ dans les notifications ACE, si aucune couleur n'est spรฉcifiรฉe pour les notifications diff --git a/addons/interaction/stringtable.xml b/addons/interaction/stringtable.xml index 19296083a6..b2e75ccdff 100644 --- a/addons/interaction/stringtable.xml +++ b/addons/interaction/stringtable.xml @@ -575,7 +575,7 @@ Pล™iล™adit k ฤervenรฝm ะะฐะทะฝะฐั‡ะธั‚ัŒ ะฒ ะšั€ะฐัะฝัƒัŽ ะณั€ัƒะฟะฟัƒ Assigner ร  rouge - Assegna al team rosso + Assegna al team rosso Assign Green @@ -587,7 +587,7 @@ Pล™iล™adit k zelenรฝm ะะฐะทะฝะฐั‡ะธั‚ัŒ ะฒ ะ—ะตะปะตะฝัƒัŽ ะณั€ัƒะฟะฟัƒ Assigner ร  vert - Assegna al team verde + Assegna al team verde Assign Blue @@ -599,7 +599,7 @@ Pล™iล™adit k modrรฝm ะะฐะทะฝะฐั‡ะธั‚ัŒ ะฒ ะกะธะฝัŽัŽ ะณั€ัƒะฟะฟัƒ Assigner ร  bleu - Assegna al team blu + Assegna al team blu Assign Yellow @@ -611,7 +611,7 @@ Pล™iล™adit ke ลพlutรฝm ะะฐะทะฝะฐั‡ะธั‚ัŒ ะฒ ะ–ะตะปั‚ัƒัŽ ะณั€ัƒะฟะฟัƒ Assigner ร  jaune - Assegna al team giallo + Assegna al team giallo Join Red @@ -623,7 +623,7 @@ Pล™ipojit k ฤervenรฝm ะŸั€ะธัะพะตะดะธะฝะธั‚ัŒัั ะบ ะšั€ะฐัะฝะพะน ะณั€ัƒะฟะฟะต Rejoindre rouge - Unirsi al team rosso + Unirsi al team rosso Join Green @@ -635,7 +635,7 @@ Pล™ipojit k zelenรฝm ะŸั€ะธัะพะตะดะธะฝะธั‚ัŒัั ะบ ะ—ะตะปะตะฝะพะน ะณั€ัƒะฟะฟะต Rejoindre vert - Unirsi al team verde + Unirsi al team verde Join Blue @@ -647,7 +647,7 @@ Pล™ipojit k modrรฝm ะŸั€ะธัะพะตะดะธะฝะธั‚ัŒัั ะบ ะกะธะฝะตะน ะณั€ัƒะฟะฟะต Rejoindre bleu - Unirsi al team blu + Unirsi al team blu Join Yellow @@ -659,7 +659,7 @@ Pล™ipojit ke ลพlutรฝm ะŸั€ะธัะพะตะดะธะฝะธั‚ัŒัั ะบ ะ–ั‘ะปั‚ะพะน ะณั€ัƒะฟะฟะต Rejoindre jaune - Unirsi al team giallo + Unirsi al team giallo You joined Team %1 @@ -767,7 +767,7 @@ Tolรกs ะขะพะปะบะฐั‚ัŒ Empurrar - Spingere + Spingere Interact diff --git a/addons/nametags/stringtable.xml b/addons/nametags/stringtable.xml index 070257e807..1a0a2f1369 100644 --- a/addons/nametags/stringtable.xml +++ b/addons/nametags/stringtable.xml @@ -70,8 +70,8 @@ Zobrazit info o posรกdce vozidla ะŸะพะบะฐะทั‹ะฒะฐั‚ัŒ ะธะฝั„ะพั€ะผะฐั†ะธัŽ ะพะฑ ัะบะธะฟะฐะถะต Jรกrmลฑ-legรฉnysรฉg adatainak mutatรกsa - Mostra le informazioni sull'equipaggio del veicolo Mostrar tripulantes + Mostra l'elenco del personale a bordo Show name tags for AI units @@ -82,7 +82,7 @@ Wyล›wietl imiona jednostek AI Afficher les noms des IA Nรฉvcรญmkรฉk mutatรกsa MI-egysรฉgeknรฉl - Mostra le tag nomi per le unitร  AI + Mostra i nomi delle le unitร  AI Mostrar nomes para unidades de IA @@ -94,7 +94,7 @@ Pokaลผ fale dลบwiฤ™kowe (wymagana opcja Pokaลผ imiona graczy) Afficher "qui parle" (si noms affichรฉs) "Hanghullรกmok" mutatรกsa (a nevek mutatรกsa szรผksรฉges) - Mostra barra movimento audio (richiede mostra nomi abilitato) + Mostra movimento audio (richiede mostra nomi abilitato) Mostrar onda sonora (requer nome de jogadores) @@ -106,7 +106,7 @@ Couleur d'affichage par dรฉfaut (si dans aucun groupe) Standardnรญ barva jmenovek (pro neฤleny jednotky) Alap nรฉvcรญmke-szรญn (csoporton kรญvรผli szemรฉlyek) - Colore nametag di default (membri non del gruppo) + Colore dei nomi non appartenenti al gruppo Cor padrรฃo do nome (unidades fora do grupo) diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index aa78e83645..18ee57310a 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -239,7 +239,7 @@ UI Skalierung Beรกllรญtรกsmenรผ kezelล‘felรผletรฉnek skรกlรกzรกsa Escalar o menu de opรงรตes - Proporzioni della interfaccia utente + Proporzioni della interfaccia utente Allow Config Export [ACE] @@ -257,31 +257,31 @@ When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard. Jeลผeli ustawione na zezwรณl, wtedy bฤ™dziesz mieฤ‡ dostฤ™p do ekranu modyfikacji wszystich ustawieล„ i zmiennych ACE, a takลผe bฤ™dziesz mieฤ‡ moลผliwoล›ฤ‡ eksportu tychลผe ustawieล„ do formatu rozpoznawalnego przez userconfig serwera. Klikniฤ™cie opcji Eksportuj skopiuje wszystkie ustawienia do schowka. Dziaล‚a tylko w trybie SP. - + Hide Ukryj - + Top right, downwards Po prawej u gรณry, w dรณล‚ - + Top right, to the left Po prawej u gรณry, do lewej - + Top left, downwards Po lewej u gรณry, w dรณล‚ - + Top left, to the right Po lewej u gรณry, do prawej - + Top Gรณra - + Bottom Dรณล‚ diff --git a/addons/respawn/stringtable.xml b/addons/respawn/stringtable.xml index 5351d0f3bc..d7d5b7ac98 100644 --- a/addons/respawn/stringtable.xml +++ b/addons/respawn/stringtable.xml @@ -35,6 +35,7 @@ Tรฉlรฉportation ร  la base Teletransportar para a Base Bรกzisra teleportรกlรกs + Teleporta alla base Teleport to Rallypoint @@ -46,6 +47,7 @@ Tรฉlรฉporation au point de ralliement Teletransportar para o ponto de encontro Gyรผlekezล‘pontra teleportรกlรกs + Teleporta al rallypoint Teleported to Base From 1610221a70d516b536602f0a114282458f2eb662 Mon Sep 17 00:00:00 2001 From: GieNkoV Date: Tue, 12 May 2015 20:01:10 +0200 Subject: [PATCH 123/172] Remove duplicated strings --- addons/captives/stringtable.xml | 8 - addons/medical/stringtable.xml | 372 ----------------------------- addons/mk6mortar/stringtable.xml | 32 --- addons/optionsmenu/stringtable.xml | 44 ---- 4 files changed, 456 deletions(-) diff --git a/addons/captives/stringtable.xml b/addons/captives/stringtable.xml index 0d01cbafc6..07cf780e19 100644 --- a/addons/captives/stringtable.xml +++ b/addons/captives/stringtable.xml @@ -201,13 +201,5 @@ Sync a unit to make them surrender.<br />Source: ace_captives Zsynchronizuj z jednostkฤ… aby sprawiฤ‡ by siฤ™ poddaล‚a<br />ลนrรณdล‚o: ace_captives - - Make Unit Surrender - Poddaj siฤ™! - - - Sync a unit to make them surrender.<br />Source: ace_captives - Zsynchronizuj z jednostkฤ… aby sprawiฤ‡ by siฤ™ poddaล‚a<br />ลนrรณdล‚o: ace_captives - diff --git a/addons/medical/stringtable.xml b/addons/medical/stringtable.xml index 9cfc7e15d5..a5ffc6a4ba 100644 --- a/addons/medical/stringtable.xml +++ b/addons/medical/stringtable.xml @@ -3065,378 +3065,6 @@ [ACE] Medical Supply Crate (Advanced) [ACE] Skrzynka z zapasami medycznymi (zaawansowana) - - ACE Medical - ACE Opcje medyczne - - - Medical Settings [ACE] - Ustawienia medyczne [ACE] - - - Medical Level - Poziom medyczny - - - What is the medical simulation level? - Jaki jest poziom symulacji medycznej? - - - Basic - Podstawowy - - - Advanced - Zaawansowany - - - Medics setting - Poziom medykรณw - - - What is the level of detail prefered for medics? - Jaki jest poziom detali medycznych wyล›wietlanych dla medykรณw? - - - Disable medics - Wyล‚ฤ…cz medykรณw - - - Enable Litter - Aktywuj odpadki - - - Enable litter being created upon treatment - Twรณrz odpadki medyczne podczas leczenia - - - Life time of litter objects - Dล‚ugoล›ฤ‡ ลผycia odpadkรณw - - - How long should litter objects stay? In seconds. -1 is forever. - Ile czasu musi upล‚ynฤ…ฤ‡, aby odpadki zaczฤ™ล‚y znikaฤ‡? W sekundach. -1 dla nieskoล„czonoล›ci. - - - Enable Screams - Aktywuj wrzaski - - - Enable screaming by injuried units - Aktywuj wrzeszczenie z bรณlu przez ranne jednostki - - - Player Damage - Prรณg obraลผeล„ graczy - - - What is the damage a player can take before being killed? - Jaki jest prรณg obraลผeล„, jakie gracz moลผe otrzymaฤ‡ zanim zostanie zabity? - - - AI Damage - Prรณg obraลผeล„ AI - - - What is the damage an AI can take before being killed? - Jaki jest prรณg obraลผeล„, jakie AI moลผe otrzymaฤ‡ zanim zostanie zabite? - - - AI Unconsciousness - Nieprzytomnoล›ฤ‡ AI - - - Allow AI to go unconscious - Czy AI moลผe byฤ‡ nieprzytomne od odniesionych obraลผeล„? - - - Disabled - Wyล‚ฤ…czone - - - Enabled - Wล‚ฤ…czone - - - Prevent instant death - Wyล‚. natychmiast. ล›mierฤ‡ - - - Have a unit move to unconscious instead of death - Spraw, aby jednostka zostaล‚a przeniesiona do stanu nieprzytomnoล›ci zamiast ginฤ…ฤ‡ na miejscu od ล›miertelnych obraลผeล„ - - - Bleeding coefficient - Mnoลผnik krwawienia - - - Coefficient to modify the bleeding speed - Mnoลผnik modyfikujฤ…cy prฤ™dkoล›ฤ‡ wykrwawiania siฤ™ - - - Pain coefficient - Mnoลผnik bรณlu - - - Coefficient to modify the pain intensity - Mnoลผnik modyfikujฤ…cy intensywnoล›ฤ‡ bรณlu - - - Sync status - Synchronizuj status - - - Keep unit status synced. Recommended on. - Utrzymuj synchronizacjฤ™ statusu jednostek. Zalecane zostawienie tej opcji wล‚ฤ…czonej. - - - Provides a medical system for both players and AI. - Moduล‚ ten dostarcza system medyczny dla graczy oraz AI. - - - Advanced Medical Settings [ACE] - Zaawansowane ustawienia medyczne [ACE] - - - Enabled for - Aktywne dla - - - Select what units the advanced medical system will be enabled for - Wybierz dla kogo zaawansowany system medyczny bฤ™dzie aktywny - - - Players only - Tylko dla graczy - - - Players and AI - Gracze oraz AI - - - Enable Advanced wounds - Akt. zaawansowane rany - - - Allow reopening of bandaged wounds? - Pozwรณl na otwieranie siฤ™ zabandaลผowanych ran? - - - Vehicle Crashes - Obraลผenia od kolizji - - - Do units take damage from a vehicle crash? - Czy jednostki otrzymujฤ… obraลผenia w wyniku kolizji pojazdรณw? - - - Allow PAK - Ust. apteczek osobistych - - - Who can use the PAK for full heal? - Kto moลผe skorzystaฤ‡ z apteczki osobistej w celu peล‚nego uleczenia? - - - Anyone - Wszyscy - - - Medics only - Tylko medycy - - - Doctors only - Tylko doktorzy - - - Remove PAK on use - Usuล„ apteczkฤ™ po uลผyciu - - - Should PAK be removed on usage? - Czy apteczka osobista powinna zniknฤ…ฤ‡ z ekwipunku po jej uลผyciu? - - - No - Nie - - - Yes - Tak - - - Locations PAK - Ogr. apteczek osobistych - - - Where can the personal aid kit be used? - Gdzie moลผna korzystaฤ‡ z apteczek osobistych? - - - Anywhere - Wszฤ™dzie - - - Medical vehicles - Pojazdy medyczne - - - Medical facility - Budynki medyczne - - - Vehicles & facility - Pojazdy i budynki medyczne - - - Disabled - Wyล‚ฤ…czone - - - Allow Surgical kit (Adv) - Ust. zestawu chirurg. - - - Who can use the surgical kit? - Kto moลผe skorzystaฤ‡ z zestawu chirurgicznego w celu zszycia ran? - - - Remove Surgical kit (Adv) - Usuล„ zest. chir. po uลผyciu - - - Should Surgical kit be removed on usage? - Czy zestaw chirurgiczny powinien zniknฤ…ฤ‡ z ekwipunku po jego uลผyciu? - - - Locations Surgical kit (Adv) - Ogr. zestawu chirurg. - - - Where can the Surgical kit be used? - Gdzie moลผna korzystaฤ‡ z zestawu chirurgicznego? - - - Configure the treatment settings from ACE Medical - Skonfiguruj zaawansowane ustawienia leczenia systemu medycznego ACE - - - Revive Settings [ACE] - Ustawienia wskrzeszania [ACE] - - - Enable Revive - Aktywuj wskrzeszanie - - - Enable a basic revive system - Aktywuj podstawowy system wskrzeszania - - - Max Revive time - Maks. czas agonii - - - Max amount of seconds a unit can spend in revive state - Maksymalna dล‚ugoล›ฤ‡ agonii w sekundach (czas na wskrzeszenie) - - - Max Revive lives - Maks. iloล›ฤ‡ wskrzeszeล„ - - - Max amount of lives a unit. 0 or -1 is disabled. - Maksymalna iloล›ฤ‡ wskrzeszeล„. Wpisz 0 lub -1 aby wyล‚ฤ…czyฤ‡. - - - Provides a medical system for both players and AI. - Moduล‚ ten aktywuje podstawowy system wskrzeszania. Jednostka po otrzymaniu ล›miertelnych obraลผeล„ przechodzi do stanu agonii, ktรณra trwa okreล›lonฤ… dล‚ugoล›ฤ‡ czasu. W tym czasie aby wskrzesiฤ‡ i jednoczeล›nie odratowaฤ‡ jednostkฤ™ naleลผy opatrzeฤ‡ jej rany i wykonaฤ‡ RKO. - - - Set Medic Class [ACE] - Ustaw klasฤ™ medyka [ACE] - - - List - Lista - - - List of unit names that will be classified as medic, separated by commas. - Lista nazw jednostek, ktรณre sฤ… sklasyfikowane jako medycy, oddzielone przecinkami. - - - Is Medic - Klasa medyczna - - - - - - - None - ลปadna - - - Regular medic - Zwykล‚y medyk - - - Doctor (Only Advanced Medics) - Doktor (tylko zaawansowani medycy) - - - Assigns the ACE medic class to a unit - Moduล‚ ten przypisuje klasฤ™ medyka ACE do jednostek. - - - Set Medical Vehicle [ACE] - Ustaw pojazd medyczny [ACE] - - - List - Lista - - - List of vehicles that will be classified as medical vehicle, separated by commas. - Lista nazw pojazdรณw, ktรณre sฤ… sklasyfikowane jako pojazdy medyczne, oddzielone przecinkami. - - - Is Medical Vehicle - Jest pojazdem med. - - - Whatever or not the objects in the list will be a medical vehicle. - Czy pojazdy z tej listy sฤ… pojazdami medycznymi. - - - Assigns the ACE medic class to a unit - Moduล‚ ten pozwala na przypisanie danym pojazdom statusu pojazdรณw medycznych. Wewnฤ…trz takiego pojazdu moลผna wykonywaฤ‡ zaawansowane zabiegi medyczne. - - - Set Medical Facility [ACE] - Ustaw budynek medyczny [ACE] - - - Is Medical Facility - Jest budynkiem med. - - - Registers an object as a medical facility - Przypisuje danemu obiektowi status budynku medycznego - - - Defines an object as a medical facility. This allows for more advanced treatments. Can be used on buildings and vehicles. - Moduล‚ ten pozwala przypisaฤ‡ status budynku medycznego danemu obiektowi. Budynek taki pozwala na wykonywanie zaawansowanych zabiegรณw medycznych. Moลผe byฤ‡ uลผyte na pojazdach i budynkach. - - - [ACE] Medical Supply Crate (Basic) - [ACE] Skrzynka z zapasami medycznymi (podstawowa) - - - [ACE] Medical Supply Crate (Advanced) - [ACE] Skrzynka z zapasami medycznymi (zaawansowana) - diff --git a/addons/mk6mortar/stringtable.xml b/addons/mk6mortar/stringtable.xml index cb4a7c5376..37c7d322ad 100644 --- a/addons/mk6mortar/stringtable.xml +++ b/addons/mk6mortar/stringtable.xml @@ -81,37 +81,5 @@ Moduล‚ ten pozwala dostosowaฤ‡ ustawienia moลบdzierza MK6. - - MK6 Settings - Moลบdzierz MK6 - Ustawienia - - - Air Resistance - Opรณr powietrza - - - For Player Shots, Model Air Resistance and Wind Effects - Modeluj opรณr powietrza oraz wpล‚yw wiatru na tor lotu pocisku dla strzaล‚รณw z moลบdzierza MK6 przez graczy - - - Allow MK6 Computer - Komputer MK6 - - - Show the Computer and Rangefinder (these NEED to be removed if you enable air resistance) - Zezwรณl na komputer i dalmierz (opcja ta MUSI zostaฤ‡ wyล‚ฤ…czona jeลผeli aktywowaล‚eล› opรณr powietrza) - - - Allow MK6 Compass - Kompas MK6 - - - Show the MK6 Digital Compass - Pokaลผ kompas MK6 - - - - Moduล‚ ten pozwala dostosowaฤ‡ ustawienia moลบdzierza MK6. - diff --git a/addons/optionsmenu/stringtable.xml b/addons/optionsmenu/stringtable.xml index 18ee57310a..22a1a88cfa 100644 --- a/addons/optionsmenu/stringtable.xml +++ b/addons/optionsmenu/stringtable.xml @@ -285,49 +285,5 @@ Bottom Dรณล‚ - - Allow Config Export [ACE] - Pozwรณl na eksport ustawieล„ [ACE] - - - Allow - Zezwรณl - - - Allow export of all settings to a server config formatted. - Zezwรณl na eksport wszystkich ustawieล„ do formatu konfiguracji serwera. - - - When allowed, you have access to the settings modification and export in SP. Clicking export will place the formated config on your clipboard. - Jeลผeli ustawione na zezwรณl, wtedy bฤ™dziesz mieฤ‡ dostฤ™p do ekranu modyfikacji wszystich ustawieล„ i zmiennych ACE, a takลผe bฤ™dziesz mieฤ‡ moลผliwoล›ฤ‡ eksportu tychลผe ustawieล„ do formatu rozpoznawalnego przez userconfig serwera. Klikniฤ™cie opcji Eksportuj skopiuje wszystkie ustawienia do schowka. Dziaล‚a tylko w trybie SP. - - - Hide - Ukryj - - - Top right, downwards - Po prawej u gรณry, w dรณล‚ - - - Top right, to the left - Po prawej u gรณry, do lewej - - - Top left, downwards - Po lewej u gรณry, w dรณล‚ - - - Top left, to the right - Po lewej u gรณry, do prawej - - - Top - Gรณra - - - Bottom - Dรณล‚ - From 2620f5ebd92aba72b6fdd9f4938e82a9c600b5bf Mon Sep 17 00:00:00 2001 From: SilentSpike Date: Tue, 12 May 2015 19:55:38 +0100 Subject: [PATCH 124/172] Made module also default to disabled --- addons/zeus/CfgVehicles.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/zeus/CfgVehicles.hpp b/addons/zeus/CfgVehicles.hpp index a1f71f405a..5750ab52d6 100644 --- a/addons/zeus/CfgVehicles.hpp +++ b/addons/zeus/CfgVehicles.hpp @@ -18,25 +18,25 @@ class CfgVehicles { displayName = "Ascension Messages"; description = "Display global popup messages when a player is assigned as Zeus."; typeName = "BOOL"; - defaultValue = 1; + defaultValue = 0; }; class zeusBird { displayName = "Zeus Eagle"; description = "Spawn an eagle that follows the Zeus camera."; typeName = "BOOL"; - defaultValue = 1; + defaultValue = 0; }; class remoteWind { displayName = "Wind Sounds"; description = "Play wind sounds when Zeus remote controls a unit."; typeName = "BOOL"; - defaultValue = 1; + defaultValue = 0; }; class radioOrdnance { - displayName = "Ordnance Radio Warning"; + displayName = "Ordnance Warning"; description = "Play a radio warning when Zeus uses ordnance."; typeName = "BOOL"; - defaultValue = 1; + defaultValue = 0; }; class revealMines { displayName = "Reveal Mines"; @@ -46,6 +46,7 @@ class CfgVehicles { class disable { name = "Disabled"; value = 0; + default = 1; }; class partial { name = "Reveal to Allies"; @@ -54,7 +55,6 @@ class CfgVehicles { class full { name = "Allies + Map Markers"; value = 2; - default = 1; }; }; }; From e58d23d8853cb09d66565d79cbca50916a48423f Mon Sep 17 00:00:00 2001 From: jonpas Date: Tue, 12 May 2015 21:32:30 +0200 Subject: [PATCH 125/172] Removed Titan realistic name as it's not implemented yet as a Spike --- addons/realisticnames/CfgVehicles.hpp | 8 ++++---- addons/realisticnames/CfgWeapons.hpp | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/addons/realisticnames/CfgVehicles.hpp b/addons/realisticnames/CfgVehicles.hpp index 0fa3111243..cf1ce87b80 100644 --- a/addons/realisticnames/CfgVehicles.hpp +++ b/addons/realisticnames/CfgVehicles.hpp @@ -407,7 +407,7 @@ class CfgVehicles { displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; }; - class Weapon_launch_Titan_F: Launcher_Base_F { + /*class Weapon_launch_Titan_F: Launcher_Base_F { displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; }; @@ -417,13 +417,13 @@ class CfgVehicles { class Weapon_launch_B_Titan_F: Launcher_Base_F { displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; - }; + };*/ //class Weapon_launch_I_Titan_F: Weapon_launch_B_Titan_F {}; //class Weapon_launch_O_Titan_F: Weapon_launch_B_Titan_F {}; - class Weapon_launch_launch_B_Titan_short_F: Launcher_Base_F { + /*class Weapon_launch_launch_B_Titan_short_F: Launcher_Base_F { displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; - }; + };*/ //class Weapon_launch_I_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; //class Weapon_launch_O_Titan_short_F: Weapon_launch_launch_B_Titan_short_F {}; diff --git a/addons/realisticnames/CfgWeapons.hpp b/addons/realisticnames/CfgWeapons.hpp index 8eb3c04577..e61457df5d 100644 --- a/addons/realisticnames/CfgWeapons.hpp +++ b/addons/realisticnames/CfgWeapons.hpp @@ -181,12 +181,12 @@ class CfgWeapons { displayName = "$STR_ACE_RealisticNames_launch_RPG32_Name"; }; - class launch_Titan_base: Launcher_Base_F { + /*class launch_Titan_base: Launcher_Base_F { displayName = "$STR_ACE_RealisticNames_launch_Titan_Name"; }; class launch_Titan_short_base: launch_Titan_base { displayName = "$STR_ACE_RealisticNames_launch_Titan_short_Name"; - }; + };*/ class launch_NLAW_F: Launcher_Base_F { displayName = "$STR_ACE_RealisticNames_launch_NLAW_Name"; From e613db1feadafd1f203b17d8e18c7e50f7a67303 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 May 2015 15:40:12 -0500 Subject: [PATCH 126/172] Add missing script_component include --- addons/common/functions/fnc_waveHeightAt.sqf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_waveHeightAt.sqf b/addons/common/functions/fnc_waveHeightAt.sqf index fbfe5fb241..e05e4219b7 100644 --- a/addons/common/functions/fnc_waveHeightAt.sqf +++ b/addons/common/functions/fnc_waveHeightAt.sqf @@ -4,12 +4,13 @@ * Gets the wave height at a specific location. Uses a logic, so may be performance iffy * * Arguments: - * 0: Position ASL to get height at + * 0: Position ASL to get height at * * Return Value: * Wave height in meters * */ +#include "script_component.hpp" if(isNil QGVAR(waveHeightLogic)) then { GVAR(waveHeightLogic) = "Logic" createVehicleLocal [0,0,0]; From 1827d8ad959ad6d9c0c06f41033b6f022a0bdfa9 Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 May 2015 16:04:42 -0500 Subject: [PATCH 127/172] Fix #1024 - Adjust self iMenu for wave height --- .../interact_menu/functions/fnc_keyDown.sqf | 7 +++++++ .../functions/fnc_renderActionPoints.sqf | 19 ++++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/addons/interact_menu/functions/fnc_keyDown.sqf b/addons/interact_menu/functions/fnc_keyDown.sqf index 464466ae3a..5416440269 100644 --- a/addons/interact_menu/functions/fnc_keyDown.sqf +++ b/addons/interact_menu/functions/fnc_keyDown.sqf @@ -64,6 +64,13 @@ if (GVAR(useCursorMenu)) then { GVAR(selfMenuOffset) = ((positionCameraToWorld [0, 0, 2]) call EFUNC(common,positionToASL)) vectorDiff ((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)); +private ["_wavesAtOrigin", "_wavesAtVirtualPoint"]; + +_wavesAtOrigin = [(positionCameraToWorld [0, 0, 0])] call EFUNC(common,waveHeightAt); +_wavesAtVirtualPoint = [(positionCameraToWorld [0, 0, 2])] call EFUNC(common,waveHeightAt); +GVAR(selfMenuOffset) set [2, ((GVAR(selfMenuOffset) select 2) + _wavesAtOrigin - _wavesAtVirtualPoint)]; + + ["interactMenuOpened", [_menuType]] call EFUNC(common,localEvent); true diff --git a/addons/interact_menu/functions/fnc_renderActionPoints.sqf b/addons/interact_menu/functions/fnc_renderActionPoints.sqf index 8e6cb7d390..6579bd33e7 100644 --- a/addons/interact_menu/functions/fnc_renderActionPoints.sqf +++ b/addons/interact_menu/functions/fnc_renderActionPoints.sqf @@ -14,7 +14,7 @@ GVAR(currentOptions) = []; -private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_target","_player","_action","_cameraPos","_cameraDir", "_lambda", "_nearestObjects", "_pos"]; +private ["_player","_numInteractObjects","_numInteractions","_actionsVarName","_classActions","_target","_player","_action","_cameraPos","_cameraDir", "_lambda", "_nearestObjects", "_pos", "_virtualPoint", "_wavesAtOrigin", "_wavesAtVirtualPoint"]; _player = ACE_player; _fnc_renderNearbyActions = { @@ -101,14 +101,19 @@ _fnc_renderSelfActions = { // Iterate through base level class actions and render them if appropiate _actionsVarName = format [QGVAR(SelfAct_%1), typeOf _target]; _classActions = missionNamespace getVariable [_actionsVarName, []]; + + _pos = if !(GVAR(useCursorMenu)) then { + _virtualPoint = (((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)) vectorAdd GVAR(selfMenuOffset)) call EFUNC(common,ASLToPosition); + _wavesAtOrigin = [(positionCameraToWorld [0, 0, 0])] call EFUNC(common,waveHeightAt); + _wavesAtVirtualPoint = [_virtualPoint] call EFUNC(common,waveHeightAt); + _virtualPoint set [2, ((_virtualPoint select 2) - _wavesAtOrigin + _wavesAtVirtualPoint)]; + _virtualPoint + } else { + [0.5, 0.5] + }; + { _action = _x; - - _pos = if !(GVAR(useCursorMenu)) then { - (((positionCameraToWorld [0, 0, 0]) call EFUNC(common,positionToASL)) vectorAdd GVAR(selfMenuOffset)) call EFUNC(common,ASLToPosition) - } else { - [0.5, 0.5] - }; [_target, _action, _pos] call FUNC(renderBaseMenu); } forEach _classActions; }; From 1227d6e3fb56b23bc186be96256ce7ada912474d Mon Sep 17 00:00:00 2001 From: Dharma Bellamkonda Date: Tue, 12 May 2015 18:28:18 -0600 Subject: [PATCH 128/172] Create missing documentation placeholders Creates placeholder documentation for modules which did not previously have any. If a module had the same name and apparent purpose as a module from AGM, AGM's documentation was imported into the placeholder. These documentation are useful to users for explaining what ACE3 changes. They are also useful to community admins who want to create a custom distribution of ACE3 and need to know which modules to disable. The documentation needs to be significantly fleshed out before it's ready for public consumption, but this should be a helpful start. --- documentation/feature/advanced_ballistics.md | 18 +++++++++++ documentation/feature/ai.md | 27 ++++++++++++++++ documentation/feature/aircraft.md | 25 +++++++++++++++ documentation/feature/apl.md | 18 +++++++++++ documentation/feature/atragmx.md | 18 +++++++++++ documentation/feature/attach.md | 18 +++++++++++ documentation/feature/backpacks.md | 16 ++++++++++ documentation/feature/ballistics.md | 28 ++++++++++++++++ documentation/feature/captives.md | 20 ++++++++++++ documentation/feature/difficulties.md | 16 ++++++++++ documentation/feature/disarming.md | 18 +++++++++++ documentation/feature/disposable.md | 16 ++++++++++ documentation/feature/dragging.md | 18 +++++++++++ documentation/feature/explosives.md | 20 ++++++++++++ documentation/feature/fcs.md | 21 ++++++++++++ documentation/feature/flashsuppressors.md | 18 +++++++++++ documentation/feature/frag.md | 18 +++++++++++ documentation/feature/gforces.md | 18 +++++++++++ documentation/feature/goggles.md | 18 +++++++++++ documentation/feature/grenades.md | 20 ++++++++++++ documentation/feature/hearing.md | 19 +++++++++++ documentation/feature/hitreactions.md | 18 +++++++++++ documentation/feature/interact_menu.md | 18 +++++++++++ documentation/feature/interaction.md | 18 +++++++++++ documentation/feature/inventory.md | 16 ++++++++++ documentation/feature/javelin.md | 17 +++++++--- documentation/feature/kestrel4500.md | 18 +++++++++++ documentation/feature/laser.md | 18 +++++++++++ documentation/feature/laser_selfdesignate.md | 18 +++++++++++ documentation/feature/laserpointer.md | 18 +++++++++++ documentation/feature/logistics_uavbattery.md | 18 +++++++++++ documentation/feature/logistics_wirecutter.md | 18 +++++++++++ documentation/feature/magazinerepack.md | 18 +++++++++++ documentation/feature/map.md | 18 +++++++++++ documentation/feature/maptools.md | 18 +++++++++++ documentation/feature/markers.md | 16 ++++++++++ documentation/feature/microdagr.md | 18 +++++++++++ documentation/feature/missileguidance.md | 18 +++++++++++ documentation/feature/missionmodules.md | 18 +++++++++++ documentation/feature/mk6mortar.md | 18 +++++++++++ documentation/feature/movement.md | 24 ++++++++++++++ documentation/feature/nametags.md | 16 ++++++++++ documentation/feature/nightvision.md | 23 +++++++++++++ documentation/feature/noidle.md | 18 +++++++++++ documentation/feature/noradio.md | 17 ++++++++++ documentation/feature/norearm.md | 18 +++++++++++ documentation/feature/optics.md | 18 +++++++++++ documentation/feature/optionsmenu.md | 18 +++++++++++ documentation/feature/ovepressure.md | 18 +++++++++++ documentation/feature/overheating.md | 27 ++++++++++++++++ documentation/feature/parachute.md | 22 +++++++++++++ documentation/feature/protection.md | 18 +++++++++++ documentation/feature/ragdolls.md | 16 ++++++++++ documentation/feature/realisticnames.md | 17 ++++++++++ documentation/feature/recoil.md | 20 ++++++++++++ documentation/feature/reload.md | 16 ++++++++++ documentation/feature/reloadlaunchers.md | 19 +++++++++++ documentation/feature/respawn.md | 20 ++++++++++++ documentation/feature/safemode.md | 16 ++++++++++ documentation/feature/scopes.md | 16 ++++++++++ documentation/feature/smallarms.md | 20 ++++++++++++ documentation/feature/switchunits.md | 18 +++++++++++ documentation/feature/testmissions.md | 18 +++++++++++ documentation/feature/thermals.md | 16 ++++++++++ documentation/feature/vector.md | 16 ++++++++++ documentation/feature/vehiclelock.md | 18 +++++++++++ documentation/feature/vehicles.md | 32 +++++++++++++++++++ documentation/feature/weaponselect.md | 24 ++++++++++++++ documentation/feature/weather.md | 18 +++++++++++ documentation/feature/windeflection.md | 16 ++++++++++ 70 files changed, 1313 insertions(+), 5 deletions(-) create mode 100644 documentation/feature/advanced_ballistics.md create mode 100644 documentation/feature/ai.md create mode 100644 documentation/feature/aircraft.md create mode 100644 documentation/feature/apl.md create mode 100644 documentation/feature/atragmx.md create mode 100644 documentation/feature/attach.md create mode 100644 documentation/feature/backpacks.md create mode 100644 documentation/feature/ballistics.md create mode 100644 documentation/feature/captives.md create mode 100644 documentation/feature/difficulties.md create mode 100644 documentation/feature/disarming.md create mode 100644 documentation/feature/disposable.md create mode 100644 documentation/feature/dragging.md create mode 100644 documentation/feature/explosives.md create mode 100644 documentation/feature/fcs.md create mode 100644 documentation/feature/flashsuppressors.md create mode 100644 documentation/feature/frag.md create mode 100644 documentation/feature/gforces.md create mode 100644 documentation/feature/goggles.md create mode 100644 documentation/feature/grenades.md create mode 100644 documentation/feature/hearing.md create mode 100644 documentation/feature/hitreactions.md create mode 100644 documentation/feature/interact_menu.md create mode 100644 documentation/feature/interaction.md create mode 100644 documentation/feature/inventory.md create mode 100644 documentation/feature/kestrel4500.md create mode 100644 documentation/feature/laser.md create mode 100644 documentation/feature/laser_selfdesignate.md create mode 100644 documentation/feature/laserpointer.md create mode 100644 documentation/feature/logistics_uavbattery.md create mode 100644 documentation/feature/logistics_wirecutter.md create mode 100644 documentation/feature/magazinerepack.md create mode 100644 documentation/feature/map.md create mode 100644 documentation/feature/maptools.md create mode 100644 documentation/feature/markers.md create mode 100644 documentation/feature/microdagr.md create mode 100644 documentation/feature/missileguidance.md create mode 100644 documentation/feature/missionmodules.md create mode 100644 documentation/feature/mk6mortar.md create mode 100644 documentation/feature/movement.md create mode 100644 documentation/feature/nametags.md create mode 100644 documentation/feature/nightvision.md create mode 100644 documentation/feature/noidle.md create mode 100644 documentation/feature/noradio.md create mode 100644 documentation/feature/norearm.md create mode 100644 documentation/feature/optics.md create mode 100644 documentation/feature/optionsmenu.md create mode 100644 documentation/feature/ovepressure.md create mode 100644 documentation/feature/overheating.md create mode 100644 documentation/feature/parachute.md create mode 100644 documentation/feature/protection.md create mode 100644 documentation/feature/ragdolls.md create mode 100644 documentation/feature/realisticnames.md create mode 100644 documentation/feature/recoil.md create mode 100644 documentation/feature/reload.md create mode 100644 documentation/feature/reloadlaunchers.md create mode 100644 documentation/feature/respawn.md create mode 100644 documentation/feature/safemode.md create mode 100644 documentation/feature/scopes.md create mode 100644 documentation/feature/smallarms.md create mode 100644 documentation/feature/switchunits.md create mode 100644 documentation/feature/testmissions.md create mode 100644 documentation/feature/thermals.md create mode 100644 documentation/feature/vector.md create mode 100644 documentation/feature/vehiclelock.md create mode 100644 documentation/feature/vehicles.md create mode 100644 documentation/feature/weaponselect.md create mode 100644 documentation/feature/weather.md create mode 100644 documentation/feature/windeflection.md diff --git a/documentation/feature/advanced_ballistics.md b/documentation/feature/advanced_ballistics.md new file mode 100644 index 0000000000..fd44bb21b9 --- /dev/null +++ b/documentation/feature/advanced_ballistics.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Advanced Ballistics +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/ai.md b/documentation/feature/ai.md new file mode 100644 index 0000000000..b82192b920 --- /dev/null +++ b/documentation/feature/ai.md @@ -0,0 +1,27 @@ +--- +layout: wiki +title: AI (Artifical Intelligence) +group: feature +order: 5 +parent: wiki +--- + +# Overview +## Adjusted AI skill values +The idea here is to reduce the AI's godlike aiming capabilties while retaining it's high intelligence. The AI should be smart enough to move through a town, but also be 'human' in their reaction time and aim. +Note: All these values can still be adjusted via scripts, these arrays just change what 0 & 1 are for setSkill. +## Firing in burst mode +AIs will now use the automatic mode of their weapons on short distances, instead of always relying on firing single shots in quick succession. +## Longer engagement ranges +The maximum engagement ranges are increased: AI will fire in bursts with variable length on high ranges of 500 - 700 meters, depending on their weapon and optic. +## No deadzones in CQB +Some weapons had minimum engagement ranges. If you were as close as 2 meters to an AAF soldier, he wouldn't open fire, because the AI couldn't find any valid fire mode for their weapon. AGM removes this behaviour mostly notable in CQB by adding a valid firing mode. +## No scripting +All changes of AGM AI are config based to ensure full compatibility with advanced AI modifications like ASR AI. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/aircraft.md b/documentation/feature/aircraft.md new file mode 100644 index 0000000000..6b99540466 --- /dev/null +++ b/documentation/feature/aircraft.md @@ -0,0 +1,25 @@ +--- +layout: wiki +title: Aircraft +group: feature +order: 5 +parent: wiki +--- +# Overview +## Adjusted flight behaviour +Changes the flight behaviour of various aircraft. +## Various adjustments to A2A, A2G and G2A munitions +- needs documentaion - +## Missile lock warnings +Adds missile-lock warning systems to helicopters and planes based on the various real life capabilities. +## Semi-automatic flare mode +Adds the semi-automatic flare mode known from Arma 2. The key to switch the mode still exists in Arma 3's key settings, but is unused. +### Ejecting from pilot and copilot seats +Pilots and copilots of all helicopters can now eject. +## Laser marker for wildcat +Adds a laser marker to the copilot seat of the Wildcat. +## HUD for AH-9 +Adds a HUD to the AH-9 based on the comanches HUD. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/apl.md b/documentation/feature/apl.md new file mode 100644 index 0000000000..fe69507f32 --- /dev/null +++ b/documentation/feature/apl.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: APL +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/atragmx.md b/documentation/feature/atragmx.md new file mode 100644 index 0000000000..77affe1326 --- /dev/null +++ b/documentation/feature/atragmx.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: ATragMX +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/attach.md b/documentation/feature/attach.md new file mode 100644 index 0000000000..7bf2c400e6 --- /dev/null +++ b/documentation/feature/attach.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Attach +group: feature +parent: wiki +--- +# Overview +## Attach items to uniform +Enables player to attach IR grenades and chemlights to themselves. +## IR Strobe +Adds an attachable IR strobe, which is only visible using night vision devices and offers better visibility than IR grenades.re 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/backpacks.md b/documentation/feature/backpacks.md new file mode 100644 index 0000000000..ade414525f --- /dev/null +++ b/documentation/feature/backpacks.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Backpacks +group: feature +parent: wiki +--- +# Overview +## Lock backpack +Adds the ability to lock backpacks. Locked backpacks can't be accessed by others. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/ballistics.md b/documentation/feature/ballistics.md new file mode 100644 index 0000000000..895f1e37ab --- /dev/null +++ b/documentation/feature/ballistics.md @@ -0,0 +1,28 @@ +--- +layout: wiki +title: Ballistics +group: feature +parent: wiki +--- +# Overview +## Realistic rifle ammunition +Changes include adjusted muzzle velocity, air friction and dispersion based on real life values. +## Body armour nerf +Nerfs protection values of vests, CSAT uniforms and various campaign only gear to more realistic levels comparable to Arma 2 levels. +## Realistic silencers and sub-sonic ammunition +Silencers no longer decrease the muzzle velocity and are generally less effective when used with normal ammunition. They now only remove the muzzle blast and flash. To prevent the crack caused by super sonic projectiles, AGM introduces sub sonic ammunition. This is also fully compatible with AI. Sub sonic ammunition is available for the calibers 5.56mm, 6.5mm and 7.62mm. +## Armour piercing ammunition +Armour piercing rounds have higher penetration values against light armoured targets or other obstacles on the battlefield. Their drawback is a slighly decreased man-stopping power. AP rounds are available for the calibers 5.56mm, 6.5mm and 7.62mm. +## IR-Dim tracer ammunition +IR-Dim ammunition is similar to tracer rounds, but their tracers are only visible using night vision devices. +## M118 Long range ammunition +The M14 EBR now uses ammunition with decreased muzzle velocity and air friction to improve precission on long ranges. +## Flash suppressors +Flash suppressors are similar to sound suppressors and prevent the muzzle flash reducing visibilty without decreasing combat effectiveness. Flash suppressors are available for the calibers 5.56mm, 6.5mm, 7.62mm, .45 ACP and 9mm. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/captives.md b/documentation/feature/captives.md new file mode 100644 index 0000000000..305610cdce --- /dev/null +++ b/documentation/feature/captives.md @@ -0,0 +1,20 @@ +--- +layout: wiki +title: Captives +group: feature +parent: wiki +--- +# Overview +## Take captives +Introduces a captivity system for taking and moving prisoners. +## Load and unload captives into / from vehicles +- needs documentaion - +## Frisk captives +- needs documentaion - + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/difficulties.md b/documentation/feature/difficulties.md new file mode 100644 index 0000000000..626576ee09 --- /dev/null +++ b/documentation/feature/difficulties.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Difficulties +group: feature +parent: wiki +--- +# Overview +## Elite mode adjustments +Adjusts the default settings for the hardest difficulty to more closely resemble A2 settings. (No crosshair, stat screen, death messages...) + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/disarming.md b/documentation/feature/disarming.md new file mode 100644 index 0000000000..7b30494adc --- /dev/null +++ b/documentation/feature/disarming.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Disarming +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/disposable.md b/documentation/feature/disposable.md new file mode 100644 index 0000000000..dd634eb9c1 --- /dev/null +++ b/documentation/feature/disposable.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Disposable +group: feature +parent: wiki +--- +# Overview +## NLAW disposable anti tank weapon +Makes the NLAW disposable and provides the tools for other addons to do the same. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/dragging.md b/documentation/feature/dragging.md new file mode 100644 index 0000000000..28d5c6089f --- /dev/null +++ b/documentation/feature/dragging.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Dragging +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/explosives.md b/documentation/feature/explosives.md new file mode 100644 index 0000000000..78f09d62bb --- /dev/null +++ b/documentation/feature/explosives.md @@ -0,0 +1,20 @@ +--- +layout: wiki +title: Explosives +group: feature +parent: wiki +--- +# Overview +## Advanced explosives placement +Enables more precise placement of explosives. +## More trigger types +Offers different trigger types, like clackers and dead man switches. +## Attack explosives to vehicles +Enables attaching explosives to vehicles. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/fcs.md b/documentation/feature/fcs.md new file mode 100644 index 0000000000..4eefe05e5b --- /dev/null +++ b/documentation/feature/fcs.md @@ -0,0 +1,21 @@ +--- +layout: wiki +title: FCS (Fire Control System) +group: feature +parent: wiki +--- +# Overview +## Fire control system +Offers a custom fire control system for tanks and helicopters. It enables engaging stationary and moving targets. +## Manual lasing targets +Changes the default rangefinders, including those in vehicles, to require manual lasing. +## Air burst ammunition +Anti air cannons can now use airburst ammunition. It will explode on the FCS' zeroed in range. + +# Usage +To engage moving targets, place the crosshair on the enemy vehicle and press and hold tab. Follow the moving target with your crosshair for about 2 seconds and release tab. The optic will now be adjusted sideways to ensure a hit. + +To use manual lasing, place the crosshair on the object to range and press and hold tab. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/flashsuppressors.md b/documentation/feature/flashsuppressors.md new file mode 100644 index 0000000000..4217299857 --- /dev/null +++ b/documentation/feature/flashsuppressors.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Flash Suppressors +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/frag.md b/documentation/feature/frag.md new file mode 100644 index 0000000000..4d30c8d9f9 --- /dev/null +++ b/documentation/feature/frag.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Frag +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/gforces.md b/documentation/feature/gforces.md new file mode 100644 index 0000000000..73c3b321ed --- /dev/null +++ b/documentation/feature/gforces.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: G-Forces +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/goggles.md b/documentation/feature/goggles.md new file mode 100644 index 0000000000..1d77e342d4 --- /dev/null +++ b/documentation/feature/goggles.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Goggles +group: feature +parent: wiki +--- +# Overview +## Visual Effects for eyewear +Adds color tint to sunglasses and other eyewear. Causes raindrops to appear on +the screen in rain. Causes dirt to appear on the screen when dirt is kicked up +nearby (e.g. explsions, rotor wash, bullet impacts). + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/grenades.md b/documentation/feature/grenades.md new file mode 100644 index 0000000000..67918ae77b --- /dev/null +++ b/documentation/feature/grenades.md @@ -0,0 +1,20 @@ +--- +layout: wiki +title: Grenades +group: feature +parent: wiki +--- +# Overview +## Throw modes +Provides different modes for throwing grenades (high throw, precision throw and drop mode). +## Hand flares +Adds throwable hand flares in the colors white, red, green and yellow. Additionally buffs existing flares. +## M84 stun grenade +Adds stun grenade. This will also affect AI. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/hearing.md b/documentation/feature/hearing.md new file mode 100644 index 0000000000..32d4fce986 --- /dev/null +++ b/documentation/feature/hearing.md @@ -0,0 +1,19 @@ +--- +layout: wiki +title: Hearing +group: feature +parent: wiki +--- +# Overview +## Hearing damage simulation +Introduces hearing damage caused by nearby explosions and large-caliber weapons. +## Earplugs +Adds ear plugs to mitigate that effect. Soldiers with high caliber weapons or +missile launchers will be equipped with those, but remember to put them in. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/hitreactions.md b/documentation/feature/hitreactions.md new file mode 100644 index 0000000000..c109f10ddd --- /dev/null +++ b/documentation/feature/hitreactions.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Hit Reactions +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/interact_menu.md b/documentation/feature/interact_menu.md new file mode 100644 index 0000000000..d00ba6f977 --- /dev/null +++ b/documentation/feature/interact_menu.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Interact Menu +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/interaction.md b/documentation/feature/interaction.md new file mode 100644 index 0000000000..36365342ae --- /dev/null +++ b/documentation/feature/interaction.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Interaction +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/inventory.md b/documentation/feature/inventory.md new file mode 100644 index 0000000000..8dac5b6644 --- /dev/null +++ b/documentation/feature/inventory.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Inventory +group: feature +parent: wiki +--- +# Overview +## Resized inventory UI +Makes the inventory dialog bigger and increases the number of items that can be seen in the list at once. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/javelin.md b/documentation/feature/javelin.md index b253a25fc9..78102840c1 100644 --- a/documentation/feature/javelin.md +++ b/documentation/feature/javelin.md @@ -1,13 +1,18 @@ --- layout: wiki -title: Javelin/Titan Locking and Firing +title: Javelin group: feature -order: 5 parent: wiki --- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. -## 1. Overview -Blah blah blah +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. Steps to lock titan/Javelin: @@ -17,5 +22,7 @@ Steps to lock titan/Javelin: 4. Hold TAB over a target, it will start beeping and the constraint boxes will appear 5. Once the beeping changes to LOCK tone, and the lock crosshairs appear, click fire without releasing tab - CTRL+TAB is default key to change firemode (configurable as a key) + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/kestrel4500.md b/documentation/feature/kestrel4500.md new file mode 100644 index 0000000000..0c6e03d304 --- /dev/null +++ b/documentation/feature/kestrel4500.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Kestrel 4500 +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/laser.md b/documentation/feature/laser.md new file mode 100644 index 0000000000..6e1de22002 --- /dev/null +++ b/documentation/feature/laser.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Laser +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/laser_selfdesignate.md b/documentation/feature/laser_selfdesignate.md new file mode 100644 index 0000000000..8405d57c43 --- /dev/null +++ b/documentation/feature/laser_selfdesignate.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Laser Self-Designate +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/laserpointer.md b/documentation/feature/laserpointer.md new file mode 100644 index 0000000000..c22471e320 --- /dev/null +++ b/documentation/feature/laserpointer.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Laser Pointer +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/logistics_uavbattery.md b/documentation/feature/logistics_uavbattery.md new file mode 100644 index 0000000000..6cd3bc0b3b --- /dev/null +++ b/documentation/feature/logistics_uavbattery.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Logistics - UAV Battery +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/logistics_wirecutter.md b/documentation/feature/logistics_wirecutter.md new file mode 100644 index 0000000000..97d684e697 --- /dev/null +++ b/documentation/feature/logistics_wirecutter.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Logistics - Wirecutter +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/magazinerepack.md b/documentation/feature/magazinerepack.md new file mode 100644 index 0000000000..e9ae26f315 --- /dev/null +++ b/documentation/feature/magazinerepack.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Magazine Repack +group: feature +parent: wiki +--- +# Overview +## Repacking magazines +Adds ability to repack magazines of the same type. An optional module provides +options to adjust the repacking time of single rounds and whole magazines to +the mission maker. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/map.md b/documentation/feature/map.md new file mode 100644 index 0000000000..88a3493d9e --- /dev/null +++ b/documentation/feature/map.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Map +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/maptools.md b/documentation/feature/maptools.md new file mode 100644 index 0000000000..6814a5c1f5 --- /dev/null +++ b/documentation/feature/maptools.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Map Tools +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/markers.md b/documentation/feature/markers.md new file mode 100644 index 0000000000..eae1bfe333 --- /dev/null +++ b/documentation/feature/markers.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Markers +group: feature +parent: wiki +--- +# Overview +## Improved marker placement +Expands the "Insert Marker" menu and allows to rotate map markers. Shows the currently selected channel to prevent misplacement. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/microdagr.md b/documentation/feature/microdagr.md new file mode 100644 index 0000000000..a98730c9f4 --- /dev/null +++ b/documentation/feature/microdagr.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: MicroDAGR +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/missileguidance.md b/documentation/feature/missileguidance.md new file mode 100644 index 0000000000..fe5aa792b3 --- /dev/null +++ b/documentation/feature/missileguidance.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Missile Guidance +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/missionmodules.md b/documentation/feature/missionmodules.md new file mode 100644 index 0000000000..771a5ef290 --- /dev/null +++ b/documentation/feature/missionmodules.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Mission Modules +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/mk6mortar.md b/documentation/feature/mk6mortar.md new file mode 100644 index 0000000000..af718eedce --- /dev/null +++ b/documentation/feature/mk6mortar.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Mk6 Mortar +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/movement.md b/documentation/feature/movement.md new file mode 100644 index 0000000000..f1d9d93df9 --- /dev/null +++ b/documentation/feature/movement.md @@ -0,0 +1,24 @@ +--- +layout: wiki +title: Movement +group: feature +parent: wiki +--- +# Overview +## Jumping +Adds the ability to jump when pressing the vault key while moving. (V - key) +## Minor animation tweaks +Walking slowly with the weapon lowered now has a less silly looking animation. +## Fatigue adjustments +Soldiers get fatigued slower, but regain their stamina slower aswell. Fatigued soldiers have a faster walking speed and no longer turn into snails. +## Weight display +Adds a weight of the current loadout display in the inventory to estimate the fatigue gain while moving in combat. Can be adjusted to display lb. instead of kg in the AGM Options Menu. +## Optics view in all stances +The player can now use the sights of rifles and pistols in all prone stances. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/nametags.md b/documentation/feature/nametags.md new file mode 100644 index 0000000000..10ff3404c0 --- /dev/null +++ b/documentation/feature/nametags.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Nametags +group: feature +parent: wiki +--- +# Overview +## Nametag and rank display +Adds nametags and soldier ranks to friendly players in multiplayer. This can be adjusted in the AGM Options Menu to not display the rank, display all nametags of nearby soldiers instead of those who are looked directly at, to require a button press to show the nametags or to disable them altogether. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/nightvision.md b/documentation/feature/nightvision.md new file mode 100644 index 0000000000..efdc5721c5 --- /dev/null +++ b/documentation/feature/nightvision.md @@ -0,0 +1,23 @@ +--- +layout: wiki +title: Nightvision +group: feature +parent: wiki +--- +# Overview +## Multiple Generation NVGs +Adds different night vision devices with varying image quality and field of +view. New Classnames for Generations 1, 2, and 4 NVGs (default ArmA3 NVGs +represents Generation 3) and a wide view NVG. +## Blending effects +Adds a blending effect depending on ammunition type when firing while using a +night vision device. Especially tracer rounds are bright, but you can use the + IR-dim tracers from AGM_Ballistics to reduce tis effect. +## Brightness adjustment +Enables the user to manually adjust NVG brightness. + +# Usage +Use Alt+PageUp and Alt+PageDown to adjust NVG brightness. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/noidle.md b/documentation/feature/noidle.md new file mode 100644 index 0000000000..aa6657728d --- /dev/null +++ b/documentation/feature/noidle.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: No Idle +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/noradio.md b/documentation/feature/noradio.md new file mode 100644 index 0000000000..f9a832abd0 --- /dev/null +++ b/documentation/feature/noradio.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: No Radio +group: feature +parent: wiki +--- +# Overview +## Silent avatar +Mutes the player's automatic callouts ("Enemy man, 100 meters, front!"). +Does not mute AI callouts. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/norearm.md b/documentation/feature/norearm.md new file mode 100644 index 0000000000..7ed7a5c515 --- /dev/null +++ b/documentation/feature/norearm.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: No Rearm +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/optics.md b/documentation/feature/optics.md new file mode 100644 index 0000000000..90b486bc88 --- /dev/null +++ b/documentation/feature/optics.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Optics +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/optionsmenu.md b/documentation/feature/optionsmenu.md new file mode 100644 index 0000000000..a0c9ad33da --- /dev/null +++ b/documentation/feature/optionsmenu.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Options Menu +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/ovepressure.md b/documentation/feature/ovepressure.md new file mode 100644 index 0000000000..af8e47ae0c --- /dev/null +++ b/documentation/feature/ovepressure.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Overpressure +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/overheating.md b/documentation/feature/overheating.md new file mode 100644 index 0000000000..3a10bf9f48 --- /dev/null +++ b/documentation/feature/overheating.md @@ -0,0 +1,27 @@ +--- +layout: wiki +title: Overheating +group: feature +parent: wiki +--- +# Overview +## Weapon Jamming +Adds a propability to jam a weapon when firing. Jams can be cleared by +reloading or by using the clear jam-key. +## Temperature simulation +Introduces weapon temperature simulation depending on weapon and bullet +mass. Hot weapons are more prone to jamming. Depending on weapon type +the accuracy and in extreme cases the muzzle velocity might be reduced +on high temperatues. Adds smoke puff and heat refraction effects to +indicate this. +## Spare barrels +Adds the ability to changes barrels on machine guns to compensate for those +effects. + +# Usage +To clear a jammed weapon, press Shift+R. + +*needs documentation on swapping barrels* + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/parachute.md b/documentation/feature/parachute.md new file mode 100644 index 0000000000..48ad0e9836 --- /dev/null +++ b/documentation/feature/parachute.md @@ -0,0 +1,22 @@ +--- +layout: wiki +title: Parachute +group: feature +parent: wiki +--- +# Overview +## Altimeter +Removes the altitude and descend speed UI elements when free-falling and +parachuting on higher difficulties and instead adds an altimeter watch type +item. +## Non-steerable parachute +Adds a non-steerable parachute variant for jet pilots. +## Landing animation +Smoothens parachute landing animation. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/protection.md b/documentation/feature/protection.md new file mode 100644 index 0000000000..2eb2a9aaef --- /dev/null +++ b/documentation/feature/protection.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Protection +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/ragdolls.md b/documentation/feature/ragdolls.md new file mode 100644 index 0000000000..585c6c71a8 --- /dev/null +++ b/documentation/feature/ragdolls.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Ragdolls +group: feature +parent: wiki +--- +# Overview +## Adjusted Ragdolls +Changes the ragdolls to react more to the force of shots and explosions. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/realisticnames.md b/documentation/feature/realisticnames.md new file mode 100644 index 0000000000..64d9a316cb --- /dev/null +++ b/documentation/feature/realisticnames.md @@ -0,0 +1,17 @@ +--- +layout: wiki +title: Realistic Names +group: feature +parent: wiki +--- +# Overview +## Real names +Changes the names of vehicles, magazines, weapons, grenades, explosive charges +and mines to their respective real-world counterparts whenever possible. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/recoil.md b/documentation/feature/recoil.md new file mode 100644 index 0000000000..919ab24836 --- /dev/null +++ b/documentation/feature/recoil.md @@ -0,0 +1,20 @@ +--- +layout: wiki +title: Recoil +group: feature +parent: wiki +--- +# Overview +## Recoil adjustment +Overhauls the recoil system reducing upwards recoil. +## Advanced cam shake +Introducing camshake when firing on foot or as vehicle gunner depending on stance and weapon type. +## Burst dispersion +Firing in longer burst (> 3 rounds per burst) slightly reduces the accuracy. Firing machine guns in bursts is now useful. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/reload.md b/documentation/feature/reload.md new file mode 100644 index 0000000000..f791521a63 --- /dev/null +++ b/documentation/feature/reload.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Reload +group: feature +parent: wiki +--- +# Overview +## Ammo count +Hides the actual round count of magazines and removes the icon when the current magazine is emptied. The player can instead check the magazine weight, but that gives only estimated values for magazines with more than 10 rounds. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/reloadlaunchers.md b/documentation/feature/reloadlaunchers.md new file mode 100644 index 0000000000..7b1f26cea1 --- /dev/null +++ b/documentation/feature/reloadlaunchers.md @@ -0,0 +1,19 @@ +--- +layout: wiki +title: Reload Launchers +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. +r \ No newline at end of file diff --git a/documentation/feature/respawn.md b/documentation/feature/respawn.md new file mode 100644 index 0000000000..6059f33c59 --- /dev/null +++ b/documentation/feature/respawn.md @@ -0,0 +1,20 @@ +--- +layout: wiki +title: Respawn +group: feature +parent: wiki +--- +# Overview +## Respawn with same gear +Requires the Respawn Gear module to be placed. Respawned soldiers now have their loadout when killed. +## Friendly Fire messages +Shows friendly fire warnings in system chat if the module is placed. Works even in higher difficulties where kill messages are normally disabled. +## Rallypoints +Adds rallypoints to all 3 sides to enable teleportation from base spawn to FOBs. Requires some setup from the mission maker. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/safemode.md b/documentation/feature/safemode.md new file mode 100644 index 0000000000..ea4f3fe902 --- /dev/null +++ b/documentation/feature/safemode.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Safe Mode +group: feature +parent: wiki +--- +# Overview +## Safety +You can now use the safety mode of any weapon. Switching weapon modes takes the safety off. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/scopes.md b/documentation/feature/scopes.md new file mode 100644 index 0000000000..fb29c7d6e1 --- /dev/null +++ b/documentation/feature/scopes.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Scopes +group: feature +parent: wiki +--- +# Overview +## Sniper Scope Adjustment +Enables snipers to adjust their scopes horizontally and vertically in mils. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/smallarms.md b/documentation/feature/smallarms.md new file mode 100644 index 0000000000..11e68d4373 --- /dev/null +++ b/documentation/feature/smallarms.md @@ -0,0 +1,20 @@ +--- +layout: wiki +title: Small Arms +group: feature +parent: wiki +--- +# Overview +## Magazine Names +Unifies the name formatting of magazines similar to Arma 2 standards. +## No tracers in non-tracer mags +Assault rifles no longer have tracer rounds in their non-tracer magazines. This doesn't effect the additional tracers in the last rounds of machine gun magazines. +## Real magazine round counts +All pistol and sub machine gun magazines now have adjusted capacaties to match their real life counterparts. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/switchunits.md b/documentation/feature/switchunits.md new file mode 100644 index 0000000000..71ace0e055 --- /dev/null +++ b/documentation/feature/switchunits.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Switch Units +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/testmissions.md b/documentation/feature/testmissions.md new file mode 100644 index 0000000000..7d7ac52af8 --- /dev/null +++ b/documentation/feature/testmissions.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Test Missions +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/thermals.md b/documentation/feature/thermals.md new file mode 100644 index 0000000000..12f79a311b --- /dev/null +++ b/documentation/feature/thermals.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Thermals +group: feature +parent: wiki +--- +# Overview +## Body Warmth +Adjusts the thermal properties of humans making them less like torches. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/vector.md b/documentation/feature/vector.md new file mode 100644 index 0000000000..277f5eb524 --- /dev/null +++ b/documentation/feature/vector.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Vector +group: feature +parent: wiki +--- +# Overview +## Vector IV Rangefinder +Adds the Vector IV rangefinder, including all real-life usage modes (distance between two points, angle between two points etc.) + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/vehiclelock.md b/documentation/feature/vehiclelock.md new file mode 100644 index 0000000000..239661d153 --- /dev/null +++ b/documentation/feature/vehiclelock.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Vehicle Lock +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/vehicles.md b/documentation/feature/vehicles.md new file mode 100644 index 0000000000..534bb35171 --- /dev/null +++ b/documentation/feature/vehicles.md @@ -0,0 +1,32 @@ +--- +layout: wiki +title: Vehicles +group: feature +parent: wiki +--- +# Overview +## Speedlimiter +Adds ability to limit the max. speed of any vehicle. +## Engine start delay +The engine has to be started before the vehicle can move. Starting the engine takes aprox. 1 to 2 seconds. +## Fuel capacity +The range of all vehicle gets signifigantly reduced to reflect ranges of their real life counterparts. Scaled down to match the relative short distances in Arma. A full vehicle on mission start should still most likely never need a refueling during a mission. +## Main gun muzzles +APCs and Tanks now share a muzzle for all ammunition types of their main guns. This prevents an exploit that skips the reloading time of a round or clip while changing the ammunition type. Also makes it possible to switch between ammunition types using the scroll wheel like in Arma 2. +## Boat machine gun tracers +NATO and AAF armed boats now use their respective tracer colours like any vehicle when they fire their rear gun. (Red for BluFor, yellow for Indep) +## Improved smoke launcher of Fennek (Strider) +Reduced smoke shell count and launch angle of the AAF Fennek to match the models smoke launcher. +## Stabilized optic of Fennek (Strider) +Stabilizes the commander's view in the Fennek (Strider). +## Vehicle mounted machine guns ROF +The rate of fire of vehicle mounted miniguns and machine guns is adjusted to match real life values. +## 120mm gun and mortar behavior +MBT main guns and mortars can no longer lock on enemies. The AT rounds of both now have raised cost values to encourage the AI to not use those rounds against foot soldiers over their machine guns or HE rounds. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/weaponselect.md b/documentation/feature/weaponselect.md new file mode 100644 index 0000000000..232f0221d5 --- /dev/null +++ b/documentation/feature/weaponselect.md @@ -0,0 +1,24 @@ +--- +layout: wiki +title: Weapon Select +group: feature +parent: wiki +--- +# Overview +## Weapon select +The number key can be used to quickly switch between weapons. (1 key - pistol, 2 key - rifle, 3 key - grenade launcher, 4 key - rocket launcher, 5 key - binocular) +Holster weapon +Adds the ability to holster a weapon on the back. (0 key) +Engine select +Quickly turn engine on and off (1 key - turn off, 2 key - turn on) +Weapon select +Quickly switch between vehicle weapons (1-3 key) +Grenade select +To prevent accidents a grenade has to be selected before it can be thrown. Toggles between explosive and non-explosive grenades. When spamming the throw key, the player won't automatically switch to frag grenades when all smokes are used up. Also shows an indicator to quickly see how many grenades are left when selecting and after throwing (6 key - switch between frag grenades, 7 key - switch between other grenades) + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/weather.md b/documentation/feature/weather.md new file mode 100644 index 0000000000..2cbeea5e7e --- /dev/null +++ b/documentation/feature/weather.md @@ -0,0 +1,18 @@ +--- +layout: wiki +title: Weather +group: feature +parent: wiki +--- +# Overview +## Sub-feature 1 +Short description of sub-feature 1. +## Sub-feature 2 +Short description of sub-feature 2. + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. diff --git a/documentation/feature/windeflection.md b/documentation/feature/windeflection.md new file mode 100644 index 0000000000..7bca0b0f60 --- /dev/null +++ b/documentation/feature/windeflection.md @@ -0,0 +1,16 @@ +--- +layout: wiki +title: Wind Deflection +group: feature +parent: wiki +--- +# Overview +## Wind Deflection +Adds ballistic influences of wind, air density and temperature + +# Usage +Short overview of how to use the feature, e.g. menu options, key bindings, +instructions. May not apply to all modules. + +# Dependencies +List of modules that must be present for this module to work. From 7c1875b624d2cdbfe41a061006a7d47fd1145374 Mon Sep 17 00:00:00 2001 From: Dharma Bellamkonda Date: Tue, 12 May 2015 18:31:03 -0600 Subject: [PATCH 129/172] add name to authors.txt --- AUTHORS.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS.txt b/AUTHORS.txt index 862cb23413..9a6b836bea 100644 --- a/AUTHORS.txt +++ b/AUTHORS.txt @@ -94,3 +94,4 @@ Bla1337 nikolauska adam3adam Professor +Dharma Bellamkonda From b27d7eafa41e6871476242a90d775de2d35ff7c5 Mon Sep 17 00:00:00 2001 From: Dharma Bellamkonda Date: Tue, 12 May 2015 20:18:03 -0600 Subject: [PATCH 130/172] Fix headers in weapon select doc --- documentation/feature/weaponselect.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/documentation/feature/weaponselect.md b/documentation/feature/weaponselect.md index 232f0221d5..872e27cad0 100644 --- a/documentation/feature/weaponselect.md +++ b/documentation/feature/weaponselect.md @@ -7,13 +7,13 @@ parent: wiki # Overview ## Weapon select The number key can be used to quickly switch between weapons. (1 key - pistol, 2 key - rifle, 3 key - grenade launcher, 4 key - rocket launcher, 5 key - binocular) -Holster weapon +## Holster weapon Adds the ability to holster a weapon on the back. (0 key) -Engine select +## Engine select Quickly turn engine on and off (1 key - turn off, 2 key - turn on) -Weapon select +## Weapon select Quickly switch between vehicle weapons (1-3 key) -Grenade select +## Grenade select To prevent accidents a grenade has to be selected before it can be thrown. Toggles between explosive and non-explosive grenades. When spamming the throw key, the player won't automatically switch to frag grenades when all smokes are used up. Also shows an indicator to quickly see how many grenades are left when selecting and after throwing (6 key - switch between frag grenades, 7 key - switch between other grenades) # Usage From 3978445837cf613c91fef61029e22f003157ab5a Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 May 2015 23:01:59 -0500 Subject: [PATCH 131/172] Draggin Privates --- addons/dragging/functions/fnc_setCarryable.sqf | 3 ++- addons/dragging/functions/fnc_setDraggable.sqf | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/addons/dragging/functions/fnc_setCarryable.sqf b/addons/dragging/functions/fnc_setCarryable.sqf index bc6da1f04d..2a10ca4897 100644 --- a/addons/dragging/functions/fnc_setCarryable.sqf +++ b/addons/dragging/functions/fnc_setCarryable.sqf @@ -14,7 +14,8 @@ */ #include "script_component.hpp" -private ["_object", "_enableCarry", "_position", "_direction"]; +private ["_carryAction", "_dropAction", "_object", "_enableCarry", "_position", "_direction"]; +//IGNORE_PRIVATE_WARNING("_player", "_target"); _this resize 4; diff --git a/addons/dragging/functions/fnc_setDraggable.sqf b/addons/dragging/functions/fnc_setDraggable.sqf index da2d0310b4..5a42f4e439 100644 --- a/addons/dragging/functions/fnc_setDraggable.sqf +++ b/addons/dragging/functions/fnc_setDraggable.sqf @@ -14,7 +14,8 @@ */ #include "script_component.hpp" -private ["_object", "_enableDrag", "_position", "_direction"]; +private ["_dragAction", "_dropAction", "_object", "_enableDrag", "_position", "_direction"]; +//IGNORE_PRIVATE_WARNING("_player", "_target"); _this resize 4; From 4185874a9abeacddc8df7a1854831e8ba1d1c5bf Mon Sep 17 00:00:00 2001 From: PabstMirror Date: Tue, 12 May 2015 23:19:31 -0500 Subject: [PATCH 132/172] Frag Privates --- addons/frag/functions/fnc_doSpall.sqf | 7 ++----- addons/frag/functions/fnc_frago.sqf | 7 +------ 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/addons/frag/functions/fnc_doSpall.sqf b/addons/frag/functions/fnc_doSpall.sqf index 990fb80f8d..d2e64dbbfb 100644 --- a/addons/frag/functions/fnc_doSpall.sqf +++ b/addons/frag/functions/fnc_doSpall.sqf @@ -4,11 +4,8 @@ GVAR(traceFrags) = true; #endif // ACE_player sideChat "WAAAAAAAAAAAAAAAAAAAAA"; -private ["_params", "_initialData", "_hpData", "_roundType", "_round", "_object", "_caliber", "_explosive", - "_idh", "_alive", "_exit", "_vm", "_velocity", "_unitDir", "_oldVelocity", "_curVelocity", "_diff", "_polar", - "_pos", "_spallPos", "_i", "_pos1", "_pos2", "_blah", "_data", "_spallPolar", "_c", "_warn", "_m", "_k", - "_gC", "_shellType", "_fragPower", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", - "_fragment", "_index", "_hitData", "_fragTypes", "_fragType", "_foundObjects"]; + +private ["_params", "_hitData", "_initialData", "_hpData", "_object", "_foundObjects", "_index", "_foundObjecsts", "_roundType", "_round", "_caliber", "_explosive", "_idh", "_alive", "_exit", "_vm", "_velocity", "_oldVelocity", "_curVelocity", "_diff", "_polar", "_unitDir", "_spallPos", "_pos1", "_i", "_pos2", "_blah", "_data", "_spallPolar", "_warn", "_c", "_m", "_k", "_gC", "_fragPower", "_fragTypes", "_spread", "_spallCount", "_elev", "_dir", "_vel", "_spallFragVect", "_fragType", "_fragment", "_pos"]; _params = _this select 0; [(_this select 1)] call cba_fnc_removePerFrameHandler; diff --git a/addons/frag/functions/fnc_frago.sqf b/addons/frag/functions/fnc_frago.sqf index de7c6986d9..43eb9d5a67 100644 --- a/addons/frag/functions/fnc_frago.sqf +++ b/addons/frag/functions/fnc_frago.sqf @@ -9,13 +9,8 @@ if(!isServer) exitWith { }; // _startTime = diag_tickTime; -private ["_round", "_lastPos", "_lastVel", "_shellType", "_gun", "_fragTypes", "_warn", "_atlPos", "_isArmed", - "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", - "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_target", "_boundingBox", - "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", - "_currentCount", "_count", "_vecVar", "_i", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", - "_sectorSize", "_sectorOffset", "_randomDir", "_endTime"]; +private ["_startTime", "_round", "_lastPos", "_lastVel", "_shellType", "_gun", "_fragTypes", "_warn", "_atlPos", "_isArmed", "_fuseDist", "_indirectHitRange", "_fragRange", "_c", "_m", "_k", "_gC", "_fragPower", "_fragPowerRandom", "_manObjects", "_objects", "_crew", "_fragCount", "_fragArcs", "_doRandom", "_boundingBox", "_targetPos", "_distance", "_add", "_bbX", "_bbY", "_bbZ", "_cubic", "_targetVel", "_baseVec", "_dir", "_currentCount", "_count", "_vecVar", "_vec", "_fp", "_vel", "_fragType", "_fragObj", "_randomCount", "_sectorSize", "_sectorOffset", "_i", "_randomDir", "_endTime", "_target"]; _round = _this select 0; _lastPos = _this select 1; From a4d0af4b679e171ba4d63ec2f657c688dca52ccb Mon Sep 17 00:00:00 2001 From: Glowbal Date: Wed, 13 May 2015 15:55:03 +0200 Subject: [PATCH 133/172] Fix medical vehicle return value Could fix #1142 --- addons/medical/functions/fnc_isMedicalVehicle.sqf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/medical/functions/fnc_isMedicalVehicle.sqf b/addons/medical/functions/fnc_isMedicalVehicle.sqf index 5635700fe0..5e9283852f 100644 --- a/addons/medical/functions/fnc_isMedicalVehicle.sqf +++ b/addons/medical/functions/fnc_isMedicalVehicle.sqf @@ -15,4 +15,4 @@ private ["_vehicle"]; _vehicle = _this select 0; -_vehicle getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant") == 1] +(_vehicle getVariable [QGVAR(medicClass), getNumber (configFile >> "CfgVehicles" >> typeOf _vehicle >> "attendant")]) > 0 From 3ff9ea230a9556e5721fe860bce681e0308ce9fa Mon Sep 17 00:00:00 2001 From: jaynus Date: Wed, 13 May 2015 08:34:14 -0700 Subject: [PATCH 134/172] initial pick from vehicledamage for new extension build process. --- extensions/CMakeLists.txt | 84 +- .../AdvancedBallistics.cpp | 34 +- extensions/advanced_ballistics/CMakeLists.txt | 7 +- extensions/break_line/CMakeLists.txt | 7 +- extensions/break_line/ace_break_line.cpp | 4 +- extensions/clipboard/ace_clipboard.cpp | 17 +- extensions/cmake/FindDirectX.cmake | 215 + extensions/common/CMakeLists.txt | 18 + extensions/common/arguments.hpp | 90 + extensions/common/directx/d3d_display.cpp | 439 ++ extensions/common/directx/d3d_display.hpp | 130 + extensions/common/dispatch.hpp | 153 + extensions/common/easyloggingc++.hpp | 6718 +++++++++++++++++ extensions/common/glm/CMakeLists.txt | 43 + extensions/common/glm/common.hpp | 35 + extensions/common/glm/detail/_features.hpp | 428 ++ extensions/common/glm/detail/_fixes.hpp | 59 + extensions/common/glm/detail/_noise.hpp | 136 + extensions/common/glm/detail/_swizzle.hpp | 833 ++ .../common/glm/detail/_swizzle_func.hpp | 725 ++ extensions/common/glm/detail/_vectorize.hpp | 160 + extensions/common/glm/detail/dummy.cpp | 232 + extensions/common/glm/detail/func_common.hpp | 456 ++ extensions/common/glm/detail/func_common.inl | 758 ++ .../common/glm/detail/func_exponential.hpp | 132 + .../common/glm/detail/func_exponential.inl | 161 + .../common/glm/detail/func_geometric.hpp | 142 + .../common/glm/detail/func_geometric.inl | 201 + extensions/common/glm/detail/func_integer.hpp | 232 + extensions/common/glm/detail/func_integer.inl | 393 + extensions/common/glm/detail/func_matrix.hpp | 178 + extensions/common/glm/detail/func_matrix.inl | 310 + extensions/common/glm/detail/func_noise.hpp | 93 + extensions/common/glm/detail/func_noise.inl | 388 + extensions/common/glm/detail/func_packing.hpp | 197 + extensions/common/glm/detail/func_packing.inl | 119 + .../common/glm/detail/func_trigonometric.hpp | 205 + .../common/glm/detail/func_trigonometric.inl | 224 + .../glm/detail/func_vector_relational.hpp | 140 + .../glm/detail/func_vector_relational.inl | 131 + extensions/common/glm/detail/glm.cpp | 286 + .../common/glm/detail/intrinsic_common.hpp | 87 + .../common/glm/detail/intrinsic_common.inl | 313 + .../glm/detail/intrinsic_exponential.hpp | 77 + .../glm/detail/intrinsic_exponential.inl | 27 + .../common/glm/detail/intrinsic_geometric.hpp | 74 + .../common/glm/detail/intrinsic_geometric.inl | 147 + .../common/glm/detail/intrinsic_integer.hpp | 48 + .../common/glm/detail/intrinsic_integer.inl | 139 + .../common/glm/detail/intrinsic_matrix.hpp | 67 + .../common/glm/detail/intrinsic_matrix.inl | 1070 +++ .../glm/detail/intrinsic_trigonometric.hpp | 46 + .../glm/detail/intrinsic_trigonometric.inl | 27 + .../detail/intrinsic_vector_relational.hpp | 46 + .../detail/intrinsic_vector_relational.inl | 366 + extensions/common/glm/detail/precision.hpp | 44 + extensions/common/glm/detail/setup.hpp | 962 +++ extensions/common/glm/detail/type_float.hpp | 96 + extensions/common/glm/detail/type_gentype.hpp | 224 + extensions/common/glm/detail/type_gentype.inl | 370 + extensions/common/glm/detail/type_half.hpp | 48 + extensions/common/glm/detail/type_half.inl | 277 + extensions/common/glm/detail/type_int.hpp | 326 + extensions/common/glm/detail/type_mat.hpp | 793 ++ extensions/common/glm/detail/type_mat.inl | 32 + extensions/common/glm/detail/type_mat2x2.hpp | 223 + extensions/common/glm/detail/type_mat2x2.inl | 548 ++ extensions/common/glm/detail/type_mat2x3.hpp | 201 + extensions/common/glm/detail/type_mat2x3.inl | 506 ++ extensions/common/glm/detail/type_mat2x4.hpp | 202 + extensions/common/glm/detail/type_mat2x4.inl | 515 ++ extensions/common/glm/detail/type_mat3x2.hpp | 207 + extensions/common/glm/detail/type_mat3x2.inl | 540 ++ extensions/common/glm/detail/type_mat3x3.hpp | 230 + extensions/common/glm/detail/type_mat3x3.inl | 631 ++ extensions/common/glm/detail/type_mat3x4.hpp | 206 + extensions/common/glm/detail/type_mat3x4.inl | 579 ++ extensions/common/glm/detail/type_mat4x2.hpp | 212 + extensions/common/glm/detail/type_mat4x2.inl | 587 ++ extensions/common/glm/detail/type_mat4x3.hpp | 211 + extensions/common/glm/detail/type_mat4x3.inl | 631 ++ extensions/common/glm/detail/type_mat4x4.hpp | 235 + extensions/common/glm/detail/type_mat4x4.inl | 790 ++ extensions/common/glm/detail/type_vec.hpp | 518 ++ extensions/common/glm/detail/type_vec.inl | 31 + extensions/common/glm/detail/type_vec1.hpp | 322 + extensions/common/glm/detail/type_vec1.inl | 616 ++ extensions/common/glm/detail/type_vec2.hpp | 403 + extensions/common/glm/detail/type_vec2.inl | 909 +++ extensions/common/glm/detail/type_vec3.hpp | 425 ++ extensions/common/glm/detail/type_vec3.inl | 1042 +++ extensions/common/glm/detail/type_vec4.hpp | 531 ++ extensions/common/glm/detail/type_vec4.inl | 1124 +++ .../common/glm/detail/type_vec4_avx.inl | 41 + .../common/glm/detail/type_vec4_avx2.inl | 41 + .../common/glm/detail/type_vec4_sse2.inl | 120 + extensions/common/glm/exponential.hpp | 35 + extensions/common/glm/ext.hpp | 143 + extensions/common/glm/fwd.hpp | 2601 +++++++ extensions/common/glm/geometric.hpp | 35 + extensions/common/glm/glm.hpp | 117 + extensions/common/glm/gtc/bitfield.hpp | 236 + extensions/common/glm/gtc/bitfield.inl | 542 ++ extensions/common/glm/gtc/constants.hpp | 205 + extensions/common/glm/gtc/constants.inl | 210 + extensions/common/glm/gtc/epsilon.hpp | 102 + extensions/common/glm/gtc/epsilon.inl | 154 + extensions/common/glm/gtc/integer.hpp | 105 + extensions/common/glm/gtc/integer.inl | 74 + extensions/common/glm/gtc/matrix_access.hpp | 88 + extensions/common/glm/gtc/matrix_access.inl | 92 + extensions/common/glm/gtc/matrix_integer.hpp | 515 ++ extensions/common/glm/gtc/matrix_inverse.hpp | 78 + extensions/common/glm/gtc/matrix_inverse.inl | 148 + .../common/glm/gtc/matrix_transform.hpp | 304 + .../common/glm/gtc/matrix_transform.inl | 413 + extensions/common/glm/gtc/noise.hpp | 89 + extensions/common/glm/gtc/noise.inl | 837 ++ extensions/common/glm/gtc/packing.hpp | 478 ++ extensions/common/glm/gtc/packing.inl | 490 ++ extensions/common/glm/gtc/quaternion.hpp | 377 + extensions/common/glm/gtc/quaternion.inl | 784 ++ extensions/common/glm/gtc/random.hpp | 120 + extensions/common/glm/gtc/random.inl | 379 + extensions/common/glm/gtc/reciprocal.hpp | 134 + extensions/common/glm/gtc/reciprocal.inl | 221 + extensions/common/glm/gtc/round.hpp | 203 + extensions/common/glm/gtc/round.inl | 378 + extensions/common/glm/gtc/type_precision.hpp | 890 +++ extensions/common/glm/gtc/type_precision.inl | 36 + extensions/common/glm/gtc/type_ptr.hpp | 178 + extensions/common/glm/gtc/type_ptr.inl | 479 ++ extensions/common/glm/gtc/ulp.hpp | 92 + extensions/common/glm/gtc/ulp.inl | 350 + extensions/common/glm/gtc/vec1.hpp | 193 + extensions/common/glm/gtc/vec1.inl | 31 + .../common/glm/gtx/associated_min_max.hpp | 231 + .../common/glm/gtx/associated_min_max.inl | 384 + extensions/common/glm/gtx/bit.hpp | 120 + extensions/common/glm/gtx/bit.inl | 107 + extensions/common/glm/gtx/closest_point.hpp | 74 + extensions/common/glm/gtx/closest_point.inl | 75 + extensions/common/glm/gtx/color_space.hpp | 97 + extensions/common/glm/gtx/color_space.inl | 172 + .../common/glm/gtx/color_space_YCoCg.hpp | 85 + .../common/glm/gtx/color_space_YCoCg.inl | 87 + extensions/common/glm/gtx/common.hpp | 74 + extensions/common/glm/gtx/common.inl | 102 + extensions/common/glm/gtx/compatibility.hpp | 158 + extensions/common/glm/gtx/compatibility.inl | 83 + extensions/common/glm/gtx/component_wise.hpp | 84 + extensions/common/glm/gtx/component_wise.inl | 70 + extensions/common/glm/gtx/dual_quaternion.hpp | 321 + extensions/common/glm/gtx/dual_quaternion.inl | 400 + extensions/common/glm/gtx/euler_angles.hpp | 156 + extensions/common/glm/gtx/euler_angles.inl | 287 + extensions/common/glm/gtx/extend.hpp | 67 + extensions/common/glm/gtx/extend.inl | 78 + .../common/glm/gtx/extented_min_max.hpp | 162 + .../common/glm/gtx/extented_min_max.inl | 169 + .../common/glm/gtx/fast_exponential.hpp | 120 + .../common/glm/gtx/fast_exponential.inl | 166 + .../common/glm/gtx/fast_square_root.hpp | 117 + .../common/glm/gtx/fast_square_root.inl | 110 + .../common/glm/gtx/fast_trigonometry.hpp | 104 + .../common/glm/gtx/fast_trigonometry.inl | 162 + extensions/common/glm/gtx/gradient_paint.hpp | 77 + extensions/common/glm/gtx/gradient_paint.inl | 66 + .../glm/gtx/handed_coordinate_space.hpp | 75 + .../glm/gtx/handed_coordinate_space.inl | 56 + extensions/common/glm/gtx/integer.hpp | 101 + extensions/common/glm/gtx/integer.inl | 211 + extensions/common/glm/gtx/intersect.hpp | 112 + extensions/common/glm/gtx/intersect.inl | 217 + extensions/common/glm/gtx/io.hpp | 224 + extensions/common/glm/gtx/io.inl | 618 ++ extensions/common/glm/gtx/log_base.hpp | 73 + extensions/common/glm/gtx/log_base.inl | 47 + .../common/glm/gtx/matrix_cross_product.hpp | 72 + .../common/glm/gtx/matrix_cross_product.inl | 67 + .../common/glm/gtx/matrix_decompose.hpp | 70 + .../common/glm/gtx/matrix_decompose.inl | 231 + .../common/glm/gtx/matrix_interpolation.hpp | 89 + .../common/glm/gtx/matrix_interpolation.inl | 163 + .../common/glm/gtx/matrix_major_storage.hpp | 144 + .../common/glm/gtx/matrix_major_storage.inl | 196 + .../common/glm/gtx/matrix_operation.hpp | 113 + .../common/glm/gtx/matrix_operation.inl | 147 + extensions/common/glm/gtx/matrix_query.hpp | 102 + extensions/common/glm/gtx/matrix_query.inl | 143 + .../common/glm/gtx/matrix_transform_2d.hpp | 106 + .../common/glm/gtx/matrix_transform_2d.inl | 97 + extensions/common/glm/gtx/mixed_product.hpp | 66 + extensions/common/glm/gtx/mixed_product.inl | 45 + extensions/common/glm/gtx/multiple.hpp | 106 + extensions/common/glm/gtx/multiple.inl | 64 + extensions/common/glm/gtx/norm.hpp | 128 + extensions/common/glm/gtx/norm.inl | 170 + extensions/common/glm/gtx/normal.hpp | 68 + extensions/common/glm/gtx/normal.inl | 45 + extensions/common/glm/gtx/normalize_dot.hpp | 74 + extensions/common/glm/gtx/normalize_dot.inl | 46 + .../common/glm/gtx/number_precision.hpp | 86 + .../common/glm/gtx/number_precision.inl | 36 + extensions/common/glm/gtx/optimum_pow.hpp | 79 + extensions/common/glm/gtx/optimum_pow.inl | 52 + extensions/common/glm/gtx/orthonormalize.hpp | 74 + extensions/common/glm/gtx/orthonormalize.inl | 59 + extensions/common/glm/gtx/perpendicular.hpp | 68 + extensions/common/glm/gtx/perpendicular.inl | 44 + .../common/glm/gtx/polar_coordinates.hpp | 73 + .../common/glm/gtx/polar_coordinates.inl | 66 + extensions/common/glm/gtx/projection.hpp | 65 + extensions/common/glm/gtx/projection.inl | 40 + extensions/common/glm/gtx/quaternion.hpp | 214 + extensions/common/glm/gtx/quaternion.inl | 285 + extensions/common/glm/gtx/range.hpp | 102 + extensions/common/glm/gtx/raw_data.hpp | 76 + extensions/common/glm/gtx/raw_data.inl | 31 + .../common/glm/gtx/rotate_normalized_axis.hpp | 93 + .../common/glm/gtx/rotate_normalized_axis.inl | 88 + extensions/common/glm/gtx/rotate_vector.hpp | 146 + extensions/common/glm/gtx/rotate_vector.inl | 217 + .../common/glm/gtx/scalar_multiplication.hpp | 98 + .../common/glm/gtx/scalar_relational.hpp | 61 + .../common/glm/gtx/scalar_relational.inl | 118 + extensions/common/glm/gtx/simd_mat4.hpp | 205 + extensions/common/glm/gtx/simd_mat4.inl | 602 ++ extensions/common/glm/gtx/simd_quat.hpp | 335 + extensions/common/glm/gtx/simd_quat.inl | 645 ++ extensions/common/glm/gtx/simd_vec4.hpp | 574 ++ extensions/common/glm/gtx/simd_vec4.inl | 727 ++ extensions/common/glm/gtx/spline.hpp | 90 + extensions/common/glm/gtx/spline.inl | 92 + extensions/common/glm/gtx/std_based_type.hpp | 92 + extensions/common/glm/gtx/std_based_type.inl | 36 + extensions/common/glm/gtx/string_cast.hpp | 74 + extensions/common/glm/gtx/string_cast.inl | 455 ++ extensions/common/glm/gtx/transform.hpp | 85 + extensions/common/glm/gtx/transform.inl | 60 + extensions/common/glm/gtx/transform2.hpp | 136 + extensions/common/glm/gtx/transform2.inl | 177 + extensions/common/glm/gtx/type_aligned.hpp | 995 +++ extensions/common/glm/gtx/type_aligned.inl | 36 + extensions/common/glm/gtx/vector_angle.hpp | 89 + extensions/common/glm/gtx/vector_angle.inl | 87 + extensions/common/glm/gtx/vector_query.hpp | 91 + extensions/common/glm/gtx/vector_query.inl | 222 + extensions/common/glm/gtx/wrap.hpp | 74 + extensions/common/glm/gtx/wrap.inl | 185 + extensions/common/glm/integer.hpp | 35 + extensions/common/glm/mat2x2.hpp | 81 + extensions/common/glm/mat2x3.hpp | 61 + extensions/common/glm/mat2x4.hpp | 60 + extensions/common/glm/mat3x2.hpp | 60 + extensions/common/glm/mat3x3.hpp | 81 + extensions/common/glm/mat3x4.hpp | 60 + extensions/common/glm/mat4x2.hpp | 60 + extensions/common/glm/mat4x3.hpp | 60 + extensions/common/glm/mat4x4.hpp | 81 + extensions/common/glm/matrix.hpp | 35 + extensions/common/glm/packing.hpp | 35 + extensions/common/glm/trigonometric.hpp | 35 + extensions/common/glm/vec2.hpp | 35 + extensions/common/glm/vec3.hpp | 35 + extensions/common/glm/vec4.hpp | 35 + extensions/common/glm/vector_relational.hpp | 35 + extensions/common/logging.hpp | 6 + extensions/common/lzoconf.h | 453 ++ extensions/common/lzodefs.h | 3134 ++++++++ extensions/common/membuf.hpp | 56 + extensions/common/minilzo.c | 6231 +++++++++++++++ extensions/common/minilzo.h | 106 + extensions/common/p3d/animation.cpp | 72 + extensions/common/p3d/animation.hpp | 69 + extensions/common/p3d/compressed.cpp | 237 + extensions/common/p3d/compressed.hpp | 166 + extensions/common/p3d/lod_info.cpp | 289 + extensions/common/p3d/lod_info.hpp | 237 + extensions/common/p3d/lod_types.hpp | 33 + extensions/common/p3d/model.cpp | 116 + extensions/common/p3d/model.hpp | 57 + extensions/common/p3d/model_info.cpp | 91 + extensions/common/p3d/model_info.hpp | 74 + extensions/common/p3d/parser.cpp | 26 + extensions/common/p3d/parser.hpp | 17 + extensions/common/p3d/parser_ref.txt | 269 + extensions/common/p3d/read_helpers.hpp | 11 + extensions/common/p3d/skeleton.cpp | 46 + extensions/common/p3d/skeleton.hpp | 36 + extensions/common/pbo/archive.cpp | 91 + extensions/common/pbo/archive.hpp | 61 + extensions/common/pbo/search.cpp | 301 + extensions/common/pbo/search.hpp | 27 + extensions/common/shared.cpp | 41 + extensions/common/shared.hpp | 77 + extensions/common/simplepipe_win32.cpp | 179 + extensions/common/simplepipe_win32.hpp | 57 + extensions/common/simulation/object.cpp | 464 ++ extensions/common/simulation/object.hpp | 221 + extensions/common/singleton.hpp | 31 + extensions/common/targetver.h | 2 +- extensions/common/transform_matrix.hpp | 34 + extensions/common/vector.cpp | 11 + extensions/common/vector.hpp | 161 + extensions/dynload/CMakeLists.txt | 14 + extensions/dynload/ace_dynload.cpp | 66 + extensions/dynload/ace_dynload_dllmain.cpp | 33 + extensions/dynload/dynloader.hpp | 168 + extensions/fcs/CMakeLists.txt | 7 +- extensions/fcs/ace_fcs.cpp | 5 +- extensions/lib/bullet3 | 1 + 312 files changed, 79346 insertions(+), 40 deletions(-) create mode 100644 extensions/cmake/FindDirectX.cmake create mode 100644 extensions/common/CMakeLists.txt create mode 100644 extensions/common/arguments.hpp create mode 100644 extensions/common/directx/d3d_display.cpp create mode 100644 extensions/common/directx/d3d_display.hpp create mode 100644 extensions/common/dispatch.hpp create mode 100644 extensions/common/easyloggingc++.hpp create mode 100644 extensions/common/glm/CMakeLists.txt create mode 100644 extensions/common/glm/common.hpp create mode 100644 extensions/common/glm/detail/_features.hpp create mode 100644 extensions/common/glm/detail/_fixes.hpp create mode 100644 extensions/common/glm/detail/_noise.hpp create mode 100644 extensions/common/glm/detail/_swizzle.hpp create mode 100644 extensions/common/glm/detail/_swizzle_func.hpp create mode 100644 extensions/common/glm/detail/_vectorize.hpp create mode 100644 extensions/common/glm/detail/dummy.cpp create mode 100644 extensions/common/glm/detail/func_common.hpp create mode 100644 extensions/common/glm/detail/func_common.inl create mode 100644 extensions/common/glm/detail/func_exponential.hpp create mode 100644 extensions/common/glm/detail/func_exponential.inl create mode 100644 extensions/common/glm/detail/func_geometric.hpp create mode 100644 extensions/common/glm/detail/func_geometric.inl create mode 100644 extensions/common/glm/detail/func_integer.hpp create mode 100644 extensions/common/glm/detail/func_integer.inl create mode 100644 extensions/common/glm/detail/func_matrix.hpp create mode 100644 extensions/common/glm/detail/func_matrix.inl create mode 100644 extensions/common/glm/detail/func_noise.hpp create mode 100644 extensions/common/glm/detail/func_noise.inl create mode 100644 extensions/common/glm/detail/func_packing.hpp create mode 100644 extensions/common/glm/detail/func_packing.inl create mode 100644 extensions/common/glm/detail/func_trigonometric.hpp create mode 100644 extensions/common/glm/detail/func_trigonometric.inl create mode 100644 extensions/common/glm/detail/func_vector_relational.hpp create mode 100644 extensions/common/glm/detail/func_vector_relational.inl create mode 100644 extensions/common/glm/detail/glm.cpp create mode 100644 extensions/common/glm/detail/intrinsic_common.hpp create mode 100644 extensions/common/glm/detail/intrinsic_common.inl create mode 100644 extensions/common/glm/detail/intrinsic_exponential.hpp create mode 100644 extensions/common/glm/detail/intrinsic_exponential.inl create mode 100644 extensions/common/glm/detail/intrinsic_geometric.hpp create mode 100644 extensions/common/glm/detail/intrinsic_geometric.inl create mode 100644 extensions/common/glm/detail/intrinsic_integer.hpp create mode 100644 extensions/common/glm/detail/intrinsic_integer.inl create mode 100644 extensions/common/glm/detail/intrinsic_matrix.hpp create mode 100644 extensions/common/glm/detail/intrinsic_matrix.inl create mode 100644 extensions/common/glm/detail/intrinsic_trigonometric.hpp create mode 100644 extensions/common/glm/detail/intrinsic_trigonometric.inl create mode 100644 extensions/common/glm/detail/intrinsic_vector_relational.hpp create mode 100644 extensions/common/glm/detail/intrinsic_vector_relational.inl create mode 100644 extensions/common/glm/detail/precision.hpp create mode 100644 extensions/common/glm/detail/setup.hpp create mode 100644 extensions/common/glm/detail/type_float.hpp create mode 100644 extensions/common/glm/detail/type_gentype.hpp create mode 100644 extensions/common/glm/detail/type_gentype.inl create mode 100644 extensions/common/glm/detail/type_half.hpp create mode 100644 extensions/common/glm/detail/type_half.inl create mode 100644 extensions/common/glm/detail/type_int.hpp create mode 100644 extensions/common/glm/detail/type_mat.hpp create mode 100644 extensions/common/glm/detail/type_mat.inl create mode 100644 extensions/common/glm/detail/type_mat2x2.hpp create mode 100644 extensions/common/glm/detail/type_mat2x2.inl create mode 100644 extensions/common/glm/detail/type_mat2x3.hpp create mode 100644 extensions/common/glm/detail/type_mat2x3.inl create mode 100644 extensions/common/glm/detail/type_mat2x4.hpp create mode 100644 extensions/common/glm/detail/type_mat2x4.inl create mode 100644 extensions/common/glm/detail/type_mat3x2.hpp create mode 100644 extensions/common/glm/detail/type_mat3x2.inl create mode 100644 extensions/common/glm/detail/type_mat3x3.hpp create mode 100644 extensions/common/glm/detail/type_mat3x3.inl create mode 100644 extensions/common/glm/detail/type_mat3x4.hpp create mode 100644 extensions/common/glm/detail/type_mat3x4.inl create mode 100644 extensions/common/glm/detail/type_mat4x2.hpp create mode 100644 extensions/common/glm/detail/type_mat4x2.inl create mode 100644 extensions/common/glm/detail/type_mat4x3.hpp create mode 100644 extensions/common/glm/detail/type_mat4x3.inl create mode 100644 extensions/common/glm/detail/type_mat4x4.hpp create mode 100644 extensions/common/glm/detail/type_mat4x4.inl create mode 100644 extensions/common/glm/detail/type_vec.hpp create mode 100644 extensions/common/glm/detail/type_vec.inl create mode 100644 extensions/common/glm/detail/type_vec1.hpp create mode 100644 extensions/common/glm/detail/type_vec1.inl create mode 100644 extensions/common/glm/detail/type_vec2.hpp create mode 100644 extensions/common/glm/detail/type_vec2.inl create mode 100644 extensions/common/glm/detail/type_vec3.hpp create mode 100644 extensions/common/glm/detail/type_vec3.inl create mode 100644 extensions/common/glm/detail/type_vec4.hpp create mode 100644 extensions/common/glm/detail/type_vec4.inl create mode 100644 extensions/common/glm/detail/type_vec4_avx.inl create mode 100644 extensions/common/glm/detail/type_vec4_avx2.inl create mode 100644 extensions/common/glm/detail/type_vec4_sse2.inl create mode 100644 extensions/common/glm/exponential.hpp create mode 100644 extensions/common/glm/ext.hpp create mode 100644 extensions/common/glm/fwd.hpp create mode 100644 extensions/common/glm/geometric.hpp create mode 100644 extensions/common/glm/glm.hpp create mode 100644 extensions/common/glm/gtc/bitfield.hpp create mode 100644 extensions/common/glm/gtc/bitfield.inl create mode 100644 extensions/common/glm/gtc/constants.hpp create mode 100644 extensions/common/glm/gtc/constants.inl create mode 100644 extensions/common/glm/gtc/epsilon.hpp create mode 100644 extensions/common/glm/gtc/epsilon.inl create mode 100644 extensions/common/glm/gtc/integer.hpp create mode 100644 extensions/common/glm/gtc/integer.inl create mode 100644 extensions/common/glm/gtc/matrix_access.hpp create mode 100644 extensions/common/glm/gtc/matrix_access.inl create mode 100644 extensions/common/glm/gtc/matrix_integer.hpp create mode 100644 extensions/common/glm/gtc/matrix_inverse.hpp create mode 100644 extensions/common/glm/gtc/matrix_inverse.inl create mode 100644 extensions/common/glm/gtc/matrix_transform.hpp create mode 100644 extensions/common/glm/gtc/matrix_transform.inl create mode 100644 extensions/common/glm/gtc/noise.hpp create mode 100644 extensions/common/glm/gtc/noise.inl create mode 100644 extensions/common/glm/gtc/packing.hpp create mode 100644 extensions/common/glm/gtc/packing.inl create mode 100644 extensions/common/glm/gtc/quaternion.hpp create mode 100644 extensions/common/glm/gtc/quaternion.inl create mode 100644 extensions/common/glm/gtc/random.hpp create mode 100644 extensions/common/glm/gtc/random.inl create mode 100644 extensions/common/glm/gtc/reciprocal.hpp create mode 100644 extensions/common/glm/gtc/reciprocal.inl create mode 100644 extensions/common/glm/gtc/round.hpp create mode 100644 extensions/common/glm/gtc/round.inl create mode 100644 extensions/common/glm/gtc/type_precision.hpp create mode 100644 extensions/common/glm/gtc/type_precision.inl create mode 100644 extensions/common/glm/gtc/type_ptr.hpp create mode 100644 extensions/common/glm/gtc/type_ptr.inl create mode 100644 extensions/common/glm/gtc/ulp.hpp create mode 100644 extensions/common/glm/gtc/ulp.inl create mode 100644 extensions/common/glm/gtc/vec1.hpp create mode 100644 extensions/common/glm/gtc/vec1.inl create mode 100644 extensions/common/glm/gtx/associated_min_max.hpp create mode 100644 extensions/common/glm/gtx/associated_min_max.inl create mode 100644 extensions/common/glm/gtx/bit.hpp create mode 100644 extensions/common/glm/gtx/bit.inl create mode 100644 extensions/common/glm/gtx/closest_point.hpp create mode 100644 extensions/common/glm/gtx/closest_point.inl create mode 100644 extensions/common/glm/gtx/color_space.hpp create mode 100644 extensions/common/glm/gtx/color_space.inl create mode 100644 extensions/common/glm/gtx/color_space_YCoCg.hpp create mode 100644 extensions/common/glm/gtx/color_space_YCoCg.inl create mode 100644 extensions/common/glm/gtx/common.hpp create mode 100644 extensions/common/glm/gtx/common.inl create mode 100644 extensions/common/glm/gtx/compatibility.hpp create mode 100644 extensions/common/glm/gtx/compatibility.inl create mode 100644 extensions/common/glm/gtx/component_wise.hpp create mode 100644 extensions/common/glm/gtx/component_wise.inl create mode 100644 extensions/common/glm/gtx/dual_quaternion.hpp create mode 100644 extensions/common/glm/gtx/dual_quaternion.inl create mode 100644 extensions/common/glm/gtx/euler_angles.hpp create mode 100644 extensions/common/glm/gtx/euler_angles.inl create mode 100644 extensions/common/glm/gtx/extend.hpp create mode 100644 extensions/common/glm/gtx/extend.inl create mode 100644 extensions/common/glm/gtx/extented_min_max.hpp create mode 100644 extensions/common/glm/gtx/extented_min_max.inl create mode 100644 extensions/common/glm/gtx/fast_exponential.hpp create mode 100644 extensions/common/glm/gtx/fast_exponential.inl create mode 100644 extensions/common/glm/gtx/fast_square_root.hpp create mode 100644 extensions/common/glm/gtx/fast_square_root.inl create mode 100644 extensions/common/glm/gtx/fast_trigonometry.hpp create mode 100644 extensions/common/glm/gtx/fast_trigonometry.inl create mode 100644 extensions/common/glm/gtx/gradient_paint.hpp create mode 100644 extensions/common/glm/gtx/gradient_paint.inl create mode 100644 extensions/common/glm/gtx/handed_coordinate_space.hpp create mode 100644 extensions/common/glm/gtx/handed_coordinate_space.inl create mode 100644 extensions/common/glm/gtx/integer.hpp create mode 100644 extensions/common/glm/gtx/integer.inl create mode 100644 extensions/common/glm/gtx/intersect.hpp create mode 100644 extensions/common/glm/gtx/intersect.inl create mode 100644 extensions/common/glm/gtx/io.hpp create mode 100644 extensions/common/glm/gtx/io.inl create mode 100644 extensions/common/glm/gtx/log_base.hpp create mode 100644 extensions/common/glm/gtx/log_base.inl create mode 100644 extensions/common/glm/gtx/matrix_cross_product.hpp create mode 100644 extensions/common/glm/gtx/matrix_cross_product.inl create mode 100644 extensions/common/glm/gtx/matrix_decompose.hpp create mode 100644 extensions/common/glm/gtx/matrix_decompose.inl create mode 100644 extensions/common/glm/gtx/matrix_interpolation.hpp create mode 100644 extensions/common/glm/gtx/matrix_interpolation.inl create mode 100644 extensions/common/glm/gtx/matrix_major_storage.hpp create mode 100644 extensions/common/glm/gtx/matrix_major_storage.inl create mode 100644 extensions/common/glm/gtx/matrix_operation.hpp create mode 100644 extensions/common/glm/gtx/matrix_operation.inl create mode 100644 extensions/common/glm/gtx/matrix_query.hpp create mode 100644 extensions/common/glm/gtx/matrix_query.inl create mode 100644 extensions/common/glm/gtx/matrix_transform_2d.hpp create mode 100644 extensions/common/glm/gtx/matrix_transform_2d.inl create mode 100644 extensions/common/glm/gtx/mixed_product.hpp create mode 100644 extensions/common/glm/gtx/mixed_product.inl create mode 100644 extensions/common/glm/gtx/multiple.hpp create mode 100644 extensions/common/glm/gtx/multiple.inl create mode 100644 extensions/common/glm/gtx/norm.hpp create mode 100644 extensions/common/glm/gtx/norm.inl create mode 100644 extensions/common/glm/gtx/normal.hpp create mode 100644 extensions/common/glm/gtx/normal.inl create mode 100644 extensions/common/glm/gtx/normalize_dot.hpp create mode 100644 extensions/common/glm/gtx/normalize_dot.inl create mode 100644 extensions/common/glm/gtx/number_precision.hpp create mode 100644 extensions/common/glm/gtx/number_precision.inl create mode 100644 extensions/common/glm/gtx/optimum_pow.hpp create mode 100644 extensions/common/glm/gtx/optimum_pow.inl create mode 100644 extensions/common/glm/gtx/orthonormalize.hpp create mode 100644 extensions/common/glm/gtx/orthonormalize.inl create mode 100644 extensions/common/glm/gtx/perpendicular.hpp create mode 100644 extensions/common/glm/gtx/perpendicular.inl create mode 100644 extensions/common/glm/gtx/polar_coordinates.hpp create mode 100644 extensions/common/glm/gtx/polar_coordinates.inl create mode 100644 extensions/common/glm/gtx/projection.hpp create mode 100644 extensions/common/glm/gtx/projection.inl create mode 100644 extensions/common/glm/gtx/quaternion.hpp create mode 100644 extensions/common/glm/gtx/quaternion.inl create mode 100644 extensions/common/glm/gtx/range.hpp create mode 100644 extensions/common/glm/gtx/raw_data.hpp create mode 100644 extensions/common/glm/gtx/raw_data.inl create mode 100644 extensions/common/glm/gtx/rotate_normalized_axis.hpp create mode 100644 extensions/common/glm/gtx/rotate_normalized_axis.inl create mode 100644 extensions/common/glm/gtx/rotate_vector.hpp create mode 100644 extensions/common/glm/gtx/rotate_vector.inl create mode 100644 extensions/common/glm/gtx/scalar_multiplication.hpp create mode 100644 extensions/common/glm/gtx/scalar_relational.hpp create mode 100644 extensions/common/glm/gtx/scalar_relational.inl create mode 100644 extensions/common/glm/gtx/simd_mat4.hpp create mode 100644 extensions/common/glm/gtx/simd_mat4.inl create mode 100644 extensions/common/glm/gtx/simd_quat.hpp create mode 100644 extensions/common/glm/gtx/simd_quat.inl create mode 100644 extensions/common/glm/gtx/simd_vec4.hpp create mode 100644 extensions/common/glm/gtx/simd_vec4.inl create mode 100644 extensions/common/glm/gtx/spline.hpp create mode 100644 extensions/common/glm/gtx/spline.inl create mode 100644 extensions/common/glm/gtx/std_based_type.hpp create mode 100644 extensions/common/glm/gtx/std_based_type.inl create mode 100644 extensions/common/glm/gtx/string_cast.hpp create mode 100644 extensions/common/glm/gtx/string_cast.inl create mode 100644 extensions/common/glm/gtx/transform.hpp create mode 100644 extensions/common/glm/gtx/transform.inl create mode 100644 extensions/common/glm/gtx/transform2.hpp create mode 100644 extensions/common/glm/gtx/transform2.inl create mode 100644 extensions/common/glm/gtx/type_aligned.hpp create mode 100644 extensions/common/glm/gtx/type_aligned.inl create mode 100644 extensions/common/glm/gtx/vector_angle.hpp create mode 100644 extensions/common/glm/gtx/vector_angle.inl create mode 100644 extensions/common/glm/gtx/vector_query.hpp create mode 100644 extensions/common/glm/gtx/vector_query.inl create mode 100644 extensions/common/glm/gtx/wrap.hpp create mode 100644 extensions/common/glm/gtx/wrap.inl create mode 100644 extensions/common/glm/integer.hpp create mode 100644 extensions/common/glm/mat2x2.hpp create mode 100644 extensions/common/glm/mat2x3.hpp create mode 100644 extensions/common/glm/mat2x4.hpp create mode 100644 extensions/common/glm/mat3x2.hpp create mode 100644 extensions/common/glm/mat3x3.hpp create mode 100644 extensions/common/glm/mat3x4.hpp create mode 100644 extensions/common/glm/mat4x2.hpp create mode 100644 extensions/common/glm/mat4x3.hpp create mode 100644 extensions/common/glm/mat4x4.hpp create mode 100644 extensions/common/glm/matrix.hpp create mode 100644 extensions/common/glm/packing.hpp create mode 100644 extensions/common/glm/trigonometric.hpp create mode 100644 extensions/common/glm/vec2.hpp create mode 100644 extensions/common/glm/vec3.hpp create mode 100644 extensions/common/glm/vec4.hpp create mode 100644 extensions/common/glm/vector_relational.hpp create mode 100644 extensions/common/logging.hpp create mode 100644 extensions/common/lzoconf.h create mode 100644 extensions/common/lzodefs.h create mode 100644 extensions/common/membuf.hpp create mode 100644 extensions/common/minilzo.c create mode 100644 extensions/common/minilzo.h create mode 100644 extensions/common/p3d/animation.cpp create mode 100644 extensions/common/p3d/animation.hpp create mode 100644 extensions/common/p3d/compressed.cpp create mode 100644 extensions/common/p3d/compressed.hpp create mode 100644 extensions/common/p3d/lod_info.cpp create mode 100644 extensions/common/p3d/lod_info.hpp create mode 100644 extensions/common/p3d/lod_types.hpp create mode 100644 extensions/common/p3d/model.cpp create mode 100644 extensions/common/p3d/model.hpp create mode 100644 extensions/common/p3d/model_info.cpp create mode 100644 extensions/common/p3d/model_info.hpp create mode 100644 extensions/common/p3d/parser.cpp create mode 100644 extensions/common/p3d/parser.hpp create mode 100644 extensions/common/p3d/parser_ref.txt create mode 100644 extensions/common/p3d/read_helpers.hpp create mode 100644 extensions/common/p3d/skeleton.cpp create mode 100644 extensions/common/p3d/skeleton.hpp create mode 100644 extensions/common/pbo/archive.cpp create mode 100644 extensions/common/pbo/archive.hpp create mode 100644 extensions/common/pbo/search.cpp create mode 100644 extensions/common/pbo/search.hpp create mode 100644 extensions/common/shared.cpp create mode 100644 extensions/common/shared.hpp create mode 100644 extensions/common/simplepipe_win32.cpp create mode 100644 extensions/common/simplepipe_win32.hpp create mode 100644 extensions/common/simulation/object.cpp create mode 100644 extensions/common/simulation/object.hpp create mode 100644 extensions/common/singleton.hpp create mode 100644 extensions/common/transform_matrix.hpp create mode 100644 extensions/common/vector.cpp create mode 100644 extensions/common/vector.hpp create mode 100644 extensions/dynload/CMakeLists.txt create mode 100644 extensions/dynload/ace_dynload.cpp create mode 100644 extensions/dynload/ace_dynload_dllmain.cpp create mode 100644 extensions/dynload/dynloader.hpp create mode 160000 extensions/lib/bullet3 diff --git a/extensions/CMakeLists.txt b/extensions/CMakeLists.txt index 9f4a8a29fa..b1c1703f94 100644 --- a/extensions/CMakeLists.txt +++ b/extensions/CMakeLists.txt @@ -1,11 +1,20 @@ cmake_minimum_required (VERSION 3.0) project (ACE) +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +if(WIN32) +add_definitions(/DWINVER=0x0600 /D_WIN32_WINNT=0x0600) +endif() + if (NOT CMAKE_BUILD_TYPE AND CMAKE_COMPILER_IS_GNUCXX) message(STATUS "No build type selected, default to Debug") set(CMAKE_BUILD_TYPE "Debug") endif() +option(DEVEL "DEVEL" OFF) +option(USE_BULLET "USE_BULLET" OFF) +option(USE_DIRECTX "USE_DIRECTX" OFF) option(USE_64BIT_BUILD "USE_64BIT_BUILD" OFF) option(USE_STATIC_LINKING "USE_STATIC_LINKING" ON) @@ -15,15 +24,66 @@ if(CMAKE_COMPILER_IS_GNUCXX) set(CMAKE_FIND_LIBRARY_SUFFIXES ".a") set(CMAKE_SHARED_LINKER_FLAGS "-static-libgcc -static-libstdc++") else() + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /arch:x86") set(CMAKE_CXX_FLAGS_DEBUG "/D _DEBUG /MTd /Zi /Ob0 /Od /RTC1") set(CMAKE_CXX_FLAGS_MINSIZEREL "/MT /O1 /Ob1 /D NDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "/MT /O2 /Ob2 /D NDEBUG") set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "/MT /Zi /O2 /Ob1 /D NDEBUG") endif() -file(GLOB ACE_COMMON_SOURCES common/*.h common/*.hpp common/*.c common/*.cpp) -add_library(ace_common STATIC ${ACE_COMMON_SOURCES}) -include_directories(AFTER "common") +include_directories("common") + +if(USE_BULLET) + # Dependencies + # + set(BACKUP_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}) + set(BACKUP_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}) + set(BACKUP_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + + add_definitions(-DUSE_DIRECTX) + add_subdirectory(lib/bullet3) + + set_target_properties(App_BasicExample PROPERTIES FOLDER Bullet3) + set_target_properties(App_HelloWorld PROPERTIES FOLDER Bullet3) + set_target_properties(App_ExampleBrowser PROPERTIES FOLDER Bullet3) + set_target_properties(Bullet2FileLoader PROPERTIES FOLDER Bullet3) + set_target_properties(Bullet3Collision PROPERTIES FOLDER Bullet3) + set_target_properties(Bullet3Dynamics PROPERTIES FOLDER Bullet3) + set_target_properties(Bullet3Geometry PROPERTIES FOLDER Bullet3) + set_target_properties(Bullet3Common PROPERTIES FOLDER Bullet3) + set_target_properties(Bullet3OpenCL_clew PROPERTIES FOLDER Bullet3) + set_target_properties(BulletCollision PROPERTIES FOLDER Bullet3) + set_target_properties(BulletDynamics PROPERTIES FOLDER Bullet3) + set_target_properties(BulletFileLoader PROPERTIES FOLDER Bullet3) + set_target_properties(BulletSoftBody PROPERTIES FOLDER Bullet3) + + set_target_properties(BulletWorldImporter PROPERTIES FOLDER Bullet3) + set_target_properties(BulletXmlWorldImporter PROPERTIES FOLDER Bullet3) + set_target_properties(ConvexDecomposition PROPERTIES FOLDER Bullet3) + set_target_properties(GIMPACTUtils PROPERTIES FOLDER Bullet3) + set_target_properties(gtest PROPERTIES FOLDER Bullet3) + set_target_properties(gwen PROPERTIES FOLDER Bullet3) + set_target_properties(HACD PROPERTIES FOLDER Bullet3) + set_target_properties(OpenGLWindow PROPERTIES FOLDER Bullet3) + set_target_properties(LinearMath PROPERTIES FOLDER Bullet3) + + set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BACKUP_ARCHIVE_OUTPUT_DIRECTORY}) + set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${BACKUP_LIBRARY_OUTPUT_DIRECTORY}) + set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${BACKUP_RUNTIME_OUTPUT_DIRECTORY}) + + include_directories(BEFORE "lib/bullet3/src") +endif() +if(USE_DIRECTX) + add_definitions(-DUSE_DIRECTX) + set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_MODULE_PATH}) + find_package (DirectX) + link_directories (BEFORE ${DirectX_D3DX11_LIBRARY}) + include_directories (BEFORE ${DirectX_D3DX11_INCLUDE_DIR} ) +endif() +if(DEVEL) + add_definitions(-DDEVEL) +endif() + string(TIMESTAMP ACE_BUILDSTAMP "%Y-%m-%dT%H:%M:%SZ") set(ACE_VERSION_MAJOR 3) @@ -50,13 +110,29 @@ if(MSVC) set(GLOBAL_RC ${CMAKE_CURRENT_BINARY_DIR}/common/ace_version_win32.rc) endif() -include_directories(AFTER ${CMAKE_CURRENT_BINARY_DIR}/common) +include_directories(${CMAKE_CURRENT_BINARY_DIR}/common) set(GLOBAL_SOURCES ${GLOBAL_RC}) + # Add extensions to build here +add_subdirectory(common) + +# Extensions + add_subdirectory(fcs) add_subdirectory(break_line) add_subdirectory(clipboard) add_subdirectory(advanced_ballistics) +# Test Extension for dynamically loading/unloading built extensions; does not build in release +if (DEVEL) + add_subdirectory(dynload) + add_subdirectory(tests) + if(USE_DIRECTX) + add_subdirectory(lib/directxtk) + endif() +endif() + + + message("Build Type: ${CMAKE_BUILD_TYPE}") \ No newline at end of file diff --git a/extensions/advanced_ballistics/AdvancedBallistics.cpp b/extensions/advanced_ballistics/AdvancedBallistics.cpp index e6c55184a7..7e87592e00 100644 --- a/extensions/advanced_ballistics/AdvancedBallistics.cpp +++ b/extensions/advanced_ballistics/AdvancedBallistics.cpp @@ -1,4 +1,4 @@ -#include "ace_common.h" +#include "shared.hpp" #include #include @@ -235,9 +235,11 @@ extern "C" void __stdcall RVExtension(char *output, int outputSize, const char *function) { + ZERO_OUTPUT(); + if (!strcmp(function, "version")) { int n = sprintf_s(output, outputSize, "%s", ACE_FULL_VERSION_STR); - return; + EXTENSION_RETURN(); } char* input = _strdup(function); @@ -257,7 +259,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) retard = calculateRetard(dragModel, ballisticCoefficient, velocity); int n = sprintf_s(output, outputSize, "%f", retard); - return; + EXTENSION_RETURN(); } else if (!strcmp(mode, "atmosphericCorrection")) { double ballisticCoefficient = 1.0; double temperature = 15.0; @@ -273,7 +275,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) ballisticCoefficient = calculateAtmosphericCorrection(ballisticCoefficient, temperature, pressure, humidity, atmosphereModel); int n = sprintf_s(output, outputSize, "%f", ballisticCoefficient); - return; + EXTENSION_RETURN(); } else if (!strcmp(mode, "new")) { unsigned int index = 0; double airFriction = 0.0; @@ -339,8 +341,10 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) tickTime = strtod(strtok_s(NULL, ":", &next_token), NULL); tickTime += strtod(strtok_s(NULL, ":", &next_token), NULL); - if (index >= bulletDatabase.size()) - bulletDatabase.resize(index+1); + while (index >= bulletDatabase.size()) { + Bullet bullet; + bulletDatabase.push_back(bullet); + } bulletDatabase[index].airFriction = airFriction; bulletDatabase[index].ballisticCoefficients = ballisticCoefficients; @@ -366,7 +370,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) bulletDatabase[index].randSeed = 0; int n = sprintf_s(output, outputSize, "%s", ""); - return; + EXTENSION_RETURN(); } else if (!strcmp(mode, "simulate")) { // simulate:0:[-0.109985,542.529,-3.98301]:[3751.57,5332.23,214.252]:[0.598153,2.38829,0]:28.6:0:0.481542:0:215.16 unsigned int index = 0; @@ -583,7 +587,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) }; int n = sprintf_s(output, outputSize, "_bullet setVelocity (_bulletVelocity vectorAdd [%f, %f, %f]); _bullet setPosASL (_bulletPosition vectorAdd [%f, %f, %f]);", velocityOffset[0], velocityOffset[1], velocityOffset[2], positionOffset[0], positionOffset[1], positionOffset[2]); - return; + EXTENSION_RETURN(); } else if (!strcmp(mode, "set")) { int height = 0; int numObjects = 0; @@ -598,7 +602,7 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) map->gridSurfaceIsWater.push_back(surfaceIsWater); int n = sprintf_s(output, outputSize, "%s", ""); - return; + EXTENSION_RETURN(); } else if (!strcmp(mode, "init")) { int mapSize = 0; int mapGrids = 0; @@ -609,15 +613,11 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) mapGrids = (int)ceil((double)mapSize / 50.0) + 1; gridCells = mapGrids * mapGrids; - - auto map_iter = mapDatabase.find(worldName); - if (map_iter == mapDatabase.end()) - return; - map = &map_iter->second; + map = &mapDatabase[worldName]; if (map->gridHeights.size() == gridCells) { int n = sprintf_s(output, outputSize, "%s", "Terrain already initialized"); - return; + EXTENSION_RETURN(); } map->mapSize = mapSize; @@ -630,9 +630,9 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) map->gridSurfaceIsWater.reserve(gridCells); int n = sprintf_s(output, outputSize, "%s", ""); - return; + EXTENSION_RETURN(); } int n = sprintf_s(output, outputSize, "%s", ""); - return; + EXTENSION_RETURN(); } diff --git a/extensions/advanced_ballistics/CMakeLists.txt b/extensions/advanced_ballistics/CMakeLists.txt index 19b9fc41d9..51e709f6d2 100644 --- a/extensions/advanced_ballistics/CMakeLists.txt +++ b/extensions/advanced_ballistics/CMakeLists.txt @@ -1,9 +1,10 @@ set(ACE_EXTENSION_NAME "ace_advanced_ballistics") file(GLOB SOURCES *.h *.hpp *.c *.cpp) -add_library( ${ACE_EXTENSION_NAME} SHARED ${GLOBAL_SOURCES} ${SOURCES}) -add_dependencies(${ACE_EXTENSION_NAME} ace_common) -SET_TARGET_PROPERTIES(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") +add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES} ${GLOBAL_SOURCES}) +target_link_libraries(${ACE_EXTENSION_NAME} ace_common) +set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") +set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES FOLDER Extensions) if(CMAKE_COMPILER_IS_GNUCXX) set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) diff --git a/extensions/break_line/CMakeLists.txt b/extensions/break_line/CMakeLists.txt index 00a74d4c3a..5d29d295c8 100644 --- a/extensions/break_line/CMakeLists.txt +++ b/extensions/break_line/CMakeLists.txt @@ -1,9 +1,10 @@ set(ACE_EXTENSION_NAME "ace_break_line") file(GLOB SOURCES *.h *.hpp *.c *.cpp) -add_library( ${ACE_EXTENSION_NAME} SHARED ${GLOBAL_SOURCES} ${SOURCES}) -add_dependencies(${ACE_EXTENSION_NAME} ace_common) -SET_TARGET_PROPERTIES(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") +add_library( ${ACE_EXTENSION_NAME} SHARED ${SOURCES} ${GLOBAL_SOURCES}) +target_link_libraries(${ACE_EXTENSION_NAME} ace_common) +set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES PREFIX "") +set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES FOLDER Extensions) if(CMAKE_COMPILER_IS_GNUCXX) set_target_properties(${ACE_EXTENSION_NAME} PROPERTIES LINK_SEARCH_START_STATIC 1) diff --git a/extensions/break_line/ace_break_line.cpp b/extensions/break_line/ace_break_line.cpp index 2b253c05bc..440566b744 100644 --- a/extensions/break_line/ace_break_line.cpp +++ b/extensions/break_line/ace_break_line.cpp @@ -11,7 +11,7 @@ * String with line breaks */ -#include "ace_common.h" +#include "shared.hpp" #include #include @@ -65,12 +65,14 @@ std::string addLineBreaks(const std::vector &words) { #pragma warning( disable : 4996 ) void __stdcall RVExtension(char *output, int outputSize, const char *function) { + ZERO_OUTPUT(); if (!strcmp(function, "version")) { strncpy(output, ACE_FULL_VERSION_STR, outputSize); } else { strncpy(output, addLineBreaks(splitString(function)).c_str(), outputSize); output[outputSize - 1] = '\0'; } + EXTENSION_RETURN(); } #pragma warning( pop ) diff --git a/extensions/clipboard/ace_clipboard.cpp b/extensions/clipboard/ace_clipboard.cpp index 4809a14acf..41e3a5721f 100644 --- a/extensions/clipboard/ace_clipboard.cpp +++ b/extensions/clipboard/ace_clipboard.cpp @@ -9,7 +9,7 @@ * Returns: * None */ -#include "ace_common.h" +#include "shared.hpp" #include #include @@ -23,12 +23,15 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) { std::string cur_input(function); std::string result; - if (cur_input.length() < 1) - return; + ZERO_OUTPUT(); + + if (cur_input.length() < 1) { + EXTENSION_RETURN(); + } if (!strcmp(function, "version")) { strncpy(output, ACE_FULL_VERSION_STR, outputSize); - return; + EXTENSION_RETURN(); } #ifdef _WIN32 @@ -38,14 +41,14 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) { if (!hClipboardData) { result = "GlobalAlloc() failed, GetLastError=" + GetLastError(); gClipboardData = ""; - return; + EXTENSION_RETURN(); } char *pClipboardData = (char *)GlobalLock(hClipboardData); if (!pClipboardData) { result = "GlobalLock() failed, GetLastError=" + GetLastError(); gClipboardData = ""; - return; + EXTENSION_RETURN(); } memcpy(pClipboardData, gClipboardData.c_str(), gClipboardData.length()); pClipboardData[gClipboardData.length() + 1] = 0x00; @@ -82,6 +85,6 @@ void __stdcall RVExtension(char *output, int outputSize, const char *function) { #endif - + EXTENSION_RETURN(); } diff --git a/extensions/cmake/FindDirectX.cmake b/extensions/cmake/FindDirectX.cmake new file mode 100644 index 0000000000..69bf1d62e8 --- /dev/null +++ b/extensions/cmake/FindDirectX.cmake @@ -0,0 +1,215 @@ +# - try to find DirectX include directories and libraries +# +# Once done this will define: +# +# DirectX_XYZ_FOUND - system has the XYZ API +# DirectX_XYZ_INCLUDE_FOUND - system has the include for the XYZ API +# DirectX_XYZ_INCLUDE_DIR - include directory for the XYZ API +# DirectX_XYZ_LIBRARY - path/name for the XYZ library +# +# Where XYZ can be any of: +# +# DDRAW +# D3D +# D3DX +# D3D8 +# D3DX8 +# D3D9 +# D3DX9 +# D3D10 +# D3D10_1 +# D3DX10 +# D3D11 +# D3D11_1 +# D3D11_2 +# D3DX11 +# D2D1 +# + + +include (CheckIncludeFileCXX) +include (FindPackageMessage) + + +if (WIN32) + + if (CMAKE_SIZEOF_VOID_P EQUAL 8) + set (DirectX_ARCHITECTURE x64) + else () + set (DirectX_ARCHITECTURE x86) + endif () + + # Can't use "$ENV{ProgramFiles(x86)}" to avoid violating CMP0053. See + # http://public.kitware.com/pipermail/cmake-developers/2014-October/023190.html + set (ProgramFiles_x86 "ProgramFiles(x86)") + if ("$ENV{${ProgramFiles_x86}}") + set (ProgramFiles "$ENV{${ProgramFiles_x86}}") + else () + set (ProgramFiles "$ENV{ProgramFiles}") + endif () + + find_path (DirectX_ROOT_DIR + Include/d3d9.h + PATHS + "$ENV{DXSDK_DIR}" + "${ProgramFiles}/Microsoft DirectX SDK (June 2010)" + "${ProgramFiles}/Microsoft DirectX SDK (February 2010)" + "${ProgramFiles}/Microsoft DirectX SDK (March 2009)" + "${ProgramFiles}/Microsoft DirectX SDK (August 2008)" + "${ProgramFiles}/Microsoft DirectX SDK (June 2008)" + "${ProgramFiles}/Microsoft DirectX SDK (March 2008)" + "${ProgramFiles}/Microsoft DirectX SDK (November 2007)" + "${ProgramFiles}/Microsoft DirectX SDK (August 2007)" + "${ProgramFiles}/Microsoft DirectX SDK" + DOC "DirectX SDK root directory" + ) + if (DirectX_ROOT_DIR) + set (DirectX_INC_SEARCH_PATH "${DirectX_ROOT_DIR}/Include") + set (DirectX_LIB_SEARCH_PATH "${DirectX_ROOT_DIR}/Lib/${DirectX_ARCHITECTURE}") + set (DirectX_BIN_SEARCH_PATH "${DirectX_ROOT_DIR}/Utilities/bin/x86") + endif () + + # With VS 2011 and Windows 8 SDK, the DirectX SDK is included as part of + # the Windows SDK. + # + # See also: + # - http://msdn.microsoft.com/en-us/library/windows/desktop/ee663275.aspx + if (DEFINED MSVC_VERSION AND NOT ${MSVC_VERSION} LESS 1700) + set (USE_WINSDK_HEADERS TRUE) + endif () + + # Find a header in the DirectX SDK + macro (find_dxsdk_header var_name header) + set (include_dir_var "DirectX_${var_name}_INCLUDE_DIR") + set (include_found_var "DirectX_${var_name}_INCLUDE_FOUND") + find_path (${include_dir_var} ${header} + HINTS ${DirectX_INC_SEARCH_PATH} + DOC "The directory where ${header} resides" + CMAKE_FIND_ROOT_PATH_BOTH + ) + if (${include_dir_var}) + set (${include_found_var} TRUE) + find_package_message (${var_name}_INC "Found ${header} header: ${${include_dir_var}}/${header}" "[${${include_dir_var}}]") + endif () + mark_as_advanced (${include_found_var}) + endmacro () + + # Find a library in the DirectX SDK + macro (find_dxsdk_library var_name library) + # DirectX SDK + set (library_var "DirectX_${var_name}_LIBRARY") + find_library (${library_var} ${library} + HINTS ${DirectX_LIB_SEARCH_PATH} + DOC "The directory where ${library} resides" + CMAKE_FIND_ROOT_PATH_BOTH + ) + if (${library_var}) + find_package_message (${var_name}_LIB "Found ${library} library: ${${library_var}}" "[${${library_var}}]") + endif () + mark_as_advanced (${library_var}) + endmacro () + + # Find a header in the Windows SDK + macro (find_winsdk_header var_name header) + if (USE_WINSDK_HEADERS) + # Windows SDK + set (include_dir_var "DirectX_${var_name}_INCLUDE_DIR") + set (include_found_var "DirectX_${var_name}_INCLUDE_FOUND") + check_include_file_cxx (${header} ${include_found_var}) + set (${include_dir_var}) + mark_as_advanced (${include_found_var}) + else () + find_dxsdk_header (${var_name} ${header}) + endif () + endmacro () + + # Find a library in the Windows SDK + macro (find_winsdk_library var_name library) + if (USE_WINSDK_HEADERS) + # XXX: We currently just assume the library exists + set (library_var "DirectX_${var_name}_LIBRARY") + set (${library_var} ${library}) + mark_as_advanced (${library_var}) + else () + find_dxsdk_library (${var_name} ${library}) + endif () + endmacro () + + # Combine header and library variables into an API found variable + macro (find_combined var_name inc_var_name lib_var_name) + if (DirectX_${inc_var_name}_INCLUDE_FOUND AND DirectX_${lib_var_name}_LIBRARY) + set (DirectX_${var_name}_FOUND 1) + find_package_message (${var_name} "Found ${var_name} API" "[${DirectX_${lib_var_name}_LIBRARY}][${DirectX_${inc_var_name}_INCLUDE_DIR}]") + endif () + endmacro () + + find_winsdk_header (DDRAW ddraw.h) + find_winsdk_library (DDRAW ddraw) + find_combined (DDRAW DDRAW DDRAW) + + if (CMAKE_GENERATOR_TOOLSET MATCHES "_xp$") + # Windows 7 SDKs, used by XP toolset, do not include d3d.h + find_dxsdk_header (D3D d3d.h) + else () + find_winsdk_header (D3D d3d.h) + endif () + find_combined (D3D D3D DDRAW) + + find_dxsdk_header (D3DX d3dx.h) + find_combined (D3DX D3DX D3DX) + + find_dxsdk_header (D3D8 d3d8.h) + find_dxsdk_library (D3D8 d3d8) + find_combined (D3D8 D3D8 D3D8) + + find_dxsdk_header (D3DX8 d3dx8.h) + find_dxsdk_library (D3DX8 d3dx8) + find_combined (D3DX8 D3DX8 D3DX8) + + find_winsdk_header (D3D9 d3d9.h) + find_winsdk_library (D3D9 d3d9) + find_combined (D3D9 D3D9 D3D9) + + find_dxsdk_header (D3DX9 d3dx9.h) + find_dxsdk_library (D3DX9 d3dx9) + find_combined (D3DX9 D3DX9 D3DX9) + + find_winsdk_header (DXGI dxgi.h) + find_winsdk_header (DXGI1_2 dxgi1_2.h) + find_winsdk_header (DXGI1_3 dxgi1_3.h) + find_winsdk_library (DXGI dxgi) + + find_winsdk_header (D3D10 d3d10.h) + find_winsdk_library (D3D10 d3d10) + find_combined (D3D10 D3D10 D3D10) + + find_winsdk_header (D3D10_1 d3d10_1.h) + find_winsdk_library (D3D10_1 d3d10_1) + find_combined (D3D10_1 D3D10_1 D3D10_1) + + find_dxsdk_header (D3DX10 d3dx10.h) + find_dxsdk_library (D3DX10 d3dx10) + find_combined (D3DX10 D3DX10 D3DX10) + + find_winsdk_header (D3D11 d3d11.h) + find_winsdk_library (D3D11 d3d11) + find_combined (D3D11 D3D11 D3D11) + find_winsdk_header (D3D11_1 d3d11_1.h) + find_combined (D3D11_1 D3D11_1 D3D11) + find_winsdk_header (D3D11_2 d3d11_2.h) + find_combined (D3D11_2 D3D11_2 D3D11) + + find_dxsdk_header (D3DX11 d3dx11.h) + find_dxsdk_library (D3DX11 d3dx11) + find_combined (D3DX11 D3DX11 D3DX11) + + find_winsdk_header (D2D1 d2d1.h) + find_winsdk_library (D2D1 d2d1) + find_combined (D2D1 D2D1 D2D1) + + find_program (DirectX_FXC_EXECUTABLE fxc + HINTS ${DirectX_BIN_SEARCH_PATH} + DOC "Path to fxc.exe executable." + ) + +endif () \ No newline at end of file diff --git a/extensions/common/CMakeLists.txt b/extensions/common/CMakeLists.txt new file mode 100644 index 0000000000..620023ceb1 --- /dev/null +++ b/extensions/common/CMakeLists.txt @@ -0,0 +1,18 @@ +file(GLOB_RECURSE ACE_COMMON_SOURCES *.h *.hpp *.c *.cpp) + + +file(GLOB ACE_BASE_COMMON_SOURCES *.h *.hpp *.c *.cpp) +file(GLOB ACE_P3D_SOURCES p3d/*.h p3d/*.hpp p3d/*.c p3d/*.cpp) +file(GLOB ACE_PBO_SOURCES pbo/*.h pbo/*.hpp pbo/*.c pbo/*.cpp) +file(GLOB ACE_SIMULATION_SOURCES simulation/*.h simulation/*.hpp simulation/*.c simulation/*.cpp) +file(GLOB ACE_DIRECTX_SOURCES directx/*.h directx/*.hpp directx/*.c directx/*.cpp) +file(GLOB ACE_GLM_SOURCES glm/*.h glm/*.hpp glm/*.c glm/*.cpp) + +SOURCE_GROUP("common" FILES ${ACE_BASE_COMMON_SOURCES}) +SOURCE_GROUP("p3d" FILES ${ACE_P3D_SOURCES}) +SOURCE_GROUP("pbo" FILES ${ACE_PBO_SOURCES}) +SOURCE_GROUP("simulation" FILES ${ACE_SIMULATION_SOURCES}) +SOURCE_GROUP("directx" FILES ${ACE_DIRECTX_SOURCES}) +SOURCE_GROUP("glm" FILES ${ACE_GLM_SOURCES}) + +add_library(ace_common STATIC ${ACE_GLM_SOURCES} ${ACE_BASE_COMMON_SOURCES} ${ACE_P3D_SOURCES} ${ACE_PBO_SOURCES} ${ACE_SIMULATION_SOURCES} ${ACE_DIRECTX_SOURCES}) diff --git a/extensions/common/arguments.hpp b/extensions/common/arguments.hpp new file mode 100644 index 0000000000..70e942a241 --- /dev/null +++ b/extensions/common/arguments.hpp @@ -0,0 +1,90 @@ +#pragma once + +#include "shared.hpp" +#include "vector.hpp" + +#include +#include + +namespace ace { + class argument_accessor { + public: + argument_accessor(const uint32_t index, const std::vector & ar) : _index(index), _args(ar) { } + + const std::string & as_string() const { return _args[_index]; } + operator const std::string &() const { return as_string(); } + + float as_float() const { return atof(_args[_index].c_str()); } + operator float() const { return as_float(); } + + int as_int() const { return atoi(_args[_index].c_str()); } + operator int() const { return as_int(); } + + int as_uint32() const { return (uint32_t)atoi(_args[_index].c_str()); } + operator uint32_t() const { return as_uint32(); } + + ace::vector3 as_vector() const { + std::vector t = ace::split(_args[_index], ';'); + return ace::vector3(atof(t[0].c_str()), + atof(t[1].c_str()), + atof(t[2].c_str())); + } + operator ace::vector3() const { return as_vector(); } + + protected: + const uint32_t _index; + const std::vector & _args; + }; + + class arguments { + public: + arguments(const std::string & str) : _original(str) { + _args = ace::split(str, ','); + for (int i = 0; i < _args.size(); i++) { + _args[i] = trim(_args[i]); + } + } + + size_t size() const { return _args.size(); } + + const argument_accessor operator[] (int index) const { return argument_accessor(index, _args); } + + const std::string & as_string(uint32_t _index) const { return _args[_index]; } + float as_float(uint32_t _index) const { return atof(_args[_index].c_str()); } + int as_int(uint32_t _index) const { return atoi(_args[_index].c_str()); } + int as_uint32(uint32_t _index) const { return (uint32_t)atoi(_args[_index].c_str()); } + ace::vector3 as_vector(uint32_t _index) const { + std::vector t = ace::split(_args[_index], ';'); + return ace::vector3(atof(t[0].c_str()), + atof(t[1].c_str()), + atof(t[2].c_str())); + } + + const std::string & get() const { + return _original; + } + + std::string create(const std::string & command) const { + std::stringstream ss; + ss << command << ":"; + + for (auto & v : _args) { + ss << v << ","; + } + + // Remove the trailing , + std::string result = ss.str(); + result.erase(result.length()); + + return result; + } + static std::string create(const std::string & command, const arguments & args) { + return args.create(command); + } + + + protected: + std::vector _args; + const std::string _original; + }; +} \ No newline at end of file diff --git a/extensions/common/directx/d3d_display.cpp b/extensions/common/directx/d3d_display.cpp new file mode 100644 index 0000000000..bfc7a0e013 --- /dev/null +++ b/extensions/common/directx/d3d_display.cpp @@ -0,0 +1,439 @@ +#ifdef USE_DIRECTX + +#include "shared.hpp" +#include "d3d_display.hpp" + +#include + +#include + +using namespace DirectX; + +namespace ace { + namespace debug { + + DWORD GetMainThreadId() { + const std::shared_ptr hThreadSnapshot( + CreateToolhelp32Snapshot(TH32CS_SNAPTHREAD, 0), CloseHandle); + if (hThreadSnapshot.get() == INVALID_HANDLE_VALUE) { + throw std::runtime_error("GetMainThreadId failed"); + } + THREADENTRY32 tEntry; + tEntry.dwSize = sizeof(THREADENTRY32); + DWORD result = 0; + DWORD currentPID = GetCurrentProcessId(); + for (BOOL success = Thread32First(hThreadSnapshot.get(), &tEntry); + !result && success && GetLastError() != ERROR_NO_MORE_FILES; + success = Thread32Next(hThreadSnapshot.get(), &tEntry)) + { + if (tEntry.th32OwnerProcessID == currentPID) { + result = tEntry.th32ThreadID; + } + } + return result; + } + + d3d_display::d3d_display() : _fullscreen(false) {} + d3d_display::~d3d_display() {} + + bool d3d_display::render_thread(uint32_t w, uint32_t h, bool f) { + _render_thread = std::make_unique(this, d3d_display_worker_args(w, h, f) ); + return true; + } + + void d3d_display::render_worker(d3d_display_worker_args args) { + { + create(args.width, args.height, args.fullscreen); + init(); + } + run(); + } + + bool d3d_display::run() { + MSG msg = { 0 }; + + while (WM_QUIT != msg.message) { + if (PeekMessage(&msg, nullptr, 0, 0, PM_REMOVE)) { + TranslateMessage(&msg); + DispatchMessage(&msg); + } else { + render(); + } + } + + return true; + } + + bool d3d_display::init() { + + std::lock_guard _lock(_render_lock); + + HRESULT hr = S_OK; + RECT rc; + + GetClientRect(_hWnd, &rc); + UINT width = rc.right - rc.left; + UINT height = rc.bottom - rc.top; + UINT createDeviceFlags = 0; +#ifdef _DEBUG + createDeviceFlags |= D3D11_CREATE_DEVICE_DEBUG; +#endif + + D3D_DRIVER_TYPE driverTypes[] = + { + D3D_DRIVER_TYPE_HARDWARE, + D3D_DRIVER_TYPE_WARP, + D3D_DRIVER_TYPE_REFERENCE, + }; + UINT numDriverTypes = ARRAYSIZE(driverTypes); + + D3D_FEATURE_LEVEL featureLevels[] = + { + D3D_FEATURE_LEVEL_11_0, + D3D_FEATURE_LEVEL_10_1, + D3D_FEATURE_LEVEL_10_0, + }; + UINT numFeatureLevels = ARRAYSIZE(featureLevels); + + DXGI_SWAP_CHAIN_DESC sd; + ZeroMemory(&sd, sizeof(sd)); + sd.BufferCount = 1; + sd.BufferDesc.Width = width; + sd.BufferDesc.Height = height; + sd.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM; + sd.BufferDesc.RefreshRate.Numerator = 60; + sd.BufferDesc.RefreshRate.Denominator = 1; + sd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; + sd.OutputWindow = _hWnd; + sd.SampleDesc.Count = 1; + sd.SampleDesc.Quality = 0; + sd.Windowed = _fullscreen ? FALSE : TRUE; + + for (UINT driverTypeIndex = 0; driverTypeIndex < numDriverTypes; driverTypeIndex++) + { + _driverType = driverTypes[driverTypeIndex]; + hr = D3D11CreateDeviceAndSwapChain(nullptr, _driverType, nullptr, createDeviceFlags, featureLevels, numFeatureLevels, + D3D11_SDK_VERSION, &sd, &_pSwapChain, &_pd3dDevice, &_featureLevel, &_pImmediateContext); + if (SUCCEEDED(hr)) + break; + } + if (FAILED(hr)) + return false; + + // Create a render target view + ID3D11Texture2D* pBackBuffer = nullptr; + hr = _pSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&pBackBuffer); + if (FAILED(hr)) + return false; + + hr = _pd3dDevice->CreateRenderTargetView(pBackBuffer, nullptr, &_pRenderTargetView); + pBackBuffer->Release(); + if (FAILED(hr)) + return false; + + // Create depth stencil texture + D3D11_TEXTURE2D_DESC descDepth; + ZeroMemory(&descDepth, sizeof(descDepth)); + descDepth.Width = width; + descDepth.Height = height; + descDepth.MipLevels = 1; + descDepth.ArraySize = 1; + descDepth.Format = DXGI_FORMAT_D24_UNORM_S8_UINT; + descDepth.SampleDesc.Count = 1; + descDepth.SampleDesc.Quality = 0; + descDepth.Usage = D3D11_USAGE_DEFAULT; + descDepth.BindFlags = D3D11_BIND_DEPTH_STENCIL; + descDepth.CPUAccessFlags = 0; + descDepth.MiscFlags = 0; + hr = _pd3dDevice->CreateTexture2D(&descDepth, nullptr, &_pDepthStencil); + if (FAILED(hr)) + return false; + + // Create the depth stencil view + D3D11_DEPTH_STENCIL_VIEW_DESC descDSV; + ZeroMemory(&descDSV, sizeof(descDSV)); + descDSV.Format = descDepth.Format; + descDSV.ViewDimension = D3D11_DSV_DIMENSION_TEXTURE2D; + descDSV.Texture2D.MipSlice = 0; + hr = _pd3dDevice->CreateDepthStencilView(_pDepthStencil, &descDSV, &_pDepthStencilView); + if (FAILED(hr)) + return false; + + _pImmediateContext->OMSetRenderTargets(1, &_pRenderTargetView, _pDepthStencilView); + + // Setup the viewport + D3D11_VIEWPORT vp; + vp.Width = (FLOAT)width; + vp.Height = (FLOAT)height; + vp.MinDepth = 0.0f; + vp.MaxDepth = 1.0f; + vp.TopLeftX = 0; + vp.TopLeftY = 0; + _pImmediateContext->RSSetViewports(1, &vp); + + XMStoreFloat4x4(&_World, XMMatrixIdentity()); + XMStoreFloat4x4(&_View, XMMatrixLookAtLH(XMLoadFloat4(&_camera.camPosition), XMLoadFloat4(&_camera.camTarget), XMLoadFloat4(&_camera.camUp))); + XMStoreFloat4x4(&_Projection, XMMatrixPerspectiveFovLH(XM_PIDIV4, width / (FLOAT)height, 0.01f, 100.0f)); + + init_input(); + + return true; + } + + bool d3d_display::init_input() { + RAWINPUTDEVICE Rid[2]; + + Rid[0].usUsagePage = 0x01; // magic numbers + Rid[0].usUsage = 0x02; // magically means mouse + Rid[0].dwFlags = 0; // (use this if you DO NOT WANT to capture mouse) + //Rid[0].dwFlags = RIDEV_CAPTUREMOUSE | RIDEV_NOLEGACY ; // (use this to CAPTURE MOUSE) + Rid[0].hwndTarget = _hWnd; + + Rid[1].usUsagePage = 0x01; // magic numbers + Rid[1].usUsage = 0x06; // magically means keyboard + Rid[1].dwFlags = 0; // use RIDEV_NOHOTKEYS for no winkey + Rid[1].hwndTarget = _hWnd; + + if (!RegisterRawInputDevices(Rid, 2, sizeof(Rid[0]))) { + LOG(ERROR) << "Could not register raw input devices. "; + exit(1); + } + } + + bool d3d_display::create(uint32_t width = 1024, uint32_t height = 768, bool fullscreen = false) { + std::lock_guard _lock(_render_lock); + + _fullscreen = fullscreen; + + WNDCLASSEXW wcex; + wcex.cbSize = sizeof(WNDCLASSEXW); + wcex.style = CS_HREDRAW | CS_VREDRAW; + wcex.lpfnWndProc = (WNDPROC)&ace::debug::d3d_display::wndproc; + wcex.cbClsExtra = 0; + wcex.cbWndExtra = 0; + wcex.hInstance = (HINSTANCE)GetCurrentProcess(); + //wcex.hIcon = LoadIcon(hInstance, (LPCTSTR)IDI_SAMPLE1); + //wcex.hCursor = LoadCursor(nullptr, IDC_ARROW); + wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); + wcex.lpszMenuName = nullptr; + wcex.lpszClassName = L"ACE3BaseDisplayClass"; + //wcex.hIconSm = LoadIcon(wcex.hInstance, (LPCTSTR)IDI_SAMPLE1); + if (!RegisterClassExW(&wcex)) { + return false; + } + + // Create window + _hInst = (HINSTANCE)GetCurrentProcess(); + RECT rc = { 0, 0, width, height }; + AdjustWindowRect(&rc, WS_OVERLAPPEDWINDOW, FALSE); + _hWnd = CreateWindowW(L"ACE3BaseDisplayClass", L"ACE3 D3D Render", WS_OVERLAPPEDWINDOW, + CW_USEDEFAULT, CW_USEDEFAULT, rc.right - rc.left, rc.bottom - rc.top, nullptr, nullptr, _hInst, + nullptr); + + if (!_hWnd) { + return false; + } + + // Attach our input to the master input + //AttachThreadInput(GetCurrentThreadId(), GetMainThraedId()); + + SetWindowLongPtr(_hWnd, GWLP_USERDATA, (LONG)this); + + ShowWindow(_hWnd, 5); + + return true; + } + + bool d3d_display::destroy() { + if (_pImmediateContext) _pImmediateContext->ClearState(); + + if (_pBatchInputLayout) _pBatchInputLayout->Release(); + + if (_pTextureRV1) _pTextureRV1->Release(); + if (_pTextureRV2) _pTextureRV2->Release(); + + if (_pDepthStencilView) _pDepthStencilView->Release(); + if (_pDepthStencil) _pDepthStencil->Release(); + if (_pRenderTargetView) _pRenderTargetView->Release(); + if (_pSwapChain) _pSwapChain->Release(); + if (_pImmediateContext) _pImmediateContext->Release(); + if (_pd3dDevice) _pd3dDevice->Release(); + + return true; + } + + bool d3d_display::render() { + // Update our time + static float t = 0.0f; + static float dt = 0.f; + if (_driverType == D3D_DRIVER_TYPE_REFERENCE) { + t += (float)XM_PI * 0.0125f; + } else { + static uint64_t dwTimeStart = 0; + static uint64_t dwTimeLast = 0; + uint64_t dwTimeCur = GetTickCount64(); + if (dwTimeStart == 0) + dwTimeStart = dwTimeCur; + t = (dwTimeCur - dwTimeStart) / 1000.0f; + dt = (dwTimeCur - dwTimeLast) / 1000.0f; + dwTimeLast = dwTimeCur; + } + + { + std::lock_guard _lock(_render_lock); + + _pImmediateContext->ClearRenderTargetView(_pRenderTargetView, Colors::MidnightBlue); + _pImmediateContext->ClearDepthStencilView(_pDepthStencilView, D3D11_CLEAR_DEPTH, 1.0f, 0); + + update_camera(); + step(); + + _pSwapChain->Present(0, 0); + } + + return true; + } + + bool d3d_display::step() { + return true; + } + + void d3d_display::_move_camera(ace::vector3 direction) { + + } + void d3d_display::_rotate_camera(ace::vector3 direction) { + + } + void d3d_display::update_camera() { + XMVECTOR DefaultForward, DefaultRight, camPosition; + + DefaultForward = XMLoadFloat4(&_camera.DefaultForward); + DefaultRight = XMLoadFloat4(&_camera.DefaultRight); + camPosition = XMLoadFloat4(&_camera.camPosition); + + XMMATRIX camRotationMatrix = XMMatrixRotationRollPitchYaw(_camera.camPitch, _camera.camYaw, 0); + XMVECTOR camTarget = XMVector3TransformCoord(DefaultForward, camRotationMatrix); + camTarget = XMVector3Normalize(camTarget); + + XMVECTOR camRight = XMVector3TransformCoord(DefaultRight, camRotationMatrix); + XMVECTOR camForward = XMVector3TransformCoord(DefaultForward, camRotationMatrix); + XMVECTOR camUp = XMVector3Cross(camForward, camRight); + + camPosition += _camera.moveLeftRight * camRight; + camPosition += _camera.moveBackForward * camForward; + XMStoreFloat4(&_camera.camPosition, camPosition); + + _camera.moveLeftRight = 0.0f; + _camera.moveBackForward = 0.0f; + + camTarget = camPosition + camTarget; + + XMStoreFloat4x4(&_View, XMMatrixLookAtLH(camPosition, camTarget, camUp)); + } + + LRESULT CALLBACK d3d_display::_wndproc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { + PAINTSTRUCT ps; + HDC hdc; + + switch (message) { + case WM_INPUT: { + UINT dwSize; + if (GetActiveWindow() != _hWnd) { + return DefWindowProc(hWnd, message, wParam, lParam); + } + GetRawInputData((HRAWINPUT)lParam, RID_INPUT, NULL, &dwSize, + sizeof(RAWINPUTHEADER)); + LPBYTE lpb = new BYTE[dwSize]; + if (lpb == NULL) { + return 0; + } + + int readSize = GetRawInputData((HRAWINPUT)lParam, RID_INPUT, lpb, &dwSize, sizeof(RAWINPUTHEADER)); + + if (readSize != dwSize) + break; + + RAWINPUT* raw = (RAWINPUT*)lpb; + + float speed = 0.5f; + + if (raw->header.dwType == RIM_TYPEKEYBOARD) { + switch (raw->data.keyboard.VKey) { + case VK_SPACE: { + XMStoreFloat4(&_camera.camPosition, XMVectorSet(0, 0, 0, 0)); + break; + } + // Camera Movement + case 0x57: case VK_NUMPAD8: + case VK_UP: { + _camera.moveBackForward += speed; + break; + } + case 0x53: case VK_NUMPAD2: + case VK_DOWN: { + _camera.moveBackForward -= speed; + break; + } + case 0x41: case VK_NUMPAD4: + case VK_LEFT: { + _camera.moveLeftRight -= speed; + break; + } + case 0x44: case VK_NUMPAD6: + case VK_RIGHT: { + _camera.moveLeftRight += speed; + break; + } + // Numpad Movement + case VK_NUMPAD5: { + XMStoreFloat4(&_camera.camPosition, XMVectorSet(0, 0, 0, 0)); + break; + } + } + } + else if (raw->header.dwType == RIM_TYPEMOUSE) { + RAWMOUSE mouseCurrState = raw->data.mouse; + + if ((mouseCurrState.lLastX != _last_mouse_state.lLastY) || (mouseCurrState.lLastX != _last_mouse_state.lLastY)) + { + _camera.camYaw += mouseCurrState.lLastX * 0.005f; + _camera.camPitch += mouseCurrState.lLastY * 0.005f; + _last_mouse_state = mouseCurrState; + } + + } + + delete[] lpb; + return 0; + } + + case WM_PAINT: + hdc = BeginPaint(hWnd, &ps); + EndPaint(hWnd, &ps); + break; + + case WM_DESTROY: + PostQuitMessage(0); + + break; + default: + return DefWindowProc(hWnd, message, wParam, lParam); + } + + return 0; + } + LRESULT CALLBACK d3d_display::wndproc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { + LONG data; + data = GetWindowLongPtr(hWnd, GWLP_USERDATA); + if (data) { + return ((d3d_display*)data)->_wndproc(hWnd, message, wParam, lParam); + } else { + return DefWindowProc(hWnd, message, wParam, lParam); + } + } + }; + + +}; + +#endif \ No newline at end of file diff --git a/extensions/common/directx/d3d_display.hpp b/extensions/common/directx/d3d_display.hpp new file mode 100644 index 0000000000..b10e8ef070 --- /dev/null +++ b/extensions/common/directx/d3d_display.hpp @@ -0,0 +1,130 @@ +#pragma once + +#ifdef USE_DIRECTX + +#include +#include +#include +#include + +#include +#include +#include + +#include "singleton.hpp" +#include "vector.hpp" + +#define IDI_ACE_DEBUG 666 + +namespace ace { + namespace debug { + + __declspec(align(16)) + struct camera_movement { + camera_movement() { + XMStoreFloat4(&DefaultForward, DirectX::XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f)); + XMStoreFloat4(&DefaultRight, DirectX::XMVectorSet(1.0f, 0.0f, 0.0f, 0.0f)); + XMStoreFloat4(&camForward, DirectX::XMVectorSet(0.0f, 0.0f, 1.0f, 0.0f)); + XMStoreFloat4(&camRight, DirectX::XMVectorSet(1.0f, 0.0f, 0.0f, 0.0f)); + + camYaw = 0.0f; + camPitch = 0.0f; + + moveLeftRight = 0.0f; + moveBackForward = 0.0f; + + XMStoreFloat4(&camPosition, DirectX::XMVectorSet(0.0f, 12.0f, 6.0f, 0.0f)); + XMStoreFloat4(&camTarget, DirectX::XMVectorSet(0.0f, 0.0f, 0.0f, 0.0f)); + XMStoreFloat4(&camUp, DirectX::XMVectorSet(0.0f, 1.0f, 0.0f, 0.0f)); + } + + DirectX::XMFLOAT4 DefaultForward; + DirectX::XMFLOAT4 DefaultRight; + DirectX::XMFLOAT4 camForward; + DirectX::XMFLOAT4 camRight; + + DirectX::XMFLOAT4X4 camRotationMatrix; + DirectX::XMFLOAT4X4 groundWorld; + + float moveLeftRight; + float moveBackForward; + + float camYaw; + float camPitch; + + DirectX::XMFLOAT4 camPosition; + DirectX::XMFLOAT4 camTarget; + DirectX::XMFLOAT4 camUp; + }; + + struct d3d_display_worker; + struct d3d_display_worker_args; + __declspec(align(16)) + class d3d_display { + public: + d3d_display(); + ~d3d_display(); + + virtual bool run(); + virtual bool render(); + virtual bool render_thread(uint32_t, uint32_t, bool); + + virtual void update_camera(); + virtual bool step(); + + virtual bool create(uint32_t, uint32_t, bool); + virtual bool init(); + virtual bool init_input(); + + virtual bool destroy(); + + void render_worker(d3d_display_worker_args); + + static LRESULT CALLBACK wndproc(HWND, UINT, WPARAM, LPARAM); + LRESULT CALLBACK _wndproc(HWND, UINT, WPARAM, LPARAM); + protected: + void _move_camera(ace::vector3); + void _rotate_camera(ace::vector3); + + std::unique_ptr _render_thread; + std::mutex _render_lock; + + bool _fullscreen; + HINSTANCE _hInst = nullptr; + HWND _hWnd = nullptr; + D3D_DRIVER_TYPE _driverType = D3D_DRIVER_TYPE_NULL; + D3D_FEATURE_LEVEL _featureLevel = D3D_FEATURE_LEVEL_11_0; + ID3D11Device* _pd3dDevice = nullptr; + ID3D11DeviceContext* _pImmediateContext = nullptr; + IDXGISwapChain* _pSwapChain = nullptr; + ID3D11RenderTargetView* _pRenderTargetView = nullptr; + ID3D11Texture2D* _pDepthStencil = nullptr; + ID3D11DepthStencilView* _pDepthStencilView = nullptr; + + ID3D11ShaderResourceView* _pTextureRV1 = nullptr; + ID3D11ShaderResourceView* _pTextureRV2 = nullptr; + ID3D11InputLayout* _pBatchInputLayout = nullptr; + + DirectX::XMFLOAT4X4 _World; + DirectX::XMFLOAT4X4 _View; + DirectX::XMFLOAT4X4 _Projection; + + RAWMOUSE _last_mouse_state; + camera_movement _camera; + + }; + struct d3d_display_worker_args { + d3d_display_worker_args(uint32_t w, uint32_t h, bool f) : width(w), height(h), fullscreen(f) {} + uint32_t width; + uint32_t height; + bool fullscreen; + }; + struct d3d_display_worker { + d3d_display_worker(d3d_display * obj, d3d_display_worker_args args) : thread(&ace::debug::d3d_display::render_worker, obj, args) {} + ~d3d_display_worker() { thread.join(); } + std::thread thread; + }; + }; +}; + +#endif \ No newline at end of file diff --git a/extensions/common/dispatch.hpp b/extensions/common/dispatch.hpp new file mode 100644 index 0000000000..0a37824b83 --- /dev/null +++ b/extensions/common/dispatch.hpp @@ -0,0 +1,153 @@ +#pragma once + +#include +#include +#include +#include + +#include "shared.hpp" +#include "arguments.hpp" +#include "singleton.hpp" + +namespace ace { + class dispatcher { + public: + dispatcher() : _ready(true) {} + + virtual bool call(const std::string & name_, const arguments & args_, std::string & result_) { + if (_methods.find(name_) == _methods.end()) { + // @TODO: Exceptions + return false; + } + return _methods[name_](args_, result_); + } + + bool add(const std::string & name_, std::function func_) { + if (_methods.find(name_) != _methods.end()) { + // @TODO: Exceptions + return false; + } + _methods[name_] = func_; + + return true; + } + + bool ready() const { return _ready; } + void ready(bool r) { _ready.exchange(r); } + protected: + std::unordered_map < std::string, std::function > _methods; + std::atomic_bool _ready; + }; + class dispatch : public dispatcher, public singleton { }; + + struct dispatch_message { + dispatch_message(const std::string & command_, const arguments & args_, const uint64_t id_) : command(command_), args(args_), id(id_) {} + std::string command; + arguments args; + uint64_t id; + }; + struct dispatch_result { + dispatch_result() {} + dispatch_result(const std::string &res, const uint64_t id_) : message(res), id(id_) {} + std::string message; + uint64_t id; + }; + + class threaded_dispatcher : public dispatcher { + public: + threaded_dispatcher() : _stop(false), _worker(&ace::threaded_dispatcher::monitor, this) { + + } + ~threaded_dispatcher() {} + + bool call(const std::string & name_, const arguments & args_, std::string & result_, bool threaded) { + if (_methods.find(name_) == _methods.end()) { + // @TODO: Exceptions + return false; + } + if (threaded) { + std::lock_guard lock(_messages_lock); + _messages.push(dispatch_message(name_, args_, _message_id)); + + // @TODO: We should provide an interface for this serialization. + std::stringstream ss; + ss << "[\"result_id\", \"" << _message_id << "\" ]"; + result_ = ss.str(); + + _message_id = _message_id + 1; + } else { +#ifdef _DEBUG + if (name_ != "fetch_result") { + LOG(TRACE) << "dispatch[immediate]:\t[" << name_ << "] { " << args_.get() << " }"; + } +#endif + return dispatcher::call(name_, args_, result_); + } + + return true; + } + bool call(const std::string & name_, const arguments & args_, std::string & result_) override { + return call(name_, args_, result_, false); + } + + void push_result(const dispatch_result & result) { + { + std::lock_guard lock(_results_lock); + _results.push(result); + } + } + void push_result(const std::string & result) { + push_result(dispatch_result(result, -1)); + } + void stop() { + std::lock_guard lock(_messages_lock); + _stop = true; + } + protected: + void monitor() { + _ready = false; + while (!_stop) { + { + std::lock_guard lock(_messages_lock); + while (!_messages.empty()) { + if (_ready) { + dispatch_result result; + dispatch_message _message = std::move(_messages.front()); + _messages.pop(); + + result.id = _message.id; + result.message.resize(4096); +#ifdef _DEBUG + if (_message.command != "fetch_result") { + LOG(TRACE) << "dispatch[threaded]:\t[" << _message.command << "]"; + if (_message.args.size() > 0) { + // LOG(TRACE) << "\t{ " << _messages.front().args.get() << " }"; + } + } +#endif + dispatcher::call(_message.command, _message.args, result.message); + { + std::lock_guard lock(_results_lock); + _results.push(result); + } + + + } + } + } + sleep(5); + } + } + std::atomic_bool _stop; + std::queue _results; + std::mutex _results_lock; + + std::queue _messages; + std::mutex _messages_lock; + + std::thread _worker; + + uint64_t _message_id; + }; + class threaded_dispatch : public threaded_dispatcher, public singleton { }; +}; \ No newline at end of file diff --git a/extensions/common/easyloggingc++.hpp b/extensions/common/easyloggingc++.hpp new file mode 100644 index 0000000000..3a5455c4d0 --- /dev/null +++ b/extensions/common/easyloggingc++.hpp @@ -0,0 +1,6718 @@ +// +// Easylogging++ v9.80 +// Single-header only, cross-platform logging library for C++ applications +// +// Copyright (c) 2015 muflihun.com +// +// This library is released under the MIT Licence. +// http://easylogging.muflihun.com/licence.php +// +// easylogging@muflihun.com +// +// https://github.com/easylogging/easyloggingpp +// http://easylogging.muflihun.com +// http://muflihun.com +// +#ifndef EASYLOGGINGPP_H +#define EASYLOGGINGPP_H +// Compilers and C++0x/C++11 Evaluation +#if defined(__GNUC__) +# define ELPP_COMPILER_GCC 1 +# define ELPP_GCC_VERSION (__GNUC__ * 10000 \ + + __GNUC_MINOR__ * 100 \ + + __GNUC_PATCHLEVEL__) +# if defined(__GXX_EXPERIMENTAL_CXX0X__) +# define ELPP_CXX0X 1 +# elif(ELPP_GCC_VERSION >= 40801) +# define ELPP_CXX11 1 +# endif // defined(__GXX_EXPERIMENTAL_CXX0X__) +#endif // defined(__GNUC__) +// Visual C++ +#if defined(_MSC_VER) +# define ELPP_COMPILER_MSVC 1 +# define ELPP_CRT_DBG_WARNINGS 1 +# if (_MSC_VER == 1600) +# define ELPP_CXX0X 1 +# elif(_MSC_VER >= 1700) +# define ELPP_CXX11 1 +# endif // (_MSC_VER == 1600) +#endif // defined(_MSC_VER) +// Clang++ +#if defined(__clang__) && (__clang__ == 1) +# define ELPP_COMPILER_CLANG 1 +# define ELPP_CLANG_VERSION (__clang_major__ * 10000 \ + + __clang_minor__ * 100 \ + + __clang_patchlevel__) +# if (ELPP_CLANG_VERSION >= 30300) +# define ELPP_CXX11 1 +# endif // (ELPP_CLANG_VERSION >= 30300) +#endif // defined(__clang__) && (__clang__ == 1) +// MinGW +#if defined(__MINGW32__) || defined(__MINGW64__) +# define ELPP_MINGW 1 +#endif // defined(__MINGW32__) || defined(__MINGW64__) +// Cygwin +#if defined(__CYGWIN__) && (__CYGWIN__ == 1) +# define ELPP_CYGWIN 1 +#endif // defined(__CYGWIN__) && (__CYGWIN__ == 1) +// Intel C++ +#if defined(__INTEL_COMPILER) +# define ELPP_COMPILER_INTEL 1 +#endif +// Operating System Evaluation +// Windows +#if defined(_WIN32) || defined(_WIN64) +# define ELPP_OS_WINDOWS 1 +#endif // defined(_WIN32) || defined(_WIN64) +// Linux +#if (defined(__linux) || defined(__linux__)) +# define ELPP_OS_LINUX 1 +#endif // (defined(__linux) || defined(__linux__)) +// Mac +#if defined(__APPLE__) +# define ELPP_OS_MAC 1 +#endif // defined(__APPLE__) +// FreeBSD +#if defined(__FreeBSD__) +# define ELPP_OS_FREEBSD 1 +#endif +// Solaris +#if defined(__sun) +# define ELPP_OS_SOLARIS 1 +#endif +// Unix +#if ((ELPP_OS_LINUX || ELPP_OS_MAC || ELPP_OS_FREEBSD || ELPP_OS_SOLARIS) && (!ELPP_OS_WINDOWS)) +# define ELPP_OS_UNIX 1 +#endif // ((ELPP_OS_LINUX || ELPP_OS_MAC || ELPP_OS_FREEBSD || ELPP_OS_SOLARIS) && (!ELPP_OS_WINDOWS)) +// Android +#if defined(__ANDROID__) +# define ELPP_OS_ANDROID 1 +#endif // defined(__ANDROID__) +// Evaluating Cygwin as *nix OS +#if !ELPP_OS_UNIX && !ELPP_OS_WINDOWS && ELPP_CYGWIN +# undef ELPP_OS_UNIX +# undef ELPP_OS_LINUX +# define ELPP_OS_UNIX 1 +# define ELPP_OS_LINUX 1 +#endif // !ELPP_OS_UNIX && !ELPP_OS_WINDOWS && ELPP_CYGWIN +#if !defined(ELPP_INTERNAL_DEBUGGING_OUT_INFO) +# define ELPP_INTERNAL_DEBUGGING_OUT_INFO std::cout +#endif // !defined(ELPP_INTERNAL_DEBUGGING_OUT) +#if !defined(ELPP_INTERNAL_DEBUGGING_OUT_ERROR) +# define ELPP_INTERNAL_DEBUGGING_OUT_ERROR std::cerr +#endif // !defined(ELPP_INTERNAL_DEBUGGING_OUT) +#if !defined(ELPP_INTERNAL_DEBUGGING_ENDL) +# define ELPP_INTERNAL_DEBUGGING_ENDL std::endl +#endif // !defined(ELPP_INTERNAL_DEBUGGING_OUT) +#if !defined(ELPP_INTERNAL_DEBUGGING_MSG) +# define ELPP_INTERNAL_DEBUGGING_MSG(msg) msg +#endif // !defined(ELPP_INTERNAL_DEBUGGING_OUT) +// Internal Assertions and errors +#if !defined(ELPP_DISABLE_ASSERT) +# if (defined(ELPP_DEBUG_ASSERT_FAILURE)) +# define ELPP_ASSERT(expr, msg) if (!(expr)) { \ + std::stringstream internalInfoStream; internalInfoStream << msg; \ + ELPP_INTERNAL_DEBUGGING_OUT_ERROR \ + << "EASYLOGGING++ ASSERTION FAILED (LINE: " << __LINE__ << ") [" #expr << "] WITH MESSAGE \"" \ + << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStream.str()) << "\"" << ELPP_INTERNAL_DEBUGGING_ENDL; base::utils::abort(1, \ + "ELPP Assertion failure, please define ELPP_DEBUG_ASSERT_FAILURE"); } +# else +# define ELPP_ASSERT(expr, msg) if (!(expr)) { \ + std::stringstream internalInfoStream; internalInfoStream << msg; \ + ELPP_INTERNAL_DEBUGGING_OUT_ERROR\ + << "ASSERTION FAILURE FROM EASYLOGGING++ (LINE: " \ + << __LINE__ << ") [" #expr << "] WITH MESSAGE \"" << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStream.str()) << "\"" \ + << ELPP_INTERNAL_DEBUGGING_ENDL; } +# endif // (defined(ELPP_DEBUG_ASSERT_FAILURE)) +#else +# define ELPP_ASSERT(x, y) +#endif //(!defined(ELPP_DISABLE_ASSERT) +#if ELPP_COMPILER_MSVC +# define ELPP_INTERNAL_DEBUGGING_WRITE_PERROR \ + { char buff[256]; strerror_s(buff, 256, errno); \ + ELPP_INTERNAL_DEBUGGING_OUT_ERROR << ": " << buff << " [" << errno << "]";} (void)0 +#else +# define ELPP_INTERNAL_DEBUGGING_WRITE_PERROR \ + ELPP_INTERNAL_DEBUGGING_OUT_ERROR << ": " << strerror(errno) << " [" << errno << "]"; (void)0 +#endif // ELPP_COMPILER_MSVC +#if defined(ELPP_DEBUG_ERRORS) +# if !defined(ELPP_INTERNAL_ERROR) +# define ELPP_INTERNAL_ERROR(msg, pe) { \ + std::stringstream internalInfoStream; internalInfoStream << " " << msg; \ + ELPP_INTERNAL_DEBUGGING_OUT_ERROR \ + << "ERROR FROM EASYLOGGING++ (LINE: " << __LINE__ << ") " \ + << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStream.str()) << ELPP_INTERNAL_DEBUGGING_ENDL; \ + if (pe) { ELPP_INTERNAL_DEBUGGING_OUT_ERROR << " "; ELPP_INTERNAL_DEBUGGING_WRITE_PERROR; }} (void)0 +# endif +#else +# undef ELPP_INTERNAL_INFO +# define ELPP_INTERNAL_ERROR(msg, pe) +#endif // defined(ELPP_DEBUG_ERRORS) +#if (defined(ELPP_DEBUG_INFO)) +# if !(defined(ELPP_INTERNAL_INFO_LEVEL)) +# define ELPP_INTERNAL_INFO_LEVEL 9 +# endif // !(defined(ELPP_INTERNAL_INFO_LEVEL)) +# if !defined(ELPP_INTERNAL_INFO) +# define ELPP_INTERNAL_INFO(lvl, msg) { if (lvl <= ELPP_INTERNAL_INFO_LEVEL) { \ + std::stringstream internalInfoStream; internalInfoStream << " " << msg; \ + ELPP_INTERNAL_DEBUGGING_OUT_INFO << ELPP_INTERNAL_DEBUGGING_MSG(internalInfoStream.str()) \ + << ELPP_INTERNAL_DEBUGGING_ENDL; }} +# endif +#else +# undef ELPP_INTERNAL_INFO +# define ELPP_INTERNAL_INFO(lvl, msg) +#endif // (defined(ELPP_DEBUG_INFO)) +#if defined(ELPP_STACKTRACE_ON_CRASH) +# if (ELPP_COMPILER_GCC && !ELPP_MINGW) +# define ELPP_STACKTRACE 1 +# else +# if ELPP_COMPILER_MSVC +# pragma message("Stack trace not available for this compiler") +# else +# warning "Stack trace not available for this compiler"; +# endif // ELPP_COMPILER_MSVC +# endif // ELPP_COMPILER_GCC +#endif // (defined(ELPP_STACKTRACE_ON_CRASH)) +// Miscellaneous macros +#define ELPP_UNUSED(x) (void)x +#if ELPP_OS_UNIX +// Log file permissions for unix-based systems +# define ELPP_LOG_PERMS S_IRUSR | S_IWUSR | S_IXUSR | S_IWGRP | S_IRGRP | S_IXGRP | S_IWOTH | S_IXOTH +#endif // ELPP_OS_UNIX +#if defined(ELPP_AS_DLL) && ELPP_COMPILER_MSVC +# if defined(ELPP_EXPORT_SYMBOLS) +# define ELPP_EXPORT __declspec(dllexport) +# else +# define ELPP_EXPORT __declspec(dllimport) +# endif // defined(ELPP_EXPORT_SYMBOLS) +#else +# define ELPP_EXPORT +#endif // defined(ELPP_AS_DLL) && ELPP_COMPILER_MSVC +// Some special functions that are VC++ specific +#undef STRTOK +#undef STRERROR +#undef STRCAT +#undef STRCPY +#if ELPP_CRT_DBG_WARNINGS +# define STRTOK(a, b, c) strtok_s(a, b, c) +# define STRERROR(a, b, c) strerror_s(a, b, c) +# define STRCAT(a, b, len) strcat_s(a, len, b) +# define STRCPY(a, b, len) strcpy_s(a, len, b) +#else +# define STRTOK(a, b, c) strtok(a, b) +# define STRERROR(a, b, c) strerror(c) +# define STRCAT(a, b, len) strcat(a, b) +# define STRCPY(a, b, len) strcpy(a, b) +#endif +// Compiler specific support evaluations +#if (!ELPP_MINGW && !ELPP_COMPILER_CLANG) || defined(ELPP_FORCE_USE_STD_THREAD) +# define ELPP_USE_STD_THREADING 1 +#endif // (!ELPP_MINGW && !ELPP_COMPILER_CLANG) || defined(ELPP_FORCE_USE_STD_THREAD) +#undef ELPP_FINAL +#if ELPP_COMPILER_INTEL || (ELPP_GCC_VERSION < 40702) +# define ELPP_FINAL +#else +# define ELPP_FINAL final +#endif // ELPP_COMPILER_INTEL || (ELPP_GCC_VERSION < 40702) +#if defined(ELPP_EXPERIMENTAL_ASYNC) +# define ELPP_ASYNC_LOGGING 1 +#else +# define ELPP_ASYNC_LOGGING 0 +#endif // defined(ELPP_EXPERIMENTAL_ASYNC) +#if defined(ELPP_THREAD_SAFE) || ELPP_ASYNC_LOGGING +# define ELPP_THREADING_ENABLED 1 +#endif // defined(ELPP_THREAD_SAFE) || ELPP_ASYNC_LOGGING +// Function macro ELPP_FUNC +#undef ELPP_FUNC +#if ELPP_COMPILER_MSVC // Visual C++ +# define ELPP_FUNC __FUNCSIG__ +#elif ELPP_COMPILER_GCC // GCC +# define ELPP_FUNC __PRETTY_FUNCTION__ +#elif ELPP_COMPILER_INTEL // Intel C++ +# define ELPP_FUNC __PRETTY_FUNCTION__ +#elif ELPP_COMPILER_CLANG // Clang++ +# define ELPP_FUNC __PRETTY_FUNCTION__ +#else +# if defined(__func__) +# define ELPP_FUNC __func__ +# else +# define ELPP_FUNC "" +# endif // defined(__func__) +#endif // defined(_MSC_VER) +#undef ELPP_VARIADIC_TEMPLATES_SUPPORTED +// Keep following line commented until features are fixed +#if ELPP_COMPILER_GCC || ELPP_COMPILER_CLANG || ELPP_COMPILER_INTEL || (ELPP_COMPILER_MSVC && _MSC_VER >= 1800) +# define ELPP_VARIADIC_TEMPLATES_SUPPORTED 1 +#endif // ELPP_COMPILER_GCC || ELPP_COMPILER_CLANG || ELPP_COMPILER_INTEL || (ELPP_COMPILER_MSVC && _MSC_VER >= 1800) +// Logging Enable/Disable macros +#if (!defined(ELPP_DISABLE_LOGS)) +# define ELPP_LOGGING_ENABLED 1 +#endif // (!defined(ELPP_DISABLE_LOGS)) +#if (!defined(ELPP_DISABLE_DEBUG_LOGS) && (ELPP_LOGGING_ENABLED) && ((defined(_DEBUG)) || (!defined(NDEBUG)))) +# define ELPP_DEBUG_LOG 1 +#else +# define ELPP_DEBUG_LOG 0 +#endif // (!defined(ELPP_DISABLE_DEBUG_LOGS) && (ELPP_LOGGING_ENABLED) && ((defined(_DEBUG)) || (!defined(NDEBUG)))) +#if (!defined(ELPP_DISABLE_INFO_LOGS) && (ELPP_LOGGING_ENABLED)) +# define ELPP_INFO_LOG 1 +#else +# define ELPP_INFO_LOG 0 +#endif // (!defined(ELPP_DISABLE_INFO_LOGS) && (ELPP_LOGGING_ENABLED)) +#if (!defined(ELPP_DISABLE_WARNING_LOGS) && (ELPP_LOGGING_ENABLED)) +# define ELPP_WARNING_LOG 1 +#else +# define ELPP_WARNING_LOG 0 +#endif // (!defined(ELPP_DISABLE_WARNING_LOGS) && (ELPP_LOGGING_ENABLED)) +#if (!defined(ELPP_DISABLE_ERROR_LOGS) && (ELPP_LOGGING_ENABLED)) +# define ELPP_ERROR_LOG 1 +#else +# define ELPP_ERROR_LOG 0 +#endif // (!defined(ELPP_DISABLE_ERROR_LOGS) && (ELPP_LOGGING_ENABLED)) +#if (!defined(ELPP_DISABLE_FATAL_LOGS) && (ELPP_LOGGING_ENABLED)) +# define ELPP_FATAL_LOG 1 +#else +# define ELPP_FATAL_LOG 0 +#endif // (!defined(ELPP_DISABLE_FATAL_LOGS) && (ELPP_LOGGING_ENABLED)) +#if (!defined(ELPP_DISABLE_TRACE_LOGS) && (ELPP_LOGGING_ENABLED)) +# define ELPP_TRACE_LOG 1 +#else +# define ELPP_TRACE_LOG 0 +#endif // (!defined(ELPP_DISABLE_TRACE_LOGS) && (ELPP_LOGGING_ENABLED)) +#if (!defined(ELPP_DISABLE_VERBOSE_LOGS) && (ELPP_LOGGING_ENABLED)) +# define ELPP_VERBOSE_LOG 1 +#else +# define ELPP_VERBOSE_LOG 0 +#endif // (!defined(ELPP_DISABLE_VERBOSE_LOGS) && (ELPP_LOGGING_ENABLED)) +#if (!(ELPP_CXX0X || ELPP_CXX11)) +# error "Easylogging++ 9.0+ is only compatible with C++0x (or higher) compliant compiler" +#endif // (!(ELPP_CXX0X || ELPP_CXX11)) +// Headers +#if defined(ELPP_SYSLOG) +# include +#endif // defined(ELPP_SYSLOG) +#include +#include +#include +#include +#include +#include +#include +#include +#if defined(ELPP_UNICODE) +# include +# if ELPP_OS_WINDOWS +# include +# endif // ELPP_OS_WINDOWS +#endif // defined(ELPP_UNICODE) +#if ELPP_STACKTRACE +# include +# include +#endif // ELPP_STACKTRACE +#if ELPP_OS_ANDROID +# include +#endif // ELPP_OS_ANDROID +#if ELPP_OS_UNIX +# include +# include +#elif ELPP_OS_WINDOWS +# include +# include +# if defined(WIN32_LEAN_AND_MEAN) +# if defined(ELPP_WINSOCK2) +# include +# else +# include +# endif // defined(ELPP_WINSOCK2) +# endif // defined(WIN32_LEAN_AND_MEAN) +#endif // ELPP_OS_UNIX +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if ELPP_THREADING_ENABLED +# if ELPP_USE_STD_THREADING +# include +# include +# else +# if ELPP_OS_UNIX +# include +# endif // ELPP_OS_UNIX +# endif // ELPP_USE_STD_THREADING +#endif // ELPP_THREADING_ENABLED +#if ELPP_ASYNC_LOGGING +# include +# include +# include +#endif // ELPP_ASYNC_LOGGING +#if defined(ELPP_STL_LOGGING) +// For logging STL based templates +# include +# include +# include +# include +# include +# include +# if defined(ELPP_LOG_STD_ARRAY) +# include +# endif // defined(ELPP_LOG_STD_ARRAY) +# if defined(ELPP_LOG_UNORDERED_MAP) +# include +# endif // defined(ELPP_LOG_UNORDERED_MAP) +# if defined(ELPP_LOG_UNORDERED_SET) +# include +# endif // defined(ELPP_UNORDERED_SET) +#endif // defined(ELPP_STL_LOGGING) +#if defined(ELPP_QT_LOGGING) +// For logging Qt based classes & templates +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +# include +#endif // defined(ELPP_QT_LOGGING) +#if defined(ELPP_BOOST_LOGGING) +// For logging boost based classes & templates +# include +# include +# include +# include +# include +# include +# include +# include +#endif // defined(ELPP_BOOST_LOGGING) +#if defined(ELPP_WXWIDGETS_LOGGING) +// For logging wxWidgets based classes & templates +# include +#endif // defined(ELPP_WXWIDGETS_LOGGING) +// Forward declarations +namespace el { + class Logger; + class LogMessage; + class PerformanceTrackingData; + class Loggers; + class Helpers; + template class Callback; + class LogDispatchCallback; + class PerformanceTrackingCallback; + class LogDispatchData; + namespace base { + class Storage; + class RegisteredLoggers; + class PerformanceTracker; + class MessageBuilder; + class Writer; + class PErrorWriter; + class LogDispatcher; + class DefaultLogBuilder; + class DefaultLogDispatchCallback; +#if ELPP_ASYNC_LOGGING + class AsyncLogDispatchCallback; + class AsyncDispatchWorker; +#endif // ELPP_ASYNC_LOGGING + class DefaultPerformanceTrackingCallback; + } // namespace base +} // namespace el + /// @brief Easylogging++ entry namespace +namespace el { + /// @brief Namespace containing base/internal functionality used by Easylogging++ + namespace base { + /// @brief Data types used by Easylogging++ + namespace type { +#undef ELPP_LITERAL +#undef ELPP_STRLEN +#undef ELPP_COUT +#if defined(ELPP_UNICODE) +# define ELPP_LITERAL(txt) L##txt +# define ELPP_STRLEN wcslen +# if defined ELPP_CUSTOM_COUT +# define ELPP_COUT ELPP_CUSTOM_COUT +# else +# define ELPP_COUT std::wcout +# endif // defined ELPP_CUSTOM_COUT + typedef wchar_t char_t; + typedef std::wstring string_t; + typedef std::wstringstream stringstream_t; + typedef std::wfstream fstream_t; + typedef std::wostream ostream_t; +#else +# define ELPP_LITERAL(txt) txt +# define ELPP_STRLEN strlen +# if defined ELPP_CUSTOM_COUT +# define ELPP_COUT ELPP_CUSTOM_COUT +# else +# define ELPP_COUT std::cout +# endif // defined ELPP_CUSTOM_COUT + typedef char char_t; + typedef std::string string_t; + typedef std::stringstream stringstream_t; + typedef std::fstream fstream_t; + typedef std::ostream ostream_t; +#endif // defined(ELPP_UNICODE) +#if defined(ELPP_CUSTOM_COUT_LINE) +# define ELPP_COUT_LINE(logLine) ELPP_CUSTOM_COUT_LINE(logLine) +#else +# define ELPP_COUT_LINE(logLine) logLine << std::flush +#endif // defined(ELPP_CUSTOM_COUT_LINE) + typedef unsigned short EnumType; + typedef std::shared_ptr StoragePointer; + typedef int VerboseLevel; + typedef std::shared_ptr LogDispatchCallbackPtr; + typedef std::shared_ptr PerformanceTrackingCallbackPtr; + } // namespace type + /// @brief Internal helper class that prevent copy constructor for class + /// + /// @detail When using this class simply inherit it privately + class NoCopy { + protected: + NoCopy(void) {} + private: + NoCopy(const NoCopy&); + NoCopy& operator=(const NoCopy&); + }; + /// @brief Internal helper class that makes all default constructors private. + /// + /// @detail This prevents initializing class making it static unless an explicit constructor is declared. + /// When using this class simply inherit it privately + class StaticClass { + private: + StaticClass(void); + StaticClass(const StaticClass&); + StaticClass& operator=(const StaticClass&); + }; + } // namespace base + /// @brief Represents enumeration for severity level used to determine level of logging + /// + /// @detail With Easylogging++, developers may disable or enable any level regardless of + /// what the severity is. Or they can choose to log using hierarchical logging flag + enum class Level : base::type::EnumType { + /// @brief Generic level that represents all the levels. Useful when setting global configuration for all levels + Global = 1, + /// @brief Information that can be useful to back-trace certain events - mostly useful than debug logs. + Trace = 2, + /// @brief Informational events most useful for developers to debug application + Debug = 4, + /// @brief Severe error information that will presumably abort application + Fatal = 8, + /// @brief Information representing errors in application but application will keep running + Error = 16, + /// @brief Useful when application has potentially harmful situtaions + Warning = 32, + /// @brief Information that can be highly useful and vary with verbose logging level. + Verbose = 64, + /// @brief Mainly useful to represent current progress of application + Info = 128, + /// @brief Represents unknown level + Unknown = 1010 + }; + /// @brief Static class that contains helper functions for el::Level + class LevelHelper : base::StaticClass { + public: + /// @brief Represents minimum valid level. Useful when iterating through enum. + static const base::type::EnumType kMinValid = static_cast(Level::Trace); + /// @brief Represents maximum valid level. This is used internally and you should not need it. + static const base::type::EnumType kMaxValid = static_cast(Level::Info); + /// @brief Casts level to int, useful for iterating through enum. + static base::type::EnumType castToInt(Level level) { + return static_cast(level); + } + /// @brief Casts int(ushort) to level, useful for iterating through enum. + static Level castFromInt(base::type::EnumType l) { + return static_cast(l); + } + /// @brief Converts level to associated const char* + /// @return Upper case string based level. + static const char* convertToString(Level level) { + // Do not use switch over strongly typed enums because Intel C++ compilers dont support them yet. + if (level == Level::Global) return "GLOBAL"; + if (level == Level::Debug) return "DEBUG"; + if (level == Level::Info) return "INFO"; + if (level == Level::Warning) return "WARNING"; + if (level == Level::Error) return "ERROR"; + if (level == Level::Fatal) return "FATAL"; + if (level == Level::Verbose) return "VERBOSE"; + if (level == Level::Trace) return "TRACE"; + return "UNKNOWN"; + } + /// @brief Converts from levelStr to Level + /// @param levelStr Upper case string based level. + /// Lower case is also valid but providing upper case is recommended. + static Level convertFromString(const char* levelStr) { + if ((strcmp(levelStr, "GLOBAL") == 0) || (strcmp(levelStr, "global") == 0)) + return Level::Global; + if ((strcmp(levelStr, "DEBUG") == 0) || (strcmp(levelStr, "debug") == 0)) + return Level::Debug; + if ((strcmp(levelStr, "INFO") == 0) || (strcmp(levelStr, "info") == 0)) + return Level::Info; + if ((strcmp(levelStr, "WARNING") == 0) || (strcmp(levelStr, "warning") == 0)) + return Level::Warning; + if ((strcmp(levelStr, "ERROR") == 0) || (strcmp(levelStr, "error") == 0)) + return Level::Error; + if ((strcmp(levelStr, "FATAL") == 0) || (strcmp(levelStr, "fatal") == 0)) + return Level::Fatal; + if ((strcmp(levelStr, "VERBOSE") == 0) || (strcmp(levelStr, "verbose") == 0)) + return Level::Verbose; + if ((strcmp(levelStr, "TRACE") == 0) || (strcmp(levelStr, "trace") == 0)) + return Level::Trace; + return Level::Unknown; + } + /// @brief Applies specified function to each level starting from startIndex + /// @param startIndex initial value to start the iteration from. This is passed as pointer and + /// is left-shifted so this can be used inside function (fn) to represent current level. + /// @param fn function to apply with each level. This bool represent whether or not to stop iterating through levels. + static inline void forEachLevel(base::type::EnumType* startIndex, const std::function& fn) { + base::type::EnumType lIndexMax = LevelHelper::kMaxValid; + do { + if (fn()) { + break; + } + *startIndex = static_cast(*startIndex << 1); + } while (*startIndex <= lIndexMax); + } + }; + /// @brief Represents enumeration of ConfigurationType used to configure or access certain aspect + /// of logging + enum class ConfigurationType : base::type::EnumType { + /// @brief Determines whether or not corresponding level and logger of logging is enabled + /// You may disable all logs by using el::Level::Global + Enabled = 1, + /// @brief Whether or not to write corresponding log to log file + ToFile = 2, + /// @brief Whether or not to write corresponding level and logger log to standard output. + /// By standard output meaning termnal, command prompt etc + ToStandardOutput = 4, + /// @brief Determines format of logging corresponding level and logger. + Format = 8, + /// @brief Determines log file (full path) to write logs to for correponding level and logger + Filename = 16, + /// @brief Specifies milliseconds width. Width can be within range (1-6) + MillisecondsWidth = 32, + /// @brief Determines whether or not performance tracking is enabled. + /// + /// @detail This does not depend on logger or level. Performance tracking always uses 'performance' logger + PerformanceTracking = 64, + /// @brief Specifies log file max size. + /// + /// @detail If file size of corresponding log file (for corresponding level) is >= specified size, log file will + /// be truncated and re-initiated. + MaxLogFileSize = 128, + /// @brief Specifies number of log entries to hold until we flush pending log data + LogFlushThreshold = 256, + /// @brief Represents unknown configuration + Unknown = 1010 + }; + /// @brief Static class that contains helper functions for el::ConfigurationType + class ConfigurationTypeHelper : base::StaticClass { + public: + /// @brief Represents minimum valid configuration type. Useful when iterating through enum. + static const base::type::EnumType kMinValid = static_cast(ConfigurationType::Enabled); + /// @brief Represents maximum valid configuration type. This is used internally and you should not need it. + static const base::type::EnumType kMaxValid = static_cast(ConfigurationType::MaxLogFileSize); + /// @brief Casts configuration type to int, useful for iterating through enum. + static base::type::EnumType castToInt(ConfigurationType configurationType) { + return static_cast(configurationType); + } + /// @brief Casts int(ushort) to configurationt type, useful for iterating through enum. + static ConfigurationType castFromInt(base::type::EnumType c) { + return static_cast(c); + } + /// @brief Converts configuration type to associated const char* + /// @returns Upper case string based configuration type. + static const char* convertToString(ConfigurationType configurationType) { + // Do not use switch over strongly typed enums because Intel C++ compilers dont support them yet. + if (configurationType == ConfigurationType::Enabled) return "ENABLED"; + if (configurationType == ConfigurationType::Filename) return "FILENAME"; + if (configurationType == ConfigurationType::Format) return "FORMAT"; + if (configurationType == ConfigurationType::ToFile) return "TO_FILE"; + if (configurationType == ConfigurationType::ToStandardOutput) return "TO_STANDARD_OUTPUT"; + if (configurationType == ConfigurationType::MillisecondsWidth) return "MILLISECONDS_WIDTH"; + if (configurationType == ConfigurationType::PerformanceTracking) return "PERFORMANCE_TRACKING"; + if (configurationType == ConfigurationType::MaxLogFileSize) return "MAX_LOG_FILE_SIZE"; + if (configurationType == ConfigurationType::LogFlushThreshold) return "LOG_FLUSH_THRESHOLD"; + return "UNKNOWN"; + } + /// @brief Converts from configStr to ConfigurationType + /// @param configStr Upper case string based configuration type. + /// Lower case is also valid but providing upper case is recommended. + static ConfigurationType convertFromString(const char* configStr) { + if ((strcmp(configStr, "ENABLED") == 0) || (strcmp(configStr, "enabled") == 0)) + return ConfigurationType::Enabled; + if ((strcmp(configStr, "TO_FILE") == 0) || (strcmp(configStr, "to_file") == 0)) + return ConfigurationType::ToFile; + if ((strcmp(configStr, "TO_STANDARD_OUTPUT") == 0) || (strcmp(configStr, "to_standard_output") == 0)) + return ConfigurationType::ToStandardOutput; + if ((strcmp(configStr, "FORMAT") == 0) || (strcmp(configStr, "format") == 0)) + return ConfigurationType::Format; + if ((strcmp(configStr, "FILENAME") == 0) || (strcmp(configStr, "filename") == 0)) + return ConfigurationType::Filename; + if ((strcmp(configStr, "MILLISECONDS_WIDTH") == 0) || (strcmp(configStr, "milliseconds_width") == 0)) + return ConfigurationType::MillisecondsWidth; + if ((strcmp(configStr, "PERFORMANCE_TRACKING") == 0) || (strcmp(configStr, "performance_tracking") == 0)) + return ConfigurationType::PerformanceTracking; + if ((strcmp(configStr, "MAX_LOG_FILE_SIZE") == 0) || (strcmp(configStr, "max_log_file_size") == 0)) + return ConfigurationType::MaxLogFileSize; + if ((strcmp(configStr, "LOG_FLUSH_THRESHOLD") == 0) || (strcmp(configStr, "log_flush_threshold") == 0)) + return ConfigurationType::LogFlushThreshold; + return ConfigurationType::Unknown; + } + /// @brief Applies specified function to each configuration type starting from startIndex + /// @param startIndex initial value to start the iteration from. This is passed by pointer and is left-shifted + /// so this can be used inside function (fn) to represent current configuration type. + /// @param fn function to apply with each configuration type. + /// This bool represent whether or not to stop iterating through configurations. + static inline void forEachConfigType(base::type::EnumType* startIndex, const std::function& fn) { + base::type::EnumType cIndexMax = ConfigurationTypeHelper::kMaxValid; + do { + if (fn()) { + break; + } + *startIndex = static_cast(*startIndex << 1); + } while (*startIndex <= cIndexMax); + } + }; + /// @brief Flags used while writing logs. This flags are set by user + enum class LoggingFlag : base::type::EnumType { + /// @brief Makes sure we have new line for each container log entry + NewLineForContainer = 1, + /// @brief Makes sure if -vmodule is used and does not specifies a module, then verbose + /// logging is allowed via that module. + AllowVerboseIfModuleNotSpecified = 2, + /// @brief When handling crashes by default, detailed crash reason will be logged as well + LogDetailedCrashReason = 4, + /// @brief Allows to disable application abortion when logged using FATAL level + DisableApplicationAbortOnFatalLog = 8, + /// @brief Flushes log with every log-entry (performance sensative) - Disabled by default + ImmediateFlush = 16, + /// @brief Enables strict file rolling + StrictLogFileSizeCheck = 32, + /// @brief Make terminal output colorful for supported terminals + ColoredTerminalOutput = 64, + /// @brief Supports use of multiple logging in same macro, e.g, CLOG(INFO, "default", "network") + MultiLoggerSupport = 128, + /// @brief Disables comparing performance tracker's checkpoints + DisablePerformanceTrackingCheckpointComparison = 256, + /// @brief Disable VModules + DisableVModules = 512, + /// @brief Disable VModules extensions + DisableVModulesExtensions = 1024, + /// @brief Enables hierarchical logging + HierarchicalLogging = 2048, + /// @brief Creates logger automatically when not available + CreateLoggerAutomatically = 4096, + /// @brief Adds spaces b/w logs that separated by left-shift operator + AutoSpacing = 8192, + /// @brief Preserves time format and does not convert it to sec, hour etc (performance tracking only) + FixedTimeFormat = 16384 + }; + namespace base { + /// @brief Namespace containing constants used internally. + namespace consts { + // Level log values - These are values that are replaced in place of %level format specifier + static const base::type::char_t* kInfoLevelLogValue = ELPP_LITERAL("INFO "); + static const base::type::char_t* kDebugLevelLogValue = ELPP_LITERAL("DEBUG"); + static const base::type::char_t* kWarningLevelLogValue = ELPP_LITERAL("WARN "); + static const base::type::char_t* kErrorLevelLogValue = ELPP_LITERAL("ERROR"); + static const base::type::char_t* kFatalLevelLogValue = ELPP_LITERAL("FATAL"); + static const base::type::char_t* kVerboseLevelLogValue = ELPP_LITERAL("VER"); + static const base::type::char_t* kTraceLevelLogValue = ELPP_LITERAL("TRACE"); + static const base::type::char_t* kInfoLevelShortLogValue = ELPP_LITERAL("I"); + static const base::type::char_t* kDebugLevelShortLogValue = ELPP_LITERAL("D"); + static const base::type::char_t* kWarningLevelShortLogValue = ELPP_LITERAL("W"); + static const base::type::char_t* kErrorLevelShortLogValue = ELPP_LITERAL("E"); + static const base::type::char_t* kFatalLevelShortLogValue = ELPP_LITERAL("F"); + static const base::type::char_t* kVerboseLevelShortLogValue = ELPP_LITERAL("V"); + static const base::type::char_t* kTraceLevelShortLogValue = ELPP_LITERAL("T"); + // Format specifiers - These are used to define log format + static const base::type::char_t* kAppNameFormatSpecifier = ELPP_LITERAL("%app"); + static const base::type::char_t* kLoggerIdFormatSpecifier = ELPP_LITERAL("%logger"); + static const base::type::char_t* kThreadIdFormatSpecifier = ELPP_LITERAL("%thread"); + static const base::type::char_t* kSeverityLevelFormatSpecifier = ELPP_LITERAL("%level"); + static const base::type::char_t* kSeverityLevelShortFormatSpecifier = ELPP_LITERAL("%levshort"); + static const base::type::char_t* kDateTimeFormatSpecifier = ELPP_LITERAL("%datetime"); + static const base::type::char_t* kLogFileFormatSpecifier = ELPP_LITERAL("%file"); + static const base::type::char_t* kLogFileBaseFormatSpecifier = ELPP_LITERAL("%fbase"); + static const base::type::char_t* kLogLineFormatSpecifier = ELPP_LITERAL("%line"); + static const base::type::char_t* kLogLocationFormatSpecifier = ELPP_LITERAL("%loc"); + static const base::type::char_t* kLogFunctionFormatSpecifier = ELPP_LITERAL("%func"); + static const base::type::char_t* kCurrentUserFormatSpecifier = ELPP_LITERAL("%user"); + static const base::type::char_t* kCurrentHostFormatSpecifier = ELPP_LITERAL("%host"); + static const base::type::char_t* kMessageFormatSpecifier = ELPP_LITERAL("%msg"); + static const base::type::char_t* kVerboseLevelFormatSpecifier = ELPP_LITERAL("%vlevel"); + static const char* kDateTimeFormatSpecifierForFilename = "%datetime"; + // Date/time + static const char* kDays[7] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; + static const char* kDaysAbbrev[7] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; + static const char* kMonths[12] = { "January", "February", "March", "Apri", "May", "June", "July", "August", + "September", "October", "November", "December" }; + static const char* kMonthsAbbrev[12] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; + static const char* kDefaultDateTimeFormat = "%Y-%M-%d %H:%m:%s,%g"; + static const char* kDefaultDateTimeFormatInFilename = "%Y-%M-%d_%H-%m"; + static const int kYearBase = 1900; + static const char* kAm = "AM"; + static const char* kPm = "PM"; + // Miscellaneous constants + static const char* kDefaultLoggerId = "default"; + static const char* kPerformanceLoggerId = "performance"; + static const char* kSysLogLoggerId = "syslog"; + static const char* kNullPointer = "nullptr"; + static const char kFormatSpecifierChar = '%'; +#if ELPP_VARIADIC_TEMPLATES_SUPPORTED + static const char kFormatSpecifierCharValue = 'v'; +#endif // ELPP_VARIADIC_TEMPLATES_SUPPORTED + static const unsigned int kMaxLogPerContainer = 100; + static const unsigned int kMaxLogPerCounter = 100000; + static const unsigned int kDefaultMillisecondsWidth = 3; + static const base::type::VerboseLevel kMaxVerboseLevel = 9; + static const char* kUnknownUser = "user"; + static const char* kUnknownHost = "unknown-host"; +#if defined(ELPP_DEFAULT_LOG_FILE) + static const char* kDefaultLogFile = ELPP_DEFAULT_LOG_FILE; +#else +# if ELPP_OS_UNIX +# if ELPP_OS_ANDROID + static const char* kDefaultLogFile = "logs/ace.log"; +# else + static const char* kDefaultLogFile = "logs/ace.log"; +# endif // ELPP_OS_ANDROID +# elif ELPP_OS_WINDOWS + static const char* kDefaultLogFile = "logs\\ace.log"; +# endif // ELPP_OS_UNIX +#endif // defined(ELPP_DEFAULT_LOG_FILE) +#if !defined(ELPP_DISABLE_LOG_FILE_FROM_ARG) + static const char* kDefaultLogFileParam = "--default-log-file"; +#endif // !defined(ELPP_DISABLE_LOG_FILE_FROM_ARG) +#if defined(ELPP_LOGGING_FLAGS_FROM_ARG) + static const char* kLoggingFlagsParam = "--logging-flags"; +#endif // defined(ELPP_LOGGING_FLAGS_FROM_ARG) +#if ELPP_OS_WINDOWS + static const char* kFilePathSeperator = "\\"; +#else + static const char* kFilePathSeperator = "/"; +#endif // ELPP_OS_WINDOWS + static const char* kValidLoggerIdSymbols = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._"; + static const char* kConfigurationComment = "##"; + static const char* kConfigurationLevel = "*"; + static const char* kConfigurationLoggerId = "--"; + static const std::size_t kSourceFilenameMaxLength = 100; + static const std::size_t kSourceLineMaxLength = 10; + static const Level kPerformanceTrackerDefaultLevel = Level::Info; + const struct { + double value; + const base::type::char_t* unit; + } kTimeFormats[] = { + { 1000.0f, ELPP_LITERAL("mis") }, + { 1000.0f, ELPP_LITERAL("ms") }, + { 60.0f, ELPP_LITERAL("seconds") }, + { 60.0f, ELPP_LITERAL("minutes") }, + { 24.0f, ELPP_LITERAL("hours") }, + { 7.0f, ELPP_LITERAL("days") } + }; + static const int kTimeFormatsCount = sizeof(kTimeFormats) / sizeof(kTimeFormats[0]); + const struct { + int numb; + const char* name; + const char* brief; + const char* detail; + } kCrashSignals[] = { + // NOTE: Do not re-order, if you do please check CrashHandler(bool) constructor and CrashHandler::setHandler(..) + { SIGABRT, "SIGABRT", "Abnormal termination", + "Program was abnormally terminated." }, + { SIGFPE, "SIGFPE", "Erroneous arithmetic operation", + "Arithemetic operation issue such as division by zero or operation resulting in overflow." }, + { SIGILL, "SIGILL", "Illegal instruction", + "Generally due to a corruption in the code or to an attempt to execute data." }, + { SIGSEGV, "SIGSEGV", "Invalid access to memory", + "Program is trying to read an invalid (unallocated, deleted or corrupted) or inaccessible memory." }, + { SIGINT, "SIGINT", "Interactive attention signal", + "Interruption generated (generally) by user or operating system." }, + }; + static const int kCrashSignalsCount = sizeof(kCrashSignals) / sizeof(kCrashSignals[0]); + } // namespace consts + } // namespace base + typedef std::function PreRollOutCallback; + namespace base { + static inline void defaultPreRollOutCallback(const char*, std::size_t) {} + /// @brief Enum to represent timestamp unit + enum class TimestampUnit : base::type::EnumType { + Microsecond = 0, Millisecond = 1, Second = 2, Minute = 3, Hour = 4, Day = 5 + }; + /// @brief Format flags used to determine specifiers that are active for performance improvements. + enum class FormatFlags : base::type::EnumType { + DateTime = 1 << 1, LoggerId = 1 << 2, File = 1 << 3, Line = 1 << 4, Location = 1 << 5, Function = 1 << 6, + User = 1 << 7, Host = 1 << 8, LogMessage = 1 << 9, VerboseLevel = 1 << 10, AppName = 1 << 11, ThreadId = 1 << 12, + Level = 1 << 13, FileBase = 1 << 14, LevelShort = 1 << 15 + }; + /// @brief A milliseconds width class containing actual width and offset for date/time + class MillisecondsWidth { + public: + MillisecondsWidth(void) { init(base::consts::kDefaultMillisecondsWidth); } + explicit MillisecondsWidth(int width) { init(width); } + bool operator==(const MillisecondsWidth& msWidth) { return m_width == msWidth.m_width && m_offset == msWidth.m_offset; } + int m_width; unsigned int m_offset; + private: + void init(int width) { + if (width < 1 || width > 6) { + width = base::consts::kDefaultMillisecondsWidth; + } + m_width = width; + switch (m_width) { + case 3: m_offset = 1000; break; + case 4: m_offset = 100; break; + case 5: m_offset = 10; break; + case 6: m_offset = 1; break; + default: m_offset = 1000; break; + } + } + }; + /// @brief Namespace containing utility functions/static classes used internally + namespace utils { + /// @brief Deletes memory safely and points to null + template + static inline + typename std::enable_if::value, void>::type + safeDelete(T*& pointer) { + if (pointer == nullptr) + return; + delete pointer; + pointer = nullptr; + } + /// @brief Gets value of const char* but if it is nullptr, a string nullptr is returned + static inline const char* charPtrVal(const char* pointer) { + return pointer == nullptr ? base::consts::kNullPointer : pointer; + } + /// @brief Aborts application due with user-defined status + static inline void abort(int status, const std::string& reason = std::string()) { + // Both status and reason params are there for debugging with tools like gdb etc + ELPP_UNUSED(status); + ELPP_UNUSED(reason); +#if defined(ELPP_COMPILER_MSVC) && defined(_M_IX86) && defined(_DEBUG) + // Ignore msvc critical error dialog - break instead (on debug mode) + _asm int 3 +#else + ::abort(); +#endif // defined(ELPP_COMPILER_MSVC) && defined(_M_IX86) && defined(_DEBUG) + } + /// @brief Bitwise operations for C++11 strong enum class. This casts e into Flag_T and returns value after bitwise operation + /// Use these function as
flag = bitwise::Or(MyEnum::val1, flag);
+ namespace bitwise { + template + static inline base::type::EnumType And(Enum e, base::type::EnumType flag) { + return static_cast(flag) & static_cast(e); + } + template + static inline base::type::EnumType Not(Enum e, base::type::EnumType flag) { + return static_cast(flag) & ~(static_cast(e)); + } + template + static inline base::type::EnumType Or(Enum e, base::type::EnumType flag) { + return static_cast(flag) | static_cast(e); + } + } // namespace bitwise + template + static inline void addFlag(Enum e, base::type::EnumType* flag) { + *flag = base::utils::bitwise::Or(e, *flag); + } + template + static inline void removeFlag(Enum e, base::type::EnumType* flag) { + *flag = base::utils::bitwise::Not(e, *flag); + } + template + static inline bool hasFlag(Enum e, base::type::EnumType flag) { + return base::utils::bitwise::And(e, flag) > 0x0; + } + } // namespace utils + namespace threading { +#if ELPP_THREADING_ENABLED +# if !ELPP_USE_STD_THREADING + namespace internal { + /// @brief A mutex wrapper for compiler that dont yet support std::mutex + class Mutex : base::NoCopy { + public: + Mutex(void) { +# if ELPP_OS_UNIX + pthread_mutex_init(&m_underlyingMutex, nullptr); +# elif ELPP_OS_WINDOWS + InitializeCriticalSection(&m_underlyingMutex); +# endif // ELPP_OS_UNIX + } + + virtual ~Mutex(void) { +# if ELPP_OS_UNIX + pthread_mutex_destroy(&m_underlyingMutex); +# elif ELPP_OS_WINDOWS + DeleteCriticalSection(&m_underlyingMutex); +# endif // ELPP_OS_UNIX + } + + inline void lock(void) { +# if ELPP_OS_UNIX + pthread_mutex_lock(&m_underlyingMutex); +# elif ELPP_OS_WINDOWS + EnterCriticalSection(&m_underlyingMutex); +# endif // ELPP_OS_UNIX + } + + inline bool try_lock(void) { +# if ELPP_OS_UNIX + return (pthread_mutex_trylock(&m_underlyingMutex) == 0); +# elif ELPP_OS_WINDOWS + return TryEnterCriticalSection(&m_underlyingMutex); +# endif // ELPP_OS_UNIX + } + + inline void unlock(void) { +# if ELPP_OS_UNIX + pthread_mutex_unlock(&m_underlyingMutex); +# elif ELPP_OS_WINDOWS + LeaveCriticalSection(&m_underlyingMutex); +# endif // ELPP_OS_UNIX + } + + private: +# if ELPP_OS_UNIX + pthread_mutex_t m_underlyingMutex; +# elif ELPP_OS_WINDOWS + CRITICAL_SECTION m_underlyingMutex; +# endif // ELPP_OS_UNIX + }; + /// @brief Scoped lock for compiler that dont yet support std::lock_guard + template + class ScopedLock : base::NoCopy { + public: + explicit ScopedLock(M& mutex) { + m_mutex = &mutex; + m_mutex->lock(); + } + + virtual ~ScopedLock(void) { + m_mutex->unlock(); + } + private: + M* m_mutex; + ScopedLock(void); + }; + } // namespace internal + /// @brief Gets ID of currently running threading in windows systems. On unix, nothing is returned. + static inline std::string getCurrentThreadId(void) { + std::stringstream ss; +# if (ELPP_OS_WINDOWS) + ss << GetCurrentThreadId(); +# endif // (ELPP_OS_WINDOWS) + return ss.str(); + } + static inline void msleep(int) { + // No implementation for non std::thread version + } + typedef base::threading::internal::Mutex Mutex; + typedef base::threading::internal::ScopedLock ScopedLock; +# else + /// @brief Gets ID of currently running threading using std::this_thread::get_id() + static inline std::string getCurrentThreadId(void) { + std::stringstream ss; + ss << std::this_thread::get_id(); + return ss.str(); + } + static inline void msleep(int ms) { + // Only when async logging enabled - this is because async is strict on compiler +#if ELPP_ASYNC_LOGGING + std::this_thread::sleep_for(std::chrono::milliseconds(ms)); +#endif // ELPP_ASYNC_LOGGING + } + typedef std::mutex Mutex; + typedef std::lock_guard ScopedLock; +# endif // !ELPP_USE_STD_THREADING +#else + namespace internal { + /// @brief Mutex wrapper used when multi-threading is disabled. + class NoMutex : base::NoCopy { + public: + NoMutex(void) {} + inline void lock(void) {} + inline bool try_lock(void) { return true; } + inline void unlock(void) {} + }; + /// @brief Lock guard wrapper used when multi-threading is disabled. + template + class NoScopedLock : base::NoCopy { + public: + explicit NoScopedLock(Mutex&) { + } + virtual ~NoScopedLock(void) { + } + private: + NoScopedLock(void); + }; + } // namespace internal + static inline std::string getCurrentThreadId(void) { + return std::string(); + } + static inline void msleep(int) { + // No custom implementation + } + typedef base::threading::internal::NoMutex Mutex; + typedef base::threading::internal::NoScopedLock ScopedLock; +#endif // ELPP_THREADING_ENABLED + /// @brief Base of thread safe class, this class is inheritable-only + class ThreadSafe { + public: + virtual inline void acquireLock(void) ELPP_FINAL { m_mutex.lock(); } + virtual inline void releaseLock(void) ELPP_FINAL { m_mutex.unlock(); } + virtual inline base::threading::Mutex& lock(void) ELPP_FINAL { return m_mutex; } + protected: + ThreadSafe(void) {} + virtual ~ThreadSafe(void) {} + private: + base::threading::Mutex m_mutex; + }; + } // namespace threading + namespace utils { + class File : base::StaticClass { + public: + /// @brief Creates new out file stream for specified filename. + /// @return Pointer to newly created fstream or nullptr + static base::type::fstream_t* newFileStream(const std::string& filename) { + base::type::fstream_t *fs = new base::type::fstream_t(filename.c_str(), + base::type::fstream_t::out | base::type::fstream_t::app); +#if defined(ELPP_UNICODE) + std::locale elppUnicodeLocale(""); +#if ELPP_OS_WINDOWS + std::locale elppUnicodeLocaleWindows(elppUnicodeLocale, new std::codecvt_utf8_utf16); + elppUnicodeLocale = elppUnicodeLocaleWindows; +#endif + fs->imbue(elppUnicodeLocale); +#endif // defined(ELPP_UNICODE) + if (fs->is_open()) { + fs->flush(); + } + else { + base::utils::safeDelete(fs); + ELPP_INTERNAL_ERROR("Bad file [" << filename << "]", true); + } + return fs; + } + + /// @brief Gets size of file provided in stream + static std::size_t getSizeOfFile(base::type::fstream_t* fs) { + if (fs == nullptr) { + return 0; + } + std::streampos currPos = fs->tellg(); + fs->seekg(0, fs->end); + std::size_t size = static_cast(fs->tellg()); + fs->seekg(currPos); + return size; + } + + /// @brief Determines whether or not provided path exist in current file system + static inline bool pathExists(const char* path, bool considerFile = false) { + if (path == nullptr) { + return false; + } +#if ELPP_OS_UNIX + ELPP_UNUSED(considerFile); + struct stat st; + return (stat(path, &st) == 0); +#elif ELPP_OS_WINDOWS + DWORD fileType = GetFileAttributesA(path); + if (fileType == INVALID_FILE_ATTRIBUTES) { + return false; + } + return considerFile ? true : ((fileType & FILE_ATTRIBUTE_DIRECTORY) == 0 ? false : true); +#endif // ELPP_OS_UNIX + } + + /// @brief Creates specified path on file system + /// @param path Path to create. + static bool createPath(const std::string& path) { + if (path.empty()) { + return false; + } + if (base::utils::File::pathExists(path.c_str())) { + return true; + } + int status = -1; + + char* currPath = const_cast(path.c_str()); + std::string builtPath = std::string(); +#if ELPP_OS_UNIX + if (path[0] == '/') { + builtPath = "/"; + } + currPath = STRTOK(currPath, base::consts::kFilePathSeperator, 0); +#elif ELPP_OS_WINDOWS + // Use secure functions API + char* nextTok_ = nullptr; + currPath = STRTOK(currPath, base::consts::kFilePathSeperator, &nextTok_); + ELPP_UNUSED(nextTok_); +#endif // ELPP_OS_UNIX + while (currPath != nullptr) { + builtPath.append(currPath); + builtPath.append(base::consts::kFilePathSeperator); +#if ELPP_OS_UNIX + status = mkdir(builtPath.c_str(), ELPP_LOG_PERMS); + currPath = STRTOK(nullptr, base::consts::kFilePathSeperator, 0); +#elif ELPP_OS_WINDOWS + status = _mkdir(builtPath.c_str()); + currPath = STRTOK(nullptr, base::consts::kFilePathSeperator, &nextTok_); +#endif // ELPP_OS_UNIX + } + if (status == -1) { + ELPP_INTERNAL_ERROR("Error while creating path [" << path << "]", true); + return false; + } + return true; + } + /// @brief Extracts path of filename with leading slash + static std::string extractPathFromFilename(const std::string& fullPath, + const char* seperator = base::consts::kFilePathSeperator) { + if ((fullPath == "") || (fullPath.find(seperator) == std::string::npos)) { + return fullPath; + } + std::size_t lastSlashAt = fullPath.find_last_of(seperator); + if (lastSlashAt == 0) { + return std::string(seperator); + } + return fullPath.substr(0, lastSlashAt + 1); + } + /// @brief builds stripped filename and puts it in buff + static void buildStrippedFilename(const char* filename, char buff[], + std::size_t limit = base::consts::kSourceFilenameMaxLength) { + std::size_t sizeOfFilename = strlen(filename); + if (sizeOfFilename >= limit) { + filename += (sizeOfFilename - limit); + if (filename[0] != '.' && filename[1] != '.') { // prepend if not already + filename += 3; // 3 = '..' + STRCAT(buff, "..", limit); + } + } + STRCAT(buff, filename, limit); + } + /// @brief builds base filename and puts it in buff + static void buildBaseFilename(const std::string& fullPath, char buff[], + std::size_t limit = base::consts::kSourceFilenameMaxLength, + const char* seperator = base::consts::kFilePathSeperator) { + const char *filename = fullPath.c_str(); + std::size_t lastSlashAt = fullPath.find_last_of(seperator); + filename += lastSlashAt ? lastSlashAt + 1 : 0; + std::size_t sizeOfFilename = strlen(filename); + if (sizeOfFilename >= limit) { + filename += (sizeOfFilename - limit); + if (filename[0] != '.' && filename[1] != '.') { // prepend if not already + filename += 3; // 3 = '..' + STRCAT(buff, "..", limit); + } + } + STRCAT(buff, filename, limit); + } + }; + /// @brief String utilities helper class used internally. You should not use it. + class Str : base::StaticClass { + public: + /// @brief Checks if character is digit. Dont use libc implementation of it to prevent locale issues. + static inline bool isDigit(char c) { + return c >= '0' && c <= '9'; + } + + /// @brief Matches wildcards, '*' and '?' only supported. + static bool wildCardMatch(const char* str, const char* pattern) { + while (*pattern) { + switch (*pattern) { + case '?': + if (!*str) + return false; + ++str; + ++pattern; + break; + case '*': + if (wildCardMatch(str, pattern + 1)) + return true; + if (*str && wildCardMatch(str + 1, pattern)) + return true; + return false; + break; + default: + if (*str++ != *pattern++) + return false; + break; + } + } + return !*str && !*pattern; + } + + /// @brief Trims string from start + /// @param [in,out] str String to trim + static inline std::string& ltrim(std::string& str) { + str.erase(str.begin(), std::find_if(str.begin(), str.end(), std::not1(std::ptr_fun(&std::isspace)))); + return str; + } + + /// @brief Trim string from end + /// @param [in,out] str String to trim + static inline std::string& rtrim(std::string& str) { + str.erase(std::find_if(str.rbegin(), str.rend(), std::not1(std::ptr_fun(&std::isspace))).base(), str.end()); + return str; + } + + /// @brief Trims string from left and right + /// @param [in,out] str String to trim + static inline std::string& trim(std::string& str) { + return ltrim(rtrim(str)); + } + + /// @brief Determines whether or not str starts with specified string + /// @param str String to check + /// @param start String to check against + /// @return Returns true if starts with specified string, false otherwise + static inline bool startsWith(const std::string& str, const std::string& start) { + return (str.length() >= start.length()) && (str.compare(0, start.length(), start) == 0); + } + + /// @brief Determines whether or not str ends with specified string + /// @param str String to check + /// @param end String to check against + /// @return Returns true if ends with specified string, false otherwise + static inline bool endsWith(const std::string& str, const std::string& end) { + return (str.length() >= end.length()) && (str.compare(str.length() - end.length(), end.length(), end) == 0); + } + + /// @brief Replaces all instances of replaceWhat with 'replaceWith'. Original variable is changed for performance. + /// @param [in,out] str String to replace from + /// @param replaceWhat Character to replace + /// @param replaceWith Character to replace with + /// @return Modified version of str + static inline std::string& replaceAll(std::string& str, char replaceWhat, char replaceWith) { + std::replace(str.begin(), str.end(), replaceWhat, replaceWith); + return str; + } + + /// @brief Replaces all instances of 'replaceWhat' with 'replaceWith'. (String version) Replaces in place + /// @param str String to replace from + /// @param replaceWhat Character to replace + /// @param replaceWith Character to replace with + /// @return Modified (original) str + static inline std::string& replaceAll(std::string& str, const std::string& replaceWhat, // NOLINT + const std::string& replaceWith) { + if (replaceWhat == replaceWith) + return str; + std::size_t foundAt = std::string::npos; + while ((foundAt = str.find(replaceWhat, foundAt + 1)) != std::string::npos) { + str.replace(foundAt, replaceWhat.length(), replaceWith); + } + return str; + } + + static void replaceFirstWithEscape(base::type::string_t& str, const base::type::string_t& replaceWhat, // NOLINT + const base::type::string_t& replaceWith) { + std::size_t foundAt = base::type::string_t::npos; + while ((foundAt = str.find(replaceWhat, foundAt + 1)) != base::type::string_t::npos) { + if (foundAt > 0 && str[foundAt - 1] == base::consts::kFormatSpecifierChar) { + str.erase(foundAt > 0 ? foundAt - 1 : 0, 1); + ++foundAt; + } + else { + str.replace(foundAt, replaceWhat.length(), replaceWith); + return; + } + } + } +#if defined(ELPP_UNICODE) + static void replaceFirstWithEscape(base::type::string_t& str, const base::type::string_t& replaceWhat, // NOLINT + const std::string& replaceWith) { + replaceFirstWithEscape(str, replaceWhat, base::type::string_t(replaceWith.begin(), replaceWith.end())); + } +#endif // defined(ELPP_UNICODE) + /// @brief Converts string to uppercase + /// @param str String to convert + /// @return Uppercase string + static inline std::string& toUpper(std::string& str) { + std::transform(str.begin(), str.end(), str.begin(), ::toupper); + return str; + } + + /// @brief Compares cstring equality - uses strcmp + static inline bool cStringEq(const char* s1, const char* s2) { + if (s1 == nullptr && s2 == nullptr) return true; + if (s1 == nullptr || s2 == nullptr) return false; + return strcmp(s1, s2) == 0; + } + + /// @brief Compares cstring equality (case-insensitive) - uses toupper(char) + /// Dont use strcasecmp because of CRT (VC++) + static bool cStringCaseEq(const char* s1, const char* s2) { + if (s1 == nullptr && s2 == nullptr) return true; + if (s1 == nullptr || s2 == nullptr) return false; + if (strlen(s1) != strlen(s2)) return false; + while (*s1 != '\0' && *s2 != '\0') { + if (::toupper(*s1) != ::toupper(*s2)) return false; + ++s1; + ++s2; + } + return true; + } + + /// @brief Returns true if c exist in str + static inline bool contains(const char* str, char c) { + for (; *str; ++str) { + if (*str == c) + return true; + } + return false; + } + + static inline char* convertAndAddToBuff(std::size_t n, int len, char* buf, const char* bufLim, bool zeroPadded = true) { + char localBuff[10] = ""; + char* p = localBuff + sizeof(localBuff) - 2; + if (n > 0) { + for (; n > 0 && p > localBuff && len > 0; n /= 10, --len) + *--p = static_cast(n % 10 + '0'); + } + else { + *--p = '0'; + --len; + } + if (zeroPadded) + while (p > localBuff && len-- > 0) *--p = static_cast('0'); + return addToBuff(p, buf, bufLim); + } + + static inline char* addToBuff(const char* str, char* buf, const char* bufLim) { + while ((buf < bufLim) && ((*buf = *str++) != '\0')) + ++buf; + return buf; + } + + static inline char* clearBuff(char buff[], std::size_t lim) { + STRCPY(buff, "", lim); + ELPP_UNUSED(lim); // For *nix we dont have anything using lim in above STRCPY macro + return buff; + } + + /// @brief Converst wchar* to char* + /// NOTE: Need to free return value after use! + static char* wcharPtrToCharPtr(const wchar_t* line) { + std::size_t len_ = wcslen(line) + 1; + char* buff_ = static_cast(malloc(len_ + 1)); +# if ELPP_OS_UNIX || (ELPP_OS_WINDOWS && !ELPP_CRT_DBG_WARNINGS) + std::wcstombs(buff_, line, len_); +# elif ELPP_OS_WINDOWS + std::size_t convCount_ = 0; + mbstate_t mbState_; + ::memset(static_cast(&mbState_), 0, sizeof(mbState_)); + wcsrtombs_s(&convCount_, buff_, len_, &line, len_, &mbState_); +# endif // ELPP_OS_UNIX || (ELPP_OS_WINDOWS && !ELPP_CRT_DBG_WARNINGS) + return buff_; + } + }; + /// @brief Operating System helper static class used internally. You should not use it. + class OS : base::StaticClass { + public: +#if ELPP_OS_WINDOWS + /// @brief Gets environment variables for Windows based OS. + /// We are not using getenv(const char*) because of CRT deprecation + /// @param varname Variable name to get environment variable value for + /// @return If variable exist the value of it otherwise nullptr + static const char* getWindowsEnvironmentVariable(const char* varname) { + const DWORD bufferLen = 50; + static char buffer[bufferLen]; + if (GetEnvironmentVariableA(varname, buffer, bufferLen)) { + return buffer; + } + return nullptr; + } +#endif // ELPP_OS_WINDOWS +#if ELPP_OS_ANDROID + /// @brief Reads android property value + static inline std::string getProperty(const char* prop) { + char propVal[PROP_VALUE_MAX + 1]; + int ret = __system_property_get(prop, propVal); + return ret == 0 ? std::string() : std::string(propVal); + } + + /// @brief Reads android device name + static std::string getDeviceName(void) { + std::stringstream ss; + std::string manufacturer = getProperty("ro.product.manufacturer"); + std::string model = getProperty("ro.product.model"); + if (manufacturer.empty() || model.empty()) { + return std::string(); + } + ss << manufacturer << "-" << model; + return ss.str(); + } +#endif // ELPP_OS_ANDROID + + /// @brief Runs command on terminal and returns the output. + /// + /// @detail This is applicable only on unix based systems, for all other OS, an empty string is returned. + /// @param command Bash command + /// @return Result of bash output or empty string if no result found. + static const std::string getBashOutput(const char* command) { +#if (ELPP_OS_UNIX && !ELPP_OS_ANDROID && !ELPP_CYGWIN) + if (command == nullptr) { + return std::string(); + } + FILE* proc = nullptr; + if ((proc = popen(command, "r")) == nullptr) { + ELPP_INTERNAL_ERROR("\nUnable to run command [" << command << "]", true); + return std::string(); + } + char hBuff[4096]; + if (fgets(hBuff, sizeof(hBuff), proc) != nullptr) { + pclose(proc); + if (hBuff[strlen(hBuff) - 1] == '\n') { + hBuff[strlen(hBuff) - 1] = '\0'; + } + return std::string(hBuff); + } + return std::string(); +#else + ELPP_UNUSED(command); + return std::string(); +#endif // (ELPP_OS_UNIX && !ELPP_OS_ANDROID && !ELPP_CYGWIN) + } + + /// @brief Gets environment variable. This is cross-platform and CRT safe (for VC++) + /// @param variableName Environment variable name + /// @param defaultVal If no environment variable or value found the value to return by default + /// @param alternativeBashCommand If environment variable not found what would be alternative bash command + /// in order to look for value user is looking for. E.g, for 'user' alternative command will 'whoami' + static std::string getEnvironmentVariable(const char* variableName, const char* defaultVal, const char* alternativeBashCommand = nullptr) { +#if ELPP_OS_UNIX + const char* val = getenv(variableName); +#elif ELPP_OS_WINDOWS + const char* val = getWindowsEnvironmentVariable(variableName); +#endif // ELPP_OS_UNIX + if ((val == nullptr) || ((strcmp(val, "") == 0))) { +#if ELPP_OS_UNIX && defined(ELPP_FORCE_ENV_VAR_FROM_BASH) + // Try harder on unix-based systems + std::string valBash = base::utils::OS::getBashOutput(alternativeBashCommand); + if (valBash.empty()) { + return std::string(defaultVal); + } + else { + return valBash; + } +#elif ELPP_OS_WINDOWS || ELPP_OS_UNIX + ELPP_UNUSED(alternativeBashCommand); + return std::string(defaultVal); +#endif // ELPP_OS_UNIX && defined(ELPP_FORCE_ENV_VAR_FROM_BASH) + } + return std::string(val); + } + /// @brief Gets current username. + static inline std::string currentUser(void) { +#if ELPP_OS_UNIX && !ELPP_OS_ANDROID + return getEnvironmentVariable("USER", base::consts::kUnknownUser, "whoami"); +#elif ELPP_OS_WINDOWS + return getEnvironmentVariable("USERNAME", base::consts::kUnknownUser); +#elif ELPP_OS_ANDROID + ELPP_UNUSED(base::consts::kUnknownUser); + return std::string("android"); +#else + return std::string(); +#endif // ELPP_OS_UNIX && !ELPP_OS_ANDROID + } + + /// @brief Gets current host name or computer name. + /// + /// @detail For android systems this is device name with its manufacturer and model seperated by hyphen + static inline std::string currentHost(void) { +#if ELPP_OS_UNIX && !ELPP_OS_ANDROID + return getEnvironmentVariable("HOSTNAME", base::consts::kUnknownHost, "hostname"); +#elif ELPP_OS_WINDOWS + return getEnvironmentVariable("COMPUTERNAME", base::consts::kUnknownHost); +#elif ELPP_OS_ANDROID + ELPP_UNUSED(base::consts::kUnknownHost); + return getDeviceName(); +#else + return std::string(); +#endif // ELPP_OS_UNIX && !ELPP_OS_ANDROID + } + /// @brief Whether or not terminal supports colors + static inline bool termSupportsColor(void) { + std::string term = getEnvironmentVariable("TERM", ""); + return term == "xterm" || term == "xterm-color" || term == "xterm-256color" || + term == "screen" || term == "linux" || term == "cygwin"; + } + }; + extern std::string s_currentUser; + extern std::string s_currentHost; + extern bool s_termSupportsColor; +#define ELPP_INITI_BASIC_DECLR \ + namespace el {\ + namespace base {\ + namespace utils {\ + std::string s_currentUser = el::base::utils::OS::currentUser(); \ + std::string s_currentHost = el::base::utils::OS::currentHost(); \ + bool s_termSupportsColor = el::base::utils::OS::termSupportsColor(); \ + }\ + }\ + } + /// @brief Contains utilities for cross-platform date/time. This class make use of el::base::utils::Str + class DateTime : base::StaticClass { + public: + /// @brief Cross platform gettimeofday for Windows and unix platform. This can be used to determine current millisecond. + /// + /// @detail For unix system it uses gettimeofday(timeval*, timezone*) and for Windows, a seperate implementation is provided + /// @param [in,out] tv Pointer that gets updated + static void gettimeofday(struct timeval* tv) { +#if ELPP_OS_WINDOWS + if (tv != nullptr) { +# if ELPP_COMPILER_MSVC || defined(_MSC_EXTENSIONS) + const unsigned __int64 delta_ = 11644473600000000Ui64; +# else + const unsigned __int64 delta_ = 11644473600000000ULL; +# endif // ELPP_COMPILER_MSVC || defined(_MSC_EXTENSIONS) + const double secOffSet = 0.000001; + const unsigned long usecOffSet = 1000000; + FILETIME fileTime; + GetSystemTimeAsFileTime(&fileTime); + unsigned __int64 present = 0; + present |= fileTime.dwHighDateTime; + present = present << 32; + present |= fileTime.dwLowDateTime; + present /= 10; // mic-sec + // Subtract the difference + present -= delta_; + tv->tv_sec = static_cast(present * secOffSet); + tv->tv_usec = static_cast(present % usecOffSet); + } +#else + ::gettimeofday(tv, nullptr); +#endif // ELPP_OS_WINDOWS + } + + /// @brief Gets current date and time with milliseconds. + /// @param format User provided date/time format + /// @param msWidth A pointer to base::MillisecondsWidth from configuration (non-null) + /// @returns string based date time in specified format. + static inline std::string getDateTime(const char* format, const base::MillisecondsWidth* msWidth) { + struct timeval currTime; + gettimeofday(&currTime); + struct ::tm timeInfo; + buildTimeInfo(&currTime, &timeInfo); + const int kBuffSize = 30; + char buff_[kBuffSize] = ""; + parseFormat(buff_, kBuffSize, format, &timeInfo, static_cast(currTime.tv_usec / msWidth->m_offset), msWidth); + return std::string(buff_); + } + + /// @brief Formats time to get unit accordingly, units like second if > 1000 or minutes if > 60000 etc + static base::type::string_t formatTime(unsigned long long time, base::TimestampUnit timestampUnit) { + double result = static_cast(time); + base::type::EnumType start = static_cast(timestampUnit); + const base::type::char_t* unit = base::consts::kTimeFormats[start].unit; + for (base::type::EnumType i = start; i < base::consts::kTimeFormatsCount - 1; ++i) { + if (result <= base::consts::kTimeFormats[i].value) { + break; + } + result /= base::consts::kTimeFormats[i].value; + unit = base::consts::kTimeFormats[i + 1].unit; + } + base::type::stringstream_t ss; + ss << result << " " << unit; + return ss.str(); + } + + /// @brief Gets time difference in milli/micro second depending on timestampUnit + static inline unsigned long long getTimeDifference(const struct timeval& endTime, const struct timeval& startTime, base::TimestampUnit timestampUnit) { + if (timestampUnit == base::TimestampUnit::Microsecond) { + return static_cast(static_cast(1000000 * endTime.tv_sec + endTime.tv_usec) - + static_cast(1000000 * startTime.tv_sec + startTime.tv_usec)); + } + else { + return static_cast((((endTime.tv_sec - startTime.tv_sec) * 1000000) + (endTime.tv_usec - startTime.tv_usec)) / 1000); + } + } + + private: + static inline struct ::tm* buildTimeInfo(struct timeval* currTime, struct ::tm* timeInfo) { +#if ELPP_OS_UNIX + time_t rawTime = currTime->tv_sec; + ::localtime_r(&rawTime, timeInfo); + return timeInfo; +#else +# if ELPP_COMPILER_MSVC + ELPP_UNUSED(currTime); + time_t t; + _time64(&t); + localtime_s(timeInfo, &t); + return timeInfo; +# else + // For any other compilers that don't have CRT warnings issue e.g, MinGW or TDM GCC- we use different method + time_t rawTime = currTime->tv_sec; + struct tm* tmInf = localtime(&rawTime); + *timeInfo = *tmInf; + return timeInfo; +# endif // ELPP_COMPILER_MSVC +#endif // ELPP_OS_UNIX + } + static char* parseFormat(char* buf, std::size_t bufSz, const char* format, const struct tm* tInfo, + std::size_t msec, const base::MillisecondsWidth* msWidth) { + const char* bufLim = buf + bufSz; + for (; *format; ++format) { + if (*format == base::consts::kFormatSpecifierChar) { + switch (*++format) { + case base::consts::kFormatSpecifierChar: // Escape + break; + case '\0': // End + --format; + break; + case 'd': // Day + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_mday, 2, buf, bufLim); + continue; + case 'a': // Day of week (short) + buf = base::utils::Str::addToBuff(base::consts::kDaysAbbrev[tInfo->tm_wday], buf, bufLim); + continue; + case 'A': // Day of week (long) + buf = base::utils::Str::addToBuff(base::consts::kDays[tInfo->tm_wday], buf, bufLim); + continue; + case 'M': // month + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_mon + 1, 2, buf, bufLim); + continue; + case 'b': // month (short) + buf = base::utils::Str::addToBuff(base::consts::kMonthsAbbrev[tInfo->tm_mon], buf, bufLim); + continue; + case 'B': // month (long) + buf = base::utils::Str::addToBuff(base::consts::kMonths[tInfo->tm_mon], buf, bufLim); + continue; + case 'y': // year (two digits) + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_year + base::consts::kYearBase, 2, buf, bufLim); + continue; + case 'Y': // year (four digits) + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_year + base::consts::kYearBase, 4, buf, bufLim); + continue; + case 'h': // hour (12-hour) + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_hour % 12, 2, buf, bufLim); + continue; + case 'H': // hour (24-hour) + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_hour, 2, buf, bufLim); + continue; + case 'm': // minute + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_min, 2, buf, bufLim); + continue; + case 's': // second + buf = base::utils::Str::convertAndAddToBuff(tInfo->tm_sec, 2, buf, bufLim); + continue; + case 'z': // milliseconds + case 'g': + buf = base::utils::Str::convertAndAddToBuff(msec, msWidth->m_width, buf, bufLim); + continue; + case 'F': // AM/PM + buf = base::utils::Str::addToBuff((tInfo->tm_hour >= 12) ? base::consts::kPm : base::consts::kAm, buf, bufLim); + continue; + default: + continue; + } + } + if (buf == bufLim) break; + *buf++ = *format; + } + return buf; + } + }; + /// @brief Command line arguments for application if specified using el::Helpers::setArgs(..) or START_EASYLOGGINGPP(..) + class CommandLineArgs { + public: + CommandLineArgs(void) { + setArgs(0, static_cast(nullptr)); + } + CommandLineArgs(int argc, const char** argv) { + setArgs(argc, argv); + } + CommandLineArgs(int argc, char** argv) { + setArgs(argc, argv); + } + virtual ~CommandLineArgs(void) {} + /// @brief Sets arguments and parses them + inline void setArgs(int argc, const char** argv) { + setArgs(argc, const_cast(argv)); + } + /// @brief Sets arguments and parses them + inline void setArgs(int argc, char** argv) { + m_params.clear(); + m_paramsWithValue.clear(); + if (argc == 0 || argv == nullptr) { + return; + } + m_argc = argc; + m_argv = argv; + for (int i = 1; i < m_argc; ++i) { + const char* v = (strstr(m_argv[i], "=")); + if (v != nullptr && strlen(v) > 0) { + std::string key = std::string(m_argv[i]); + key = key.substr(0, key.find_first_of('=')); + if (hasParamWithValue(key.c_str())) { + ELPP_INTERNAL_INFO(1, "Skipping [" << key << "] arg since it already has value [" + << getParamValue(key.c_str()) << "]"); + } + else { + m_paramsWithValue.insert(std::make_pair(key, std::string(v + 1))); + } + } + if (v == nullptr) { + if (hasParam(m_argv[i])) { + ELPP_INTERNAL_INFO(1, "Skipping [" << m_argv[i] << "] arg since it already exists"); + } + else { + m_params.push_back(std::string(m_argv[i])); + } + } + } + } + /// @brief Returns true if arguments contain paramKey with a value (seperated by '=') + inline bool hasParamWithValue(const char* paramKey) const { + return m_paramsWithValue.find(std::string(paramKey)) != m_paramsWithValue.end(); + } + /// @brief Returns value of arguments + /// @see hasParamWithValue(const char*) + inline const char* getParamValue(const char* paramKey) const { + return m_paramsWithValue.find(std::string(paramKey))->second.c_str(); + } + /// @brief Return true if arguments has a param (not having a value) i,e without '=' + inline bool hasParam(const char* paramKey) const { + return std::find(m_params.begin(), m_params.end(), std::string(paramKey)) != m_params.end(); + } + /// @brief Returns true if no params available. This exclude argv[0] + inline bool empty(void) const { + return m_params.empty() && m_paramsWithValue.empty(); + } + /// @brief Returns total number of arguments. This exclude argv[0] + inline std::size_t size(void) const { + return m_params.size() + m_paramsWithValue.size(); + } + inline friend base::type::ostream_t& operator<<(base::type::ostream_t& os, const CommandLineArgs& c) { + for (int i = 1; i < c.m_argc; ++i) { + os << ELPP_LITERAL("[") << c.m_argv[i] << ELPP_LITERAL("]"); + if (i < c.m_argc - 1) { + os << ELPP_LITERAL(" "); + } + } + return os; + } + + private: + int m_argc; + char** m_argv; + std::map m_paramsWithValue; + std::vector m_params; + }; + /// @brief Abstract registry (aka repository) that provides basic interface for pointer repository specified by T_Ptr type. + /// + /// @detail Most of the functions are virtual final methods but anything implementing this abstract class should implement + /// unregisterAll() and deepCopy(const AbstractRegistry&) and write registerNew() method according to container + /// and few more methods; get() to find element, unregister() to unregister single entry. + /// Please note that this is thread-unsafe and should also implement thread-safety mechanisms in implementation. + template + class AbstractRegistry : public base::threading::ThreadSafe { + public: + typedef typename Container::iterator iterator; + typedef typename Container::const_iterator const_iterator; + + /// @brief Default constructor + AbstractRegistry(void) {} + + /// @brief Move constructor that is useful for base classes + AbstractRegistry(AbstractRegistry&& sr) { + if (this == &sr) { + return; + } + unregisterAll(); + m_list = std::move(sr.m_list); + } + + bool operator==(const AbstractRegistry& other) { + if (size() != other.size()) { + return false; + } + for (std::size_t i = 0; i < m_list.size(); ++i) { + if (m_list.at(i) != other.m_list.at(i)) { + return false; + } + } + return true; + } + + bool operator!=(const AbstractRegistry& other) { + if (size() != other.size()) { + return true; + } + for (std::size_t i = 0; i < m_list.size(); ++i) { + if (m_list.at(i) != other.m_list.at(i)) { + return true; + } + } + return false; + } + + /// @brief Assignment move operator + AbstractRegistry& operator=(AbstractRegistry&& sr) { + if (this == &sr) { + return *this; + } + unregisterAll(); + m_list = std::move(sr.m_list); + return *this; + } + + virtual ~AbstractRegistry(void) { + } + + /// @return Iterator pointer from start of repository + virtual inline iterator begin(void) ELPP_FINAL { + return m_list.begin(); + } + + /// @return Iterator pointer from end of repository + virtual inline iterator end(void) ELPP_FINAL { + return m_list.end(); + } + + + /// @return Constant iterator pointer from start of repository + virtual inline const_iterator cbegin(void) const ELPP_FINAL { + return m_list.cbegin(); + } + + /// @return End of repository + virtual inline const_iterator cend(void) const ELPP_FINAL { + return m_list.cend(); + } + + /// @return Whether or not repository is empty + virtual inline bool empty(void) const ELPP_FINAL { + return m_list.empty(); + } + + /// @return Size of repository + virtual inline std::size_t size(void) const ELPP_FINAL { + return m_list.size(); + } + + /// @brief Returns underlying container by reference + virtual inline Container& list(void) ELPP_FINAL { + return m_list; + } + + /// @brief Returns underlying container by constant reference. + virtual inline const Container& list(void) const ELPP_FINAL { + return m_list; + } + + /// @brief Unregisters all the pointers from current repository. + virtual void unregisterAll(void) = 0; + + protected: + virtual void deepCopy(const AbstractRegistry&) = 0; + void reinitDeepCopy(const AbstractRegistry& sr) { + unregisterAll(); + deepCopy(sr); + } + + private: + Container m_list; + }; + + /// @brief A pointer registry mechanism to manage memory and provide search functionalities. (non-predicate version) + /// + /// @detail NOTE: This is thread-unsafe implementation (although it contains lock function, it does not use these functions) + /// of AbstractRegistry. Any implementation of this class should be + /// explicitly (by using lock functions) + template + class Registry : public AbstractRegistry> { + public: + typedef typename Registry::iterator iterator; + typedef typename Registry::const_iterator const_iterator; + + Registry(void) {} + + /// @brief Copy constructor that is useful for base classes. Try to avoid this constructor, use move constructor. + Registry(const Registry& sr) : AbstractRegistry>() { + if (this == &sr) { + return; + } + this->reinitDeepCopy(sr); + } + + /// @brief Assignment operator that unregisters all the existing registeries and deeply copies each of repo element + /// @see unregisterAll() + /// @see deepCopy(const AbstractRegistry&) + Registry& operator=(const Registry& sr) { + if (this == &sr) { + return *this; + } + this->reinitDeepCopy(sr); + return *this; + } + + virtual ~Registry(void) { + unregisterAll(); + } + + protected: + virtual inline void unregisterAll(void) ELPP_FINAL { + if (!this->empty()) { + for (auto&& curr : this->list()) { + base::utils::safeDelete(curr.second); + } + this->list().clear(); + } + } + + /// @brief Registers new registry to repository. + virtual inline void registerNew(const T_Key& uniqKey, T_Ptr* ptr) ELPP_FINAL { + unregister(uniqKey); + this->list().insert(std::make_pair(uniqKey, ptr)); + } + + /// @brief Unregisters single entry mapped to specified unique key + inline void unregister(const T_Key& uniqKey) { + T_Ptr* existing = get(uniqKey); + if (existing != nullptr) { + base::utils::safeDelete(existing); + this->list().erase(uniqKey); + } + } + + /// @brief Gets pointer from repository. If none found, nullptr is returned. + inline T_Ptr* get(const T_Key& uniqKey) { + iterator it = this->list().find(uniqKey); + return it == this->list().end() + ? nullptr + : it->second; + } + + private: + virtual inline void deepCopy(const AbstractRegistry>& sr) ELPP_FINAL { + for (const_iterator it = sr.cbegin(); it != sr.cend(); ++it) { + registerNew(it->first, new T_Ptr(*it->second)); + } + } + }; + + /// @brief A pointer registry mechanism to manage memory and provide search functionalities. (predicate version) + /// + /// @detail NOTE: This is thread-unsafe implementation of AbstractRegistry. Any implementation of this class + /// should be made thread-safe explicitly + template + class RegistryWithPred : public AbstractRegistry> { + public: + typedef typename RegistryWithPred::iterator iterator; + typedef typename RegistryWithPred::const_iterator const_iterator; + + RegistryWithPred(void) { + } + + virtual ~RegistryWithPred(void) { + unregisterAll(); + } + + /// @brief Copy constructor that is useful for base classes. Try to avoid this constructor, use move constructor. + RegistryWithPred(const RegistryWithPred& sr) : AbstractRegistry>() { + if (this == &sr) { + return; + } + this->reinitDeepCopy(sr); + } + + /// @brief Assignment operator that unregisters all the existing registeries and deeply copies each of repo element + /// @see unregisterAll() + /// @see deepCopy(const AbstractRegistry&) + RegistryWithPred& operator=(const RegistryWithPred& sr) { + if (this == &sr) { + return *this; + } + this->reinitDeepCopy(sr); + return *this; + } + + friend inline base::type::ostream_t& operator<<(base::type::ostream_t& os, const RegistryWithPred& sr) { + for (const_iterator it = sr.list().begin(); it != sr.list().end(); ++it) { + os << ELPP_LITERAL(" ") << **it << ELPP_LITERAL("\n"); + } + return os; + } + + protected: + virtual inline void unregisterAll(void) ELPP_FINAL { + if (!this->empty()) { + for (auto&& curr : this->list()) { + base::utils::safeDelete(curr); + } + this->list().clear(); + } + } + + virtual void unregister(T_Ptr*& ptr) ELPP_FINAL { + if (ptr) { + iterator iter = this->begin(); + for (; iter != this->end(); ++iter) { + if (ptr == *iter) { + break; + } + } + if (iter != this->end() && *iter != nullptr) { + this->list().erase(iter); + base::utils::safeDelete(*iter); + } + } + } + + virtual inline void registerNew(T_Ptr* ptr) ELPP_FINAL { + this->list().push_back(ptr); + } + + /// @brief Gets pointer from repository with speicifed arguments. Arguments are passed to predicate + /// in order to validate pointer. + template + inline T_Ptr* get(const T& arg1, const T2 arg2) { + iterator iter = std::find_if(this->list().begin(), this->list().end(), Pred(arg1, arg2)); + if (iter != this->list().end() && *iter != nullptr) { + return *iter; + } + return nullptr; + } + + private: + virtual inline void deepCopy(const AbstractRegistry>& sr) { + for (const_iterator it = sr.list().begin(); it != sr.list().end(); ++it) { + registerNew(new T_Ptr(**it)); + } + } + }; + + } // namespace utils + } // namespace base + /// @brief Base of Easylogging++ friendly class + /// + /// @detail After inheriting this class publicly, implement pure-virtual function `void log(std::ostream&) const` + class Loggable { + public: + virtual ~Loggable(void) {} + virtual void log(el::base::type::ostream_t&) const = 0; + private: + friend inline el::base::type::ostream_t& operator<<(el::base::type::ostream_t& os, const Loggable& loggable) { + loggable.log(os); + return os; + } + }; + namespace base { + /// @brief Represents log format containing flags and date format. This is used internally to start initial log + class LogFormat : public Loggable { + public: + LogFormat(void) : + m_level(Level::Unknown), + m_userFormat(base::type::string_t()), + m_format(base::type::string_t()), + m_dateTimeFormat(std::string()), + m_flags(0x0) { + } + + LogFormat(Level level, const base::type::string_t& format) + : m_level(level), m_userFormat(format) { + parseFromFormat(m_userFormat); + } + + LogFormat(const LogFormat& logFormat) { + m_level = logFormat.m_level; + m_userFormat = logFormat.m_userFormat; + m_format = logFormat.m_format; + m_dateTimeFormat = logFormat.m_dateTimeFormat; + m_flags = logFormat.m_flags; + } + + LogFormat(LogFormat&& logFormat) { + m_level = std::move(logFormat.m_level); + m_userFormat = std::move(logFormat.m_userFormat); + m_format = std::move(logFormat.m_format); + m_dateTimeFormat = std::move(logFormat.m_dateTimeFormat); + m_flags = std::move(logFormat.m_flags); + } + + LogFormat& operator=(const LogFormat& logFormat) { + m_level = logFormat.m_level; + m_userFormat = logFormat.m_userFormat; + m_dateTimeFormat = logFormat.m_dateTimeFormat; + m_flags = logFormat.m_flags; + return *this; + } + + virtual ~LogFormat(void) { + } + + inline bool operator==(const LogFormat& other) { + return m_level == other.m_level && m_userFormat == other.m_userFormat && m_format == other.m_format && + m_dateTimeFormat == other.m_dateTimeFormat && m_flags == other.m_flags; + } + + /// @brief Updates format to be used while logging. + /// @param userFormat User provided format + void parseFromFormat(const base::type::string_t& userFormat) { + // We make copy because we will be changing the format + // i.e, removing user provided date format from original format + // and then storing it. + base::type::string_t formatCopy = userFormat; + m_flags = 0x0; + auto conditionalAddFlag = [&](const base::type::char_t* specifier, base::FormatFlags flag) { + std::size_t foundAt = base::type::string_t::npos; + while ((foundAt = formatCopy.find(specifier, foundAt + 1)) != base::type::string_t::npos) { + if (foundAt > 0 && formatCopy[foundAt - 1] == base::consts::kFormatSpecifierChar) { + if (hasFlag(flag)) { + // If we already have flag we remove the escape chars so that '%%' is turned to '%' + // even after specifier resolution - this is because we only replaceFirst specifier + formatCopy.erase(foundAt > 0 ? foundAt - 1 : 0, 1); + ++foundAt; + } + } + else { + if (!hasFlag(flag)) addFlag(flag); + } + } + }; + conditionalAddFlag(base::consts::kAppNameFormatSpecifier, base::FormatFlags::AppName); + conditionalAddFlag(base::consts::kSeverityLevelFormatSpecifier, base::FormatFlags::Level); + conditionalAddFlag(base::consts::kSeverityLevelShortFormatSpecifier, base::FormatFlags::LevelShort); + conditionalAddFlag(base::consts::kLoggerIdFormatSpecifier, base::FormatFlags::LoggerId); + conditionalAddFlag(base::consts::kThreadIdFormatSpecifier, base::FormatFlags::ThreadId); + conditionalAddFlag(base::consts::kLogFileFormatSpecifier, base::FormatFlags::File); + conditionalAddFlag(base::consts::kLogFileBaseFormatSpecifier, base::FormatFlags::FileBase); + conditionalAddFlag(base::consts::kLogLineFormatSpecifier, base::FormatFlags::Line); + conditionalAddFlag(base::consts::kLogLocationFormatSpecifier, base::FormatFlags::Location); + conditionalAddFlag(base::consts::kLogFunctionFormatSpecifier, base::FormatFlags::Function); + conditionalAddFlag(base::consts::kCurrentUserFormatSpecifier, base::FormatFlags::User); + conditionalAddFlag(base::consts::kCurrentHostFormatSpecifier, base::FormatFlags::Host); + conditionalAddFlag(base::consts::kMessageFormatSpecifier, base::FormatFlags::LogMessage); + conditionalAddFlag(base::consts::kVerboseLevelFormatSpecifier, base::FormatFlags::VerboseLevel); + // For date/time we need to extract user's date format first + std::size_t dateIndex = std::string::npos; + if ((dateIndex = formatCopy.find(base::consts::kDateTimeFormatSpecifier)) != std::string::npos) { + while (dateIndex > 0 && formatCopy[dateIndex - 1] == base::consts::kFormatSpecifierChar) { + dateIndex = formatCopy.find(base::consts::kDateTimeFormatSpecifier, dateIndex + 1); + } + if (dateIndex != std::string::npos) { + addFlag(base::FormatFlags::DateTime); + updateDateFormat(dateIndex, formatCopy); + } + } + m_format = formatCopy; + updateFormatSpec(); + } + + inline Level level(void) const { + return m_level; + } + + inline const base::type::string_t& userFormat(void) const { + return m_userFormat; + } + + inline const base::type::string_t& format(void) const { + return m_format; + } + + inline const std::string& dateTimeFormat(void) const { + return m_dateTimeFormat; + } + + inline base::type::EnumType flags(void) const { + return m_flags; + } + + inline bool hasFlag(base::FormatFlags flag) const { + return base::utils::hasFlag(flag, m_flags); + } + + virtual void log(el::base::type::ostream_t& os) const { + os << m_format; + } + + protected: + /// @brief Updates date time format if available in currFormat. + /// @param index Index where %datetime, %date or %time was found + /// @param [in,out] currFormat current format that is being used to format + virtual void updateDateFormat(std::size_t index, base::type::string_t& currFormat) ELPP_FINAL { + if (hasFlag(base::FormatFlags::DateTime)) { + index += ELPP_STRLEN(base::consts::kDateTimeFormatSpecifier); + } + const base::type::char_t* ptr = currFormat.c_str() + index; + if ((currFormat.size() > index) && (ptr[0] == '{')) { + // User has provided format for date/time + ++ptr; + int count = 1; // Start by 1 in order to remove starting brace + std::stringstream ss; + for (; *ptr; ++ptr, ++count) { + if (*ptr == '}') { + ++count; // In order to remove ending brace + break; + } + ss << *ptr; + } + currFormat.erase(index, count); + m_dateTimeFormat = ss.str(); + } + else { + // No format provided, use default + if (hasFlag(base::FormatFlags::DateTime)) { + m_dateTimeFormat = std::string(base::consts::kDefaultDateTimeFormat); + } + } + } + + /// @brief Updates %level from format. This is so that we dont have to do it at log-writing-time. It uses m_format and m_level + virtual void updateFormatSpec(void) ELPP_FINAL { + // Do not use switch over strongly typed enums because Intel C++ compilers dont support them yet. + if (m_level == Level::Debug) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kDebugLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kDebugLevelShortLogValue); + } + else if (m_level == Level::Info) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kInfoLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kInfoLevelShortLogValue); + } + else if (m_level == Level::Warning) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kWarningLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kWarningLevelShortLogValue); + } + else if (m_level == Level::Error) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kErrorLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kErrorLevelShortLogValue); + } + else if (m_level == Level::Fatal) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kFatalLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kFatalLevelShortLogValue); + } + else if (m_level == Level::Verbose) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kVerboseLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kVerboseLevelShortLogValue); + } + else if (m_level == Level::Trace) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelFormatSpecifier, + base::consts::kTraceLevelLogValue); + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kSeverityLevelShortFormatSpecifier, + base::consts::kTraceLevelShortLogValue); + } + if (hasFlag(base::FormatFlags::User)) { + std::string s = base::utils::s_currentUser; + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kCurrentUserFormatSpecifier, + base::utils::s_currentUser); + } + if (hasFlag(base::FormatFlags::Host)) { + base::utils::Str::replaceFirstWithEscape(m_format, base::consts::kCurrentHostFormatSpecifier, + base::utils::s_currentHost); + } + // Ignore Level::Global and Level::Unknown + } + + inline void addFlag(base::FormatFlags flag) { + base::utils::addFlag(flag, &m_flags); + } + + private: + Level m_level; + base::type::string_t m_userFormat; + base::type::string_t m_format; + std::string m_dateTimeFormat; + base::type::EnumType m_flags; + friend class el::Logger; // To resolve loggerId format specifier easily + }; + } // namespace base + /// @brief Resolving function for format specifier + typedef std::function FormatSpecifierValueResolver; + /// @brief User-provided custom format specifier + /// @see el::Helpers::installCustomFormatSpecifier + /// @see FormatSpecifierValueResolver + class CustomFormatSpecifier { + public: + CustomFormatSpecifier(const char* formatSpecifier, const FormatSpecifierValueResolver& resolver) : + m_formatSpecifier(formatSpecifier), m_resolver(resolver) {} + inline const char* formatSpecifier(void) const { return m_formatSpecifier; } + inline const FormatSpecifierValueResolver& resolver(void) const { return m_resolver; } + inline bool operator==(const char* formatSpecifier) { + return strcmp(m_formatSpecifier, formatSpecifier) == 0; + } + + private: + const char* m_formatSpecifier; + FormatSpecifierValueResolver m_resolver; + }; + /// @brief Represents single configuration that has representing level, configuration type and a string based value. + /// + /// @detail String based value means any value either its boolean, integer or string itself, it will be embedded inside quotes + /// and will be parsed later. + /// + /// Consider some examples below: + /// * el::Configuration confEnabledInfo(el::Level::Info, el::ConfigurationType::Enabled, "true"); + /// * el::Configuration confMaxLogFileSizeInfo(el::Level::Info, el::ConfigurationType::MaxLogFileSize, "2048"); + /// * el::Configuration confFilenameInfo(el::Level::Info, el::ConfigurationType::Filename, "/var/log/my.log"); + class Configuration : public Loggable { + public: + Configuration(const Configuration& c) : + m_level(c.m_level), + m_configurationType(c.m_configurationType), + m_value(c.m_value) { + } + + Configuration& operator=(const Configuration& c) { + m_level = c.m_level; + m_configurationType = c.m_configurationType; + m_value = c.m_value; + return *this; + } + + virtual ~Configuration(void) { + } + + /// @brief Full constructor used to sets value of configuration + Configuration(Level level, ConfigurationType configurationType, const std::string& value) : + m_level(level), + m_configurationType(configurationType), + m_value(value) { + } + + /// @brief Gets level of current configuration + inline Level level(void) const { + return m_level; + } + + /// @brief Gets configuration type of current configuration + inline ConfigurationType configurationType(void) const { + return m_configurationType; + } + + /// @brief Gets string based configuration value + inline const std::string& value(void) const { + return m_value; + } + + /// @brief Set string based configuration value + /// @param value Value to set. Values have to be std::string; For boolean values use "true", "false", for any integral values + /// use them in quotes. They will be parsed when configuring + inline void setValue(const std::string& value) { + m_value = value; + } + + virtual inline void log(el::base::type::ostream_t& os) const { + os << LevelHelper::convertToString(m_level) + << ELPP_LITERAL(" ") << ConfigurationTypeHelper::convertToString(m_configurationType) + << ELPP_LITERAL(" = ") << m_value.c_str(); + } + + /// @brief Used to find configuration from configuration (pointers) repository. Avoid using it. + class Predicate { + public: + Predicate(Level level, ConfigurationType configurationType) : + m_level(level), + m_configurationType(configurationType) { + } + + inline bool operator()(const Configuration* conf) const { + return ((conf != nullptr) && (conf->level() == m_level) && (conf->configurationType() == m_configurationType)); + } + + private: + Level m_level; + ConfigurationType m_configurationType; + }; + + private: + Level m_level; + ConfigurationType m_configurationType; + std::string m_value; + }; + + /// @brief Thread-safe Configuration repository + /// + /// @detail This repository represents configurations for all the levels and configuration type mapped to a value. + class Configurations : public base::utils::RegistryWithPred { + public: + /// @brief Default constructor with empty repository + Configurations(void) : + m_configurationFile(std::string()), + m_isFromFile(false) { + } + + /// @brief Constructor used to set configurations using configuration file. + /// @param configurationFile Full path to configuration file + /// @param useDefaultsForRemaining Lets you set the remaining configurations to default. + /// @param base If provided, this configuration will be based off existing repository that this argument is pointing to. + /// @see parseFromFile(const std::string&, Configurations* base) + /// @see setRemainingToDefault() + Configurations(const std::string& configurationFile, bool useDefaultsForRemaining = true, Configurations* base = nullptr) : + m_configurationFile(configurationFile), + m_isFromFile(false) { + parseFromFile(configurationFile, base); + if (useDefaultsForRemaining) { + setRemainingToDefault(); + } + } + + virtual ~Configurations(void) { + } + + /// @brief Parses configuration from file. + /// @param configurationFile Full path to configuration file + /// @param base Configurations to base new configuration repository off. This value is used when you want to use + /// existing Configurations to base all the values and then set rest of configuration via configuration file. + /// @return True if successfully parsed, false otherwise. You may define 'ELPP_DEBUG_ASSERT_FAILURE' to make sure you + /// do not proceed without successful parse. + inline bool parseFromFile(const std::string& configurationFile, Configurations* base = nullptr) { + // We initial assertion with true because if we have assertion diabled, we want to pass this + // check and if assertion is enabled we will have values re-assigned any way. + bool assertionPassed = true; + ELPP_ASSERT((assertionPassed = base::utils::File::pathExists(configurationFile.c_str(), true)), + "Configuration file [" << configurationFile << "] does not exist!"); + if (!assertionPassed) { + return false; + } + bool success = Parser::parseFromFile(configurationFile, this, base); + m_isFromFile = success; + return success; + } + + /// @brief Parse configurations from configuration string. + /// + /// @detail This configuration string has same syntax as configuration file contents. Make sure all the necessary + /// new line characters are provided. + /// @param base Configurations to base new configuration repository off. This value is used when you want to use + /// existing Configurations to base all the values and then set rest of configuration via configuration text. + /// @return True if successfully parsed, false otherwise. You may define 'ELPP_DEBUG_ASSERT_FAILURE' to make sure you + /// do not proceed without successful parse. + inline bool parseFromText(const std::string& configurationsString, Configurations* base = nullptr) { + bool success = Parser::parseFromText(configurationsString, this, base); + if (success) { + m_isFromFile = false; + } + return success; + } + + /// @brief Sets configuration based-off an existing configurations. + /// @param base Pointer to existing configurations. + inline void setFromBase(Configurations* base) { + if (base == nullptr || base == this) { + return; + } + base::threading::ScopedLock scopedLock(base->lock()); + for (Configuration*& conf : base->list()) { + set(conf); + } + } + + /// @brief Determines whether or not specified configuration type exists in the repository. + /// + /// @detail Returns as soon as first level is found. + /// @param configurationType Type of configuration to check existence for. + bool hasConfiguration(ConfigurationType configurationType) { + base::type::EnumType lIndex = LevelHelper::kMinValid; + bool result = false; + LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { + if (hasConfiguration(LevelHelper::castFromInt(lIndex), configurationType)) { + result = true; + } + return result; + }); + return result; + } + + /// @brief Determines whether or not specified configuration type exists for specified level + /// @param level Level to check + /// @param configurationType Type of configuration to check existence for. + inline bool hasConfiguration(Level level, ConfigurationType configurationType) { + base::threading::ScopedLock scopedLock(lock()); +#if ELPP_COMPILER_INTEL + // We cant specify template types here, Intel C++ throws compilation error + // "error: type name is not allowed" + return RegistryWithPred::get(level, configurationType) != nullptr; +#else + return RegistryWithPred::get(level, configurationType) != nullptr; +#endif // ELPP_COMPILER_INTEL + } + + /// @brief Sets value of configuration for specified level. + /// + /// @detail Any existing configuration for specified level will be replaced. Also note that configuration types + /// ConfigurationType::MillisecondsWidth and ConfigurationType::PerformanceTracking will be ignored if not set for + /// Level::Global because these configurations are not dependant on level. + /// @param level Level to set configuration for (el::Level). + /// @param configurationType Type of configuration (el::ConfigurationType) + /// @param value A string based value. Regardless of what the data type of configuration is, it will always be string + /// from users' point of view. This is then parsed later to be used internally. + /// @see Configuration::setValue(const std::string& value) + /// @see el::Level + /// @see el::ConfigurationType + inline void set(Level level, ConfigurationType configurationType, const std::string& value) { + base::threading::ScopedLock scopedLock(lock()); + unsafeSet(level, configurationType, value); // This is not unsafe anymore as we have locked mutex + if (level == Level::Global) { + unsafeSetGlobally(configurationType, value, false); // Again this is not unsafe either + } + } + + /// @brief Sets single configuration based on other single configuration. + /// @see set(Level level, ConfigurationType configurationType, const std::string& value) + inline void set(Configuration* conf) { + if (conf == nullptr) { + return; + } + set(conf->level(), conf->configurationType(), conf->value()); + } + + inline Configuration* get(Level level, ConfigurationType configurationType) { + base::threading::ScopedLock scopedLock(lock()); + return RegistryWithPred::get(level, configurationType); + } + + /// @brief Sets configuration for all levels. + /// @param configurationType Type of configuration + /// @param value String based value + /// @see Configurations::set(Level level, ConfigurationType configurationType, const std::string& value) + inline void setGlobally(ConfigurationType configurationType, const std::string& value) { + setGlobally(configurationType, value, false); + } + + /// @brief Clears repository so that all the configurations are unset + inline void clear(void) { + base::threading::ScopedLock scopedLock(lock()); + unregisterAll(); + } + + /// @brief Gets configuration file used in parsing this configurations. + /// + /// @detail If this repository was set manually or by text this returns empty string. + inline const std::string& configurationFile(void) const { + return m_configurationFile; + } + + /// @brief Sets configurations to "factory based" configurations. + void setToDefault(void) { + setGlobally(ConfigurationType::Enabled, std::string("true"), true); +#if !defined(ELPP_NO_DEFAULT_LOG_FILE) + setGlobally(ConfigurationType::Filename, std::string(base::consts::kDefaultLogFile), true); +#else + ELPP_UNUSED(base::consts::kDefaultLogFile); +#endif // !defined(ELPP_NO_DEFAULT_LOG_FILE) + setGlobally(ConfigurationType::ToFile, std::string("true"), true); + setGlobally(ConfigurationType::ToStandardOutput, std::string("true"), true); + setGlobally(ConfigurationType::MillisecondsWidth, std::string("3"), true); + setGlobally(ConfigurationType::PerformanceTracking, std::string("true"), true); + setGlobally(ConfigurationType::MaxLogFileSize, std::string("0"), true); + setGlobally(ConfigurationType::LogFlushThreshold, std::string("0"), true); + + setGlobally(ConfigurationType::Format, std::string("%datetime %level [%logger] %msg"), true); + set(Level::Debug, ConfigurationType::Format, std::string("%datetime %level [%logger] [%user@%host] [%func] [%loc] %msg")); + // INFO and WARNING are set to default by Level::Global + set(Level::Error, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); + set(Level::Fatal, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); + set(Level::Verbose, ConfigurationType::Format, std::string("%datetime %level-%vlevel [%logger] %msg")); + set(Level::Trace, ConfigurationType::Format, std::string("%datetime %level [%logger] [%func] [%loc] %msg")); + } + + /// @brief Lets you set the remaining configurations to default. + /// + /// @detail By remaining, it means that the level/type a configuration does not exist for. + /// This function is useful when you want to minimize chances of failures, e.g, if you have a configuration file that sets + /// configuration for all the configurations except for Enabled or not, we use this so that ENABLED is set to default i.e, + /// true. If you dont do this explicitley (either by calling this function or by using second param in Constructor + /// and try to access a value, an error is thrown + void setRemainingToDefault(void) { + base::threading::ScopedLock scopedLock(lock()); + unsafeSetIfNotExist(Level::Global, ConfigurationType::Enabled, std::string("true")); +#if !defined(ELPP_NO_DEFAULT_LOG_FILE) + unsafeSetIfNotExist(Level::Global, ConfigurationType::Filename, std::string(base::consts::kDefaultLogFile)); +#endif // !defined(ELPP_NO_DEFAULT_LOG_FILE) + unsafeSetIfNotExist(Level::Global, ConfigurationType::ToFile, std::string("true")); + unsafeSetIfNotExist(Level::Global, ConfigurationType::ToStandardOutput, std::string("true")); + unsafeSetIfNotExist(Level::Global, ConfigurationType::MillisecondsWidth, std::string("3")); + unsafeSetIfNotExist(Level::Global, ConfigurationType::PerformanceTracking, std::string("true")); + unsafeSetIfNotExist(Level::Global, ConfigurationType::MaxLogFileSize, std::string("0")); + unsafeSetIfNotExist(Level::Global, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); + unsafeSetIfNotExist(Level::Debug, ConfigurationType::Format, + std::string("%datetime %level [%logger] [%user@%host] [%func] [%loc] %msg")); + // INFO and WARNING are set to default by Level::Global + unsafeSetIfNotExist(Level::Error, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); + unsafeSetIfNotExist(Level::Fatal, ConfigurationType::Format, std::string("%datetime %level [%logger] %msg")); + unsafeSetIfNotExist(Level::Verbose, ConfigurationType::Format, std::string("%datetime %level-%vlevel [%logger] %msg")); + unsafeSetIfNotExist(Level::Trace, ConfigurationType::Format, std::string("%datetime %level [%logger] [%func] [%loc] %msg")); + } + + /// @brief Parser used internally to parse configurations from file or text. + /// + /// @detail This class makes use of base::utils::Str. + /// You should not need this unless you are working on some tool for Easylogging++ + class Parser : base::StaticClass { + public: + /// @brief Parses configuration from file. + /// @param configurationFile Full path to configuration file + /// @param sender Sender configurations pointer. Usually 'this' is used from calling class + /// @param base Configurations to base new configuration repository off. This value is used when you want to use + /// existing Configurations to base all the values and then set rest of configuration via configuration file. + /// @return True if successfully parsed, false otherwise. You may define '_STOP_ON_FIRSTELPP_ASSERTION' to make sure you + /// do not proceed without successful parse. + static bool parseFromFile(const std::string& configurationFile, Configurations* sender, Configurations* base = nullptr) { + sender->setFromBase(base); + std::ifstream fileStream_(configurationFile.c_str(), std::ifstream::in); + ELPP_ASSERT(fileStream_.is_open(), "Unable to open configuration file [" << configurationFile << "] for parsing."); + bool parsedSuccessfully = false; + std::string line = std::string(); + Level currLevel = Level::Unknown; + std::string currConfigStr = std::string(); + std::string currLevelStr = std::string(); + while (fileStream_.good()) { + std::getline(fileStream_, line); + parsedSuccessfully = parseLine(&line, &currConfigStr, &currLevelStr, &currLevel, sender); + ELPP_ASSERT(parsedSuccessfully, "Unable to parse configuration line: " << line); + } + return parsedSuccessfully; + } + + /// @brief Parse configurations from configuration string. + /// + /// @detail This configuration string has same syntax as configuration file contents. Make sure all the necessary + /// new line characters are provided. You may define '_STOP_ON_FIRSTELPP_ASSERTION' to make sure you + /// do not proceed without successful parse (This is recommended) + /// @param configurationsString + /// @param sender Sender configurations pointer. Usually 'this' is used from calling class + /// @param base Configurations to base new configuration repository off. This value is used when you want to use + /// existing Configurations to base all the values and then set rest of configuration via configuration text. + /// @return True if successfully parsed, false otherwise. + static bool parseFromText(const std::string& configurationsString, Configurations* sender, Configurations* base = nullptr) { + sender->setFromBase(base); + bool parsedSuccessfully = false; + std::stringstream ss(configurationsString); + std::string line = std::string(); + Level currLevel = Level::Unknown; + std::string currConfigStr = std::string(); + std::string currLevelStr = std::string(); + while (std::getline(ss, line)) { + parsedSuccessfully = parseLine(&line, &currConfigStr, &currLevelStr, &currLevel, sender); + ELPP_ASSERT(parsedSuccessfully, "Unable to parse configuration line: " << line); + } + return parsedSuccessfully; + } + + private: + friend class el::Loggers; + static void ignoreComments(std::string* line) { + std::size_t foundAt = 0; + std::size_t quotesStart = line->find("\""); + std::size_t quotesEnd = std::string::npos; + if (quotesStart != std::string::npos) { + quotesEnd = line->find("\"", quotesStart + 1); + while (quotesEnd != std::string::npos && line->at(quotesEnd - 1) == '\\') { + // Do not erase slash yet - we will erase it in parseLine(..) while loop + quotesEnd = line->find("\"", quotesEnd + 2); + } + } + if ((foundAt = line->find(base::consts::kConfigurationComment)) != std::string::npos) { + if (foundAt < quotesEnd) { + foundAt = line->find(base::consts::kConfigurationComment, quotesEnd + 1); + } + *line = line->substr(0, foundAt); + } + } + static inline bool isLevel(const std::string& line) { + return base::utils::Str::startsWith(line, std::string(base::consts::kConfigurationLevel)); + } + + static inline bool isComment(const std::string& line) { + return base::utils::Str::startsWith(line, std::string(base::consts::kConfigurationComment)); + } + + static inline bool isConfig(const std::string& line) { + std::size_t assignment = line.find('='); + return line != "" && + (line[0] >= 65 || line[0] <= 90 || line[0] >= 97 || line[0] <= 122) && + (assignment != std::string::npos) && + (line.size() > assignment); + } + + static bool parseLine(std::string* line, std::string* currConfigStr, std::string* currLevelStr, Level* currLevel, Configurations* conf) { + ConfigurationType currConfig = ConfigurationType::Unknown; + std::string currValue = std::string(); + *line = base::utils::Str::trim(*line); + if (isComment(*line)) return true; + ignoreComments(line); + *line = base::utils::Str::trim(*line); + if (line->empty()) { + // Comment ignored + return true; + } + if (isLevel(*line)) { + if (line->size() <= 2) { + return true; + } + *currLevelStr = line->substr(1, line->size() - 2); + *currLevelStr = base::utils::Str::toUpper(*currLevelStr); + *currLevelStr = base::utils::Str::trim(*currLevelStr); + *currLevel = LevelHelper::convertFromString(currLevelStr->c_str()); + return true; + } + if (isConfig(*line)) { + std::size_t assignment = line->find('='); + *currConfigStr = line->substr(0, assignment); + *currConfigStr = base::utils::Str::toUpper(*currConfigStr); + *currConfigStr = base::utils::Str::trim(*currConfigStr); + currConfig = ConfigurationTypeHelper::convertFromString(currConfigStr->c_str()); + currValue = line->substr(assignment + 1); + currValue = base::utils::Str::trim(currValue); + std::size_t quotesStart = currValue.find("\"", 0); + std::size_t quotesEnd = std::string::npos; + if (quotesStart != std::string::npos) { + quotesEnd = currValue.find("\"", quotesStart + 1); + while (quotesEnd != std::string::npos && currValue.at(quotesEnd - 1) == '\\') { + currValue = currValue.erase(quotesEnd - 1, 1); + quotesEnd = currValue.find("\"", quotesEnd + 2); + } + } + if (quotesStart != std::string::npos && quotesEnd != std::string::npos) { + // Quote provided - check and strip if valid + ELPP_ASSERT((quotesStart < quotesEnd), "Configuration error - No ending quote found in [" + << currConfigStr << "]"); + ELPP_ASSERT((quotesStart + 1 != quotesEnd), "Empty configuration value for [" << currConfigStr << "]"); + if ((quotesStart != quotesEnd) && (quotesStart + 1 != quotesEnd)) { + // Explicit check in case if assertion is disabled + currValue = currValue.substr(quotesStart + 1, quotesEnd - 1); + } + } + } + ELPP_ASSERT(*currLevel != Level::Unknown, "Unrecognized severity level [" << *currLevelStr << "]"); + ELPP_ASSERT(currConfig != ConfigurationType::Unknown, "Unrecognized configuration [" << *currConfigStr << "]"); + if (*currLevel == Level::Unknown || currConfig == ConfigurationType::Unknown) { + return false; // unrecognizable level or config + } + conf->set(*currLevel, currConfig, currValue); + return true; + } + }; + + private: + std::string m_configurationFile; + bool m_isFromFile; + friend class el::Loggers; + + /// @brief Unsafely sets configuration if does not already exist + void unsafeSetIfNotExist(Level level, ConfigurationType configurationType, const std::string& value) { + Configuration* conf = RegistryWithPred::get(level, configurationType); + if (conf == nullptr) { + unsafeSet(level, configurationType, value); + } + } + + /// @brief Thread unsafe set + void unsafeSet(Level level, ConfigurationType configurationType, const std::string& value) { + Configuration* conf = RegistryWithPred::get(level, configurationType); + if (conf == nullptr) { + registerNew(new Configuration(level, configurationType, value)); + } + else { + conf->setValue(value); + } + if (level == Level::Global) { + unsafeSetGlobally(configurationType, value, false); + } + } + + /// @brief Sets configurations for all levels including Level::Global if includeGlobalLevel is true + /// @see Configurations::setGlobally(ConfigurationType configurationType, const std::string& value) + void setGlobally(ConfigurationType configurationType, const std::string& value, bool includeGlobalLevel) { + if (includeGlobalLevel) { + set(Level::Global, configurationType, value); + } + base::type::EnumType lIndex = LevelHelper::kMinValid; + LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { + set(LevelHelper::castFromInt(lIndex), configurationType, value); + return false; // Do not break lambda function yet as we need to set all levels regardless + }); + } + + /// @brief Sets configurations (Unsafely) for all levels including Level::Global if includeGlobalLevel is true + /// @see Configurations::setGlobally(ConfigurationType configurationType, const std::string& value) + void unsafeSetGlobally(ConfigurationType configurationType, const std::string& value, bool includeGlobalLevel) { + if (includeGlobalLevel) { + unsafeSet(Level::Global, configurationType, value); + } + base::type::EnumType lIndex = LevelHelper::kMinValid; + LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { + unsafeSet(LevelHelper::castFromInt(lIndex), configurationType, value); + return false; // Do not break lambda function yet as we need to set all levels regardless + }); + } + }; + + namespace base { + typedef std::shared_ptr FileStreamPtr; + typedef std::map LogStreamsReferenceMap; + /// @brief Configurations with data types. + /// + /// @detail el::Configurations have string based values. This is whats used internally in order to read correct configurations. + /// This is to perform faster while writing logs using correct configurations. + /// + /// This is thread safe and final class containing non-virtual destructor (means nothing should inherit this class) + class TypedConfigurations : public base::threading::ThreadSafe { + public: + /// @brief Constructor to initialize (construct) the object off el::Configurations + /// @param configurations Configurations pointer/reference to base this typed configurations off. + /// @param logStreamsReference Use ELPP->registeredLoggers()->logStreamsReference() + TypedConfigurations(Configurations* configurations, base::LogStreamsReferenceMap* logStreamsReference) { + m_configurations = configurations; + m_logStreamsReference = logStreamsReference; + build(m_configurations); + } + + TypedConfigurations(const TypedConfigurations& other) { + this->m_configurations = other.m_configurations; + this->m_logStreamsReference = other.m_logStreamsReference; + build(m_configurations); + } + + virtual ~TypedConfigurations(void) { + } + + const Configurations* configurations(void) const { + return m_configurations; + } + + inline bool enabled(Level level) { + return getConfigByVal(level, &m_enabledMap, "enabled"); + } + + inline bool toFile(Level level) { + return getConfigByVal(level, &m_toFileMap, "toFile"); + } + + inline const std::string& filename(Level level) { + return getConfigByRef(level, &m_filenameMap, "filename"); + } + + inline bool toStandardOutput(Level level) { + return getConfigByVal(level, &m_toStandardOutputMap, "toStandardOutput"); + } + + inline const base::LogFormat& logFormat(Level level) { + return getConfigByRef(level, &m_logFormatMap, "logFormat"); + } + + inline const base::MillisecondsWidth& millisecondsWidth(Level level = Level::Global) { + return getConfigByRef(level, &m_millisecondsWidthMap, "millisecondsWidth"); + } + + inline bool performanceTracking(Level level = Level::Global) { + return getConfigByVal(level, &m_performanceTrackingMap, "performanceTracking"); + } + + inline base::type::fstream_t* fileStream(Level level) { + return getConfigByRef(level, &m_fileStreamMap, "fileStream").get(); + } + + inline std::size_t maxLogFileSize(Level level) { + return getConfigByVal(level, &m_maxLogFileSizeMap, "maxLogFileSize"); + } + + inline std::size_t logFlushThreshold(Level level) { + return getConfigByVal(level, &m_logFlushThresholdMap, "logFlushThreshold"); + } + + private: + Configurations* m_configurations; + std::map m_enabledMap; + std::map m_toFileMap; + std::map m_filenameMap; + std::map m_toStandardOutputMap; + std::map m_logFormatMap; + std::map m_millisecondsWidthMap; + std::map m_performanceTrackingMap; + std::map m_fileStreamMap; + std::map m_maxLogFileSizeMap; + std::map m_logFlushThresholdMap; + base::LogStreamsReferenceMap* m_logStreamsReference; + + friend class el::Helpers; + friend class el::base::MessageBuilder; + friend class el::base::Writer; + friend class el::base::DefaultLogDispatchCallback; + friend class el::base::LogDispatcher; + + template + inline Conf_T getConfigByVal(Level level, const std::map* confMap, const char* confName) { + base::threading::ScopedLock scopedLock(lock()); + return unsafeGetConfigByVal(level, confMap, confName); // This is not unsafe anymore - mutex locked in scope + } + + template + inline Conf_T& getConfigByRef(Level level, std::map* confMap, const char* confName) { + base::threading::ScopedLock scopedLock(lock()); + return unsafeGetConfigByRef(level, confMap, confName); // This is not unsafe anymore - mutex locked in scope + } + + template + inline Conf_T unsafeGetConfigByVal(Level level, const std::map* confMap, const char* confName) { + ELPP_UNUSED(confName); + typename std::map::const_iterator it = confMap->find(level); + if (it == confMap->end()) { + try { + return confMap->at(Level::Global); + } + catch (...) { + ELPP_INTERNAL_ERROR("Unable to get configuration [" << confName << "] for level [" + << LevelHelper::convertToString(level) << "]" + << std::endl << "Please ensure you have properly configured logger.", false); + return Conf_T(); + } + } + return it->second; + } + + template + inline Conf_T& unsafeGetConfigByRef(Level level, std::map* confMap, const char* confName) { + ELPP_UNUSED(confName); + typename std::map::iterator it = confMap->find(level); + if (it == confMap->end()) { + try { + return confMap->at(Level::Global); + } + catch (...) { + ELPP_INTERNAL_ERROR("Unable to get configuration [" << confName << "] for level [" + << LevelHelper::convertToString(level) << "]" + << std::endl << "Please ensure you have properly configured logger.", false); + } + } + return it->second; + } + + template + void setValue(Level level, const Conf_T& value, std::map* confMap, bool includeGlobalLevel = true) { + // If map is empty and we are allowed to add into generic level (Level::Global), do it! + if (confMap->empty() && includeGlobalLevel) { + confMap->insert(std::make_pair(Level::Global, value)); + return; + } + // If same value exist in generic level already, dont add it to explicit level + typename std::map::iterator it = confMap->find(Level::Global); + if (it != confMap->end() && it->second == value) { + return; + } + // Now make sure we dont double up values if we really need to add it to explicit level + it = confMap->find(level); + if (it == confMap->end()) { + // Value not found for level, add new + confMap->insert(std::make_pair(level, value)); + } + else { + // Value found, just update value + confMap->at(level) = value; + } + } + + void build(Configurations* configurations) { + base::threading::ScopedLock scopedLock(lock()); + auto getBool = [](std::string boolStr) -> bool { // Pass by value for trimming + base::utils::Str::trim(boolStr); + return (boolStr == "TRUE" || boolStr == "true" || boolStr == "1"); + }; + std::vector withFileSizeLimit; + for (Configurations::const_iterator it = configurations->begin(); it != configurations->end(); ++it) { + Configuration* conf = *it; + // We cannot use switch on strong enums because Intel C++ dont support them yet + if (conf->configurationType() == ConfigurationType::Enabled) { + setValue(conf->level(), getBool(conf->value()), &m_enabledMap); + } + else if (conf->configurationType() == ConfigurationType::ToFile) { + setValue(conf->level(), getBool(conf->value()), &m_toFileMap); + } + else if (conf->configurationType() == ConfigurationType::ToStandardOutput) { + setValue(conf->level(), getBool(conf->value()), &m_toStandardOutputMap); + } + else if (conf->configurationType() == ConfigurationType::Filename) { + // We do not yet configure filename but we will configure in another + // loop. This is because if file cannot be created, we will force ToFile + // to be false. Because configuring logger is not necessarily performance + // sensative operation, we can live with another loop; (by the way this loop + // is not very heavy either) + } + else if (conf->configurationType() == ConfigurationType::Format) { + setValue(conf->level(), base::LogFormat(conf->level(), + base::type::string_t(conf->value().begin(), conf->value().end())), &m_logFormatMap); + } + else if (conf->configurationType() == ConfigurationType::MillisecondsWidth) { + setValue(Level::Global, + base::MillisecondsWidth(static_cast(getULong(conf->value()))), &m_millisecondsWidthMap); + } + else if (conf->configurationType() == ConfigurationType::PerformanceTracking) { + setValue(Level::Global, getBool(conf->value()), &m_performanceTrackingMap); + } + else if (conf->configurationType() == ConfigurationType::MaxLogFileSize) { + setValue(conf->level(), static_cast(getULong(conf->value())), &m_maxLogFileSizeMap); +#if !defined(ELPP_NO_DEFAULT_LOG_FILE) + withFileSizeLimit.push_back(conf); +#endif // !defined(ELPP_NO_DEFAULT_LOG_FILE) + } + else if (conf->configurationType() == ConfigurationType::LogFlushThreshold) { + setValue(conf->level(), static_cast(getULong(conf->value())), &m_logFlushThresholdMap); + } + } + // As mentioned early, we will now set filename configuration in separate loop to deal with non-existent files + for (Configurations::const_iterator it = configurations->begin(); it != configurations->end(); ++it) { + Configuration* conf = *it; + if (conf->configurationType() == ConfigurationType::Filename) { + insertFile(conf->level(), conf->value()); + } + } + for (std::vector::iterator conf = withFileSizeLimit.begin(); + conf != withFileSizeLimit.end(); ++conf) { + // This is not unsafe as mutex is locked in currect scope + unsafeValidateFileRolling((*conf)->level(), base::defaultPreRollOutCallback); + } + } + + unsigned long getULong(std::string confVal) { + bool valid = true; + base::utils::Str::trim(confVal); + valid = !confVal.empty() && std::find_if(confVal.begin(), confVal.end(), + [](char c) { return !base::utils::Str::isDigit(c); }) == confVal.end(); + if (!valid) { + valid = false; + ELPP_ASSERT(valid, "Configuration value not a valid integer [" << confVal << "]"); + return 0; + } + return atol(confVal.c_str()); + } + + std::string resolveFilename(const std::string& filename) { + std::string resultingFilename = filename; + std::size_t dateIndex = std::string::npos; + std::string dateTimeFormatSpecifierStr = std::string(base::consts::kDateTimeFormatSpecifierForFilename); + if ((dateIndex = resultingFilename.find(dateTimeFormatSpecifierStr.c_str())) != std::string::npos) { + while (dateIndex > 0 && resultingFilename[dateIndex - 1] == base::consts::kFormatSpecifierChar) { + dateIndex = resultingFilename.find(dateTimeFormatSpecifierStr.c_str(), dateIndex + 1); + } + if (dateIndex != std::string::npos) { + const char* ptr = resultingFilename.c_str() + dateIndex; + // Goto end of specifier + ptr += dateTimeFormatSpecifierStr.size(); + std::string fmt; + if ((resultingFilename.size() > dateIndex) && (ptr[0] == '{')) { + // User has provided format for date/time + ++ptr; + int count = 1; // Start by 1 in order to remove starting brace + std::stringstream ss; + for (; *ptr; ++ptr, ++count) { + if (*ptr == '}') { + ++count; // In order to remove ending brace + break; + } + ss << *ptr; + } + resultingFilename.erase(dateIndex + dateTimeFormatSpecifierStr.size(), count); + fmt = ss.str(); + } + else { + fmt = std::string(base::consts::kDefaultDateTimeFormatInFilename); + } + base::MillisecondsWidth msWidth(3); + std::string now = base::utils::DateTime::getDateTime(fmt.c_str(), &msWidth); + base::utils::Str::replaceAll(now, '/', '-'); // Replace path element since we are dealing with filename + base::utils::Str::replaceAll(resultingFilename, dateTimeFormatSpecifierStr, now); + } + } + return resultingFilename; + } + + void insertFile(Level level, const std::string& fullFilename) { + std::string resolvedFilename = resolveFilename(fullFilename); + if (resolvedFilename.empty()) { + std::cerr << "Could not load empty file for logging, please re-check your configurations for level [" + << LevelHelper::convertToString(level) << "]"; + } + std::string filePath = base::utils::File::extractPathFromFilename(resolvedFilename, base::consts::kFilePathSeperator); + if (filePath.size() < resolvedFilename.size()) { + base::utils::File::createPath(filePath); + } + auto create = [&](Level level) { + base::LogStreamsReferenceMap::iterator filestreamIter = m_logStreamsReference->find(resolvedFilename); + base::type::fstream_t* fs = nullptr; + if (filestreamIter == m_logStreamsReference->end()) { + // We need a completely new stream, nothing to share with + fs = base::utils::File::newFileStream(resolvedFilename); + m_filenameMap.insert(std::make_pair(level, resolvedFilename)); + m_fileStreamMap.insert(std::make_pair(level, base::FileStreamPtr(fs))); + m_logStreamsReference->insert(std::make_pair(resolvedFilename, base::FileStreamPtr(m_fileStreamMap.at(level)))); + } + else { + // Woops! we have an existing one, share it! + m_filenameMap.insert(std::make_pair(level, filestreamIter->first)); + m_fileStreamMap.insert(std::make_pair(level, base::FileStreamPtr(filestreamIter->second))); + fs = filestreamIter->second.get(); + } + if (fs == nullptr) { + // We display bad file error from newFileStream() + ELPP_INTERNAL_ERROR("Setting [TO_FILE] of [" + << LevelHelper::convertToString(level) << "] to FALSE", false); + setValue(level, false, &m_toFileMap); + } + }; + // If we dont have file conf for any level, create it for Level::Global first + // otherwise create for specified level + create(m_filenameMap.empty() && m_fileStreamMap.empty() ? Level::Global : level); + } + + bool unsafeValidateFileRolling(Level level, const PreRollOutCallback& PreRollOutCallback) { + base::type::fstream_t* fs = unsafeGetConfigByRef(level, &m_fileStreamMap, "fileStream").get(); + if (fs == nullptr) { + return true; + } + std::size_t maxLogFileSize = unsafeGetConfigByVal(level, &m_maxLogFileSizeMap, "maxLogFileSize"); + std::size_t currFileSize = base::utils::File::getSizeOfFile(fs); + if (maxLogFileSize != 0 && currFileSize >= maxLogFileSize) { + std::string fname = unsafeGetConfigByRef(level, &m_filenameMap, "filename"); + ELPP_INTERNAL_INFO(1, "Truncating log file [" << fname << "] as a result of configurations for level [" + << LevelHelper::convertToString(level) << "]"); + fs->close(); + PreRollOutCallback(fname.c_str(), currFileSize); + fs->open(fname, std::fstream::out | std::fstream::trunc); + return true; + } + return false; + } + + bool validateFileRolling(Level level, const PreRollOutCallback& PreRollOutCallback) { + base::threading::ScopedLock scopedLock(lock()); + return unsafeValidateFileRolling(level, PreRollOutCallback); + } + }; + /// @brief Class that keeps record of current line hit for occasional logging + class HitCounter { + public: + HitCounter(void) : + m_filename(""), + m_lineNumber(0), + m_hitCounts(0) { + } + + HitCounter(const char* filename, unsigned long int lineNumber) : + m_filename(filename), + m_lineNumber(lineNumber), + m_hitCounts(0) { + } + + HitCounter(const HitCounter& hitCounter) : + m_filename(hitCounter.m_filename), + m_lineNumber(hitCounter.m_lineNumber), + m_hitCounts(hitCounter.m_hitCounts) { + } + + HitCounter& operator=(const HitCounter& hitCounter) { + m_filename = hitCounter.m_filename; + m_lineNumber = hitCounter.m_lineNumber; + m_hitCounts = hitCounter.m_hitCounts; + return *this; + } + + virtual ~HitCounter(void) { + } + + /// @brief Resets location of current hit counter + inline void resetLocation(const char* filename, unsigned long int lineNumber) { + m_filename = filename; + m_lineNumber = lineNumber; + } + + /// @brief Validates hit counts and resets it if necessary + inline void validateHitCounts(std::size_t n) { + if (m_hitCounts >= base::consts::kMaxLogPerCounter) { + m_hitCounts = (n >= 1 ? base::consts::kMaxLogPerCounter % n : 0); + } + ++m_hitCounts; + } + + inline const char* filename(void) const { + return m_filename; + } + + inline unsigned long int lineNumber(void) const { + return m_lineNumber; + } + + inline std::size_t hitCounts(void) const { + return m_hitCounts; + } + + inline void increment(void) { + ++m_hitCounts; + } + + class Predicate { + public: + Predicate(const char* filename, unsigned long int lineNumber) + : m_filename(filename), + m_lineNumber(lineNumber) { + } + inline bool operator()(const HitCounter* counter) { + return ((counter != nullptr) && + (strcmp(counter->m_filename, m_filename) == 0) && + (counter->m_lineNumber == m_lineNumber)); + } + + private: + const char* m_filename; + unsigned long int m_lineNumber; + }; + + private: + const char* m_filename; + unsigned long int m_lineNumber; + std::size_t m_hitCounts; + }; + /// @brief Repository for hit counters used across the application + class RegisteredHitCounters : public base::utils::RegistryWithPred { + public: + /// @brief Validates counter for every N, i.e, registers new if does not exist otherwise updates original one + /// @return True if validation resulted in triggering hit. Meaning logs should be written everytime true is returned + bool validateEveryN(const char* filename, unsigned long int lineNumber, std::size_t n) { + base::threading::ScopedLock scopedLock(lock()); + base::HitCounter* counter = get(filename, lineNumber); + if (counter == nullptr) { + registerNew(counter = new base::HitCounter(filename, lineNumber)); + } + counter->validateHitCounts(n); + bool result = (n >= 1 && counter->hitCounts() != 0 && counter->hitCounts() % n == 0); + return result; + } + + /// @brief Validates counter for hits >= N, i.e, registers new if does not exist otherwise updates original one + /// @return True if validation resulted in triggering hit. Meaning logs should be written everytime true is returned + bool validateAfterN(const char* filename, unsigned long int lineNumber, std::size_t n) { + base::threading::ScopedLock scopedLock(lock()); + base::HitCounter* counter = get(filename, lineNumber); + if (counter == nullptr) { + registerNew(counter = new base::HitCounter(filename, lineNumber)); + } + // Do not use validateHitCounts here since we do not want to reset counter here + // Note the >= instead of > because we are incrementing + // after this check + if (counter->hitCounts() >= n) + return true; + counter->increment(); + return false; + } + + /// @brief Validates counter for hits are <= n, i.e, registers new if does not exist otherwise updates original one + /// @return True if validation resulted in triggering hit. Meaning logs should be written everytime true is returned + bool validateNTimes(const char* filename, unsigned long int lineNumber, std::size_t n) { + base::threading::ScopedLock scopedLock(lock()); + base::HitCounter* counter = get(filename, lineNumber); + if (counter == nullptr) { + registerNew(counter = new base::HitCounter(filename, lineNumber)); + } + counter->increment(); + // Do not use validateHitCounts here since we do not want to reset counter here + if (counter->hitCounts() <= n) + return true; + return false; + } + + /// @brief Gets hit counter registered at specified position + inline const base::HitCounter* getCounter(const char* filename, unsigned long int lineNumber) { + base::threading::ScopedLock scopedLock(lock()); + return get(filename, lineNumber); + } + }; + /// @brief Action to be taken for dispatching + enum class DispatchAction : base::type::EnumType { + None = 1, NormalLog = 2, SysLog = 4 + }; + } // namespace base + template + class Callback : protected base::threading::ThreadSafe { + public: + Callback(void) : m_enabled(true) {} + inline bool enabled(void) const { return m_enabled; } + inline void setEnabled(bool enabled) { + base::threading::ScopedLock scopedLock(lock()); + m_enabled = enabled; + } + protected: + virtual void handle(const T* handlePtr) = 0; + private: + bool m_enabled; + }; + class LogDispatchData { + public: + LogDispatchData() : m_logMessage(nullptr), m_dispatchAction(base::DispatchAction::None) {} + inline const LogMessage* logMessage(void) const { return m_logMessage; } + inline base::DispatchAction dispatchAction(void) const { return m_dispatchAction; } + private: + LogMessage* m_logMessage; + base::DispatchAction m_dispatchAction; + friend class base::LogDispatcher; + + inline void setLogMessage(LogMessage* logMessage) { m_logMessage = logMessage; } + inline void setDispatchAction(base::DispatchAction dispatchAction) { m_dispatchAction = dispatchAction; } + }; + class LogDispatchCallback : public Callback { + private: + friend class base::LogDispatcher; + }; + class PerformanceTrackingCallback : public Callback { + private: + friend class base::PerformanceTracker; + }; + class LogBuilder : base::NoCopy { + public: + virtual ~LogBuilder(void) { ELPP_INTERNAL_INFO(3, "Destroying log builder...") } + virtual base::type::string_t build(const LogMessage* logMessage, bool appendNewLine) const = 0; + void convertToColoredOutput(base::type::string_t* logLine, Level level) { + if (!base::utils::s_termSupportsColor) return; + const base::type::char_t* resetColor = ELPP_LITERAL("\x1b[0m"); + if (level == Level::Error || level == Level::Fatal) + *logLine = ELPP_LITERAL("\x1b[31m") + *logLine + resetColor; + else if (level == Level::Warning) + *logLine = ELPP_LITERAL("\x1b[33m") + *logLine + resetColor; + } + private: + friend class el::base::DefaultLogDispatchCallback; + }; + typedef std::shared_ptr LogBuilderPtr; + /// @brief Represents a logger holding ID and configurations we need to write logs + /// + /// @detail This class does not write logs itself instead its used by writer to read configuations from. + class Logger : public base::threading::ThreadSafe, public Loggable { + public: + Logger(const std::string& id, base::LogStreamsReferenceMap* logStreamsReference) : + m_id(id), + m_typedConfigurations(nullptr), + m_parentApplicationName(std::string()), + m_isConfigured(false), + m_logStreamsReference(logStreamsReference) { + initUnflushedCount(); + } + + Logger(const std::string& id, const Configurations& configurations, base::LogStreamsReferenceMap* logStreamsReference) : + m_id(id), + m_typedConfigurations(nullptr), + m_parentApplicationName(std::string()), + m_isConfigured(false), + m_logStreamsReference(logStreamsReference) { + initUnflushedCount(); + configure(configurations); + } + + Logger(const Logger& logger) { + base::utils::safeDelete(m_typedConfigurations); + m_id = logger.m_id; + m_typedConfigurations = logger.m_typedConfigurations; + m_parentApplicationName = logger.m_parentApplicationName; + m_isConfigured = logger.m_isConfigured; + m_configurations = logger.m_configurations; + m_unflushedCount = logger.m_unflushedCount; + m_logStreamsReference = logger.m_logStreamsReference; + } + + Logger& operator=(const Logger& logger) { + base::utils::safeDelete(m_typedConfigurations); + m_id = logger.m_id; + m_typedConfigurations = logger.m_typedConfigurations; + m_parentApplicationName = logger.m_parentApplicationName; + m_isConfigured = logger.m_isConfigured; + m_configurations = logger.m_configurations; + m_unflushedCount = logger.m_unflushedCount; + m_logStreamsReference = logger.m_logStreamsReference; + return *this; + } + + virtual ~Logger(void) { + base::utils::safeDelete(m_typedConfigurations); + } + + virtual inline void log(el::base::type::ostream_t& os) const { + os << m_id.c_str(); + } + + /// @brief Configures the logger using specified configurations. + void configure(const Configurations& configurations) { + m_isConfigured = false; // we set it to false in case if we fail + initUnflushedCount(); + if (m_typedConfigurations != nullptr) { + Configurations* c = const_cast(m_typedConfigurations->configurations()); + if (c->hasConfiguration(Level::Global, ConfigurationType::Filename)) { + // This check is definitely needed for cases like ELPP_NO_DEFAULT_LOG_FILE + flush(); + } + } + base::threading::ScopedLock scopedLock(lock()); + if (m_configurations != configurations) { + m_configurations.setFromBase(const_cast(&configurations)); + } + base::utils::safeDelete(m_typedConfigurations); + m_typedConfigurations = new base::TypedConfigurations(&m_configurations, m_logStreamsReference); + resolveLoggerFormatSpec(); + m_isConfigured = true; + } + + /// @brief Reconfigures logger using existing configurations + inline void reconfigure(void) { + ELPP_INTERNAL_INFO(1, "Reconfiguring logger [" << m_id << "]"); + configure(m_configurations); + } + + inline const std::string& id(void) const { + return m_id; + } + + inline const std::string& parentApplicationName(void) const { + return m_parentApplicationName; + } + + inline void setParentApplicationName(const std::string& parentApplicationName) { + m_parentApplicationName = parentApplicationName; + } + + inline Configurations* configurations(void) { + return &m_configurations; + } + + inline base::TypedConfigurations* typedConfigurations(void) { + return m_typedConfigurations; + } + + static inline bool isValidId(const std::string& id) { + for (std::string::const_iterator it = id.begin(); it != id.end(); ++it) { + if (!base::utils::Str::contains(base::consts::kValidLoggerIdSymbols, *it)) { + return false; + } + } + return true; + } + /// @brief Flushes logger to sync all log files for all levels + inline void flush(void) { + ELPP_INTERNAL_INFO(3, "Flushing logger [" << m_id << "] all levels"); + base::threading::ScopedLock scopedLock(lock()); + base::type::EnumType lIndex = LevelHelper::kMinValid; + LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { + flush(LevelHelper::castFromInt(lIndex), nullptr); + return false; + }); + } + + inline void flush(Level level, base::type::fstream_t* fs) { + if (fs == nullptr && m_typedConfigurations->toFile(level)) { + fs = m_typedConfigurations->fileStream(level); + } + if (fs != nullptr) { + fs->flush(); + m_unflushedCount.find(level)->second = 0; + } + } + + inline bool isFlushNeeded(Level level) { + return ++m_unflushedCount.find(level)->second >= m_typedConfigurations->logFlushThreshold(level); + } + + inline LogBuilder* logBuilder(void) const { + return m_logBuilder.get(); + } + + inline void setLogBuilder(const LogBuilderPtr& logBuilder) { + m_logBuilder = logBuilder; + } + + inline bool enabled(Level level) const { + return m_typedConfigurations->enabled(level); + } + +#if ELPP_VARIADIC_TEMPLATES_SUPPORTED +# define LOGGER_LEVEL_WRITERS_SIGNATURES(FUNCTION_NAME)\ + template \ + inline void FUNCTION_NAME(const char*, const T&, const Args&...);\ + template \ + inline void FUNCTION_NAME(const T&); + + template + inline void verbose(int, const char*, const T&, const Args&...); + + template + inline void verbose(int, const T&); + + LOGGER_LEVEL_WRITERS_SIGNATURES(info) + LOGGER_LEVEL_WRITERS_SIGNATURES(debug) + LOGGER_LEVEL_WRITERS_SIGNATURES(warn) + LOGGER_LEVEL_WRITERS_SIGNATURES(error) + LOGGER_LEVEL_WRITERS_SIGNATURES(fatal) + LOGGER_LEVEL_WRITERS_SIGNATURES(trace) +# undef LOGGER_LEVEL_WRITERS_SIGNATURES +#endif // ELPP_VARIADIC_TEMPLATES_SUPPORTED + private: + std::string m_id; + base::TypedConfigurations* m_typedConfigurations; + base::type::stringstream_t m_stream; + std::string m_parentApplicationName; + bool m_isConfigured; + Configurations m_configurations; + std::map m_unflushedCount; + base::LogStreamsReferenceMap* m_logStreamsReference; + LogBuilderPtr m_logBuilder; + + friend class el::LogMessage; + friend class el::Loggers; + friend class el::Helpers; + friend class el::base::RegisteredLoggers; + friend class el::base::DefaultLogDispatchCallback; + friend class el::base::MessageBuilder; + friend class el::base::Writer; + friend class el::base::PErrorWriter; + friend class el::base::Storage; + friend class el::base::PerformanceTracker; + friend class el::base::LogDispatcher; + + Logger(void); + +#if ELPP_VARIADIC_TEMPLATES_SUPPORTED + template + void log_(Level, int, const char*, const T&, const Args&...); + + template + inline void log_(Level, int, const T&); + + template + void log(Level, const char*, const T&, const Args&...); + + template + inline void log(Level, const T&); +#endif // ELPP_VARIADIC_TEMPLATES_SUPPORTED + + void initUnflushedCount(void) { + m_unflushedCount.clear(); + base::type::EnumType lIndex = LevelHelper::kMinValid; + LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { + m_unflushedCount.insert(std::make_pair(LevelHelper::castFromInt(lIndex), 0)); + return false; + }); + } + + inline base::type::stringstream_t& stream(void) { + return m_stream; + } + + void resolveLoggerFormatSpec(void) const { + base::type::EnumType lIndex = LevelHelper::kMinValid; + LevelHelper::forEachLevel(&lIndex, [&](void) -> bool { + base::LogFormat* logFormat = + const_cast(&m_typedConfigurations->logFormat(LevelHelper::castFromInt(lIndex))); + base::utils::Str::replaceFirstWithEscape(logFormat->m_format, base::consts::kLoggerIdFormatSpecifier, m_id); + return false; + }); + } + }; + namespace base { + /// @brief Loggers repository + class RegisteredLoggers : public base::utils::Registry { + public: + explicit RegisteredLoggers(const LogBuilderPtr& defaultLogBuilder) : + m_defaultLogBuilder(defaultLogBuilder) { + m_defaultConfigurations.setToDefault(); + } + + virtual ~RegisteredLoggers(void) { + flushAll(); + } + + inline void setDefaultConfigurations(const Configurations& configurations) { + base::threading::ScopedLock scopedLock(lock()); + m_defaultConfigurations.setFromBase(const_cast(&configurations)); + } + + inline Configurations* defaultConfigurations(void) { + return &m_defaultConfigurations; + } + + Logger* get(const std::string& id, bool forceCreation = true) { + base::threading::ScopedLock scopedLock(lock()); + Logger* logger_ = base::utils::Registry::get(id); + if (logger_ == nullptr && forceCreation) { + bool validId = Logger::isValidId(id); + if (!validId) { + ELPP_ASSERT(validId, "Invalid logger ID [" << id << "]. Not registering this logger."); + return nullptr; + } + logger_ = new Logger(id, m_defaultConfigurations, &m_logStreamsReference); + logger_->m_logBuilder = m_defaultLogBuilder; + registerNew(id, logger_); + } + return logger_; + } + + bool remove(const std::string& id) { + if (id == "default") { + return false; + } + Logger* logger = base::utils::Registry::get(id); + if (logger != nullptr) { + unregister(logger); + } + return true; + } + + inline bool has(const std::string& id) { + return get(id, false) != nullptr; + } + + inline void unregister(Logger*& logger) { + base::threading::ScopedLock scopedLock(lock()); + base::utils::Registry::unregister(logger->id()); + } + + inline base::LogStreamsReferenceMap* logStreamsReference(void) { + return &m_logStreamsReference; + } + + inline void flushAll(void) { + ELPP_INTERNAL_INFO(1, "Flushing all log files"); + base::threading::ScopedLock scopedLock(lock()); + for (base::LogStreamsReferenceMap::iterator it = m_logStreamsReference.begin(); + it != m_logStreamsReference.end(); ++it) { + if (it->second.get() == nullptr) continue; + it->second->flush(); + } + } + + private: + LogBuilderPtr m_defaultLogBuilder; + Configurations m_defaultConfigurations; + base::LogStreamsReferenceMap m_logStreamsReference; + friend class el::base::Storage; + }; + /// @brief Represents registries for verbose logging + class VRegistry : base::NoCopy, public base::threading::ThreadSafe { + public: + explicit VRegistry(base::type::VerboseLevel level, base::type::EnumType* pFlags) : m_level(level), m_pFlags(pFlags) { + } + + /// @brief Sets verbose level. Accepted range is 0-9 + inline void setLevel(base::type::VerboseLevel level) { + base::threading::ScopedLock scopedLock(lock()); + if (level < 0) + m_level = 0; + else if (level > 9) + m_level = base::consts::kMaxVerboseLevel; + else + m_level = level; + } + + inline base::type::VerboseLevel level(void) const { + return m_level; + } + + inline void clearModules(void) { + base::threading::ScopedLock scopedLock(lock()); + m_modules.clear(); + } + + void setModules(const char* modules) { + base::threading::ScopedLock scopedLock(lock()); + auto addSuffix = [](std::stringstream& ss, const char* sfx, const char* prev) { + if (prev != nullptr && base::utils::Str::endsWith(ss.str(), std::string(prev))) { + std::string chr(ss.str().substr(0, ss.str().size() - strlen(prev))); + ss.str(std::string("")); + ss << chr; + } + if (base::utils::Str::endsWith(ss.str(), std::string(sfx))) { + std::string chr(ss.str().substr(0, ss.str().size() - strlen(sfx))); + ss.str(std::string("")); + ss << chr; + } + ss << sfx; + }; + auto insert = [&](std::stringstream& ss, base::type::VerboseLevel level) { + if (!base::utils::hasFlag(LoggingFlag::DisableVModulesExtensions, *m_pFlags)) { + addSuffix(ss, ".h", nullptr); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".c", ".h"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".cpp", ".c"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".cc", ".cpp"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".cxx", ".cc"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".-inl.h", ".cxx"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".hxx", ".-inl.h"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".hpp", ".hxx"); + m_modules.insert(std::make_pair(ss.str(), level)); + addSuffix(ss, ".hh", ".hpp"); + } + m_modules.insert(std::make_pair(ss.str(), level)); + }; + bool isMod = true; + bool isLevel = false; + std::stringstream ss; + int level = -1; + for (; *modules; ++modules) { + switch (*modules) { + case '=': + isLevel = true; + isMod = false; + break; + case ',': + isLevel = false; + isMod = true; + if (!ss.str().empty() && level != -1) { + insert(ss, level); + ss.str(std::string("")); + level = -1; + } + break; + default: + if (isMod) { + ss << *modules; + } + else if (isLevel) { + if (isdigit(*modules)) { + level = static_cast(*modules) - 48; + } + } + break; + } + } + if (!ss.str().empty() && level != -1) { + insert(ss, level); + } + } + + bool allowed(base::type::VerboseLevel vlevel, const char* file) { + base::threading::ScopedLock scopedLock(lock()); + if (m_modules.empty() || file == nullptr) { + return vlevel <= m_level; + } + else { + std::map::iterator it = m_modules.begin(); + for (; it != m_modules.end(); ++it) { + if (base::utils::Str::wildCardMatch(file, it->first.c_str())) { + return vlevel <= it->second; + } + } + if (base::utils::hasFlag(LoggingFlag::AllowVerboseIfModuleNotSpecified, *m_pFlags)) { + return true; + } + return false; + } + } + + inline const std::map& modules(void) const { + return m_modules; + } + + void setFromArgs(const base::utils::CommandLineArgs* commandLineArgs) { + if (commandLineArgs->hasParam("-v") || commandLineArgs->hasParam("--verbose") || + commandLineArgs->hasParam("-V") || commandLineArgs->hasParam("--VERBOSE")) { + setLevel(base::consts::kMaxVerboseLevel); + } + else if (commandLineArgs->hasParamWithValue("--v")) { + setLevel(atoi(commandLineArgs->getParamValue("--v"))); + } + else if (commandLineArgs->hasParamWithValue("--V")) { + setLevel(atoi(commandLineArgs->getParamValue("--V"))); + } + else if ((commandLineArgs->hasParamWithValue("-vmodule")) && vModulesEnabled()) { + setModules(commandLineArgs->getParamValue("-vmodule")); + } + else if (commandLineArgs->hasParamWithValue("-VMODULE") && vModulesEnabled()) { + setModules(commandLineArgs->getParamValue("-VMODULE")); + } + } + + /// @brief Whether or not vModules enabled + inline bool vModulesEnabled(void) { + return !base::utils::hasFlag(LoggingFlag::DisableVModules, *m_pFlags); + } + + private: + base::type::VerboseLevel m_level; + base::type::EnumType* m_pFlags; + std::map m_modules; + }; + } // namespace base + class LogMessage { + public: + LogMessage(Level level, const std::string& file, unsigned long int line, const std::string& func, + base::type::VerboseLevel verboseLevel, Logger* logger) : + m_level(level), m_file(file), m_line(line), m_func(func), + m_verboseLevel(verboseLevel), m_logger(logger), m_message(std::move(logger->stream().str())) { + } + inline Level level(void) const { return m_level; } + inline const std::string& file(void) const { return m_file; } + inline unsigned long int line(void) const { return m_line; } // NOLINT + inline const std::string& func(void) const { return m_func; } + inline base::type::VerboseLevel verboseLevel(void) const { return m_verboseLevel; } + inline Logger* logger(void) const { return m_logger; } + inline const base::type::string_t& message(void) const { return m_message; } + private: + Level m_level; + std::string m_file; + unsigned long int m_line; + std::string m_func; + base::type::VerboseLevel m_verboseLevel; + Logger* m_logger; + base::type::string_t m_message; + }; + namespace base { +#if ELPP_ASYNC_LOGGING + class AsyncLogItem { + public: + explicit AsyncLogItem(const LogMessage& logMessage, const LogDispatchData& data, const base::type::string_t& logLine) + : m_logMessage(logMessage), m_dispatchData(data), m_logLine(logLine) {} + virtual ~AsyncLogItem() {} + inline LogMessage* logMessage(void) { return &m_logMessage; } + inline LogDispatchData* data(void) { return &m_dispatchData; } + inline base::type::string_t logLine(void) { return m_logLine; } + private: + LogMessage m_logMessage; + LogDispatchData m_dispatchData; + base::type::string_t m_logLine; + }; + class AsyncLogQueue : public base::threading::ThreadSafe { + public: + virtual ~AsyncLogQueue() { + ELPP_INTERNAL_INFO(6, "~AsyncLogQueue"); + } + + inline AsyncLogItem next(void) { + base::threading::ScopedLock scopedLock(lock()); + AsyncLogItem result = m_queue.front(); + m_queue.pop(); + return result; + } + + inline void push(const AsyncLogItem& item) { + base::threading::ScopedLock scopedLock(lock()); + m_queue.push(item); + } + inline void pop(void) { + base::threading::ScopedLock scopedLock(lock()); + m_queue.pop(); + } + inline AsyncLogItem front(void) { + base::threading::ScopedLock scopedLock(lock()); + return m_queue.front(); + } + inline bool empty(void) { + base::threading::ScopedLock scopedLock(lock()); + return m_queue.empty(); + } + private: + std::queue m_queue; + }; + class IWorker { + public: + virtual ~IWorker() {} + virtual void start() = 0; + }; +#endif // ELPP_ASYNC_LOGGING + /// @brief Easylogging++ management storage + class Storage : base::NoCopy, public base::threading::ThreadSafe { + public: +#if ELPP_ASYNC_LOGGING + Storage(const LogBuilderPtr& defaultLogBuilder, base::IWorker* asyncDispatchWorker) : +#else + explicit Storage(const LogBuilderPtr& defaultLogBuilder) : +#endif // ELPP_ASYNC_LOGGING + m_registeredHitCounters(new base::RegisteredHitCounters()), + m_registeredLoggers(new base::RegisteredLoggers(defaultLogBuilder)), + m_flags(0x0), + m_vRegistry(new base::VRegistry(0, &m_flags)), +#if ELPP_ASYNC_LOGGING + m_asyncLogQueue(new base::AsyncLogQueue()), + m_asyncDispatchWorker(asyncDispatchWorker), +#endif // ELPP_ASYNC_LOGGING + m_preRollOutCallback(base::defaultPreRollOutCallback) { + // Register default logger + m_registeredLoggers->get(std::string(base::consts::kDefaultLoggerId)); + // Register performance logger and reconfigure format + Logger* performanceLogger = m_registeredLoggers->get(std::string(base::consts::kPerformanceLoggerId)); + performanceLogger->configurations()->setGlobally(ConfigurationType::Format, std::string("%datetime %level %msg")); + performanceLogger->reconfigure(); +#if defined(ELPP_SYSLOG) + // Register syslog logger and reconfigure format + Logger* sysLogLogger = m_registeredLoggers->get(std::string(base::consts::kSysLogLoggerId)); + sysLogLogger->configurations()->setGlobally(ConfigurationType::Format, std::string("%level: %msg")); + sysLogLogger->reconfigure(); +#else + ELPP_UNUSED(base::consts::kSysLogLoggerId); +#endif // defined(ELPP_SYSLOG) + addFlag(LoggingFlag::AllowVerboseIfModuleNotSpecified); +#if ELPP_ASYNC_LOGGING + installLogDispatchCallback(std::string("AsyncLogDispatchCallback")); +#else + installLogDispatchCallback(std::string("DefaultLogDispatchCallback")); +#endif // ELPP_ASYNC_LOGGING + installPerformanceTrackingCallback(std::string("DefaultPerformanceTrackingCallback")); + ELPP_INTERNAL_INFO(1, "Easylogging++ has been initialized"); +#if ELPP_ASYNC_LOGGING + m_asyncDispatchWorker->start(); +#endif // ELPP_ASYNC_LOGGING + } + + virtual ~Storage(void) { + ELPP_INTERNAL_INFO(4, "Destroying storage"); +#if ELPP_ASYNC_LOGGING + ELPP_INTERNAL_INFO(5, "Replacing log dispatch callback to synchronous"); + uninstallLogDispatchCallback(std::string("AsyncLogDispatchCallback")); + installLogDispatchCallback(std::string("DefaultLogDispatchCallback")); + ELPP_INTERNAL_INFO(5, "Destroying asyncDispatchWorker"); + base::utils::safeDelete(m_asyncDispatchWorker); + ELPP_INTERNAL_INFO(5, "Destroying asyncLogQueue"); + base::utils::safeDelete(m_asyncLogQueue); +#endif // ELPP_ASYNC_LOGGING + ELPP_INTERNAL_INFO(5, "Destroying registeredHitCounters"); + base::utils::safeDelete(m_registeredHitCounters); + ELPP_INTERNAL_INFO(5, "Destroying registeredLoggers"); + base::utils::safeDelete(m_registeredLoggers); + ELPP_INTERNAL_INFO(5, "Destroying vRegistry"); + base::utils::safeDelete(m_vRegistry); + } + + inline bool validateEveryNCounter(const char* filename, unsigned long int lineNumber, std::size_t occasion) { + return hitCounters()->validateEveryN(filename, lineNumber, occasion); + } + + inline bool validateAfterNCounter(const char* filename, unsigned long int lineNumber, std::size_t n) { // NOLINT + return hitCounters()->validateAfterN(filename, lineNumber, n); + } + + inline bool validateNTimesCounter(const char* filename, unsigned long int lineNumber, std::size_t n) { // NOLINT + return hitCounters()->validateNTimes(filename, lineNumber, n); + } + + inline base::RegisteredHitCounters* hitCounters(void) const { + return m_registeredHitCounters; + } + + inline base::RegisteredLoggers* registeredLoggers(void) const { + return m_registeredLoggers; + } + + inline base::VRegistry* vRegistry(void) const { + return m_vRegistry; + } + +#if ELPP_ASYNC_LOGGING + inline base::AsyncLogQueue* asyncLogQueue(void) const { + return m_asyncLogQueue; + } +#endif // ELPP_ASYNC_LOGGING + + inline const base::utils::CommandLineArgs* commandLineArgs(void) const { + return &m_commandLineArgs; + } + + inline void addFlag(LoggingFlag flag) { + base::utils::addFlag(flag, &m_flags); + } + + inline void removeFlag(LoggingFlag flag) { + base::utils::removeFlag(flag, &m_flags); + } + + inline bool hasFlag(LoggingFlag flag) const { + return base::utils::hasFlag(flag, m_flags); + } + + inline base::type::EnumType flags(void) const { + return m_flags; + } + + inline void setFlags(base::type::EnumType flags) { + m_flags = flags; + } + + inline void setPreRollOutCallback(const PreRollOutCallback& callback) { + m_preRollOutCallback = callback; + } + + inline void unsetPreRollOutCallback(void) { + m_preRollOutCallback = base::defaultPreRollOutCallback; + } + + inline PreRollOutCallback& preRollOutCallback(void) { + return m_preRollOutCallback; + } + + inline bool hasCustomFormatSpecifier(const char* formatSpecifier) { + base::threading::ScopedLock scopedLock(lock()); + return std::find(m_customFormatSpecifiers.begin(), m_customFormatSpecifiers.end(), + formatSpecifier) != m_customFormatSpecifiers.end(); + } + + inline void installCustomFormatSpecifier(const CustomFormatSpecifier& customFormatSpecifier) { + if (hasCustomFormatSpecifier(customFormatSpecifier.formatSpecifier())) { + return; + } + base::threading::ScopedLock scopedLock(lock()); + m_customFormatSpecifiers.push_back(customFormatSpecifier); + } + + inline bool uninstallCustomFormatSpecifier(const char* formatSpecifier) { + base::threading::ScopedLock scopedLock(lock()); + std::vector::iterator it = std::find(m_customFormatSpecifiers.begin(), + m_customFormatSpecifiers.end(), formatSpecifier); + if (it != m_customFormatSpecifiers.end() && strcmp(formatSpecifier, it->formatSpecifier()) == 0) { + m_customFormatSpecifiers.erase(it); + return true; + } + return false; + } + + const std::vector* customFormatSpecifiers(void) const { + return &m_customFormatSpecifiers; + } + + inline void setLoggingLevel(Level level) { + m_loggingLevel = level; + } + + template + inline bool installLogDispatchCallback(const std::string& id) { + return installCallback(id, &m_logDispatchCallbacks); + } + + template + inline void uninstallLogDispatchCallback(const std::string& id) { + uninstallCallback(id, &m_logDispatchCallbacks); + } + template + inline T* logDispatchCallback(const std::string& id) { + return callback(id, &m_logDispatchCallbacks); + } + + template + inline bool installPerformanceTrackingCallback(const std::string& id) { + return installCallback(id, &m_performanceTrackingCallbacks); + } + + template + inline void uninstallPerformanceTrackingCallback(const std::string& id) { + uninstallCallback(id, &m_performanceTrackingCallbacks); + } + + template + inline T* performanceTrackingCallback(const std::string& id) { + return callback(id, &m_performanceTrackingCallbacks); + } + private: + base::RegisteredHitCounters* m_registeredHitCounters; + base::RegisteredLoggers* m_registeredLoggers; + base::type::EnumType m_flags; + base::VRegistry* m_vRegistry; +#if ELPP_ASYNC_LOGGING + base::AsyncLogQueue* m_asyncLogQueue; + base::IWorker* m_asyncDispatchWorker; +#endif // ELPP_ASYNC_LOGGING + base::utils::CommandLineArgs m_commandLineArgs; + PreRollOutCallback m_preRollOutCallback; + std::map m_logDispatchCallbacks; + std::map m_performanceTrackingCallbacks; + std::vector m_customFormatSpecifiers; + Level m_loggingLevel; + + friend class el::Helpers; + friend class el::base::DefaultLogDispatchCallback; + friend class el::LogBuilder; + friend class el::base::MessageBuilder; + friend class el::base::Writer; + friend class el::base::PerformanceTracker; + friend class el::base::LogDispatcher; + + void setApplicationArguments(int argc, char** argv) { + m_commandLineArgs.setArgs(argc, argv); + m_vRegistry->setFromArgs(commandLineArgs()); + // default log file +#if !defined(ELPP_DISABLE_LOG_FILE_FROM_ARG) + if (m_commandLineArgs.hasParamWithValue(base::consts::kDefaultLogFileParam)) { + Configurations c; + c.setGlobally(ConfigurationType::Filename, std::string(m_commandLineArgs.getParamValue(base::consts::kDefaultLogFileParam))); + registeredLoggers()->setDefaultConfigurations(c); + for (base::RegisteredLoggers::iterator it = registeredLoggers()->begin(); + it != registeredLoggers()->end(); ++it) { + it->second->configure(c); + } + } +#endif // !defined(ELPP_DISABLE_LOG_FILE_FROM_ARG) +#if defined(ELPP_LOGGING_FLAGS_FROM_ARG) + if (m_commandLineArgs.hasParamWithValue(base::consts::kLoggingFlagsParam)) { + m_flags = atoi(m_commandLineArgs.getParamValue(base::consts::kLoggingFlagsParam)); + } +#endif // defined(ELPP_LOGGING_FLAGS_FROM_ARG) + } + + inline void setApplicationArguments(int argc, const char** argv) { + setApplicationArguments(argc, const_cast(argv)); + } + + template + inline bool installCallback(const std::string& id, std::map* mapT) { + if (mapT->find(id) == mapT->end()) { + mapT->insert(std::make_pair(id, TPtr(new T()))); + return true; + } + return false; + } + + template + inline void uninstallCallback(const std::string& id, std::map* mapT) { + if (mapT->find(id) != mapT->end()) { + mapT->erase(id); + } + } + + template + inline T* callback(const std::string& id, std::map* mapT) { + typename std::map::iterator iter = mapT->find(id); + if (iter != mapT->end()) { + return static_cast(iter->second.get()); + } + return nullptr; + } + }; + extern ELPP_EXPORT base::type::StoragePointer elStorage; +#define ELPP el::base::elStorage + class DefaultLogDispatchCallback : public LogDispatchCallback { + protected: + void handle(const LogDispatchData* data) { + m_data = data; + dispatch(std::move(m_data->logMessage()->logger()->logBuilder()->build(m_data->logMessage(), + m_data->dispatchAction() == base::DispatchAction::NormalLog))); + } + private: + const LogDispatchData* m_data; + void dispatch(base::type::string_t&& logLine) { + if (m_data->dispatchAction() == base::DispatchAction::NormalLog) { + if (m_data->logMessage()->logger()->m_typedConfigurations->toFile(m_data->logMessage()->level())) { + base::type::fstream_t* fs = m_data->logMessage()->logger()->m_typedConfigurations->fileStream(m_data->logMessage()->level()); + if (fs != nullptr) { + fs->write(logLine.c_str(), logLine.size()); + if (fs->fail()) { + ELPP_INTERNAL_ERROR("Unable to write log to file [" + << m_data->logMessage()->logger()->m_typedConfigurations->filename(m_data->logMessage()->level()) << "].\n" + << "Few possible reasons (could be something else):\n" << " * Permission denied\n" + << " * Disk full\n" << " * Disk is not writable", true); + } + else { + if (ELPP->hasFlag(LoggingFlag::ImmediateFlush) || (m_data->logMessage()->logger()->isFlushNeeded(m_data->logMessage()->level()))) { + m_data->logMessage()->logger()->flush(m_data->logMessage()->level(), fs); + } + } + } + else { + ELPP_INTERNAL_ERROR("Log file for [" << LevelHelper::convertToString(m_data->logMessage()->level()) << "] " + << "has not been configured but [TO_FILE] is configured to TRUE. [Logger ID: " + << m_data->logMessage()->logger()->id() << "]", false); + } + } + if (m_data->logMessage()->logger()->m_typedConfigurations->toStandardOutput(m_data->logMessage()->level())) { + if (ELPP->hasFlag(LoggingFlag::ColoredTerminalOutput)) + m_data->logMessage()->logger()->logBuilder()->convertToColoredOutput(&logLine, m_data->logMessage()->level()); + ELPP_COUT << ELPP_COUT_LINE(logLine); + } + } +#if defined(ELPP_SYSLOG) + else if (m_data->dispatchAction() == base::DispatchAction::SysLog) { + // Determine syslog priority + int sysLogPriority = 0; + if (m_data->logMessage()->level() == Level::Fatal) + sysLogPriority = LOG_EMERG; + else if (m_data->logMessage()->level() == Level::Error) + sysLogPriority = LOG_ERR; + else if (m_data->logMessage()->level() == Level::Warning) + sysLogPriority = LOG_WARNING; + else if (m_data->logMessage()->level() == Level::Info) + sysLogPriority = LOG_INFO; + else if (m_data->logMessage()->level() == Level::Debug) + sysLogPriority = LOG_DEBUG; + else + sysLogPriority = LOG_NOTICE; +# if defined(ELPP_UNICODE) + char* line = base::utils::Str::wcharPtrToCharPtr(logLine.c_str()); + syslog(sysLogPriority, "%s", line); + free(line); +# else + syslog(sysLogPriority, "%s", logLine.c_str()); +# endif + } +#endif // defined(ELPP_SYSLOG) + } + }; +#if ELPP_ASYNC_LOGGING + class AsyncLogDispatchCallback : public LogDispatchCallback { + protected: + void handle(const LogDispatchData* data) { + base::type::string_t logLine = data->logMessage()->logger()->logBuilder()->build(data->logMessage(), data->dispatchAction() == base::DispatchAction::NormalLog); + if (data->dispatchAction() == base::DispatchAction::NormalLog && data->logMessage()->logger()->typedConfigurations()->toStandardOutput(data->logMessage()->level())) { + if (ELPP->hasFlag(LoggingFlag::ColoredTerminalOutput)) + data->logMessage()->logger()->logBuilder()->convertToColoredOutput(&logLine, data->logMessage()->level()); + ELPP_COUT << ELPP_COUT_LINE(logLine); + } + // Save resources and only queue if we want to write to file otherwise just ignore handler + if (data->logMessage()->logger()->typedConfigurations()->toFile(data->logMessage()->level())) { + ELPP->asyncLogQueue()->push(AsyncLogItem(*(data->logMessage()), *data, logLine)); + } + } + }; + class AsyncDispatchWorker : public base::IWorker, public base::threading::ThreadSafe { + public: + AsyncDispatchWorker() { + setContinueRunning(false); + } + + virtual ~AsyncDispatchWorker() { + setContinueRunning(false); + ELPP_INTERNAL_INFO(6, "Stopping dispatch worker - Cleaning log queue"); + clean(); + ELPP_INTERNAL_INFO(6, "Log queue cleaned"); + } + + inline bool clean() { + std::mutex m; + std::unique_lock lk(m); + cv.wait(lk, [] { return !ELPP->asyncLogQueue()->empty(); }); + emptyQueue(); + lk.unlock(); + cv.notify_one(); + return ELPP->asyncLogQueue()->empty(); + } + + inline void emptyQueue() { + while (!ELPP->asyncLogQueue()->empty()) { + AsyncLogItem data = ELPP->asyncLogQueue()->next(); + handle(&data); + base::threading::msleep(100); + } + } + + virtual inline void start() { + base::threading::msleep(5000); // Wait extra few seconds + setContinueRunning(true); + std::thread t1(&AsyncDispatchWorker::runner, this); + t1.join(); + } + + void handle(AsyncLogItem* logItem) { + LogDispatchData* data = logItem->data(); + LogMessage* logMessage = logItem->logMessage(); + Logger* logger = logMessage->logger(); + base::TypedConfigurations* conf = logger->typedConfigurations(); + base::type::string_t logLine = logItem->logLine(); + if (data->dispatchAction() == base::DispatchAction::NormalLog) { + if (conf->toFile(logMessage->level())) { + base::type::fstream_t* fs = conf->fileStream(logMessage->level()); + if (fs != nullptr) { + fs->write(logLine.c_str(), logLine.size()); + if (fs->fail()) { + ELPP_INTERNAL_ERROR("Unable to write log to file [" + << conf->filename(logMessage->level()) << "].\n" + << "Few possible reasons (could be something else):\n" << " * Permission denied\n" + << " * Disk full\n" << " * Disk is not writable", true); + } + else { + if (ELPP->hasFlag(LoggingFlag::ImmediateFlush) || (logger->isFlushNeeded(logMessage->level()))) { + logger->flush(logMessage->level(), fs); + } + } + } + else { + ELPP_INTERNAL_ERROR("Log file for [" << LevelHelper::convertToString(logMessage->level()) << "] " + << "has not been configured but [TO_FILE] is configured to TRUE. [Logger ID: " << logger->id() << "]", false); + } + } + } +# if defined(ELPP_SYSLOG) + else if (data->dispatchAction() == base::DispatchAction::SysLog) { + // Determine syslog priority + int sysLogPriority = 0; + if (logMessage->level() == Level::Fatal) + sysLogPriority = LOG_EMERG; + else if (logMessage->level() == Level::Error) + sysLogPriority = LOG_ERR; + else if (logMessage->level() == Level::Warning) + sysLogPriority = LOG_WARNING; + else if (logMessage->level() == Level::Info) + sysLogPriority = LOG_INFO; + else if (logMessage->level() == Level::Debug) + sysLogPriority = LOG_DEBUG; + else + sysLogPriority = LOG_NOTICE; +# if defined(ELPP_UNICODE) + char* line = base::utils::Str::wcharPtrToCharPtr(logLine.c_str()); + syslog(sysLogPriority, "%s", line); + free(line); +# else + syslog(sysLogPriority, "%s", logLine.c_str()); +# endif + } +# endif // defined(ELPP_SYSLOG) + } + + void run() { + while (continueRunning()) { + emptyQueue(); + base::threading::msleep(10); // 10ms + } + } + + static void* runner(void *context) { + static_cast(context)->run(); + return NULL; + } + + void setContinueRunning(bool value) { + base::threading::ScopedLock scopedLock(m_continueRunningMutex); + m_continueRunning = value; + } + bool continueRunning(void) { + return m_continueRunning; + } + private: + std::condition_variable cv; + bool m_continueRunning; + base::threading::Mutex m_continueRunningMutex; + }; +#endif // ELPP_ASYNC_LOGGING + } // namespace base + namespace base { + class DefaultLogBuilder : public LogBuilder { + public: + base::type::string_t build(const LogMessage* logMessage, bool appendNewLine) const { + base::TypedConfigurations* tc = logMessage->logger()->typedConfigurations(); + const base::LogFormat* logFormat = &tc->logFormat(logMessage->level()); + base::type::string_t logLine = logFormat->format(); + char buff[base::consts::kSourceFilenameMaxLength + base::consts::kSourceLineMaxLength] = ""; + const char* bufLim = buff + sizeof(buff); + if (logFormat->hasFlag(base::FormatFlags::AppName)) { + // App name + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kAppNameFormatSpecifier, + logMessage->logger()->parentApplicationName()); + } + if (logFormat->hasFlag(base::FormatFlags::ThreadId)) { + // Thread ID + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kThreadIdFormatSpecifier, + base::threading::getCurrentThreadId()); + } + if (logFormat->hasFlag(base::FormatFlags::DateTime)) { + // DateTime + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kDateTimeFormatSpecifier, + base::utils::DateTime::getDateTime(logFormat->dateTimeFormat().c_str(), + &tc->millisecondsWidth(logMessage->level()))); + } + if (logFormat->hasFlag(base::FormatFlags::Function)) { + // Function + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogFunctionFormatSpecifier, logMessage->func()); + } + if (logFormat->hasFlag(base::FormatFlags::File)) { + // File + char* buf = base::utils::Str::clearBuff(buff, base::consts::kSourceFilenameMaxLength); + base::utils::File::buildStrippedFilename(logMessage->file().c_str(), buff); + buf = base::utils::Str::addToBuff(buff, buf, bufLim); + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogFileFormatSpecifier, std::string(buff)); + } + if (logFormat->hasFlag(base::FormatFlags::FileBase)) { + // FileBase + char* buf = base::utils::Str::clearBuff(buff, base::consts::kSourceFilenameMaxLength); + base::utils::File::buildBaseFilename(logMessage->file(), buff); + buf = base::utils::Str::addToBuff(buff, buf, bufLim); + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogFileBaseFormatSpecifier, std::string(buff)); + } + if (logFormat->hasFlag(base::FormatFlags::Line)) { + // Line + char* buf = base::utils::Str::clearBuff(buff, base::consts::kSourceLineMaxLength); + buf = base::utils::Str::convertAndAddToBuff(logMessage->line(), + base::consts::kSourceLineMaxLength, buf, bufLim, false); + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogLineFormatSpecifier, std::string(buff)); + } + if (logFormat->hasFlag(base::FormatFlags::Location)) { + // Location + char* buf = base::utils::Str::clearBuff(buff, + base::consts::kSourceFilenameMaxLength + base::consts::kSourceLineMaxLength); + base::utils::File::buildStrippedFilename(logMessage->file().c_str(), buff); + buf = base::utils::Str::addToBuff(buff, buf, bufLim); + buf = base::utils::Str::addToBuff(":", buf, bufLim); + buf = base::utils::Str::convertAndAddToBuff(logMessage->line(), + base::consts::kSourceLineMaxLength, buf, bufLim, false); + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kLogLocationFormatSpecifier, std::string(buff)); + } + if (logMessage->level() == Level::Verbose && logFormat->hasFlag(base::FormatFlags::VerboseLevel)) { + // Verbose level + char* buf = base::utils::Str::clearBuff(buff, 1); + buf = base::utils::Str::convertAndAddToBuff(logMessage->verboseLevel(), 1, buf, bufLim, false); + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kVerboseLevelFormatSpecifier, std::string(buff)); + } + if (logFormat->hasFlag(base::FormatFlags::LogMessage)) { + // Log message + base::utils::Str::replaceFirstWithEscape(logLine, base::consts::kMessageFormatSpecifier, logMessage->message()); + } +#if !defined(ELPP_DISABLE_CUSTOM_FORMAT_SPECIFIERS) + for (std::vector::const_iterator it = ELPP->customFormatSpecifiers()->begin(); + it != ELPP->customFormatSpecifiers()->end(); ++it) { + std::string fs(it->formatSpecifier()); + base::type::string_t wcsFormatSpecifier(fs.begin(), fs.end()); + base::utils::Str::replaceFirstWithEscape(logLine, wcsFormatSpecifier, std::string(it->resolver()())); + } +#endif // !defined(ELPP_DISABLE_CUSTOM_FORMAT_SPECIFIERS) + if (appendNewLine) logLine += ELPP_LITERAL("\n"); + return logLine; + } + }; + /// @brief Dispatches log messages + class LogDispatcher : base::NoCopy { + public: + LogDispatcher(bool proceed, LogMessage&& logMessage, base::DispatchAction dispatchAction) : + m_proceed(proceed), + m_logMessage(std::move(logMessage)), + m_dispatchAction(std::move(dispatchAction)) { + } + + void dispatch(void) { + if (m_proceed && m_dispatchAction == base::DispatchAction::None) { + m_proceed = false; + } + if (!m_proceed) { + return; + } + // We minimize the time of ELPP's lock - this lock is released after log is written + base::threading::ScopedLock scopedLock(ELPP->lock()); + base::TypedConfigurations* tc = m_logMessage.logger()->m_typedConfigurations; + if (ELPP->hasFlag(LoggingFlag::StrictLogFileSizeCheck)) { + tc->validateFileRolling(m_logMessage.level(), ELPP->preRollOutCallback()); + } + LogDispatchCallback* callback = nullptr; + LogDispatchData data; + for (const std::pair& h + : ELPP->m_logDispatchCallbacks) { + callback = h.second.get(); + if (callback != nullptr && callback->enabled()) { + data.setLogMessage(&m_logMessage); + data.setDispatchAction(m_dispatchAction); + callback->acquireLock(); + callback->handle(&data); + callback->releaseLock(); + } + } + } + + private: + bool m_proceed; + LogMessage m_logMessage; + base::DispatchAction m_dispatchAction; + }; +#if defined(ELPP_STL_LOGGING) + /// @brief Workarounds to write some STL logs + /// + /// @detail There is workaround needed to loop through some stl containers. In order to do that, we need iterable containers + /// of same type and provide iterator interface and pass it on to writeIterator(). + /// Remember, this is passed by value in constructor so that we dont change original containers. + /// This operation is as expensive as Big-O(std::min(class_.size(), base::consts::kMaxLogPerContainer)) + namespace workarounds { + /// @brief Abstract IterableContainer template that provides interface for iterable classes of type T + template + class IterableContainer { + public: + typedef typename Container::iterator iterator; + typedef typename Container::const_iterator const_iterator; + IterableContainer(void) {} + virtual ~IterableContainer(void) {} + iterator begin(void) { return getContainer().begin(); } + iterator end(void) { return getContainer().end(); } + private: + virtual Container& getContainer(void) = 0; + }; + /// @brief Implements IterableContainer and provides iterable std::priority_queue class + template, typename Comparator = std::less> + class IterablePriorityQueue : public IterableContainer, public std::priority_queue { + public: + IterablePriorityQueue(std::priority_queue queue_) { + std::size_t count_ = 0; + while (++count_ < base::consts::kMaxLogPerContainer && !queue_.empty()) { + this->push(queue_.top()); + queue_.pop(); + } + } + private: + inline Container& getContainer(void) { + return this->c; + } + }; + /// @brief Implements IterableContainer and provides iterable std::queue class + template> + class IterableQueue : public IterableContainer, public std::queue { + public: + IterableQueue(std::queue queue_) { + std::size_t count_ = 0; + while (++count_ < base::consts::kMaxLogPerContainer && !queue_.empty()) { + this->push(queue_.front()); + queue_.pop(); + } + } + private: + inline Container& getContainer(void) { + return this->c; + } + }; + /// @brief Implements IterableContainer and provides iterable std::stack class + template> + class IterableStack : public IterableContainer, public std::stack { + public: + IterableStack(std::stack stack_) { + std::size_t count_ = 0; + while (++count_ < base::consts::kMaxLogPerContainer && !stack_.empty()) { + this->push(stack_.top()); + stack_.pop(); + } + } + private: + inline Container& getContainer(void) { + return this->c; + } + }; + } // namespace workarounds +#endif // defined(ELPP_STL_LOGGING) + // Log message builder + class MessageBuilder { + public: + MessageBuilder(void) : m_logger(nullptr), m_containerLogSeperator(ELPP_LITERAL("")) {} + void initialize(Logger* logger) { + m_logger = logger; + m_containerLogSeperator = ELPP->hasFlag(LoggingFlag::NewLineForContainer) ? + ELPP_LITERAL("\n ") : ELPP_LITERAL(", "); + } + +# define ELPP_SIMPLE_LOG(LOG_TYPE)\ + inline MessageBuilder& operator<<(LOG_TYPE msg) {\ + m_logger->stream() << msg;\ + if (ELPP->hasFlag(LoggingFlag::AutoSpacing)) {\ + m_logger->stream() << " ";\ + }\ + return *this;\ + } + + inline MessageBuilder& operator<<(const std::string& msg) { + return operator<<(msg.c_str()); + } + ELPP_SIMPLE_LOG(char) + ELPP_SIMPLE_LOG(bool) + ELPP_SIMPLE_LOG(signed short) + ELPP_SIMPLE_LOG(unsigned short) + ELPP_SIMPLE_LOG(signed int) + ELPP_SIMPLE_LOG(unsigned int) + ELPP_SIMPLE_LOG(signed long) + ELPP_SIMPLE_LOG(unsigned long) + ELPP_SIMPLE_LOG(float) + ELPP_SIMPLE_LOG(double) + ELPP_SIMPLE_LOG(char*) + ELPP_SIMPLE_LOG(const char*) + ELPP_SIMPLE_LOG(const void*) + ELPP_SIMPLE_LOG(long double) + inline MessageBuilder& operator<<(const std::wstring& msg) { + return operator<<(msg.c_str()); + } + inline MessageBuilder& operator<<(const wchar_t* msg) { + if (msg == nullptr) { + m_logger->stream() << base::consts::kNullPointer; + return *this; + } +# if defined(ELPP_UNICODE) + m_logger->stream() << msg; +# else + char* buff_ = base::utils::Str::wcharPtrToCharPtr(msg); + m_logger->stream() << buff_; + free(buff_); +# endif + if (ELPP->hasFlag(LoggingFlag::AutoSpacing)) { + m_logger->stream() << " "; + } + return *this; + } + // ostream manipulators + inline MessageBuilder& operator<<(std::ostream& (*OStreamMani)(std::ostream&)) { + m_logger->stream() << OStreamMani; + return *this; + } +#define ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(temp) \ + template \ + inline MessageBuilder& operator<<(const temp& template_inst) { \ + return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ + } +#define ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(temp) \ + template \ + inline MessageBuilder& operator<<(const temp& template_inst) { \ + return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ + } +#define ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(temp) \ + template \ + inline MessageBuilder& operator<<(const temp& template_inst) { \ + return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ + } +#define ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(temp) \ + template \ + inline MessageBuilder& operator<<(const temp& template_inst) { \ + return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ + } +#define ELPP_ITERATOR_CONTAINER_LOG_FIVE_ARG(temp) \ + template \ + inline MessageBuilder& operator<<(const temp& template_inst) { \ + return writeIterator(template_inst.begin(), template_inst.end(), template_inst.size()); \ + } + +#if defined(ELPP_STL_LOGGING) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(std::vector) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(std::list) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(std::deque) + ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(std::set) + ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(std::multiset) + ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(std::map) + ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(std::multimap) + template + inline MessageBuilder& operator<<(const std::queue& queue_) { + base::workarounds::IterableQueue iterableQueue_ = + static_cast >(queue_); + return writeIterator(iterableQueue_.begin(), iterableQueue_.end(), iterableQueue_.size()); + } + template + inline MessageBuilder& operator<<(const std::stack& stack_) { + base::workarounds::IterableStack iterableStack_ = + static_cast >(stack_); + return writeIterator(iterableStack_.begin(), iterableStack_.end(), iterableStack_.size()); + } + template + inline MessageBuilder& operator<<(const std::priority_queue& priorityQueue_) { + base::workarounds::IterablePriorityQueue iterablePriorityQueue_ = + static_cast >(priorityQueue_); + return writeIterator(iterablePriorityQueue_.begin(), iterablePriorityQueue_.end(), iterablePriorityQueue_.size()); + } + template + inline MessageBuilder& operator<<(const std::pair& pair_) { + m_logger->stream() << ELPP_LITERAL("("); + operator << (static_cast(pair_.first)); + m_logger->stream() << ELPP_LITERAL(", "); + operator << (static_cast(pair_.second)); + m_logger->stream() << ELPP_LITERAL(")"); + return *this; + } + template + inline MessageBuilder& operator<<(const std::bitset& bitset_) { + m_logger->stream() << ELPP_LITERAL("["); + operator << (bitset_.to_string()); + m_logger->stream() << ELPP_LITERAL("]"); + return *this; + } +# if defined(ELPP_LOG_STD_ARRAY) + template + inline MessageBuilder& operator<<(const std::array& array) { + return writeIterator(array.begin(), array.end(), array.size()); + } +# endif // defined(ELPP_LOG_STD_ARRAY) +# if defined(ELPP_LOG_UNORDERED_MAP) + ELPP_ITERATOR_CONTAINER_LOG_FIVE_ARG(std::unordered_map) + ELPP_ITERATOR_CONTAINER_LOG_FIVE_ARG(std::unordered_multimap) +# endif // defined(ELPP_LOG_UNORDERED_MAP) +# if defined(ELPP_LOG_UNORDERED_SET) + ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(std::unordered_set) + ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(std::unordered_multiset) +# endif // defined(ELPP_LOG_UNORDERED_SET) +#endif // defined(ELPP_STL_LOGGING) +#if defined(ELPP_QT_LOGGING) + inline MessageBuilder& operator<<(const QString& msg) { +# if defined(ELPP_UNICODE) + m_logger->stream() << msg.toStdWString(); +# else + m_logger->stream() << msg.toStdString(); +# endif // defined(ELPP_UNICODE) + return *this; + } + inline MessageBuilder& operator<<(const QByteArray& msg) { + return operator << (QString(msg)); + } + inline MessageBuilder& operator<<(const QStringRef& msg) { + return operator<<(msg.toString()); + } + inline MessageBuilder& operator<<(qint64 msg) { +# if defined(ELPP_UNICODE) + m_logger->stream() << QString::number(msg).toStdWString(); +# else + m_logger->stream() << QString::number(msg).toStdString(); +# endif // defined(ELPP_UNICODE) + return *this; + } + inline MessageBuilder& operator<<(quint64 msg) { +# if defined(ELPP_UNICODE) + m_logger->stream() << QString::number(msg).toStdWString(); +# else + m_logger->stream() << QString::number(msg).toStdString(); +# endif // defined(ELPP_UNICODE) + return *this; + } + inline MessageBuilder& operator<<(QChar msg) { + m_logger->stream() << msg.toLatin1(); + return *this; + } + inline MessageBuilder& operator<<(const QLatin1String& msg) { + m_logger->stream() << msg.latin1(); + return *this; + } + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QList) + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QVector) + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QQueue) + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QSet) + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QLinkedList) + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(QStack) + template + inline MessageBuilder& operator<<(const QPair& pair_) { + m_logger->stream() << ELPP_LITERAL("("); + operator << (static_cast(pair_.first)); + m_logger->stream() << ELPP_LITERAL(", "); + operator << (static_cast(pair_.second)); + m_logger->stream() << ELPP_LITERAL(")"); + return *this; + } + template + inline MessageBuilder& operator<<(const QMap& map_) { + m_logger->stream() << ELPP_LITERAL("["); + QList keys = map_.keys(); + typename QList::const_iterator begin = keys.begin(); + typename QList::const_iterator end = keys.end(); + int max_ = static_cast(base::consts::kMaxLogPerContainer); // to prevent warning + for (int index_ = 0; begin != end && index_ < max_; ++index_, ++begin) { + m_logger->stream() << ELPP_LITERAL("("); + operator << (static_cast(*begin)); + m_logger->stream() << ELPP_LITERAL(", "); + operator << (static_cast(map_.value(*begin))); + m_logger->stream() << ELPP_LITERAL(")"); + m_logger->stream() << ((index_ < keys.size() - 1) ? m_containerLogSeperator : ELPP_LITERAL("")); + } + if (begin != end) { + m_logger->stream() << ELPP_LITERAL("..."); + } + m_logger->stream() << ELPP_LITERAL("]"); + return *this; + } + template + inline MessageBuilder& operator<<(const QMultiMap& map_) { + operator << (static_cast>(map_)); + return *this; + } + template + inline MessageBuilder& operator<<(const QHash& hash_) { + m_logger->stream() << ELPP_LITERAL("["); + QList keys = hash_.keys(); + typename QList::const_iterator begin = keys.begin(); + typename QList::const_iterator end = keys.end(); + int max_ = static_cast(base::consts::kMaxLogPerContainer); // prevent type warning + for (int index_ = 0; begin != end && index_ < max_; ++index_, ++begin) { + m_logger->stream() << ELPP_LITERAL("("); + operator << (static_cast(*begin)); + m_logger->stream() << ELPP_LITERAL(", "); + operator << (static_cast(hash_.value(*begin))); + m_logger->stream() << ELPP_LITERAL(")"); + m_logger->stream() << ((index_ < keys.size() - 1) ? m_containerLogSeperator : ELPP_LITERAL("")); + } + if (begin != end) { + m_logger->stream() << ELPP_LITERAL("..."); + } + m_logger->stream() << ELPP_LITERAL("]"); + return *this; + } + template + inline MessageBuilder& operator<<(const QMultiHash& multiHash_) { + operator << (static_cast>(multiHash_)); + return *this; + } +#endif // defined(ELPP_QT_LOGGING) +#if defined(ELPP_BOOST_LOGGING) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(boost::container::vector) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(boost::container::stable_vector) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(boost::container::list) + ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG(boost::container::deque) + ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(boost::container::map) + ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG(boost::container::flat_map) + ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(boost::container::set) + ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG(boost::container::flat_set) +#endif // defined(ELPP_BOOST_LOGGING) + + /// @brief Macro used internally that can be used externally to make containers easylogging++ friendly + /// + /// @detail This macro expands to write an ostream& operator<< for container. This container is expected to + /// have begin() and end() methods that return respective iterators + /// @param ContainerType Type of container e.g, MyList from WX_DECLARE_LIST(int, MyList); in wxwidgets + /// @param SizeMethod Method used to get size of container. + /// @param ElementInstance Instance of element to be fed out. Insance name is "elem". See WXELPP_ENABLED macro + /// for an example usage +#define MAKE_CONTAINERELPP_FRIENDLY(ContainerType, SizeMethod, ElementInstance) \ + el::base::type::ostream_t& operator<<(el::base::type::ostream_t& ss, const ContainerType& container) {\ + const el::base::type::char_t* sep = ELPP->hasFlag(el::LoggingFlag::NewLineForContainer) ? \ + ELPP_LITERAL("\n ") : ELPP_LITERAL(", ");\ + ContainerType::const_iterator elem = container.begin();\ + ContainerType::const_iterator endElem = container.end();\ + std::size_t size_ = container.SizeMethod; \ + ss << ELPP_LITERAL("[");\ + for (std::size_t i = 0; elem != endElem && i < el::base::consts::kMaxLogPerContainer; ++i, ++elem) { \ + ss << ElementInstance;\ + ss << ((i < size_ - 1) ? sep : ELPP_LITERAL(""));\ + }\ + if (elem != endElem) {\ + ss << ELPP_LITERAL("...");\ + }\ + ss << ELPP_LITERAL("]");\ + return ss;\ + } +#if defined(ELPP_WXWIDGETS_LOGGING) + ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG(wxVector) +# define ELPP_WX_PTR_ENABLED(ContainerType) MAKE_CONTAINERELPP_FRIENDLY(ContainerType, size(), *(*elem)) +# define ELPP_WX_ENABLED(ContainerType) MAKE_CONTAINERELPP_FRIENDLY(ContainerType, size(), (*elem)) +# define ELPP_WX_HASH_MAP_ENABLED(ContainerType) MAKE_CONTAINERELPP_FRIENDLY(ContainerType, size(), \ + ELPP_LITERAL("(") << elem->first << ELPP_LITERAL(", ") << elem->second << ELPP_LITERAL(")") +#else +# define ELPP_WX_PTR_ENABLED(ContainerType) +# define ELPP_WX_ENABLED(ContainerType) +# define ELPP_WX_HASH_MAP_ENABLED(ContainerType) +#endif // defined(ELPP_WXWIDGETS_LOGGING) + // Other classes + template + ELPP_SIMPLE_LOG(const Class&) +#undef ELPP_SIMPLE_LOG +#undef ELPP_ITERATOR_CONTAINER_LOG_ONE_ARG +#undef ELPP_ITERATOR_CONTAINER_LOG_TWO_ARG +#undef ELPP_ITERATOR_CONTAINER_LOG_THREE_ARG +#undef ELPP_ITERATOR_CONTAINER_LOG_FOUR_ARG +#undef ELPP_ITERATOR_CONTAINER_LOG_FIVE_ARG + private: + Logger* m_logger; + const base::type::char_t* m_containerLogSeperator; + + template + inline MessageBuilder& writeIterator(Iterator begin_, Iterator end_, std::size_t size_) { + m_logger->stream() << ELPP_LITERAL("["); + for (std::size_t i = 0; begin_ != end_ && i < base::consts::kMaxLogPerContainer; ++i, ++begin_) { + operator << (*begin_); + m_logger->stream() << ((i < size_ - 1) ? m_containerLogSeperator : ELPP_LITERAL("")); + } + if (begin_ != end_) { + m_logger->stream() << ELPP_LITERAL("..."); + } + m_logger->stream() << ELPP_LITERAL("]"); + if (ELPP->hasFlag(LoggingFlag::AutoSpacing)) { + m_logger->stream() << " "; + } + return *this; + } + }; + /// @brief Writes nothing - Used when certain log is disabled + class NullWriter : base::NoCopy { + public: + NullWriter(void) {} + + // Null manipulator + inline NullWriter& operator<<(std::ostream& (*)(std::ostream&)) { + return *this; + } + + template + inline NullWriter& operator<<(const T&) { + return *this; + } + }; + /// @brief Main entry point of each logging + class Writer : base::NoCopy { + public: + Writer(Level level, const char* file, unsigned long int line, + const char* func, base::DispatchAction dispatchAction = base::DispatchAction::NormalLog, + base::type::VerboseLevel verboseLevel = 0) : + m_level(level), m_file(file), m_line(line), m_func(func), m_verboseLevel(verboseLevel), + m_proceed(false), m_dispatchAction(dispatchAction) { + } + + virtual ~Writer(void) { + processDispatch(); + } + + template + inline Writer& operator<<(const T& log) { +#if ELPP_LOGGING_ENABLED + if (m_proceed) { + m_messageBuilder << log; + } +#endif // ELPP_LOGGING_ENABLED + return *this; + } + + inline Writer& operator<<(std::ostream& (*log)(std::ostream&)) { +#if ELPP_LOGGING_ENABLED + if (m_proceed) { + m_messageBuilder << log; + } +#endif // ELPP_LOGGING_ENABLED + return *this; + } + + Writer& construct(Logger* logger, bool needLock = true) { + m_logger = logger; + initializeLogger(logger->id(), false, needLock); + m_messageBuilder.initialize(m_logger); + return *this; + } + + Writer& construct(int count, const char* loggerIds, ...) { + if (ELPP->hasFlag(LoggingFlag::MultiLoggerSupport)) { + va_list loggersList; + va_start(loggersList, loggerIds); + const char* id = loggerIds; + for (int i = 0; i < count; ++i) { + m_loggerIds.push_back(std::string(id)); + id = va_arg(loggersList, const char*); + } + va_end(loggersList); + initializeLogger(m_loggerIds.at(0)); + } + else { + initializeLogger(std::string(loggerIds)); + } + m_messageBuilder.initialize(m_logger); + return *this; + } + protected: + Level m_level; + const char* m_file; + const unsigned long int m_line; + const char* m_func; + base::type::VerboseLevel m_verboseLevel; + Logger* m_logger; + bool m_proceed; + base::MessageBuilder m_messageBuilder; + base::DispatchAction m_dispatchAction; + std::vector m_loggerIds; + friend class el::Helpers; + + void initializeLogger(const std::string& loggerId, bool lookup = true, bool needLock = true) { + if (lookup) { + m_logger = ELPP->registeredLoggers()->get(loggerId, ELPP->hasFlag(LoggingFlag::CreateLoggerAutomatically)); + } + if (m_logger == nullptr) { + ELPP->acquireLock(); + if (!ELPP->registeredLoggers()->has(std::string(base::consts::kDefaultLoggerId))) { + // Somehow default logger has been unregistered. Not good! Register again + ELPP->registeredLoggers()->get(std::string(base::consts::kDefaultLoggerId)); + } + ELPP->releaseLock(); // Need to unlock it for next writer + Writer(Level::Debug, m_file, m_line, m_func).construct(1, base::consts::kDefaultLoggerId) + << "Logger [" << loggerId << "] is not registered yet!"; + m_proceed = false; + } + else { + if (needLock) { + m_logger->acquireLock(); // This should not be unlocked by checking m_proceed because + // m_proceed can be changed by lines below + } + if (ELPP->hasFlag(LoggingFlag::HierarchicalLogging)) { + m_proceed = m_level == Level::Verbose ? m_logger->enabled(m_level) : + LevelHelper::castToInt(m_level) >= LevelHelper::castToInt(ELPP->m_loggingLevel); + } + else { + m_proceed = m_logger->enabled(m_level); + } + } + } + + void processDispatch() { +#if ELPP_LOGGING_ENABLED + if (ELPP->hasFlag(LoggingFlag::MultiLoggerSupport)) { + bool firstDispatched = false; + base::type::string_t logMessage; + std::size_t i = 0; + do { + if (m_proceed) { + if (firstDispatched) { + m_logger->stream() << logMessage; + } + else { + firstDispatched = true; + if (m_loggerIds.size() > 1) { + logMessage = m_logger->stream().str(); + } + } + triggerDispatch(); + } + else if (m_logger != nullptr) { + m_logger->stream().str(ELPP_LITERAL("")); + m_logger->releaseLock(); + } + if (i + 1 < m_loggerIds.size()) { + initializeLogger(m_loggerIds.at(i + 1)); + } + } while (++i < m_loggerIds.size()); + } + else { + if (m_proceed) { + triggerDispatch(); + } + else if (m_logger != nullptr) { + m_logger->stream().str(ELPP_LITERAL("")); + m_logger->releaseLock(); + } + } +#else + if (m_logger != nullptr) { + m_logger->stream().str(ELPP_LITERAL("")); + m_logger->releaseLock(); + } +#endif // ELPP_LOGGING_ENABLED + } + + void triggerDispatch(void) { + if (m_proceed) { + base::LogDispatcher(m_proceed, LogMessage(m_level, m_file, m_line, m_func, m_verboseLevel, + m_logger), m_dispatchAction).dispatch(); + } + if (m_logger != nullptr) { + m_logger->stream().str(ELPP_LITERAL("")); + m_logger->releaseLock(); + } + if (m_proceed && m_level == Level::Fatal + && !ELPP->hasFlag(LoggingFlag::DisableApplicationAbortOnFatalLog)) { + base::Writer(Level::Warning, m_file, m_line, m_func).construct(1, base::consts::kDefaultLoggerId) + << "Aborting application. Reason: Fatal log at [" << m_file << ":" << m_line << "]"; + std::stringstream reasonStream; + reasonStream << "Fatal log at [" << m_file << ":" << m_line << "]" + << " If you wish to disable 'abort on fatal log' please use " + << "el::Helpers::addFlag(el::LoggingFlag::DisableApplicationAbortOnFatalLog)"; + base::utils::abort(1, reasonStream.str()); + } + m_proceed = false; + } + }; + class PErrorWriter : public base::Writer { + public: + PErrorWriter(Level level, const char* file, unsigned long int line, + const char* func, base::DispatchAction dispatchAction = base::DispatchAction::NormalLog, + base::type::VerboseLevel verboseLevel = 0) : + base::Writer(level, file, line, func, dispatchAction, verboseLevel) { + } + + virtual ~PErrorWriter(void) { + if (m_proceed) { +#if ELPP_COMPILER_MSVC + char buff[256]; + strerror_s(buff, 256, errno); + m_logger->stream() << ": " << buff << " [" << errno << "]"; +#else + m_logger->stream() << ": " << strerror(errno) << " [" << errno << "]"; +#endif + } + } + }; + } // namespace base + // Logging from Logger class. Why this is here? Because we have Storage and Writer class available +#if ELPP_VARIADIC_TEMPLATES_SUPPORTED + template + void Logger::log_(Level level, int vlevel, const char* s, const T& value, const Args&... args) { + base::MessageBuilder b; + b.initialize(this); + while (*s) { + if (*s == base::consts::kFormatSpecifierChar) { + if (*(s + 1) == base::consts::kFormatSpecifierChar) { + ++s; + } + else { + if (*(s + 1) == base::consts::kFormatSpecifierCharValue) { + ++s; + b << value; + log_(level, vlevel, ++s, args...); + return; + } + } + } + b << *s++; + } + ELPP_INTERNAL_ERROR("Too many arguments provided. Unable to handle. Please provide more format specifiers", false); + } + template + inline void Logger::log_(Level level, int vlevel, const T& log) { + if (level == Level::Verbose) { + if (ELPP->vRegistry()->allowed(vlevel, __FILE__)) { + base::Writer(Level::Verbose, "FILE", 0, "FUNCTION", + base::DispatchAction::NormalLog, vlevel).construct(this, false) << log; + } + else { + stream().str(ELPP_LITERAL("")); + } + } + else { + base::Writer(level, "FILE", 0, "FUNCTION").construct(this, false) << log; + } + } + template + void Logger::log(Level level, const char* s, const T& value, const Args&... args) { + base::threading::ScopedLock scopedLock(lock()); + log_(level, 0, s, value, args...); + } + template + inline void Logger::log(Level level, const T& log) { + base::threading::ScopedLock scopedLock(lock()); + log_(level, 0, log); + } +# if ELPP_VERBOSE_LOG + template + inline void Logger::verbose(int vlevel, const char* s, const T& value, const Args&... args) { + base::threading::ScopedLock scopedLock(lock()); + log_(el::Level::Verbose, vlevel, s, value, args...); + } + template + inline void Logger::verbose(int vlevel, const T& log) { + base::threading::ScopedLock scopedLock(lock()); + log_(el::Level::Verbose, vlevel, log); + } +# else + template + inline void Logger::verbose(int, const char*, const T&, const Args&...) { + return; + } + template + inline void Logger::verbose(int, const T&) { + return; + } +# endif // ELPP_VERBOSE_LOG +# define LOGGER_LEVEL_WRITERS(FUNCTION_NAME, LOG_LEVEL)\ + template \ + inline void Logger::FUNCTION_NAME(const char* s, const T& value, const Args&... args) {\ + log(LOG_LEVEL, s, value, args...);\ + }\ + template \ + inline void Logger::FUNCTION_NAME(const T& value) {\ + log(LOG_LEVEL, value);\ + } +# define LOGGER_LEVEL_WRITERS_DISABLED(FUNCTION_NAME, LOG_LEVEL)\ + template \ + inline void Logger::FUNCTION_NAME(const char*, const T&, const Args&...) {\ + return;\ + }\ + template \ + inline void Logger::FUNCTION_NAME(const T&) {\ + return;\ + } + +# if ELPP_INFO_LOG + LOGGER_LEVEL_WRITERS(info, Level::Info) +# else + LOGGER_LEVEL_WRITERS_DISABLED(info, Level::Info) +# endif // ELPP_INFO_LOG +# if ELPP_DEBUG_LOG + LOGGER_LEVEL_WRITERS(debug, Level::Debug) +# else + LOGGER_LEVEL_WRITERS_DISABLED(debug, Level::Debug) +# endif // ELPP_DEBUG_LOG +# if ELPP_WARNING_LOG + LOGGER_LEVEL_WRITERS(warn, Level::Warning) +# else + LOGGER_LEVEL_WRITERS_DISABLED(warn, Level::Warning) +# endif // ELPP_WARNING_LOG +# if ELPP_ERROR_LOG + LOGGER_LEVEL_WRITERS(error, Level::Error) +# else + LOGGER_LEVEL_WRITERS_DISABLED(error, Level::Error) +# endif // ELPP_ERROR_LOG +# if ELPP_FATAL_LOG + LOGGER_LEVEL_WRITERS(fatal, Level::Fatal) +# else + LOGGER_LEVEL_WRITERS_DISABLED(fatal, Level::Fatal) +# endif // ELPP_FATAL_LOG +# if ELPP_TRACE_LOG + LOGGER_LEVEL_WRITERS(trace, Level::Trace) +# else + LOGGER_LEVEL_WRITERS_DISABLED(trace, Level::Trace) +# endif // ELPP_TRACE_LOG +# undef LOGGER_LEVEL_WRITERS +# undef LOGGER_LEVEL_WRITERS_DISABLED +#endif // ELPP_VARIADIC_TEMPLATES_SUPPORTED +#if ELPP_COMPILER_MSVC +# define ELPP_VARIADIC_FUNC_MSVC(variadicFunction, variadicArgs) variadicFunction variadicArgs +# define ELPP_VARIADIC_FUNC_MSVC_RUN(variadicFunction, ...) ELPP_VARIADIC_FUNC_MSVC(variadicFunction, (__VA_ARGS__)) +# define el_getVALength(...) ELPP_VARIADIC_FUNC_MSVC_RUN(el_resolveVALength, 0, ## __VA_ARGS__,\ + 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +#else +# if ELPP_COMPILER_CLANG +# define el_getVALength(...) el_resolveVALength(0, __VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +# else +# define el_getVALength(...) el_resolveVALength(0, ## __VA_ARGS__, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) +# endif // ELPP_COMPILER_CLANG +#endif // ELPP_COMPILER_MSVC +#define el_resolveVALength(_0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, N, ...) N +#define ELPP_WRITE_LOG(writer, level, dispatchAction, ...) \ + writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#define ELPP_WRITE_LOG_IF(writer, condition, level, dispatchAction, ...) if (condition) \ + writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#define ELPP_WRITE_LOG_EVERY_N(writer, occasion, level, dispatchAction, ...) \ + if (ELPP->validateEveryNCounter(__FILE__, __LINE__, occasion)) \ + writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#define ELPP_WRITE_LOG_AFTER_N(writer, n, level, dispatchAction, ...) \ + if (ELPP->validateAfterNCounter(__FILE__, __LINE__, n)) \ + writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#define ELPP_WRITE_LOG_N_TIMES(writer, n, level, dispatchAction, ...) \ + if (ELPP->validateNTimesCounter(__FILE__, __LINE__, n)) \ + writer(level, __FILE__, __LINE__, ELPP_FUNC, dispatchAction).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#undef ELPP_CURR_FILE_PERFORMANCE_LOGGER +#if defined(ELPP_PERFORMANCE_LOGGER) +# define ELPP_CURR_FILE_PERFORMANCE_LOGGER ELPP_PERFORMANCE_LOGGER +#else +# define ELPP_CURR_FILE_PERFORMANCE_LOGGER el::base::consts::kPerformanceLoggerId +#endif + class PerformanceTrackingData { + public: + enum class DataType : base::type::EnumType { + Checkpoint = 1, Complete = 2 + }; + // Do not use constructor, will run into multiple definition error, use init(PerformanceTracker*) + explicit PerformanceTrackingData(DataType dataType) : m_performanceTracker(nullptr), + m_dataType(dataType), m_file(""), m_line(0), m_func("") {} + inline const std::string* blockName(void) const; + inline const struct timeval* startTime(void) const; + inline const struct timeval* endTime(void) const; + inline const struct timeval* lastCheckpointTime(void) const; + inline const base::PerformanceTracker* performanceTracker(void) const { return m_performanceTracker; } + inline PerformanceTrackingData::DataType dataType(void) const { return m_dataType; } + inline bool firstCheckpoint(void) const { return m_firstCheckpoint; } + inline std::string checkpointId(void) const { return m_checkpointId; } + inline const char* file(void) const { return m_file; } + inline unsigned long int line(void) const { return m_line; } + inline const char* func(void) const { return m_func; } + inline const base::type::string_t* formattedTimeTaken() const { return &m_formattedTimeTaken; } + inline const std::string& loggerId(void) const; + private: + base::PerformanceTracker* m_performanceTracker; + base::type::string_t m_formattedTimeTaken; + PerformanceTrackingData::DataType m_dataType; + bool m_firstCheckpoint; + std::string m_checkpointId; + const char* m_file; + unsigned long int m_line; + const char* m_func; + inline void init(base::PerformanceTracker* performanceTracker, bool firstCheckpoint = false) { + m_performanceTracker = performanceTracker; + m_firstCheckpoint = firstCheckpoint; + } + + friend class el::base::PerformanceTracker; + }; + namespace base { + /// @brief Represents performanceTracker block of code that conditionally adds performance status to log + /// either when goes outside the scope of when checkpoint() is called + class PerformanceTracker : public base::threading::ThreadSafe, public Loggable { + public: + PerformanceTracker(const std::string& blockName, + base::TimestampUnit timestampUnit = base::TimestampUnit::Millisecond, + const std::string& loggerId = std::string(ELPP_CURR_FILE_PERFORMANCE_LOGGER), + bool scopedLog = true, Level level = base::consts::kPerformanceTrackerDefaultLevel) : + m_blockName(blockName), m_timestampUnit(timestampUnit), m_loggerId(loggerId), m_scopedLog(scopedLog), + m_level(level), m_hasChecked(false), m_lastCheckpointId(std::string()), m_enabled(false) { +#if !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED + // We store it locally so that if user happen to change configuration by the end of scope + // or before calling checkpoint, we still depend on state of configuraton at time of construction + el::Logger* loggerPtr = ELPP->registeredLoggers()->get(loggerId, false); + m_enabled = loggerPtr != nullptr && loggerPtr->m_typedConfigurations->performanceTracking(m_level); + if (m_enabled) { + base::utils::DateTime::gettimeofday(&m_startTime); + } +#endif // !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED + } + /// @brief Copy constructor + PerformanceTracker(const PerformanceTracker& t) : + m_blockName(t.m_blockName), m_timestampUnit(t.m_timestampUnit), m_loggerId(t.m_loggerId), m_scopedLog(t.m_scopedLog), + m_level(t.m_level), m_hasChecked(t.m_hasChecked), m_lastCheckpointId(t.m_lastCheckpointId), m_enabled(t.m_enabled), + m_startTime(t.m_startTime), m_endTime(t.m_endTime), m_lastCheckpointTime(t.m_lastCheckpointTime) { + } + virtual ~PerformanceTracker(void) { +#if !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED + if (m_enabled) { + base::threading::ScopedLock scopedLock(lock()); + if (m_scopedLog) { + base::utils::DateTime::gettimeofday(&m_endTime); + base::type::string_t formattedTime = getFormattedTimeTaken(); + PerformanceTrackingData data(PerformanceTrackingData::DataType::Complete); + data.init(this); + data.m_formattedTimeTaken = formattedTime; + PerformanceTrackingCallback* callback = nullptr; + for (const std::pair& h + : ELPP->m_performanceTrackingCallbacks) { + callback = h.second.get(); + if (callback != nullptr && callback->enabled()) { + callback->acquireLock(); + callback->handle(&data); + callback->releaseLock(); + } + } + } + } +#endif // !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) + } + /// @brief A checkpoint for current performanceTracker block. + void checkpoint(const std::string& id = std::string(), const char* file = __FILE__, unsigned long int line = __LINE__, const char* func = "") { +#if !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED + if (m_enabled) { + base::threading::ScopedLock scopedLock(lock()); + base::utils::DateTime::gettimeofday(&m_endTime); + base::type::string_t formattedTime = m_hasChecked ? getFormattedTimeTaken(m_lastCheckpointTime) : ELPP_LITERAL(""); + PerformanceTrackingData data(PerformanceTrackingData::DataType::Checkpoint); + data.init(this); + data.m_checkpointId = id; + data.m_file = file; + data.m_line = line; + data.m_func = func; + data.m_formattedTimeTaken = formattedTime; + PerformanceTrackingCallback* callback = nullptr; + for (const std::pair& h + : ELPP->m_performanceTrackingCallbacks) { + callback = h.second.get(); + if (callback != nullptr && callback->enabled()) { + callback->acquireLock(); + callback->handle(&data); + callback->releaseLock(); + } + } + base::utils::DateTime::gettimeofday(&m_lastCheckpointTime); + m_hasChecked = true; + m_lastCheckpointId = id; + } +#endif // !defined(ELPP_DISABLE_PERFORMANCE_TRACKING) && ELPP_LOGGING_ENABLED + ELPP_UNUSED(id); + ELPP_UNUSED(file); + ELPP_UNUSED(line); + ELPP_UNUSED(func); + } + inline Level level(void) const { return m_level; } + private: + std::string m_blockName; + base::TimestampUnit m_timestampUnit; + std::string m_loggerId; + bool m_scopedLog; + Level m_level; + bool m_hasChecked; + std::string m_lastCheckpointId; + bool m_enabled; + struct timeval m_startTime, m_endTime, m_lastCheckpointTime; + + PerformanceTracker(void); + + friend class el::PerformanceTrackingData; + friend class base::DefaultPerformanceTrackingCallback; + + const inline base::type::string_t getFormattedTimeTaken() const { + return getFormattedTimeTaken(m_startTime); + } + + const base::type::string_t getFormattedTimeTaken(struct timeval startTime) const { + if (ELPP->hasFlag(LoggingFlag::FixedTimeFormat)) { + base::type::stringstream_t ss; + ss << base::utils::DateTime::getTimeDifference(m_endTime, + startTime, m_timestampUnit) << " " << base::consts::kTimeFormats[static_cast(m_timestampUnit)].unit; + return ss.str(); + } + return base::utils::DateTime::formatTime(base::utils::DateTime::getTimeDifference(m_endTime, + startTime, m_timestampUnit), m_timestampUnit); + } + + virtual inline void log(el::base::type::ostream_t& os) const { + os << getFormattedTimeTaken(); + } + }; + class DefaultPerformanceTrackingCallback : public PerformanceTrackingCallback { + protected: + void handle(const PerformanceTrackingData* data) { + m_data = data; + base::type::stringstream_t ss; + if (m_data->dataType() == PerformanceTrackingData::DataType::Complete) { + ss << ELPP_LITERAL("Executed [") << m_data->blockName()->c_str() << ELPP_LITERAL("] in [") << *m_data->formattedTimeTaken() << ELPP_LITERAL("]"); + } + else { + ss << ELPP_LITERAL("Performance checkpoint"); + if (!m_data->checkpointId().empty()) { + ss << ELPP_LITERAL(" [") << m_data->checkpointId().c_str() << ELPP_LITERAL("]"); + } + ss << ELPP_LITERAL(" for block [") << m_data->blockName()->c_str() << ELPP_LITERAL("] : [") << *m_data->performanceTracker(); + if (!ELPP->hasFlag(LoggingFlag::DisablePerformanceTrackingCheckpointComparison) && m_data->performanceTracker()->m_hasChecked) { + ss << ELPP_LITERAL(" ([") << *m_data->formattedTimeTaken() << ELPP_LITERAL("] from "); + if (m_data->performanceTracker()->m_lastCheckpointId.empty()) { + ss << ELPP_LITERAL("last checkpoint"); + } + else { + ss << ELPP_LITERAL("checkpoint '") << m_data->performanceTracker()->m_lastCheckpointId.c_str() << ELPP_LITERAL("'"); + } + ss << ELPP_LITERAL(")]"); + } + else { + ss << ELPP_LITERAL("]"); + } + } + el::base::Writer(m_data->performanceTracker()->level(), m_data->file(), m_data->line(), m_data->func()).construct(1, m_data->loggerId().c_str()) << ss.str(); + } + private: + const PerformanceTrackingData* m_data; + }; + } // namespace base + inline const std::string* PerformanceTrackingData::blockName() const { + return const_cast(&m_performanceTracker->m_blockName); + } + inline const struct timeval* PerformanceTrackingData::startTime() const { + return const_cast(&m_performanceTracker->m_startTime); + } + inline const struct timeval* PerformanceTrackingData::endTime() const { + return const_cast(&m_performanceTracker->m_endTime); + } + inline const struct timeval* PerformanceTrackingData::lastCheckpointTime() const { + return const_cast(&m_performanceTracker->m_lastCheckpointTime); + } + inline const std::string& PerformanceTrackingData::loggerId(void) const { return m_performanceTracker->m_loggerId; } + namespace base { + /// @brief Contains some internal debugging tools like crash handler and stack tracer + namespace debug { + class StackTrace : base::NoCopy { + public: + static const std::size_t kMaxStack = 64; + static const std::size_t kStackStart = 2; // We want to skip c'tor and StackTrace::generateNew() + class StackTraceEntry { + public: + StackTraceEntry(std::size_t index, const char* loc, const char* demang, const char* hex, const char* addr) { + m_index = index; + m_location = std::string(loc); + m_demangled = std::string(demang); + m_hex = std::string(hex); + m_addr = std::string(addr); + } + StackTraceEntry(std::size_t index, char* loc) { + m_index = index; + m_location = std::string(loc); + } + std::size_t m_index; + std::string m_location; + std::string m_demangled; + std::string m_hex; + std::string m_addr; + friend std::ostream& operator<<(std::ostream& ss, const StackTraceEntry& si) { + ss << "[" << si.m_index << "] " << si.m_location << (si.m_demangled.empty() ? "" : ":") << si.m_demangled + << (si.m_hex.empty() ? "" : "+") << si.m_hex << si.m_addr; + return ss; + } + + private: + StackTraceEntry(void); + }; + + StackTrace(void) { + generateNew(); + } + + virtual ~StackTrace(void) { + } + + inline std::vector& getLatestStack(void) { + return m_stack; + } + + friend inline std::ostream& operator<<(std::ostream& os, const StackTrace& st) { + std::vector::const_iterator it = st.m_stack.begin(); + while (it != st.m_stack.end()) { + os << " " << *it++ << "\n"; + } + return os; + } + + private: + std::vector m_stack; + + void generateNew(void) { +#if ELPP_STACKTRACE + m_stack.clear(); + void* stack[kMaxStack]; + std::size_t size = backtrace(stack, kMaxStack); + char** strings = backtrace_symbols(stack, size); + if (size > kStackStart) { // Skip StackTrace c'tor and generateNew + for (std::size_t i = kStackStart; i < size; ++i) { + char* mangName = nullptr; + char* hex = nullptr; + char* addr = nullptr; + for (char* c = strings[i]; *c; ++c) { + switch (*c) { + case '(': + mangName = c; + break; + case '+': + hex = c; + break; + case ')': + addr = c; + break; + } + } + // Perform demangling if parsed properly + if (mangName != nullptr && hex != nullptr && addr != nullptr && mangName < hex) { + *mangName++ = '\0'; + *hex++ = '\0'; + *addr++ = '\0'; + int status = 0; + char* demangName = abi::__cxa_demangle(mangName, 0, 0, &status); + // if demangling is successful, output the demangled function name + if (status == 0) { + // Success (see http://gcc.gnu.org/onlinedocs/libstdc++/libstdc++-html-USERS-4.3/a01696.html) + StackTraceEntry entry(i - 1, strings[i], demangName, hex, addr); + m_stack.push_back(entry); + } + else { + // Not successful - we will use mangled name + StackTraceEntry entry(i - 1, strings[i], mangName, hex, addr); + m_stack.push_back(entry); + } + free(demangName); + } + else { + StackTraceEntry entry(i - 1, strings[i]); + m_stack.push_back(entry); + } + } + } + free(strings); +#else + ELPP_INTERNAL_INFO(1, "Stacktrace generation not supported for selected compiler"); +#endif // ELPP_STACKTRACE + } + }; + static std::string crashReason(int sig) { + std::stringstream ss; + bool foundReason = false; + for (int i = 0; i < base::consts::kCrashSignalsCount; ++i) { + if (base::consts::kCrashSignals[i].numb == sig) { + ss << "Application has crashed due to [" << base::consts::kCrashSignals[i].name << "] signal"; + if (ELPP->hasFlag(el::LoggingFlag::LogDetailedCrashReason)) { + ss << std::endl << + " " << base::consts::kCrashSignals[i].brief << std::endl << + " " << base::consts::kCrashSignals[i].detail; + } + foundReason = true; + } + } + if (!foundReason) { + ss << "Application has crashed due to unknown signal [" << sig << "]"; + } + return ss.str(); + } + /// @brief Logs reason of crash from sig + static void logCrashReason(int sig, bool stackTraceIfAvailable, Level level, const char* logger) { + std::stringstream ss; + ss << "CRASH HANDLED; "; + ss << crashReason(sig); +#if ELPP_STACKTRACE + if (stackTraceIfAvailable) { + ss << std::endl << " ======= Backtrace: =========" << std::endl << base::debug::StackTrace(); + } +#else + ELPP_UNUSED(stackTraceIfAvailable); +#endif // ELPP_STACKTRACE + ELPP_WRITE_LOG(el::base::Writer, level, base::DispatchAction::NormalLog, logger) << ss.str(); + } + static inline void crashAbort(int sig) { + base::utils::abort(sig); + } + /// @brief Default application crash handler + /// + /// @detail This function writes log using 'default' logger, prints stack trace for GCC based compilers and aborts program. + static inline void defaultCrashHandler(int sig) { + base::debug::logCrashReason(sig, true, Level::Fatal, base::consts::kDefaultLoggerId); + base::debug::crashAbort(sig); + } + /// @brief Handles unexpected crashes + class CrashHandler : base::NoCopy { + public: + typedef void(*Handler)(int); + + explicit CrashHandler(bool useDefault) { + if (useDefault) { + setHandler(defaultCrashHandler); + } + } + explicit CrashHandler(const Handler& cHandler) { + setHandler(cHandler); + } + void setHandler(const Handler& cHandler) { + m_handler = cHandler; +#if defined(ELPP_HANDLE_SIGABRT) + int i = 0; // SIGABRT is at base::consts::kCrashSignals[0] +#else + int i = 1; +#endif // defined(ELPP_HANDLE_SIGABRT) + for (; i < base::consts::kCrashSignalsCount; ++i) { + m_handler = signal(base::consts::kCrashSignals[i].numb, cHandler); + } + } + + private: + Handler m_handler; + }; + } // namespace debug + } // namespace base + extern base::debug::CrashHandler elCrashHandler; +#define MAKE_LOGGABLE(ClassType, ClassInstance, OutputStreamInstance) \ + el::base::type::ostream_t& operator<<(el::base::type::ostream_t& OutputStreamInstance, const ClassType& ClassInstance) + /// @brief Initializes syslog with process ID, options and facility. calls closelog() on d'tor + class SysLogInitializer { + public: + SysLogInitializer(const char* processIdent, int options = 0, int facility = 0) { +#if defined(ELPP_SYSLOG) + openlog(processIdent, options, facility); +#else + ELPP_UNUSED(processIdent); + ELPP_UNUSED(options); + ELPP_UNUSED(facility); +#endif // defined(ELPP_SYSLOG) + } + virtual ~SysLogInitializer(void) { +#if defined(ELPP_SYSLOG) + closelog(); +#endif // defined(ELPP_SYSLOG) + } + }; +#define ELPP_INITIALIZE_SYSLOG(id, opt, fac) el::SysLogInitializer elSyslogInit(id, opt, fac) + /// @brief Static helpers for developers + class Helpers : base::StaticClass { + public: + /// @brief Shares logging repository (base::Storage) + static inline void setStorage(base::type::StoragePointer storage) { + ELPP = storage; + } + /// @return Main storage repository + static inline base::type::StoragePointer storage() { + return ELPP; + } + /// @brief Sets application arguments and figures out whats active for logging and whats not. + static inline void setArgs(int argc, char** argv) { + ELPP->setApplicationArguments(argc, argv); + } + /// @copydoc setArgs(int argc, char** argv) + static inline void setArgs(int argc, const char** argv) { + ELPP->setApplicationArguments(argc, const_cast(argv)); + } + /// @brief Overrides default crash handler and installs custom handler. + /// @param crashHandler A functor with no return type that takes single int argument. + /// Handler is a typedef with specification: void (*Handler)(int) + static inline void setCrashHandler(const el::base::debug::CrashHandler::Handler& crashHandler) { + el::elCrashHandler.setHandler(crashHandler); + } + /// @brief Abort due to crash with signal in parameter + /// @param sig Crash signal + static inline void crashAbort(int sig, const char* sourceFile = "", unsigned int long line = 0) { + std::stringstream ss; + ss << base::debug::crashReason(sig).c_str(); + ss << " - [Called el::Helpers::crashAbort(" << sig << ")]"; + if (sourceFile != nullptr && strlen(sourceFile) > 0) { + ss << " - Source: " << sourceFile; + if (line > 0) + ss << ":" << line; + else + ss << " (line number not specified)"; + } + base::utils::abort(sig, ss.str()); + } + /// @brief Logs reason of crash as per sig + /// @param sig Crash signal + /// @param stackTraceIfAvailable Includes stack trace if available + /// @param level Logging level + /// @param logger Logger to use for logging + static inline void logCrashReason(int sig, bool stackTraceIfAvailable = false, + Level level = Level::Fatal, const char* logger = base::consts::kDefaultLoggerId) { + el::base::debug::logCrashReason(sig, stackTraceIfAvailable, level, logger); + } + /// @brief Installs pre rollout callback, this callback is triggered when log file is about to be rolled out + /// (can be useful for backing up) + static inline void installPreRollOutCallback(const PreRollOutCallback& callback) { + ELPP->setPreRollOutCallback(callback); + } + /// @brief Uninstalls pre rollout callback + static inline void uninstallPreRollOutCallback(void) { + ELPP->unsetPreRollOutCallback(); + } + /// @brief Installs post log dispatch callback, this callback is triggered when log is dispatched + template + static inline bool installLogDispatchCallback(const std::string& id) { + return ELPP->installLogDispatchCallback(id); + } + /// @brief Uninstalls log dispatch callback + template + static inline void uninstallLogDispatchCallback(const std::string& id) { + ELPP->uninstallLogDispatchCallback(id); + } + template + static inline T* logDispatchCallback(const std::string& id) { + return ELPP->logDispatchCallback(id); + } + /// @brief Installs post performance tracking callback, this callback is triggered when performance tracking is finished + template + static inline bool installPerformanceTrackingCallback(const std::string& id) { + return ELPP->installPerformanceTrackingCallback(id); + } + /// @brief Uninstalls post performance tracking handler + template + static inline void uninstallPerformanceTrackingCallback(const std::string& id) { + ELPP->uninstallPerformanceTrackingCallback(id); + } + template + static inline T* performanceTrackingCallback(const std::string& id) { + return ELPP->performanceTrackingCallback(id); + } + /// @brief Converts template to std::string - useful for loggable classes to log containers within log(std::ostream&) const + template + static std::string convertTemplateToStdString(const T& templ) { + el::Logger* logger = + ELPP->registeredLoggers()->get(el::base::consts::kDefaultLoggerId); + if (logger == nullptr) { + return std::string(); + } + base::MessageBuilder b; + b.initialize(logger); + logger->acquireLock(); + b << templ; +#if defined(ELPP_UNICODE) + std::string s = std::string(logger->stream().str().begin(), logger->stream().str().end()); +#else + std::string s = logger->stream().str(); +#endif // defined(ELPP_UNICODE) + logger->stream().str(ELPP_LITERAL("")); + logger->releaseLock(); + return s; + } + /// @brief Returns command line arguments (pointer) provided to easylogging++ + static inline const el::base::utils::CommandLineArgs* commandLineArgs(void) { + return ELPP->commandLineArgs(); + } + /// @brief Installs user defined format specifier and handler + static inline void installCustomFormatSpecifier(const CustomFormatSpecifier& customFormatSpecifier) { + ELPP->installCustomFormatSpecifier(customFormatSpecifier); + } + /// @brief Uninstalls user defined format specifier and handler + static inline bool uninstallCustomFormatSpecifier(const char* formatSpecifier) { + return ELPP->uninstallCustomFormatSpecifier(formatSpecifier); + } + /// @brief Returns true if custom format specifier is installed + static inline bool hasCustomFormatSpecifier(const char* formatSpecifier) { + return ELPP->hasCustomFormatSpecifier(formatSpecifier); + } + static inline void validateFileRolling(Logger* logger, Level level) { + if (logger == nullptr) return; + logger->m_typedConfigurations->validateFileRolling(level, ELPP->preRollOutCallback()); + } + }; + /// @brief Static helpers to deal with loggers and their configurations + class Loggers : base::StaticClass { + public: + /// @brief Gets existing or registers new logger + static inline Logger* getLogger(const std::string& identity, bool registerIfNotAvailable = true) { + base::threading::ScopedLock scopedLock(ELPP->lock()); + return ELPP->registeredLoggers()->get(identity, registerIfNotAvailable); + } + /// @brief Unregisters logger - use it only when you know what you are doing, you may unregister + /// loggers initialized / used by third-party libs. + static inline bool unregisterLogger(const std::string& identity) { + base::threading::ScopedLock scopedLock(ELPP->lock()); + return ELPP->registeredLoggers()->remove(identity); + } + /// @brief Whether or not logger with id is registered + static inline bool hasLogger(const std::string& identity) { + base::threading::ScopedLock scopedLock(ELPP->lock()); + return ELPP->registeredLoggers()->has(identity); + } + /// @brief Reconfigures specified logger with new configurations + static inline Logger* reconfigureLogger(Logger* logger, const Configurations& configurations) { + if (!logger) return nullptr; + logger->configure(configurations); + return logger; + } + /// @brief Reconfigures logger with new configurations after looking it up using identity + static inline Logger* reconfigureLogger(const std::string& identity, const Configurations& configurations) { + return Loggers::reconfigureLogger(Loggers::getLogger(identity), configurations); + } + /// @brief Reconfigures logger's single configuration + static inline Logger* reconfigureLogger(const std::string& identity, ConfigurationType configurationType, + const std::string& value) { + Logger* logger = Loggers::getLogger(identity); + if (logger == nullptr) { + return nullptr; + } + logger->configurations()->set(Level::Global, configurationType, value); + logger->reconfigure(); + return logger; + } + /// @brief Reconfigures all the existing loggers with new configurations + static inline void reconfigureAllLoggers(const Configurations& configurations) { + for (base::RegisteredLoggers::iterator it = ELPP->registeredLoggers()->begin(); + it != ELPP->registeredLoggers()->end(); ++it) { + Loggers::reconfigureLogger(it->second, configurations); + } + } + /// @brief Reconfigures single configuration for all the loggers + static inline void reconfigureAllLoggers(ConfigurationType configurationType, const std::string& value) { + reconfigureAllLoggers(Level::Global, configurationType, value); + } + /// @brief Reconfigures single configuration for all the loggers for specified level + static inline void reconfigureAllLoggers(Level level, ConfigurationType configurationType, + const std::string& value) { + for (base::RegisteredLoggers::iterator it = ELPP->registeredLoggers()->begin(); + it != ELPP->registeredLoggers()->end(); ++it) { + Logger* logger = it->second; + logger->configurations()->set(level, configurationType, value); + logger->reconfigure(); + } + } + /// @brief Sets default configurations. This configuration is used for future (and conditionally for existing) loggers + static inline void setDefaultConfigurations(const Configurations& configurations, bool reconfigureExistingLoggers = false) { + ELPP->registeredLoggers()->setDefaultConfigurations(configurations); + if (reconfigureExistingLoggers) { + Loggers::reconfigureAllLoggers(configurations); + } + } + /// @brief Returns current default + static inline const Configurations* defaultConfigurations(void) { + return ELPP->registeredLoggers()->defaultConfigurations(); + } + /// @brief Returns log stream reference pointer if needed by user + static inline const base::LogStreamsReferenceMap* logStreamsReference(void) { + return ELPP->registeredLoggers()->logStreamsReference(); + } + /// @brief Default typed configuration based on existing defaultConf + static base::TypedConfigurations defaultTypedConfigurations(void) { + return base::TypedConfigurations( + ELPP->registeredLoggers()->defaultConfigurations(), + ELPP->registeredLoggers()->logStreamsReference()); + } + /// @brief Populates all logger IDs in current repository. + /// @param [out] targetList List of fill up. + static inline std::vector* populateAllLoggerIds(std::vector* targetList) { + targetList->clear(); + for (base::RegisteredLoggers::iterator it = ELPP->registeredLoggers()->list().begin(); + it != ELPP->registeredLoggers()->list().end(); ++it) { + targetList->push_back(it->first); + } + return targetList; + } + /// @brief Sets configurations from global configuration file. + static void configureFromGlobal(const char* globalConfigurationFilePath) { + std::ifstream gcfStream(globalConfigurationFilePath, std::ifstream::in); + ELPP_ASSERT(gcfStream.is_open(), "Unable to open global configuration file [" << globalConfigurationFilePath + << "] for parsing."); + std::string line = std::string(); + std::stringstream ss; + Logger* logger = nullptr; + auto configure = [&](void) { + ELPP_INTERNAL_INFO(8, "Configuring logger: '" << logger->id() << "' with configurations \n" << ss.str() + << "\n--------------"); + Configurations c; + c.parseFromText(ss.str()); + logger->configure(c); + }; + while (gcfStream.good()) { + std::getline(gcfStream, line); + ELPP_INTERNAL_INFO(1, "Parsing line: " << line); + base::utils::Str::trim(line); + if (Configurations::Parser::isComment(line)) continue; + Configurations::Parser::ignoreComments(&line); + base::utils::Str::trim(line); + if (line.size() > 2 && base::utils::Str::startsWith(line, std::string(base::consts::kConfigurationLoggerId))) { + if (!ss.str().empty() && logger != nullptr) { + configure(); + } + ss.str(std::string("")); + line = line.substr(2); + base::utils::Str::trim(line); + if (line.size() > 1) { + ELPP_INTERNAL_INFO(1, "Getting logger: '" << line << "'"); + logger = getLogger(line); + } + } + else { + ss << line << "\n"; + } + } + if (!ss.str().empty() && logger != nullptr) { + configure(); + } + } + /// @brief Configures loggers using command line arg. Ensure you have already set command line args, + /// @return False if invalid argument or argument with no value provided, true if attempted to configure logger. + /// If true is returned that does not mean it has been configured successfully, it only means that it + /// has attempeted to configure logger using configuration file provided in argument + static inline bool configureFromArg(const char* argKey) { +#if defined(ELPP_DISABLE_CONFIGURATION_FROM_PROGRAM_ARGS) + ELPP_UNUSED(argKey); +#else + if (!Helpers::commandLineArgs()->hasParamWithValue(argKey)) { + return false; + } + configureFromGlobal(Helpers::commandLineArgs()->getParamValue(argKey)); +#endif // defined(ELPP_DISABLE_CONFIGURATION_FROM_PROGRAM_ARGS) + return true; + } + /// @brief Flushes all loggers for all levels - Be careful if you dont know how many loggers are registered + static inline void flushAll(void) { + ELPP->registeredLoggers()->flushAll(); + } + /// @brief Adds logging flag used internally. + static inline void addFlag(LoggingFlag flag) { + ELPP->addFlag(flag); + } + /// @brief Removes logging flag used internally. + static inline void removeFlag(LoggingFlag flag) { + ELPP->removeFlag(flag); + } + /// @brief Determines whether or not certain flag is active + static inline bool hasFlag(LoggingFlag flag) { + return ELPP->hasFlag(flag); + } + /// @brief Adds flag and removes it when scope goes out + class ScopedAddFlag { + public: + ScopedAddFlag(LoggingFlag flag) : m_flag(flag) { Loggers::addFlag(m_flag); } + ~ScopedAddFlag(void) { Loggers::removeFlag(m_flag); } + private: + LoggingFlag m_flag; + }; + /// @brief Removes flag and add it when scope goes out + class ScopedRemoveFlag { + public: + ScopedRemoveFlag(LoggingFlag flag) : m_flag(flag) { Loggers::removeFlag(m_flag); } + ~ScopedRemoveFlag(void) { Loggers::addFlag(m_flag); } + private: + LoggingFlag m_flag; + }; + /// @brief Sets hierarchy for logging. Needs to enable logging flag (HierarchicalLogging) + static inline void setLoggingLevel(Level level) { + ELPP->setLoggingLevel(level); + } + /// @brief Sets verbose level on the fly + static inline void setVerboseLevel(base::type::VerboseLevel level) { + ELPP->vRegistry()->setLevel(level); + } + /// @brief Gets current verbose level + static inline base::type::VerboseLevel verboseLevel(void) { + return ELPP->vRegistry()->level(); + } + /// @brief Sets vmodules as specified (on the fly) + static inline void setVModules(const char* modules) { + if (ELPP->vRegistry()->vModulesEnabled()) { + ELPP->vRegistry()->setModules(modules); + } + } + /// @brief Clears vmodules + static inline void clearVModules(void) { + ELPP->vRegistry()->clearModules(); + } + }; + class VersionInfo : base::StaticClass { + public: + /// @brief Current version number + static inline const std::string version(void) { return std::string("9.80"); } + /// @brief Release date of current version + static inline const std::string releaseDate(void) { return std::string("08-01-2015 0850hrs"); } + }; +} // namespace el +#undef VLOG_IS_ON + /// @brief Determines whether verbose logging is on for specified level current file. +#define VLOG_IS_ON(verboseLevel) (ELPP->vRegistry()->allowed(verboseLevel, __FILE__)) +#undef TIMED_BLOCK +#undef TIMED_SCOPE +#undef TIMED_FUNC +#undef ELPP_MIN_UNIT +#if defined(ELPP_PERFORMANCE_MICROSECONDS) +# define ELPP_MIN_UNIT el::base::TimestampUnit::Microsecond +#else +# define ELPP_MIN_UNIT el::base::TimestampUnit::Millisecond +#endif // (defined(ELPP_PERFORMANCE_MICROSECONDS)) + /// @brief Performance tracked scope. Performance gets written when goes out of scope using + /// 'performance' logger. + /// + /// @detail Please note in order to check the performance at a certain time you can use obj.checkpoint(); + /// @see el::base::PerformanceTracker + /// @see el::base::PerformanceTracker::checkpoint + // Note: Do not surround this definition with null macro because of obj instance +#define TIMED_SCOPE(obj, blockname) el::base::PerformanceTracker obj(blockname, ELPP_MIN_UNIT) +#define TIMED_BLOCK(obj, blockName) for (struct { int i; el::base::PerformanceTracker timer; } obj = { 0, \ + el::base::PerformanceTracker(blockName, ELPP_MIN_UNIT) }; obj.i < 1; ++obj.i) + /// @brief Performance tracked function. Performance gets written when goes out of scope using + /// 'performance' logger. + /// + /// @detail Please note in order to check the performance at a certain time you can use obj.checkpoint(); + /// @see el::base::PerformanceTracker + /// @see el::base::PerformanceTracker::checkpoint +#define TIMED_FUNC(obj) TIMED_SCOPE(obj, ELPP_FUNC) +#undef PERFORMANCE_CHECKPOINT +#undef PERFORMANCE_CHECKPOINT_WITH_ID +#define PERFORMANCE_CHECKPOINT(obj) obj.checkpoint(std::string(), __FILE__, __LINE__, ELPP_FUNC) +#define PERFORMANCE_CHECKPOINT_WITH_ID(obj, id) obj.checkpoint(id, __FILE__, __LINE__, ELPP_FUNC) +#undef ELPP_COUNTER +#undef ELPP_COUNTER_POS + /// @brief Gets hit counter for file/line +#define ELPP_COUNTER (ELPP->hitCounters()->getCounter(__FILE__, __LINE__)) + /// @brief Gets hit counter position for file/line, -1 if not registered yet +#define ELPP_COUNTER_POS (ELPP_COUNTER == nullptr ? -1 : ELPP_COUNTER->hitCounts()) + // Undef levels to support LOG(LEVEL) +#undef INFO +#undef WARNING +#undef DEBUG +#undef ERROR +#undef FATAL +#undef TRACE +#undef VERBOSE + // Undef existing +#undef CINFO +#undef CWARNING +#undef CDEBUG +#undef CFATAL +#undef CERROR +#undef CTRACE +#undef CVERBOSE +#undef CINFO_IF +#undef CWARNING_IF +#undef CDEBUG_IF +#undef CERROR_IF +#undef CFATAL_IF +#undef CTRACE_IF +#undef CVERBOSE_IF +#undef CINFO_EVERY_N +#undef CWARNING_EVERY_N +#undef CDEBUG_EVERY_N +#undef CERROR_EVERY_N +#undef CFATAL_EVERY_N +#undef CTRACE_EVERY_N +#undef CVERBOSE_EVERY_N +#undef CINFO_AFTER_N +#undef CWARNING_AFTER_N +#undef CDEBUG_AFTER_N +#undef CERROR_AFTER_N +#undef CFATAL_AFTER_N +#undef CTRACE_AFTER_N +#undef CVERBOSE_AFTER_N +#undef CINFO_N_TIMES +#undef CWARNING_N_TIMES +#undef CDEBUG_N_TIMES +#undef CERROR_N_TIMES +#undef CFATAL_N_TIMES +#undef CTRACE_N_TIMES +#undef CVERBOSE_N_TIMES + // Normal logs +#if ELPP_INFO_LOG +# define CINFO(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Info, dispatchAction, __VA_ARGS__) +#else +# define CINFO(writer, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_INFO_LOG +#if ELPP_WARNING_LOG +# define CWARNING(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Warning, dispatchAction, __VA_ARGS__) +#else +# define CWARNING(writer, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_WARNING_LOG +#if ELPP_DEBUG_LOG +# define CDEBUG(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Debug, dispatchAction, __VA_ARGS__) +#else +# define CDEBUG(writer, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_DEBUG_LOG +#if ELPP_ERROR_LOG +# define CERROR(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Error, dispatchAction, __VA_ARGS__) +#else +# define CERROR(writer, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_ERROR_LOG +#if ELPP_FATAL_LOG +# define CFATAL(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Fatal, dispatchAction, __VA_ARGS__) +#else +# define CFATAL(writer, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_FATAL_LOG +#if ELPP_TRACE_LOG +# define CTRACE(writer, dispatchAction, ...) ELPP_WRITE_LOG(writer, el::Level::Trace, dispatchAction, __VA_ARGS__) +#else +# define CTRACE(writer, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_TRACE_LOG +#if ELPP_VERBOSE_LOG +# define CVERBOSE(writer, vlevel, dispatchAction, ...) if (VLOG_IS_ON(vlevel)) writer(\ + el::Level::Verbose, __FILE__, __LINE__, ELPP_FUNC, dispatchAction, vlevel).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#else +# define CVERBOSE(writer, vlevel, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_VERBOSE_LOG + // Conditional logs +#if ELPP_INFO_LOG +# define CINFO_IF(writer, condition_, dispatchAction, ...) \ + ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Info, dispatchAction, __VA_ARGS__) +#else +# define CINFO_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_INFO_LOG +#if ELPP_WARNING_LOG +# define CWARNING_IF(writer, condition_, dispatchAction, ...)\ + ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Warning, dispatchAction, __VA_ARGS__) +#else +# define CWARNING_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_WARNING_LOG +#if ELPP_DEBUG_LOG +# define CDEBUG_IF(writer, condition_, dispatchAction, ...)\ + ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Debug, dispatchAction, __VA_ARGS__) +#else +# define CDEBUG_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_DEBUG_LOG +#if ELPP_ERROR_LOG +# define CERROR_IF(writer, condition_, dispatchAction, ...)\ + ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Error, dispatchAction, __VA_ARGS__) +#else +# define CERROR_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_ERROR_LOG +#if ELPP_FATAL_LOG +# define CFATAL_IF(writer, condition_, dispatchAction, ...)\ + ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Fatal, dispatchAction, __VA_ARGS__) +#else +# define CFATAL_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_FATAL_LOG +#if ELPP_TRACE_LOG +# define CTRACE_IF(writer, condition_, dispatchAction, ...)\ + ELPP_WRITE_LOG_IF(writer, (condition_), el::Level::Trace, dispatchAction, __VA_ARGS__) +#else +# define CTRACE_IF(writer, condition_, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_TRACE_LOG +#if ELPP_VERBOSE_LOG +# define CVERBOSE_IF(writer, condition_, vlevel, dispatchAction, ...) if (VLOG_IS_ON(vlevel) && (condition_)) writer( \ + el::Level::Verbose, __FILE__, __LINE__, ELPP_FUNC, dispatchAction, vlevel).construct(el_getVALength(__VA_ARGS__), __VA_ARGS__) +#else +# define CVERBOSE_IF(writer, condition_, vlevel, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_VERBOSE_LOG + // Occasional logs +#if ELPP_INFO_LOG +# define CINFO_EVERY_N(writer, occasion, dispatchAction, ...)\ + ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Info, dispatchAction, __VA_ARGS__) +#else +# define CINFO_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_INFO_LOG +#if ELPP_WARNING_LOG +# define CWARNING_EVERY_N(writer, occasion, dispatchAction, ...)\ + ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Warning, dispatchAction, __VA_ARGS__) +#else +# define CWARNING_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_WARNING_LOG +#if ELPP_DEBUG_LOG +# define CDEBUG_EVERY_N(writer, occasion, dispatchAction, ...)\ + ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Debug, dispatchAction, __VA_ARGS__) +#else +# define CDEBUG_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_DEBUG_LOG +#if ELPP_ERROR_LOG +# define CERROR_EVERY_N(writer, occasion, dispatchAction, ...)\ + ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Error, dispatchAction, __VA_ARGS__) +#else +# define CERROR_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_ERROR_LOG +#if ELPP_FATAL_LOG +# define CFATAL_EVERY_N(writer, occasion, dispatchAction, ...)\ + ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Fatal, dispatchAction, __VA_ARGS__) +#else +# define CFATAL_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_FATAL_LOG +#if ELPP_TRACE_LOG +# define CTRACE_EVERY_N(writer, occasion, dispatchAction, ...)\ + ELPP_WRITE_LOG_EVERY_N(writer, occasion, el::Level::Trace, dispatchAction, __VA_ARGS__) +#else +# define CTRACE_EVERY_N(writer, occasion, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_TRACE_LOG +#if ELPP_VERBOSE_LOG +# define CVERBOSE_EVERY_N(writer, occasion, vlevel, dispatchAction, ...)\ + CVERBOSE_IF(writer, ELPP->validateEveryNCounter(__FILE__, __LINE__, occasion), vlevel, dispatchAction, __VA_ARGS__) +#else +# define CVERBOSE_EVERY_N(writer, occasion, vlevel, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_VERBOSE_LOG + // After N logs +#if ELPP_INFO_LOG +# define CINFO_AFTER_N(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Info, dispatchAction, __VA_ARGS__) +#else +# define CINFO_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_INFO_LOG +#if ELPP_WARNING_LOG +# define CWARNING_AFTER_N(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Warning, dispatchAction, __VA_ARGS__) +#else +# define CWARNING_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_WARNING_LOG +#if ELPP_DEBUG_LOG +# define CDEBUG_AFTER_N(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Debug, dispatchAction, __VA_ARGS__) +#else +# define CDEBUG_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_DEBUG_LOG +#if ELPP_ERROR_LOG +# define CERROR_AFTER_N(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Error, dispatchAction, __VA_ARGS__) +#else +# define CERROR_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_ERROR_LOG +#if ELPP_FATAL_LOG +# define CFATAL_AFTER_N(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Fatal, dispatchAction, __VA_ARGS__) +#else +# define CFATAL_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_FATAL_LOG +#if ELPP_TRACE_LOG +# define CTRACE_AFTER_N(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_AFTER_N(writer, n, el::Level::Trace, dispatchAction, __VA_ARGS__) +#else +# define CTRACE_AFTER_N(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_TRACE_LOG +#if ELPP_VERBOSE_LOG +# define CVERBOSE_AFTER_N(writer, n, vlevel, dispatchAction, ...)\ + CVERBOSE_IF(writer, ELPP->validateAfterNCounter(__FILE__, __LINE__, n), vlevel, dispatchAction, __VA_ARGS__) +#else +# define CVERBOSE_AFTER_N(writer, n, vlevel, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_VERBOSE_LOG + // N Times logs +#if ELPP_INFO_LOG +# define CINFO_N_TIMES(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Info, dispatchAction, __VA_ARGS__) +#else +# define CINFO_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_INFO_LOG +#if ELPP_WARNING_LOG +# define CWARNING_N_TIMES(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Warning, dispatchAction, __VA_ARGS__) +#else +# define CWARNING_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_WARNING_LOG +#if ELPP_DEBUG_LOG +# define CDEBUG_N_TIMES(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Debug, dispatchAction, __VA_ARGS__) +#else +# define CDEBUG_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_DEBUG_LOG +#if ELPP_ERROR_LOG +# define CERROR_N_TIMES(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Error, dispatchAction, __VA_ARGS__) +#else +# define CERROR_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_ERROR_LOG +#if ELPP_FATAL_LOG +# define CFATAL_N_TIMES(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Fatal, dispatchAction, __VA_ARGS__) +#else +# define CFATAL_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_FATAL_LOG +#if ELPP_TRACE_LOG +# define CTRACE_N_TIMES(writer, n, dispatchAction, ...)\ + ELPP_WRITE_LOG_N_TIMES(writer, n, el::Level::Trace, dispatchAction, __VA_ARGS__) +#else +# define CTRACE_N_TIMES(writer, n, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_TRACE_LOG +#if ELPP_VERBOSE_LOG +# define CVERBOSE_N_TIMES(writer, n, vlevel, dispatchAction, ...)\ + CVERBOSE_IF(writer, ELPP->validateNTimesCounter(__FILE__, __LINE__, n), vlevel, dispatchAction, __VA_ARGS__) +#else +# define CVERBOSE_N_TIMES(writer, n, vlevel, dispatchAction, ...) el::base::NullWriter() +#endif // ELPP_VERBOSE_LOG + // + // Custom Loggers - Requires (level, dispatchAction, loggerId/s) + // + // undef existing +#undef CLOG +#undef CLOG_VERBOSE +#undef CVLOG +#undef CLOG_IF +#undef CLOG_VERBOSE_IF +#undef CVLOG_IF +#undef CLOG_EVERY_N +#undef CVLOG_EVERY_N +#undef CLOG_AFTER_N +#undef CVLOG_AFTER_N +#undef CLOG_N_TIMES +#undef CVLOG_N_TIMES + // Normal logs +#define CLOG(LEVEL, ...)\ + C##LEVEL(el::base::Writer, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CVLOG(vlevel, ...) CVERBOSE(el::base::Writer, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) + // Conditional logs +#define CLOG_IF(condition, LEVEL, ...)\ + C##LEVEL##_IF(el::base::Writer, condition, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CVLOG_IF(condition, vlevel, ...)\ + CVERBOSE_IF(el::base::Writer, condition, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) + // Hit counts based logs +#define CLOG_EVERY_N(n, LEVEL, ...)\ + C##LEVEL##_EVERY_N(el::base::Writer, n, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CVLOG_EVERY_N(n, vlevel, ...)\ + CVERBOSE_EVERY_N(el::base::Writer, n, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CLOG_AFTER_N(n, LEVEL, ...)\ + C##LEVEL##_AFTER_N(el::base::Writer, n, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CVLOG_AFTER_N(n, vlevel, ...)\ + CVERBOSE_AFTER_N(el::base::Writer, n, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CLOG_N_TIMES(n, LEVEL, ...)\ + C##LEVEL##_N_TIMES(el::base::Writer, n, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CVLOG_N_TIMES(n, vlevel, ...)\ + CVERBOSE_N_TIMES(el::base::Writer, n, vlevel, el::base::DispatchAction::NormalLog, __VA_ARGS__) + // + // Default Loggers macro using CLOG(), CLOG_VERBOSE() and CVLOG() macros + // + // undef existing +#undef LOG +#undef VLOG +#undef LOG_IF +#undef VLOG_IF +#undef LOG_EVERY_N +#undef VLOG_EVERY_N +#undef LOG_AFTER_N +#undef VLOG_AFTER_N +#undef LOG_N_TIMES +#undef VLOG_N_TIMES +#undef ELPP_CURR_FILE_LOGGER_ID +#if defined(ELPP_DEFAULT_LOGGER) +# define ELPP_CURR_FILE_LOGGER_ID ELPP_DEFAULT_LOGGER +#else +# define ELPP_CURR_FILE_LOGGER_ID el::base::consts::kDefaultLoggerId +#endif +#undef ELPP_TRACE +#define ELPP_TRACE CLOG(TRACE, ELPP_CURR_FILE_LOGGER_ID) + // Normal logs +#define LOG(LEVEL) CLOG(LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define VLOG(vlevel) CVLOG(vlevel, ELPP_CURR_FILE_LOGGER_ID) + // Conditional logs +#define LOG_IF(condition, LEVEL) CLOG_IF(condition, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define VLOG_IF(condition, vlevel) CVLOG_IF(condition, vlevel, ELPP_CURR_FILE_LOGGER_ID) + // Hit counts based logs +#define LOG_EVERY_N(n, LEVEL) CLOG_EVERY_N(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define VLOG_EVERY_N(n, vlevel) CVLOG_EVERY_N(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) +#define LOG_AFTER_N(n, LEVEL) CLOG_AFTER_N(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define VLOG_AFTER_N(n, vlevel) CVLOG_AFTER_N(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) +#define LOG_N_TIMES(n, LEVEL) CLOG_N_TIMES(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define VLOG_N_TIMES(n, vlevel) CVLOG_N_TIMES(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) + // Generic PLOG() +#undef CPLOG +#undef CPLOG_IF +#undef PLOG +#undef PLOG_IF +#undef DCPLOG +#undef DCPLOG_IF +#undef DPLOG +#undef DPLOG_IF +#define CPLOG(LEVEL, ...)\ + C##LEVEL(el::base::PErrorWriter, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define CPLOG_IF(condition, LEVEL, ...)\ + C##LEVEL##_IF(el::base::PErrorWriter, condition, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define DCPLOG(LEVEL, ...)\ + if (ELPP_DEBUG_LOG) C##LEVEL(el::base::PErrorWriter, el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define DCPLOG_IF(condition, LEVEL, ...)\ + C##LEVEL##_IF(el::base::PErrorWriter, (ELPP_DEBUG_LOG) && (condition), el::base::DispatchAction::NormalLog, __VA_ARGS__) +#define PLOG(LEVEL) CPLOG(LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define PLOG_IF(condition, LEVEL) CPLOG_IF(condition, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DPLOG(LEVEL) DCPLOG(LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DPLOG_IF(condition, LEVEL) DCPLOG_IF(condition, LEVEL, ELPP_CURR_FILE_LOGGER_ID) + // Generic SYSLOG() +#undef CSYSLOG +#undef CSYSLOG_IF +#undef CSYSLOG_EVERY_N +#undef CSYSLOG_AFTER_N +#undef CSYSLOG_N_TIMES +#undef SYSLOG +#undef SYSLOG_IF +#undef SYSLOG_EVERY_N +#undef SYSLOG_AFTER_N +#undef SYSLOG_N_TIMES +#undef DCSYSLOG +#undef DCSYSLOG_IF +#undef DCSYSLOG_EVERY_N +#undef DCSYSLOG_AFTER_N +#undef DCSYSLOG_N_TIMES +#undef DSYSLOG +#undef DSYSLOG_IF +#undef DSYSLOG_EVERY_N +#undef DSYSLOG_AFTER_N +#undef DSYSLOG_N_TIMES +#if defined(ELPP_SYSLOG) +# define CSYSLOG(LEVEL, ...)\ + C##LEVEL(el::base::Writer, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define CSYSLOG_IF(condition, LEVEL, ...)\ + C##LEVEL##_IF(el::base::Writer, condition, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define CSYSLOG_EVERY_N(n, LEVEL, ...) C##LEVEL##_EVERY_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define CSYSLOG_AFTER_N(n, LEVEL, ...) C##LEVEL##_AFTER_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define CSYSLOG_N_TIMES(n, LEVEL, ...) C##LEVEL##_N_TIMES(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define SYSLOG(LEVEL) CSYSLOG(LEVEL, el::base::consts::kSysLogLoggerId) +# define SYSLOG_IF(condition, LEVEL) CSYSLOG_IF(condition, LEVEL, el::base::consts::kSysLogLoggerId) +# define SYSLOG_EVERY_N(n, LEVEL) CSYSLOG_EVERY_N(n, LEVEL, el::base::consts::kSysLogLoggerId) +# define SYSLOG_AFTER_N(n, LEVEL) CSYSLOG_AFTER_N(n, LEVEL, el::base::consts::kSysLogLoggerId) +# define SYSLOG_N_TIMES(n, LEVEL) CSYSLOG_N_TIMES(n, LEVEL, el::base::consts::kSysLogLoggerId) +# define DCSYSLOG(LEVEL, ...) if (ELPP_DEBUG_LOG) C##LEVEL(el::base::Writer, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define DCSYSLOG_IF(condition, LEVEL, ...)\ + C##LEVEL##_IF(el::base::Writer, (ELPP_DEBUG_LOG) && (condition), el::base::DispatchAction::SysLog, __VA_ARGS__) +# define DCSYSLOG_EVERY_N(n, LEVEL, ...)\ + if (ELPP_DEBUG_LOG) C##LEVEL##_EVERY_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define DCSYSLOG_AFTER_N(n, LEVEL, ...)\ + if (ELPP_DEBUG_LOG) C##LEVEL##_AFTER_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define DCSYSLOG_N_TIMES(n, LEVEL, ...)\ + if (ELPP_DEBUG_LOG) C##LEVEL##_EVERY_N(el::base::Writer, n, el::base::DispatchAction::SysLog, __VA_ARGS__) +# define DSYSLOG(LEVEL) DCSYSLOG(LEVEL, el::base::consts::kSysLogLoggerId) +# define DSYSLOG_IF(condition, LEVEL) DCSYSLOG_IF(condition, LEVEL, el::base::consts::kSysLogLoggerId) +# define DSYSLOG_EVERY_N(n, LEVEL) DCSYSLOG_EVERY_N(n, LEVEL, el::base::consts::kSysLogLoggerId) +# define DSYSLOG_AFTER_N(n, LEVEL) DCSYSLOG_AFTER_N(n, LEVEL, el::base::consts::kSysLogLoggerId) +# define DSYSLOG_N_TIMES(n, LEVEL) DCSYSLOG_N_TIMES(n, LEVEL, el::base::consts::kSysLogLoggerId) +#else +# define CSYSLOG(LEVEL, ...) el::base::NullWriter() +# define CSYSLOG_IF(condition, LEVEL, ...) el::base::NullWriter() +# define CSYSLOG_EVERY_N(n, LEVEL, ...) el::base::NullWriter() +# define CSYSLOG_AFTER_N(n, LEVEL, ...) el::base::NullWriter() +# define CSYSLOG_N_TIMES(n, LEVEL, ...) el::base::NullWriter() +# define SYSLOG(LEVEL) el::base::NullWriter() +# define SYSLOG_IF(condition, LEVEL) el::base::NullWriter() +# define SYSLOG_EVERY_N(n, LEVEL) el::base::NullWriter() +# define SYSLOG_AFTER_N(n, LEVEL) el::base::NullWriter() +# define SYSLOG_N_TIMES(n, LEVEL) el::base::NullWriter() +# define DCSYSLOG(LEVEL, ...) el::base::NullWriter() +# define DCSYSLOG_IF(condition, LEVEL, ...) el::base::NullWriter() +# define DCSYSLOG_EVERY_N(n, LEVEL, ...) el::base::NullWriter() +# define DCSYSLOG_AFTER_N(n, LEVEL, ...) el::base::NullWriter() +# define DCSYSLOG_N_TIMES(n, LEVEL, ...) el::base::NullWriter() +# define DSYSLOG(LEVEL) el::base::NullWriter() +# define DSYSLOG_IF(condition, LEVEL) el::base::NullWriter() +# define DSYSLOG_EVERY_N(n, LEVEL) el::base::NullWriter() +# define DSYSLOG_AFTER_N(n, LEVEL) el::base::NullWriter() +# define DSYSLOG_N_TIMES(n, LEVEL) el::base::NullWriter() +#endif // defined(ELPP_SYSLOG) + // + // Custom Debug Only Loggers - Requires (level, loggerId/s) + // + // undef existing +#undef DCLOG +#undef DCVLOG +#undef DCLOG_IF +#undef DCVLOG_IF +#undef DCLOG_EVERY_N +#undef DCVLOG_EVERY_N +#undef DCLOG_AFTER_N +#undef DCVLOG_AFTER_N +#undef DCLOG_N_TIMES +#undef DCVLOG_N_TIMES + // Normal logs +#define DCLOG(LEVEL, ...) if (ELPP_DEBUG_LOG) CLOG(LEVEL, __VA_ARGS__) +#define DCLOG_VERBOSE(vlevel, ...) if (ELPP_DEBUG_LOG) CLOG_VERBOSE(vlevel, __VA_ARGS__) +#define DCVLOG(vlevel, ...) if (ELPP_DEBUG_LOG) CVLOG(vlevel, __VA_ARGS__) + // Conditional logs +#define DCLOG_IF(condition, LEVEL, ...) if (ELPP_DEBUG_LOG) CLOG_IF(condition, LEVEL, __VA_ARGS__) +#define DCVLOG_IF(condition, vlevel, ...) if (ELPP_DEBUG_LOG) CVLOG_IF(condition, vlevel, __VA_ARGS__) + // Hit counts based logs +#define DCLOG_EVERY_N(n, LEVEL, ...) if (ELPP_DEBUG_LOG) CLOG_EVERY_N(n, LEVEL, __VA_ARGS__) +#define DCVLOG_EVERY_N(n, vlevel, ...) if (ELPP_DEBUG_LOG) CVLOG_EVERY_N(n, vlevel, __VA_ARGS__) +#define DCLOG_AFTER_N(n, LEVEL, ...) if (ELPP_DEBUG_LOG) CLOG_AFTER_N(n, LEVEL, __VA_ARGS__) +#define DCVLOG_AFTER_N(n, vlevel, ...) if (ELPP_DEBUG_LOG) CVLOG_AFTER_N(n, vlevel, __VA_ARGS__) +#define DCLOG_N_TIMES(n, LEVEL, ...) if (ELPP_DEBUG_LOG) CLOG_N_TIMES(n, LEVEL, __VA_ARGS__) +#define DCVLOG_N_TIMES(n, vlevel, ...) if (ELPP_DEBUG_LOG) CVLOG_N_TIMES(n, vlevel, __VA_ARGS__) + // + // Default Debug Only Loggers macro using CLOG(), CLOG_VERBOSE() and CVLOG() macros + // + // undef existing +#undef DLOG +#undef DVLOG +#undef DLOG_IF +#undef DVLOG_IF +#undef DLOG_EVERY_N +#undef DVLOG_EVERY_N +#undef DLOG_AFTER_N +#undef DVLOG_AFTER_N +#undef DLOG_N_TIMES +#undef DVLOG_N_TIMES + // Normal logs +#define DLOG(LEVEL) DCLOG(LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DVLOG(vlevel) DCVLOG(vlevel, ELPP_CURR_FILE_LOGGER_ID) + // Conditional logs +#define DLOG_IF(condition, LEVEL) DCLOG_IF(condition, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DVLOG_IF(condition, vlevel) DCVLOG_IF(condition, vlevel, ELPP_CURR_FILE_LOGGER_ID) + // Hit counts based logs +#define DLOG_EVERY_N(n, LEVEL) DCLOG_EVERY_N(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DVLOG_EVERY_N(n, vlevel) DCVLOG_EVERY_N(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) +#define DLOG_AFTER_N(n, LEVEL) DCLOG_AFTER_N(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DVLOG_AFTER_N(n, vlevel) DCVLOG_AFTER_N(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) +#define DLOG_N_TIMES(n, LEVEL) DCLOG_N_TIMES(n, LEVEL, ELPP_CURR_FILE_LOGGER_ID) +#define DVLOG_N_TIMES(n, vlevel) DCVLOG_N_TIMES(n, vlevel, ELPP_CURR_FILE_LOGGER_ID) + // Check macros +#undef CCHECK +#undef CPCHECK +#undef CCHECK_EQ +#undef CCHECK_NE +#undef CCHECK_LT +#undef CCHECK_GT +#undef CCHECK_LE +#undef CCHECK_GE +#undef CCHECK_BOUNDS +#undef CCHECK_NOTNULL +#undef CCHECK_STRCASEEQ +#undef CCHECK_STRCASENE +#undef CHECK +#undef PCHECK +#undef CHECK_EQ +#undef CHECK_NE +#undef CHECK_LT +#undef CHECK_GT +#undef CHECK_LE +#undef CHECK_GE +#undef CHECK_BOUNDS +#undef CHECK_NOTNULL +#undef CHECK_STRCASEEQ +#undef CHECK_STRCASENE +#define CCHECK(condition, ...) CLOG_IF(!(condition), FATAL, __VA_ARGS__) << "Check failed: [" << #condition << "] " +#define CPCHECK(condition, ...) CPLOG_IF(!(condition), FATAL, __VA_ARGS__) << "Check failed: [" << #condition << "] " +#define CHECK(condition) CCHECK(condition, ELPP_CURR_FILE_LOGGER_ID) +#define PCHECK(condition) CPCHECK(condition, ELPP_CURR_FILE_LOGGER_ID) +#define CCHECK_EQ(a, b, ...) CCHECK(a == b, __VA_ARGS__) +#define CCHECK_NE(a, b, ...) CCHECK(a != b, __VA_ARGS__) +#define CCHECK_LT(a, b, ...) CCHECK(a < b, __VA_ARGS__) +#define CCHECK_GT(a, b, ...) CCHECK(a > b, __VA_ARGS__) +#define CCHECK_LE(a, b, ...) CCHECK(a <= b, __VA_ARGS__) +#define CCHECK_GE(a, b, ...) CCHECK(a >= b, __VA_ARGS__) +#define CCHECK_BOUNDS(val, min, max, ...) CCHECK(val >= min && val <= max, __VA_ARGS__) +#define CHECK_EQ(a, b) CCHECK_EQ(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_NE(a, b) CCHECK_NE(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_LT(a, b) CCHECK_LT(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_GT(a, b) CCHECK_GT(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_LE(a, b) CCHECK_LE(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_GE(a, b) CCHECK_GE(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_BOUNDS(val, min, max) CCHECK_BOUNDS(val, min, max, ELPP_CURR_FILE_LOGGER_ID) +namespace el { + namespace base { + namespace utils { + template + static T* checkNotNull(T* ptr, const char* name, const char* loggers, ...) { + CLOG_IF(ptr == nullptr, FATAL, loggers) << "Check failed: [" << name << " != nullptr]"; + return ptr; + } + } // namespace utils + } // namespace base +} // namespace el +#define CCHECK_NOTNULL(ptr, ...) el::base::utils::checkNotNull(ptr, #ptr, __VA_ARGS__) +#define CCHECK_STREQ(str1, str2, ...) CLOG_IF(!el::base::utils::Str::cStringEq(str1, str2), FATAL, __VA_ARGS__) \ + << "Check failed: [" << #str1 << " == " << #str2 << "] " +#define CCHECK_STRNE(str1, str2, ...) CLOG_IF(el::base::utils::Str::cStringEq(str1, str2), FATAL, __VA_ARGS__) \ + << "Check failed: [" << #str1 << " != " << #str2 << "] " +#define CCHECK_STRCASEEQ(str1, str2, ...) CLOG_IF(!el::base::utils::Str::cStringCaseEq(str1, str2), FATAL, __VA_ARGS__) \ + << "Check failed: [" << #str1 << " == " << #str2 << "] " +#define CCHECK_STRCASENE(str1, str2, ...) CLOG_IF(el::base::utils::Str::cStringCaseEq(str1, str2), FATAL, __VA_ARGS__) \ + << "Check failed: [" << #str1 << " != " << #str2 << "] " +#define CHECK_NOTNULL(ptr) CCHECK_NOTNULL(ptr, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_STREQ(str1, str2) CCHECK_STREQ(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_STRNE(str1, str2) CCHECK_STRNE(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_STRCASEEQ(str1, str2) CCHECK_STRCASEEQ(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define CHECK_STRCASENE(str1, str2) CCHECK_STRCASENE(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#undef DCCHECK +#undef DCCHECK_EQ +#undef DCCHECK_NE +#undef DCCHECK_LT +#undef DCCHECK_GT +#undef DCCHECK_LE +#undef DCCHECK_GE +#undef DCCHECK_BOUNDS +#undef DCCHECK_NOTNULL +#undef DCCHECK_STRCASEEQ +#undef DCCHECK_STRCASENE +#undef DCPCHECK +#undef DCHECK +#undef DCHECK_EQ +#undef DCHECK_NE +#undef DCHECK_LT +#undef DCHECK_GT +#undef DCHECK_LE +#undef DCHECK_GE +#undef DCHECK_BOUNDS_ +#undef DCHECK_NOTNULL +#undef DCHECK_STRCASEEQ +#undef DCHECK_STRCASENE +#undef DPCHECK +#define DCCHECK(condition, ...) if (ELPP_DEBUG_LOG) CCHECK(condition, __VA_ARGS__) +#define DCCHECK_EQ(a, b, ...) if (ELPP_DEBUG_LOG) CCHECK_EQ(a, b, __VA_ARGS__) +#define DCCHECK_NE(a, b, ...) if (ELPP_DEBUG_LOG) CCHECK_NE(a, b, __VA_ARGS__) +#define DCCHECK_LT(a, b, ...) if (ELPP_DEBUG_LOG) CCHECK_LT(a, b, __VA_ARGS__) +#define DCCHECK_GT(a, b, ...) if (ELPP_DEBUG_LOG) CCHECK_GT(a, b, __VA_ARGS__) +#define DCCHECK_LE(a, b, ...) if (ELPP_DEBUG_LOG) CCHECK_LE(a, b, __VA_ARGS__) +#define DCCHECK_GE(a, b, ...) if (ELPP_DEBUG_LOG) CCHECK_GE(a, b, __VA_ARGS__) +#define DCCHECK_BOUNDS(val, min, max, ...) if (ELPP_DEBUG_LOG) CCHECK_BOUNDS(val, min, max, __VA_ARGS__) +#define DCCHECK_NOTNULL(ptr, ...) if (ELPP_DEBUG_LOG) CCHECK_NOTNULL(ptr, __VA_ARGS__) +#define DCCHECK_STREQ(str1, str2, ...) if (ELPP_DEBUG_LOG) CCHECK_STREQ(str1, str2, __VA_ARGS__) +#define DCCHECK_STRNE(str1, str2, ...) if (ELPP_DEBUG_LOG) CCHECK_STRNE(str1, str2, __VA_ARGS__) +#define DCCHECK_STRCASEEQ(str1, str2, ...) if (ELPP_DEBUG_LOG) CCHECK_STRCASEEQ(str1, str2, __VA_ARGS__) +#define DCCHECK_STRCASENE(str1, str2, ...) if (ELPP_DEBUG_LOG) CCHECK_STRCASENE(str1, str2, __VA_ARGS__) +#define DCPCHECK(condition, ...) if (ELPP_DEBUG_LOG) CPCHECK(condition, __VA_ARGS__) +#define DCHECK(condition) DCCHECK(condition, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_EQ(a, b) DCCHECK_EQ(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_NE(a, b) DCCHECK_NE(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_LT(a, b) DCCHECK_LT(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_GT(a, b) DCCHECK_GT(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_LE(a, b) DCCHECK_LE(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_GE(a, b) DCCHECK_GE(a, b, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_BOUNDS(val, min, max) DCCHECK_BOUNDS(val, min, max, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_NOTNULL(ptr) DCCHECK_NOTNULL(ptr, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_STREQ(str1, str2) DCCHECK_STREQ(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_STRNE(str1, str2) DCCHECK_STRNE(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_STRCASEEQ(str1, str2) DCCHECK_STRCASEEQ(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define DCHECK_STRCASENE(str1, str2) DCCHECK_STRCASENE(str1, str2, ELPP_CURR_FILE_LOGGER_ID) +#define DPCHECK(condition) DCPCHECK(condition, ELPP_CURR_FILE_LOGGER_ID) +#if defined(ELPP_DISABLE_DEFAULT_CRASH_HANDLING) +# define ELPP_USE_DEF_CRASH_HANDLER false +#else +# define ELPP_USE_DEF_CRASH_HANDLER true +#endif // defined(ELPP_DISABLE_DEFAULT_CRASH_HANDLING) +#define ELPP_CRASH_HANDLER_INIT +#define ELPP_INIT_EASYLOGGINGPP(val)\ + ELPP_INITI_BASIC_DECLR\ + namespace el {\ + namespace base {\ + el::base::type::StoragePointer elStorage(val);\ + }\ + el::base::debug::CrashHandler elCrashHandler(ELPP_USE_DEF_CRASH_HANDLER);\ + } + +#if ELPP_ASYNC_LOGGING +# define INITIALIZE_EASYLOGGINGPP\ + ELPP_INIT_EASYLOGGINGPP(new el::base::Storage(el::LogBuilderPtr(new el::base::DefaultLogBuilder()),\ + new el::base::AsyncDispatchWorker()))\ + +#else +# define INITIALIZE_EASYLOGGINGPP\ + ELPP_INIT_EASYLOGGINGPP(new el::base::Storage(el::LogBuilderPtr(new el::base::DefaultLogBuilder()))) +#endif // ELPP_ASYNC_LOGGING +#define INITIALIZE_NULL_EASYLOGGINGPP\ + ELPP_INITI_BASIC_DECLR\ + namespace el {\ + namespace base {\ + el::base::type::StoragePointer elStorage;\ + }\ + el::base::debug::CrashHandler elCrashHandler(ELPP_USE_DEF_CRASH_HANDLER);\ + } + // NOTE: no ELPP_INITI_BASIC_DECLR when sharing - causes double free corruption on external symbols +#define SHARE_EASYLOGGINGPP(initializedStorage)\ + namespace el {\ + namespace base {\ + el::base::type::StoragePointer elStorage(initializedStorage);\ + }\ + el::base::debug::CrashHandler elCrashHandler(ELPP_USE_DEF_CRASH_HANDLER);\ + } + +#if defined(ELPP_UNICODE) +# define START_EASYLOGGINGPP(argc, argv) el::Helpers::setArgs(argc, argv); std::locale::global(std::locale("")) +#else +# define START_EASYLOGGINGPP(argc, argv) el::Helpers::setArgs(argc, argv) +#endif // defined(ELPP_UNICODE) +#endif // EASYLOGGINGPP_H \ No newline at end of file diff --git a/extensions/common/glm/CMakeLists.txt b/extensions/common/glm/CMakeLists.txt new file mode 100644 index 0000000000..fe28b5d975 --- /dev/null +++ b/extensions/common/glm/CMakeLists.txt @@ -0,0 +1,43 @@ +set(NAME glm_dummy) + +file(GLOB ROOT_SOURCE *.cpp) +file(GLOB ROOT_INLINE *.inl) +file(GLOB ROOT_HEADER *.hpp) +file(GLOB ROOT_TEXT ../*.txt) +file(GLOB ROOT_NAT ../util/glm.natvis) + +file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp) +file(GLOB_RECURSE CORE_INLINE ./detail/*.inl) +file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp) + +file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) +file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) +file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) + +file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) +file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) +file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) + +source_group("Text Files" FILES ${ROOT_TEXT}) +source_group("Core Files" FILES ${CORE_SOURCE}) +source_group("Core Files" FILES ${CORE_INLINE}) +source_group("Core Files" FILES ${CORE_HEADER}) +source_group("GTC Files" FILES ${GTC_SOURCE}) +source_group("GTC Files" FILES ${GTC_INLINE}) +source_group("GTC Files" FILES ${GTC_HEADER}) +source_group("GTX Files" FILES ${GTX_SOURCE}) +source_group("GTX Files" FILES ${GTX_INLINE}) +source_group("GTX Files" FILES ${GTX_HEADER}) + +include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) + +if(GLM_TEST_ENABLE) + add_executable(${NAME} ${ROOT_TEXT} ${ROOT_NAT} + ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} + ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} + ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} + ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER}) +endif(GLM_TEST_ENABLE) + +#add_library(glm STATIC glm.cpp) +#add_library(glm_shared SHARED glm.cpp) diff --git a/extensions/common/glm/common.hpp b/extensions/common/glm/common.hpp new file mode 100644 index 0000000000..57beb106a9 --- /dev/null +++ b/extensions/common/glm/common.hpp @@ -0,0 +1,35 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/common.hpp +/// @date 2013-12-24 / 2013-12-24 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "detail/func_common.hpp" diff --git a/extensions/common/glm/detail/_features.hpp b/extensions/common/glm/detail/_features.hpp new file mode 100644 index 0000000000..ce2a35d9c1 --- /dev/null +++ b/extensions/common/glm/detail/_features.hpp @@ -0,0 +1,428 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/_features.hpp +/// @date 2013-02-20 / 2013-02-20 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +// #define GLM_CXX98_EXCEPTIONS +// #define GLM_CXX98_RTTI + +// #define GLM_CXX11_RVALUE_REFERENCES +// Rvalue references - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2118.html + +// GLM_CXX11_TRAILING_RETURN +// Rvalue references for *this - GCC not supported +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2439.htm + +// GLM_CXX11_NONSTATIC_MEMBER_INIT +// Initialization of class objects by rvalues - GCC any +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1610.html + +// GLM_CXX11_NONSTATIC_MEMBER_INIT +// Non-static data member initializers - GCC 4.7 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2008/n2756.htm + +// #define GLM_CXX11_VARIADIC_TEMPLATE +// Variadic templates - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2242.pdf + +// +// Extending variadic template template parameters - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2555.pdf + +// #define GLM_CXX11_GENERALIZED_INITIALIZERS +// Initializer lists - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2672.htm + +// #define GLM_CXX11_STATIC_ASSERT +// Static assertions - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1720.html + +// #define GLM_CXX11_AUTO_TYPE +// auto-typed variables - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1984.pdf + +// #define GLM_CXX11_AUTO_TYPE +// Multi-declarator auto - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1737.pdf + +// #define GLM_CXX11_AUTO_TYPE +// Removal of auto as a storage-class specifier - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2546.htm + +// #define GLM_CXX11_AUTO_TYPE +// New function declarator syntax - GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2541.htm + +// #define GLM_CXX11_LAMBDAS +// New wording for C++0x lambdas - GCC 4.5 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2927.pdf + +// #define GLM_CXX11_DECLTYPE +// Declared type of an expression - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2343.pdf + +// +// Right angle brackets - GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1757.html + +// +// Default template arguments for function templates DR226 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#226 + +// +// Solving the SFINAE problem for expressions DR339 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2634.html + +// #define GLM_CXX11_ALIAS_TEMPLATE +// Template aliases N2258 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2258.pdf + +// +// Extern templates N1987 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1987.htm + +// #define GLM_CXX11_NULLPTR +// Null pointer constant N2431 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2431.pdf + +// #define GLM_CXX11_STRONG_ENUMS +// Strongly-typed enums N2347 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2347.pdf + +// +// Forward declarations for enums N2764 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2764.pdf + +// +// Generalized attributes N2761 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2761.pdf + +// +// Generalized constant expressions N2235 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2235.pdf + +// +// Alignment support N2341 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2341.pdf + +// #define GLM_CXX11_DELEGATING_CONSTRUCTORS +// Delegating constructors N1986 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1986.pdf + +// +// Inheriting constructors N2540 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2540.htm + +// #define GLM_CXX11_EXPLICIT_CONVERSIONS +// Explicit conversion operators N2437 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2437.pdf + +// +// New character types N2249 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2249.html + +// +// Unicode string literals N2442 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm + +// +// Raw string literals N2442 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2442.htm + +// +// Universal character name literals N2170 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2170.html + +// #define GLM_CXX11_USER_LITERALS +// User-defined literals N2765 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2765.pdf + +// +// Standard Layout Types N2342 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2342.htm + +// #define GLM_CXX11_DEFAULTED_FUNCTIONS +// #define GLM_CXX11_DELETED_FUNCTIONS +// Defaulted and deleted functions N2346 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2346.htm + +// +// Extended friend declarations N1791 GCC 4.7 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1791.pdf + +// +// Extending sizeof N2253 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2253.html + +// #define GLM_CXX11_INLINE_NAMESPACES +// Inline namespaces N2535 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2535.htm + +// #define GLM_CXX11_UNRESTRICTED_UNIONS +// Unrestricted unions N2544 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2544.pdf + +// #define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS +// Local and unnamed types as template arguments N2657 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2657.htm + +// #define GLM_CXX11_RANGE_FOR +// Range-based for N2930 GCC 4.6 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2930.html + +// #define GLM_CXX11_OVERRIDE_CONTROL +// Explicit virtual overrides N2928 N3206 N3272 GCC 4.7 +// http://www.open-std.org/JTC1/SC22/WG21/docs/papers/2009/n2928.htm +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3206.htm +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2011/n3272.htm + +// +// Minimal support for garbage collection and reachability-based leak detection N2670 No +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2670.htm + +// #define GLM_CXX11_NOEXCEPT +// Allowing move constructors to throw [noexcept] N3050 GCC 4.6 (core language only) +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3050.html + +// +// Defining move special member functions N3053 GCC 4.6 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2010/n3053.html + +// +// Sequence points N2239 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html + +// +// Atomic operations N2427 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2239.html + +// +// Strong Compare and Exchange N2748 GCC 4.5 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2427.html + +// +// Bidirectional Fences N2752 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2752.htm + +// +// Memory model N2429 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2429.htm + +// +// Data-dependency ordering: atomics and memory model N2664 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2664.htm + +// +// Propagating exceptions N2179 GCC 4.4 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html + +// +// Abandoning a process and at_quick_exit N2440 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2440.htm + +// +// Allow atomics use in signal handlers N2547 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2547.htm + +// +// Thread-local storage N2659 GCC 4.8 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2659.htm + +// +// Dynamic initialization and destruction with concurrency N2660 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2008/n2660.htm + +// +// __func__ predefined identifier N2340 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2340.htm + +// +// C99 preprocessor N1653 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2004/n1653.htm + +// +// long long N1811 GCC 4.3 +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1811.pdf + +// +// Extended integral types N1988 Yes +// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n1988.pdf + +#if(GLM_COMPILER & GLM_COMPILER_GCC) + +# if(GLM_COMPILER >= GLM_COMPILER_GCC43) +# define GLM_CXX11_STATIC_ASSERT +# endif + +#elif(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) +# if(__has_feature(cxx_exceptions)) +# define GLM_CXX98_EXCEPTIONS +# endif + +# if(__has_feature(cxx_rtti)) +# define GLM_CXX98_RTTI +# endif + +# if(__has_feature(cxx_access_control_sfinae)) +# define GLM_CXX11_ACCESS_CONTROL_SFINAE +# endif + +# if(__has_feature(cxx_alias_templates)) +# define GLM_CXX11_ALIAS_TEMPLATE +# endif + +# if(__has_feature(cxx_alignas)) +# define GLM_CXX11_ALIGNAS +# endif + +# if(__has_feature(cxx_attributes)) +# define GLM_CXX11_ATTRIBUTES +# endif + +# if(__has_feature(cxx_constexpr)) +# define GLM_CXX11_CONSTEXPR +# endif + +# if(__has_feature(cxx_decltype)) +# define GLM_CXX11_DECLTYPE +# endif + +# if(__has_feature(cxx_default_function_template_args)) +# define GLM_CXX11_DEFAULT_FUNCTION_TEMPLATE_ARGS +# endif + +# if(__has_feature(cxx_defaulted_functions)) +# define GLM_CXX11_DEFAULTED_FUNCTIONS +# endif + +# if(__has_feature(cxx_delegating_constructors)) +# define GLM_CXX11_DELEGATING_CONSTRUCTORS +# endif + +# if(__has_feature(cxx_deleted_functions)) +# define GLM_CXX11_DELETED_FUNCTIONS +# endif + +# if(__has_feature(cxx_explicit_conversions)) +# define GLM_CXX11_EXPLICIT_CONVERSIONS +# endif + +# if(__has_feature(cxx_generalized_initializers)) +# define GLM_CXX11_GENERALIZED_INITIALIZERS +# endif + +# if(__has_feature(cxx_implicit_moves)) +# define GLM_CXX11_IMPLICIT_MOVES +# endif + +# if(__has_feature(cxx_inheriting_constructors)) +# define GLM_CXX11_INHERITING_CONSTRUCTORS +# endif + +# if(__has_feature(cxx_inline_namespaces)) +# define GLM_CXX11_INLINE_NAMESPACES +# endif + +# if(__has_feature(cxx_lambdas)) +# define GLM_CXX11_LAMBDAS +# endif + +# if(__has_feature(cxx_local_type_template_args)) +# define GLM_CXX11_LOCAL_TYPE_TEMPLATE_ARGS +# endif + +# if(__has_feature(cxx_noexcept)) +# define GLM_CXX11_NOEXCEPT +# endif + +# if(__has_feature(cxx_nonstatic_member_init)) +# define GLM_CXX11_NONSTATIC_MEMBER_INIT +# endif + +# if(__has_feature(cxx_nullptr)) +# define GLM_CXX11_NULLPTR +# endif + +# if(__has_feature(cxx_override_control)) +# define GLM_CXX11_OVERRIDE_CONTROL +# endif + +# if(__has_feature(cxx_reference_qualified_functions)) +# define GLM_CXX11_REFERENCE_QUALIFIED_FUNCTIONS +# endif + +# if(__has_feature(cxx_range_for)) +# define GLM_CXX11_RANGE_FOR +# endif + +# if(__has_feature(cxx_raw_string_literals)) +# define GLM_CXX11_RAW_STRING_LITERALS +# endif + +# if(__has_feature(cxx_rvalue_references)) +# define GLM_CXX11_RVALUE_REFERENCES +# endif + +# if(__has_feature(cxx_static_assert)) +# define GLM_CXX11_STATIC_ASSERT +# endif + +# if(__has_feature(cxx_auto_type)) +# define GLM_CXX11_AUTO_TYPE +# endif + +# if(__has_feature(cxx_strong_enums)) +# define GLM_CXX11_STRONG_ENUMS +# endif + +# if(__has_feature(cxx_trailing_return)) +# define GLM_CXX11_TRAILING_RETURN +# endif + +# if(__has_feature(cxx_unicode_literals)) +# define GLM_CXX11_UNICODE_LITERALS +# endif + +# if(__has_feature(cxx_unrestricted_unions)) +# define GLM_CXX11_UNRESTRICTED_UNIONS +# endif + +# if(__has_feature(cxx_user_literals)) +# define GLM_CXX11_USER_LITERALS +# endif + +# if(__has_feature(cxx_variadic_templates)) +# define GLM_CXX11_VARIADIC_TEMPLATES +# endif + +#endif//(GLM_COMPILER & (GLM_COMPILER_APPLE_CLANG | GLM_COMPILER_LLVM)) diff --git a/extensions/common/glm/detail/_fixes.hpp b/extensions/common/glm/detail/_fixes.hpp new file mode 100644 index 0000000000..9728cafb73 --- /dev/null +++ b/extensions/common/glm/detail/_fixes.hpp @@ -0,0 +1,59 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/_fixes.hpp +/// @date 2011-02-21 / 2011-11-22 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#include + +//! Workaround for compatibility with other libraries +#ifdef max +#undef max +#endif + +//! Workaround for compatibility with other libraries +#ifdef min +#undef min +#endif + +//! Workaround for Android +#ifdef isnan +#undef isnan +#endif + +//! Workaround for Android +#ifdef isinf +#undef isinf +#endif + +//! Workaround for Chrone Native Client +#ifdef log2 +#undef log2 +#endif + diff --git a/extensions/common/glm/detail/_noise.hpp b/extensions/common/glm/detail/_noise.hpp new file mode 100644 index 0000000000..296709d4b9 --- /dev/null +++ b/extensions/common/glm/detail/_noise.hpp @@ -0,0 +1,136 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/_noise.hpp +/// @date 2013-12-24 / 2013-12-24 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "../vec2.hpp" +#include "../vec3.hpp" +#include "../vec4.hpp" +#include "../common.hpp" + +namespace glm{ +namespace detail +{ + template + GLM_FUNC_QUALIFIER T mod289(T const & x) + { + return x - floor(x * static_cast(1.0) / static_cast(289.0)) * static_cast(289.0); + } + + template + GLM_FUNC_QUALIFIER T permute(T const & x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER tvec2 permute(tvec2 const & x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER tvec3 permute(tvec3 const & x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } + + template + GLM_FUNC_QUALIFIER tvec4 permute(tvec4 const & x) + { + return mod289(((x * static_cast(34)) + static_cast(1)) * x); + } +/* + template class vecType> + GLM_FUNC_QUALIFIER vecType permute(vecType const & x) + { + return mod289(((x * T(34)) + T(1)) * x); + } +*/ + template + GLM_FUNC_QUALIFIER T taylorInvSqrt(T const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER tvec2 taylorInvSqrt(tvec2 const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER tvec3 taylorInvSqrt(tvec3 const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } + + template + GLM_FUNC_QUALIFIER tvec4 taylorInvSqrt(tvec4 const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } +/* + template class vecType> + GLM_FUNC_QUALIFIER vecType taylorInvSqrt(vecType const & r) + { + return T(1.79284291400159) - T(0.85373472095314) * r; + } +*/ + + template + GLM_FUNC_QUALIFIER tvec2 fade(tvec2 const & t) + { + return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + } + + template + GLM_FUNC_QUALIFIER tvec3 fade(tvec3 const & t) + { + return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + } + + template + GLM_FUNC_QUALIFIER tvec4 fade(tvec4 const & t) + { + return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + } +/* + template class vecType> + GLM_FUNC_QUALIFIER vecType fade(vecType const & t) + { + return (t * t * t) * (t * (t * T(6) - T(15)) + T(10)); + } +*/ +}//namespace detail +}//namespace glm + diff --git a/extensions/common/glm/detail/_swizzle.hpp b/extensions/common/glm/detail/_swizzle.hpp new file mode 100644 index 0000000000..04ea55bcf2 --- /dev/null +++ b/extensions/common/glm/detail/_swizzle.hpp @@ -0,0 +1,833 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/_swizzle.hpp +/// @date 2006-04-20 / 2011-02-16 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +namespace glm{ +namespace detail +{ + // Internal class for implementing swizzle operators + template + struct _swizzle_base0 + { + typedef T value_type; + + protected: + GLM_FUNC_QUALIFIER value_type& elem (size_t i) { return (reinterpret_cast(_buffer))[i]; } + GLM_FUNC_QUALIFIER const value_type& elem (size_t i) const { return (reinterpret_cast(_buffer))[i]; } + + // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. + // The size 1 buffer is assumed to aligned to the actual members so that the + // elem() + char _buffer[1]; + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1)); } + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); } + }; + + template + struct _swizzle_base1 : public _swizzle_base0 + { + GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } + }; + + // Internal class for implementing swizzle operators + /* + Template parameters: + + ValueType = type of scalar values (e.g. float, double) + VecType = class the swizzle is applies to (e.g. tvec3) + N = number of components in the vector (e.g. 3) + E0...3 = what index the n-th element of this swizzle refers to in the unswizzled vec + + DUPLICATE_ELEMENTS = 1 if there is a repeated element, 0 otherwise (used to specialize swizzles + containing duplicate elements so that they cannot be used as r-values). + */ + template + struct _swizzle_base2 : public _swizzle_base1 + { + typedef VecType vec_type; + typedef ValueType value_type; + + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const ValueType& t) + { + for (int i = 0; i < N; ++i) + (*this)[i] = t; + return *this; + } + + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const VecType& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e = t; } + }; + _apply_op(that, op()); + return *this; + } + + GLM_FUNC_QUALIFIER void operator -= (const VecType& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e -= t; } + }; + _apply_op(that, op()); + } + + GLM_FUNC_QUALIFIER void operator += (const VecType& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e += t; } + }; + _apply_op(that, op()); + } + + GLM_FUNC_QUALIFIER void operator *= (const VecType& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e *= t; } + }; + _apply_op(that, op()); + } + + GLM_FUNC_QUALIFIER void operator /= (const VecType& that) + { + struct op { + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e /= t; } + }; + _apply_op(that, op()); + } + + GLM_FUNC_QUALIFIER value_type& operator[] (size_t i) + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + + protected: + template + GLM_FUNC_QUALIFIER void _apply_op(const VecType& that, T op) + { + // Make a copy of the data in this == &that. + // The copier should optimize out the copy in cases where the function is + // properly inlined and the copy is not necessary. + ValueType t[N]; + for (int i = 0; i < N; ++i) + t[i] = that[i]; + for (int i = 0; i < N; ++i) + op( (*this)[i], t[i] ); + } + }; + + // Specialization for swizzles containing duplicate elements. These cannot be modified. + template + struct _swizzle_base2 : public _swizzle_base1 + { + typedef VecType vec_type; + typedef ValueType value_type; + + struct Stub {}; + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const &) { return *this; } + + GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const + { + const int offset_dst[4] = { E0, E1, E2, E3 }; + return this->elem(offset_dst[i]); + } + }; + + template + struct _swizzle : public _swizzle_base2 + { + typedef _swizzle_base2 base_type; + + using base_type::operator=; + + GLM_FUNC_QUALIFIER operator VecType () const { return (*this)(); } + }; + +// +// To prevent the C++ syntax from getting entirely overwhelming, define some alias macros +// +#define _GLM_SWIZZLE_TEMPLATE1 template +#define _GLM_SWIZZLE_TEMPLATE2 template +#define _GLM_SWIZZLE_TYPE1 _swizzle +#define _GLM_SWIZZLE_TYPE2 _swizzle + +// +// Wrapper for a binary operator (e.g. u.yy + v.zy) +// +#define _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ + _GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ + { \ + return a() OPERAND b(); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \ + { \ + return a() OPERAND b; \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \ + { \ + return a OPERAND b(); \ + } + +// +// Wrapper for a operand between a swizzle and a binary (e.g. 1.0f - u.xyz) +// +#define _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \ + { \ + return a() OPERAND b; \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \ + { \ + return a OPERAND b(); \ + } + +// +// Macro for wrapping a function taking one argument (e.g. abs()) +// +#define _GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \ + { \ + return FUNCTION(a()); \ + } + +// +// Macro for wrapping a function taking two vector arguments (e.g. dot()). +// +#define _GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \ + _GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ + { \ + return FUNCTION(a(), b()); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \ + { \ + return FUNCTION(a(), b()); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \ + { \ + return FUNCTION(a(), b); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \ + { \ + return FUNCTION(a, b()); \ + } + +// +// Macro for wrapping a function take 2 vec arguments followed by a scalar (e.g. mix()). +// +#define _GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \ + _GLM_SWIZZLE_TEMPLATE2 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \ + { \ + return FUNCTION(a(), b(), c); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ + { \ + return FUNCTION(a(), b(), c); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ + { \ + return FUNCTION(a(), b, c); \ + } \ + _GLM_SWIZZLE_TEMPLATE1 \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ + { \ + return FUNCTION(a, b(), c); \ + } + +}//namespace detail +}//namespace glm + +namespace glm +{ + namespace detail + { + _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(-) + _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(*) + _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(+) + _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(-) + _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(*) + _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(/) + } + + // + // Swizzles are distinct types from the unswizzled type. The below macros will + // provide template specializations for the swizzle types for the given functions + // so that the compiler does not have any ambiguity to choosing how to handle + // the function. + // + // The alternative is to use the operator()() when calling the function in order + // to explicitly convert the swizzled type to the unswizzled type. + // + + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, abs); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acos); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, acosh); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, all); + //_GLM_SWIZZLE_FUNCTION_1_ARGS(vec_type, any); + + //_GLM_SWIZZLE_FUNCTION_2_ARGS(value_type, dot); + //_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, cross); + //_GLM_SWIZZLE_FUNCTION_2_ARGS(vec_type, step); + //_GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(vec_type, mix); +} + +#define _GLM_SWIZZLE2_2_MEMBERS(T, P, V, E0,E1) \ + struct { detail::_swizzle<2, T, P, V, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2, T, P, V, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2, T, P, V, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2, T, P, V, 1,1,-1,-2> E1 ## E1; }; + +#define _GLM_SWIZZLE2_3_MEMBERS(T, P, V, E0,E1) \ + struct { detail::_swizzle<3,T, P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T, P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T, P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T, P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T, P, V, 1,1,1,-1> E1 ## E1 ## E1; }; + +#define _GLM_SWIZZLE2_4_MEMBERS(T, P, V, E0,E1) \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; + +#define _GLM_SWIZZLE3_2_MEMBERS(T, P, V, E0,E1,E2) \ + struct { detail::_swizzle<2,T, P, V, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 0,2,-1,-2> E0 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 1,1,-1,-2> E1 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 1,2,-1,-2> E1 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 2,0,-1,-2> E2 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 2,1,-1,-2> E2 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 2,2,-1,-2> E2 ## E2; }; + +#define _GLM_SWIZZLE3_3_MEMBERS(T, P, V ,E0,E1,E2) \ + struct { detail::_swizzle<3,T,P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,0,2,-1> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,2,-1> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,2,-1> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,1,-1> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,2,-1> E2 ## E2 ## E2; }; + +#define _GLM_SWIZZLE3_4_MEMBERS(T, P, V, E0,E1,E2) \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4,T, P, V, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; + +#define _GLM_SWIZZLE4_2_MEMBERS(T, P, V, E0,E1,E2,E3) \ + struct { detail::_swizzle<2,T, P, V, 0,0,-1,-2> E0 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 0,1,-1,-2> E0 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 0,2,-1,-2> E0 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 0,3,-1,-2> E0 ## E3; }; \ + struct { detail::_swizzle<2,T, P, V, 1,0,-1,-2> E1 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 1,1,-1,-2> E1 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 1,2,-1,-2> E1 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 1,3,-1,-2> E1 ## E3; }; \ + struct { detail::_swizzle<2,T, P, V, 2,0,-1,-2> E2 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 2,1,-1,-2> E2 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 2,2,-1,-2> E2 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 2,3,-1,-2> E2 ## E3; }; \ + struct { detail::_swizzle<2,T, P, V, 3,0,-1,-2> E3 ## E0; }; \ + struct { detail::_swizzle<2,T, P, V, 3,1,-1,-2> E3 ## E1; }; \ + struct { detail::_swizzle<2,T, P, V, 3,2,-1,-2> E3 ## E2; }; \ + struct { detail::_swizzle<2,T, P, V, 3,3,-1,-2> E3 ## E3; }; + +#define _GLM_SWIZZLE4_3_MEMBERS(T,P, V, E0,E1,E2,E3) \ + struct { detail::_swizzle<3,T,P, V, 0,0,0,-1> E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,0,1,-1> E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,0,2,-1> E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 0,0,3,-1> E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,0,-1> E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,1,-1> E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,2,-1> E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 0,1,3,-1> E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,0,-1> E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,1,-1> E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,2,-1> E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 0,2,3,-1> E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 0,3,0,-1> E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 0,3,1,-1> E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 0,3,2,-1> E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 0,3,3,-1> E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,0,-1> E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,1,-1> E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,2,-1> E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,0,3,-1> E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,0,-1> E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,1,-1> E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,2,-1> E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,1,3,-1> E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,0,-1> E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,1,-1> E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,2,-1> E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,2,3,-1> E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 1,3,0,-1> E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 1,3,1,-1> E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 1,3,2,-1> E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 1,3,3,-1> E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,0,-1> E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,1,-1> E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,2,-1> E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,0,3,-1> E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,0,-1> E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,1,-1> E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,2,-1> E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,1,3,-1> E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,0,-1> E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,1,-1> E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,2,-1> E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,2,3,-1> E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 2,3,0,-1> E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 2,3,1,-1> E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 2,3,2,-1> E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 2,3,3,-1> E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 3,0,0,-1> E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 3,0,1,-1> E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 3,0,2,-1> E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 3,0,3,-1> E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 3,1,0,-1> E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 3,1,1,-1> E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 3,1,2,-1> E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 3,1,3,-1> E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 3,2,0,-1> E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 3,2,1,-1> E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 3,2,2,-1> E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 3,2,3,-1> E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<3,T,P, V, 3,3,0,-1> E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<3,T,P, V, 3,3,1,-1> E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<3,T,P, V, 3,3,2,-1> E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<3,T,P, V, 3,3,3,-1> E3 ## E3 ## E3; }; + +#define _GLM_SWIZZLE4_4_MEMBERS(T, P, V, E0,E1,E2,E3) \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,0> E0 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,1> E0 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,2> E0 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,0,3> E0 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,0> E0 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,1> E0 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,2> E0 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,1,3> E0 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,0> E0 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,1> E0 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,2> E0 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,2,3> E0 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,0> E0 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,1> E0 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,2> E0 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,0,3,3> E0 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,0> E0 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,1> E0 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,2> E0 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,0,3> E0 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,0> E0 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,1> E0 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,2> E0 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,1,3> E0 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,0> E0 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,1> E0 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,2> E0 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,2,3> E0 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,0> E0 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,1> E0 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,2> E0 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,1,3,3> E0 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,0> E0 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,1> E0 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,2> E0 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,0,3> E0 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,0> E0 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,1> E0 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,2> E0 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,1,3> E0 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,0> E0 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,1> E0 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,2> E0 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,2,3> E0 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,0> E0 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,0,3> E1 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,0> E1 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,1> E1 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,2> E1 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,1,3> E1 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,0> E1 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,1> E1 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,2> E1 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,2,3> E1 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,0> E1 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,1> E1 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,2> E1 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,0,3,3> E1 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,0> E1 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,1> E1 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,2> E1 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,0,3> E1 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,0> E1 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,1> E1 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,2> E1 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,1,3> E1 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,0> E1 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,1> E1 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,2> E1 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,2,3> E1 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,0> E1 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,1> E1 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,2> E1 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,1,3,3> E1 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,0> E1 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,1> E1 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,2> E1 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,0,3> E1 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,0> E1 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,1> E1 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,2> E1 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,1,3> E1 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,0> E1 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,1> E1 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,2> E1 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,2,3> E1 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,0> E1 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,1> E1 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,2> E1 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,2,3,3> E1 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,0> E1 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,1> E1 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,2> E1 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,0,3> E1 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,0> E1 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,1> E1 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,2> E1 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,1,3> E1 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,0> E1 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,1> E1 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,2> E1 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,2,3> E1 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,0> E1 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,1> E1 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,2> E1 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 1,3,3,3> E1 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,0> E2 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,1> E2 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,2> E2 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,0,3> E2 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,0> E2 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,1> E2 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,2> E2 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,1,3> E2 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,0> E2 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,1> E2 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,2> E2 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,2,3> E2 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,0> E2 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,1> E2 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,2> E2 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,0,3,3> E2 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,0> E2 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,1> E2 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,2> E2 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,0,3> E2 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,0> E2 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,1> E2 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,2> E2 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,1,3> E2 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,0> E2 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,1> E2 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,2> E2 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,2,3> E2 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,0> E2 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,1> E2 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,2> E2 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,1,3,3> E2 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,0> E2 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,1> E2 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,2> E2 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,0,3> E2 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,0> E2 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,1> E2 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,2> E2 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,1,3> E2 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,0> E2 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,1> E2 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,2> E2 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,2,3> E2 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,0> E2 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,1> E2 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,2> E2 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,2,3,3> E2 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,0> E2 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,1> E2 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,2> E2 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,0,3> E2 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,0> E2 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,1> E2 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,2> E2 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,1,3> E2 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,0> E2 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,1> E2 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,2> E2 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,2,3> E2 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,0> E2 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,1> E2 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,2> E2 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 2,3,3,3> E2 ## E3 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,0> E3 ## E0 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,1> E3 ## E0 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,2> E3 ## E0 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,0,3> E3 ## E0 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,0> E3 ## E0 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,1> E3 ## E0 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,2> E3 ## E0 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,1,3> E3 ## E0 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,0> E3 ## E0 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,1> E3 ## E0 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,2> E3 ## E0 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,2,3> E3 ## E0 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,0> E3 ## E0 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,1> E3 ## E0 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,2> E3 ## E0 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,0,3,3> E3 ## E0 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,0> E3 ## E1 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,1> E3 ## E1 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,2> E3 ## E1 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,0,3> E3 ## E1 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,0> E3 ## E1 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,1> E3 ## E1 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,2> E3 ## E1 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,1,3> E3 ## E1 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,0> E3 ## E1 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,1> E3 ## E1 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,2> E3 ## E1 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,2,3> E3 ## E1 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,0> E3 ## E1 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,1> E3 ## E1 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,2> E3 ## E1 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,1,3,3> E3 ## E1 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,0> E3 ## E2 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,1> E3 ## E2 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,2> E3 ## E2 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,0,3> E3 ## E2 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,0> E3 ## E2 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,1> E3 ## E2 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,2> E3 ## E2 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,1,3> E3 ## E2 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,0> E3 ## E2 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,1> E3 ## E2 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,2> E3 ## E2 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,2,3> E3 ## E2 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,0> E3 ## E2 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,1> E3 ## E2 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,2> E3 ## E2 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,2,3,3> E3 ## E2 ## E3 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,0> E3 ## E3 ## E0 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,1> E3 ## E3 ## E0 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,2> E3 ## E3 ## E0 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,0,3> E3 ## E3 ## E0 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,0> E3 ## E3 ## E1 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,1> E3 ## E3 ## E1 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,2> E3 ## E3 ## E1 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,1,3> E3 ## E3 ## E1 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,0> E3 ## E3 ## E2 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,1> E3 ## E3 ## E2 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,2> E3 ## E3 ## E2 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,2,3> E3 ## E3 ## E2 ## E3; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,0> E3 ## E3 ## E3 ## E0; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,1> E3 ## E3 ## E3 ## E1; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,2> E3 ## E3 ## E3 ## E2; }; \ + struct { detail::_swizzle<4, T, P, V, 3,3,3,3> E3 ## E3 ## E3 ## E3; }; diff --git a/extensions/common/glm/detail/_swizzle_func.hpp b/extensions/common/glm/detail/_swizzle_func.hpp new file mode 100644 index 0000000000..4dbb783c5b --- /dev/null +++ b/extensions/common/glm/detail/_swizzle_func.hpp @@ -0,0 +1,725 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/_swizzle_func.hpp +/// @date 2011-10-16 / 2011-10-16 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#define GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \ + SWIZZLED_TYPE A ## B() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B); \ + } + +#define GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C) \ + SWIZZLED_TYPE A ## B ## C() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B, this->C); \ + } + +#define GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \ + SWIZZLED_TYPE A ## B ## C ## D() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B, this->C, this->D); \ + } + +#define GLM_SWIZZLE_GEN_VEC2_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B) \ + template \ + SWIZZLED_TYPE CLASS_TYPE::A ## B() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B); \ + } + +#define GLM_SWIZZLE_GEN_VEC3_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C) \ + template \ + SWIZZLED_TYPE CLASS_TYPE::A ## B ## C() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B, this->C); \ + } + +#define GLM_SWIZZLE_GEN_VEC4_ENTRY_DEF(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, CONST, A, B, C, D) \ + template \ + SWIZZLED_TYPE CLASS_TYPE::A ## B ## C ## D() CONST \ + { \ + return SWIZZLED_TYPE(this->A, this->B, this->C, this->D); \ + } + +#define GLM_MUTABLE + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC2(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, x, y) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, r, g) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, s, t) + +//GLM_SWIZZLE_GEN_REF_FROM_VEC2(valType, detail::vec2, detail::ref2) + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B) + +#define GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_REF3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC3(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, x, y, z) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, r, g, b) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, s, t, p) + +//GLM_SWIZZLE_GEN_REF_FROM_VEC3(valType, detail::vec3, detail::ref2, detail::ref3) + +#define GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, A, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, B, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, GLM_MUTABLE, D, C) + +#define GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, B) + +#define GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , B, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , C, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, , D, B, C, A) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_REF4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) + +#define GLM_SWIZZLE_GEN_REF_FROM_VEC4(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z, w) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b, a) \ + GLM_SWIZZLE_GEN_REF_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p, q) + +//GLM_SWIZZLE_GEN_REF_FROM_VEC4(valType, detail::vec4, detail::ref2, detail::ref3, detail::ref4) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC2_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC2(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC2_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t) + +//GLM_SWIZZLE_GEN_VEC_FROM_VEC2(valType, detail::vec2, detail::vec2, detail::vec3, detail::vec4) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, C) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC3_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC3(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC3_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p) + +//GLM_SWIZZLE_GEN_VEC_FROM_VEC3(valType, detail::vec3, detail::vec2, detail::vec3, detail::vec4) + +#define GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C) \ + GLM_SWIZZLE_GEN_VEC2_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D) + +#define GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C) \ + GLM_SWIZZLE_GEN_VEC3_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D) + +#define GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, A, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, B, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, C, D, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, A, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, B, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, C, D, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, A, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, B, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, C, D) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, A) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, B) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, C) \ + GLM_SWIZZLE_GEN_VEC4_ENTRY(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_TYPE, const, D, D, D, D) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC2_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC3_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC3_TYPE, A, B, C, D) \ + GLM_SWIZZLE_GEN_VEC4_FROM_VEC4_SWIZZLE(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC4_TYPE, A, B, C, D) + +#define GLM_SWIZZLE_GEN_VEC_FROM_VEC4(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, x, y, z, w) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, r, g, b, a) \ + GLM_SWIZZLE_GEN_VEC_FROM_VEC4_COMP(TMPL_TYPE, PRECISION, CLASS_TYPE, SWIZZLED_VEC2_TYPE, SWIZZLED_VEC3_TYPE, SWIZZLED_VEC4_TYPE, s, t, p, q) + +//GLM_SWIZZLE_GEN_VEC_FROM_VEC4(valType, detail::vec4, detail::vec2, detail::vec3, detail::vec4) diff --git a/extensions/common/glm/detail/_vectorize.hpp b/extensions/common/glm/detail/_vectorize.hpp new file mode 100644 index 0000000000..1deff1e080 --- /dev/null +++ b/extensions/common/glm/detail/_vectorize.hpp @@ -0,0 +1,160 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/_vectorize.hpp +/// @date 2011-10-14 / 2011-10-14 +/// @author Christophe Riccio +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "type_vec1.hpp" +#include "type_vec2.hpp" +#include "type_vec3.hpp" +#include "type_vec4.hpp" + +namespace glm{ +namespace detail +{ + template class vecType> + struct functor1{}; + + template + struct functor1 + { + GLM_FUNC_QUALIFIER static tvec1 call(R (*Func) (T x), tvec1 const & v) + { + return tvec1(Func(v.x)); + } + }; + + template + struct functor1 + { + GLM_FUNC_QUALIFIER static tvec2 call(R (*Func) (T x), tvec2 const & v) + { + return tvec2(Func(v.x), Func(v.y)); + } + }; + + template + struct functor1 + { + GLM_FUNC_QUALIFIER static tvec3 call(R (*Func) (T x), tvec3 const & v) + { + return tvec3(Func(v.x), Func(v.y), Func(v.z)); + } + }; + + template + struct functor1 + { + GLM_FUNC_QUALIFIER static tvec4 call(R (*Func) (T x), tvec4 const & v) + { + return tvec4(Func(v.x), Func(v.y), Func(v.z), Func(v.w)); + } + }; + + template class vecType> + struct functor2{}; + + template + struct functor2 + { + GLM_FUNC_QUALIFIER static tvec1 call(T (*Func) (T x, T y), tvec1 const & a, tvec1 const & b) + { + return tvec1(Func(a.x, b.x)); + } + }; + + template + struct functor2 + { + GLM_FUNC_QUALIFIER static tvec2 call(T (*Func) (T x, T y), tvec2 const & a, tvec2 const & b) + { + return tvec2(Func(a.x, b.x), Func(a.y, b.y)); + } + }; + + template + struct functor2 + { + GLM_FUNC_QUALIFIER static tvec3 call(T (*Func) (T x, T y), tvec3 const & a, tvec3 const & b) + { + return tvec3(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z)); + } + }; + + template + struct functor2 + { + GLM_FUNC_QUALIFIER static tvec4 call(T (*Func) (T x, T y), tvec4 const & a, tvec4 const & b) + { + return tvec4(Func(a.x, b.x), Func(a.y, b.y), Func(a.z, b.z), Func(a.w, b.w)); + } + }; + + template class vecType> + struct functor2_vec_sca{}; + + template + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static tvec1 call(T (*Func) (T x, T y), tvec1 const & a, T b) + { + return tvec1(Func(a.x, b)); + } + }; + + template + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static tvec2 call(T (*Func) (T x, T y), tvec2 const & a, T b) + { + return tvec2(Func(a.x, b), Func(a.y, b)); + } + }; + + template + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static tvec3 call(T (*Func) (T x, T y), tvec3 const & a, T b) + { + return tvec3(Func(a.x, b), Func(a.y, b), Func(a.z, b)); + } + }; + + template + struct functor2_vec_sca + { + GLM_FUNC_QUALIFIER static tvec4 call(T (*Func) (T x, T y), tvec4 const & a, T b) + { + return tvec4(Func(a.x, b), Func(a.y, b), Func(a.z, b), Func(a.w, b)); + } + }; +}//namespace detail +}//namespace glm diff --git a/extensions/common/glm/detail/dummy.cpp b/extensions/common/glm/detail/dummy.cpp new file mode 100644 index 0000000000..88d8f3b807 --- /dev/null +++ b/extensions/common/glm/detail/dummy.cpp @@ -0,0 +1,232 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/core/dummy.cpp +/// @date 2011-01-19 / 2011-06-15 +/// @author Christophe Riccio +/// +/// GLM is a header only library. There is nothing to compile. +/// dummy.cpp exist only a wordaround for CMake file. +/////////////////////////////////////////////////////////////////////////////////// + +#define GLM_MESSAGES +#include +#include +#include + +struct material +{ + glm::vec4 emission; // Ecm + glm::vec4 ambient; // Acm + glm::vec4 diffuse; // Dcm + glm::vec4 specular; // Scm + float shininess; // Srm +}; + +struct light +{ + glm::vec4 ambient; // Acli + glm::vec4 diffuse; // Dcli + glm::vec4 specular; // Scli + glm::vec4 position; // Ppli + glm::vec4 halfVector; // Derived: Hi + glm::vec3 spotDirection; // Sdli + float spotExponent; // Srli + float spotCutoff; // Crli + // (range: [0.0,90.0], 180.0) + float spotCosCutoff; // Derived: cos(Crli) + // (range: [1.0,0.0],-1.0) + float constantAttenuation; // K0 + float linearAttenuation; // K1 + float quadraticAttenuation;// K2 +}; + + +// Sample 1 +#include // glm::vec3 +#include // glm::cross, glm::normalize + +glm::vec3 computeNormal +( + glm::vec3 const & a, + glm::vec3 const & b, + glm::vec3 const & c +) +{ + return glm::normalize(glm::cross(c - a, b - a)); +} + +typedef unsigned int GLuint; +#define GL_FALSE 0 +void glUniformMatrix4fv(GLuint, int, int, float*){} + +// Sample 2 +#include // glm::vec3 +#include // glm::vec4, glm::ivec4 +#include // glm::mat4 +#include // glm::translate, glm::rotate, glm::scale, glm::perspective +#include // glm::value_ptr +void func(GLuint LocationMVP, float Translate, glm::vec2 const & Rotate) +{ + glm::mat4 Projection = glm::perspective(45.0f, 4.0f / 3.0f, 0.1f, 100.f); + glm::mat4 ViewTranslate = glm::translate(glm::mat4(1.0f), glm::vec3(0.0f, 0.0f, -Translate)); + glm::mat4 ViewRotateX = glm::rotate(ViewTranslate, Rotate.y, glm::vec3(-1.0f, 0.0f, 0.0f)); + glm::mat4 View = glm::rotate(ViewRotateX, Rotate.x, glm::vec3(0.0f, 1.0f, 0.0f)); + glm::mat4 Model = glm::scale(glm::mat4(1.0f), glm::vec3(0.5f)); + glm::mat4 MVP = Projection * View * Model; + glUniformMatrix4fv(LocationMVP, 1, GL_FALSE, glm::value_ptr(MVP)); +} + +// Sample 3 +#include // glm::vec2 +#include // glm::packUnorm2x16 +#include // glm::uint +#include // glm::i8vec2, glm::i32vec2 +std::size_t const VertexCount = 4; +// Float quad geometry +std::size_t const PositionSizeF32 = VertexCount * sizeof(glm::vec2); +glm::vec2 const PositionDataF32[VertexCount] = +{ + glm::vec2(-1.0f,-1.0f), + glm::vec2( 1.0f,-1.0f), + glm::vec2( 1.0f, 1.0f), + glm::vec2(-1.0f, 1.0f) + }; +// Half-float quad geometry +std::size_t const PositionSizeF16 = VertexCount * sizeof(glm::uint); +glm::uint const PositionDataF16[VertexCount] = +{ + glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, -1.0f))), + glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, -1.0f))), + glm::uint(glm::packUnorm2x16(glm::vec2( 1.0f, 1.0f))), + glm::uint(glm::packUnorm2x16(glm::vec2(-1.0f, 1.0f))) +}; +// 8 bits signed integer quad geometry +std::size_t const PositionSizeI8 = VertexCount * sizeof(glm::i8vec2); +glm::i8vec2 const PositionDataI8[VertexCount] = +{ + glm::i8vec2(-1,-1), + glm::i8vec2( 1,-1), + glm::i8vec2( 1, 1), + glm::i8vec2(-1, 1) +}; +// 32 bits signed integer quad geometry +std::size_t const PositionSizeI32 = VertexCount * sizeof(glm::i32vec2); +glm::i32vec2 const PositionDataI32[VertexCount] = +{ + glm::i32vec2 (-1,-1), + glm::i32vec2 ( 1,-1), + glm::i32vec2 ( 1, 1), + glm::i32vec2 (-1, 1) +}; + +struct intersection +{ + glm::vec4 position; + glm::vec3 normal; +}; + +/* +// Sample 4 +#include // glm::vec3 +#include // glm::normalize, glm::dot, glm::reflect +#include // glm::pow +#include // glm::vecRand3 +glm::vec3 lighting +( + intersection const & Intersection, + material const & Material, + light const & Light, + glm::vec3 const & View +) +{ + glm::vec3 Color(0.0f); + glm::vec3 LightVertor(glm::normalize( + Light.position - Intersection.position + + glm::vecRand3(0.0f, Light.inaccuracy)); + + if(!shadow(Intersection.position, Light.position, LightVertor)) + { + float Diffuse = glm::dot(Intersection.normal, LightVector); + if(Diffuse <= 0.0f) + return Color; + if(Material.isDiffuse()) + Color += Light.color() * Material.diffuse * Diffuse; + if(Material.isSpecular()) + { + glm::vec3 Reflect(glm::reflect( + glm::normalize(-LightVector), + glm::normalize(Intersection.normal))); + float Dot = glm::dot(Reflect, View); + float Base = Dot > 0.0f ? Dot : 0.0f; + float Specular = glm::pow(Base, Material.exponent); + Color += Material.specular * Specular; + } + } + return Color; +} +*/ + + +template class vecType> +T normalizeDotA(vecType const & x, vecType const & y) +{ + return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); +} + +#define GLM_TEMPLATE_GENTYPE typename T, glm::precision P, template class + +template +T normalizeDotB(vecType const & x, vecType const & y) +{ + return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y)); +} + +template +typename vecType::value_type normalizeDotC(vecType const & a, vecType const & b) +{ + return glm::dot(a, b) * glm::inversesqrt(glm::dot(a, a) * glm::dot(b, b)); +} + +int main() +{ + glm::vec1 o(1); + glm::vec2 a(1); + glm::vec3 b(1); + glm::vec4 c(1); + + glm::quat q; + glm::dualquat p; + + glm::mat4 m(1); + + float a0 = normalizeDotA(a, a); + float b0 = normalizeDotB(b, b); + float c0 = normalizeDotC(c, c); + + return 0; +} diff --git a/extensions/common/glm/detail/func_common.hpp b/extensions/common/glm/detail/func_common.hpp new file mode 100644 index 0000000000..da28007b05 --- /dev/null +++ b/extensions/common/glm/detail/func_common.hpp @@ -0,0 +1,456 @@ +/////////////////////////////////////////////////////////////////////////////////// +/// OpenGL Mathematics (glm.g-truc.net) +/// +/// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net) +/// Permission is hereby granted, free of charge, to any person obtaining a copy +/// of this software and associated documentation files (the "Software"), to deal +/// in the Software without restriction, including without limitation the rights +/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +/// copies of the Software, and to permit persons to whom the Software is +/// furnished to do so, subject to the following conditions: +/// +/// The above copyright notice and this permission notice shall be included in +/// all copies or substantial portions of the Software. +/// +/// Restrictions: +/// By making use of the Software for military purposes, you choose to make +/// a Bunny unhappy. +/// +/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +/// THE SOFTWARE. +/// +/// @ref core +/// @file glm/detail/func_common.hpp +/// @date 2008-03-08 / 2010-01-26 +/// @author Christophe Riccio +/// +/// @see GLSL 4.20.8 specification, section 8.3 Common Functions +/// +/// @defgroup core_func_common Common functions +/// @ingroup core +/// +/// These all operate component-wise. The description is per component. +/////////////////////////////////////////////////////////////////////////////////// + +#pragma once + +#include "setup.hpp" +#include "precision.hpp" +#include "type_int.hpp" +#include "_fixes.hpp" + +namespace glm +{ + /// @addtogroup core_func_common + /// @{ + + /// Returns x if x >= 0; otherwise, it returns -x. + /// + /// @tparam genType floating-point or signed integer; scalar or vector types. + /// + /// @see GLSL abs man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType abs(genType x); + + template class vecType> + GLM_FUNC_DECL vecType abs(vecType const & x); + + /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. + /// + /// @tparam genType Floating-point or signed integer; scalar or vector types. + /// + /// @see GLSL sign man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType sign(vecType const & x); + + /// Returns a value equal to the nearest integer that is less then or equal to x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL floor man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType floor(vecType const & x); + + /// Returns a value equal to the nearest integer to x + /// whose absolute value is not larger than the absolute value of x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL trunc man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType trunc(vecType const & x); + + /// Returns a value equal to the nearest integer to x. + /// The fraction 0.5 will round in a direction chosen by the + /// implementation, presumably the direction that is fastest. + /// This includes the possibility that round(x) returns the + /// same value as roundEven(x) for all values of x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL round man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType round(vecType const & x); + + /// Returns a value equal to the nearest integer to x. + /// A fractional part of 0.5 will round toward the nearest even + /// integer. (Both 3.5 and 4.5 for x will return 4.0.) + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL roundEven man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// @see New round to even technique + template class vecType> + GLM_FUNC_DECL vecType roundEven(vecType const & x); + + /// Returns a value equal to the nearest integer + /// that is greater than or equal to x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL ceil man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template class vecType> + GLM_FUNC_DECL vecType ceil(vecType const & x); + + /// Return x - floor(x). + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL fract man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType fract(genType x); + + template class vecType> + GLM_FUNC_DECL vecType fract(vecType const & x); + + /// Modulus. Returns x - y * floor(x / y) + /// for each component in x using the floating point value y. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL mod man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType mod(genType x, genType y); + + template class vecType> + GLM_FUNC_DECL vecType mod(vecType const & x, T y); + + template class vecType> + GLM_FUNC_DECL vecType mod(vecType const & x, vecType const & y); + + /// Returns the fractional part of x and sets i to the integer + /// part (as a whole number floating point value). Both the + /// return value and the output parameter will have the same + /// sign as x. + /// + /// @tparam genType Floating-point scalar or vector types. + /// + /// @see GLSL modf man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType modf(genType x, genType & i); + + /// Returns y if y < x; otherwise, it returns x. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL min man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType min(genType x, genType y); + + template class vecType> + GLM_FUNC_DECL vecType min(vecType const & x, T y); + + template class vecType> + GLM_FUNC_DECL vecType min(vecType const & x, vecType const & y); + + /// Returns y if x < y; otherwise, it returns x. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL max man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType max(genType x, genType y); + + template class vecType> + GLM_FUNC_DECL vecType max(vecType const & x, T y); + + template class vecType> + GLM_FUNC_DECL vecType max(vecType const & x, vecType const & y); + + /// Returns min(max(x, minVal), maxVal) for each component in x + /// using the floating-point values minVal and maxVal. + /// + /// @tparam genType Floating-point or integer; scalar or vector types. + /// + /// @see GLSL clamp man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType clamp(genType x, genType minVal, genType maxVal); + + template class vecType> + GLM_FUNC_DECL vecType clamp(vecType const & x, T minVal, T maxVal); + + template class vecType> + GLM_FUNC_DECL vecType clamp(vecType const & x, vecType const & minVal, vecType const & maxVal); + + /// If genTypeU is a floating scalar or vector: + /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of + /// x and y using the floating-point value a. + /// The value for a is not restricted to the range [0, 1]. + /// + /// If genTypeU is a boolean scalar or vector: + /// Selects which vector each returned component comes + /// from. For a component of that is false, the + /// corresponding component of x is returned. For a + /// component of a that is true, the corresponding + /// component of y is returned. Components of x and y that + /// are not selected are allowed to be invalid floating point + /// values and will have no effect on the results. Thus, this + /// provides different functionality than + /// genType mix(genType x, genType y, genType(a)) + /// where a is a Boolean vector. + /// + /// @see GLSL mix man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + /// + /// @param[in] x Value to interpolate. + /// @param[in] y Value to interpolate. + /// @param[in] a Interpolant. + /// + /// @tparam genTypeT Floating point scalar or vector. + /// @tparam genTypeU Floating point or boolean scalar or vector. It can't be a vector if it is the length of genTypeT. + /// + /// @code + /// #include + /// ... + /// float a; + /// bool b; + /// glm::dvec3 e; + /// glm::dvec3 f; + /// glm::vec4 g; + /// glm::vec4 h; + /// ... + /// glm::vec4 r = glm::mix(g, h, a); // Interpolate with a floating-point scalar two vectors. + /// glm::vec4 s = glm::mix(g, h, b); // Teturns g or h; + /// glm::dvec3 t = glm::mix(e, f, a); // Types of the third parameter is not required to match with the first and the second. + /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. + /// @endcode + template class vecType> + GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, vecType const & a); + + template class vecType> + GLM_FUNC_DECL vecType mix(vecType const & x, vecType const & y, U a); + + template + GLM_FUNC_DECL genTypeT mix(genTypeT x, genTypeT y, genTypeU a); + + /// Returns 0.0 if x < edge, otherwise it returns 1.0 for each component of a genType. + /// + /// @see GLSL step man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template + GLM_FUNC_DECL genType step(genType edge, genType x); + + /// Returns 0.0 if x < edge, otherwise it returns 1.0. + /// + /// @see GLSL step man page + /// @see GLSL 4.20.8 specification, section 8.3 Common Functions + template