mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
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:
parent
e56cc0d74e
commit
7877ce3116
@ -1,25 +1,11 @@
|
|||||||
class ACE_Settings {
|
class ACE_Settings {
|
||||||
class GVAR(enableAI) {
|
class GVAR(enableAI) {
|
||||||
category = CSTRING(Module_DisplayName);
|
movedToSQF = 1;
|
||||||
displayName = CSTRING(ai_DisplayName);
|
|
||||||
description = CSTRING(ai_Description);
|
|
||||||
typeName = "BOOL";
|
|
||||||
value = 0;
|
|
||||||
};
|
};
|
||||||
class GVAR(restrictModes) {
|
class GVAR(restrictModes) {
|
||||||
category = CSTRING(Module_DisplayName);
|
movedToSQF = 1;
|
||||||
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"};
|
|
||||||
};
|
};
|
||||||
class GVAR(restrictVisions) {
|
class GVAR(restrictVisions) {
|
||||||
category = CSTRING(Module_DisplayName);
|
movedToSQF = 1;
|
||||||
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"};
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -6,6 +6,8 @@ PREP_RECOMPILE_START;
|
|||||||
#include "XEH_PREP.hpp"
|
#include "XEH_PREP.hpp"
|
||||||
PREP_RECOMPILE_END;
|
PREP_RECOMPILE_END;
|
||||||
|
|
||||||
|
#include "initSettings.sqf"
|
||||||
|
|
||||||
// Used by public functions
|
// Used by public functions
|
||||||
GVAR(availableModes) = [MODE_FREE, MODE_FPS, MODE_FOLLOW];
|
GVAR(availableModes) = [MODE_FREE, MODE_FPS, MODE_FOLLOW];
|
||||||
GVAR(availableSides) = [west,east,resistance,civilian];
|
GVAR(availableSides) = [west,east,resistance,civilian];
|
||||||
|
@ -15,12 +15,11 @@
|
|||||||
*
|
*
|
||||||
* Public: No
|
* Public: No
|
||||||
*/
|
*/
|
||||||
#define FOLLOW_CAMERA_MAX_DISTANCE 5
|
|
||||||
|
|
||||||
if (GVAR(camMode) == MODE_FOLLOW) then {
|
if (GVAR(camMode) == MODE_FOLLOW) then {
|
||||||
if ((_this select 1) > 0) then {
|
if ((_this select 1) > 0) then {
|
||||||
GVAR(camDistance) = (GVAR(camDistance) - 1) max 0;
|
GVAR(camDistance) = (GVAR(camDistance) - 1) max 0;
|
||||||
} else {
|
} else {
|
||||||
GVAR(camDistance) = (GVAR(camDistance) + 1) min FOLLOW_CAMERA_MAX_DISTANCE;
|
GVAR(camDistance) = (GVAR(camDistance) + 1) min GVAR(maxFollowDistance);
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
39
addons/spectator/initSettings.sqf
Normal file
39
addons/spectator/initSettings.sqf
Normal 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;
|
@ -180,6 +180,12 @@
|
|||||||
<Chinesesimp>热成像</Chinesesimp>
|
<Chinesesimp>热成像</Chinesesimp>
|
||||||
<Chinese>熱成像</Chinese>
|
<Chinese>熱成像</Chinese>
|
||||||
</Key>
|
</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 -->
|
<!-- Interface strings -->
|
||||||
<Key ID="STR_ACE_Spectator_TooltipEngineer">
|
<Key ID="STR_ACE_Spectator_TooltipEngineer">
|
||||||
<English>Engineer</English>
|
<English>Engineer</English>
|
||||||
|
Loading…
Reference in New Issue
Block a user