Skip to content

Commit

Permalink
Fix launcher ui bug + gamemaker test game
Browse files Browse the repository at this point in the history
  • Loading branch information
Atlinx committed Oct 20, 2024
1 parent 8827555 commit c260a65
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
1 change: 1 addition & 0 deletions CogsPartyLauncher/scenes/main.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ layout_mode = 2
size_flags_horizontal = 3

[node name="PlayButton" type="Button" parent="Menus/PlayerSelectMenu/HBoxContainer"]
custom_minimum_size = Vector2(200, 80)
layout_mode = 2
size_flags_horizontal = 4
theme_override_font_sizes/font_size = 36
Expand Down
4 changes: 2 additions & 2 deletions CogsPartyLauncher/scripts/game_entry.gd
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ func construct(_game_data: Dictionary):
if rel_build_location is String:
if build is String and build in SUPPORTED_BUILDS:
var build_location = game_data.directory_path + "/" + rel_build_location
if not FileAccess.file_exists(build_location):
errors.append("No file found at location '%s'" % build_location)
if not FileAccess.file_exists(build_location) and not DirAccess.dir_exists_absolute(build_location):
errors.append("No file/folder found at location '%s'" % build_location)
else:
errors.append("Failed to parse build: '%s'" % build)
else:
Expand Down
15 changes: 9 additions & 6 deletions GameMakerTestGame/objects/o_minigame_manager/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ function apply_results(_results) {
for (var i = 0; i < array_length(_results); i++) {
var player_result = _results[i];
save_data.players[player_result.player].points += player_result.points;
player_data_array[player_result.player].points = save_data.players[player_result.player].points
}
// Add result to save_data games
var game_result = {
Expand All @@ -103,14 +104,15 @@ function apply_results(_results) {
}

var _init = function() {
// Parse cmd paramters for save file path
// Parse cmd parameters for save file path
var p_num = parameter_count();
var file_path = "";
if (p_num > 0)
{
for (var i = 0; i < p_num; i += 1)
for (var i = 0; i < p_num; i++)
{
var p_string = parameter_string(i + 1);
_print(string(" Arg[{0}]: {1}", i, p_string));
if (string_starts_with(p_string, "--savefile=")) {
file_path = string_split(p_string, "=")[1];
}
Expand All @@ -123,12 +125,13 @@ var _init = function() {
try {
if (file_path != "") {
// String exists
var file = file_text_open_read(file_path);
var load_data = file_text_read_string(file);
file_text_close(file);
var file_buffer = buffer_load(file_path);
var load_data = buffer_read(file_buffer, buffer_string);
_print("Raw save file text:\n" + load_data);
buffer_delete(file_buffer);
save_file_path = file_path;
save_data = json_parse(load_data);
_print("Loaded save file data");
_print("Loaded save file data from: " + file_path);
} else {
_print("Loaded dummy data");
}
Expand Down
2 changes: 1 addition & 1 deletion GodotTestGame/assets/rainbow_material.tres
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://b87yd308vxbfo"]
[gd_resource type="ShaderMaterial" load_steps=2 format=3 uid="uid://dhjxc32vn50nn"]

[ext_resource type="Shader" path="res://assets/rainbow.gdshader" id="1_isb4a"]

Expand Down

0 comments on commit c260a65

Please sign in to comment.