Merge branch 'main' into custom-level-loading-rewrite

This commit is contained in:
JHDev2006
2025-10-17 21:12:58 +01:00
200 changed files with 19511 additions and 16655 deletions

View File

@@ -19,6 +19,7 @@ func _ready() -> void:
coin_medal = int(ChallengeModeHandler.red_coins_collected[Global.world_num - 1][Global.level_num - 1]) & 0b011111 == 0b011111
score_medal = ChallengeModeHandler.top_challenge_scores[Global.world_num -1][Global.level_num - 1] >= ChallengeModeHandler.CHALLENGE_TARGETS[Global.current_campaign][Global.world_num -1][Global.level_num -1]
yoshi_medal = ChallengeModeHandler.is_coin_collected(ChallengeModeHandler.CoinValues.YOSHI_EGG, ChallengeModeHandler.red_coins_collected[Global.world_num - 1][Global.level_num - 1])
$ChallengeResults.play()
setup_results()
func _process(_delta: float) -> void:
@@ -26,10 +27,9 @@ func _process(_delta: float) -> void:
can_exit = false
exiting = true
save_results()
$Music.stop()
$Music.stream = preload("res://Assets/Audio/BGM/ChallengeEnd.mp3")
$Music.play()
await $Music.finished
$ChallengeResults.stop()
$ChallengeEnd.play()
await $ChallengeEnd.finished
open_menu()
Engine.time_scale = 5 if Input.is_action_pressed("jump_0") and can_exit == false and exiting == false else 1

View File

@@ -50,14 +50,26 @@ func get_custom_characters() -> void:
var json = JSON.parse_string(FileAccess.open(char_path.path_join("CharacterInfo.json"), FileAccess.READ).get_as_text())
Player.CHARACTERS.append(i)
Player.CHARACTER_NAMES.append(json.name)
if FileAccess.file_exists(char_path.path_join("CharacterColour.json")):
Player.CHARACTER_COLOURS.append(load(char_path.path_join("CharacterColour.json")))
else:
Player.CHARACTER_COLOURS.append(null)
if FileAccess.file_exists(char_path.path_join("LifeIcon.json")):
GameHUD.character_icons.append(load(char_path.path_join("LifeIcon.json")))
else:
GameHUD.character_icons.append(null)
if FileAccess.file_exists(char_path.path_join("ColourPalette.json")):
Player.CHARACTER_PALETTES.append(load(char_path.path_join("ColourPalette.json")))
else:
Player.CHARACTER_PALETTES.append(null)
if FileAccess.file_exists(char_path.path_join("SFX.json")):
AudioManager.character_sfx_map[i] = JSON.parse_string(FileAccess.open(char_path.path_join("SFX.json"), FileAccess.READ).get_as_text())
else:
AudioManager.character_sfx_map[i] = {}
func open() -> void:
get_custom_characters()

View File

@@ -4,9 +4,11 @@ extends AssetRipper
@onready var progress_bar: ProgressBar = %ProgressBar
@onready var error: Label = %Error
static var updating := false
func _ready() -> void:
Global.get_node("GameHUD").hide()
if updating: $MarginContainer/ProgressBar/Label.text = "UPDATING ASSETS..."
rom = FileAccess.get_file_as_bytes(Global.rom_path)
prg_rom_size = rom[4] * 16384
chr_rom = rom.slice(16 + prg_rom_size)

View File

@@ -7,6 +7,7 @@ var selected_index := 0
var active := false
@export var can_exit := true
@export var is_pause := true
signal option_1_selected
@@ -30,7 +31,7 @@ func handle_inputs() -> void:
selected_index = clamp(selected_index, 0, options.size() - 1)
if Input.is_action_just_pressed("ui_accept"):
option_selected()
elif Input.is_action_just_pressed("pause") or Input.is_action_just_pressed("ui_back"):
elif (Input.is_action_just_pressed("pause") or Input.is_action_just_pressed("ui_back")) and can_exit:
close()
func option_selected() -> void:

View File

@@ -4,7 +4,7 @@ extends Node
const valid_chars := "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-*!.^/+:,'()?_;<> \n"
@export var node_to_validate: Control = null
const FONT = preload("uid://cd221873lbtj1")
const FONT = preload("res://Assets/Sprites/UI/Font.fnt")
signal text_validated(new_text: String)
func validate_text() -> void:

View File

@@ -59,7 +59,10 @@ func frame_limit_changed(new_value := 0) -> void:
Engine.max_fps = new_framerate
Settings.file.video.frame_limit = new_value
func set_value(value_name := "", value := 0) -> void:
func set_window_size(value := []) -> void:
get_window().size = Vector2(value[0], value[1])
func set_value(value_name := "", value = null) -> void:
{
"mode": window_mode_changed,
"size": window_size_changed,
@@ -71,4 +74,5 @@ func set_value(value_name := "", value := 0) -> void:
"hud_size": hud_style_changed,
"hud_style": hud_style_changed,
"frame_limit": frame_limit_changed,
"window_size": set_window_size
}[value_name].call(value)