Hint text

This commit is contained in:
adrienmalin 2019-01-16 15:35:46 +01:00
parent a915251506
commit 5419864859
5 changed files with 64 additions and 27 deletions

1
.gitignore vendored
View File

@ -10,3 +10,4 @@ export_presets.cfg
midi/FluidR3 GM.sf2 midi/FluidR3 GM.sf2
release/ release/
*.import *.import
*.tmp

View File

@ -3,7 +3,7 @@
[ext_resource path="res://Tetrominos/Tetromino.gd" type="Script" id=1] [ext_resource path="res://Tetrominos/Tetromino.gd" type="Script" id=1]
[ext_resource path="res://Tetrominos/Mino/Mino.tscn" type="PackedScene" id=2] [ext_resource path="res://Tetrominos/Mino/Mino.tscn" type="PackedScene" id=2]
[node name="TetroJ" type="Spatial" index="0"] [node name="TetroJ" type="Spatial"]
script = ExtResource( 1 ) script = ExtResource( 1 )

View File

@ -3,7 +3,7 @@
[ext_resource path="res://Tetrominos/TetroT.gd" type="Script" id=1] [ext_resource path="res://Tetrominos/TetroT.gd" type="Script" id=1]
[ext_resource path="res://Tetrominos/Mino/Mino.tscn" type="PackedScene" id=2] [ext_resource path="res://Tetrominos/Mino/Mino.tscn" type="PackedScene" id=2]
[node name="TetroT" type="Spatial"] [node name="TetroT" type="Spatial" index="0"]
script = ExtResource( 1 ) script = ExtResource( 1 )

View File

@ -99,6 +99,7 @@ func _input(event):
save_to_config("input", action, scancode) save_to_config("input", action, scancode)
enable_resume = true enable_resume = true
hint_text()
func _ready(): func _ready():
# Load config if existing, if not it will be generated with default values # Load config if existing, if not it will be generated with default values
@ -112,5 +113,12 @@ func _ready():
button.text = OS.get_scancode_string(input_event.scancode) button.text = OS.get_scancode_string(input_event.scancode)
button.connect("pressed", self, "wait_for_input", [action]) button.connect("pressed", self, "wait_for_input", [action])
hint_text()
func hint_text():
var input_event = InputMap.get_action_list("pause")[0]
var scancode = OS.get_scancode_string(input_event.scancode)
$hint.text = "Press "+ scancode + " to resume\nor click on a button to change key assignment"
# Do not start processing input until a button is pressed # Do not start processing input until a button is pressed
set_process_input(false) set_process_input(false)

View File

