diff --git a/CameraPivot.gd b/CameraPivot.gd index 4e1d9af..9bcd2b8 100644 --- a/CameraPivot.gd +++ b/CameraPivot.gd @@ -56,19 +56,19 @@ func _process(delta): if rotating: rotate_2d_position = get_viewport().get_mouse_position() var mouse_diff = rotate_2d_position - rotate_2d_position_old - rotation.y = old_y_rotation - mouse_diff.x * 0.005 - azimuth_pivot.rotation.x = old_x_rotation - mouse_diff.y * 0.005 + rotation.y = old_y_rotation - mouse_diff.x * GameSettings.camera_rotation_speed / 1000.0 + azimuth_pivot.rotation.x = old_x_rotation - mouse_diff.y * GameSettings.camera_rotation_speed / 1000.0 pass if Input.is_action_pressed("camera_left"): - position -= transform.basis.x * 0.2 + position -= transform.basis.x * GameSettings.camera_movement_speed / 1000.0 if Input.is_action_pressed("camera_right"): - position += transform.basis.x * 0.2 + position += transform.basis.x * GameSettings.camera_movement_speed / 1000.0 if Input.is_action_pressed("camera_up"): - position -= transform.basis.z * 0.2 + position -= transform.basis.z * GameSettings.camera_movement_speed / 1000.0 if Input.is_action_pressed("camera_down"): - position += transform.basis.z * 0.2 + position += transform.basis.z * GameSettings.camera_movement_speed / 1000.0 if position.length() > world_distance_limit: position = position.normalized() * world_distance_limit diff --git a/Game.tscn b/Game.tscn index b59ad49..37833ae 100644 --- a/Game.tscn +++ b/Game.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=27 format=3 uid="uid://bx0bbrwdr0h40"] +[gd_scene load_steps=28 format=3 uid="uid://bx0bbrwdr0h40"] [ext_resource type="Script" path="res://Game.gd" id="1_dgt1j"] [ext_resource type="Script" path="res://CameraPivot.gd" id="2_71xp1"] @@ -7,6 +7,7 @@ [ext_resource type="Material" uid="uid://dv2oo7hlc5nyy" path="res://Testbed/Table.tres" id="5_u4p4p"] [ext_resource type="Script" path="res://WebLightChecker.gd" id="6_41m5i"] [ext_resource type="Script" path="res://UI/BuildMenu.gd" id="7_1oc55"] +[ext_resource type="Script" path="res://WorldEnvSettings.gd" id="7_w8wx1"] [ext_resource type="Script" path="res://Table.gd" id="8_ys5y3"] [ext_resource type="Texture2D" uid="uid://d2i5vboeyq8qx" path="res://UI/hex_white.svg" id="11_cl0he"] [ext_resource type="Script" path="res://GameOverMenu.gd" id="11_ffmss"] @@ -94,6 +95,7 @@ script = ExtResource("8_ys5y3") [node name="WorldEnvironment" type="WorldEnvironment" parent="."] environment = SubResource("Environment_xoohw") camera_attributes = SubResource("CameraAttributesPractical_41x5h") +script = ExtResource("7_w8wx1") [node name="DirectionalLight3D" type="DirectionalLight3D" parent="."] transform = Transform3D(0.843961, -0.46784, 0.262404, -0.0775016, 0.377705, 0.922677, -0.530777, -0.79904, 0.28251, 0.262159, 3.27869, -0.104568) diff --git a/Globals/GameSettings.gd b/Globals/GameSettings.gd index e70f5bd..b8e98d8 100644 --- a/Globals/GameSettings.gd +++ b/Globals/GameSettings.gd @@ -1,6 +1,17 @@ extends Node +signal dof_blur_changed(enabled) + +func _ready(): + dof_blur_changed.connect(_on_dof_blur_changed) + +func _on_dof_blur_changed(enabled: bool) -> void: + dof_blur_enabled = enabled + +var dof_blur_enabled: bool = true + +var camera_movement_speed: float = 200.0 +var camera_rotation_speed: float = 5.0 + const DEFAULT_LOBBY_ENDPOINT: String = "wss://dev.bytesandpieces.xyz:9088" - - var LOBBY_ENDPOINT: String = "wss://dev.bytesandpieces.xyz:9088" diff --git a/UI/CreditsPanel.gd b/UI/CreditsPanel.gd new file mode 100644 index 0000000..28d1772 --- /dev/null +++ b/UI/CreditsPanel.gd @@ -0,0 +1,21 @@ +extends Control + + +# Called when the node enters the scene tree for the first time. +func _ready(): + pass # Replace with function body. + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass + + +func _on_rich_text_label_meta_clicked(meta): + OS.shell_open(str(meta)) + pass # Replace with function body. + + +func _on_close_button_pressed(): + visible = false + pass # Replace with function body. diff --git a/UI/Rules/Rules.tscn b/UI/Rules/Rules.tscn index dfacfca..818e4e7 100644 --- a/UI/Rules/Rules.tscn +++ b/UI/Rules/Rules.tscn @@ -107,17 +107,14 @@ text = "Ant" [node name="Ladybug" type="Button" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"] layout_mode = 2 -disabled = true text = "Ladybug" [node name="Mosquito" type="Button" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"] layout_mode = 2 -disabled = true text = "Mosquito" [node name="Pillbug" type="Button" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer"] layout_mode = 2 -disabled = true text = "Pillbug" [node name="VBoxContainer2" type="VBoxContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer"] @@ -147,91 +144,149 @@ theme_override_constants/margin_bottom = 10 [node name="GeneralLabel" type="RichTextLabel" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer"] layout_mode = 2 -text = "The pieces in play define the playing surface, known as the Hive. +bbcode_enabled = true +text = "[b]Objective[/b]: Surround your opponent's Queen Bee with your own insects or a combination of yours and theirs, while preventing them from doing the same to your Queen Bee. -Play begings with one player placing a piece from their hand in the center of the table and the next player joining one of their own pieces to it edge to edge. +[b]Components[/b]: The game pieces themselves create the board as you play. These pieces represent different insects with unique movement abilities. -Players then take turns to either place or move any one of their pieces." +[b]Gameplay[/b]: +[ul] +Players take turns placing a new insect from their hand onto the growing hive, or moving an insect already on the hive. +The key rule is the One Hive Rule: All your insects must remain connected as a single group at all times. No detaching pieces or splitting the hive in two! +The first player to surround their opponent's Queen Bee wins! +[/ul] + +[b]On Your Turn[/b]: You can choose to perform one of two actions: +[ul] + Place a new insect: Select an insect from your supply and place it onto the existing hive structure. + Move an existing insect: If your Queen Bee has already been placed, you can choose to move one of your placed insects according to its movement rules (explained elsewhere in the rulebook). +[/ul] + + +There are additional rules specific to how each insect type moves." fit_content = true [node name="PlacingLabel" type="RichTextLabel" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer"] visible = false layout_mode = 2 -text = "A new piece can be introduced into the game at any time. However, with the exception of the first piece placed by each player, pieces may not be placed next to a piece of the opponent's color. - -It is possible to win the game without placing all your pieces but once a piece has been placed it can't be removed. - -Your Queen Bee can be placed at any time from your first to your fourth turn. You must place your Queen Bee on your fourth turn if you have not placed it before." +bbcode_enabled = true +text = "[b]Placement Restrictions[/b]: When placing a new insect, it must follow these two key rules: +[ul] + Adjacent Placement: The new insect must be placed such that it touches at least one of your other insects along a complete side (not just a corner). + No Enemy Contact: The new insect cannot be placed touching any of your opponent's insects. +[/ul] +" fit_content = true [node name="MovingLabel" type="RichTextLabel" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer"] visible = false layout_mode = 2 -text = "Once your Queen Bee has been placed (but not before), you can decide whether to use each turn after that to place another tile or to move one of the pieces that have already been placed. +bbcode_enabled = true +text = "Hive insects navigate the ever-growing hive structure, but they can't squeeze through impossibly tight spaces! This is where the Freedom of Movement Rule comes in. -Each creature has its own way of moving about the Hive and it's possible to move pieces to a position where they touch one or more of your opponent's tiles. +[b]The Rule[/b]: A piece can only move to a space where it could physically slide in or out of using its normal movement. Imagine each insect scooting across the table – if it gets stuck halfway through the gap, it can't move there. -Note: All pieces must always touch at least one other piece. If a piece the only connection between two parts of the Hive, it may not be moved." +There are two main situations where the Freedom of Movement Rule applies: +[ul] +[b]Moving into a New Space[/b]: When moving an insect, the gap between its starting position and the destination space must be large enough for the insect to fit through. For example, a Soldier Ant can move into a space between two other insects because there's a full side open. However, an Ant cannot move into a narrow gap between the corner of two insects. +[b]Moving Out of an Enclosed Space[/b]: Sometimes, your insects might get \"boxed in\" by other pieces. The Freedom of Movement Rule applies here too. An insect can only move out of a space if there's a gap large enough for it to completely exit. +[/ul] + +Tip: This rule can be used strategically! By cleverly positioning your insects, you can limit your opponent's movement options and potentially trap their Queen Bee. However, be mindful – the Freedom of Movement Rule applies to your insects as well, so don't accidentally box yourself in!" fit_content = true [node name="BeeLabel" type="RichTextLabel" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer"] visible = false layout_mode = 2 bbcode_enabled = true -text = "The Queen Bee can move only one space per turn. Even though it is restricted in this way, if moved at the right time it can severely disrupt your opponent's plans. +text = "The Bee is the most important of your pieces. It's the heart of your hive. -[img]res://Testbed/queenbeemove.png[/img] +You need to protect your bee from getting surrounded (all 6 surrounding cells filled with other pieces) while also trying to surround your opponent's bee. +[b]Movement[/b]: The bee can move one (1) space in any direction. -From this position, the black Queen Bee is able to move into one of four spaces." +[b]Ability[/b]: None " fit_content = true [node name="BeetleLabel" type="RichTextLabel" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer"] visible = false layout_mode = 2 -text = "The Beetle, like the Queen Bee, moves only one space per turn. +bbcode_enabled = true +text = "The Beetle is similiar to the bee. It can only move 1 space in any direction. +Additionally, the beetle can climb on top of other pieces. This blocks them from moving and using their abilities (as well es being targeted by abilities). +For the purpose of placing a tile, only the top most pieces' color relevant. -Unlike any other creature though, it can also move on top of the Hive. +[b]Movement[/b]: One (1) space in any direction -A piece with a beetle on top of it is unable to move and for the purposes of the placing rules, the stack takes on the color of the Beetle. - -From its position on top of the Hive, the Beetle can move from tile to tile across the top of the Hive. It can also drop into spaces that are surrounded and therefore not accessible to most other creatures. - -From its position, the white Beetle is able to move into one of four positions. - -The only way to block a Beetle that is on top of the Hive is to move another Beetle on top of it. All four Beetles can be stacked on top of each other. - -Note: When it is first placed, the Beetle is placed in the same way as all other pieces. It can't be placed directly on top of the Hive, even though it can be moved there later." +[b]Ability[/b]: Can climb on top of other pieces and can drop into narrow spaces (ignoring the freedom of move rule, but only when moving from on top of the hive to a lower place)." fit_content = true [node name="GrasshopperLabel" type="RichTextLabel" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer"] visible = false layout_mode = 2 -text = "The Grasshopper does not move around the outside of the Hive like the other creatures. Instead, it jumps from its space over any number of pieces (but at least one) to the next unoccupied space along a straight row of joined pieces. +bbcode_enabled = true +text = "The Grasshopper can bridge large gaps as long as there are pieces in between. -This gives it the advantage of being able to fill in a space which is surrounded by other tiles. +[b]Movement[/b]: Can jump in any of the six (6) directions, as long as there is at least one neighbour in that direction. The grasshopper can only jump until the first hole in a straight line. -From its position, the white Grasshopper can jump to one of three spaces. Note: It can't jump across the gap to the space marked x." +[b]Ability[/b]: None" fit_content = true [node name="SpiderLabel" type="RichTextLabel" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer"] visible = false layout_mode = 2 -text = "The Spider moves three spaces per turn - no more, no less. +bbcode_enabled = true +text = "The Spider can move exactly three (3) cells. -It must move in a direct path and can't backtrack on itself. It may only move around pieces that it is in direct contact with on each step of its move and it may not move across to a piece that it's not in direct contact with. +[b]Movement[/b]: Move 3 cells (without breaking the hive). Can not move onto previously visited cells during that move. -From its position, the black Spider can move into one of four spaces but is unable to move to the position on its left marked 2 on its first step. -" +[b]Ability[/b]: None" fit_content = true [node name="AntLabel" type="RichTextLabel" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer"] visible = false layout_mode = 2 -text = "The Soldier Ant can move from its position to any other position around the Hive provided the restrictions are adhered to. This freedom of movement makes the Ant one of the most valuable pieces. +bbcode_enabled = true +text = "The Ant is very strong and a flexible piece. It scoots around the hive until it finds a nice resting spot. -In this case, the Ant can be moved into one of eleven positions but is unable to move into the position in the center of the Hive. -" +[b]Movement[/b]: Move any amount of cells (around the hive). Can not move into narrow gaps (freedom of movement rule). + +[b]Ability[/b]: None" +fit_content = true + +[node name="LadybugLabel" type="RichTextLabel" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer"] +visible = false +layout_mode = 2 +bbcode_enabled = true +text = "The Ladybug is similiar to the beetle and the spider. It moves exactly three (3) spaces. The first two on top of the hive, and the final third one on ground level. Can drop into narrow spaces. + +[b]Movement[/b]: Move 3 spaces. Can not move onto previously visited cells during that move. The first two cells have to be on top of the hive, the final one on ground level. + +[b]Ability[/b]: None" +fit_content = true + +[node name="MosquitoLabel" type="RichTextLabel" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer"] +visible = false +layout_mode = 2 +bbcode_enabled = true +text = "The adaptive Mosquito. It can copy any movement (or ability) of any neighbouring piece. +If the mosquito ends up on top of the hive (by copying a beetles' movement) it keeps the beetles' movement until it is back on the ground. + +[b]Movement[/b]: None (or: Beetles' Movement when on top of the hive) + +[b]Ability[/b]: Can copy any movement or ability of a surrounding piece." +fit_content = true + +[node name="PillbugLabel" type="RichTextLabel" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer"] +visible = false +layout_mode = 2 +bbcode_enabled = true +text = "The sleek Pillbug. It moves like the bee (one piece in any direction) but also has a special ability. +It can grab any one surrounding piece, then lift it over its head and drop it onto a free surrounding space. + +[b]Movement[/b]: One (1) space in any direction. + +[b]Ability[/b]: Can move surrounding pieces." fit_content = true [node name="CloseButton" type="Button" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] @@ -246,4 +301,7 @@ text = "Close" [connection signal="pressed" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Grasshopper" to="." method="_on_button_pressed" binds= [NodePath("../../VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer/GrasshopperLabel"), "Grasshopper"]] [connection signal="pressed" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Spider" to="." method="_on_button_pressed" binds= [NodePath("../../VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer/SpiderLabel"), "Spider"]] [connection signal="pressed" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Ant" to="." method="_on_button_pressed" binds= [NodePath("../../VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer/AntLabel"), "Ant"]] +[connection signal="pressed" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Ladybug" to="." method="_on_button_pressed" binds= [NodePath("../../VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer/LadybugLabel"), "Ladybug"]] +[connection signal="pressed" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Mosquito" to="." method="_on_button_pressed" binds= [NodePath("../../VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer/MosquitoLabel"), "Mosquito"]] +[connection signal="pressed" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/HBoxContainer/VBoxContainer/Pillbug" to="." method="_on_button_pressed" binds= [NodePath("../../VBoxContainer2/ScrollContainer/PanelContainer/MarginContainer/PillbugLabel"), "Pillbug"]] [connection signal="pressed" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/CloseButton" to="." method="_on_close_button_pressed"] diff --git a/UI/Settings/Settings.gd b/UI/Settings/Settings.gd index 4118ca6..b9f8bae 100644 --- a/UI/Settings/Settings.gd +++ b/UI/Settings/Settings.gd @@ -3,6 +3,8 @@ extends Control @onready var panel_container = $PanelContainer @onready var margin_container2 = $Pivot/MarginContainer +@onready var line_edit = $Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General/MarginContainer/General/VBoxContainer/LineEdit + var mat: ShaderMaterial func show_panel() -> void: @@ -19,6 +21,8 @@ func show_panel() -> void: # Called when the node enters the scene tree for the first time. func _ready(): mat = panel_container.material.duplicate() + + line_edit.text = GameSettings.LOBBY_ENDPOINT pass # Replace with function body. func tween_blur(val: float) -> void: @@ -39,3 +43,31 @@ func _on_panel_hidden() -> void: func _on_cancel_pressed(): hide_panel() + + +func _on_reset_lobby_url_button_pressed(): + line_edit = GameSettings.DEFAULT_LOBBY_ENDPOINT + GameSettings.LOBBY_ENDPOINT = GameSettings.DEFAULT_LOBBY_ENDPOINT + + +func _on_line_edit_text_changed(new_text): + GameSettings.LOBBY_ENDPOINT = new_text + + +func _on_rich_text_label_meta_clicked(meta): + OS.shell_open(str(meta)) + + +func _on_line_edit_toggled(toggled_on): + GameSettings.dof_blur_changed.emit(toggled_on) + pass # Replace with function body. + + +func _on_camera_rotation_speed_value_changed(value): + GameSettings.camera_rotation_speed = value + pass # Replace with function body. + + +func _on_camera_movement_speed_value_changed(value): + GameSettings.camera_movement_speed = value + pass # Replace with function body. diff --git a/UI/Settings/Settings.tscn b/UI/Settings/Settings.tscn index bbe939c..eb0ad62 100644 --- a/UI/Settings/Settings.tscn +++ b/UI/Settings/Settings.tscn @@ -62,8 +62,10 @@ layout_mode = 2 [node name="TabContainer" type="TabContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 +current_tab = 2 [node name="General" type="PanelContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer"] +visible = false layout_mode = 2 [node name="MarginContainer" type="MarginContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General"] @@ -88,12 +90,19 @@ text = "Lobby Server URL" [node name="LineEdit" type="LineEdit" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General/MarginContainer/General/VBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +placeholder_text = "wss://dev.bytesandpieces.xyz:9088" -[node name="Button" type="Button" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General/MarginContainer/General/VBoxContainer"] +[node name="ResetLobbyURLButton" type="Button" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General/MarginContainer/General/VBoxContainer"] custom_minimum_size = Vector2(200, 0) layout_mode = 2 text = "Reset to default" +[node name="RichTextLabel" type="RichTextLabel" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General/MarginContainer/General"] +layout_mode = 2 +bbcode_enabled = true +text = "The lobby server is hosted on my dev server. In case it is not reachable, you may host your own instance via: [url]https://github.com/Sch1nken/GodotFlowfield[/url]" +fit_content = true + [node name="Graphics" type="PanelContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer"] visible = false layout_mode = 2 @@ -120,9 +129,9 @@ text = "Depth of Field Blur" [node name="LineEdit" type="CheckButton" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/General/VBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +button_pressed = true [node name="Controls" type="PanelContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer"] -visible = false layout_mode = 2 [node name="MarginContainer" type="MarginContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls"] @@ -144,9 +153,33 @@ custom_minimum_size = Vector2(200, 0) layout_mode = 2 text = "Camera Rotation Speed" -[node name="SpinBox" type="SpinBox" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls/MarginContainer/General/VBoxContainer"] +[node name="CameraRotationSpeed" type="SpinBox" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls/MarginContainer/General/VBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +min_value = 1.0 +max_value = 50.0 +value = 5.0 +allow_greater = true +allow_lesser = true +alignment = 2 + +[node name="VBoxContainer2" type="HBoxContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls/MarginContainer/General"] +layout_mode = 2 +theme_override_constants/separation = 15 + +[node name="Label" type="Label" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls/MarginContainer/General/VBoxContainer2"] +custom_minimum_size = Vector2(200, 0) +layout_mode = 2 +text = "Camera Move Speed" + +[node name="CameraMovementSpeed" type="SpinBox" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls/MarginContainer/General/VBoxContainer2"] +layout_mode = 2 +size_flags_horizontal = 3 +min_value = 10.0 +max_value = 2000.0 +value = 200.0 +allow_greater = true +allow_lesser = true alignment = 2 [node name="VBoxContainer" type="HBoxContainer" parent="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer"] @@ -162,4 +195,10 @@ layout_mode = 2 size_flags_horizontal = 3 text = "Cancel" +[connection signal="text_changed" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General/MarginContainer/General/VBoxContainer/LineEdit" to="." method="_on_line_edit_text_changed"] +[connection signal="pressed" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General/MarginContainer/General/VBoxContainer/ResetLobbyURLButton" to="." method="_on_reset_lobby_url_button_pressed"] +[connection signal="meta_clicked" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/General/MarginContainer/General/RichTextLabel" to="." method="_on_rich_text_label_meta_clicked"] +[connection signal="toggled" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Graphics/MarginContainer/General/VBoxContainer/LineEdit" to="." method="_on_line_edit_toggled"] +[connection signal="value_changed" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls/MarginContainer/General/VBoxContainer/CameraRotationSpeed" to="." method="_on_camera_rotation_speed_value_changed"] +[connection signal="value_changed" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/TabContainer/Controls/MarginContainer/General/VBoxContainer2/CameraMovementSpeed" to="." method="_on_camera_movement_speed_value_changed"] [connection signal="pressed" from="Pivot/MarginContainer/PanelContainer/MarginContainer/VBoxContainer/VBoxContainer/Cancel" to="." method="_on_cancel_pressed"] diff --git a/UI/main_menu.gd b/UI/main_menu.gd index 144ac90..1c85b4e 100644 --- a/UI/main_menu.gd +++ b/UI/main_menu.gd @@ -1,11 +1,13 @@ extends Control -@onready var exit_button = $PanelContainer/MarginContainer/VBoxContainer/ExitButton -@onready var lan_button = $PanelContainer/MarginContainer/VBoxContainer/LANButton +@onready var exit_button = $VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/ExitButton +@onready var lan_button = $VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/LANButton const SETTINGS = preload("res://UI/Settings/Settings.tscn") const RULES = preload("res://UI/Rules/Rules.tscn") +@onready var credits_panel = $CreditsPanel + # Called when the node enters the scene tree for the first time. func _ready() -> void: if OS.has_feature("web"): @@ -61,3 +63,8 @@ func _on_settings_button_pressed(): func _on_lan_button_pressed(): get_tree().change_scene_to_file("res://UI/Lobby/LANLobby.tscn") + + +func _on_credits_button_pressed(): + credits_panel.visible = true + pass # Replace with function body. diff --git a/UI/main_menu.tscn b/UI/main_menu.tscn index 98e3174..a271235 100644 --- a/UI/main_menu.tscn +++ b/UI/main_menu.tscn @@ -1,11 +1,15 @@ -[gd_scene load_steps=4 format=3 uid="uid://dogu37xma5vsp"] +[gd_scene load_steps=6 format=3 uid="uid://dogu37xma5vsp"] [ext_resource type="Script" path="res://UI/main_menu.gd" id="1_q3q3u"] [ext_resource type="Script" path="res://DisconnectInfo.gd" id="2_2fkdc"] +[ext_resource type="Script" path="res://UI/CreditsPanel.gd" id="3_16j20"] [sub_resource type="StyleBoxFlat" id="StyleBoxFlat_47fa1"] bg_color = Color(0, 0, 0, 1) +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_6jy8e"] +bg_color = Color(0.25098, 0.25098, 0.25098, 1) + [node name="MainMenu" type="Control"] layout_mode = 3 anchors_preset = 15 @@ -15,88 +19,104 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_q3q3u") -[node name="PanelContainer" type="PanelContainer" parent="."] -custom_minimum_size = Vector2(300, 0) +[node name="VBoxContainer" type="VBoxContainer" parent="."] layout_mode = 1 anchors_preset = 8 anchor_left = 0.5 anchor_top = 0.5 anchor_right = 0.5 anchor_bottom = 0.5 -offset_left = -62.0 -offset_top = -76.5 -offset_right = 62.0 -offset_bottom = 76.5 +offset_left = -161.5 +offset_top = -301.5 +offset_right = 161.5 +offset_bottom = 301.5 grow_horizontal = 2 grow_vertical = 2 -[node name="MarginContainer" type="MarginContainer" parent="PanelContainer"] +[node name="Label" type="Label" parent="VBoxContainer"] +layout_mode = 2 +theme_override_font_sizes/font_size = 32 +text = "" +horizontal_alignment = 1 + +[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer"] +custom_minimum_size = Vector2(300, 0) +layout_mode = 2 + +[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/PanelContainer"] layout_mode = 2 theme_override_constants/margin_left = 15 theme_override_constants/margin_top = 15 theme_override_constants/margin_right = 15 theme_override_constants/margin_bottom = 15 -[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/MarginContainer"] +[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/PanelContainer/MarginContainer"] layout_mode = 2 theme_override_constants/separation = 15 -[node name="Label2" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="Label2" type="Label" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 text = "Singleplayer" -[node name="HostButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="HostButton" type="Button" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] visible = false layout_mode = 2 text = "Host Game" -[node name="JoinButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="JoinButton" type="Button" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] visible = false layout_mode = 2 text = "Join Game" -[node name="SingleplayerButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="SingleplayerButton" type="Button" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 disabled = true text = "Singleplayer (vs AI)" -[node name="HSeparator2" type="HSeparator" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="HSeparator2" type="HSeparator" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 -[node name="Label" type="Label" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="Label" type="Label" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 text = "Multiplayer" -[node name="LocalButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="LocalButton" type="Button" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 text = "Local (Hotseat)" -[node name="OnlineButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="OnlineButton" type="Button" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 text = "Online" -[node name="LANButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="LANButton" type="Button" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 text = "LAN" -[node name="HSeparator" type="HSeparator" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="HSeparator" type="HSeparator" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 -[node name="RulesButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="RulesButton" type="Button" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 text = "Rules" -[node name="HSeparator4" type="HSeparator" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="HSeparator4" type="HSeparator" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 -[node name="SettingsButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="SettingsButton" type="Button" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 text = "Settings" -[node name="HSeparator3" type="HSeparator" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="HSeparator3" type="HSeparator" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 -[node name="ExitButton" type="Button" parent="PanelContainer/MarginContainer/VBoxContainer"] +[node name="CreditsButton" type="Button" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 +text = "Credits" + +[node name="HSeparator5" type="HSeparator" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] +layout_mode = 2 + +[node name="ExitButton" type="Button" parent="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer"] layout_mode = 2 text = "Exit" @@ -139,13 +159,141 @@ text = "#REASON#" layout_mode = 2 text = "Ok" -[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/HostButton" to="." method="_on_host_button_pressed"] -[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/JoinButton" to="." method="_on_join_button_pressed"] -[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/SingleplayerButton" to="." method="_on_rules_button_pressed"] -[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/LocalButton" to="." method="_on_local_button_pressed"] -[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/OnlineButton" to="." method="_on_online_button_pressed"] -[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/LANButton" to="." method="_on_lan_button_pressed"] -[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/RulesButton" to="." method="_on_rules_button_pressed"] -[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/SettingsButton" to="." method="_on_settings_button_pressed"] -[connection signal="pressed" from="PanelContainer/MarginContainer/VBoxContainer/ExitButton" to="." method="_on_exit_button_pressed"] +[node name="CreditsPanel" type="Control" parent="."] +visible = false +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -20.0 +offset_top = -20.0 +offset_right = 20.0 +offset_bottom = 20.0 +grow_horizontal = 2 +grow_vertical = 2 +script = ExtResource("3_16j20") + +[node name="PanelContainer" type="PanelContainer" parent="CreditsPanel"] +layout_mode = 1 +anchors_preset = 8 +anchor_left = 0.5 +anchor_top = 0.5 +anchor_right = 0.5 +anchor_bottom = 0.5 +offset_left = -300.0 +offset_top = -250.0 +offset_right = 300.0 +offset_bottom = 250.0 +grow_horizontal = 2 +grow_vertical = 2 +theme_override_styles/panel = SubResource("StyleBoxFlat_6jy8e") + +[node name="VBoxContainer" type="VBoxContainer" parent="CreditsPanel/PanelContainer"] +custom_minimum_size = Vector2(600, 500) +layout_mode = 2 + +[node name="ScrollContainer" type="ScrollContainer" parent="CreditsPanel/PanelContainer/VBoxContainer"] +layout_mode = 2 +size_flags_vertical = 3 + +[node name="GridContainer" type="GridContainer" parent="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer"] +custom_minimum_size = Vector2(600, 400) +layout_mode = 2 +theme_override_constants/v_separation = 15 +columns = 2 + +[node name="Label" type="Label" parent="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 5 +text = "Gen42 for their amazing game" + +[node name="RichTextLabel" type="RichTextLabel" parent="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +size_flags_horizontal = 3 +bbcode_enabled = true +text = "[url]https://www.gen42.com/games/hive[/url]" +fit_content = true + +[node name="Label3" type="Label" parent="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 5 +text = "HexGrid Godot 4 by HugoEnzo" + +[node name="RichTextLabel3" type="RichTextLabel" parent="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +size_flags_horizontal = 3 +bbcode_enabled = true +text = "[url]https://github.com/HugoEnzo/HexGrid_Godot_4.0[/url]" +fit_content = true + +[node name="Label5" type="Label" parent="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 5 +text = "Amit Patel's Hex Guide at RedBlobGames" + +[node name="RichTextLabel5" type="RichTextLabel" parent="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +size_flags_horizontal = 3 +bbcode_enabled = true +text = "[url]https://www.redblobgames.com/grids/hexagons/[/url]" +fit_content = true + +[node name="Label4" type="Label" parent="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 5 +text = "Insect Icons by Gigbrinus / Nikoichu" + +[node name="RichTextLabel4" type="RichTextLabel" parent="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +size_flags_horizontal = 3 +bbcode_enabled = true +text = "[url]https://www.thingiverse.com/thing:1745592/comments[/url] + +[url]https://www.dropbox.com/scl/fi/8c9ieihtd7c516lxvd2lx/SwarmPieces.svg?rlkey=wtitgasojb6zdir1g22wmgib9&dl=0[/url]" +fit_content = true + +[node name="Label2" type="Label" parent="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 5 +text = "Wooden Table Texture from Poly Haven" + +[node name="RichTextLabel2" type="RichTextLabel" parent="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer"] +custom_minimum_size = Vector2(100, 0) +layout_mode = 2 +size_flags_horizontal = 3 +bbcode_enabled = true +text = "[url]https://polyhaven.com/a/wood_table_001[/url]" +fit_content = true + +[node name="CloseButton" type="Button" parent="CreditsPanel/PanelContainer/VBoxContainer"] +layout_mode = 2 +text = "Close" + +[connection signal="pressed" from="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/HostButton" to="." method="_on_host_button_pressed"] +[connection signal="pressed" from="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/JoinButton" to="." method="_on_join_button_pressed"] +[connection signal="pressed" from="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/SingleplayerButton" to="." method="_on_rules_button_pressed"] +[connection signal="pressed" from="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/LocalButton" to="." method="_on_local_button_pressed"] +[connection signal="pressed" from="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/OnlineButton" to="." method="_on_online_button_pressed"] +[connection signal="pressed" from="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/LANButton" to="." method="_on_lan_button_pressed"] +[connection signal="pressed" from="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/RulesButton" to="." method="_on_rules_button_pressed"] +[connection signal="pressed" from="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/SettingsButton" to="." method="_on_settings_button_pressed"] +[connection signal="pressed" from="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/CreditsButton" to="." method="_on_credits_button_pressed"] +[connection signal="pressed" from="VBoxContainer/PanelContainer/MarginContainer/VBoxContainer/ExitButton" to="." method="_on_exit_button_pressed"] [connection signal="pressed" from="DisconnectInfo/PanelContainer/MarginContainer/VBoxContainer/Button" to="DisconnectInfo" method="_on_button_pressed"] +[connection signal="meta_clicked" from="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer/RichTextLabel" to="CreditsPanel" method="_on_rich_text_label_meta_clicked"] +[connection signal="meta_clicked" from="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer/RichTextLabel3" to="CreditsPanel" method="_on_rich_text_label_meta_clicked"] +[connection signal="meta_clicked" from="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer/RichTextLabel5" to="CreditsPanel" method="_on_rich_text_label_meta_clicked"] +[connection signal="meta_clicked" from="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer/RichTextLabel4" to="CreditsPanel" method="_on_rich_text_label_meta_clicked"] +[connection signal="meta_clicked" from="CreditsPanel/PanelContainer/VBoxContainer/ScrollContainer/GridContainer/RichTextLabel2" to="CreditsPanel" method="_on_rich_text_label_meta_clicked"] +[connection signal="pressed" from="CreditsPanel/PanelContainer/VBoxContainer/CloseButton" to="CreditsPanel" method="_on_close_button_pressed"] diff --git a/WorldEnvSettings.gd b/WorldEnvSettings.gd new file mode 100644 index 0000000..47471bb --- /dev/null +++ b/WorldEnvSettings.gd @@ -0,0 +1,20 @@ +extends WorldEnvironment + + +# Called when the node enters the scene tree for the first time. +func _ready(): + GameSettings.dof_blur_changed.connect(_on_dof_blur_changed) + var ca: CameraAttributes = camera_attributes + ca.dof_blur_far_enabled = GameSettings.dof_blur_enabled + ca.dof_blur_near_enabled = GameSettings.dof_blur_enabled + +func _on_dof_blur_changed(enabled: bool) -> void: + var ca: CameraAttributes = camera_attributes + ca.dof_blur_far_enabled = enabled + ca.dof_blur_near_enabled = enabled + pass + + +# Called every frame. 'delta' is the elapsed time since the previous frame. +func _process(delta): + pass