ACE3/addons/arsenal/functions/fnc_itemInfo.sqf
Josuan Albin 1994e301fd More various ace arsenal fixes (#6192)
* Compile stats on preInit

* Remove uneeded check in add/removeStat

* Remove perf profiler vars

They aren't required anymore

* Fix case issue in verifyLoadout, remove uneeded line

* Fix ace arsenal cam not working porperly underwater

By removing those checks the cam is allowed to clip through objects and work properly underwater, sounds like features to me :D

* Fix gunbag behavior in ace arsenal

Switching between gunbags will keep the weapon, switching to another backpack then back to a gunbag will also keep the weapon.

* Fix text scaling in the searchbars and loadout name edit boxes

Also made the text bigger by default
2018-04-12 10:44:23 -05:00

80 lines
2.7 KiB
Plaintext

/*
* Author: Alganthe
* Update arsenal's info box.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Current panel control <CONTROL>
* 2: Current panel selection <SCALAR>
* 3: Item config entry <CONFIG>
*
* Return Value:
* None
*
* Public: No
*/
#include "script_component.hpp"
#include "..\defines.hpp"
params ["_display", "_control", "_curSel" ,"_itemCfg"];
private _ctrlInfo = _display displayCtrl IDC_infoBox;
if (isClass _itemCfg) then {
_ctrlInfo ctrlSetFade 0;
_ctrlInfo ctrlCommit FADE_DELAY;
[QGVAR(displayStats), [_display, _control, _curSel, _itemCfg]] call CBA_fnc_localEvent;
// Name + author
private _ctrlInfoName = _display displayCtrl IDC_infoName;
_ctrlInfoName ctrlSetText ([_control lbText _curSel, _control lnbText [_curSel, 1]] select (ctrlType _control == 102));
private _ctrlInfoAuthor = _display displayctrl IDC_infoAuthor;
_ctrlInfoAuthor ctrlSetText "";
private _itemAuthor = getText (_itemCfg >> "author");
_ctrlInfoAuthor ctrlSetText ([localize "STR_AUTHOR_UNKNOWN", format [localize "STR_FORMAT_AUTHOR_SCRIPTED",_itemAuthor]] select (_itemAuthor != ""));
// DLC / mod icon
private _ctrlDLC = _display displayctrl IDC_DLCIcon;
private _ctrlDLCBackground = _display displayctrl IDC_DLCBackground;
private _dlc = _itemCfg call GETDLC;
if (_dlc != "") then {
private _dlcParams = modParams [_dlc, ["name", "logo", "logoOver"]];
_dlcParams params ["_name", "_logo", "_logoOver"];
private _appId = getnumber (configfile >> "CfgMods" >> _dlc >> "appId");
_ctrlDLC ctrlsettooltip _name;
_ctrlDLC ctrlsettext _logo;
_ctrlDLCBackground ctrlsetfade 0;
_ctrlDLC ctrlsetfade 0;
if (_appId > 0) then {
_ctrlDLC ctrlseteventhandler ["mouseexit",format ["(_this select 0) ctrlsettext '%1';",_logo]];
_ctrlDLC ctrlseteventhandler ["mouseenter",format ["(_this select 0) ctrlsettext '%1';",_logoOver]];
_ctrlDLC ctrlseteventhandler [
"buttonclick",
format ["uiNamespace setvariable ['RscDisplayDLCPreview_dlc','%1']; ctrlparent (_this select 0) createDisplay 'RscDisplayDLCPreview';", _dlc]
];
} else {
_ctrlDLC ctrlRemoveAllEventHandlers "buttonclick";
_ctrlDLC ctrlRemoveAllEventHandlers "mouseexit";
_ctrlDLC ctrlRemoveAllEventHandlers "mouseenter";
};
} else {
_ctrlDLC ctrlsetfade 1;
_ctrlDLCBackground ctrlsetfade 1;
};
_ctrlDLC ctrlcommit 0;
_ctrlDLCBackground ctrlcommit 0;
} else {
[QGVAR(displayStats), [_display, _control, -1, nil]] call CBA_fnc_localEvent;
_ctrlInfo ctrlSetFade 1;
_ctrlInfo ctrlCommit FADE_DELAY;
};