game: fix placeholder texture in autoload
This commit is contained in:
4
assets/sprites/64x64_placeholder.tres
Normal file
4
assets/sprites/64x64_placeholder.tres
Normal file
@@ -0,0 +1,4 @@
|
||||
[gd_resource type="PlaceholderTexture2D" format=3 uid="uid://baxbllvlqssur"]
|
||||
|
||||
[resource]
|
||||
size = Vector2(64, 64)
|
@@ -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
|
||||
|
@@ -25,6 +25,7 @@ func _ready() -> void:
|
||||
upgrade_name.text = mod.title
|
||||
upgrade_description.text = mod.description
|
||||
upgrade_tex.texture = mod.tex
|
||||
print_debug("tex: %s" % mod.tex)
|
||||
|
||||
|
||||
func _on_pick_button_pressed() -> void:
|
||||
|
Reference in New Issue
Block a user