Used macros, getVariable capitalization, removed start of file newlines, separated CfgActions

This commit is contained in:
jonpas 2015-08-16 16:45:46 +02:00
parent 9f3af45a8f
commit b7282e476c
13 changed files with 39 additions and 43 deletions

View File

@ -45,7 +45,6 @@ class ACE_Settings {
values[] = {ECSTRING(common,No), ECSTRING(common,Yes)};
category = CSTRING(categoryName);
};
class GVAR(fullRepairLocation) {
displayName = CSTRING(fullRepairLocation);
description = CSTRING(fullRepairLocation_description);

View File

@ -0,0 +1,9 @@
class CfgActions {
class None;
class Repair: None {
show = 0;
};
class RepairVehicle: None {
show = 0;
};
};

View File

@ -1,4 +1,3 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call COMPILE_FILE(XEH_preInit));

View File

@ -1,4 +1,3 @@
class CfgVehicleClasses {
class GVAR(items) {
displayName = "ACE";

View File

@ -1,4 +1,3 @@
#define MACRO_REPAIRVEHICLE \
class ACE_Actions { \
class ACE_MainActions { \
@ -261,8 +260,8 @@ class CfgVehicles {
};
class ACE_Track: ACE_RepairItem_Base {
ace_cargo_size = 2;
ace_cargo_canLoad = 1;
EGVAR(cargo,size) = 2;
EGVAR(cargo,canLoad) = 1;
author = "Hawkins";
scope = 2;
model = QUOTE(PATHTOF(data\ace_track.p3d));
@ -270,8 +269,8 @@ class CfgVehicles {
};
class ACE_Wheel: ACE_RepairItem_Base {
ace_cargo_size = 1;
ace_cargo_canLoad = 1;
EGVAR(cargo,size) = 1;
EGVAR(cargo,canLoad) = 1;
author = "Hawkins";
scope = 2;
model = QUOTE(PATHTOF(data\ace_wheel.p3d));

View File

@ -5,7 +5,7 @@ class CfgPatches {
units[] = {"ACE_Wheel", "ACE_Track"};
weapons[] = {};
requiredVersion = REQUIRED_VERSION;
requiredAddons[] = {"ace_common","ace_interact_menu"};
requiredAddons[] = {"ace_common", "ace_interaction"};
author[] = {"commy2", "Glowbal"};
authorUrl = "https://ace3mod.com";
VERSION_CONFIG;
@ -14,18 +14,9 @@ class CfgPatches {
#include "CfgEventHandlers.hpp"
#include "CfgActions.hpp"
#include "CfgVehicleClasses.hpp"
#include "CfgVehicles.hpp"
#include "ACE_Settings.hpp"
#include "ACE_repair.hpp"
class CfgActions {
class None;
class Repair: None {
show = 0;
};
class RepairVehicle: None {
show = 0;
};
};
#include "ACE_Repair.hpp"

View File

@ -30,7 +30,7 @@ _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then {
} else {
// Check for required class
if (isText (_config >> "requiredEngineer")) exitwith {
missionNamespace getvariable [(getText (_config >> "requiredEngineer")), 0];
missionNamespace getVariable [(getText (_config >> "requiredEngineer")), 0];
};
0;
};
@ -45,7 +45,7 @@ if (getText (_config >> "condition") != "") then {
if (isnil _condition) then {
_condition = compile _condition;
} else {
_condition = missionNamespace getvariable _condition;
_condition = missionNamespace getVariable _condition;
};
if (typeName _condition == "BOOL") then {
_return = _condition;
@ -57,7 +57,7 @@ if (getText (_config >> "condition") != "") then {
if (!_return) exitwith {false};
_vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then {
missionNamespace getvariable [getText(_config >> "vehicleStateCondition"), 0]
missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0]
} else {
getNumber(_config >> "vehicleStateCondition")
};
@ -76,7 +76,7 @@ _repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC
if (_x == "RepairVehicle" && _repairVeh) exitwith {_return = true;};
if !(isnil _x) exitwith {
private "_val";
_val = missionNamespace getvariable _x;
_val = missionNamespace getVariable _x;
if (typeName _val == "SCALAR") then {
_return = switch (_val) do {
case 0: {true};

View File

@ -19,8 +19,8 @@ params ["_logic"];
if (!isNull _logic) then {
private ["_list", "_setting"];
_list = _logic getvariable ["EnableList",""];
_setting = _logic getvariable ["role",0];
_list = _logic getVariable ["EnableList",""];
_setting = _logic getVariable ["role",0];
[_list, "ACE_IsEngineer", _setting, true] call EFUNC(common,assignObjectsInList);
[synchronizedObjects _logic, "ACE_IsEngineer", _setting, true] call EFUNC(common,assignObjectsInList);

View File

@ -19,8 +19,8 @@ params ["_logic"];
if (!isNull _logic) then {
private ["_list", "_setting"];
_list = _logic getvariable ["EnableList",""];
_setting = _logic getvariable ["role",0];
_list = _logic getVariable ["EnableList",""];
_setting = _logic getVariable ["role",0];
[_list, "ACE_isRepairFacility", _setting, true] call EFUNC(common,assignObjectsInList);
[synchronizedObjects _logic, "ACE_isRepairFacility", _setting, true] call EFUNC(common,assignObjectsInList);

View File

@ -19,8 +19,8 @@ params ["_logic"];
if (!isNull _logic) then {
private ["_list", "_setting"];
_list = _logic getvariable ["EnableList",""];
_setting = _logic getvariable ["role",0];
_list = _logic getVariable ["EnableList",""];
_setting = _logic getVariable ["role",0];
[_list, "ACE_isRepairVehicle", _setting, true] call EFUNC(common,assignObjectsInList);
[synchronizedObjects _logic, "ACE_isRepairVehicle", _setting, true] call EFUNC(common,assignObjectsInList);

View File

@ -29,7 +29,7 @@ _engineerRequired = if (isNumber (_config >> "requiredEngineer")) then {
} else {
// Check for required class
if (isText (_config >> "requiredEngineer")) exitwith {
missionNamespace getvariable [(getText (_config >> "requiredEngineer")), 0];
missionNamespace getVariable [(getText (_config >> "requiredEngineer")), 0];
};
0;
};
@ -44,7 +44,7 @@ if (getText (_config >> "condition") != "") then {
if (isnil _condition) then {
_condition = compile _condition;
} else {
_condition = missionNamespace getvariable _condition;
_condition = missionNamespace getVariable _condition;
};
if (typeName _condition == "BOOL") then {
_return = _condition;
@ -55,7 +55,7 @@ if (getText (_config >> "condition") != "") then {
if (!_return) exitwith {false};
_vehicleStateCondition = if (isText(_config >> "vehicleStateCondition")) then {
missionNamespace getvariable [getText(_config >> "vehicleStateCondition"), 0]
missionNamespace getVariable [getText(_config >> "vehicleStateCondition"), 0]
} else {
getNumber(_config >> "vehicleStateCondition")
};
@ -74,7 +74,7 @@ _repairVeh = {([_caller] call FUNC(isNearRepairVehicle)) || ([_target] call FUNC
if (_x == "RepairVehicle" && _repairVeh) exitwith {_return = true;};
if !(isnil _x) exitwith {
private "_val";
_val = missionNamespace getvariable _x;
_val = missionNamespace getVariable _x;
if (typeName _val == "SCALAR") then {
_return = switch (_val) do {
case 0: {true};
@ -94,7 +94,7 @@ _consumeItems = if (isNumber (_config >> "itemConsumed")) then {
} else {
// Check for required class
if (isText (_config >> "itemConsumed")) exitwith {
missionNamespace getvariable [(getText (_config >> "itemConsumed")), 0];
missionNamespace getVariable [(getText (_config >> "itemConsumed")), 0];
};
0;
};
@ -112,7 +112,7 @@ if (_callbackProgress == "") then {
if (isNil _callbackProgress) then {
_callbackProgress = compile _callbackProgress;
} else {
_callbackProgress = missionNamespace getvariable _callbackProgress;
_callbackProgress = missionNamespace getVariable _callbackProgress;
};
@ -152,7 +152,7 @@ _repairTime = if (isNumber (_config >> "repairingTime")) then {
if (isnil _repairTimeConfig) then {
_repairTimeConfig = compile _repairTimeConfig;
} else {
_repairTimeConfig = missionNamespace getvariable _repairTimeConfig;
_repairTimeConfig = missionNamespace getVariable _repairTimeConfig;
};
if (typeName _repairTimeConfig == "SCALAR") exitwith {
_repairTimeConfig;

View File

@ -26,11 +26,11 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then {
_caller removeWeapon "ACE_FakePrimaryWeapon";
};
if (vehicle _caller == _caller) then {
[_caller, _caller getvariable [QGVAR(repairPrevAnimCaller), ""], 2] call EFUNC(common,doAnimation);
[_caller, _caller getVariable [QGVAR(repairPrevAnimCaller), ""], 2] call EFUNC(common,doAnimation);
};
_caller setvariable [QGVAR(repairPrevAnimCaller), nil];
_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnrepair), ""]);
_weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]);
if (_weaponSelect != "") then {
_caller selectWeapon _weaponSelect;
} else {
@ -48,7 +48,7 @@ _callback = getText (_config >> "callbackFailure");
if (isNil _callback) then {
_callback = compile _callback;
} else {
_callback = missionNamespace getvariable _callback;
_callback = missionNamespace getVariable _callback;
};
_args call _callback;

View File

@ -27,11 +27,11 @@ if (primaryWeapon _caller == "ACE_FakePrimaryWeapon") then {
_caller removeWeapon "ACE_FakePrimaryWeapon";
};
if (vehicle _caller == _caller) then {
[_caller, _caller getvariable [QGVAR(repairPrevAnimCaller), ""], 2] call EFUNC(common,doAnimation);
[_caller, _caller getVariable [QGVAR(repairPrevAnimCaller), ""], 2] call EFUNC(common,doAnimation);
};
_caller setvariable [QGVAR(repairPrevAnimCaller), nil];
_weaponSelect = (_caller getvariable [QGVAR(selectedWeaponOnrepair), ""]);
_weaponSelect = (_caller getVariable [QGVAR(selectedWeaponOnrepair), ""]);
if (_weaponSelect != "") then {
_caller selectWeapon _weaponSelect;
} else {
@ -45,7 +45,7 @@ _callback = getText (_config >> "callbackSuccess");
if (isNil _callback) then {
_callback = compile _callback;
} else {
_callback = missionNamespace getvariable _callback;
_callback = missionNamespace getVariable _callback;
};
_args call _callback;