add module options

This commit is contained in:
commy2 2015-04-21 13:17:09 +02:00
parent 665aa37898
commit 9e3d9f23a5
5 changed files with 124 additions and 9 deletions

View File

@ -0,0 +1,32 @@
class ACE_Settings {
class GVAR(DisplayTextOnRepair) {
typeName = "BOOL";
isClientSetable = 1;
value = 1;
displayName = "$STR_ACE_Repair_SettingDisplayTextName";
description = "$STR_ACE_Repair_SettingDisplayTextDesc";
};
class GVAR(engineerSetting_Repair) {
typeName = "SCALAR";
value = 1;
values[] = {"Anyone", "Engineer only", "Repair Specialist only"};
};
class GVAR(engineerSetting_Wheel) {
typeName = "SCALAR";
value = 0;
values[] = {"Anyone", "Engineer only", "Repair Specialist only"};
};
class GVAR(consumeItem_ToolKit) {
typeName = "SCALAR";
value = 1;
values[] = {"No", "Yes"};
};
class GVAR(repairDamageThreshold) {
typeName = "SCALAR";
value = 0;
};
class GVAR(repairDamageThreshold_Engineer) {
typeName = "SCALAR";
value = 0;
};
};

View File

@ -16,6 +16,67 @@
};
class CfgVehicles {
class ACE_Module;
// @todo localization for all the modules
class ACE_moduleRepairSettings: ACE_Module {
scope = 2;
displayName = "Repair Settings";
icon = QUOTE(PATHTOF(UI\Icon_Module_Medical_ca.paa)); //@todo
category = "ACE";
function = QUOTE(DFUNC(moduleRepairSettings));
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
author = "$STR_ACE_Common_ACETeam";
class Arguments {
class engineerSetting_Repair {
displayName = "Allow Repair";
description = "Who can use the toolkit to fully repair?";
typeName = "NUMBER";
class values {
class anyone { name = "Anyone"; value = 0; };
class Medic { name = "Engineers only"; value = 1; default = 1; };
class Special { name = "Repair Specialists only"; value = 2; };
};
};
class engineerSetting_Wheel {
displayName = "Allow Wheel";
description = "Who can remove and replace wheels?";
typeName = "NUMBER";
class values {
class anyone { name = "Anyone"; value = 0; default = 1; };
class Medic { name = "Engineers only"; value = 1; };
class Special { name = "Repair Specialists only"; value = 2; };
};
};
class repairDamageThreshold {
displayName = "Repair Threshold";
description = "What is the maximum damage that can be repaired with a toolkit?";
typeName = "NUMBER";
defaultValue = 1;
};
class repairDamageThreshold_Engineer {
displayName = "Repair Threshold (Engineer)";
description = "What is the maximum damage that can be repaired by an engineer?";
typeName = "NUMBER";
defaultValue = 1;
};
class consumeItem_ToolKit {
displayName = "Remove toolkit on use";
description = "Should the toolkit be removed on usage?";
typeName = "NUMBER";
class values {
class keep { name = "No"; value = 0; default = 1; };
class remove { name = "Yes"; value = 1; };
};
};
};
class ModuleDescription {
description = "Provides a repair system for all types of vehicles.";
sync[] = {};
};
};
class LandVehicle;
class Car: LandVehicle {
MACRO_REPAIRVEHICLE

View File

@ -10,6 +10,7 @@ PREP(doRemoveWheel);
PREP(doRepair);
PREP(doReplaceWheel);
PREP(getWheelHitPointsWithSelections);
PREP(moduleRepairSettings);
PREP(normalizeHitPoints);
PREP(removeWheel);
PREP(repairVehicle);

View File

@ -17,12 +17,4 @@ class CfgPatches {
#include "CfgVehicleClasses.hpp"
#include "CfgVehicles.hpp"
class ACE_Settings {
class GVAR(DisplayTextOnRepair) {
typeName = "BOOL";
isClientSetable = 1;
value = 1;
displayName = "$STR_ACE_Repair_SettingDisplayTextName";
description = "$STR_ACE_Repair_SettingDisplayTextDesc";
};
};
#include "ACE_Settings.hpp"

View File

@ -0,0 +1,29 @@
/*
* Author: commy2
* Module for adjusting the repair damage settings
*
* Arguments:
* 0: The module logic <LOGIC>
* 1: units <ARRAY>
* 2: activated <BOOL>
*
* Return Value:
* None <NIL>
*
* Public: No
*/
#include "script_component.hpp"
private ["_logic", "_units", "_activated"];
_logic = _this select 0;
_units = _this select 1;
_activated = _this select 2;
if !(_activated) exitWith {};
[_logic, QGVAR(engineerSetting_Repair), "engineerSetting_Repair"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(engineerSetting_Wheel), "engineerSetting_Wheel"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(consumeItem_ToolKit), "consumeItem_ToolKit"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(repairDamageThreshold), "repairDamageThreshold"] call EFUNC(common,readSettingFromModule);
[_logic, QGVAR(repairDamageThreshold_Engineer), "repairDamageThreshold_Engineer"] call EFUNC(common,readSettingFromModule);