Skip to content

Commit

Permalink
make rerolls configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
McDiod committed Oct 8, 2019
1 parent 70aabe6 commit 40f1f32
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions cfgMission.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class cfgMission {

spawnGroupMinDist = 50;

chooseUniformRerolls = 999;

weaponBlacklist[] = {
arifle_Katiba_C_F,
arifle_Katiba_GL_F,
Expand Down
6 changes: 4 additions & 2 deletions functions/chooseUniform/fn_onButtonReroll.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

0 comments on commit 40f1f32

Please sign in to comment.