forked from team-sg/hero-mark-2
expand level select menu, implement palettes fully :)
This commit is contained in:
parent
923b638cca
commit
3f7da8aa83
5 changed files with 263 additions and 3 deletions
|
@ -29,6 +29,8 @@ onready var shards_block: HBoxContainer = $"%ShardsBlock"
|
|||
onready var shards_needed: Label = $"%ShardsNeeded"
|
||||
|
||||
func _ready() -> void:
|
||||
var palette = load("res://graphics/player/palettes/%s.png" % Game.current_palette)
|
||||
player_sprite.material.set_shader_param("palette", palette)
|
||||
$ShardCount.text = "%02d" % Save.current_file.get_total_shards()
|
||||
Fade.fade_in(Options.transition_speed_secs)
|
||||
Audio.ac_music.stop()
|
||||
|
@ -83,9 +85,15 @@ func _process(delta: float) -> void:
|
|||
else:
|
||||
player_sprite.visible = true
|
||||
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("ui_cancel") and $"%MenuPopup".rect_scale.y >= 1.0:
|
||||
animation_player.play("hide_menu")
|
||||
|
||||
|
||||
func _gui_input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("ui_cancel"):
|
||||
animation_player.play("show_exit")
|
||||
animation_player.play("show_menu")
|
||||
if not made_selection: # player is walking around
|
||||
if event.is_action_pressed("ui_accept"):
|
||||
_update_stats()
|
||||
|
@ -118,6 +126,7 @@ func _gui_input(event: InputEvent) -> void:
|
|||
func _select_level(level_id: int) -> void:
|
||||
var level = LevelData.levels[level_id]
|
||||
selected_level = level_id
|
||||
Game.current_level = selected_level
|
||||
# hide arrows at edges of leve set
|
||||
if level_id == 0:
|
||||
back_arrow.modulate.a = 0.0
|
||||
|
@ -197,3 +206,7 @@ func _on_ExitMenu_pressed() -> void:
|
|||
Fade.fade_out(Options.transition_speed_secs)
|
||||
yield(Fade, "fade_finished")
|
||||
SceneManager.current_scene = load("res://menus/main_menu.tscn").instance()
|
||||
|
||||
|
||||
func _on_PalettesButton_button_down() -> void:
|
||||
SceneManager.current_scene = load("res://menus/palette_select.tscn").instance()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue