game: fix placeholder texture in autoload

This commit is contained in:
2025-08-20 07:45:49 +02:00
parent dec0901b3d
commit c04e6b3a34
3 changed files with 7 additions and 6 deletions

View File

@@ -19,7 +19,7 @@ const GROUP_PICKUP = "pickup"
enum ModRarity { LEGENDARY, EPIC, RARE, NORMAL }
var placeholder_tex: Texture2D
const placeholder_tex = preload("res://assets/sprites/64x64_placeholder.tres")
var MOD_CHOICES = [
{
@@ -80,11 +80,6 @@ var MOD_CHOICES = [
]
func _ready() -> void:
placeholder_tex = PlaceholderTexture2D.new()
placeholder_tex.size = Vector2(64.0, 64.0)
func _draw_random_choice(fortune: float = 1.0) -> Dictionary:
var total_weight: int = 0
for choice in MOD_CHOICES:
@@ -107,6 +102,7 @@ func draw_random_mod(fortune: float = 1.0) -> PlayerStatsModifier:
mod.description = choice["description"]
mod.internal_name = choice["internal_name"]
mod.tex = choice["tex"]
print_debug("gc: %s" % mod.tex)
mod.title = choice["name"]
return mod