fixed more menu weirdness
This commit is contained in:
parent
84182e5665
commit
5e2f789e40
5 changed files with 13 additions and 6 deletions
|
@ -34,12 +34,15 @@ onready var shards_needed: Label = $"%ShardsNeeded"
|
|||
onready var world_title: Label = $"%WorldTitle"
|
||||
onready var options_screen = $OptionsScreen
|
||||
|
||||
const music = preload("res://audio/music/vitreous_squares.ogg")
|
||||
|
||||
func _ready() -> void:
|
||||
if Audio.ac_music.get_stream() != music:
|
||||
Audio.play_music(music)
|
||||
var palette = load("res://graphics/player/palettes/%s.tex" % 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()
|
||||
# set initial offset
|
||||
selected_level = Game.current_level
|
||||
var target_level = level_path.get_node(LevelData.levels[selected_level].save_id)
|
||||
|
|
|
@ -1332,6 +1332,7 @@ texture = ExtResource( 14 )
|
|||
offset = Vector2( 5, 0 )
|
||||
|
||||
[node name="BossCenter" type="Control" parent="."]
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
rect_scale = Vector2( 1e-05, 0.04 )
|
||||
|
|
|
@ -15,8 +15,6 @@ func _gui_input(event):
|
|||
current_selection += 1
|
||||
if Input.is_action_just_pressed("ui_accept"):
|
||||
Audio.play_sound(songs[current_selection],Audio.ac_music)
|
||||
if Input.is_action_just_pressed("ui_cancel"):
|
||||
Audio.ac_music.stop()
|
||||
current_selection = posmod(current_selection,songs.size())
|
||||
body.text = titles[current_selection]
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ extends Control
|
|||
export (Array, String) var titles: Array
|
||||
export (Array, Texture) var palettes: Array
|
||||
export var previous_screen: PackedScene
|
||||
|
||||
onready var menu_sounds = $MenuSounds
|
||||
|
||||
var current_palette: int = 0
|
||||
|
||||
|
@ -28,11 +28,14 @@ func _ready() -> void:
|
|||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("ui_cancel"):
|
||||
SceneManager.current_scene = previous_screen.instance()
|
||||
menu_sounds.play_select_sound()
|
||||
return
|
||||
elif event.is_action_pressed("ui_left"):
|
||||
current_palette -= 1
|
||||
menu_sounds.play_select_sound()
|
||||
elif event.is_action_pressed("ui_right"):
|
||||
current_palette += 1
|
||||
menu_sounds.play_select_sound()
|
||||
|
||||
current_palette = posmod(current_palette, palettes.size())
|
||||
sg.material.set_shader_param("palette", palettes[current_palette])
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=46 format=2]
|
||||
[gd_scene load_steps=47 format=2]
|
||||
|
||||
[ext_resource path="res://shaders/ska_plane.gdshader" type="Shader" id=1]
|
||||
[ext_resource path="res://ui/theme.tres" type="Theme" id=2]
|
||||
|
@ -36,6 +36,7 @@
|
|||
[ext_resource path="res://graphics/player/palettes/seegee.tex" type="Texture" id=34]
|
||||
[ext_resource path="res://graphics/player/palettes/nightrunner.tex" type="Texture" id=35]
|
||||
[ext_resource path="res://graphics/player/palettes/typhoon.tex" type="Texture" id=36]
|
||||
[ext_resource path="res://objects/hud/menu_sounds.tscn" type="PackedScene" id=37]
|
||||
|
||||
[sub_resource type="ShaderMaterial" id=1]
|
||||
shader = ExtResource( 1 )
|
||||
|
@ -155,7 +156,6 @@ material = SubResource( 2 )
|
|||
position = Vector2( 128, 128 )
|
||||
scale = Vector2( 3, 3 )
|
||||
frames = SubResource( 9 )
|
||||
frame = 1
|
||||
playing = true
|
||||
|
||||
[node name="CenterContainer" type="CenterContainer" parent="."]
|
||||
|
@ -214,3 +214,5 @@ margin_right = 99.0
|
|||
margin_bottom = 17.0
|
||||
size_flags_vertical = 4
|
||||
texture = ExtResource( 9 )
|
||||
|
||||
[node name="MenuSounds" parent="." instance=ExtResource( 37 )]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue