mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
742626ff1a
Co-authored-by: PabstMirror <pabstmirror@gmail.com>
68 lines
1.7 KiB
Plaintext
68 lines
1.7 KiB
Plaintext
#include "..\script_component.hpp"
|
|
#include "..\defines.hpp"
|
|
/*
|
|
* Author: Alganthe
|
|
* Change unit animation / play sound preview.
|
|
*
|
|
* Arguments:
|
|
* None
|
|
*
|
|
* Return Value:
|
|
* None
|
|
*
|
|
* Public: No
|
|
*/
|
|
|
|
if (GVAR(centerNotPlayer)) exitWith {};
|
|
|
|
// Determine action to play based on current category selection
|
|
private _nextAction = switch (GVAR(currentLeftPanel)) do {
|
|
// Primary weapon
|
|
case IDC_buttonPrimaryWeapon: {
|
|
["Civil", "PrimaryWeapon"] select ((GVAR(currentItems) select IDX_CURR_PRIMARY_WEAPON) != "")
|
|
};
|
|
// Secondary weapon
|
|
case IDC_buttonSecondaryWeapon: {
|
|
["Civil", "SecondaryWeapon"] select ((GVAR(currentItems) select IDX_CURR_SECONDARY_WEAPON) != "")
|
|
};
|
|
// Handgun weapon
|
|
case IDC_buttonHandgun: {
|
|
["Civil", "HandGunOn"] select ((GVAR(currentItems) select IDX_CURR_HANDGUN_WEAPON) != "")
|
|
};
|
|
// Binoculars
|
|
case IDC_buttonBinoculars: {
|
|
["Civil", "Binoculars"] select ((GVAR(currentItems) select IDX_CURR_BINO) != "")
|
|
};
|
|
// Insignia
|
|
case IDC_buttonInsignia: {
|
|
"Salute"
|
|
};
|
|
// Voice
|
|
case IDC_buttonVoice: {
|
|
GVAR(center) directSay "CuratorObjectPlaced";
|
|
"Civil"
|
|
};
|
|
// Other
|
|
default {
|
|
"Civil"
|
|
};
|
|
};
|
|
|
|
// Play the action if a new category of item was selected
|
|
if (_nextAction != GVAR(currentAction)) then {
|
|
GVAR(selectedWeaponType) = switch (_nextAction) do {
|
|
case "PrimaryWeapon": {0};
|
|
case "SecondaryWeapon": {1};
|
|
case "HandGunOn": {2};
|
|
default {GVAR(selectedWeaponType)};
|
|
};
|
|
|
|
if (simulationEnabled GVAR(center)) then {
|
|
GVAR(center) playActionNow _nextAction;
|
|
} else {
|
|
GVAR(center) switchAction _nextAction;
|
|
};
|
|
|
|
GVAR(currentAction) = _nextAction;
|
|
};
|