Skip to content

Commit f35ab9f

Browse files
committed
Fix "Sucessfully updated" text not appearing after updating
Create a new variable `update_success` that bypasses the other status options when true. The "Successfully updated!" string would never actually appear, since the async update check would override it later with "You are using the latest version!" (`update == 2`). This text only started appearing before due to a bug solved in 9440548, in which the update check would be stuck at "Checking for updates...". Since the logic for actually verifying if there's a newer version was never executed, the `update` status "had a chance" to stay set to 3, which would display the text properly.
1 parent e336328 commit f35ab9f

File tree

2 files changed

+26
-24
lines changed

2 files changed

+26
-24
lines changed

scripts/control_create/control_create.gml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ function control_create() {
7979
update = 0
8080
check_update = 1
8181
check_prerelease = 0
82+
update_success = 0
8283
show_welcome = 1
8384
scroll_wheel = 0
8485
theme = 3 // Using Fluent as the default theme
@@ -504,7 +505,7 @@ function control_create() {
504505
if (theme = 2) fdark = 1
505506
theme = 3 // Sets to the Fluent theme when updated
506507
window = w_update
507-
update = 3
508+
update_success = 1
508509
}
509510

510511
// Delete old installer

scripts/draw_window_greeting/draw_window_greeting.gml

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -16,32 +16,33 @@ function draw_window_greeting() {
1616
if (language != 1) draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "Running from the GameMaker IDE.")
1717
else draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "在IDE中运行")
1818
} else if (check_update) {
19-
if (update = -1) {
20-
draw_set_color(c_red)
21-
if (language != 1) draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "Could not check for updates")
22-
else draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "检查更新失败")
23-
}
24-
if (update = 0) {
25-
//draw_set_color(c_gray)
26-
if (language != 1) draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "Checking for updates...")
27-
else draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "正在检查更新……")
28-
}
29-
if (update = 1) {
30-
draw_set_color(33023)
31-
if (language != 1) draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "There is an update available!")
32-
else draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "有新版本!")
33-
}
34-
if (update = 2) {
35-
draw_set_color(c_green)
36-
if (theme == 2) draw_set_color(c_lime)
37-
if (language != 1) draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "You are using the latest version!")
38-
else draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "已为最新版本!")
39-
}
40-
if (update = 3) {
19+
if (update_success) {
4120
draw_set_color(c_lime)
4221
if (language != 1) draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "Successfully updated!")
4322
else draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "更新成功!")
44-
}
23+
} else {
24+
if (update = -1) {
25+
draw_set_color(c_red)
26+
if (language != 1) draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "Could not check for updates")
27+
else draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "检查更新失败")
28+
}
29+
else if (update = 0) {
30+
//draw_set_color(c_gray)
31+
if (language != 1) draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "Checking for updates...")
32+
else draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "正在检查更新……")
33+
}
34+
else if (update = 1) {
35+
draw_set_color(33023)
36+
if (language != 1) draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "There is an update available!")
37+
else draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "有新版本!")
38+
}
39+
else if (update = 2) {
40+
draw_set_color(c_green)
41+
if (theme == 2) draw_set_color(c_lime)
42+
if (language != 1) draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "You are using the latest version!")
43+
else draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "已为最新版本!")
44+
}
45+
}
4546
} else {
4647
draw_set_color(c_red)
4748
if (language != 1) draw_text_center(x1 + 132, y1 + 248 + dev_label_offset, "Update checking disabled by user")

0 commit comments

Comments
 (0)