Skip to content

Commit

Permalink
Shorten handleStats window resize (#6176)
Browse files Browse the repository at this point in the history
  • Loading branch information
mharis001 authored and jonpas committed Mar 3, 2018
1 parent fe0945e commit a483311
Showing 1 changed file with 8 additions and 61 deletions.
69 changes: 8 additions & 61 deletions addons/arsenal/functions/fnc_handleStats.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -129,67 +129,14 @@ if !(isNil "_itemCfg") then {
};

// Resize the window
switch (_statsCount) do {
case 0: {
[[1, 2, 3, 4, 5]] call _hideUnusedFnc;
_statsBoxCtrl ctrlSetPosition [
(0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP,
safezoneY + 1.8 * GRID_H,
47 * GRID_W,
11 * GRID_H
];
_statsBoxCtrl ctrlCommit 0;
};
case 1: {
[[2, 3, 4, 5]] call _hideUnusedFnc;
_statsBoxCtrl ctrlSetPosition [
(0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP,
safezoneY + 1.8 * GRID_H,
47 * GRID_W,
15 * GRID_H
];
_statsBoxCtrl ctrlCommit 0;
};
case 2: {
[[3, 4, 5]] call _hideUnusedFnc;
_statsBoxCtrl ctrlSetPosition [
(0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP,
safezoneY + 1.8 * GRID_H,
47 * GRID_W,
25 * GRID_H
];
_statsBoxCtrl ctrlCommit 0;
};
case 3: {
[[4, 5]] call _hideUnusedFnc;
_statsBoxCtrl ctrlSetPosition [
(0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP,
safezoneY + 1.8 * GRID_H,
47 * GRID_W,
35 * GRID_H
];
_statsBoxCtrl ctrlCommit 0;
};
case 4: {
[[5]] call _hideUnusedFnc;
_statsBoxCtrl ctrlSetPosition [
(0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP,
safezoneY + 1.8 * GRID_H,
47 * GRID_W,
45 * GRID_H
];
_statsBoxCtrl ctrlCommit 0;
};
case 5: {
_statsBoxCtrl ctrlSetPosition [
(0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP,
safezoneY + 1.8 * GRID_H,
47 * GRID_W,
55 * GRID_H
];
_statsBoxCtrl ctrlCommit 0;
};
};
[[1, 2, 3, 4, 5] select [_statsCount, 5]] call _hideUnusedFnc;
_statsBoxCtrl ctrlSetPosition [
(0.5 - WIDTH_TOTAL / 2) + WIDTH_GAP,
safezoneY + 1.8 * GRID_H,
47 * GRID_W,
([11, (10 * _statsCount) + 5] select (_statsCount > 0)) * GRID_H
];
_statsBoxCtrl ctrlCommit 0;

GVAR(statsInfo) = [_isLeftPanel, _statsIndex, _control, _curSel, _itemCfg];

Expand Down

0 comments on commit a483311

Please sign in to comment.