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,22 +1,25 @@
|
|||||||
#define MACRO_SEAT_ACTION \
|
class CfgVehicles {
|
||||||
class ACE_Actions { \
|
class ACE_Module;
|
||||||
class ACE_MainActions { \
|
class ACE_ModuleSitting: ACE_Module {
|
||||||
displayName = ECSTRING(interaction,MainAction); \
|
author = ECSTRING(common,ACETeam);
|
||||||
selection = ""; \
|
category = "ACE";
|
||||||
distance = 1.25; \
|
displayName = CSTRING(ModuleDisplayName);
|
||||||
condition = "true"; \
|
function = QFUNC(moduleInit);
|
||||||
class GVAR(Sit) { \
|
scope = 2;
|
||||||
displayName = CSTRING(Sit); \
|
isGlobal = 1;
|
||||||
condition = QUOTE(_this call FUNC(canSit)); \
|
//icon = QUOTE(PATHTOF(UI\Icon_Module_Sitting_ca.paa));
|
||||||
statement = QUOTE(_this call FUNC(sit)); \
|
class Arguments {
|
||||||
showDisabled = 0; \
|
class enable {
|
||||||
priority = 0; \
|
displayName = CSTRING(Enable);
|
||||||
icon = PATHTOF(UI\sit_ca.paa); \
|
typeName = "BOOL";
|
||||||
}; \
|
defaultValue = 1;
|
||||||
}; \
|
};
|
||||||
|
};
|
||||||
|
class ModuleDescription {
|
||||||
|
description = CSTRING(ModuleDescription);
|
||||||
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
class CfgVehicles {
|
|
||||||
class Man;
|
class Man;
|
||||||
class CAManBase: Man {
|
class CAManBase: Man {
|
||||||
class ACE_SelfActions {
|
class ACE_SelfActions {
|
||||||
@ -31,6 +34,24 @@ class CfgVehicles {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#define MACRO_SEAT_ACTION \
|
||||||
|
class ACE_Actions { \
|
||||||
|
class ACE_MainActions { \
|
||||||
|
displayName = ECSTRING(interaction,MainAction); \
|
||||||
|
selection = ""; \
|
||||||
|
distance = 1.25; \
|
||||||
|
condition = "true"; \
|
||||||
|
class GVAR(Sit) { \
|
||||||
|
displayName = CSTRING(Sit); \
|
||||||
|
condition = QUOTE(_this call FUNC(canSit)); \
|
||||||
|
statement = QUOTE(_this call FUNC(sit)); \
|
||||||
|
showDisabled = 0; \
|
||||||
|
priority = 0; \
|
||||||
|
icon = PATHTOF(UI\sit_ca.paa); \
|
||||||
|
}; \
|
||||||
|
}; \
|
||||||
|
};
|
||||||
|
|
||||||
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