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

@ -91,7 +91,7 @@ func recolor():
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_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
bases.modulate = color_base
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:
var path_name = id.to_lower().replace(" ", "_")
var path = "res://items/{name}.tres".format({"name": path_name})
if FileAccess.file_exists(path):
if ResourceLoader.exists(path):
var res = load(path)
return res.duplicate()
return DEFAULT_ITEM

View file

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

View file

@ -75,3 +75,7 @@ func change_menu(id):
b4.change_name()
b5.change_name()
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]:
var returnable : Array[String] = []
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:
returnable.append(itm)
return returnable