Spectator - Add setting for follow camera max distance (#6989)

* Add setting for follow camera max distance

* Convert spectator settings to CBA function
This commit is contained in:
mharis001 2019-05-12 00:32:13 -04:00 committed by PabstMirror
parent e56cc0d74e
commit 7877ce3116
5 changed files with 51 additions and 19 deletions

View File

@ -1,25 +1,11 @@
class ACE_Settings {
class GVAR(enableAI) {
category = CSTRING(Module_DisplayName);
displayName = CSTRING(ai_DisplayName);
description = CSTRING(ai_Description);
typeName = "BOOL";
value = 0;
movedToSQF = 1;
};
class GVAR(restrictModes) {
category = CSTRING(Module_DisplayName);
displayName = CSTRING(modes_DisplayName);
description = CSTRING(modes_Description);
typeName = "SCALAR";
value = 0;
values[] = {CSTRING(modes_all), CSTRING(modes_unit), "$STR_A3_Spectator_free_camera_tooltip", "$STR_A3_Spectator_1pp_camera_tooltip", "$STR_A3_Spectator_3pp_camera_tooltip"};
movedToSQF = 1;
};
class GVAR(restrictVisions) {
category = CSTRING(Module_DisplayName);
displayName = CSTRING(visions_DisplayName);
description = CSTRING(visions_Description);
typeName = "SCALAR";
value = 0;
values[] = {CSTRING(modes_all), CSTRING(visions_nv), CSTRING(visions_ti), "$STR_Special_None"};
movedToSQF = 1;
};
};

View File

@ -6,6 +6,8 @@ PREP_RECOMPILE_START;
#include "XEH_PREP.hpp"
PREP_RECOMPILE_END;
#include "initSettings.sqf"
// Used by public functions
GVAR(availableModes) = [MODE_FREE, MODE_FPS, MODE_FOLLOW];
GVAR(availableSides) = [west,east,resistance,civilian];

View File

@ -15,12 +15,11 @@
*
* Public: No
*/
#define FOLLOW_CAMERA_MAX_DISTANCE 5
if (GVAR(camMode) == MODE_FOLLOW) then {
if ((_this select 1) > 0) then {
GVAR(camDistance) = (GVAR(camDistance) - 1) max 0;
} else {
GVAR(camDistance) = (GVAR(camDistance) + 1) min FOLLOW_CAMERA_MAX_DISTANCE;
GVAR(camDistance) = (GVAR(camDistance) + 1) min GVAR(maxFollowDistance);
};
};

View File

@ -0,0 +1,39 @@
[
QGVAR(enableAI),
"CHECKBOX",
[LSTRING(ai_DisplayName), LSTRING(ai_Description)],
LSTRING(Settings_DisplayName),
false,
true
] call CBA_settings_fnc_init;
[
QGVAR(restrictModes),
"LIST",
[LSTRING(modes_DisplayName), LSTRING(modes_Description)],
LSTRING(Settings_DisplayName),
[[0, 1, 2, 3, 4], [LSTRING(modes_all), LSTRING(modes_unit), "STR_A3_Spectator_free_camera_tooltip", "STR_A3_Spectator_1pp_camera_tooltip", "STR_A3_Spectator_3pp_camera_tooltip"], 0],
true,
{},
true
] call CBA_settings_fnc_init;
[
QGVAR(restrictVisions),
"LIST",
[LSTRING(visions_DisplayName), LSTRING(visions_Description)],
LSTRING(Settings_DisplayName),
[[0, 1, 2, 3], [LSTRING(modes_all), LSTRING(visions_nv), LSTRING(visions_ti), "STR_Special_None"], 0],
true,
{},
true
] call CBA_settings_fnc_init;
[
QGVAR(maxFollowDistance),
"SLIDER",
[LSTRING(MaxFollowDistance_DisplayName), LSTRING(MaxFollowDistance_Description)],
LSTRING(Settings_DisplayName),
[5, 25, 5, 1],
false
] call CBA_settings_fnc_init;

View File

@ -180,6 +180,12 @@
<Chinesesimp>热成像</Chinesesimp>
<Chinese>熱成像</Chinese>
</Key>
<Key ID="STR_ACE_Spectator_MaxFollowDistance_DisplayName">
<English>Max Follow Distance</English>
</Key>
<Key ID="STR_ACE_Spectator_MaxFollowDistance_Description">
<English>Maximum distance the follow camera can be from the target</English>
</Key>
<!-- Interface strings -->
<Key ID="STR_ACE_Spectator_TooltipEngineer">
<English>Engineer</English>