mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
9935ac57bd
Headers Formating Small optimizations
51 lines
1.6 KiB
Plaintext
51 lines
1.6 KiB
Plaintext
/*
|
|
* Author: bux, commy2
|
|
* Hide or show the secondary weapon magazine inventory slot to prevent unloading of dummy magazines.
|
|
*
|
|
* Arguments:
|
|
* 0: unit - Object the event handler is assigned to <OBJECT>
|
|
*
|
|
* Return Value:
|
|
* Nothing
|
|
*
|
|
* Example:
|
|
* [player] call ace_disposable_fnc_updateInventoryDisplay;
|
|
*
|
|
* Public: No
|
|
*/
|
|
#include "script_component.hpp"
|
|
|
|
disableSerialization;
|
|
|
|
PARAMS_1(_player);
|
|
DEFAULT_PARAM(1,_display,(findDisplay 602));
|
|
|
|
_player removeMagazines "ACE_PreloadedMissileDummy";
|
|
_player removeMagazines "ACE_FiredMissileDummy";
|
|
|
|
if (isNull _display) exitWith {};
|
|
|
|
private ["_launcher", "_control", "_config"];
|
|
|
|
_launcher = secondaryWeapon _player;
|
|
|
|
if (_launcher == "" || {getText (configFile >> "CfgWeapons" >> _launcher >> "ACE_UsedTube") == ""}) then {
|
|
_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;
|
|
} else {
|
|
_control = _display displayCtrl 627;
|
|
_control ctrlSetPosition [0, 0, 0, 0];
|
|
_control ctrlCommit 0;
|
|
|
|
_control = _display displayCtrl 1251;
|
|
_control ctrlSetPosition [0, 0, 0, 0];
|
|
_control ctrlCommit 0;
|
|
};
|