fixed an animation override bug cause im dumb and havent touched the json parser in a while

This commit is contained in:
JHDev2006
2025-10-17 13:32:08 +01:00
parent 2e66c00163
commit a0521becb4
9 changed files with 167 additions and 19 deletions

View File

@@ -2,7 +2,7 @@
importer="font_data_bmfont" importer="font_data_bmfont"
type="FontFile" type="FontFile"
uid="uid://cd221873lbtj1" uid="uid://djsv6aojrcuyg"
path="res://.godot/imported/Font.fnt-6c6685c58d22178166a8720d2c719ea3.fontdata" path="res://.godot/imported/Font.fnt-6c6685c58d22178166a8720d2c719ea3.fontdata"
[deps] [deps]
@@ -13,5 +13,5 @@ dest_files=["res://.godot/imported/Font.fnt-6c6685c58d22178166a8720d2c719ea3.fon
[params] [params]
fallbacks=[] fallbacks=[]
compress=false compress=true
scaling_mode=0 scaling_mode=2

View File

@@ -1,3 +1,40 @@
[remap] [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

View File

@@ -1,3 +1,40 @@
[remap] [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

View File

@@ -1,3 +1,40 @@
[remap] [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

View File

@@ -2,7 +2,7 @@
importer="texture" importer="texture"
type="CompressedTexture2D" type="CompressedTexture2D"
uid="uid://csm3iphwghxr4" uid="uid://bmhnxinh358ql"
path="res://.godot/imported/FontJPOld.png-7fc797be5045e04e8b21b55cfd2654c1.ctex" path="res://.godot/imported/FontJPOld.png-7fc797be5045e04e8b21b55cfd2654c1.ctex"
metadata={ metadata={
"vram_texture": false "vram_texture": false

View File

@@ -2,7 +2,7 @@
importer="font_data_bmfont" importer="font_data_bmfont"
type="FontFile" type="FontFile"
uid="uid://ctx37lrb3f76i" uid="uid://b8pt2ab0kg0vw"
path="res://.godot/imported/FontLL.fnt-b0a4b8976c6dfce9e7529f579de98f07.fontdata" path="res://.godot/imported/FontLL.fnt-b0a4b8976c6dfce9e7529f579de98f07.fontdata"
[deps] [deps]
@@ -13,5 +13,5 @@ dest_files=["res://.godot/imported/FontLL.fnt-b0a4b8976c6dfce9e7529f579de98f07.f
[params] [params]
fallbacks=[] fallbacks=[]
compress=false compress=true
scaling_mode=0 scaling_mode=2

View File

@@ -1,3 +1,40 @@
[remap] [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

View File

@@ -113,14 +113,15 @@ func get_resource(json_file: JSON) -> Resource:
match mode: match mode:
ResourceMode.SPRITE_FRAMES: ResourceMode.SPRITE_FRAMES:
var animation_json = {} 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"): if source_json.has("animations"):
for i in source_json.get("animation_overrides").keys(): animation_json = source_json.get("animations")
animation_json[i] = source_json.get("animation_overrides")[i] 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 != {}: if animation_json != {}:
resource = load_image_from_path(source_resource_path) resource = load_image_from_path(source_resource_path)

View File

@@ -354,7 +354,6 @@ func camera_make_current() -> void:
func play_animation(animation_name := "") -> void: func play_animation(animation_name := "") -> void:
if sprite.sprite_frames == null: return if sprite.sprite_frames == null: return
animation_name = get_fallback_animation(animation_name) animation_name = get_fallback_animation(animation_name)
print(animation_name)
if sprite.animation != animation_name: if sprite.animation != animation_name:
sprite.play(animation_name) sprite.play(animation_name)