|
1
|
get_inputs(true);
|
|
2
|
t++;
|
|
3
|
if (selected)
|
|
4
|
exit;
|
|
5
|
var _sel_prev = selection;
|
|
6
|
if (vinput != 0)
|
|
7
|
vfast += vinput;
|
|
8
|
else
|
|
9
|
vfast = 0;
|
|
10
|
var _rapid = false;
|
|
11
|
if ((t % 3) == 0)
|
|
12
|
_rapid = true;
|
|
13
|
if (press_up || (_rapid && vfast < -9))
|
|
14
|
selection--;
|
|
15
|
if (press_down || (_rapid && vfast > 9))
|
|
16
|
selection++;
|
|
17
|
selection = scr_wrap_newscr_wrap_new
function scr_wrap_new()
{
var _val = argument[0];
var _max = argument[2];
var _min = argument[1];
if ((_val % 1) == 0)
{
while (_val > _max || _val < _min)
{
if (_val > _max)
{
_val = (_min + _val) - _max - 1;
}
else if (_val < _min)
{
_val = ((_max + _val) - _min) + 1;
}
else
{
}
}
return _val;
}
else
{
var _old = argument[0] + 1;
while (_val != _old)
{
_old = _val;
if (_val < _min)
{
_val = _max - (_min - _val);
}
else if (_val > _max)
{
_val = _min + (_val - _max);
}
else
{
}
}
return _val;
}
} (selection, 0, menu_length - 1);
|
|
18
|
if (selection != _sel_prev)
|
|
19
|
snd_play(snd_menumove);
|
|
20
|
if (hinput != 0)
|
|
21
|
hfast += hinput;
|
|
22
|
else
|
|
23
|
hfast = 0;
|
|
24
|
if (selection < (menu_length - 1))
|
|
25
|
{
|
|
26
|
if ((press_left || press_right) || (_rapid && abs(hfast) > 9))
|
|
27
|
{
|
|
28
|
opt[selection] = clamp(opt[selection] + hinput, 0, optmax[selection]);
|
|
29
|
snd_play(snd_menumove);
|
|
30
|
refresh_options();
|
|
31
|
}
|
|
32
|
}
|
|
33
|
if ((press_jump && selection == (menu_length - 1)) || keyboard_check_pressed(vk_enter) || button3_p())
|
|
34
|
{
|
|
35
|
selected = true;
|
|
36
|
snd_play(snd_select);
|
|
37
|
alarm[0] = 30; gml_Object_obj_chefs_toggles_Alarm_0.gml
instance_activate_all();
scr_chefs_start(opt[0]);
if (opt[1] > 0)
snd_play(minigame_kart);
instance_destroy();
|
|
38
|
}
|