From 40f1f324bce6b09c38eae7c349387b121b5d27e3 Mon Sep 17 00:00:00 2001 From: McDiod Date: Tue, 8 Oct 2019 19:16:32 +0200 Subject: [PATCH] make rerolls configurable --- cfgMission.hpp | 2 ++ functions/chooseUniform/fn_onButtonReroll.sqf | 6 ++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cfgMission.hpp b/cfgMission.hpp index 0a8429f..be12648 100644 --- a/cfgMission.hpp +++ b/cfgMission.hpp @@ -7,6 +7,8 @@ class cfgMission { spawnGroupMinDist = 50; + chooseUniformRerolls = 999; + weaponBlacklist[] = { arifle_Katiba_C_F, arifle_Katiba_GL_F, diff --git a/functions/chooseUniform/fn_onButtonReroll.sqf b/functions/chooseUniform/fn_onButtonReroll.sqf index c832f8a..a34a94e 100644 --- a/functions/chooseUniform/fn_onButtonReroll.sqf +++ b/functions/chooseUniform/fn_onButtonReroll.sqf @@ -7,13 +7,15 @@ if (isNull _display) exitWith {}; private _ctrlButtonReroll = _display displayCtrl CHOOSEUNIFORM_IDC_REROLL; if (isNull _ctrlButtonReroll) exitWith {}; +private _maxRerolls = [missionConfigFile >> "cfgMission","chooseUniformRerolls",2] call BIS_fnc_returnConfigEntry; + private _rerolls = (_ctrlButtonReroll getVariable [QGVAR(rerolls),0]) + 1; _ctrlButtonReroll setVariable [QGVAR(rerolls),_rerolls]; -_ctrlButtonReroll ctrlSetText format ["REROLL (%1/2)",_rerolls]; +_ctrlButtonReroll ctrlSetText format ["REROLL (%1/%2)",_rerolls,_maxRerolls]; [_display] call FUNC(reroll); [-1] call FUNC(onUniformSelected); -if (_rerolls == 2) then { +if (_rerolls >= _maxRerolls) then { _ctrlButtonReroll ctrlEnable false; };