Deltarune (Chapter Select) script viewer

← back to main script listing

gml_Object_obj_ui_choice_Create_0

(view raw script w/o annotations or w/e)
1
_parent = -4;
2
_init = false;
3
_input_enabled = false;
4
_is_highlighted = false;
5
_disabled = false;
6
_input_buffer = 2;
7
_input_time = _input_buffer;
8
_heart_enabled = false;
9
_text = "";
10
_value = -4;
11
_text_offset = 0;
12
_alpha = 1;
13
_scale = 2;
14
_color = 16777215;
15
_font = (global.lang == "en") ? 2 : 1;
16
_centered = false;
17
18
init = function(arg0, arg1, arg2)
19
{
20
    _parent = arg0;
21
    _text = arg1;
22
    _value = arg2;
23
    _init = true;
24
};
25
26
align_center = function()
27
{
28
    _centered = true;
29
};
30
31
set_font = function(arg0)
32
{
33
    _font = arg0;
34
};
35
36
set_alpha = function(arg0)
37
{
38
    _alpha = arg0;
39
};
40
41
enable_input = function()
42
{
43
    _input_enabled = true;
44
    _input_time = _input_buffer;
45
};
46
47
disable_input = function()
48
{
49
    _input_enabled = false;
50
};
51
52
disable = function()
53
{
54
    _disabled = true;
55
    _color = 8421504;
56
    disable_input();
57
};
58
59
enable = function()
60
{
61
    _disabled = false;
62
    reset();
63
};
64
65
highlight = function()
66
{
67
    _is_highlighted = true;
68
    _color = 65535;
69
    show_heart();
70
    enable_input();
71
};
72
73
reset = function()
74
{
75
    _is_highlighted = false;
76
    _color = 16777215;
77
    hide_heart();
78
    disable_input();
79
};
80
81
select = function()
82
{
83
    audio_play_sound(snd_select, 50, 0);
84
    _parent.trigger_event("select", _value);
85
};
86
87
hide_heart = function()
88
{
89
    _heart_enabled = false;
90
};
91
92
show_heart = function()
93
{
94
    _heart_enabled = true;
95
};