Move some addActions to config UserActions

Should improve client FPS while still allowing conditions and scripts to
be customized.

Some special vehicles like MV22, UH1Y, etc. have UserActions overwritten
in their configs, so please let me know if you find any others that do
not get the option to repair or salvage because UserActions is
overwritten in their config. I think I got them all.

Vanilla commits:

a8c4238c0c

350d73abe1
This commit is contained in:
ebaydayz
2016-11-20 19:47:10 -05:00
parent ef1ad261e2
commit 3aad4b61e9
34 changed files with 320 additions and 259 deletions

View File

@@ -0,0 +1,22 @@
#define CAN_DO (!r_drag_sqf && !r_player_unconscious && getNumber (configFile >> "CfgMovesMaleSdr" >> "States" >> (animationState player) >> "onLadder") != 1)
#define HAS_TOOLBOX ("ItemToolbox" in items player)
#define IN_VEHICLE (vehicle player != player)
#define IS_ALIVE (damage _object < 1)
#define IS_BIKE (_object isKindOf "Bicycle")
#define IS_PZOMBIE (player isKindOf "PZombie_VB")
private ["_action","_object","_show"];
_action = _this select 0;
_object = _this select 1;
_show = switch _action do {
case "Butcher": {!IS_ALIVE && !IN_VEHICLE && CAN_DO && !(_object getVariable["meatHarvested",false]) && !IS_PZOMBIE};
case "PushPlane": {IS_ALIVE && !IN_VEHICLE && CAN_DO && count crew _object == 0 && !isEngineOn _object && !IS_PZOMBIE};
case "Repair": {IS_ALIVE && !IN_VEHICLE && CAN_DO && _object != dayz_myCursorTarget && HAS_TOOLBOX};
case "Salvage": {IS_ALIVE && !IN_VEHICLE && CAN_DO && _object != dayz_myCursorTarget && HAS_TOOLBOX && !IS_BIKE && (DZE_salvageLocked or !locked _object)};
case "StudyBody": {!IS_ALIVE && !IN_VEHICLE && !(_object isKindOf "zZombie_base")};
default {false};
};
_show