/
config.cpp
108 lines (95 loc) · 2.74 KB
/
config.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
class CfgPatches
{
class DarkbelgSpeedControl
{
name = "Darkbelgs speed control";
author = "Darkbelg";
requiredVersion = 2.06;
requiredAddons[] = {"A3_Data_F_AoW_Loadorder", "A3_Data_F_Mod_Loadorder", "cba_common", "cba_events","cba_settings"};
units[] = {};
weapons[] = {};
};
};
class CfgFunctions
{
class DarkbelgsSpeedControl
{
tag= "DBSC";
class Functions
{
file = "src\Functions";
class resetSpeedActionId{};
class cruiseControl{};
class speedLimiter{};
};
class Events {
file = "src\Functions\Events";
class addEventHandlers {
postInit = 1;
};
class eventSeatSwitchedMan{};
class eventGetInMan{};
class eventGetOutMan{};
};
class Helpers {
file = "src\Functions\Helpers";
class isCorrectVehicle{};
class toggleModes{};
};
class Actions {
file = "src\Functions\Actions";
class addCruiseControl{};
class addSpeedLimiter{};
class addPresets{};
};
class Settings {
file = "src\Functions\Settings";
class addSettings {
preInit = 1;
};
};
};
};
class CfgUserActions
{
class DBSC_CruiseControlAction
{
displayName = "Cruise Control Toggle";
tooltip = "Toggles cruise control on or off.";
onActivate = "if (isNull objectParent player || is3DEN) exitWith {}; if ((assignedVehicleRole player)#0 != 'driver') exitWith {}; call DBSC_fnc_cruiseControl";
modifierBlocking=0;
};
class DBSC_SpeedLimiterAction
{
displayName = "Speed Control Toggle";
tooltip = "Toggles speed limiter on or off.";
onActivate = "if (isNull objectParent player || is3DEN) exitWith {}; if ((assignedVehicleRole player)#0 != 'driver') exitWith {}; call DBSC_fnc_speedLimiter";
modifierBlocking=0;
};
class DBSC_ResetSpeedAction
{
displayName = "Reset Speed";
tooltip = "Resets the speed limiter";
onActivate = "if (isNull objectParent player || is3DEN) exitWith {}; if ((assignedVehicleRole player)#0 != 'driver') exitWith {}; player setVariable ['speed',nil,false];";
modifierBlocking=0;
};
class DBSC_PresetAction
{
displayName = "Show presets";
tooltip = "Shows screen with the preset speeds.";
onActivate = "if (isNull objectParent player || is3DEN) exitWith {}; if ((assignedVehicleRole player)#0 != 'driver') exitWith {}; createDialog 'DBSCPresetSpeeds';";
modifierBlocking=0;
};
};
class UserActionGroups
{
class DarkbelgSpeedControlSection // Unique classname of your category.
{
name = "Darkbelg Speed Control"; // Display name of your category.
isAddon = 1;
group[] = {"DBSC_CruiseControlAction","DBSC_SpeedLimiterAction","DBSC_ResetSpeedAction","DBSC_PresetAction"}; // List of all actions inside this category.
};
};
#include "\a3\ui_f\hpp\defineCommonGrids.inc"
#include "UI\BaseControls.hpp"
#include "UI\DBSCPresetSpeeds.hpp"