mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Merge pull request #3092 from acemod/minorSittingCleanup
Sitting Cleanup
This commit is contained in:
commit
62a94759c4
@ -3,9 +3,16 @@
|
|||||||
// Exit on Headless
|
// Exit on Headless
|
||||||
if (!hasInterface) exitWith {};
|
if (!hasInterface) exitWith {};
|
||||||
|
|
||||||
// Add interaction menu exception
|
["SettingsInitialized", {
|
||||||
["isNotSitting", {isNil {(_this select 0) getVariable QGVAR(isSitting)}}] call EFUNC(common,addCanInteractWithCondition);
|
TRACE_1("SettingInit", GVAR(enable));
|
||||||
|
|
||||||
|
//If not enabled, then do not add CanInteractWith Condition or event handlers:
|
||||||
|
if (!GVAR(enable)) exitWith {};
|
||||||
|
|
||||||
// Handle interruptions
|
// Add interaction menu exception
|
||||||
["medical_onUnconscious", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler);
|
["isNotSitting", {isNil {(_this select 0) getVariable QGVAR(isSitting)}}] call EFUNC(common,addCanInteractWithCondition);
|
||||||
["SetHandcuffed", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler);
|
|
||||||
|
// Handle interruptions
|
||||||
|
["medical_onUnconscious", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler);
|
||||||
|
["SetHandcuffed", {_this call DFUNC(handleInterrupt)}] call EFUNC(common,addEventhandler);
|
||||||
|
}] call EFUNC(common,addEventHandler);
|
||||||
|
@ -16,19 +16,28 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_seat"];
|
params ["_seat"];
|
||||||
private ["_type", "_sitAction"];
|
|
||||||
|
|
||||||
_type = typeOf _seat;
|
private _type = typeOf _seat;
|
||||||
|
|
||||||
// Exit if the object is not specified as a seat
|
// Exit if the object is not specified as a seat
|
||||||
if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canSit)) != 1) exitWith {};
|
if (getNumber (configFile >> "CfgVehicles" >> _type >> QGVAR(canSit)) != 1) exitWith {};
|
||||||
|
|
||||||
|
// only run this after the settings are initialized
|
||||||
|
if !(EGVAR(common,settingsInitFinished)) exitWith {
|
||||||
|
EGVAR(common,runAtSettingsInitialized) pushBack [FUNC(addSitActions), _this];
|
||||||
|
};
|
||||||
|
|
||||||
|
//If not enabled, don't add actions:
|
||||||
|
if (!GVAR(enable)) exitWith {};
|
||||||
|
|
||||||
// Exit if class already initialized
|
// Exit if class already initialized
|
||||||
if (_type in GVAR(initializedClasses)) exitWith {};
|
if (_type in GVAR(initializedClasses)) exitWith {};
|
||||||
|
|
||||||
GVAR(initializedClasses) pushBack _type;
|
GVAR(initializedClasses) pushBack _type;
|
||||||
|
|
||||||
_sitAction = [
|
TRACE_1("Adding Sit Action",_type);
|
||||||
|
|
||||||
|
private _sitAction = [
|
||||||
QGVAR(Sit),
|
QGVAR(Sit),
|
||||||
localize LSTRING(Sit),
|
localize LSTRING(Sit),
|
||||||
QUOTE(PATHTOF(UI\sit_ca.paa)),
|
QUOTE(PATHTOF(UI\sit_ca.paa)),
|
||||||
|
@ -15,10 +15,8 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private "_animations";
|
|
||||||
|
|
||||||
// Animations Pool
|
// Animations Pool
|
||||||
_animations = [
|
private _animations = [
|
||||||
QGVAR(HubSittingChairA_idle1),
|
QGVAR(HubSittingChairA_idle1),
|
||||||
QGVAR(HubSittingChairA_idle2),
|
QGVAR(HubSittingChairA_idle2),
|
||||||
QGVAR(HubSittingChairA_idle3),
|
QGVAR(HubSittingChairA_idle3),
|
||||||
|
@ -16,15 +16,13 @@
|
|||||||
*/
|
*/
|
||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
private ["_actionID", "_configFile", "_sitDirection", "_sitPosition", "_seatPosOrig"];
|
|
||||||
|
|
||||||
params ["_seat", "_player"];
|
params ["_seat", "_player"];
|
||||||
|
|
||||||
// Overwrite weird position, because Arma decides to set it differently based on current animation/stance...
|
// Overwrite weird position, because Arma decides to set it differently based on current animation/stance...
|
||||||
_player switchMove "amovpknlmstpsraswrfldnon";
|
_player switchMove "amovpknlmstpsraswrfldnon";
|
||||||
|
|
||||||
// Add scroll-wheel action to release object
|
// Add scroll-wheel action to release object
|
||||||
_actionID = _player addAction [
|
private _actionID = _player addAction [
|
||||||
format ["<t color='#FFFF00'>%1</t>", localize LSTRING(Stand)],
|
format ["<t color='#FFFF00'>%1</t>", localize LSTRING(Stand)],
|
||||||
QUOTE((_this select 0) call FUNC(stand)),
|
QUOTE((_this select 0) call FUNC(stand)),
|
||||||
nil,
|
nil,
|
||||||
@ -36,9 +34,9 @@ _actionID = _player addAction [
|
|||||||
];
|
];
|
||||||
|
|
||||||
// Read config
|
// Read config
|
||||||
_configFile = configFile >> "CfgVehicles" >> typeOf _seat;
|
private _configFile = configFile >> "CfgVehicles" >> typeOf _seat;
|
||||||
_sitDirection = (getDir _seat) + getNumber (_configFile >> QGVAR(sitDirection));
|
private _sitDirection = (getDir _seat) + getNumber (_configFile >> QGVAR(sitDirection));
|
||||||
_sitPosition = getArray (_configFile >> QGVAR(sitPosition));
|
private _sitPosition = getArray (_configFile >> QGVAR(sitPosition));
|
||||||
|
|
||||||
// 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); // Correctly places when using non-transitional animations
|
[_player, call FUNC(getRandomAnimation), 2] call EFUNC(common,doAnimation); // Correctly places when using non-transitional animations
|
||||||
@ -55,7 +53,7 @@ _seat setVariable [QGVAR(seatOccupied), true, true]; // To prevent multiple peop
|
|||||||
|
|
||||||
|
|
||||||
// Add automatical stand PFH in case of interruptions
|
// Add automatical stand PFH in case of interruptions
|
||||||
_seatPosOrig = getPosASL _seat;
|
private _seatPosOrig = getPosASL _seat;
|
||||||
[{
|
[{
|
||||||
params ["_args", "_pfhId"];
|
params ["_args", "_pfhId"];
|
||||||
_args params ["_player", "_seat", "_seatPosOrig"];
|
_args params ["_player", "_seat", "_seatPosOrig"];
|
||||||
|
@ -16,7 +16,6 @@
|
|||||||
#include "script_component.hpp"
|
#include "script_component.hpp"
|
||||||
|
|
||||||
params ["_player"];
|
params ["_player"];
|
||||||
private ["_animation"];
|
|
||||||
|
|
||||||
(_player getVariable QGVAR(isSitting)) params ["_seat", "_actionID"];
|
(_player getVariable QGVAR(isSitting)) params ["_seat", "_actionID"];
|
||||||
|
|
||||||
@ -24,7 +23,7 @@ private ["_animation"];
|
|||||||
_player removeAction _actionID;
|
_player removeAction _actionID;
|
||||||
|
|
||||||
// Restore animation
|
// Restore animation
|
||||||
_animation = switch (currentWeapon _player) do {
|
private _animation = switch (currentWeapon _player) do {
|
||||||
case "": {"amovpercmstpsnonwnondnon"};
|
case "": {"amovpercmstpsnonwnondnon"};
|
||||||
case (primaryWeapon _player): {"amovpercmstpslowwrfldnon"};
|
case (primaryWeapon _player): {"amovpercmstpslowwrfldnon"};
|
||||||
case (handgunWeapon _player): {"amovpercmstpslowwpstdnon"};
|
case (handgunWeapon _player): {"amovpercmstpslowwpstdnon"};
|
||||||
|
Loading…
Reference in New Issue
Block a user