From 75793bd23d275d10d6a0bd8024a7e412b64557ce Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Sun, 15 Dec 2024 16:53:12 +0100 Subject: next commit --- extractor/grf.gd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'extractor/grf.gd') diff --git a/extractor/grf.gd b/extractor/grf.gd index e017bc8..9917a74 100644 --- a/extractor/grf.gd +++ b/extractor/grf.gd @@ -220,13 +220,11 @@ func convert(destination: String = "res://data"): var player_head_path_part = "¸Ó¸®Åë" var player_body_path_part = "¸öÅë" - if file_path.ends_with(".spr") and file_path.contains(player_body_path_part) and file_path.contains("NIGHT_WATCH"): + if file_path.ends_with(".spr") and file_path.contains(player_head_path_part): var sprite = SpriteFormat.from_bytes(file_entry.get_contents(file_access)) - print(file_path, (sprite.palette_image_count), sprite.version) sprite.save_to_file(base_file_directory_path) - elif file_path.ends_with(".act") and file_path.contains(player_body_path_part): - continue + elif file_path.ends_with(".act") and file_path.contains(player_head_path_part): if not FileAccess.file_exists("%s/000.png.import" % base_file_directory_path): continue @@ -299,8 +297,6 @@ func convert(destination: String = "res://data"): animation.length = frame_timing_base * action.motion_count animation_library.add_animation(str(action_idx).pad_zeros(3), animation) - # TODO: set animation max length - # get max number of sprite layers for current action motions var motion_sprite_layers_max_count = action.motions.reduce(func(accum, motion: ActionFormat.Motion): return max(accum, motion.sprite_layer_count) @@ -331,6 +327,10 @@ func convert(destination: String = "res://data"): for motion_idx in action.motions.size(): var motion: ActionFormat.Motion = action.motions[motion_idx] + # TODO: no animations to speak of available ? + if motion.event_id == -1: + continue + var timing = motion_idx * frame_timing_base var visible_key = 0 -- cgit v1.2.3