Fixed #1937 - Made use of CfgMoves to make free-look head movement visible, Fixed grenade throwing while sitting

This commit is contained in:
jonpas 2015-08-08 02:13:14 +02:00
parent 9e64e8c2aa
commit 52ac13273c
4 changed files with 133 additions and 26 deletions

105
addons/sitting/CfgMoves.hpp Normal file
View File

@ -0,0 +1,105 @@
// Enable visual head movement while free-looking
#define MACRO_ANIMATION \
head = "headDefault";
class CfgMovesBasic;
class CfgMovesMaleSdr: CfgMovesBasic {
class States {
class HubSittingChairA_idle1;
class GVAR(HubSittingChairA_idle1): HubSittingChairA_idle1 {
MACRO_ANIMATION
};
class HubSittingChairA_idle2;
class GVAR(HubSittingChairA_idle2): HubSittingChairA_idle2 {
MACRO_ANIMATION
};
class HubSittingChairA_idle3;
class GVAR(HubSittingChairA_idle3): HubSittingChairA_idle3 {
MACRO_ANIMATION
};
class HubSittingChairA_move1;
class GVAR(HubSittingChairA_move1): HubSittingChairA_move1 {
MACRO_ANIMATION
};
class HubSittingChairB_idle1;
class GVAR(HubSittingChairB_idle1): HubSittingChairB_idle1 {
MACRO_ANIMATION
};
class HubSittingChairB_idle2;
class GVAR(HubSittingChairB_idle2): HubSittingChairB_idle2 {
MACRO_ANIMATION
};
class HubSittingChairB_idle3;
class GVAR(HubSittingChairB_idle3): HubSittingChairB_idle3 {
MACRO_ANIMATION
};
class HubSittingChairB_move1;
class GVAR(HubSittingChairB_move1): HubSittingChairB_move1 {
MACRO_ANIMATION
};
class HubSittingChairC_idle1;
class GVAR(HubSittingChairC_idle1): HubSittingChairC_idle1 {
MACRO_ANIMATION
};
class HubSittingChairC_idle2;
class GVAR(HubSittingChairC_idle2): HubSittingChairC_idle2 {
MACRO_ANIMATION
};
class HubSittingChairC_idle3;
class GVAR(HubSittingChairC_idle3): HubSittingChairC_idle3 {
MACRO_ANIMATION
};
class HubSittingChairC_move1;
class GVAR(HubSittingChairC_move1): HubSittingChairC_move1 {
MACRO_ANIMATION
};
class HubSittingChairUA_idle1;
class GVAR(HubSittingChairUA_idle1): HubSittingChairUA_idle1 {
MACRO_ANIMATION
};
class HubSittingChairUA_idle2;
class GVAR(HubSittingChairUA_idle2): HubSittingChairUA_idle2 {
MACRO_ANIMATION
};
class HubSittingChairUA_idle3;
class GVAR(HubSittingChairUA_idle3): HubSittingChairUA_idle3 {
MACRO_ANIMATION
};
class HubSittingChairUA_move1;
class GVAR(HubSittingChairUA_move1): HubSittingChairUA_move1 {
MACRO_ANIMATION
};
class HubSittingChairUB_idle1;
class GVAR(HubSittingChairUB_idle1): HubSittingChairUB_idle1 {
MACRO_ANIMATION
};
class HubSittingChairUB_idle2;
class GVAR(HubSittingChairUB_idle2): HubSittingChairUB_idle2 {
MACRO_ANIMATION
};
class HubSittingChairUB_idle3;
class GVAR(HubSittingChairUB_idle3): HubSittingChairUB_idle3 {
MACRO_ANIMATION
};
class HubSittingChairUB_move1;
class GVAR(HubSittingChairUB_move1): HubSittingChairUB_move1 {
MACRO_ANIMATION
};
class HubSittingChairUC_idle1;
class GVAR(HubSittingChairUC_idle1): HubSittingChairUC_idle1 {
MACRO_ANIMATION
};
class HubSittingChairUC_idle2;
class GVAR(HubSittingChairUC_idle2): HubSittingChairUC_idle2 {
MACRO_ANIMATION
};
class HubSittingChairUC_idle3;
class GVAR(HubSittingChairUC_idle3): HubSittingChairUC_idle3 {
MACRO_ANIMATION
};
class HubSittingChairUC_move1;
class GVAR(HubSittingChairUC_move1): HubSittingChairUC_move1 {
MACRO_ANIMATION
};
};
};

