maxchristensenaudio
Observant Sound
Today I noticed that watch_var and message() are not showing me the same result for the state of a button.
In the picture you can see that "Save Modulation" is selected, so only the btn_save_modulation should be 1.
CT says that btn_save_global is also 1, but my message(btn_save_global) says 0????
In the picture you can see that "Save Modulation" is selected, so only the btn_save_modulation should be 1.
CT says that btn_save_global is also 1, but my message(btn_save_global) says 0????
Code:
on note
message(btn_save_global)
end on
on ui_control (btn_save_global)
show_save_confirm_controls(1, 0) // bool, num
toggle_buttons(ui_save_btns, 0)
toggle_buttons(ui_clear_btns, -1)
end on
on ui_control (btn_save_modulation)
show_save_confirm_controls(1, 1) // bool, num
toggle_buttons(ui_save_btns, 1)
toggle_buttons(ui_clear_btns, -1)
end on
function toggle_buttons(array, num)
// Go through all elements of UI ID array
for i := 0 to num_elements(array) - 1
// Set value of each element to 0
array[i] -> value := 0
if (num >= 0)
if (array[i] = array[num])
array[num] -> value := 1
end if
end if
end for
end function