@ -19,9 +19,9 @@ anchor_top = 0.5
anchor_right = 0.5 anchor_right = 0.5
anchor_bottom = 0.5 anchor_bottom = 0.5
margin_left = -30.0 margin_left = -30.0
margin_top = 10.0 margin_top = 20.0
margin_right = 10.0 margin_right = 10.0
margin_bottom = 50.0 margin_bottom = 60.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false rect_clip_content = false
mouse_filter = 0 mouse_filter = 0
@ -39,10 +39,10 @@ anchor_left = 0.0
anchor_top = 0.0 anchor_top = 0.0
anchor_right = 0.0 anchor_right = 0.0
anchor_bottom = 0.0 anchor_bottom = 0.0
margin_left = -40.0 margin_left = -220.0
margin_top = -150.0 margin_top = -190.0
margin_right = 110.0 margin_right = 280.0
margin_bottom = -111.0 margin_bottom = -151.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false rect_clip_content = false
mouse_filter = 2 mouse_filter = 2
@ -53,6 +53,8 @@ custom_fonts/font = ExtResource( 2 )
custom_colors/font_color = Color( 0.443137, 0.709804, 0.819608, 0.533333 ) custom_colors/font_color = Color( 0.443137, 0.709804, 0.819608, 0.533333 )
custom_colors/font_color_shadow = Color( 1, 1, 1, 0.0968627 ) custom_colors/font_color_shadow = Color( 1, 1, 1, 0.0968627 )
text = "PAUSE" text = "PAUSE"
align = 1
valign = 1
percent_visible = 1.0 percent_visible = 1.0
lines_skipped = 0 lines_skipped = 0
max_lines_visible = -1 max_lines_visible = -1
@ -82,9 +84,9 @@ anchor_top = 0.0
anchor_right = 0.0 anchor_right = 0.0
anchor_bottom = 0.0 anchor_bottom = 0.0
margin_left = 50.0 margin_left = 50.0
margin_top = 50.0 margin_top = 65.0
margin_right = 90.0 margin_right = 90.0
margin_bottom = 90.0 margin_bottom = 105.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false rect_clip_content = false
mouse_filter = 0 mouse_filter = 0
@ -130,9 +132,9 @@ anchor_top = 0.0
anchor_right = 0.0 anchor_right = 0.0
anchor_bottom = 0.0 anchor_bottom = 0.0
margin_left = 226.0 margin_left = 226.0
margin_top = 51.0 margin_top = 66.0
margin_right = 266.0 margin_right = 266.0
margin_bottom = 91.0 margin_bottom = 106.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false rect_clip_content = false
mouse_filter = 0 mouse_filter = 0
@ -178,9 +180,9 @@ anchor_top = 0.0
anchor_right = 0.0 anchor_right = 0.0
anchor_bottom = 0.0 anchor_bottom = 0.0
margin_left = 230.0 margin_left = 230.0
margin_top = 100.0 margin_top = 115.0
margin_right = 270.0 margin_right = 270.0
margin_bottom = 140.0 margin_bottom = 155.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false rect_clip_content = false
mouse_filter = 0 mouse_filter = 0
@ -225,9 +227,9 @@ anchor_top = 0.0
anchor_right = 0.0 anchor_right = 0.0
anchor_bottom = 0.0 anchor_bottom = 0.0
margin_left = 45.0 margin_left = 45.0
margin_top = 100.0 margin_top = 115.0
margin_right = 85.0 margin_right = 85.0
margin_bottom = 140.0 margin_bottom = 155.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false rect_clip_content = false
mouse_filter = 0 mouse_filter = 0
@ -273,9 +275,9 @@ anchor_top = 0.0
anchor_right = 0.0 anchor_right = 0.0
anchor_bottom = 0.0 anchor_bottom = 0.0
margin_left = 50.0 margin_left = 50.0
margin_top = 150.0 margin_top = 165.0
margin_right = 90.0 margin_right = 90.0
margin_bottom = 190.0 margin_bottom = 205.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false rect_clip_content = false
mouse_filter = 0 mouse_filter = 0
@ -320,9 +322,9 @@ anchor_top = 0.0
anchor_right = 0.0 anchor_right = 0.0
anchor_bottom = 0.0 anchor_bottom = 0.0
margin_left = 226.0 margin_left = 226.0
margin_top = 151.0 margin_top = 166.0
margin_right = 266.0 margin_right = 266.0
margin_bottom = 191.0 margin_bottom = 206.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false rect_clip_content = false
mouse_filter = 0 mouse_filter = 0
@ -367,9 +369,9 @@ anchor_top = 0.0
anchor_right = 0.0 anchor_right = 0.0
anchor_bottom = 0.0 anchor_bottom = 0.0
margin_left = 50.0 margin_left = 50.0
margin_top = 200.0 margin_top = 215.0
margin_right = 90.0 margin_right = 90.0
margin_bottom = 240.0 margin_bottom = 255.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false rect_clip_content = false
mouse_filter = 0 mouse_filter = 0
@ -413,9 +415,9 @@ anchor_top = 0.0
anchor_right = 0.0 anchor_right = 0.0
anchor_bottom = 0.0 anchor_bottom = 0.0
margin_left = 226.0 margin_left = 226.0
margin_top = 201.0 margin_top = 216.0
margin_right = 266.0 margin_right = 266.0
margin_bottom = 241.0 margin_bottom = 256.0
rect_pivot_offset = Vector2( 0, 0 ) rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false rect_clip_content = false
mouse_filter = 0 mouse_filter = 0
@ -453,4 +455,30 @@ align = 1
position = Vector2( 34, 19 ) position = Vector2( 34, 19 )
texture = ExtResource( 11 ) texture = ExtResource( 11 )
[node name="hint" type="Label" parent="." index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = -220.0
margin_top = -135.0
margin_right = 280.0
margin_bottom = -103.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
custom_fonts/font = ExtResource( 3 )
text = "Press the pause/resume key to resume
or click on a button to change key assignment"
align = 1
valign = 1
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "custom_fonts" ]