Skip to content

Commit

Permalink
Change placeholder effect
Browse files Browse the repository at this point in the history
Always print errors about incorrect effect path
  • Loading branch information
Kvel2D committed Sep 29, 2024
1 parent 04fb17e commit ecc3c25
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

importer="texture"
type="CompressedTexture2D"
uid="uid://d3t7hvubaudy4"
path="res://.godot/imported/GenericMagic.png-f3f03acccacc3ad10515fa0e6ebad34c.ctex"
uid="uid://8aycp6wxnpve"
path="res://.godot/imported/placeholder_481.png-38d1edbe73a3fcc1e115861261d76a65.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/effects/GenericMagic.png"
dest_files=["res://.godot/imported/GenericMagic.png-f3f03acccacc3ad10515fa0e6ebad34c.ctex"]
source_file="res://assets/effects/bdragon/placeholder_481.png"
dest_files=["res://.godot/imported/placeholder_481.png-38d1edbe73a3fcc1e115861261d76a65.ctex"]

[params]

Expand Down
10 changes: 1 addition & 9 deletions src/effects/effects_container.gd
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ var _effect_original_scale_map: Dictionary = {}
var _free_id_list: Array = []


# NOTE: Enable to check if any effects do not have scenes.
# This is currently disabled because at this point most
# effects won't have scenes and you will get hundreds of
# errors.
const PRINT_INVALID_PATH_ERROR: bool = false


#########################
### Public ###
#########################
Expand Down Expand Up @@ -100,8 +93,7 @@ func _create_internal(effect_path: String) -> int:
else:
effect_scene = Preloads.placeholder_effect_scene

if PRINT_INVALID_PATH_ERROR:
print_debug("Invalid effect path:", effect_path, ". Using placeholder effect.")
push_error("Invalid effect path:", effect_path, ". Using placeholder effect.")

var effect: Node2D = effect_scene.instantiate()

Expand Down
71 changes: 0 additions & 71 deletions src/effects/generic_magic.tscn

This file was deleted.

99 changes: 99 additions & 0 deletions src/effects/placeholder.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
[gd_scene load_steps=15 format=3 uid="uid://djmwggj8te8j0"]

[ext_resource type="Texture2D" uid="uid://8aycp6wxnpve" path="res://assets/effects/bdragon/placeholder_481.png" id="1_1cwr2"]

[sub_resource type="AtlasTexture" id="AtlasTexture_qjyg1"]
atlas = ExtResource("1_1cwr2")
region = Rect2(0, 320, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_k385l"]
atlas = ExtResource("1_1cwr2")
region = Rect2(64, 320, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_73nos"]
atlas = ExtResource("1_1cwr2")
region = Rect2(128, 320, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_dumt7"]
atlas = ExtResource("1_1cwr2")
region = Rect2(192, 320, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_p462m"]
atlas = ExtResource("1_1cwr2")
region = Rect2(256, 320, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_to7m5"]
atlas = ExtResource("1_1cwr2")
region = Rect2(320, 320, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_qylrt"]
atlas = ExtResource("1_1cwr2")
region = Rect2(384, 320, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_xw752"]
atlas = ExtResource("1_1cwr2")
region = Rect2(448, 320, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_ecle4"]
atlas = ExtResource("1_1cwr2")
region = Rect2(512, 320, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_c5kmy"]
atlas = ExtResource("1_1cwr2")
region = Rect2(576, 320, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_o8i8f"]
atlas = ExtResource("1_1cwr2")
region = Rect2(640, 320, 64, 64)

[sub_resource type="AtlasTexture" id="AtlasTexture_lgmlt"]
atlas = ExtResource("1_1cwr2")
region = Rect2(704, 320, 64, 64)

[sub_resource type="SpriteFrames" id="SpriteFrames_g0s8x"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_qjyg1")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_k385l")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_73nos")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_dumt7")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_p462m")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_to7m5")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_qylrt")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_xw752")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ecle4")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_c5kmy")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_o8i8f")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_lgmlt")
}],
"loop": true,
"name": &"default",
"speed": 20.0
}]

[node name="Placeholder" type="AnimatedSprite2D"]
scale = Vector2(3, 3)
sprite_frames = SubResource("SpriteFrames_g0s8x")
2 changes: 1 addition & 1 deletion src/singletons/preloads.gd
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const blood_pool_scene: PackedScene = preload("res://src/creeps/creep_blood_pool
const flying_item_scene: PackedScene = preload("res://src/hud/flying_item.tscn")
const autocast_button_scene: PackedScene = preload("res://src/hud/buttons/autocast_button.tscn")
const autocast_scene: PackedScene = preload("res://src/towers/autocast.tscn")
const placeholder_effect_scene: PackedScene = preload("res://src/effects/generic_magic.tscn")
const placeholder_effect_scene: PackedScene = preload("res://src/effects/placeholder.tscn")
const empty_slot_button_scene: PackedScene = preload("res://src/hud/buttons/empty_unit_button.tscn")
const range_indicator_scene: PackedScene = preload("res://src/towers/range_indicator.tscn")
const outline_shader: Material = preload("res://resources/shaders/glowing_outline.material")
Expand Down

0 comments on commit ecc3c25

Please sign in to comment.