Skip to content

Commit

Permalink
Merge branch 'master' into release-candidate-3-9-0
Browse files Browse the repository at this point in the history
* master:
  Add Feature Camera Player EH (#982)
  German brands for JR and JAM components (#988)
  veteran29 Polish translation updates master (#986)
  German translation, part 3 (#981)
  German translation, part 2 (#980)
  German translation, part 1 (#979)
  add Joint Ammo Magazines A3 (#928)
  CBA_fnc_getVolume not calculating volume correctly (#984)
  ProjectileTracking - Stop tracking stationary objects (#985)
  • Loading branch information
ViperMaul committed Sep 19, 2018
2 parents 52796f6 + b2058d2 commit ebb3577
Show file tree
Hide file tree
Showing 35 changed files with 562 additions and 344 deletions.
9 changes: 9 additions & 0 deletions addons/accessory/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Package name="accessory">
<Key ID="STR_CBA_accessory_Component">
<English>Community Base Addons - Accessory Functions</English>
<German>Community Base Addons - Zubehörfunktionen</German>
<Japanese>Community Base Addons - アクセサリー機能</Japanese>
<Chinese>社群基礎模組 - 附件功能</Chinese>
<Chinesesimp>社群基础模组 - 附件功能</Chinesesimp>
Expand All @@ -12,6 +13,7 @@
</Key>
<Key ID="STR_CBA_accessory_railNext">
<English>Next rail item state</English>
<German>Nächster Zustand des Schienenaufsatzes</German>
<Japanese>レイル アイテムを次モード</Japanese>
<Chinese>下個導軌物品狀態</Chinese>
<Chinesesimp>下个导轨物品状态</Chinesesimp>
Expand All @@ -21,6 +23,7 @@
</Key>
<Key ID="STR_CBA_accessory_railNext_tooltip">
<English>Cycles to the next mode available for your rail slot attachment</English>
<German>Wechselt zum nächsten verfügbaren Modus des Schienenaufsatzes.</German>
<Japanese>レイルにあるアイテムを次のモードに変更します</Japanese>
<Chinese>循環切換到下個可用的導軌物品模式</Chinese>
<Chinesesimp>循环切换到下个可用的导轨物品模式</Chinesesimp>
Expand All @@ -30,6 +33,7 @@
</Key>
<Key ID="STR_CBA_accessory_railPrev">
<English>Prev rail item state</English>
<German>Vorheriger Zustand des Schienenaufsatzes</German>
<Japanese>レイル アイテムを前モード</Japanese>
<Chinese>上個導軌物品狀態</Chinese>
<Chinesesimp>上个导轨物品状态</Chinesesimp>
Expand All @@ -39,6 +43,7 @@
</Key>
<Key ID="STR_CBA_accessory_railPrev_tooltip">
<English>Cycles to the previous mode available for your rail slot attachment</English>
<German>Wechselt zum vorherigen verfügbaren Modus des Schienenaufsatzes.</German>
<Japanese>レイルにあるアイテムを前のモードに変更します</Japanese>
<Chinese>循環切換到上個可用的導軌物品模式</Chinese>
<Chinesesimp>循环切换到上个可用的导轨物品模式</Chinesesimp>
Expand All @@ -48,6 +53,7 @@
</Key>
<Key ID="STR_CBA_accessory_opticNext">
<English>Next optics state</English>
<German>Nächster Zustand der Optik</German>
<Japanese>照準器を次モード</Japanese>
<Chinese>下個瞄鏡模式</Chinese>
<Chinesesimp>下个瞄镜模式</Chinesesimp>
Expand All @@ -57,6 +63,7 @@
</Key>
<Key ID="STR_CBA_accessory_opticNext_tooltip">
<English>Cycles to the next mode available for your optics slot attachment</English>
<German>Wechselt zum nächsten verfügbaren Modus des Optikaufsatzes.</German>
<Japanese>照準器アイテムを次のモードに変更します</Japanese>
<Chinese>循環切換到下個可用的瞄鏡模式</Chinese>
<Chinesesimp>循环切换到下个可用的瞄镜模式</Chinesesimp>
Expand All @@ -66,6 +73,7 @@
</Key>
<Key ID="STR_CBA_accessory_opticPrev">
<English>Prev optics state</English>
<German>Vorheriger Zustand der Optik</German>
<Japanese>照準器を前モード</Japanese>
<Chinese>上個瞄鏡模式</Chinese>
<Chinesesimp>上个瞄镜模式</Chinesesimp>
Expand All @@ -75,6 +83,7 @@
</Key>
<Key ID="STR_CBA_accessory_opticPrev_tooltip">
<English>Cycles to the previous mode available for your optics slot attachment</English>
<German>Wechselt zum vorherigen verfügbaren Modus des Optikaufsatzes.</German>
<Japanese>照準器アイテムを前のモードに変更します</Japanese>
<Chinese>循環切換到上個可用的瞄鏡模式</Chinese>
<Chinesesimp>循环切换到上个可用的瞄镜模式</Chinesesimp>
Expand Down
1 change: 1 addition & 0 deletions addons/ai/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Package name="AI">
<Key ID="STR_CBA_AI_Component">
<English>Community Base Addons - Artificial Intelligence</English>
<German>Community Base Addons - Künstliche Intelligenz</German>
<Japanese>Community Base Addons - 人工知能</Japanese>
<Chinese>社群基礎模組 - 人工智能</Chinese>
<Chinesesimp>社群基础模组 - 人工智能</Chinesesimp>
Expand Down
1 change: 1 addition & 0 deletions addons/arrays/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Package name="Arrays">
<Key ID="STR_CBA_Arrays_Component">
<English>Community Base Addons - Arrays</English>
<German>Community Base Addons - Arrays</German>
<Japanese>Community Base Addons - アレイ</Japanese>
<Chinese>社群基礎模組 - 陣列</Chinese>
<Chinesesimp>社群基础模组 - 阵列</Chinesesimp>
Expand Down
2 changes: 2 additions & 0 deletions addons/common/CfgFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ class CfgFunctions {
PATHTO_FNC(getMagazineIndex);
PATHTO_FNC(currentMagazineIndex);
PATHTO_FNC(setCallsign);
PATHTO_FNC(getActiveFeatureCamera);
PATHTO_FNC(registerFeatureCamera);
};

class Soldiers {
Expand Down
18 changes: 18 additions & 0 deletions addons/common/XEH_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,24 @@ GVAR(delayless_loop) = QUOTE(PATHTOF(delayless_loop.fsm));

// Initialize Components
GVAR(groups) = [grpNull, grpNull, grpNull, grpNull, grpNull];
GVAR(featureCamerasCode) = [
{!isNull curatorCamera}, // Curator
{!isNull (missionNamespace getVariable ["BIS_EGSpectatorCamera_camera", objNull])}, // BIS Nexus Spectator
{!isNull (uiNamespace getVariable ["BIS_fnc_arsenal_cam", objNull])}, // Arsenal camera
{!isNull (missionNamespace getVariable ["BIS_fnc_establishingShot_fakeUAV", objNull])}, // Establishing shot camera
{!isNull (missionNamespace getVariable ["BIS_fnc_camera_cam", objNull])}, // Splendid camera
{!isNull (uiNamespace getVariable ["BIS_fnc_animViewer_cam", objNull])}, // Animation viewer camera
{!isNull (missionNamespace getVariable ["BIS_DEBUG_CAM", objNull])} // Classic camera
];
GVAR(featureCamerasNames) = [
"curator", // Curator
"nexus", // BIS Nexus Spectator
"arsenal", // Arsenal camera
"establishing", // Establishing shot camera
"splendid", // Splendid camera
"animViewer", // Animation viewer camera
"classic" // Classic camera
];

call COMPILE_FILE(init_gauss);
call COMPILE_FILE(init_perFrameHandler);
Expand Down
35 changes: 35 additions & 0 deletions addons/common/fnc_getActiveFeatureCamera.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#include "script_component.hpp"
/* ----------------------------------------------------------------------------
Function: CBA_fnc_getActiveFeatureCamera
Description:
Returns active feature camera.
Checks for the following feature cameras:
- Curator
- Arsenal camera (BIS_fnc_arsenal)
- Nexus Spectator (BIS_fnc_EGSpectator)
- Establishing shot (BIS_fnc_establishingShot)
- Splendid camera (BIS_fnc_camera)
- Animation viewer (BIS_fnc_animViewer)
- Classic camera (BIS_fnc_cameraOld)
And cameras registered via CBA_fnc_registerFeatureCamera.
Parameters:
None
Returns:
Active feature camera ("" if none) <STRING>
Examples:
(begin example)
_result = [] call CBA_fnc_getActiveFeatureCamera
(end)
Author:
Sniperwolf572, Jonpas
---------------------------------------------------------------------------- */
SCRIPT(getActiveFeatureCamera);

GVAR(featureCamerasNames) param [GVAR(featureCamerasCode) findIf {call _x}, ""]
17 changes: 9 additions & 8 deletions addons/common/fnc_getVolume.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,27 @@
Function: CBA_fnc_getVolume
Description:
Return the volume of an object based on the object's model's bounding box.
Return the volume of the bounding box of an object's model.
The bounding box is retrieved using boundingBoxReal instead of boundingBox for more precise measurements.
Parameters:
_object - an object to calculate the volume of <OBJECT>
_object - Object to calculate the volume of <OBJECT>
Returns:
_volume - the volume <NUMBER>
_volume - Volume of the bounding box <NUMBER>
Examples:
(begin example)
_volume = _vehicle call CBA_fnc_getVolume
private _volume = _vehicle call CBA_fnc_getVolume
(end)
Author:
Rommel
Anton
---------------------------------------------------------------------------- */
SCRIPT(getVolume);

params [["_object", objNull, [objNull]]];

private _bounds = (boundingBox _object) select 1;

(_bounds select 0) * (_bounds select 1) * (_bounds select 2)
(boundingBoxReal _object) params ["_leftBackBottom", "_rightFrontTop"];
(_rightFrontTop vectorDiff _leftBackBottom) params ["_width", "_length", "_height"];
_width * _length * _height
43 changes: 43 additions & 0 deletions addons/common/fnc_registerFeatureCamera.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include "script_component.hpp"
/* ----------------------------------------------------------------------------
Function: CBA_fnc_registerFeatureCamera
Description:
Registers a feature camera for use with CBA_fnc_getActiveFeatureCamera.
Parameters:
_name - Name (unique/tagged) <STRING>
_callback - Activity check (should return true if active, false otherwise) <CODE>
Returns:
Successfully registered <BOOL>
Examples:
(begin example)
_result = [
"ace_spectator",
{!isNull (missionNamespace getVariable ["ace_spectator_isSet", objNull])}
] call CBA_fnc_registerFeatureCamera
(end)
Author:
Sniperwolf572, Jonpas
---------------------------------------------------------------------------- */
SCRIPT(registerFeatureCamera);

params [["_name", "", [""]], ["_callback", false, [{}]]];

if (_name isEqualTo "") exitWith {
TRACE_1("Name empty",_name);
false
};

if (_callback isEqualTo false) exitWith {
TRACE_1("Callback not code",_name);
false
};

if ((GVAR(featureCamerasNames) pushBackUnique _name) == -1) exitWith {false};
GVAR(featureCamerasCode) pushBack _callback;

true
1 change: 1 addition & 0 deletions addons/common/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Package name="Common">
<Key ID="STR_CBA_Common_Component">
<English>Community Base Addons - Common Component</English>
<German>Community Base Addons - Gemeinsame Komponente</German>
<Japanese>Community Base Addons - 全般要素</Japanese>
<Chinese>社群基礎模組 - 通用組件</Chinese>
<Chinesesimp>社群基础模组 - 通用组件</Chinesesimp>
Expand Down
12 changes: 6 additions & 6 deletions addons/diagnostic/fnc_projectileTracking_trackProjectile.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ params ["_args", "_handle"];
_args params ["_projectile", "_index", "_initialProjectileData"];

if (!isNull _projectile) then {
private _speed = vectorMagnitude velocity _projectile;
if (_speed < 0.1) then { // If projectile is slowed down, stop tracking after this run
[_handle] call CBA_fnc_removePerFrameHandler;
};

private _data = [];
private _bulletData = [];
Expand All @@ -39,13 +43,9 @@ if (!isNull _projectile) then {
} else {
_bulletData = [_initialProjectileData];
_data = [_handle, _bulletData];
GVAR(projectileData) set [_index, _data];
};

_bulletData pushBack [(getPos _projectile), vectorMagnitude (velocity _projectile)];

_data set [1, _bulletData];

GVAR(projectileData) set [_index, _data];
_bulletData pushBack [(getPos _projectile), _speed];

} else {
[_handle] call CBA_fnc_removePerFrameHandler;
Expand Down
6 changes: 5 additions & 1 deletion addons/diagnostic/stringtable.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Package name="Diagnostics">
<Key ID="STR_CBA_Diagnostic_Component">
<English>Community Base Addons - Diagnostics</English>
<German>Community Base Addons - Diagnose</German>
<Japanese>Community Base Addons - 診断</Japanese>
<Chinese>社群基礎模組 - 診斷</Chinese>
<Chinesesimp>社群基础模组 - 诊断</Chinesesimp>
Expand Down Expand Up @@ -42,6 +43,7 @@
</Key>
<Key ID="STR_CBA_Diagnostic_TargetExec">
<English>Target Exec</English>
<German>Ziel Ausf.</German>
<Japanese>対象へ実行</Japanese>
<Chinese>在目標執行</Chinese>
<Chinesesimp>在目标执行</Chinesesimp>
Expand All @@ -50,7 +52,8 @@
<French>Cible Exec</French>
</Key>
<Key ID="STR_CBA_Diagnostic_EnableTargetDebug">
<English>Enable Target Debuging</English>
<English>Enable Target Debugging</English>
<German>Ziel-Debugging aktivieren</German>
<Japanese>対象デバッキングを有効化</Japanese>
<Chinese>開啟目標除錯模式</Chinese>
<Chinesesimp>开启目标除错模式</Chinesesimp>
Expand All @@ -60,6 +63,7 @@
</Key>
<Key ID="STR_CBA_Diagnostic_EnableTargetDebug_tooltip">
<English>[CBA] Allows remote target debugging. Requires Debug Console.</English>
<German>[CBA] Erlaubt Remote-Ziel-Debugging. Benötigt Debug-Konsole.</German>
<Japanese>[CBA] リモート対象デバッキングを許可します。デバッグ コンソールが必要です。</Japanese>
<Chinese>[CBA] 允許遠程為目標進行除錯。需要開啟除錯控制台。</Chinese>
<Chinesesimp>[CBA] 允许远程为目标进行除错。需要开启除错控制台。</Chinesesimp>
Expand Down
41 changes: 29 additions & 12 deletions addons/events/fnc_addPlayerEventHandler.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,21 @@ Description:
Adds a player event handler.
Possible events:
"unit" - player controlled unit changed
"weapon" - currently selected weapon change
"loadout" - players loadout changed
"vehicle" - players current vehicle changed
"turret" - position in vehicle changed
"visionMode" - player changed to normal/night/thermal view
"cameraView" - camera mode changed ("Internal", "External", "Gunner" etc.)
"visibleMap" - opened or closed map
"group" - player group changes
"leader" - leader of player changes
"unit" - player controlled unit changed
"weapon" - currently selected weapon change
"loadout" - players loadout changed
"vehicle" - players current vehicle changed
"turret" - position in vehicle changed
"visionMode" - player changed to normal/night/thermal view
"cameraView" - camera mode changed ("Internal", "External", "Gunner" etc.)
"featureCamera" - camera changed (Curator, Arsenal, Spectator etc.)
"visibleMap" - opened or closed map
"group" - player group changes
"leader" - leader of player changes
Parameters:
_type - Event handler type. <STRING>
_function - Function to add to event. <CODE>
_type - Event handler type. <STRING>
_function - Function to add to event. <CODE>
_applyRetroactively - Call function immediately if player is defined already (optional, default: false) <BOOL>
Returns:
Expand Down Expand Up @@ -84,6 +85,12 @@ private _id = switch (_type) do {
};
[QGVAR(cameraViewEvent), _function] call CBA_fnc_addEventHandler // return id
};
case "featurecamera": {
if (_applyRetroactively && {!isNull (missionNamespace getVariable [QGVAR(oldUnit), objNull])}) then {
[GVAR(oldUnit), call CBA_fnc_getActiveFeatureCamera] call _function;
};
[QGVAR(featureCameraEvent), _function] call CBA_fnc_addEventHandler // return id
};
case "visiblemap": {
if (_applyRetroactively && {!isNull (missionNamespace getVariable [QGVAR(oldUnit), objNull])}) then {
[GVAR(oldUnit), visibleMap] call _function;
Expand Down Expand Up @@ -120,6 +127,7 @@ if (_id != -1) then {
GVAR(oldTurret) = [];
GVAR(oldVisionMode) = -1;
GVAR(oldCameraView) = "";
GVAR(oldFeatureCamera) = "";
GVAR(oldVisibleMap) = false;

GVAR(playerEHInfo) pushBack addMissionEventHandler ["EachFrame", {call FUNC(playerEH_EachFrame)}];
Expand Down Expand Up @@ -214,6 +222,15 @@ if (_id != -1) then {
};
} call CBA_fnc_directCall;
};

GVAR(playerEHInfo) pushBack ([{
private _data = call CBA_fnc_getActiveFeatureCamera;
if !(_data isEqualTo GVAR(oldFeatureCamera)) then {
GVAR(oldFeatureCamera) = _data;
[QGVAR(featureCameraEvent), [call CBA_fnc_currentUnit, _data]] call CBA_fnc_localEvent;
};
}, 0.5] call CBA_fnc_addPerFrameHandler);

};

GVAR(playerEHInfo) pushBack [_type, _id];
Expand Down
Loading

0 comments on commit ebb3577

Please sign in to comment.