From ffbd72616af63f0ef9ddda9c7fe1e4f6c7981d16 Mon Sep 17 00:00:00 2001 From: shukari Date: Thu, 9 Jul 2020 20:06:38 +0200 Subject: [PATCH] Arsenal - double custom right panel misc items buttons fixed (#7801) * added medical, food and roleplay categories to arsenal * decreased wound stitch time * added custom rightPanelButtons * stuff that doesnt belong here * fix * commys wishes * commys wishes part2 * Update addons/arsenal/defines.hpp Co-Authored-By: Dedmen Miller * Update addons/arsenal/functions/fnc_fillRightPanel.sqf Co-Authored-By: Dedmen Miller * Update addons/arsenal/functions/fnc_fillRightPanel.sqf Co-Authored-By: Dedmen Miller * infinitely better SPEED * changes * delete unused stuff * my own 3 white dots * fixed fillRightPanel IDC_MISC * commy fixes * background first * fix double buttons Co-authored-by: Schwaggot Co-authored-by: Dedmen Miller --- addons/arsenal/defines.hpp | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/addons/arsenal/defines.hpp b/addons/arsenal/defines.hpp index f0ce0bc894..7f4ff6952b 100644 --- a/addons/arsenal/defines.hpp +++ b/addons/arsenal/defines.hpp @@ -313,20 +313,25 @@ if (!isNil QGVAR(customRightPanelButtons)) then {\ if (!isNil "_x") then {\ _x params ["", "_picture", "_tooltip"];\ _miscOffset = _forEachIndex + 1;\ - private _ctrl = _display ctrlCreate [QGVAR(customArsenalButton_Background), 60 + (_forEachIndex * 2)];\ - _ctrl ctrlSetPosition [\ - safezoneW + safezoneX - 13 * GRID_W,\ - safezoneY + (88 + (10 * _forEachIndex)) * GRID_H\ - ];\ - _ctrl ctrlCommit 0;\ - _ctrl = _display ctrlCreate [QGVAR(customArsenalButton_Button), 61 + (_forEachIndex * 2)];\ - _ctrl ctrlSetPosition [\ - safezoneW + safezoneX - 10 * GRID_W,\ - safezoneY + (88 + (10 * _forEachIndex)) * GRID_H\ - ];\ - _ctrl ctrlSetText _picture;\ - _ctrl ctrlSetTooltip _tooltip;\ - _ctrl ctrlCommit 0;\ + private _plusId = _forEachIndex * 2;\ + if (isNull (_display displayCtrl (60 + _plusId))) then {\ + private _ctrl = _display ctrlCreate [QGVAR(customArsenalButton_Background), 60 + _plusId];\ + _ctrl ctrlSetPosition [\ + safezoneW + safezoneX - 13 * GRID_W,\ + safezoneY + (88 + (10 * _forEachIndex)) * GRID_H\ + ];\ + _ctrl ctrlCommit 0;\ + };\ + if (isNull (_display displayCtrl (61 + _plusId))) then {\ + _ctrl = _display ctrlCreate [QGVAR(customArsenalButton_Button), 61 + _plusId];\ + _ctrl ctrlSetPosition [\ + safezoneW + safezoneX - 10 * GRID_W,\ + safezoneY + (88 + (10 * _forEachIndex)) * GRID_H\ + ];\ + _ctrl ctrlSetText _picture;\ + _ctrl ctrlSetTooltip _tooltip;\ + _ctrl ctrlCommit 0;\ + };\ };\ } forEach GVAR(customRightPanelButtons);\ {\