Skip to content

Commit

Permalink
Fix #561 : Track Spacing edit box in Music Manager default value
Browse files Browse the repository at this point in the history
  • Loading branch information
Ansible2 committed Aug 22, 2021
1 parent 3758803 commit dc14ee8
Showing 1 changed file with 18 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "..\..\Headers\descriptionEXT\GUI\musicManagerCommonDefines.hpp"
#include "..\..\KISKA Systems\KISKA Music Functions\Headers\Music Common Defines.hpp"
/* ----------------------------------------------------------------------------
Function: BLWK_fnc_musicManagerOnLoad_trackSpacingControls
Expand Down Expand Up @@ -29,6 +30,8 @@ Author(s):
disableSerialization;
scriptName "BLWK_fnc_musicManagerOnLoad_trackSpacingControls";

#define DEFAULT_TRACK_SPACING [120,180,240]

params ["_comboControl","_editBoxControl","_buttonControl"];

// KISKA_fnc_getVariableTarget needs a scheduled environment
Expand All @@ -51,25 +54,25 @@ _comboControl lbSetTooltip [2,"Time between tracks will ALWAYS be this many seco


// get current spacing setting from server
private _currentSpacingSetting = ["KISKA_randomMusic_timeBetween",localNamespace] call KISKA_fnc_getVariableTarget;
if (_currentSpacingSetting isEqualTo -1) then {
_comboControl lbSetCurSel 1; // set to random bell curve by default
_editBoxControl ctrlSetText "[1,2,3]";
} else {
if (_currentSpacingSetting isEqualType []) then {
// if random bell curve
if (_currentSpacingSetting isEqualTypeArray [1,2,3]) then {
_comboControl lbSetCurSel 1;
} else { // if random max
_comboControl lbSetCurSel 0;
};
} else { // if exact time
_comboControl lbSetCurSel 2;
private _currentSpacingSetting = ["KISKA_randomMusic_timeBetween",localNamespace,GET_MUSIC_RANDOM_TIME_BETWEEN] call KISKA_fnc_getVariableTarget;
if (_currentSpacingSetting isEqualType []) then {
// if random bell curve format
if (_currentSpacingSetting isEqualTypeArray [1,2,3]) then {
_comboControl lbSetCurSel 1;

} else { // if random max format
_comboControl lbSetCurSel 0;

};

_editBoxControl ctrlSetText (str _currentSpacingSetting);
} else { // if exact time format
_comboControl lbSetCurSel 2;

};

_editBoxControl ctrlSetText (str _currentSpacingSetting);


// combo change event
_comboControl ctrlAddEventHandler ["LBSelChanged",{
params ["_control", "_selectedIndex"];
Expand Down

0 comments on commit dc14ee8

Please sign in to comment.