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,4 +1,40 @@
#define MACRO_SEAT_ACTION \ 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 \
class ACE_Actions { \ class ACE_Actions { \
class ACE_MainActions { \ class ACE_MainActions { \
displayName = ECSTRING(interaction,MainAction); \ displayName = ECSTRING(interaction,MainAction); \
@ -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 {

View File

@ -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);

View File

@ -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"

View File

@ -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)}})

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> <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>