Skip to content

Commit df25c8f

Browse files
committed
Restore original draw_loading code and move new code to a new script
Restored the original loading bar drawing code for historical reasons (despite unused, it's still mentioned in a few places in the code). Moved the download progress bar drawing code to a new script called draw_downloadprogress().
1 parent 99b4291 commit df25c8f

File tree

5 files changed

+44
-1
lines changed

5 files changed

+44
-1
lines changed

Minecraft Note Block Studio.yyp

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

scripts/control_draw/control_draw.gml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,7 @@ draw_windows()
13271327
// Draw update progress bar
13281328
if (update == 4) {
13291329
window = -1
1330-
draw_loading("Update", "Downloading update...", downloaded_size, total_size)
1330+
draw_downloadprogress("Update", "Downloading update...", downloaded_size, total_size)
13311331
}
13321332

13331333
window_set_cursor(curs)
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// draw_downloadprogress(caption, desc, downloaded_size, total_size)
2+
var caption, desc, done, total, done_mb, total_mb, percent, x1, y1;
3+
caption = argument0
4+
desc = argument1
5+
done = argument2
6+
total = argument3
7+
percent = done/total
8+
done_mb = done/power(1024, 2)
9+
total_mb = total/power(1024, 2)
10+
x1 = floor(window_width / 2 - 150)
11+
y1 = floor(window_height / 2 - 50)
12+
draw_theme_color()
13+
draw_window(x1, y1, x1 + 300, y1 + 100)
14+
draw_set_font(fnt_mainbold)
15+
draw_text(x1 + 16, y1 + 16, caption)
16+
draw_set_font(fnt_main)
17+
draw_set_halign(fa_center)
18+
draw_text(floor(window_width / 2), y1 + 40, desc)
19+
draw_set_color(10512464)
20+
draw_rectangle(x1 + 30, y1 + 60, x1 + 30 + percent * 240, y1 + 80, 0)
21+
draw_theme_color()
22+
draw_rectangle(x1 + 30, y1 + 60, x1 + 270, y1 + 80, 1)
23+
if (percent > 0.5) draw_set_color(c_white)
24+
draw_text(floor(window_width / 2), y1 + 65, string_format(done_mb, 0, 2) + "/" + string_format(total_mb, 0, 2) + " MB (" + string(round(percent * 100)) + "%)")
25+
draw_set_halign(fa_left)

scripts/draw_downloadprogress/draw_downloadprogress.yy

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

views/851a6098-0a35-48ef-8f86-8d6cd677f3fd.yy

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)