mirror of
https://github.com/HarmonyHoney/tiny_crate.git
synced 2026-01-23 02:34:53 +00:00
StartMenu WIP! Touch controls coming next (=
This commit is contained in:
parent
8d7d548608
commit
5c9bb806b0
9 changed files with 7 additions and 61 deletions
Binary file not shown.
|
Before Width: | Height: | Size: 350 B After Width: | Height: | Size: 349 B |
Binary file not shown.
|
Before Width: | Height: | Size: 184 B After Width: | Height: | Size: 174 B |
Binary file not shown.
|
Before Width: | Height: | Size: 111 B After Width: | Height: | Size: 111 B |
|
|
@ -55,13 +55,9 @@ margin_left = 12.0
|
|||
margin_top = -7.0
|
||||
margin_right = 42.0
|
||||
margin_bottom = 6.0
|
||||
custom_colors/font_color = Color( 1, 0.945098, 0.909804, 1 )
|
||||
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
|
||||
custom_constants/shadow_as_outline = 1
|
||||
custom_fonts/font = ExtResource( 8 )
|
||||
text = "move"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[editable path="GameCamera"]
|
||||
|
|
|
|||
|
|
@ -55,13 +55,9 @@ margin_left = 12.0
|
|||
margin_top = -7.0
|
||||
margin_right = 50.0
|
||||
margin_bottom = 6.0
|
||||
custom_colors/font_color = Color( 1, 0.945098, 0.909804, 1 )
|
||||
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
|
||||
custom_constants/shadow_as_outline = 1
|
||||
custom_fonts/font = ExtResource( 8 )
|
||||
text = "jump"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[editable path="GameCamera"]
|
||||
|
|
|
|||
|
|
@ -66,7 +66,6 @@ margin_left = 15.0
|
|||
margin_top = -6.0
|
||||
margin_right = 45.0
|
||||
margin_bottom = 7.0
|
||||
custom_colors/font_color = Color( 1, 0.945098, 0.909804, 1 )
|
||||
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
|
||||
custom_constants/shadow_as_outline = 1
|
||||
custom_fonts/font = ExtResource( 9 )
|
||||
|
|
|
|||
|
|
@ -62,13 +62,9 @@ margin_left = 12.0
|
|||
margin_top = -6.0
|
||||
margin_right = 32.0
|
||||
margin_bottom = 7.0
|
||||
custom_colors/font_color = Color( 1, 0.945098, 0.909804, 1 )
|
||||
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
|
||||
custom_constants/shadow_as_outline = 1
|
||||
custom_fonts/font = ExtResource( 9 )
|
||||
text = "lift"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[editable path="GameCamera"]
|
||||
|
|
|
|||
|
|
@ -4,12 +4,9 @@ var menu_list : Label
|
|||
var menu_items := []
|
||||
|
||||
onready var menu_stuff := $Control/Menu.get_children()
|
||||
|
||||
onready var main_list : Label = $Menu/List
|
||||
var main_items := ["play", "options", "credits"]
|
||||
|
||||
onready var quit_menu : Control = $Menu/Quit
|
||||
onready var quit_list : Label = $Menu/Quit/List
|
||||
var quit_items := ["yes", "no"]
|
||||
|
||||
var cursor := 0
|
||||
|
|
@ -17,7 +14,6 @@ var cursor := 0
|
|||
var timer := 0.1
|
||||
var clock := 0.0
|
||||
|
||||
onready var node_cursor : ColorRect = $Menu/Cursor
|
||||
onready var node_audio_scroll : AudioStreamPlayer = $AudioScroll
|
||||
onready var node_audio_play : AudioStreamPlayer = $AudioPlay
|
||||
onready var node_audio_options : AudioStreamPlayer = $AudioOptions
|
||||
|
|
@ -29,7 +25,6 @@ onready var node_audio_no : AudioStreamPlayer = $AudioNo
|
|||
var is_input = true
|
||||
|
||||
func _ready():
|
||||
menu_list = main_list
|
||||
switch_menu("main")
|
||||
UI.keys(true, true, false)
|
||||
|
||||
|
|
@ -37,9 +32,14 @@ func _input(event):
|
|||
if !is_input:
|
||||
return
|
||||
if event.is_action_pressed("action"):
|
||||
if menu_list == quit_list:
|
||||
if menu_items == quit_items:
|
||||
cursor = 1
|
||||
menu_select()
|
||||
else:
|
||||
cursor = 0
|
||||
write_menu()
|
||||
switch_menu("quit")
|
||||
node_audio_quit.play()
|
||||
elif event.is_action_pressed("jump"):
|
||||
menu_select()
|
||||
else:
|
||||
|
|
@ -56,7 +56,7 @@ func write_menu():
|
|||
menu_stuff[i].modulate = Color("ff004d") if i == cursor else Color("83769c")
|
||||
|
||||
func menu_select():
|
||||
match menu_items[cursor].to_lower():
|
||||
match menu_items[clamp(cursor, 0, menu_items.size() - 1)].to_lower():
|
||||
"play":
|
||||
Shared.wipe_scene(Shared.level_select_path)
|
||||
is_input = false
|
||||
|
|
@ -69,11 +69,6 @@ func menu_select():
|
|||
Shared.wipe_scene(Shared.credits_path)
|
||||
is_input = false
|
||||
node_audio_credits.play()
|
||||
"quit":
|
||||
cursor = -1
|
||||
write_menu()
|
||||
switch_menu("quit")
|
||||
node_audio_quit.play()
|
||||
"yes":
|
||||
is_input = false
|
||||
node_audio_yes.play()
|
||||
|
|
@ -92,17 +87,9 @@ func switch_menu(arg):
|
|||
match arg:
|
||||
"main":
|
||||
quit_menu.visible = false
|
||||
menu_list = main_list
|
||||
menu_items = main_items
|
||||
|
||||
node_cursor.get_parent().remove_child(node_cursor)
|
||||
main_list.add_child(node_cursor)
|
||||
"quit":
|
||||
quit_menu.visible = true
|
||||
menu_list = quit_list
|
||||
menu_items = quit_items
|
||||
cursor = 1
|
||||
|
||||
node_cursor.get_parent().remove_child(node_cursor)
|
||||
quit_list.add_child(node_cursor)
|
||||
write_menu()
|
||||
|
|
|
|||
|
|
@ -45,38 +45,10 @@ pause_mode = 2
|
|||
script = ExtResource( 3 )
|
||||
|
||||
[node name="Menu" type="Node2D" parent="."]
|
||||
visible = false
|
||||
position = Vector2( -18, 8 )
|
||||
z_index = 20
|
||||
z_as_relative = false
|
||||
|
||||
[node name="Cursor" type="ColorRect" parent="Menu"]
|
||||
show_behind_parent = true
|
||||
margin_left = 15.0
|
||||
margin_top = 47.0
|
||||
margin_right = 44.0
|
||||
margin_bottom = 57.0
|
||||
color = Color( 0.113725, 0.168627, 0.32549, 1 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="List" type="Label" parent="Menu"]
|
||||
margin_left = 12.0
|
||||
margin_top = 48.0
|
||||
margin_right = 48.0
|
||||
margin_bottom = 89.0
|
||||
custom_colors/font_color = Color( 1, 0.945098, 0.909804, 1 )
|
||||
custom_fonts/font = ExtResource( 1 )
|
||||
text = "play
|
||||
options
|
||||
credits
|
||||
quit"
|
||||
align = 1
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Quit" type="Control" parent="Menu"]
|
||||
visible = false
|
||||
margin_left = 80.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue