From b4b1dcdc4a77539358a8e3fd5f9aa76e1bc69cc1 Mon Sep 17 00:00:00 2001 From: notdraimdev Date: Tue, 8 Oct 2024 23:33:47 +0200 Subject: [PATCH] Linux crash fixes --- Main.tscn | 2 ++ main.gd | 53 ++++++++++++++++++++++++++++------------------------- 2 files changed, 30 insertions(+), 25 deletions(-) diff --git a/Main.tscn b/Main.tscn index 09d7680..3b79121 100644 --- a/Main.tscn +++ b/Main.tscn @@ -873,6 +873,7 @@ script = ExtResource("12_073mb") [node name="SettingsHolder" type="Control" parent="."] layout_mode = 1 +anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 @@ -880,6 +881,7 @@ anchor_bottom = 0.5 offset_top = -294.0 offset_bottom = -294.0 grow_horizontal = 2 +grow_vertical = 2 [node name="SettingsPopup" type="Control" parent="SettingsHolder"] visible = false diff --git a/main.gd b/main.gd index fb6b471..fba4d82 100644 --- a/main.gd +++ b/main.gd @@ -414,11 +414,13 @@ func _process(_delta: float) -> void: print("yoo") @warning_ignore("integer_division") UpdateSplashes() - print(DiscordRPC.get_current_user()["username"]) + if DiscordRPC.get_is_discord_working(): + print(DiscordRPC.get_current_user()["username"]) print(TimeSpentListening) var LText = SplashStrings.pick_random() DiscordRPC.large_image_text = LText - DiscordRPC.refresh() + if DiscordRPC.get_is_discord_working(): + DiscordRPC.refresh() # "59:59 remaining" timestamp for the activity if music_player.playing: TimeSpentListening += _delta @@ -470,29 +472,30 @@ func _process(_delta: float) -> void: func UpdateSplashes(): - SplashStrings = ["Total listening time: %s!" % str(str(int(TimeSpentListening/60)/60 ) - + "h : " + str((int(TimeSpentListening) / 60) % 60) + "m : " + - str(int(TimeSpentListening) % 60) + "s"), - "Version: %s" % version.text,"🤷‍♂️","This Changes every ~11 seconds", - "hello everybody my name is %s" % DiscordRPC.get_current_user()["username"], - "wash your dishes, i know you got some","Running on %s" % OS.get_distribution_name(), - "%s is cooking" % DiscordRPC.get_current_user()["username"], "debugging" if OS.has_feature("editor") else "Release build", - "this user chose to show you all this info","Playing a Banger", - ":steamhappy:","This is a sign that crocodiles live in water", - "Space? SPACE?! SPAAAAAAAAAAAAACE!!!", - "i love gd colonge", - "listening with reverb" if settings_menu_child.reverb_check.button_pressed else - "not listening with reverb","the cake is edible", - "what a great song!","this message is useless", - "stop reading these","why are you reading these", - "hello from mars", "hello to mars","there is a fly in my room", - "yippee!","What, are they allergic to bathtubs or something", - "Did you know, a 737 can land with up to 33knots of wind!", - "Welcome to todays JahresSchau", - "ram is very useful","your cpu is tasty","main course: Nvidia GPU", - "SCHOTTLAND FUER IMMER","i eat airborne vehicles","linus trovalds", - "™","\(〇_o)/","Nuh Uh!","Yuh Huh","Breaching.", - "I get a narcissistic injury when the wall ignores me","totally not using %s" % version.text] + if DiscordRPC.get_is_discord_working(): + SplashStrings = ["Total listening time: %s!" % str(str(int(TimeSpentListening/60)/60 ) + + "h : " + str((int(TimeSpentListening) / 60) % 60) + "m : " + + str(int(TimeSpentListening) % 60) + "s"), + "Version: %s" % version.text,"🤷‍♂️","This Changes every ~11 seconds", + "hello everybody my name is %s" % DiscordRPC.get_current_user()["username"], + "wash your dishes, i know you got some","Running on %s" % OS.get_distribution_name(), + "%s is cooking" % DiscordRPC.get_current_user()["username"], "debugging" if OS.has_feature("editor") else "Release build", + "this user chose to show you all this info","Playing a Banger", + ":steamhappy:","This is a sign that crocodiles live in water", + "Space? SPACE?! SPAAAAAAAAAAAAACE!!!", + "i love gd colonge", + "listening with reverb" if settings_menu_child.reverb_check.button_pressed else + "not listening with reverb","the cake is edible", + "what a great song!","this message is useless", + "stop reading these","why are you reading these", + "hello from mars", "hello to mars","there is a fly in my room", + "yippee!","What, are they allergic to bathtubs or something", + "Did you know, a 737 can land with up to 33knots of wind!", + "Welcome to todays JahresSchau", + "ram is very useful","your cpu is tasty","main course: Nvidia GPU", + "SCHOTTLAND FUER IMMER","i eat airborne vehicles","linus trovalds", + "™","\(〇_o)/","Nuh Uh!","Yuh Huh","Breaching.", + "I get a narcissistic injury when the wall ignores me","totally not using %s" % version.text] func SaveEverything():