From a0521becb45735d90d6b352d8072eaf93c8051c2 Mon Sep 17 00:00:00 2001 From: JHDev2006 Date: Fri, 17 Oct 2025 13:32:08 +0100 Subject: [PATCH] fixed an animation override bug cause im dumb and havent touched the json parser in a while --- Assets/Sprites/UI/Font.fnt.import | 6 +-- Assets/Sprites/UI/Font.png.import | 39 ++++++++++++++++++- Assets/Sprites/UI/FontGA.png.import | 39 ++++++++++++++++++- Assets/Sprites/UI/FontJP.png.import | 39 ++++++++++++++++++- Assets/Sprites/UI/FontJPOld.png.import | 2 +- Assets/Sprites/UI/FontLL.fnt.import | 6 +-- Assets/Sprites/UI/FontLL.png.import | 39 ++++++++++++++++++- .../Classes/Components/ResourceSetterNew.gd | 15 +++---- Scripts/Classes/Entities/Player.gd | 1 - 9 files changed, 167 insertions(+), 19 deletions(-) diff --git a/Assets/Sprites/UI/Font.fnt.import b/Assets/Sprites/UI/Font.fnt.import index 12cd993..7b999fc 100644 --- a/Assets/Sprites/UI/Font.fnt.import +++ b/Assets/Sprites/UI/Font.fnt.import @@ -2,7 +2,7 @@ importer="font_data_bmfont" type="FontFile" -uid="uid://cd221873lbtj1" +uid="uid://djsv6aojrcuyg" path="res://.godot/imported/Font.fnt-6c6685c58d22178166a8720d2c719ea3.fontdata" [deps] @@ -13,5 +13,5 @@ dest_files=["res://.godot/imported/Font.fnt-6c6685c58d22178166a8720d2c719ea3.fon [params] fallbacks=[] -compress=false -scaling_mode=0 +compress=true +scaling_mode=2 diff --git a/Assets/Sprites/UI/Font.png.import b/Assets/Sprites/UI/Font.png.import index 4812a94..a562818 100644 --- a/Assets/Sprites/UI/Font.png.import +++ b/Assets/Sprites/UI/Font.png.import @@ -1,3 +1,40 @@ [remap] -importer="skip" +importer="texture" +type="CompressedTexture2D" +uid="uid://fl3d66h6h0o7" +path="res://.godot/imported/Font.png-641933ef994f12d7d57b3370c1fb44de.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Sprites/UI/Font.png" +dest_files=["res://.godot/imported/Font.png-641933ef994f12d7d57b3370c1fb44de.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Sprites/UI/FontGA.png.import b/Assets/Sprites/UI/FontGA.png.import index 4812a94..934e5c4 100644 --- a/Assets/Sprites/UI/FontGA.png.import +++ b/Assets/Sprites/UI/FontGA.png.import @@ -1,3 +1,40 @@ [remap] -importer="skip" +importer="texture" +type="CompressedTexture2D" +uid="uid://bmyn0megjnnrx" +path="res://.godot/imported/FontGA.png-d849a866dc513008eabe61624b4d39c8.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Sprites/UI/FontGA.png" +dest_files=["res://.godot/imported/FontGA.png-d849a866dc513008eabe61624b4d39c8.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Sprites/UI/FontJP.png.import b/Assets/Sprites/UI/FontJP.png.import index 4812a94..e82b1d1 100644 --- a/Assets/Sprites/UI/FontJP.png.import +++ b/Assets/Sprites/UI/FontJP.png.import @@ -1,3 +1,40 @@ [remap] -importer="skip" +importer="texture" +type="CompressedTexture2D" +uid="uid://du7ke62m5mfci" +path="res://.godot/imported/FontJP.png-e9d4affae12e83d1ad38e68741a363e2.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Sprites/UI/FontJP.png" +dest_files=["res://.godot/imported/FontJP.png-e9d4affae12e83d1ad38e68741a363e2.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Assets/Sprites/UI/FontJPOld.png.import b/Assets/Sprites/UI/FontJPOld.png.import index 76742f1..90b721d 100644 --- a/Assets/Sprites/UI/FontJPOld.png.import +++ b/Assets/Sprites/UI/FontJPOld.png.import @@ -2,7 +2,7 @@ importer="texture" type="CompressedTexture2D" -uid="uid://csm3iphwghxr4" +uid="uid://bmhnxinh358ql" path="res://.godot/imported/FontJPOld.png-7fc797be5045e04e8b21b55cfd2654c1.ctex" metadata={ "vram_texture": false diff --git a/Assets/Sprites/UI/FontLL.fnt.import b/Assets/Sprites/UI/FontLL.fnt.import index 888b53e..ba6cc29 100644 --- a/Assets/Sprites/UI/FontLL.fnt.import +++ b/Assets/Sprites/UI/FontLL.fnt.import @@ -2,7 +2,7 @@ importer="font_data_bmfont" type="FontFile" -uid="uid://ctx37lrb3f76i" +uid="uid://b8pt2ab0kg0vw" path="res://.godot/imported/FontLL.fnt-b0a4b8976c6dfce9e7529f579de98f07.fontdata" [deps] @@ -13,5 +13,5 @@ dest_files=["res://.godot/imported/FontLL.fnt-b0a4b8976c6dfce9e7529f579de98f07.f [params] fallbacks=[] -compress=false -scaling_mode=0 +compress=true +scaling_mode=2 diff --git a/Assets/Sprites/UI/FontLL.png.import b/Assets/Sprites/UI/FontLL.png.import index 4812a94..c862ce8 100644 --- a/Assets/Sprites/UI/FontLL.png.import +++ b/Assets/Sprites/UI/FontLL.png.import @@ -1,3 +1,40 @@ [remap] -importer="skip" +importer="texture" +type="CompressedTexture2D" +uid="uid://gd41bb6k1803" +path="res://.godot/imported/FontLL.png-8507bc88b2949495a33d1ab1002b7a73.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://Assets/Sprites/UI/FontLL.png" +dest_files=["res://.godot/imported/FontLL.png-8507bc88b2949495a33d1ab1002b7a73.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/uastc_level=0 +compress/rdo_quality_loss=0.0 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=false +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/channel_remap/red=0 +process/channel_remap/green=1 +process/channel_remap/blue=2 +process/channel_remap/alpha=3 +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 diff --git a/Scripts/Classes/Components/ResourceSetterNew.gd b/Scripts/Classes/Components/ResourceSetterNew.gd index c234bfd..3c746e6 100644 --- a/Scripts/Classes/Components/ResourceSetterNew.gd +++ b/Scripts/Classes/Components/ResourceSetterNew.gd @@ -113,14 +113,15 @@ func get_resource(json_file: JSON) -> Resource: match mode: ResourceMode.SPRITE_FRAMES: var animation_json = {} - if json.has("animations"): - animation_json = json.get("animations") - elif source_json.has("animations"): - animation_json = source_json.get("animations") - if source_json.has("animation_overrides"): - for i in source_json.get("animation_overrides").keys(): - animation_json[i] = source_json.get("animation_overrides")[i] + if source_json.has("animations"): + animation_json = source_json.get("animations") + elif json.has("animations"): + animation_json = json.get("animations") + + if json.has("animation_overrides"): + for i in json.get("animation_overrides").keys(): + animation_json[i] = json.get("animation_overrides")[i] if animation_json != {}: resource = load_image_from_path(source_resource_path) diff --git a/Scripts/Classes/Entities/Player.gd b/Scripts/Classes/Entities/Player.gd index 97d1f30..ff2cd51 100644 --- a/Scripts/Classes/Entities/Player.gd +++ b/Scripts/Classes/Entities/Player.gd @@ -354,7 +354,6 @@ func camera_make_current() -> void: func play_animation(animation_name := "") -> void: if sprite.sprite_frames == null: return animation_name = get_fallback_animation(animation_name) - print(animation_name) if sprite.animation != animation_name: sprite.play(animation_name)