Added Sitting Settings and Module

This commit is contained in:
jonpas 2015-06-08 23:25:15 +02:00
parent 2104e5b45f
commit c6b5c705c7
7 changed files with 82 additions and 20 deletions

View File

@ -0,0 +1,7 @@
class ACE_Settings {
class GVAR(enable) {
value = 1;
typeName = "BOOL";
displayName = CSTRING(Enable);
};
};

View File

@ -1,22 +1,25 @@
#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 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 CfgVehicles {
class Man;
class CAManBase: Man {
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;
// Folding Chair
class Land_CampingChair_V1_F: ThingX {

View File

@ -5,6 +5,7 @@ ADDON = false;
PREP(canSit);
PREP(canStand);
PREP(getRandomAnimation);
PREP(moduleInit);
PREP(sit);
PREP(stand);

View File

@ -5,7 +5,7 @@ class CfgPatches {
units[] = {};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common"};
requiredAddons[] = {"ace_interaction"};
author[] = {"Jonpas"};
authorUrl = "https://github.com/jonpas";
VERSION_CONFIG;
@ -13,4 +13,5 @@ class CfgPatches {
};
#include "CfgEventHandlers.hpp"
#include "ACE_Settings.hpp"
#include "CfgVehicles.hpp"

View File

@ -18,5 +18,5 @@
PARAMS_2(_seat,_player);
// If seat object and not occupied
(getNumber (configFile >> "CfgVehicles" >> typeOf _seat >> QGVAR(canSit)) == 1 && {isNil{_seat getVariable QGVAR(seatOccupied)}})
// Sitting enabled, is seat object and not occupied
(GVAR(enable) && {getNumber (configFile >> "CfgVehicles" >> typeOf _seat >> QGVAR(canSit)) == 1} && {isNil{_seat getVariable QGVAR(seatOccupied)}})

View 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.";

View File

@ -9,5 +9,14 @@
<English>Stand Up</English>
<Polish>Wstań</Polish>
</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>
</Project>