debug scene + fixed resource loading in releases

This commit is contained in:
gotfishmakesticks 2024-01-14 11:50:13 +03:00
commit 0dd3628ce1
7 changed files with 114 additions and 6 deletions

View file

@ -8,7 +8,7 @@ custom_features=""
export_filter="all_resources" export_filter="all_resources"
include_filter="" include_filter=""
exclude_filter="" exclude_filter=""
export_path="../executables/cosmic/gammacosmicrays ictar1.1 beta.exe" export_path="../executables/cosmic/gammacosmicrays ictar1.1 beta 2.exe"
encryption_include_filters="" encryption_include_filters=""
encryption_exclude_filters="" encryption_exclude_filters=""
encrypt_pck=false encrypt_pck=false
@ -18,7 +18,7 @@ encrypt_directory=false
custom_template/debug="" custom_template/debug=""
custom_template/release="" custom_template/release=""
debug/export_console_wrapper=1 debug/export_console_wrapper=0
binary_format/embed_pck=true binary_format/embed_pck=true
texture_format/bptc=true texture_format/bptc=true
texture_format/s3tc=true texture_format/s3tc=true
@ -42,6 +42,7 @@ application/product_name="Gamma Cosmic Rays"
application/file_description="" application/file_description=""
application/copyright="" application/copyright=""
application/trademarks="" application/trademarks=""
application/export_angle=0
ssh_remote_deploy/enabled=false ssh_remote_deploy/enabled=false
ssh_remote_deploy/host="user@host_ip" ssh_remote_deploy/host="user@host_ip"
ssh_remote_deploy/port="22" ssh_remote_deploy/port="22"

104
scenes/debug.tscn Normal file
View file

