From accd1fe26f5fd84d6d9d00def7cf1acd639fc7b2 Mon Sep 17 00:00:00 2001 From: notdraimdev Date: Sat, 2 Nov 2024 19:23:51 +0100 Subject: [PATCH] Patchnotes inside simplaudio --- Main.tscn | 37 ++++++++++++++++--------------------- update_checker.gd | 3 +++ 2 files changed, 19 insertions(+), 21 deletions(-) diff --git a/Main.tscn b/Main.tscn index c015ec0..5e20bf8 100644 --- a/Main.tscn +++ b/Main.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=74 format=3 uid="uid://b2sygl55s6fng"] +[gd_scene load_steps=73 format=3 uid="uid://b2sygl55s6fng"] [ext_resource type="Script" path="res://main.gd" id="1_ubs1p"] [ext_resource type="Texture2D" uid="uid://b8on1case224h" path="res://LoopPressed.png" id="2_iolk5"] @@ -34,7 +34,6 @@ [ext_resource type="PackedScene" uid="uid://bel6i6wdbexw4" path="res://search_results.tscn" id="27_g8wmp"] [ext_resource type="Texture2D" uid="uid://bmbxyma4ra46p" path="res://Download.png" id="29_v44vi"] [ext_resource type="Script" path="res://update_checker.gd" id="30_byc5i"] -[ext_resource type="Script" path="res://patch_notes_button.gd" id="31_hjsj1"] [ext_resource type="Script" path="res://CustomButtonColor.gd" id="32_pwgec"] [ext_resource type="Script" path="res://loading_failed_screen.gd" id="37_mkkhu"] [ext_resource type="AudioStream" uid="uid://n8g3v41u2u48" path="res://Error.wav" id="38_nkjlp"] @@ -883,7 +882,7 @@ offset_left = -64.0 offset_top = -23.0 grow_horizontal = 0 grow_vertical = 0 -text = "v1.5.1" +text = "v1.5.2" horizontal_alignment = 2 [node name="SettingsButton" type="Button" parent="."] @@ -982,9 +981,9 @@ timeout = 5.0 [node name="ColorRect" type="ColorRect" parent="UpdateChecker"] layout_mode = 0 -offset_left = -214.0 -offset_top = -144.0 -offset_right = -24.0 +offset_left = -292.0 +offset_top = -256.0 +offset_right = -10.0 offset_bottom = -44.0 color = Color(0.14902, 0.14902, 0.14902, 1) @@ -1001,22 +1000,20 @@ text = "Update Available!" horizontal_alignment = 1 vertical_alignment = 1 -[node name="PatchNotesButton" type="Button" parent="UpdateChecker/ColorRect"] -z_index = 4 +[node name="Patchnotes" type="RichTextLabel" parent="UpdateChecker/ColorRect"] +z_index = 2 layout_mode = 1 -anchors_preset = 14 -anchor_top = 0.5 +anchors_preset = -1 +anchor_top = 0.150943 anchor_right = 1.0 -anchor_bottom = 0.5 -offset_top = -24.0 -offset_bottom = 12.0 +anchor_bottom = 0.820755 grow_horizontal = 2 grow_vertical = 2 -text = "View patch notes" -flat = true -script = ExtResource("31_hjsj1") +text = "PatchNotes" +context_menu_enabled = true +metadata/_edit_use_anchors_ = true -[node name="ColorRect" type="ColorRect" parent="UpdateChecker/ColorRect/PatchNotesButton"] +[node name="ColorRect" type="ColorRect" parent="UpdateChecker/ColorRect/Patchnotes"] z_index = -1 layout_mode = 1 anchors_preset = 15 @@ -1024,9 +1021,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -mouse_filter = 2 -color = Color(0.19706, 0.279877, 0.326012, 1) -script = ExtResource("32_pwgec") +color = Color(0.257219, 0.338913, 0.352311, 1) [node name="LinkButton" type="Button" parent="UpdateChecker/ColorRect"] z_index = 1 @@ -1061,7 +1056,7 @@ anchor_right = 1.0 offset_left = -72.0 offset_bottom = 72.0 grow_horizontal = 0 -scale = Vector2(0.25, 0.25) +scale = Vector2(0.4, 0.4) pivot_offset = Vector2(72, 0) icon = ExtResource("14_mioc4") flat = true diff --git a/update_checker.gd b/update_checker.gd index a3e912a..3655a27 100644 --- a/update_checker.gd +++ b/update_checker.gd @@ -10,6 +10,7 @@ extends Control @onready var errorLabel: Label = $"../UpdatingNotification/Error" @onready var updating_bg: ColorRect = $"../UpdatingBG" @onready var paused_indicator: TextureRect = $"../PausedIndicator" +@onready var patchnotes: RichTextLabel = $ColorRect/Patchnotes @export var errorColor:Color @@ -51,6 +52,8 @@ func _on_http_request_completed(result: int, _response_code: int, _headers: Pack update_available_text.text = result2["tag_name"] + " Is Out!" show() updateLink = result2["html_url"] + if result2.has("body"): + patchnotes.text = str(result2["body"]) func _on_close_buen_pressed() -> void: hide()