View File

@ -12,6 +12,7 @@ class CfgPatches {
}; };
}; };
#include "CfgEventHandlers.hpp"
#include "ACE_Settings.hpp" #include "ACE_Settings.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgMoves.hpp"
#include "CfgVehicles.hpp" #include "CfgVehicles.hpp"

View File

@ -19,30 +19,30 @@ private ["_animations"];
// Animations Pool // Animations Pool
_animations = [ _animations = [
"HubSittingChairUA_idle1", QGVAR(HubSittingChairA_idle1),
"HubSittingChairUA_idle2", QGVAR(HubSittingChairA_idle2),
"HubSittingChairUA_idle3", QGVAR(HubSittingChairA_idle3),
"HubSittingChairUA_move1", QGVAR(HubSittingChairA_move1),
"HubSittingChairUB_idle1", QGVAR(HubSittingChairB_idle1),
"HubSittingChairUB_idle2", QGVAR(HubSittingChairB_idle2),
"HubSittingChairUB_idle3", QGVAR(HubSittingChairB_idle3),
"HubSittingChairUB_move1", QGVAR(HubSittingChairB_move1),
"HubSittingChairUC_idle1", QGVAR(HubSittingChairC_idle1),
"HubSittingChairUC_idle2", QGVAR(HubSittingChairC_idle2),
"HubSittingChairUC_idle3", QGVAR(HubSittingChairC_idle3),
"HubSittingChairUC_move1", QGVAR(HubSittingChairC_move1),
"HubSittingChairA_idle1", QGVAR(HubSittingChairUA_idle1),
"HubSittingChairA_idle2", QGVAR(HubSittingChairUA_idle2),
"HubSittingChairA_idle3", QGVAR(HubSittingChairUA_idle3),
"HubSittingChairA_move1", QGVAR(HubSittingChairUA_move1),
"HubSittingChairB_idle1", QGVAR(HubSittingChairUB_idle1),
"HubSittingChairB_idle2", QGVAR(HubSittingChairUB_idle2),
"HubSittingChairB_idle3", QGVAR(HubSittingChairUB_idle3),
"HubSittingChairB_move1", QGVAR(HubSittingChairUB_move1),
"HubSittingChairC_idle1", QGVAR(HubSittingChairUC_idle1),
"HubSittingChairC_idle2", QGVAR(HubSittingChairUC_idle2),
"HubSittingChairC_idle3", QGVAR(HubSittingChairUC_idle3),
"HubSittingChairC_move1" QGVAR(HubSittingChairUC_move1)
]; ];
// Select random animation // Select random animation

View File

@ -34,7 +34,8 @@ _sitPosition = getArray (_configFile >> QGVAR(sitPosition));
_sitRotation = if (isNumber (_configFile >> QGVAR(sitRotation))) then {getNumber (_configFile >> QGVAR(sitRotation))} else {45}; // Apply default if config entry not present _sitRotation = if (isNumber (_configFile >> QGVAR(sitRotation))) then {getNumber (_configFile >> QGVAR(sitRotation))} else {45}; // Apply default if config entry not present
// Get random animation and perform it (before moving player to ensure correct placement) // Get random animation and perform it (before moving player to ensure correct placement)
[_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); [_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); // Correctly places when using non-transitional animations
[_player, "", 1] call EFUNC(common,doAnimation); // Correctly applies animation's config values (such as disallow throwing of grenades, intercept keybinds... etc).
// Set direction and position // Set direction and position
_player setDir _sitDirection; _player setDir _sitDirection;