couple things, icr

This commit is contained in:
JHDev2006
2025-09-25 22:54:23 +01:00
parent 7b5399147f
commit 40c2c04fcd
12 changed files with 347 additions and 283 deletions

View File

@@ -85,6 +85,7 @@ func get_resource(json_file: JSON) -> Resource:
if json.get("source") is String:
source_resource_path = json_file.resource_path.replace(json_file.resource_path.get_file(), json.source)
else:
print(json)
Global.log_error("Error getting variations! " + resource_path)
return
for i in Settings.file.visuals.resource_packs:

View File

@@ -117,6 +117,10 @@ func check_for_ghost() -> void:
func get_highscore() -> void:
%HighScore.text = "TOP- " + str(Global.high_score).pad_zeros(6)
if Global.world_num == 1 and Global.level_num == 1 and Global.score <= 0:
%StoryOptions.selected_index = 0
else:
%StoryOptions.selected_index = 1
func clear_stats() -> void:
Global.clear_saved_values()
@@ -132,6 +136,7 @@ func start_game() -> void:
Global.transition_to_scene("res://Scenes/Levels/LevelTransition.tscn")
func start_full_run() -> void:
Global.second_quest = false
Global.current_game_mode = Global.GameMode.MARATHON
SpeedrunHandler.timer = 0
if SpeedrunHandler.is_warp_run:
@@ -148,6 +153,7 @@ func start_full_run() -> void:
Global.transition_to_scene("res://Scenes/Levels/LevelTransition.tscn")
func start_level_run() -> void:
Global.second_quest = false
Global.current_game_mode = Global.GameMode.MARATHON_PRACTICE
SpeedrunHandler.timer = 0
if SpeedrunHandler.is_warp_run:
@@ -166,6 +172,7 @@ func _exit_tree() -> void:
Global.in_title_screen = false
func challenge_hunt_selected() -> void:
Global.second_quest = false
Global.current_game_mode = Global.GameMode.CHALLENGE
Global.reset_values()
Global.clear_saved_values()
@@ -220,6 +227,7 @@ func quit_game() -> void:
get_tree().quit()
func new_game_selected() -> void:
Global.second_quest = false
Global.current_game_mode = Global.GameMode.CAMPAIGN
if Global.game_beaten:
%QuestSelect.open()
@@ -227,6 +235,7 @@ func new_game_selected() -> void:
$CanvasLayer/StoryMode/NewUnbeatenGame/NoBeatenCharSelect.open()
func continue_game() -> void:
SaveManager.apply_save(SaveManager.load_save(Global.current_campaign))
Global.current_game_mode = Global.GameMode.CAMPAIGN
if Global.game_beaten:
$CanvasLayer/StoryMode/ContinueBeatenGame/WorldSelect.open()

View File

@@ -184,6 +184,8 @@ func slot_selected(idx := 0) -> void:
selected_level = idx
update_pb()
update_score()
if Settings.file.audio.extra_sfx == 1:
AudioManager.play_global_sfx("menu_move")
func cleanup() -> void:
await get_tree().process_frame

View File

@@ -6,11 +6,14 @@ var active := false
var selected_index := 0
var old_quest := false
func _process(_delta: float) -> void:
if active:
handle_input()
func open() -> void:
old_quest = Global.second_quest
show()
await get_tree().process_frame
[%FirstQuest, %SecondQuest][int(Global.second_quest)].grab_focus()
@@ -21,7 +24,7 @@ func handle_input() -> void:
select()
close()
elif Input.is_action_just_pressed("ui_back"):
Global.second_quest = false
Global.second_quest = old_quest
close()
cancelled.emit()
return

View File

@@ -82,6 +82,8 @@ func handle_input() -> void:
func slot_focused(idx := 0) -> void:
selected_world = idx
if Settings.file.audio.extra_sfx == 1:
AudioManager.play_global_sfx("menu_move")
func select_world() -> void:
if owner is Level: