aboutsummaryrefslogtreecommitdiff
path: root/game/src
diff options
context:
space:
mode:
author Hop311 <hop3114@gmail.com>2023-04-11 21:28:18 +0200
committer Hop311 <hop3114@gmail.com>2023-04-11 21:28:18 +0200
commit7a84dc859a991ebb385df205a6d74b5de8ec6980 (patch)
tree6bf237f3efbeab1d2e9ddab5f563610ee6d6d20c /game/src
parent51dcd0c3e205c80d57da2e3d702cb612b77f4411 (diff)
Added requirement comments
Diffstat (limited to 'game/src')
-rw-r--r--game/src/Autoload/Events.gd2
-rw-r--r--game/src/GameSession/GameSession.tscn2
-rw-r--r--game/src/GameSession/MapControlPanel.gd5
-rw-r--r--game/src/GameSession/MapControlPanel.tscn3
-rw-r--r--game/src/GameSession/MapView.gd11
-rw-r--r--game/src/GameSession/MapView.tscn2
-rw-r--r--game/src/GameSession/Minimap.gd6
-rw-r--r--game/src/GameSession/ProvinceOverviewPanel.tscn2
8 files changed, 32 insertions, 1 deletions
diff --git a/game/src/Autoload/Events.gd b/game/src/Autoload/Events.gd
index c2f96d5..f4aac70 100644
--- a/game/src/Autoload/Events.gd
+++ b/game/src/Autoload/Events.gd
@@ -7,6 +7,8 @@ const _province_identifier_file : String = "res://common/map/provinces.json"
const _region_file : String = "res://common/map/regions.json"
const _province_shape_file : String = "res://common/map/provinces.png"
+# REQUIREMENTS
+# * FS-333, FS-335, FS-341
func _ready():
if MapSingleton.load_province_identifier_file(_province_identifier_file) != OK:
push_error("Failed to load province identifiers")
diff --git a/game/src/GameSession/GameSession.tscn b/game/src/GameSession/GameSession.tscn
index bba5671..e270f8a 100644
--- a/game/src/GameSession/GameSession.tscn
+++ b/game/src/GameSession/GameSession.tscn
@@ -7,7 +7,7 @@
[ext_resource type="PackedScene" uid="uid://byq323jbel48u" path="res://src/GameSession/ProvinceOverviewPanel.tscn" id="5_osjnn"]
[node name="GameSession" type="Node" node_paths=PackedStringArray("_game_session_menu")]
-editor_description = "SS-102"
+editor_description = "SS-102, UI-546"
script = ExtResource("1_eklvp")
_game_session_menu = NodePath("GameSessionMenu")
diff --git a/game/src/GameSession/MapControlPanel.gd b/game/src/GameSession/MapControlPanel.gd
index fb4f161..693890f 100644
--- a/game/src/GameSession/MapControlPanel.gd
+++ b/game/src/GameSession/MapControlPanel.gd
@@ -9,6 +9,8 @@ signal minimap_clicked(pos_clicked : Vector2)
var _mapmode_button_group : ButtonGroup
+# REQUIREMENTS:
+# * UI-550, UI-554
func _add_mapmode_button(identifier : String) -> void:
var button := Button.new()
button.text = identifier
@@ -30,6 +32,9 @@ func _ready():
func _on_game_session_menu_button_pressed() -> void:
game_session_menu_button_pressed.emit()
+# REQUIREMENTS:
+# * SS-76
+# * UIFUN-129, UIFUN-133
func _mapmode_pressed(button : BaseButton) -> void:
MapSingleton.set_mapmode(button.tooltip_text)
mapmode_changed.emit()
diff --git a/game/src/GameSession/MapControlPanel.tscn b/game/src/GameSession/MapControlPanel.tscn
index b76af10..70d7eab 100644
--- a/game/src/GameSession/MapControlPanel.tscn
+++ b/game/src/GameSession/MapControlPanel.tscn
@@ -25,14 +25,17 @@ alignment = 2
layout_mode = 2
[node name="MapmodesGrid" type="GridContainer" parent="HBoxContainer/VBoxContainer"]
+editor_description = "UI-750"
layout_mode = 2
columns = 11
[node name="Minimap" type="PanelContainer" parent="HBoxContainer/VBoxContainer"]
+editor_description = "UI-549"
layout_mode = 2
mouse_filter = 1
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/VBoxContainer/Minimap"]
+editor_description = "UI-751, FS-338"
layout_mode = 2
texture = ExtResource("2_r613r")
diff --git a/game/src/GameSession/MapView.gd b/game/src/GameSession/MapView.gd
index fc13b07..05e77fa 100644
--- a/game/src/GameSession/MapView.gd
+++ b/game/src/GameSession/MapView.gd
@@ -137,6 +137,8 @@ func _viewport_to_map_coords(pos_viewport : Vector2) -> Vector2:
push_error("Invalid intersection: ", intersection)
return Vector2(0.5, 0.5)
+# REQUIREMENTS
+# * SS-31
func _unhandled_input(event : InputEvent):
if event.is_action_pressed(_action_click):
# Check if the mouse is outside of bounds
@@ -177,6 +179,8 @@ func _physics_process(delta : float):
# Calculate where the mouse lies on the map
_update_mouse_map_position()
+# REQUIREMENTS
+# * UIFUN-124
func _movement_process(delta : float) -> void:
var direction : Vector2
if _drag_active:
@@ -187,6 +191,8 @@ func _movement_process(delta : float) -> void:
direction *= _camera.position.y * delta
_camera.position += Vector3(direction.x, 0, direction.y)
+# REQUIREMENTS
+# * UIFUN-125
func _edge_scrolling_vector() -> Vector2:
if not _mouse_over_viewport:
return Vector2()
@@ -195,6 +201,8 @@ func _edge_scrolling_vector() -> Vector2:
mouse_vector *= 0
return mouse_vector * _edge_move_speed
+# REQUIREMENTS
+# * SS-75
func _cardinal_movement_vector() -> Vector2:
var move := Vector2(
float(Input.is_action_pressed(_action_east)) - float(Input.is_action_pressed(_action_west)),
@@ -206,6 +214,9 @@ func _clamp_over_map() -> void:
_camera.position.x = _map_mesh_corner.x + fposmod(_camera.position.x - _map_mesh_corner.x, _map_mesh_dims.x)
_camera.position.z = clamp(_camera.position.z, _map_mesh_corner.y, _map_mesh_corner.y + _map_mesh_dims.y)
+# REQUIREMENTS
+# * SS-74
+# * UIFUN-123
func _zoom_process(delta : float) -> void:
var height := _camera.position.y
var zoom := _zoom_target - height
diff --git a/game/src/GameSession/MapView.tscn b/game/src/GameSession/MapView.tscn
index b48617a..93fc162 100644
--- a/game/src/GameSession/MapView.tscn
+++ b/game/src/GameSession/MapView.tscn
@@ -14,6 +14,7 @@ shader_parameter/terrain_tex = ExtResource("3_l8pnf")
[sub_resource type="MapMesh" id="MapMesh_3gtsd"]
[node name="MapView" type="Node3D" node_paths=PackedStringArray("_camera", "_map_mesh_instance")]
+editor_description = "SS-73"
script = ExtResource("1_exccw")
_camera = NodePath("MapCamera")
_map_mesh_instance = NodePath("MapMeshInstance")
@@ -22,6 +23,7 @@ _map_mesh_instance = NodePath("MapMeshInstance")
transform = Transform3D(1, 0, 0, 0, 0.707107, 0.707107, 0, -0.707107, 0.707107, 0.25, 1.5, -2.75)
[node name="MapMeshInstance" type="MeshInstance3D" parent="."]
+editor_description = "FS-343"
transform = Transform3D(10, 0, 0, 0, 10, 0, 0, 0, 10, 0, 0, 0)
material_override = SubResource("ShaderMaterial_tayeg")
mesh = SubResource("MapMesh_3gtsd")
diff --git a/game/src/GameSession/Minimap.gd b/game/src/GameSession/Minimap.gd
index 7c02698..d633fdf 100644
--- a/game/src/GameSession/Minimap.gd
+++ b/game/src/GameSession/Minimap.gd
@@ -6,10 +6,16 @@ const _action_click : StringName = &"map_click"
var _viewport_points : PackedVector2Array
+# REQUIREMENTS
+# * SS-80
+# * UI-752
func _draw() -> void:
if _viewport_points.size() > 1:
draw_multiline(_viewport_points, Color.WHITE, -1)
+# REQUIREMENTS
+# * SS-81
+# * UIFUN-127
func _unhandled_input(event : InputEvent):
if event is InputEventMouseMotion and Input.is_action_pressed(_action_click):
var pos_clicked := get_local_mouse_position() / size - Vector2(0.5, 0.5)
diff --git a/game/src/GameSession/ProvinceOverviewPanel.tscn b/game/src/GameSession/ProvinceOverviewPanel.tscn
index e21b1c3..2df95fb 100644
--- a/game/src/GameSession/ProvinceOverviewPanel.tscn
+++ b/game/src/GameSession/ProvinceOverviewPanel.tscn
@@ -3,6 +3,7 @@
[ext_resource type="Script" path="res://src/GameSession/ProvinceOverviewPanel.gd" id="1_3n8k5"]
[node name="ProvinceOverviewPanel" type="Panel" node_paths=PackedStringArray("_province_name_label")]
+editor_description = "UI-56"
anchors_preset = 2
anchor_top = 1.0
anchor_bottom = 1.0
@@ -23,6 +24,7 @@ offset_right = -10.0
offset_bottom = -5.0
[node name="ProvinceName" type="Label" parent="VBoxContainer"]
+editor_description = "UI-57"
layout_mode = 2
text = "PROVINCE_NAME"
vertical_alignment = 1