Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_custommenu_Create_0

(view raw script w/o annotations or w/e)
1
ubuffer = 1;
2
dbuffer = 1;
3
rbuffer = 1;
4
lbuffer = 1;
5
buffer1 = 1;
6
buffer2 = 1;
7
buffer3 = 1;
8
scrolltimer = 0;
9
scrollrepeat = 4;
10
dheld = 0;
11
uheld = 0;
12
rheld = 0;
13
lheld = 0;
14
menu = 0;
15
init = 0;
16
heartX = 0;
17
heartY = 0;
18
wrap = 0;
19
menuMax = 4;
20
edgedebug = 0;
21
siner = 0;
22
type = 1;
23
reminteract = global.interact;
24
menuSprite = spr_heart;
25
display_buttons = false;
26
for (i = 0; i < menuMax; i++)
27
{
28
    menuCoord[i] = 0;
29
    menuHeight[i] = 6;
30
    menuWidth[i] = 4;
31
    menuNext[i] = i + 1;
32
    menuPrevious[i] = i - 1;
33
    menuMinimumID[i] = 0;
34
    menuMaximumID[i] = 100;
35
    menuVEdgeBehavior[i] = 0;
36
    menuHEdgeBehavior[i] = 0;
37
    menuPageSize[i] = 24;
38
    menuScrollCurrent[i] = 0;
39
    menuScrollAdd[i] = 0;
40
    if (menuHEdgeBehavior[i] == 2)
41
        menuScrollAdd[i] = menuPageSize[i];
42
    if (menuVEdgeBehavior[i] == 2)
43
        menuScrollAdd[i] = menuWidth[i];
44
    menuVHeld[i] = 8;
45
    menuHHeld[i] = 8;
46
    menuDisplayCondition[i] = 2;
47
    menuTextColor[i] = c_white;
48
    menuTextColorUnselectable[i] = c_gray;
49
    menuTextColorHover[i] = c_yellow;
50
    menuTextColorInactive[i] = c_gray;
51
    menuTextColorSelected[i] = c_yellow;
52
    menuTextFont[i] = scr_84_get_font
scr_84_get_font

function scr_84_get_font(arg0) { if (!variable_global_exists("chemg_last_get_font")) global.chemg_last_get_font = ""; if (arg0 != global.chemg_last_get_font) global.chemg_last_get_font = arg0; return ds_map_find_value(global.font_map, arg0); }
("mainbig");
53
    menuTextScaleType[i] = 0;
54
    menuTextXScale[i] = 1;
55
    menuTextYScale[i] = 1;
56
    menuTextWidth[i] = 100;
57
    menuTextHeight[i] = 0;
58
    menuOptionX[i] = 40;
59
    menuOptionY[i] = 40;
60
    menuSpacingOverride[i] = 0;
61
    menuSpacingX[i] = 100;
62
    menuSpacingY[i] = 40;
63
    menuTextOffsetX[i] = 30;
64
    menuTextOffsetY[i] = 0;
65
    menuX[i] = __view_get(e__VW.XView, 0);
66
    menuY[i] = __view_get(e__VW.YView, 0);
67
    menuBoxDraw[i] = 1;
68
    menuBoxDrawX1[i] = menuX[i] - 20;
69
    menuBoxDrawX2[i] = menuX[i] + (menuSpacingX[i] * menuWidth[i]) + 20;
70
    menuBoxDrawY1[i] = menuY[i] - 10;
71
    menuBoxDrawY2[i] = menuY[i] + (menuSpacingY[i] * menuHeight[i]) + 10;
72
    wrap = 0;
73
    vwrap = 0;
74
    for (j = 0; j <= menuMaximumID[i]; j++)
75
    {
76
        optionID[i][j] = j;
77
        optionX[i][j] = menuX[i] + (wrap * menuSpacingX[i]);
78
        optionY[i][j] = menuY[i] + (vwrap * menuSpacingY[i]);
79
        optionText[i][j] = "---";
80
        optionSelectable[i][j] = 0;
81
        optionSelected[i][j] = 0;
82
        optionEffect[i][j] = 0;
83
        wrap++;
84
        if (wrap >= menuWidth[i])
85
        {
86
            wrap = 0;
87
            vwrap++;
88
        }
89
        optionSelectable[i][j] = choose(0, 1);
90
        optionText[i][j] = choose("A", "B", "C", "D") + choose("A", "E", "I") + choose("T", "R", "S", "Q");
91
        optionCommentA[i][j] = " ";
92
        optionCommentB[i][j] = " ";
93
        optionCommentC[i][j] = " ";
94
        optionCommentAColor[i][j] = c_gray;
95
        optionCommentBColor[i][j] = c_gray;
96
        optionCommentCColor[i][j] = c_gray;
97
        optionCommentAWidth[i][j] = 0;
98
        optionCommentBWidth[i][j] = 0;
99
        optionCommentCWidth[i][j] = 0;
100
        optionCommentAHeight[i][j] = 0;
101
        optionCommentBHeight[i][j] = 0;
102
        optionCommentCHeight[i][j] = 0;
103
        optionCommentAXOffset[i][j] = 100;
104
        optionCommentBXOffset[i][j] = 100;
105
        optionCommentCXOffset[i][j] = 100;
106
        optionCommentAYOffset[i][j] = 100;
107
        optionCommentBYOffset[i][j] = 100;
108
        optionCommentCYOffset[i][j] = 100;
109
        optionTopComment[i][j] = " ";
110
    }
111
    menuHeaderTextAmount[i] = 3;
112
    for (j = 0; j < menuHeaderTextAmount[i]; j++)
113
    {
114
        menuHeaderText[i][j] = " ";
115
        menuHeaderX[i][j] = (menuBoxDrawX1[i] + menuBoxDrawX2[i]) / 2;
116
        menuHeaderY[i][j] = menuBoxDrawY1[i] + 10;
117
        menuHeaderColor[i][j] = c_white;
118
        menuHeaderWidth[i][j] = 0;
119
        menuHeaderHeight[i][j] = 0;
120
    }
121
}
122
123
enum e__VW
124
{
125
    XView,
126
    YView,
127
    WView,
128
    HView,
129
    Angle,
130
    HBorder,
131
    VBorder,
132
    HSpeed,
133
    VSpeed,
134
    Object,
135
    Visible,
136
    XPort,
137
    YPort,
138
    WPort,
139
    HPort,
140
    Camera,
141
    SurfaceID
142
}