diff --git a/.gitignore b/.gitignore index 2dcf1d23..87e0b89b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ export/ +.godot/ + diff --git a/Bakgrundsbild i launchern2.0.png.import b/Bakgrundsbild i launchern2.0.png.import index a34aea70..1e061575 100644 --- a/Bakgrundsbild i launchern2.0.png.import +++ b/Bakgrundsbild i launchern2.0.png.import @@ -1,8 +1,9 @@ [remap] importer="texture" -type="StreamTexture" -path="res://.import/Bakgrundsbild i launchern2.0.png-8210d112ce64ea8205615a57672407a9.stex" +type="CompressedTexture2D" +uid="uid://bauin1qhbv52q" +path="res://.godot/imported/Bakgrundsbild i launchern2.0.png-8210d112ce64ea8205615a57672407a9.ctex" metadata={ "vram_texture": false } @@ -10,25 +11,24 @@ metadata={ [deps] source_file="res://Bakgrundsbild i launchern2.0.png" -dest_files=[ "res://.import/Bakgrundsbild i launchern2.0.png-8210d112ce64ea8205615a57672407a9.stex" ] +dest_files=["res://.godot/imported/Bakgrundsbild i launchern2.0.png-8210d112ce64ea8205615a57672407a9.ctex"] [params] compress/mode=0 +compress/high_quality=false compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 +compress/hdr_compression=1 compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 +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/HDR_as_SRGB=false -process/invert_color=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 +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 diff --git a/GameVersion.gd b/GameVersion.gd index 1f6a06c5..8a778720 100644 --- a/GameVersion.gd +++ b/GameVersion.gd @@ -7,19 +7,19 @@ var download_url: String var file_to_run: String func _init(id: String, name: String, release_date: String, download_url: String, file_to_run: String): - self.id = id - self.name = name - self.release_date = release_date - self.download_url = download_url - self.file_to_run = file_to_run + self.id = id + self.name = name + self.release_date = release_date + self.download_url = download_url + self.file_to_run = file_to_run func asDict(): - var dict = {} - - dict["id"] = id - dict["name"] = name - dict["release_date"] = release_date - dict["url"] = download_url - dict["file_to_run"] = file_to_run - - return dict + var dict = {} + + dict["id"] = id + dict["name"] = name + dict["release_date"] = release_date + dict["url"] = download_url + dict["file_to_run"] = file_to_run + + return dict diff --git a/Verdana.ttf.import b/Verdana.ttf.import new file mode 100644 index 00000000..3d8cf6ff --- /dev/null +++ b/Verdana.ttf.import @@ -0,0 +1,33 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bqkc6pgu1hlux" +path="res://.godot/imported/Verdana.ttf-1f581ec4b5fbca84ada14569dc3f1e76.fontdata" + +[deps] + +source_file="res://Verdana.ttf" +dest_files=["res://.godot/imported/Verdana.ttf-1f581ec4b5fbca84ada14569dc3f1e76.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +hinting=1 +subpixel_positioning=1 +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Window.gd b/Window.gd index 0e284497..b3f22a07 100644 --- a/Window.gd +++ b/Window.gd @@ -13,189 +13,185 @@ var launcher_data_path: String = "user://launcher_data.json" var versions: Dictionary = {} func _ready(): - # This makes sure that a cmd-window doesn't pop up on Windows - if OS.get_name() == "Windows": - javaCommand = "javaw" - else: - javaCommand = "java" - - libFilePath = str(OS.get_user_data_dir(), "/libs/martolib_", MARTO_LIB_VERSION, ".jar") - ensureMartoLibIsDownloaded() - - var file = File.new() - if file.file_exists(launcher_data_path): - file.open(launcher_data_path, File.READ) - var fileContents = file.get_as_text() - var json = JSON.parse(fileContents) - currentVersion = json.result["current-version"] - loadVersionsDict(json.result["versions"]) - else: - $CenterPlay/MarginPlay/Play.hide() - - $VersionListRequest.request("https://www.martomate.com/api/hexacraft/versions") + # This makes sure that a cmd-window doesn't pop up on Windows + if OS.get_name() == "Windows": + javaCommand = "javaw" + else: + javaCommand = "java" + + libFilePath = str(OS.get_user_data_dir(), "/libs/martolib_", MARTO_LIB_VERSION, ".jar") + ensureMartoLibIsDownloaded() + + if FileAccess.file_exists(launcher_data_path): + var file = FileAccess.open(launcher_data_path, FileAccess.READ) + var fileContents = file.get_as_text() + var json = JSON.parse_string(fileContents) + currentVersion = json["current-version"] + loadVersionsDict(json["versions"]) + else: + $CenterPlay/MarginPlay/Play.hide() + + $VersionListRequest.request("https://www.martomate.com/api/hexacraft/versions") func ensureMartoLibIsDownloaded(): - var libDir = Directory.new() - libDir.open("user://") - if libDir.file_exists(libFilePath): - martoLibDownloaded = true - else: - print("Downloading MartoLib") - libDir.make_dir("libs") - $MartoLibDownloader.download_file = libFilePath - $MartoLibDownloader.request("https://www.martomate.com/api/libs/martolib") + var libDir = DirAccess.open("user://") + if libDir.file_exists(libFilePath): + martoLibDownloaded = true + else: + print("Downloading MartoLib") + libDir.make_dir("libs") + $MartoLibDownloader.download_file = libFilePath + $MartoLibDownloader.request("https://www.martomate.com/api/libs/martolib") func saveLauncherData(): - var file = File.new() - file.open("user://launcher_data.json", File.WRITE) - var versionList = [] - for v in versions.keys(): - if v != "latest-version": - versionList.append(versions[v].asDict()); - var jsonStr = JSON.print({ - "current-version": currentVersion, - "versions": versionList - }) - file.store_string(jsonStr) + var file = FileAccess.open("user://launcher_data.json", FileAccess.WRITE) + var versionList = [] + for v in versions.keys(): + if v != "latest-version": + versionList.append(versions[v].asDict()); + var jsonStr = JSON.stringify({ + "current-version": currentVersion, + "versions": versionList + }) + file.store_string(jsonStr) func _on_Play_pressed(): - saveLauncherData() - if ensureVersionIsDownloaded(currentVersion): - startGame(currentVersion) + saveLauncherData() + if ensureVersionIsDownloaded(currentVersion): + startGame(currentVersion) func startGame(versionID): - if checkIfMartoLibIsDownloaded(): - var version = versions[versionID] - var dir = str(OS.get_user_data_dir(), "/versions/", version.name) - - var output = [] - OS.execute(javaCommand, ["-jar", libFilePath, "execute", dir, javaCommand, "-jar", version.file_to_run], false, output) - OS.delay_msec(1000) - if !output.empty() && output[0] != "": - print("Failed to run game. Error: ", output) - - get_tree().quit() + if checkIfMartoLibIsDownloaded(): + var version = versions[versionID] + var dir = str(OS.get_user_data_dir(), "/versions/", version.name) + + var output = [] + OS.execute(javaCommand, ["-jar", libFilePath, "execute", dir, javaCommand, "-jar", version.file_to_run], output, true, false) + OS.delay_msec(1000) + if !output.is_empty() && output[0] != "": + print("Failed to run game. Error: ", output) + + get_tree().quit() func ensureVersionIsDownloaded(versionID): - var version = versions[versionID] - var dir = Directory.new() - dir.open("user://") - - var base = "user://versions/" + version.name - - if !dir.dir_exists(base): - var error = dir.make_dir_recursive(base) - if error != OK: - print(str("Could not make dir. Error: ", error)) - - $VersionDownloader.download_file = "user://tmp.zip" - - $CenterPlay/MarginPlay/Progress.value = 0 - - $CenterPlay/MarginPlay/Play.hide() - $CenterPlay/MarginPlay/Progress.show() - $DownloadProgress.start() - - var requestStatus = $VersionDownloader.request(version.download_url) - if requestStatus != OK: - print("Request failed with status: " + requestStatus) - else: - print("Requesting " + version.download_url) - return false - else: - return true + var version = versions[versionID] + var dir = DirAccess.open("user://") + + var base = "user://versions/" + version.name + + if !dir.dir_exists(base): + var error = dir.make_dir_recursive(base) + if error != OK: + print(str("Could not make dir. Error: ", error)) + + $VersionDownloader.download_file = "user://tmp.zip" + + $CenterPlay/MarginPlay/Progress.value = 0 + + $CenterPlay/MarginPlay/Play.hide() + $CenterPlay/MarginPlay/Progress.show() + $DownloadProgress.start() + + var requestStatus = $VersionDownloader.request(version.download_url) + if requestStatus != OK: + print("Request failed with status: " + requestStatus) + else: + print("Requesting " + version.download_url) + return false + else: + return true func _on_Versions_item_selected(ID): - var versionSelector = $MarginContainer/HBoxContainer/Versions - currentVersion = versionSelector.get_item_metadata(ID) + var versionSelector = $MarginContainer/HBoxContainer/Versions + currentVersion = versionSelector.get_item_metadata(ID) func _on_Settings_pressed(): - pass # Replace with function body. + pass # Replace with function body. func _on_VersionListRequest_request_completed(result, response_code, headers, body): - if result == HTTPRequest.RESULT_SUCCESS: - loadVersionsDict(JSON.parse(body.get_string_from_utf8()).result) - $CenterPlay/MarginPlay/Play.show() - saveLauncherData() - else: - print("Could not download latest version list. Result was: ", result, ", response_code", response_code) + if result == HTTPRequest.RESULT_SUCCESS: + loadVersionsDict(JSON.parse_string(body.get_string_from_utf8())) + $CenterPlay/MarginPlay/Play.show() + saveLauncherData() + else: + print("Could not download latest version list. Result was: ", result, ", response_code", response_code) func loadVersionsDict(p: Array): - if typeof(p) == TYPE_ARRAY: - versions.clear() - for v in p: - var version = GameVersion.new(v["id"], v["name"], v["release_date"], v["url"], v["file_to_run"]) - versions[version.id] = version - - var sortedVersions = Array(versions.values()) - sortedVersions.sort_custom(GameVersionSorter, "sort") - - var versionSelector = $MarginContainer/HBoxContainer/Versions - versionSelector.clear() - - versions["latest-version"] = sortedVersions[0] - versionSelector.add_item(str("Latest (", sortedVersions[0].name, ")")) - versionSelector.set_item_metadata(0, "latest-version") - if (currentVersion == "latest-version"): - versionSelector.select(0) - - for v in sortedVersions: - versionSelector.add_item(v.name) - versionSelector.set_item_metadata(versionSelector.get_item_count() - 1, v.id) - if (currentVersion == v.id): - versionSelector.select(versionSelector.get_item_count() - 1) - - else: - print("ERROR: The retrieved game versions were not in an array") + if typeof(p) == TYPE_ARRAY: + versions.clear() + for v in p: + var version = GameVersion.new(v["id"], v["name"], v["release_date"], v["url"], v["file_to_run"]) + versions[version.id] = version + + var sortedVersions = Array(versions.values()) + sortedVersions.sort_custom(Callable(GameVersionSorter, "sort")) + + var versionSelector = $MarginContainer/HBoxContainer/Versions + versionSelector.clear() + + versions["latest-version"] = sortedVersions[0] + versionSelector.add_item(str("Latest (", sortedVersions[0].name, ")")) + versionSelector.set_item_metadata(0, "latest-version") + if (currentVersion == "latest-version"): + versionSelector.select(0) + + for v in sortedVersions: + versionSelector.add_item(v.name) + versionSelector.set_item_metadata(versionSelector.get_item_count() - 1, v.id) + if (currentVersion == v.id): + versionSelector.select(versionSelector.get_item_count() - 1) + + else: + print("ERROR: The retrieved game versions were not in an array") class GameVersionSorter: - static func sort(a, b): - return a.name > b.name + static func sort(a, b): + return a.name > b.name func _on_VersionDownloader_request_completed(result, response_code, headers, body): - if result != HTTPRequest.RESULT_SUCCESS: - print("Failed to downloadload version. Result: ", result, ", response_code: ", response_code) - $DownloadProgress.stop() - updateVersionDownloadProgress() - - unzipAndStartGame() + if result != HTTPRequest.RESULT_SUCCESS: + print("Failed to downloadload version. Result: ", result, ", response_code: ", response_code) + $DownloadProgress.stop() + updateVersionDownloadProgress() + + unzipAndStartGame() func _on_DownloadProgress_timeout(): - updateVersionDownloadProgress() + updateVersionDownloadProgress() func updateVersionDownloadProgress(): - var maxBytes = $VersionDownloader.get_body_size() - if maxBytes != -1: - var downloadedBytes = $VersionDownloader.get_downloaded_bytes() - $CenterPlay/MarginPlay/Progress.max_value = maxBytes - $CenterPlay/MarginPlay/Progress.value = downloadedBytes + var maxBytes = $VersionDownloader.get_body_size() + if maxBytes != -1: + var downloadedBytes = $VersionDownloader.get_downloaded_bytes() + $CenterPlay/MarginPlay/Progress.max_value = maxBytes + $CenterPlay/MarginPlay/Progress.value = downloadedBytes func _on_MartoLibDownloader_request_completed(result, response_code, headers, body): - if result != HTTPRequest.RESULT_SUCCESS: - print("Failed to downloadload MartoLib. Result: ", result, ", response_code: ", response_code) - martoLibDownloaded = true + if result != HTTPRequest.RESULT_SUCCESS: + print("Failed to downloadload MartoLib. Result: ", result, ", response_code: ", response_code) + martoLibDownloaded = true func unzipAndStartGame(): - unzipDownloadedVersionFile() - - $CenterPlay/MarginPlay/Play.show() - $CenterPlay/MarginPlay/Progress.hide() - startGame(currentVersion) + unzipDownloadedVersionFile() + + $CenterPlay/MarginPlay/Play.show() + $CenterPlay/MarginPlay/Progress.hide() + startGame(currentVersion) func unzipDownloadedVersionFile(): - if checkIfMartoLibIsDownloaded(): - var filePath = str(OS.get_user_data_dir(), "/tmp.zip") - var output = [] - OS.execute(javaCommand, ["-jar", libFilePath, "unzip", filePath, str(OS.get_user_data_dir(), "/versions/", versions[currentVersion].name)], true, output) - if !output.empty() && output[0] != "": - print("Failed to unzip version file. Error: ", output) - - Directory.new().remove(filePath) + if checkIfMartoLibIsDownloaded(): + var filePath = str(OS.get_user_data_dir(), "/tmp.zip") + var output = [] + OS.execute(javaCommand, ["-jar", libFilePath, "unzip", filePath, str(OS.get_user_data_dir(), "/versions/", versions[currentVersion].name)], output, true, false) + if !output.is_empty() && output[0] != "": + print("Failed to unzip version file. Error: ", output) + + DirAccess.remove_absolute(filePath) func checkIfMartoLibIsDownloaded(): - if !martoLibDownloaded: - print("Cannot run MartoLib since it has't finished downloading yet") - return martoLibDownloaded + if !martoLibDownloaded: + print("Cannot run MartoLib since it has't finished downloading yet") + return martoLibDownloaded diff --git a/Window.tscn b/Window.tscn index 44f8c3d9..ca7b16f2 100644 --- a/Window.tscn +++ b/Window.tscn @@ -1,121 +1,145 @@ -[gd_scene load_steps=10 format=2] - -[ext_resource path="res://main_theme.tres" type="Theme" id=1] -[ext_resource path="res://Window.gd" type="Script" id=2] -[ext_resource path="res://Bakgrundsbild i launchern2.0.png" type="Texture" id=3] -[ext_resource path="res://Verdana.ttf" type="DynamicFontData" id=4] -[ext_resource path="res://play_button_style.tres" type="StyleBox" id=5] - -[sub_resource type="DynamicFont" id=1] -size = 64 -outline_size = 2 -outline_color = Color( 0, 0, 0, 1 ) -font_data = ExtResource( 4 ) - -[sub_resource type="Theme" id=2] -Button/colors/font_color = Color( 0.878431, 0.878431, 0.878431, 1 ) -Button/colors/font_color_disabled = Color( 0.9, 0.9, 0.9, 0.2 ) -Button/colors/font_color_hover = Color( 0.941176, 0.941176, 0.941176, 1 ) -Button/colors/font_color_pressed = Color( 1, 1, 1, 1 ) -Button/constants/hseparation = 2 +[gd_scene load_steps=11 format=3 uid="uid://bd5465xkam62w"] + +[ext_resource type="Theme" uid="uid://bkginljllrfm5" path="res://main_theme.tres" id="1"] +[ext_resource type="Script" path="res://Window.gd" id="2"] +[ext_resource type="Texture2D" uid="uid://bauin1qhbv52q" path="res://Bakgrundsbild i launchern2.0.png" id="3"] +[ext_resource type="FontFile" uid="uid://bqkc6pgu1hlux" path="res://Verdana.ttf" id="4"] +[ext_resource type="StyleBox" uid="uid://86osga6ourjx" path="res://play_button_style.tres" id="5"] + +[sub_resource type="FontFile" id="1"] +fallbacks = Array[Font]([ExtResource("4")]) +cache/0/16/0/ascent = 0.0 +cache/0/16/0/descent = 0.0 +cache/0/16/0/underline_position = 0.0 +cache/0/16/0/underline_thickness = 0.0 +cache/0/16/0/scale = 1.0 +cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0) +cache/0/16/0/kerning_overrides/72/0 = Vector2(0, 0) +cache/0/72/0/ascent = 0.0 +cache/0/72/0/descent = 0.0 +cache/0/72/0/underline_position = 0.0 +cache/0/72/0/underline_thickness = 0.0 +cache/0/72/0/scale = 1.0 +cache/0/72/0/kerning_overrides/16/0 = Vector2(0, 0) +cache/0/72/0/kerning_overrides/72/0 = Vector2(0, 0) + +[sub_resource type="LabelSettings" id="LabelSettings_t6e1b"] +font_size = 72 +outline_size = 8 +outline_color = Color(0, 0, 0, 1) + +[sub_resource type="Theme" id="2"] +Button/colors/font_color = Color(0.878431, 0.878431, 0.878431, 1) +Button/colors/font_color_disabled = Color(0.9, 0.9, 0.9, 0.2) +Button/colors/font_color_hover = Color(0.941176, 0.941176, 0.941176, 1) +Button/colors/font_color_pressed = Color(1, 1, 1, 1) +Button/constants/h_separation = 2 Button/fonts/font = null Button/styles/disabled = null -Button/styles/focus = ExtResource( 5 ) -Button/styles/hover = ExtResource( 5 ) -Button/styles/normal = ExtResource( 5 ) -Button/styles/pressed = ExtResource( 5 ) - -[sub_resource type="DynamicFont" id=3] -size = 32 -font_data = ExtResource( 4 ) - -[sub_resource type="Theme" id=4] -ProgressBar/colors/font_color = Color( 0.941176, 0.941176, 0.941176, 1 ) -ProgressBar/colors/font_color_shadow = Color( 0, 0, 0, 1 ) +Button/styles/focus = ExtResource("5") +Button/styles/hover = ExtResource("5") +Button/styles/normal = ExtResource("5") +Button/styles/pressed = ExtResource("5") + +[sub_resource type="FontFile" id="3"] +fallbacks = Array[Font]([ExtResource("4")]) +cache/0/16/0/ascent = 0.0 +cache/0/16/0/descent = 0.0 +cache/0/16/0/underline_position = 0.0 +cache/0/16/0/underline_thickness = 0.0 +cache/0/16/0/scale = 1.0 +cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0) +cache/0/16/0/kerning_overrides/32/0 = Vector2(0, 0) +cache/0/32/0/ascent = 0.0 +cache/0/32/0/descent = 0.0 +cache/0/32/0/underline_position = 0.0 +cache/0/32/0/underline_thickness = 0.0 +cache/0/32/0/scale = 1.0 +cache/0/32/0/kerning_overrides/16/0 = Vector2(0, 0) +cache/0/32/0/kerning_overrides/32/0 = Vector2(0, 0) + +[sub_resource type="Theme" id="4"] +ProgressBar/colors/font_color = Color(0.941176, 0.941176, 0.941176, 1) +ProgressBar/colors/font_color_shadow = Color(0, 0, 0, 1) ProgressBar/fonts/font = null -ProgressBar/styles/bg = ExtResource( 5 ) +ProgressBar/styles/bg = ExtResource("5") ProgressBar/styles/fg = null [node name="Window" type="Control"] +layout_mode = 3 +anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 -theme = ExtResource( 1 ) -script = ExtResource( 2 ) +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("1") +script = ExtResource("2") [node name="TextureRect" type="TextureRect" parent="."] -margin_right = 720.0 -margin_bottom = 540.0 -texture = ExtResource( 3 ) +layout_mode = 0 +offset_right = 720.0 +offset_bottom = 540.0 +texture = ExtResource("3") [node name="GameTitle" type="Label" parent="."] +layout_mode = 0 anchor_right = 1.0 -margin_bottom = 79.0 -custom_fonts/font = SubResource( 1 ) +offset_bottom = 79.0 +theme_override_fonts/font = SubResource("1") text = "Hexacraft" -align = 1 +label_settings = SubResource("LabelSettings_t6e1b") +horizontal_alignment = 1 [node name="CenterPlay" type="CenterContainer" parent="."] +layout_mode = 0 anchor_top = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 -margin_top = -192.0 +offset_top = -192.0 [node name="MarginPlay" type="MarginContainer" parent="CenterPlay"] -margin_left = 296.0 -margin_right = 424.0 -margin_bottom = 192.0 -custom_constants/margin_bottom = 128 +layout_mode = 2 +theme_override_constants/margin_bottom = 128 [node name="Play" type="Button" parent="CenterPlay/MarginPlay"] -margin_right = 128.0 -margin_bottom = 64.0 -rect_min_size = Vector2( 128, 64 ) +custom_minimum_size = Vector2(128, 64) +layout_mode = 2 size_flags_horizontal = 0 -theme = SubResource( 2 ) -custom_fonts/font = SubResource( 3 ) +theme = SubResource("2") +theme_override_fonts/font = SubResource("3") +theme_override_font_sizes/font_size = 32 text = "Play" [node name="Progress" type="ProgressBar" parent="CenterPlay/MarginPlay"] visible = false -margin_right = 128.0 -margin_bottom = 64.0 -rect_min_size = Vector2( 128, 64 ) -theme = SubResource( 4 ) +custom_minimum_size = Vector2(128, 64) +layout_mode = 2 +theme = SubResource("4") [node name="MarginContainer" type="MarginContainer" parent="."] +layout_mode = 0 anchor_top = 1.0 anchor_right = 1.0 anchor_bottom = 1.0 -margin_top = -37.0 -custom_constants/margin_right = 8 -custom_constants/margin_left = 8 -custom_constants/margin_bottom = 8 +offset_top = -37.0 +theme_override_constants/margin_left = 8 +theme_override_constants/margin_right = 8 +theme_override_constants/margin_bottom = 8 [node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] -margin_left = 8.0 -margin_right = 712.0 -margin_bottom = 29.0 +layout_mode = 2 [node name="Versions" type="OptionButton" parent="MarginContainer/HBoxContainer"] -margin_right = 242.0 -margin_bottom = 29.0 +layout_mode = 2 size_flags_horizontal = 0 -text = "Latest release (0.8)" flat = true -items = [ "Latest release (0.8)", null, false, 0, null ] -selected = 0 [node name="Filler" type="Label" parent="MarginContainer/HBoxContainer"] -margin_left = 246.0 -margin_top = 3.0 -margin_right = 604.0 -margin_bottom = 26.0 +layout_mode = 2 size_flags_horizontal = 3 [node name="Settings" type="Button" parent="MarginContainer/HBoxContainer"] -margin_left = 608.0 -margin_right = 704.0 -margin_bottom = 29.0 +layout_mode = 2 size_flags_horizontal = 0 text = "Settings" flat = true @@ -129,6 +153,7 @@ use_threads = true wait_time = 0.1 [node name="MartoLibDownloader" type="HTTPRequest" parent="."] + [connection signal="pressed" from="CenterPlay/MarginPlay/Play" to="." method="_on_Play_pressed"] [connection signal="item_selected" from="MarginContainer/HBoxContainer/Versions" to="." method="_on_Versions_item_selected"] [connection signal="pressed" from="MarginContainer/HBoxContainer/Settings" to="." method="_on_Settings_pressed"] diff --git a/default_env.tres b/default_env.tres index 20207a4a..ef74da5c 100644 --- a/default_env.tres +++ b/default_env.tres @@ -1,7 +1,7 @@ -[gd_resource type="Environment" load_steps=2 format=2] +[gd_resource type="Environment" load_steps=2 format=3 uid="uid://pgrbclae0t17"] -[sub_resource type="ProceduralSky" id=1] +[sub_resource type="Sky" id="1"] [resource] background_mode = 2 -background_sky = SubResource( 1 ) +sky = SubResource("1") diff --git a/export/windows/Hexacraft Launcher.exe b/export/windows/Hexacraft Launcher.exe deleted file mode 100644 index f8968d54..00000000 Binary files a/export/windows/Hexacraft Launcher.exe and /dev/null differ diff --git a/export/windows/Hexacraft Launcher.pck b/export/windows/Hexacraft Launcher.pck deleted file mode 100644 index 2e22d090..00000000 Binary files a/export/windows/Hexacraft Launcher.pck and /dev/null differ diff --git a/export_presets.cfg b/export_presets.cfg index 9ded170e..0f3b3f64 100644 --- a/export_presets.cfg +++ b/export_presets.cfg @@ -3,26 +3,38 @@ name="Windows Desktop" platform="Windows Desktop" runnable=true +dedicated_server=false custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="/home/martin/git/HexacraftLauncher/export/windows/Hexacraft Launcher.exe" -patch_list=PoolStringArray( ) -script_export_mode=1 -script_encryption_key="" +export_path="export/windows/Hexacraft Launcher.exe" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false [preset.0.options] +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false texture_format/bptc=false texture_format/s3tc=true texture_format/etc=false texture_format/etc2=false -texture_format/no_bptc_fallbacks=true -binary_format/64_bits=true -custom_template/release="" -custom_template/debug="" +binary_format/architecture="x86_64" +codesign/enable=false +codesign/timestamp=true +codesign/timestamp_server_url="" +codesign/digest_algorithm=1 +codesign/description="" +codesign/custom_options=PackedStringArray() +application/modify_resources=false application/icon="res://icon.ico" +application/console_wrapper_icon="" +application/icon_interpolation=4 application/file_version="" application/product_version="" application/company_name="Martomate" @@ -30,59 +42,167 @@ application/product_name="Hexacraft Launcher" application/file_description="Launcher for Hexacraft" application/copyright="" application/trademarks="" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="Expand-Archive -LiteralPath '{temp_dir}\\{archive_name}' -DestinationPath '{temp_dir}' +$action = New-ScheduledTaskAction -Execute '{temp_dir}\\{exe_name}' -Argument '{cmd_args}' +$trigger = New-ScheduledTaskTrigger -Once -At 00:00 +$settings = New-ScheduledTaskSettingsSet +$task = New-ScheduledTask -Action $action -Trigger $trigger -Settings $settings +Register-ScheduledTask godot_remote_debug -InputObject $task -Force:$true +Start-ScheduledTask -TaskName godot_remote_debug +while (Get-ScheduledTask -TaskName godot_remote_debug | ? State -eq running) { Start-Sleep -Milliseconds 100 } +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue" +ssh_remote_deploy/cleanup_script="Stop-ScheduledTask -TaskName godot_remote_debug -ErrorAction:SilentlyContinue +Unregister-ScheduledTask -TaskName godot_remote_debug -Confirm:$false -ErrorAction:SilentlyContinue +Remove-Item -Recurse -Force '{temp_dir}'" +texture_format/no_bptc_fallbacks=true +binary_format/64_bits=true [preset.1] name="Linux/X11" platform="Linux/X11" runnable=true +dedicated_server=false custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="/home/martin/git/HexacraftLauncher/export/linux/HexacraftLauncherLinux.x86_64" -patch_list=PoolStringArray( ) -script_export_mode=1 -script_encryption_key="" +export_path="export/linux/HexacraftLauncherLinux.x86_64" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false [preset.1.options] +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 +binary_format/embed_pck=false texture_format/bptc=false texture_format/s3tc=true texture_format/etc=false texture_format/etc2=false +binary_format/architecture="x86_64" +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +export DISPLAY=:0 +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +\"{temp_dir}/{exe_name}\" {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" texture_format/no_bptc_fallbacks=true binary_format/64_bits=true -custom_template/release="" -custom_template/debug="" [preset.2] -name="Mac OSX" -platform="Mac OSX" +name="macOS" +platform="macOS" runnable=true +dedicated_server=false custom_features="" export_filter="all_resources" include_filter="" exclude_filter="" -export_path="/home/martin/git/HexacraftLauncher/export/macos/Hexacraft Launcher.zip" -patch_list=PoolStringArray( ) -script_export_mode=1 -script_encryption_key="" +export_path="export/macos/HexacraftLauncherMac.app" +encryption_include_filters="" +encryption_exclude_filters="" +encrypt_pck=false +encrypt_directory=false [preset.2.options] -custom_package/debug="" -custom_package/release="" -application/name="Hexacraft Launcher" -application/info="Launcher for Hexacraft" +export/distribution_type=1 +binary_format/architecture="universal" +custom_template/debug="" +custom_template/release="" +debug/export_console_wrapper=1 application/icon="res://icon.png" -application/identifier="com.martomate.hexacraftlauncher" +application/icon_interpolation=4 +application/bundle_identifier="com.martomate.hexacraftlauncher" application/signature="" -application/short_version="1.0" -application/version="1.0" +application/app_category="Games" +application/short_version="1.2" +application/version="1.2" application/copyright="" +application/copyright_localized={} +application/min_macos_version="10.12" display/high_res=false -texture_format/s3tc=true -texture_format/etc=false -texture_format/etc2=false +xcode/platform_build="14C18" +xcode/sdk_version="13.1" +xcode/sdk_build="22C55" +xcode/sdk_name="macosx13.1" +xcode/xcode_version="1420" +xcode/xcode_build="14C18" +codesign/codesign=0 +codesign/installer_identity="" +codesign/apple_team_id="" +codesign/identity="" +codesign/entitlements/custom_file="" +codesign/entitlements/allow_jit_code_execution=false +codesign/entitlements/allow_unsigned_executable_memory=false +codesign/entitlements/allow_dyld_environment_variables=false +codesign/entitlements/disable_library_validation=false +codesign/entitlements/audio_input=false +codesign/entitlements/camera=false +codesign/entitlements/location=false +codesign/entitlements/address_book=false +codesign/entitlements/calendars=false +codesign/entitlements/photos_library=false +codesign/entitlements/apple_events=false +codesign/entitlements/debugging=false +codesign/entitlements/app_sandbox/enabled=false +codesign/entitlements/app_sandbox/network_server=false +codesign/entitlements/app_sandbox/network_client=false +codesign/entitlements/app_sandbox/device_usb=false +codesign/entitlements/app_sandbox/device_bluetooth=false +codesign/entitlements/app_sandbox/files_downloads=0 +codesign/entitlements/app_sandbox/files_pictures=0 +codesign/entitlements/app_sandbox/files_music=0 +codesign/entitlements/app_sandbox/files_movies=0 +codesign/entitlements/app_sandbox/helper_executables=[] +codesign/custom_options=PackedStringArray() +notarization/notarization=0 +privacy/microphone_usage_description="" +privacy/microphone_usage_description_localized={} +privacy/camera_usage_description="" +privacy/camera_usage_description_localized={} +privacy/location_usage_description="" +privacy/location_usage_description_localized={} +privacy/address_book_usage_description="" +privacy/address_book_usage_description_localized={} +privacy/calendar_usage_description="" +privacy/calendar_usage_description_localized={} +privacy/photos_library_usage_description="" +privacy/photos_library_usage_description_localized={} +privacy/desktop_folder_usage_description="" +privacy/desktop_folder_usage_description_localized={} +privacy/documents_folder_usage_description="" +privacy/documents_folder_usage_description_localized={} +privacy/downloads_folder_usage_description="" +privacy/downloads_folder_usage_description_localized={} +privacy/network_volumes_usage_description="" +privacy/network_volumes_usage_description_localized={} +privacy/removable_volumes_usage_description="" +privacy/removable_volumes_usage_description_localized={} +ssh_remote_deploy/enabled=false +ssh_remote_deploy/host="user@host_ip" +ssh_remote_deploy/port="22" +ssh_remote_deploy/extra_args_ssh="" +ssh_remote_deploy/extra_args_scp="" +ssh_remote_deploy/run_script="#!/usr/bin/env bash +unzip -o -q \"{temp_dir}/{archive_name}\" -d \"{temp_dir}\" +open \"{temp_dir}/{exe_name}.app\" --args {cmd_args}" +ssh_remote_deploy/cleanup_script="#!/usr/bin/env bash +kill $(pgrep -x -f \"{temp_dir}/{exe_name}.app/Contents/MacOS/{exe_name} {cmd_args}\") +rm -rf \"{temp_dir}\"" diff --git a/icon.png.import b/icon.png.import index 96cbf462..82258a45 100644 --- a/icon.png.import +++ b/icon.png.import @@ -1,8 +1,9 @@ [remap] importer="texture" -type="StreamTexture" -path="res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" +type="CompressedTexture2D" +uid="uid://cjo8qg72dekj7" +path="res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex" metadata={ "vram_texture": false } @@ -10,25 +11,24 @@ metadata={ [deps] source_file="res://icon.png" -dest_files=[ "res://.import/icon.png-487276ed1e3a0c39cad0279d744ee560.stex" ] +dest_files=["res://.godot/imported/icon.png-487276ed1e3a0c39cad0279d744ee560.ctex"] [params] compress/mode=0 +compress/high_quality=false compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 +compress/hdr_compression=1 compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 +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/HDR_as_SRGB=false -process/invert_color=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 +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 diff --git a/icon_2d_big.png.import b/icon_2d_big.png.import index 20b8eab0..919b4ef5 100644 --- a/icon_2d_big.png.import +++ b/icon_2d_big.png.import @@ -1,8 +1,9 @@ [remap] importer="texture" -type="StreamTexture" -path="res://.import/icon_2d_big.png-66af80b41df5b14ec63d782610b10142.stex" +type="CompressedTexture2D" +uid="uid://byp3t2ffkb3j1" +path="res://.godot/imported/icon_2d_big.png-66af80b41df5b14ec63d782610b10142.ctex" metadata={ "vram_texture": false } @@ -10,25 +11,24 @@ metadata={ [deps] source_file="res://icon_2d_big.png" -dest_files=[ "res://.import/icon_2d_big.png-66af80b41df5b14ec63d782610b10142.stex" ] +dest_files=["res://.godot/imported/icon_2d_big.png-66af80b41df5b14ec63d782610b10142.ctex"] [params] compress/mode=0 +compress/high_quality=false compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 +compress/hdr_compression=1 compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 +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/HDR_as_SRGB=false -process/invert_color=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 +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 diff --git a/icon_3d_big.png.import b/icon_3d_big.png.import index 9a564984..04b671f8 100644 --- a/icon_3d_big.png.import +++ b/icon_3d_big.png.import @@ -1,8 +1,9 @@ [remap] importer="texture" -type="StreamTexture" -path="res://.import/icon_3d_big.png-f906e6fa403cc9bf0aa7bf29a63327f3.stex" +type="CompressedTexture2D" +uid="uid://b8gdkc1txwkst" +path="res://.godot/imported/icon_3d_big.png-f906e6fa403cc9bf0aa7bf29a63327f3.ctex" metadata={ "vram_texture": false } @@ -10,25 +11,24 @@ metadata={ [deps] source_file="res://icon_3d_big.png" -dest_files=[ "res://.import/icon_3d_big.png-f906e6fa403cc9bf0aa7bf29a63327f3.stex" ] +dest_files=["res://.godot/imported/icon_3d_big.png-f906e6fa403cc9bf0aa7bf29a63327f3.ctex"] [params] compress/mode=0 +compress/high_quality=false compress/lossy_quality=0.7 -compress/hdr_mode=0 -compress/bptc_ldr=0 +compress/hdr_compression=1 compress/normal_map=0 -flags/repeat=0 -flags/filter=true -flags/mipmaps=false -flags/anisotropic=false -flags/srgb=2 +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/HDR_as_SRGB=false -process/invert_color=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 +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 diff --git a/main_theme.tres b/main_theme.tres index aee71195..0a0651ed 100644 --- a/main_theme.tres +++ b/main_theme.tres @@ -1,34 +1,39 @@ -[gd_resource type="Theme" load_steps=4 format=2] +[gd_resource type="Theme" load_steps=4 format=3 uid="uid://bkginljllrfm5"] -[ext_resource path="res://Verdana.ttf" type="DynamicFontData" id=1] +[ext_resource type="FontFile" uid="uid://bqkc6pgu1hlux" path="res://Verdana.ttf" id="1"] -[sub_resource type="StyleBoxFlat" id=1] -bg_color = Color( 0, 0, 0, 0.4 ) +[sub_resource type="FontFile" id="2"] +fallbacks = Array[Font]([ExtResource("1")]) +cache/0/16/0/ascent = 0.0 +cache/0/16/0/descent = 0.0 +cache/0/16/0/underline_position = 0.0 +cache/0/16/0/underline_thickness = 0.0 +cache/0/16/0/scale = 1.0 +cache/0/16/0/kerning_overrides/16/0 = Vector2(0, 0) -[sub_resource type="DynamicFont" id=2] -size = 18 -font_data = ExtResource( 1 ) +[sub_resource type="StyleBoxFlat" id="1"] +bg_color = Color(0, 0, 0, 0.4) [resource] -default_font = SubResource( 2 ) -Button/colors/font_color = Color( 0.878431, 0.878431, 0.878431, 1 ) -Button/colors/font_color_disabled = Color( 0.9, 0.9, 0.9, 0.2 ) -Button/colors/font_color_hover = Color( 0.941176, 0.941176, 0.941176, 1 ) -Button/colors/font_color_pressed = Color( 1, 1, 1, 1 ) +default_font = SubResource("2") +Button/colors/font_color = Color(0.878431, 0.878431, 0.878431, 1) +Button/colors/font_color_disabled = Color(0.9, 0.9, 0.9, 0.2) +Button/colors/font_color_hover = Color(0.941176, 0.941176, 0.941176, 1) +Button/colors/font_color_pressed = Color(1, 1, 1, 1) Button/constants/hseparation = 2 -Button/fonts/font = null +Button/fonts/font = SubResource("2") Button/styles/disabled = null Button/styles/focus = null Button/styles/hover = null Button/styles/normal = null Button/styles/pressed = null -PopupMenu/colors/font_color = Color( 0.878431, 0.878431, 0.878431, 1 ) -PopupMenu/colors/font_color_accel = Color( 0.7, 0.7, 0.7, 0.8 ) -PopupMenu/colors/font_color_disabled = Color( 0.4, 0.4, 0.4, 0.8 ) -PopupMenu/colors/font_color_hover = Color( 0.878431, 0.878431, 0.878431, 1 ) +PopupMenu/colors/font_color = Color(0.878431, 0.878431, 0.878431, 1) +PopupMenu/colors/font_color_accel = Color(0.7, 0.7, 0.7, 0.8) +PopupMenu/colors/font_color_disabled = Color(0.4, 0.4, 0.4, 0.8) +PopupMenu/colors/font_color_hover = Color(0.878431, 0.878431, 0.878431, 1) PopupMenu/constants/hseparation = 4 PopupMenu/constants/vseparation = 4 -PopupMenu/fonts/font = null +PopupMenu/fonts/font = SubResource("2") PopupMenu/icons/checked = null PopupMenu/icons/radio_checked = null PopupMenu/icons/radio_unchecked = null @@ -37,6 +42,6 @@ PopupMenu/icons/unchecked = null PopupMenu/styles/hover = null PopupMenu/styles/labeled_separator_left = null PopupMenu/styles/labeled_separator_right = null -PopupMenu/styles/panel = SubResource( 1 ) +PopupMenu/styles/panel = SubResource("1") PopupMenu/styles/panel_disabled = null PopupMenu/styles/separator = null diff --git a/play_button_style.tres b/play_button_style.tres index 840a439a..433bd9cc 100644 --- a/play_button_style.tres +++ b/play_button_style.tres @@ -1,14 +1,13 @@ -[gd_resource type="StyleBoxFlat" format=2] +[gd_resource type="StyleBoxFlat" format=3 uid="uid://86osga6ourjx"] [resource] -bg_color = Color( 0.156863, 0.156863, 0.156863, 0.411765 ) +bg_color = Color(0.156863, 0.156863, 0.156863, 0.411765) border_width_left = 2 border_width_top = 2 border_width_right = 2 border_width_bottom = 2 -border_color = Color( 1, 1, 1, 0.447059 ) +border_color = Color(1, 1, 1, 0.447059) corner_radius_top_left = 8 corner_radius_top_right = 8 corner_radius_bottom_right = 8 corner_radius_bottom_left = 8 - diff --git a/project.godot b/project.godot index 0c6d1db4..111b362f 100644 --- a/project.godot +++ b/project.godot @@ -6,17 +6,7 @@ ; [section] ; section goes between [] ; param=value ; assign values to parameters -config_version=4 - -_global_script_classes=[ { -"base": "Reference", -"class": "GameVersion", -"language": "GDScript", -"path": "res://GameVersion.gd" -} ] -_global_script_class_icons={ -"GameVersion": "" -} +config_version=5 [application] @@ -24,17 +14,17 @@ config/name="Hexacraft Launcher" run/main_scene="res://Window.tscn" config/use_custom_user_dir=true config/custom_user_dir_name="Hexacraft" +config/features=PackedStringArray("4.1") boot_splash/image="res://Bakgrundsbild i launchern2.0.png" config/icon="res://icon.png" [display] -window/size/width=720 -window/size/height=540 +window/size/viewport_width=720 +window/size/viewport_height=540 [rendering] +environment/defaults/default_environment="res://default_env.tres" quality/driver/driver_name="GLES2" vram_compression/import_etc=true -vram_compression/import_etc2=false -environment/default_environment="res://default_env.tres"