ACE3/addons/arsenal/functions/fnc_buttonStatsPage.sqf
Grim 2f0ed27d93
Arsenal - Improve stats display (#9290)
* improve page handling

* drop MAX_STATS_PER_PAGE for now

* hide stats box when empty

* improve hiding

* improve _fnc_hideUnused

* condition

* prevent page overflow

Co-authored-by: PabstMirror <pabstmirror@gmail.com>

---------

Co-authored-by: PabstMirror <pabstmirror@gmail.com>
2023-07-29 01:00:05 +03:00

28 lines
722 B
Plaintext

#include "script_component.hpp"
#include "..\defines.hpp"
/*
* Author: Alganthe
* Handles the previous / next page buttons for stats.
*
* Arguments:
* 0: Arsenal display <DISPLAY>
* 1: Stats page <CONTROL>
* 2: Previous (false) or next (true) page <BOOL>
*
* Return Value:
* None
*
* Public: No
*/
params ["_display", "_control", "_nextPage"];
TRACE_1("control enabled", ctrlEnabled _control);
if !(ctrlEnabled _control) exitWith {};
GVAR(currentStatPage) = [GVAR(currentStatPage) - 1, GVAR(currentStatPage) + 1] select _nextPage;
GVAR(statsInfo) params ["_isLeftPanel", "_panelControl", "_curSel", "_itemCfg"];
[QGVAR(displayStats), [_display, _panelControl, _curSel, _itemCfg]] call CBA_fnc_localEvent;