This commit is contained in:
2025-12-10 23:11:59 +08:00
parent 7ad20497d8
commit a04be19af5
31 changed files with 985 additions and 389 deletions
+37
View File
@@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://b048nsl527nah"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false
+44 -53
View File
@@ -1,37 +1,22 @@
[gd_scene load_steps=7 format=3 uid="uid://launcher_main"]
[gd_scene load_steps=12 format=3 uid="uid://lwtn5sbr5jr2"]
[ext_resource type="Script" path="res://scripts/launcher_main.gd" id="1"]
[ext_resource type="Script" path="res://scripts/version_checker.gd" id="2"]
[ext_resource type="Script" path="res://scripts/download_manager.gd" id="3"]
[ext_resource type="Script" path="res://scripts/update_applier.gd" id="4"]
[ext_resource type="Script" path="res://scripts/news_fetcher.gd" id="5"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_bg"]
bg_color = Color(0.039, 0.039, 0.102, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_panel"]
bg_color = Color(0.078, 0.078, 0.157, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
corner_radius_bottom_right = 12
corner_radius_bottom_left = 12
[ext_resource type="Script" uid="uid://cvstgaigwt0sj" path="res://scripts/launcher_main.gd" id="1"]
[ext_resource type="Script" uid="uid://ptdurqksg1sv" path="res://scripts/version_checker.gd" id="2"]
[ext_resource type="Script" uid="uid://cer12vb230kfw" path="res://scripts/download_manager.gd" id="3"]
[ext_resource type="Script" uid="uid://n2ptlbblexo6" path="res://scripts/update_applier.gd" id="4"]
[ext_resource type="Script" uid="uid://coer7l074xm6x" path="res://scripts/news_fetcher.gd" id="5"]
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_titlebar"]
bg_color = Color(0.059, 0.059, 0.118, 1)
corner_radius_top_left = 12
corner_radius_top_right = 12
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
bg_color = Color(0, 0.831, 1, 1)
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
bg_color = Color(0.2, 0.9, 1, 1)
corner_radius_top_left = 8
corner_radius_top_right = 8
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_tab_panel"]
content_margin_left = 8.0
content_margin_top = 8.0
content_margin_right = 8.0
content_margin_bottom = 8.0
bg_color = Color(0.059, 0.059, 0.118, 1)
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
@@ -49,14 +34,19 @@ corner_radius_top_right = 4
corner_radius_bottom_right = 4
corner_radius_bottom_left = 4
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_tab_panel"]
bg_color = Color(0.059, 0.059, 0.118, 1)
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button_hover"]
bg_color = Color(0.2, 0.9, 1, 1)
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_button"]
bg_color = Color(0, 0.831, 1, 1)
corner_radius_top_left = 8
corner_radius_top_right = 8
corner_radius_bottom_right = 8
corner_radius_bottom_left = 8
content_margin_left = 8.0
content_margin_top = 8.0
content_margin_right = 8.0
content_margin_bottom = 8.0
[node name="Launcher" type="Control"]
layout_mode = 3
@@ -65,7 +55,6 @@ anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
theme_override_styles/panel = SubResource("StyleBoxFlat_bg")
script = ExtResource("1")
[node name="Background" type="ColorRect" parent="."]
@@ -73,6 +62,8 @@ layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
color = Color(0.039, 0.039, 0.102, 1)
[node name="VersionChecker" type="Node" parent="."]
@@ -87,7 +78,7 @@ script = ExtResource("4")
[node name="NewsFetcher" type="Node" parent="."]
script = ExtResource("5")
[node name="MainPanel" type="PanelContainer" parent="."]
[node name="MainPanel" type="VBoxContainer" parent="."]
layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
@@ -96,39 +87,35 @@ offset_left = 20.0
offset_top = 20.0
offset_right = -20.0
offset_bottom = -20.0
theme_override_styles/panel = SubResource("StyleBoxFlat_panel")
grow_horizontal = 2
grow_vertical = 2
[node name="TitleBar" type="PanelContainer" parent="MainPanel"]
custom_minimum_size = Vector2(0, 60)
layout_mode = 2
size_flags_vertical = 0
custom_minimum_size = Vector2(0, 60)
theme_override_styles/panel = SubResource("StyleBoxFlat_titlebar")
[node name="HBoxContainer" type="HBoxContainer" parent="MainPanel/TitleBar"]
layout_mode = 2
offset_left = 16.0
offset_right = -16.0
[node name="TitleLabel" type="Label" parent="MainPanel/TitleBar/HBoxContainer"]
layout_mode = 2
size_flags_horizontal = 3
text = "TEKTON LAUNCHER"
theme_override_colors/font_color = Color(0, 0.831, 1, 1)
theme_override_font_sizes/font_size = 24
text = "TEKTON LAUNCHER"
[node name="VersionLabel" type="Label" parent="MainPanel/TitleBar"]
layout_mode = 2
offset_left = 750.0
offset_top = 20.0
offset_right = 840.0
offset_bottom = 40.0
text = "v0.0.0"
theme_override_colors/font_color = Color(0.533, 0.533, 0.6, 1)
text = "v0.0.0"
horizontal_alignment = 2
[node name="ContentContainer" type="VBoxContainer" parent="MainPanel"]
layout_mode = 2
offset_top = 60.0
size_flags_vertical = 3
alignment = 1
[node name="TabContainer" type="TabContainer" parent="MainPanel/ContentContainer"]
layout_mode = 2
@@ -145,6 +132,8 @@ layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="NewsVBox" type="VBoxContainer" parent="MainPanel/ContentContainer/TabContainer/News/ScrollContainer"]
layout_mode = 2
@@ -161,6 +150,8 @@ layout_mode = 1
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
[node name="ChangelogVBox" type="VBoxContainer" parent="MainPanel/ContentContainer/TabContainer/Changelog/ScrollContainer"]
layout_mode = 2
@@ -168,39 +159,39 @@ size_flags_horizontal = 3
size_flags_vertical = 3
[node name="BottomBar" type="HBoxContainer" parent="MainPanel/ContentContainer"]
layout_mode = 2
custom_minimum_size = Vector2(0, 80)
layout_mode = 2
alignment = 2
[node name="StatusLabel" type="Label" parent="MainPanel/ContentContainer/BottomBar"]
layout_mode = 2
size_flags_horizontal = 3
text = "Checking for updates..."
theme_override_colors/font_color = Color(0.533, 0.533, 0.6, 1)
text = "Checking for updates..."
[node name="ProgressContainer" type="VBoxContainer" parent="MainPanel/ContentContainer/BottomBar"]
visible = false
layout_mode = 2
custom_minimum_size = Vector2(200, 0)
layout_mode = 2
[node name="ProgressBar" type="ProgressBar" parent="MainPanel/ContentContainer/BottomBar/ProgressContainer"]
layout_mode = 2
custom_minimum_size = Vector2(200, 20)
layout_mode = 2
theme_override_styles/background = SubResource("StyleBoxFlat_progress_bg")
theme_override_styles/fill = SubResource("StyleBoxFlat_progress_fill")
show_percentage = false
[node name="ProgressLabel" type="Label" parent="MainPanel/ContentContainer/BottomBar/ProgressContainer"]
layout_mode = 2
text = "0%"
theme_override_colors/font_color = Color(0.533, 0.533, 0.6, 1)
text = "0%"
horizontal_alignment = 1
[node name="PlayButton" type="Button" parent="MainPanel/ContentContainer/BottomBar"]
layout_mode = 2
custom_minimum_size = Vector2(160, 50)
layout_mode = 2
theme_override_colors/font_color = Color(0.039, 0.039, 0.102, 1)
theme_override_font_sizes/font_size = 18
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
theme_override_styles/hover = SubResource("StyleBoxFlat_button_hover")
theme_override_styles/normal = SubResource("StyleBoxFlat_button")
text = "► PLAY"
+1
View File
@@ -0,0 +1 @@
uid://huq4exk8psgu
+1
View File
@@ -0,0 +1 @@
uid://cer12vb230kfw
+1
View File
@@ -0,0 +1 @@
uid://cvstgaigwt0sj
+1
View File
@@ -0,0 +1 @@
uid://coer7l074xm6x
+4 -4
View File
@@ -8,7 +8,7 @@ signal update_completed
signal update_failed(error: String)
signal rollback_completed
const BACKUP_COUNT := 2 # Keep this many backup versions
const BACKUP_COUNT := 2 # Keep this many backup versions
func apply_update(downloaded_pck_path: String, version: String) -> void:
emit_signal("update_started")
@@ -91,7 +91,7 @@ func _copy_file(from: String, to: String) -> bool:
return false
# Copy in chunks for large files
const CHUNK_SIZE := 1024 * 1024 # 1MB chunks
const CHUNK_SIZE := 1024 * 1024 # 1MB chunks
while source.get_position() < source.get_length():
var chunk := source.get_buffer(CHUNK_SIZE)
dest.store_buffer(chunk)
@@ -121,7 +121,7 @@ func _cleanup_old_backups(backup_dir: String, keep_count: int) -> void:
# Remove oldest backups if we have too many
while backups.size() > keep_count:
var old_backup := backups.pop_front()
var old_backup = backups.pop_front()
dir.remove(old_backup)
print("[UpdateApplier] Removed old backup: ", old_backup)
@@ -151,7 +151,7 @@ func rollback_to_backup() -> bool:
return false
backups.sort()
var latest_backup := backups.back()
var latest_backup = backups.back()
# Restore the backup
if _copy_file(backup_dir + latest_backup, game_dir + pck_name):
+1
View File
@@ -0,0 +1 @@
uid://n2ptlbblexo6
+1
View File
@@ -0,0 +1 @@
uid://ptdurqksg1sv