diff --git a/Gui.tscn b/Gui.tscn index 89b6dc0..5e38dcc 100644 --- a/Gui.tscn +++ b/Gui.tscn @@ -1,16 +1,6 @@ -[gd_scene load_steps=4 format=2] +[gd_scene load_steps=2 format=2] -[ext_resource path="res://Oswald-Bold.otf" type="DynamicFontData" id=1] - -[sub_resource type="DynamicFont" id=1] -size = 19 -font_data = ExtResource( 1 ) - -[sub_resource type="DynamicFont" id=2] -size = 34 -outline_size = 2 -outline_color = Color( 0.25098, 0.25098, 0.25098, 1 ) -font_data = ExtResource( 1 ) +[ext_resource path="res://font.tres" type="DynamicFont" id=1] [node name="GUI" type="MarginContainer"] margin_left = 10.5631 @@ -19,20 +9,18 @@ margin_right = 159.563 margin_bottom = 59.2427 [node name="Laps" type="HBoxContainer" parent="."] -margin_right = 148.0 -margin_bottom = 50.0 +margin_right = 155.0 +margin_bottom = 66.0 [node name="Text" type="Label" parent="Laps"] -margin_top = 11.0 -margin_right = 50.0 -margin_bottom = 38.0 -custom_fonts/font = SubResource( 1 ) +margin_right = 125.0 +margin_bottom = 66.0 +custom_fonts/font = ExtResource( 1 ) text = "Laps : " [node name="Value" type="Label" parent="Laps"] -margin_left = 54.0 -margin_top = 1.0 -margin_right = 72.0 -margin_bottom = 49.0 -custom_fonts/font = SubResource( 2 ) +margin_left = 129.0 +margin_right = 155.0 +margin_bottom = 66.0 +custom_fonts/font = ExtResource( 1 ) text = "0" diff --git a/Main.tscn b/Main.tscn index 0190665..1d6128f 100644 --- a/Main.tscn +++ b/Main.tscn @@ -21,6 +21,5 @@ visible = false delay = 3 [node name="GUI" parent="." instance=ExtResource( 5 )] -visible = false script = ExtResource( 6 ) [connection signal="game_started" from="Menu" to="." method="start_game"] diff --git a/Menu.gd b/Menu.gd index 973fc86..79a4d06 100644 --- a/Menu.gd +++ b/Menu.gd @@ -11,10 +11,10 @@ enum Actions { PREV_TRACK, # PREV_SKIN, # NEXT_SKIN, - # PREV_INPUT_MODE, - # NEXT_INPUT_MODE, - # PREV_GAME_MODE, - # NEXT_GAME_MODE, + PREV_INPUT_MODE, + NEXT_INPUT_MODE, + PREV_GAME_MODE, + NEXT_GAME_MODE, QUIT, } var actions = {} # Registered actions @@ -29,6 +29,11 @@ func _ready(): _connect_action("Options/Return", Actions.EXIT_OPTIONS) _connect_action("Options/TrackSelection/LeftArrow", Actions.PREV_TRACK) _connect_action("Options/TrackSelection/RightArrow", Actions.NEXT_TRACK) + _connect_action("Options/GameMode/LeftArrow", Actions.PREV_GAME_MODE) + _connect_action("Options/GameMode/RightArrow", Actions.NEXT_GAME_MODE) + _connect_action("Options/InputMode/LeftArrow", Actions.PREV_INPUT_MODE) + _connect_action("Options/InputMode/RightArrow", Actions.NEXT_INPUT_MODE) + _update_options_values() TrackSelection.connect("track_changed", self, "_on_track_changed") _on_track_changed() @@ -53,6 +58,20 @@ func _input(event): TrackSelection.set_previous_track() Actions.NEXT_TRACK: TrackSelection.set_next_track() + Actions.NEXT_GAME_MODE,Actions.PREV_GAME_MODE: + if Global.settings.game_mode == Global.GameMode.TRAIN: + Global.settings.game_mode = Global.GameMode.EASY + else: + Global.settings.game_mode = Global.GameMode.TRAIN + _update_options_values() + + Actions.NEXT_INPUT_MODE,Actions.PREV_INPUT_MODE: + if Global.settings.input_mode == Global.InputMode.MOUSE: + Global.settings.input_mode = Global.InputMode.KEYBOARD + else: + Global.settings.input_mode = Global.InputMode.MOUSE + _update_options_values() + func _on_track_changed(): @@ -64,8 +83,8 @@ func _connect_action(node_path, action): node.connect("mouse_entered", self, "set_focus", [node]) node.connect("mouse_exited", self, "leave_focus", [node]) actions[node] = action - - + + func set_focus(node): _set_active(true, node) _focus = node @@ -79,4 +98,17 @@ func leave_focus(node): func _set_active(is_active, node): # Updates the focus effect for node var color = Color.orange if is_active else Color.white - node.set("custom_colors/font_color", color) \ No newline at end of file + node.set("custom_colors/font_color", color) + + +func _update_options_values(): + var new_text + match Global.settings.game_mode: + Global.GameMode.EASY: new_text = "Facile" + Global.GameMode.TRAIN: new_text = "EntraƮnement" + get_node("Options/GameMode/Value").set_text(new_text) + + match Global.settings.input_mode: + Global.InputMode.MOUSE: new_text = "Souris" + Global.InputMode.KEYBOARD: new_text = "Clavier" + get_node("Options/InputMode/Value").set_text(new_text) \ No newline at end of file diff --git a/Menu.tscn b/Menu.tscn index c2cbd15..154bfcc 100644 --- a/Menu.tscn +++ b/Menu.tscn @@ -38,6 +38,7 @@ margin_bottom = 421.063 rect_scale = Vector2( 2, 2 ) [node name="TrackSelection" type="HBoxContainer" parent="Options"] +editor/display_folded = true margin_right = 960.0 margin_bottom = 66.0 custom_constants/separation = 20 @@ -83,6 +84,7 @@ custom_constants/shadow_offset_y = 3 text = ">" [node name="GameMode" type="HBoxContainer" parent="Options"] +editor/display_folded = true margin_top = 70.0 margin_right = 960.0 margin_bottom = 136.0 @@ -129,6 +131,7 @@ custom_constants/shadow_offset_y = 3 text = ">" [node name="InputMode" type="HBoxContainer" parent="Options"] +editor/display_folded = true margin_top = 140.0 margin_right = 960.0 margin_bottom = 206.0