@ -0,0 +1,104 @@
[gd_scene load_steps=2 format=3 uid="uid://ckdttdkoo1t0s"]
[sub_resource type="GDScript" id="GDScript_6w8qb"]
resource_name = "gogo"
script/source = "extends Node2D
@onready var items = $Items
@onready var verified = $\"Verified Items\"
# Called when the node enters the scene tree for the first time.
func _ready():
var dir = DirAccess.open(\"res://items\")
var files = dir.get_files()
var text = \"Items:\\n\"
for file in files:
text += \"{file}\\n\".format({'file': file})
text += \"Hulls:\\n\"
dir = DirAccess.open(\"res://scenes/hulls\")
files = dir.get_files()
for file in files:
text += \"{file}\\n\".format({'file': file})
text += \"Engines:\\n\"
dir = DirAccess.open(\"res://scenes/engines\")
files = dir.get_files()
for file in files:
text += \"{file}\\n\".format({'file': file})
text += \"Shields:\\n\"
dir = DirAccess.open(\"res://scenes/shields\")
files = dir.get_files()
for file in files:
text += \"{file}\\n\".format({'file': file})
text += \"Weapons:\\n\"
dir = DirAccess.open(\"res://scenes/weapons/presets\")
files = dir.get_files()
for file in files:
text += \"{file}\\n\".format({'file': file})
items.text = text
fetch_modules()
func fetch_modules():
var dir = DirAccess.open(\"res://items\")
var files = dir.get_files()
var text = \"Items:\\n\"
for file in files:
text += \"{file}\\n\".format({'file': file})
text += \"Verified Hulls:\\n\"
dir = DirAccess.open(\"res://scenes/hulls\")
var modules = dir.get_files()
files = check_for_item(modules)
for file in files:
text += \"{file}\\n\".format({'file': file})
text += \"Verified Engines:\\n\"
dir = DirAccess.open(\"res://scenes/engines\")
modules = dir.get_files()
files = check_for_item(modules)
for file in files:
text += \"{file}\\n\".format({'file': file})
text += \"Verified Shields:\\n\"
dir = DirAccess.open(\"res://scenes/shields\")
modules = dir.get_files()
files = check_for_item(modules)
for file in files:
text += \"{file}\\n\".format({'file': file})
text += \"Verified Weapons:\\n\"
dir = DirAccess.open(\"res://scenes/weapons/presets\")
modules = dir.get_files()
files = check_for_item(modules)
for file in files:
text += \"{file}\\n\".format({'file': file})
verified.text = text
func check_for_item(modules : Array[String]) -> Array[String]:
var returnable : Array[String] = []
for module in modules:
var itm = module.split('.', true, 1)[0]
if Game.get_item(itm).name != Game.DEFAULT_ITEM.name:
returnable.append(itm)
return returnable
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
if Input.is_action_just_released(\"pause\"):
get_tree().change_scene_to_file(\"res://scenes/MainMenu.tscn\")
"
[node name="Debug" type="Node2D"]
script = SubResource("GDScript_6w8qb")
[node name="Items" type="Label" parent="."]
offset_right = 640.0
offset_bottom = 720.0
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 2
[node name="Verified Items" type="Label" parent="."]
offset_left = 640.0
offset_right = 1280.0
offset_bottom = 720.0
horizontal_alignment = 1
vertical_alignment = 1
autowrap_mode = 2

View file

@ -91,7 +91,7 @@ func recolor():
color_player = Color.from_hsv(randf(), randf_range(0.8, 1), randf_range(0.8, 1)) color_player = Color.from_hsv(randf(), randf_range(0.8, 1), randf_range(0.8, 1))
color_base = Color.from_hsv(randf(), randf_range(0.8, 1), randf_range(0.8, 1)) color_base = Color.from_hsv(randf(), randf_range(0.8, 1), randf_range(0.8, 1))
color_enemy = Color.from_hsv(randf(), randf_range(0.8, 1), randf_range(0.8, 1)) color_enemy = Color.from_hsv(randf(), randf_range(0.8, 1), randf_range(0.8, 1))
color_background = Color.from_hsv(randf(), randf_range(0.1765, 1), randf_range(0.0392, 0.0862)) color_background = Color.from_hsv(randf(), randf_range(0.1765, 1), randf_range(0.06, 0.08))
ship.modulate = color_player ship.modulate = color_player
bases.modulate = color_base bases.modulate = color_base
enemy_faction.modulate = color_enemy enemy_faction.modulate = color_enemy

View file

@ -112,7 +112,7 @@ static func profile_legit_check(profile_meta : Dictionary) -> Dictionary:
static func get_item(id : String) -> Item: static func get_item(id : String) -> Item:
var path_name = id.to_lower().replace(" ", "_") var path_name = id.to_lower().replace(" ", "_")
var path = "res://items/{name}.tres".format({"name": path_name}) var path = "res://items/{name}.tres".format({"name": path_name})
if FileAccess.file_exists(path): if ResourceLoader.exists(path):
var res = load(path) var res = load(path)
return res.duplicate() return res.duplicate()
return DEFAULT_ITEM return DEFAULT_ITEM

View file

@ -293,7 +293,6 @@ func add_available(avail_list):
'hull': 'hull':
meta['price'] = hulls_prices[avail_list[i]] meta['price'] = hulls_prices[avail_list[i]]
meta['equipped'] = ship.hull.id == avail_list[i] meta['equipped'] = ship.hull.id == avail_list[i]
print(ship.hull.id, avail_list[i])
'engine': 'engine':
meta['price'] = engines_prices[avail_list[i]] meta['price'] = engines_prices[avail_list[i]]
meta['equipped'] = ship.engine.id == avail_list[i] meta['equipped'] = ship.engine.id == avail_list[i]

View file

@ -75,3 +75,7 @@ func change_menu(id):
b4.change_name() b4.change_name()
b5.change_name() b5.change_name()
menu_id = id menu_id = id
func _process(_delta):
if Input.is_action_just_released("hide_menu"):
get_tree().change_scene_to_file("res://scenes/debug.tscn")

View file

@ -150,7 +150,7 @@ func fetch_modules():
func check_for_item(modules : Array[String]) -> Array[String]: func check_for_item(modules : Array[String]) -> Array[String]:
var returnable : Array[String] = [] var returnable : Array[String] = []
for module in modules: for module in modules:
var itm = module.trim_suffix(".tscn") var itm = module.split('.', true, 1)[0]
if Game.get_item(itm).name != Game.DEFAULT_ITEM.name: if Game.get_item(itm).name != Game.DEFAULT_ITEM.name:
returnable.append(itm) returnable.append(itm)
return returnable return returnable