Used new notice() to notify user if executable file doesn't exist. (And re-install in that case too)
This commit is contained in:
parent
cd6396cada
commit
fc21c328e4
25
Main_menu.gd
25
Main_menu.gd
@ -48,7 +48,6 @@ func _process(_delta):
|
|||||||
|
|
||||||
# When everything is loaded,
|
# When everything is loaded,
|
||||||
func _ready():
|
func _ready():
|
||||||
|
|
||||||
# Determine the os_name
|
# Determine the os_name
|
||||||
if OS.get_name() == "X11": # X11 is linuxy-based
|
if OS.get_name() == "X11": # X11 is linuxy-based
|
||||||
os_name = "linux"
|
os_name = "linux"
|
||||||
@ -144,13 +143,19 @@ func _on_Play_button_pressed():
|
|||||||
# If not,
|
# If not,
|
||||||
# Play the game
|
# Play the game
|
||||||
else:
|
else:
|
||||||
# Attempt to execute the UltraFlare executable
|
# Check if there's an executable installed
|
||||||
var exit_code = OS.execute(OS.get_config_dir()+"/UltraFlare/current/UltraFlare-"+os_name+"-x86_64"+suffix, [], false)
|
if File.new().file_exists(OS.get_config_dir()+"/UltraFlare/current/UltraFlare-"+os_name+"-x86_64"+suffix):
|
||||||
|
# Attempt to execute the UltraFlare executable
|
||||||
# If the exit_code is anything other than -1,
|
var exit_code = OS.execute(OS.get_config_dir()+"/UltraFlare/current/UltraFlare-"+os_name+"-x86_64"+suffix, [], false)
|
||||||
if exit_code != -1:
|
|
||||||
# Close the launcher, the game should have started
|
# If the exit_code is anything other than -1,
|
||||||
get_tree().quit()
|
if exit_code != -1:
|
||||||
# If not, print out a debug message with the exit code
|
# Close the launcher, the game should have started
|
||||||
|
get_tree().quit()
|
||||||
|
# If not, print out a debug message with the exit code
|
||||||
|
else:
|
||||||
|
print("Running UltraFlare failed with code: "+exit_code)
|
||||||
|
# If not,
|
||||||
else:
|
else:
|
||||||
print("Running UltraFlare failed with code: "+exit_code)
|
notice("Executable not found! Click 'UPDATE' to install it again", "alert")
|
||||||
|
Store.write_store("current_version", "")
|
||||||
|
@ -4,7 +4,6 @@
|
|||||||
[ext_resource path="res://Notice_msg.gd" type="Script" id=2]
|
[ext_resource path="res://Notice_msg.gd" type="Script" id=2]
|
||||||
|
|
||||||
[sub_resource type="DynamicFont" id=1]
|
[sub_resource type="DynamicFont" id=1]
|
||||||
size = 24
|
|
||||||
extra_spacing_char = 4
|
extra_spacing_char = 4
|
||||||
font_data = ExtResource( 1 )
|
font_data = ExtResource( 1 )
|
||||||
|
|
||||||
@ -37,7 +36,7 @@ tracks/1/keys = {
|
|||||||
|
|
||||||
[sub_resource type="Animation" id=3]
|
[sub_resource type="Animation" id=3]
|
||||||
resource_name = "move_off_screen"
|
resource_name = "move_off_screen"
|
||||||
length = 0.3
|
length = 0.5
|
||||||
tracks/0/type = "value"
|
tracks/0/type = "value"
|
||||||
tracks/0/path = NodePath("Label:rect_position")
|
tracks/0/path = NodePath("Label:rect_position")
|
||||||
tracks/0/interp = 1
|
tracks/0/interp = 1
|
||||||
@ -45,10 +44,10 @@ tracks/0/loop_wrap = true
|
|||||||
tracks/0/imported = false
|
tracks/0/imported = false
|
||||||
tracks/0/enabled = true
|
tracks/0/enabled = true
|
||||||
tracks/0/keys = {
|
tracks/0/keys = {
|
||||||
"times": PoolRealArray( 0, 0.3 ),
|
"times": PoolRealArray( 0, 0.5 ),
|
||||||
"transitions": PoolRealArray( 1, 1 ),
|
"transitions": PoolRealArray( 1, 1 ),
|
||||||
"update": 0,
|
"update": 0,
|
||||||
"values": [ Vector2( 0, 0 ), Vector2( -200, 0 ) ]
|
"values": [ Vector2( 0, 0 ), Vector2( -1000, 0 ) ]
|
||||||
}
|
}
|
||||||
|
|
||||||
[node name="Notice_msg" type="Node2D"]
|
[node name="Notice_msg" type="Node2D"]
|
||||||
|
Loading…
Reference in New Issue
Block a user