2015-01-11 16:42:31 +00:00
|
|
|
/*
|
|
|
|
* Author: bux, commy2
|
|
|
|
* Hide or show the secondary weapon magazine inventory slot to prevent unloading of dummy magazines.
|
2015-02-20 01:32:41 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: unit - Object the event handler is assigned to <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
2015-03-20 01:24:14 +00:00
|
|
|
* None
|
2015-02-20 01:32:41 +00:00
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* [player] call ace_disposable_fnc_updateInventoryDisplay;
|
|
|
|
*
|
|
|
|
* Public: No
|
2015-01-11 16:42:31 +00:00
|
|
|
*/
|
2015-01-13 19:12:37 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-02-20 01:32:41 +00:00
|
|
|
disableSerialization;
|
2015-08-09 18:57:39 +00:00
|
|
|
params ["_player", ["_display",(findDisplay 602),[displayNull]]];
|
2015-08-10 20:12:42 +00:00
|
|
|
TRACE_2("params",_player,_display);
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-13 19:12:37 +00:00
|
|
|
_player removeMagazines "ACE_PreloadedMissileDummy";
|
|
|
|
_player removeMagazines "ACE_FiredMissileDummy";
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-01-14 01:30:25 +00:00
|
|
|
if (isNull _display) exitWith {};
|
2015-01-11 16:42:31 +00:00
|
|
|
|
|
|
|
private ["_launcher", "_control", "_config"];
|
|
|
|
|
|
|
|
_launcher = secondaryWeapon _player;
|
|
|
|
|
2015-01-13 19:12:37 +00:00
|
|
|
if (_launcher == "" || {getText (configFile >> "CfgWeapons" >> _launcher >> "ACE_UsedTube") == ""}) then {
|
2015-02-20 01:32:41 +00:00
|
|
|
_control = _display displayCtrl 627;
|
|
|
|
_config = configFile >> "RscDisplayInventory" >> "controls" >> "SlotSecondaryMagazine";
|
|
|
|
_control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")];
|
|
|
|
_control ctrlCommit 0;
|
|
|
|
|
|
|
|
_control = _display displayCtrl 1251;
|
|
|
|
_config = configFile >> "RscDisplayInventory" >> "controls" >> "BackgroundSlotSecondaryMagazine";
|
|
|
|
_control ctrlSetPosition [getNumber (_config >> "x"), getNumber (_config >> "y"), getNumber (_config >> "w"), getNumber (_config >> "h")];
|
|
|
|
_control ctrlCommit 0;
|
2015-01-11 16:42:31 +00:00
|
|
|
} else {
|
2015-02-20 01:32:41 +00:00
|
|
|
_control = _display displayCtrl 627;
|
|
|
|
_control ctrlSetPosition [0, 0, 0, 0];
|
|
|
|
_control ctrlCommit 0;
|
2015-01-11 16:42:31 +00:00
|
|
|
|
2015-02-20 01:32:41 +00:00
|
|
|
_control = _display displayCtrl 1251;
|
|
|
|
_control ctrlSetPosition [0, 0, 0, 0];
|
|
|
|
_control ctrlCommit 0;
|
2015-01-11 16:42:31 +00:00
|
|
|
};
|