aboutsummaryrefslogtreecommitdiff
path: root/game/src/Game/GameSession
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-07-21 18:02:38 +0200
committer GitHub <noreply@github.com>2023-07-21 18:02:38 +0200
commit40e412da4a11de97dda041287e306ca285c50ccf (patch)
treea0b28dffaba50d351cab1619f54516be23d2aa6f /game/src/Game/GameSession
parentf3f240853b15a9f9b7cb561dc6626e7f342c5c74 (diff)
parent62d001b0fa209f259440e160503dc5ffe5bcaa8f (diff)
Merge pull request #142 from OpenVicProject/tidying
Tidying: missing req comments, submodules, hotkeys, user data folder
Diffstat (limited to 'game/src/Game/GameSession')
-rw-r--r--game/src/Game/GameSession/GameSession.gd2
-rw-r--r--game/src/Game/GameSession/GameSpeedPanel.gd10
-rw-r--r--game/src/Game/GameSession/GameSpeedPanel.tscn27
-rw-r--r--game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd2
-rw-r--r--game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd2
5 files changed, 37 insertions, 6 deletions
diff --git a/game/src/Game/GameSession/GameSession.gd b/game/src/Game/GameSession/GameSession.gd
index 5bb1c2f..2a27e3d 100644
--- a/game/src/Game/GameSession/GameSession.gd
+++ b/game/src/Game/GameSession/GameSession.gd
@@ -7,7 +7,7 @@ func _ready():
if GameSingleton.setup_game() != OK:
push_error("Failed to setup game")
-func _process(delta : float):
+func _process(_delta : float):
GameSingleton.try_tick()
# REQUIREMENTS:
diff --git a/game/src/Game/GameSession/GameSpeedPanel.gd b/game/src/Game/GameSession/GameSpeedPanel.gd
index 80708b1..6a4b4de 100644
--- a/game/src/Game/GameSession/GameSpeedPanel.gd
+++ b/game/src/Game/GameSession/GameSpeedPanel.gd
@@ -1,6 +1,7 @@
extends PanelContainer
-#UI-74 UI-75 UI-76 UI-77
+# REQUIREMENTS:
+# * SS-37, SS-38, SS-39
@export var _longform_date_button : Button
@export var _play_pause_display_button : Button
@@ -19,15 +20,20 @@ func _update_buttons():
_longform_date_button.text = GameSingleton.get_longform_date()
-
+# REQUIREMENTS:
+# * UIFUN-73
func _on_decrease_speed_button_pressed():
GameSingleton.decrease_speed()
_update_buttons()
+# REQUIREMENTS:
+# * UIFUN-72
func _on_increase_speed_button_pressed():
GameSingleton.increase_speed()
_update_buttons()
+# REQUIREMENTS:
+# * UIFUN-71
func _on_play_pause_display_button_pressed():
GameSingleton.toggle_paused()
_update_buttons()
diff --git a/game/src/Game/GameSession/GameSpeedPanel.tscn b/game/src/Game/GameSession/GameSpeedPanel.tscn
index 2ce5042..5526427 100644
--- a/game/src/Game/GameSession/GameSpeedPanel.tscn
+++ b/game/src/Game/GameSession/GameSpeedPanel.tscn
@@ -1,7 +1,25 @@
-[gd_scene load_steps=2 format=3 uid="uid://dd8k3p7r3huwc"]
+[gd_scene load_steps=8 format=3 uid="uid://dd8k3p7r3huwc"]
[ext_resource type="Script" path="res://src/Game/GameSession/GameSpeedPanel.gd" id="1_pfs8t"]
+[sub_resource type="InputEventAction" id="InputEventAction_3k1tl"]
+action = &"time_pause"
+
+[sub_resource type="Shortcut" id="Shortcut_cg5xm"]
+events = [SubResource("InputEventAction_3k1tl")]
+
+[sub_resource type="InputEventAction" id="InputEventAction_w2rkb"]
+action = &"time_speed_decrease"
+
+[sub_resource type="Shortcut" id="Shortcut_ocrfe"]
+events = [SubResource("InputEventAction_w2rkb")]
+
+[sub_resource type="InputEventAction" id="InputEventAction_7sdhp"]
+action = &"time_speed_increase"
+
+[sub_resource type="Shortcut" id="Shortcut_gwofc"]
+events = [SubResource("InputEventAction_7sdhp")]
+
[node name="GameSpeedPanel" type="PanelContainer" node_paths=PackedStringArray("_longform_date_button", "_play_pause_display_button", "_decrease_speed_button", "_increase_speed_button")]
script = ExtResource("1_pfs8t")
_longform_date_button = NodePath("ButtonList/LongformDateButton")
@@ -13,27 +31,34 @@ _increase_speed_button = NodePath("ButtonList/IncreaseSpeedButton")
layout_mode = 2
[node name="LongformDateButton" type="Button" parent="ButtonList"]
+editor_description = "UI-74"
custom_minimum_size = Vector2(200, 0)
layout_mode = 2
focus_mode = 0
text = "LONGFORM DATE"
[node name="PlayPauseDisplayButton" type="Button" parent="ButtonList"]
+editor_description = "UI-75, UIFUN-90"
custom_minimum_size = Vector2(30, 0)
layout_mode = 2
focus_mode = 0
+shortcut = SubResource("Shortcut_cg5xm")
text = "⏸ "
[node name="DecreaseSpeedButton" type="Button" parent="ButtonList"]
+editor_description = "UI-77"
custom_minimum_size = Vector2(30, 0)
layout_mode = 2
focus_mode = 0
+shortcut = SubResource("Shortcut_ocrfe")
text = "-"
[node name="IncreaseSpeedButton" type="Button" parent="ButtonList"]
+editor_description = "UI-76"
custom_minimum_size = Vector2(30, 0)
layout_mode = 2
focus_mode = 0
+shortcut = SubResource("Shortcut_gwofc")
text = "+"
[connection signal="pressed" from="ButtonList/LongformDateButton" to="." method="_on_longform_date_label_pressed"]
diff --git a/game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd b/game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd
index 01e6623..c84f116 100644
--- a/game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd
+++ b/game/src/Game/GameSession/MapControlPanel/MapControlPanel.gd
@@ -37,7 +37,7 @@ func _on_game_session_menu_button_pressed() -> void:
# REQUIREMENTS:
# * SS-76
-# * UIFUN-129, UIFUN-131, UIFUN-133
+# * UIFUN-129, UIFUN-131, UIFUN-133, UIFUN-140
func _mapmode_pressed(button : BaseButton) -> void:
GameSingleton.set_mapmode(button.tooltip_text)
diff --git a/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd b/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
index 758c24b..13418b6 100644
--- a/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
+++ b/game/src/Game/GameSession/ProvinceOverviewPanel/ProvinceOverviewPanel.gd
@@ -44,7 +44,7 @@ var _building_rows : Array[Dictionary]
# * UI-191, UI-193, UI-194, UI-766, UI-195, UI-196, UI-197
# * UI-199, UI-201, UI-202, UI-767, UI-203, UI-204, UI-205
func _add_building_row() -> void:
- var row : Dictionary
+ var row : Dictionary = {}
row.level = Label.new()
row.level.text = "X"