mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Added Sitting Settings and Module
This commit is contained in:
parent
2104e5b45f
commit
c6b5c705c7
7
addons/sitting/ACE_Settings.hpp
Normal file
7
addons/sitting/ACE_Settings.hpp
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
class ACE_Settings {
|
||||||
|
class GVAR(enable) {
|
||||||
|
value = 1;
|
||||||
|
typeName = "BOOL";
|
||||||
|
displayName = CSTRING(Enable);
|
||||||
|
};
|
||||||
|
};
|
@ -1,3 +1,39 @@
|
|||||||
|
class CfgVehicles {
|
||||||
|
class ACE_Module;
|
||||||
|
class ACE_ModuleSitting: ACE_Module {
|
||||||
|
author = ECSTRING(common,ACETeam);
|
||||||
|
category = "ACE";
|
||||||
|
displayName = CSTRING(ModuleDisplayName);
|
||||||
|
function = QFUNC(moduleInit);
|
||||||
|
scope = 2;
|
||||||
|
isGlobal = 1;
|
||||||
|
//icon = QUOTE(PATHTOF(UI\Icon_Module_Sitting_ca.paa));
|
||||||
|
class Arguments {
|
||||||
|
class enable {
|
||||||
|
displayName = CSTRING(Enable);
|
||||||
|
typeName = "BOOL";
|
||||||
|
defaultValue = 1;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
class ModuleDescription {
|
||||||
|
description = CSTRING(ModuleDescription);
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
|
class Man;
|
||||||
|
class CAManBase: Man {
|
||||||
|
class ACE_SelfActions {
|
||||||
|
class GVAR(Stand) {
|
||||||
|
displayName = CSTRING(Stand);
|
||||||
|
condition = QUOTE(_player call FUNC(canStand));
|
||||||
|
statement = QUOTE(_player call FUNC(stand));
|
||||||
|
priority = 0;
|
||||||
|
icon = PATHTOF(UI\stand_ca.paa);
|
||||||
|
//add exception isNotSitting to everything that shouldn't be available (eg. medical)
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
|
||||||
#define MACRO_SEAT_ACTION \
|
#define MACRO_SEAT_ACTION \
|
||||||
class ACE_Actions { \
|
class ACE_Actions { \
|
||||||
class ACE_MainActions { \
|
class ACE_MainActions { \
|
||||||
@ -16,21 +52,6 @@
|
|||||||
}; \
|
}; \
|
||||||
};
|
};
|
||||||
|
|
||||||
class CfgVehicles {
|
|
||||||
class Man;
|
|
||||||
class CAManBase: Man {
|
|
||||||
class ACE_SelfActions {
|
|
||||||
class GVAR(Stand) {
|
|
||||||
displayName = CSTRING(Stand);
|
|
||||||
condition = QUOTE(_player call FUNC(canStand));
|
|
||||||
statement = QUOTE(_player call FUNC(stand));
|
|
||||||
priority = 0;
|
|
||||||
icon = PATHTOF(UI\stand_ca.paa);
|
|
||||||
//add exception isNotSitting to everything that shouldn't be available (eg. medical)
|
|
||||||
};
|
|
||||||
};
|
|
||||||
};
|
|
||||||
|
|
||||||
class ThingX;
|
class ThingX;
|
||||||
// Folding Chair
|
// Folding Chair
|
||||||
class Land_CampingChair_V1_F: ThingX {
|
class Land_CampingChair_V1_F: ThingX {
|
||||||
|
@ -5,6 +5,7 @@ ADDON = false;
|
|||||||
PREP(canSit);
|
PREP(canSit);
|
||||||
PREP(canStand);
|
PREP(canStand);
|
||||||
PREP(getRandomAnimation);
|
PREP(getRandomAnimation);
|
||||||
|
PREP(moduleInit);
|
||||||
PREP(sit);
|
PREP(sit);
|
||||||
PREP(stand);
|
PREP(stand);
|
||||||
|
|
||||||
|
@ -5,7 +5,7 @@ class CfgPatches {
|
|||||||
units[] = {};
|
units[] = {};
|
||||||
weapons[] = {};
|
weapons[] = {};
|
||||||
requiredVersion = REQUIRED_VERSION;
|
requiredVersion = REQUIRED_VERSION;
|
||||||
requiredAddons[] = {"ace_common"};
|
requiredAddons[] = {"ace_interaction"};
|
||||||
author[] = {"Jonpas"};
|
author[] = {"Jonpas"};
|
||||||
authorUrl = "https://github.com/jonpas";
|
authorUrl = "https://github.com/jonpas";
|
||||||
VERSION_CONFIG;
|
VERSION_CONFIG;
|
||||||
@ -13,4 +13,5 @@ class CfgPatches {
|
|||||||
};
|
};
|
||||||
|
|
||||||
#include "CfgEventHandlers.hpp"
|
#include "CfgEventHandlers.hpp"
|
||||||
|
#include "ACE_Settings.hpp"
|
||||||
#include "CfgVehicles.hpp"
|
#include "CfgVehicles.hpp"
|
||||||
|
@ -18,5 +18,5 @@
|
|||||||
|
|
||||||
PARAMS_2(_seat,_player);
|
PARAMS_2(_seat,_player);
|
||||||
|
|
||||||
// If seat object and not occupied
|
// Sitting enabled, is seat object and not occupied
|
||||||
(getNumber (configFile >> "CfgVehicles" >> typeOf _seat >> QGVAR(canSit)) == 1 && {isNil{_seat getVariable QGVAR(seatOccupied)}})
|
(GVAR(enable) && {getNumber (configFile >> "CfgVehicles" >> typeOf _seat >> QGVAR(canSit)) == 1} && {isNil{_seat getVariable QGVAR(seatOccupied)}})
|
||||||
|
23
addons/sitting/functions/fnc_moduleInit.sqf
Normal file
23
addons/sitting/functions/fnc_moduleInit.sqf
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
/*
|
||||||
|
* Author: Jonpas
|
||||||
|
* Initializes the Sitting module.
|
||||||
|
*
|
||||||
|
* Arguments:
|
||||||
|
* Whatever the module provides.
|
||||||
|
*
|
||||||
|
* Return Value:
|
||||||
|
* None
|
||||||
|
*/
|
||||||
|
#include "script_component.hpp"
|
||||||
|
|
||||||
|
if !(isServer) exitWith {};
|
||||||
|
|
||||||
|
PARAMS_3(_logic,_units,_activated);
|
||||||
|
|
||||||
|
if !(_activated) exitWith {};
|
||||||
|
|
||||||
|
GVAR(Module) = true;
|
||||||
|
|
||||||
|
[_logic, QGVAR(enable), "enable"] call EFUNC(common,readSettingFromModule);
|
||||||
|
|
||||||
|
diag_log text "[ACE]: Sitting Module Initialized.";
|
@ -9,5 +9,14 @@
|
|||||||
<English>Stand Up</English>
|
<English>Stand Up</English>
|
||||||
<Polish>Wstań</Polish>
|
<Polish>Wstań</Polish>
|
||||||
</Key>
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Sitting_Enable">
|
||||||
|
<English>Enable Sitting</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Sitting_ModuleDisplayName">
|
||||||
|
<English>Sitting</English>
|
||||||
|
</Key>
|
||||||
|
<Key ID="STR_ACE_Sitting_ModuleDescription">
|
||||||
|
<English>This module allows you to disable the ability to sit on chairs and toilets.</English>
|
||||||
|
</Key>
|
||||||
</Package>
|
</Package>
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue
Block a user