diff options
author | Hop311 <hop3114@gmail.com> | 2023-04-09 12:00:15 +0200 |
---|---|---|
committer | Hop311 <hop3114@gmail.com> | 2023-04-09 12:00:15 +0200 |
commit | 55723c35dfbcf9445873724906f8e3c448b6689f (patch) | |
tree | f438530315fb0a39d4b063bde800ba71dc16b7aa | |
parent | 5e5efa8a3d693f8e39f91f08e24832d08e2695bb (diff) |
Moved assets to R/art/
-rw-r--r-- | game/art/terrain/terrain.png (renamed from game/common/map/terrain/terrain.png) | bin | 27542091 -> 27542091 bytes | |||
-rw-r--r-- | game/art/terrain/terrain.png.import (renamed from game/common/map/terrain/terrain.png.import) | 6 | ||||
-rw-r--r-- | game/art/ui/minimap.png (renamed from game/common/map/minimap.png) | bin | 69018 -> 69018 bytes | |||
-rw-r--r-- | game/art/ui/minimap.png.import (renamed from game/common/map/minimap.png.import) | 6 | ||||
-rw-r--r-- | game/art/ui/minimap_frame.png (renamed from game/common/map/MapFrame.png) | bin | 1043 -> 1043 bytes | |||
-rw-r--r-- | game/art/ui/minimap_frame.png.import (renamed from game/common/map/MapFrame.png.import) | 6 | ||||
-rw-r--r-- | game/src/GameSession/GameSession.tscn | 13 | ||||
-rw-r--r-- | game/src/GameSession/MapView.tscn | 2 | ||||
-rw-r--r-- | game/src/GameSession/Minimap.gd | 18 | ||||
-rw-r--r-- | game/src/GameSession/RectangularCamera.gd | 17 |
10 files changed, 34 insertions, 34 deletions
diff --git a/game/common/map/terrain/terrain.png b/game/art/terrain/terrain.png Binary files differindex 6d36dee..6d36dee 100644 --- a/game/common/map/terrain/terrain.png +++ b/game/art/terrain/terrain.png diff --git a/game/common/map/terrain/terrain.png.import b/game/art/terrain/terrain.png.import index 56ba5dc..2642176 100644 --- a/game/common/map/terrain/terrain.png.import +++ b/game/art/terrain/terrain.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://cmw0pvjthnn8c" -path="res://.godot/imported/terrain.png-c443b8a709ca7acc4b3bb3df1d3095a9.ctex" +path="res://.godot/imported/terrain.png-06c63c2b87b3131a2067f668f87a9d67.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://common/map/terrain/terrain.png" -dest_files=["res://.godot/imported/terrain.png-c443b8a709ca7acc4b3bb3df1d3095a9.ctex"] +source_file="res://art/terrain/terrain.png" +dest_files=["res://.godot/imported/terrain.png-06c63c2b87b3131a2067f668f87a9d67.ctex"] [params] diff --git a/game/common/map/minimap.png b/game/art/ui/minimap.png Binary files differindex 9e5bdb6..9e5bdb6 100644 --- a/game/common/map/minimap.png +++ b/game/art/ui/minimap.png diff --git a/game/common/map/minimap.png.import b/game/art/ui/minimap.png.import index c69c844..31da5f0 100644 --- a/game/common/map/minimap.png.import +++ b/game/art/ui/minimap.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://c0sm1jfu4kyv3" -path="res://.godot/imported/minimap.png-6dff941a6fa3e94c55113971bbb32fcf.ctex" +path="res://.godot/imported/minimap.png-05ee44469856e77fd05107fe9e259e25.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://common/map/minimap.png" -dest_files=["res://.godot/imported/minimap.png-6dff941a6fa3e94c55113971bbb32fcf.ctex"] +source_file="res://art/ui/minimap.png" +dest_files=["res://.godot/imported/minimap.png-05ee44469856e77fd05107fe9e259e25.ctex"] [params] diff --git a/game/common/map/MapFrame.png b/game/art/ui/minimap_frame.png Binary files differindex 21aa2ce..21aa2ce 100644 --- a/game/common/map/MapFrame.png +++ b/game/art/ui/minimap_frame.png diff --git a/game/common/map/MapFrame.png.import b/game/art/ui/minimap_frame.png.import index 04756cc..6db81bc 100644 --- a/game/common/map/MapFrame.png.import +++ b/game/art/ui/minimap_frame.png.import @@ -3,15 +3,15 @@ importer="texture" type="CompressedTexture2D" uid="uid://vr1hq2stk8ny" -path="res://.godot/imported/MapFrame.png-a4cf5a3479e19f337ce338f6f6ee4eb8.ctex" +path="res://.godot/imported/minimap_frame.png-3668393435d2582fb1dc8a9598573e80.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://common/map/MapFrame.png" -dest_files=["res://.godot/imported/MapFrame.png-a4cf5a3479e19f337ce338f6f6ee4eb8.ctex"] +source_file="res://art/ui/minimap_frame.png" +dest_files=["res://.godot/imported/minimap_frame.png-3668393435d2582fb1dc8a9598573e80.ctex"] [params] diff --git a/game/src/GameSession/GameSession.tscn b/game/src/GameSession/GameSession.tscn index 73259b4..ca24256 100644 --- a/game/src/GameSession/GameSession.tscn +++ b/game/src/GameSession/GameSession.tscn @@ -4,10 +4,10 @@ [ext_resource type="PackedScene" uid="uid://g524p8lr574w" path="res://src/GameSession/MapControlPanel.tscn" id="3_afh6d"] [ext_resource type="PackedScene" uid="uid://dvdynl6eir40o" path="res://src/GameSession/GameSessionMenu.tscn" id="3_bvmqh"] [ext_resource type="PackedScene" uid="uid://dkehmdnuxih2r" path="res://src/GameSession/MapView.tscn" id="4_xkg5j"] -[ext_resource type="Texture2D" uid="uid://c0sm1jfu4kyv3" path="res://common/map/minimap.png" id="5_l05wo"] +[ext_resource type="Texture2D" uid="uid://c0sm1jfu4kyv3" path="res://art/ui/minimap.png" id="5_l05wo"] [ext_resource type="PackedScene" uid="uid://byq323jbel48u" path="res://src/GameSession/ProvinceOverviewPanel.tscn" id="5_osjnn"] -[ext_resource type="Texture2D" uid="uid://vr1hq2stk8ny" path="res://common/map/MapFrame.png" id="6_ujbv2"] -[ext_resource type="Script" path="res://src/GameSession/RectangularCamera.gd" id="7_go8y3"] +[ext_resource type="Texture2D" uid="uid://vr1hq2stk8ny" path="res://art/ui/minimap_frame.png" id="6_ujbv2"] +[ext_resource type="Script" path="res://src/GameSession/Minimap.gd" id="7_go8y3"] [node name="GameSession" type="Node" node_paths=PackedStringArray("_game_session_menu")] editor_description = "SS-102" @@ -52,12 +52,13 @@ offset_right = 350.0 offset_bottom = 175.0 texture = ExtResource("5_l05wo") -[node name="RectangularCamera" type="Control" parent="Minimap"] +[node name="RectangularCamera" type="Control" parent="Minimap" node_paths=PackedStringArray("_background")] anchors_preset = 0 offset_right = 40.0 offset_bottom = 40.0 mouse_filter = 2 script = ExtResource("7_go8y3") +_background = NodePath("../TextureRect") [node name="Frame" type="NinePatchRect" parent="Minimap"] layout_mode = 1 @@ -81,9 +82,7 @@ anchor_right = 0.15625 offset_top = 0.0 offset_right = 0.0 -[connection signal="map_view_camera_changed" from="MapView" to="Minimap/RectangularCamera" method="_on_map_view_map_view_camera_changed"] +[connection signal="map_view_camera_changed" from="MapView" to="Minimap/RectangularCamera" method="_on_camera_view_changed"] [connection signal="province_selected" from="MapView" to="ProvinceOverviewPanel" method="_on_province_selected"] [connection signal="close_button_pressed" from="GameSessionMenu" to="." method="_on_game_session_menu_close_button_pressed"] [connection signal="game_session_menu_button_pressed" from="MapControlPanel" to="." method="_on_game_session_menu_button_pressed"] -[connection signal="mouse_entered" from="Minimap" to="Minimap" method="_on_mouse_entered"] -[connection signal="mouse_exited" from="Minimap" to="Minimap" method="_on_mouse_exited"] diff --git a/game/src/GameSession/MapView.tscn b/game/src/GameSession/MapView.tscn index 2df06fb..f4f3a9e 100644 --- a/game/src/GameSession/MapView.tscn +++ b/game/src/GameSession/MapView.tscn @@ -2,7 +2,7 @@ [ext_resource type="Script" path="res://src/GameSession/MapView.gd" id="1_exccw"] [ext_resource type="Shader" path="res://src/GameSession/TerrainMap.gdshader" id="1_upocn"] -[ext_resource type="Texture2D" uid="uid://cmw0pvjthnn8c" path="res://common/map/terrain/terrain.png" id="3_l8pnf"] +[ext_resource type="Texture2D" uid="uid://cmw0pvjthnn8c" path="res://art/terrain/terrain.png" id="3_l8pnf"] [sub_resource type="ShaderMaterial" id="ShaderMaterial_tayeg"] render_priority = 0 diff --git a/game/src/GameSession/Minimap.gd b/game/src/GameSession/Minimap.gd new file mode 100644 index 0000000..dcfc343 --- /dev/null +++ b/game/src/GameSession/Minimap.gd @@ -0,0 +1,18 @@ +extends Control + +@export var _background : TextureRect + +var _viewport_points : PackedVector2Array + +func _draw() -> void: + if _viewport_points.size() > 1: + draw_polyline(_viewport_points, Color.WHITE, -1) + +func _on_camera_view_changed(near_left : Vector2, far_left : Vector2, far_right : Vector2, near_right : Vector2) -> void: + _viewport_points.clear() + _viewport_points.push_back(near_left * _background.size) + _viewport_points.push_back(far_left * _background.size) + _viewport_points.push_back(far_right * _background.size) + _viewport_points.push_back(near_right * _background.size) + _viewport_points.push_back(_viewport_points[0]) + queue_redraw() diff --git a/game/src/GameSession/RectangularCamera.gd b/game/src/GameSession/RectangularCamera.gd deleted file mode 100644 index bc7ca1e..0000000 --- a/game/src/GameSession/RectangularCamera.gd +++ /dev/null @@ -1,17 +0,0 @@ -extends Control - -@onready var _frame : TextureRect = $"../TextureRect" -var _viewport_points : PackedVector2Array - -func _draw() -> void: - if _viewport_points.size() > 1: - draw_polyline(_viewport_points, Color.WHITE, -1) - -func _on_map_view_map_view_camera_changed(near_left : Vector2, far_left : Vector2, far_right : Vector2, near_right : Vector2) -> void: - _viewport_points.clear() - _viewport_points.push_back(near_left * _frame.size) - _viewport_points.push_back(far_left * _frame.size) - _viewport_points.push_back(far_right * _frame.size) - _viewport_points.push_back(near_right * _frame.size) - _viewport_points.push_back(_viewport_points[0]) - queue_redraw() |