diff options
Diffstat (limited to 'game/src/Game')
12 files changed, 123 insertions, 7 deletions
diff --git a/game/src/Game/GameSession/MainManagamentPanel/BudgetPanel.gd b/game/src/Game/GameSession/MainManagamentPanel/BudgetPanel.gd index ba72a01..6a3a3ea 100644 --- a/game/src/Game/GameSession/MainManagamentPanel/BudgetPanel.gd +++ b/game/src/Game/GameSession/MainManagamentPanel/BudgetPanel.gd @@ -1,6 +1,7 @@ extends Button -var Pan = load("res://src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn") +var PopPanel = load("res://src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn") func _on_pressed(): - var spawn = Pan.instantiate() + var spawn = PopPanel.instantiate() + spawn.PanelName = "EXAMPLE_POPUP_BUDGET" $"../../..".add_child(spawn) # Spawning window on MainManagamentPanel diff --git a/game/src/Game/GameSession/MainManagamentPanel/CountryPanel.gd b/game/src/Game/GameSession/MainManagamentPanel/CountryPanel.gd new file mode 100644 index 0000000..c4e3eb6 --- /dev/null +++ b/game/src/Game/GameSession/MainManagamentPanel/CountryPanel.gd @@ -0,0 +1,7 @@ +extends Button +var PopPanel = load("res://src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn") + +func _on_pressed(): + var spawn = PopPanel.instantiate() + spawn.PanelName = "EXAMPLE_POPUP" + $"../../..".add_child(spawn) # Spawning window on MainManagamentPanel diff --git a/game/src/Game/GameSession/MainManagamentPanel/DiplomacyPanel.gd b/game/src/Game/GameSession/MainManagamentPanel/DiplomacyPanel.gd new file mode 100644 index 0000000..c4e3eb6 --- /dev/null +++ b/game/src/Game/GameSession/MainManagamentPanel/DiplomacyPanel.gd @@ -0,0 +1,7 @@ +extends Button +var PopPanel = load("res://src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn") + +func _on_pressed(): + var spawn = PopPanel.instantiate() + spawn.PanelName = "EXAMPLE_POPUP" + $"../../..".add_child(spawn) # Spawning window on MainManagamentPanel diff --git a/game/src/Game/GameSession/MainManagamentPanel/MainManagamentPanel.tscn b/game/src/Game/GameSession/MainManagamentPanel/MainManagamentPanel.tscn index abe720e..0eb9730 100644 --- a/game/src/Game/GameSession/MainManagamentPanel/MainManagamentPanel.tscn +++ b/game/src/Game/GameSession/MainManagamentPanel/MainManagamentPanel.tscn @@ -1,6 +1,14 @@ -[gd_scene load_steps=2 format=3 uid="uid://cyr5e31ucu44d"] +[gd_scene load_steps=10 format=3 uid="uid://cyr5e31ucu44d"] [ext_resource type="Script" path="res://src/Game/GameSession/MainManagamentPanel/BudgetPanel.gd" id="1_5jsre"] +[ext_resource type="Script" path="res://src/Game/GameSession/MainManagamentPanel/ProductionPanel.gd" id="1_7nvhi"] +[ext_resource type="Script" path="res://src/Game/GameSession/MainManagamentPanel/TechnologyPanel.gd" id="3_i0cql"] +[ext_resource type="Script" path="res://src/Game/GameSession/MainManagamentPanel/PoliticsPanel.gd" id="4_b1w56"] +[ext_resource type="Script" path="res://src/Game/GameSession/MainManagamentPanel/PopulationPanel.gd" id="5_e3kg5"] +[ext_resource type="Script" path="res://src/Game/GameSession/MainManagamentPanel/TradePanel.gd" id="6_lrvon"] +[ext_resource type="Script" path="res://src/Game/GameSession/MainManagamentPanel/DiplomacyPanel.gd" id="7_4ixxg"] +[ext_resource type="Script" path="res://src/Game/GameSession/MainManagamentPanel/MilitaryPanel.gd" id="8_oxtyy"] +[ext_resource type="Script" path="res://src/Game/GameSession/MainManagamentPanel/CountryPanel.gd" id="9_c6qjc"] [node name="MainManagamentPanel" type="Control"] layout_mode = 3 @@ -18,44 +26,77 @@ offset_bottom = 100.0 [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"] layout_mode = 2 -size_flags_vertical = 3 [node name="ProductionPanel" type="Button" parent="VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +text = "PRODUCTION_TOP_PANEL" +clip_text = true +script = ExtResource("1_7nvhi") [node name="BudgetPanel" type="Button" parent="VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +text = "BUDGET_TOP_PANEL" +clip_text = true script = ExtResource("1_5jsre") [node name="TechnologyPanel" type="Button" parent="VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +text = "TECHNOLOGY_TOP_PANEL" +clip_text = true +script = ExtResource("3_i0cql") [node name="PoliticsPanel" type="Button" parent="VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +text = "POLITICS_TOP_PANEL" +clip_text = true +script = ExtResource("4_b1w56") [node name="PopulationPanel" type="Button" parent="VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +text = "POPULATION_TOP_PANEL" +clip_text = true +script = ExtResource("5_e3kg5") [node name="TradePanel" type="Button" parent="VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +text = "TRADE_TOP_PANEL" +clip_text = true +script = ExtResource("6_lrvon") [node name="DiplomacyPanel" type="Button" parent="VBoxContainer/HBoxContainer"] +clip_contents = true layout_mode = 2 size_flags_horizontal = 3 +text = "DIPLOMACY_TOP_PANEL" +clip_text = true +script = ExtResource("7_4ixxg") [node name="MilitaryPanel" type="Button" parent="VBoxContainer/HBoxContainer"] layout_mode = 2 size_flags_horizontal = 3 +text = "MILITARY_TOP_PANEL" +clip_text = true +script = ExtResource("8_oxtyy") [node name="CountryPanel" type="Button" parent="VBoxContainer"] custom_minimum_size = Vector2(100, 60) layout_mode = 2 size_flags_horizontal = 0 +text = "COUNTRY_TOP_PANEL" +script = ExtResource("9_c6qjc") +[connection signal="pressed" from="VBoxContainer/HBoxContainer/ProductionPanel" to="VBoxContainer/HBoxContainer/ProductionPanel" method="_on_pressed"] [connection signal="pressed" from="VBoxContainer/HBoxContainer/BudgetPanel" to="VBoxContainer/HBoxContainer/BudgetPanel" method="_on_pressed"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer/TechnologyPanel" to="VBoxContainer/HBoxContainer/TechnologyPanel" method="_on_pressed"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer/PoliticsPanel" to="VBoxContainer/HBoxContainer/PoliticsPanel" method="_on_pressed"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer/PopulationPanel" to="VBoxContainer/HBoxContainer/PopulationPanel" method="_on_pressed"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer/TradePanel" to="VBoxContainer/HBoxContainer/TradePanel" method="_on_pressed"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer/DiplomacyPanel" to="VBoxContainer/HBoxContainer/DiplomacyPanel" method="_on_pressed"] +[connection signal="pressed" from="VBoxContainer/HBoxContainer/MilitaryPanel" to="VBoxContainer/HBoxContainer/MilitaryPanel" method="_on_pressed"] +[connection signal="pressed" from="VBoxContainer/CountryPanel" to="VBoxContainer/CountryPanel" method="_on_pressed"] diff --git a/game/src/Game/GameSession/MainManagamentPanel/MilitaryPanel.gd b/game/src/Game/GameSession/MainManagamentPanel/MilitaryPanel.gd new file mode 100644 index 0000000..c4e3eb6 --- /dev/null +++ b/game/src/Game/GameSession/MainManagamentPanel/MilitaryPanel.gd @@ -0,0 +1,7 @@ +extends Button +var PopPanel = load("res://src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn") + +func _on_pressed(): + var spawn = PopPanel.instantiate() + spawn.PanelName = "EXAMPLE_POPUP" + $"../../..".add_child(spawn) # Spawning window on MainManagamentPanel diff --git a/game/src/Game/GameSession/MainManagamentPanel/PoliticsPanel.gd b/game/src/Game/GameSession/MainManagamentPanel/PoliticsPanel.gd new file mode 100644 index 0000000..c4e3eb6 --- /dev/null +++ b/game/src/Game/GameSession/MainManagamentPanel/PoliticsPanel.gd @@ -0,0 +1,7 @@ +extends Button +var PopPanel = load("res://src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn") + +func _on_pressed(): + var spawn = PopPanel.instantiate() + spawn.PanelName = "EXAMPLE_POPUP" + $"../../..".add_child(spawn) # Spawning window on MainManagamentPanel diff --git a/game/src/Game/GameSession/MainManagamentPanel/PopulationPanel.gd b/game/src/Game/GameSession/MainManagamentPanel/PopulationPanel.gd new file mode 100644 index 0000000..c4e3eb6 --- /dev/null +++ b/game/src/Game/GameSession/MainManagamentPanel/PopulationPanel.gd @@ -0,0 +1,7 @@ +extends Button +var PopPanel = load("res://src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn") + +func _on_pressed(): + var spawn = PopPanel.instantiate() + spawn.PanelName = "EXAMPLE_POPUP" + $"../../..".add_child(spawn) # Spawning window on MainManagamentPanel diff --git a/game/src/Game/GameSession/MainManagamentPanel/PopupPanel.gd b/game/src/Game/GameSession/MainManagamentPanel/PopupPanel.gd index 72e54ae..d51cd50 100644 --- a/game/src/Game/GameSession/MainManagamentPanel/PopupPanel.gd +++ b/game/src/Game/GameSession/MainManagamentPanel/PopupPanel.gd @@ -1,9 +1,9 @@ extends Control +var PanelName: String = "TEST" var _mouse_over_viewport : bool = true -var _mouse_entered : bool = true const _action_click : StringName = &"map_click" - + func _on_close_button_pressed(): self.queue_free() diff --git a/game/src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn b/game/src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn index 52cec21..9682847 100644 --- a/game/src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn +++ b/game/src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn @@ -6,9 +6,15 @@ [sub_resource type="GDScript" id="GDScript_c3oah"] script/source = "extends Panel + func _ready(): + var PanelLabel: Label = $Label + self.set_size($\"../CloseButton/Sprite2D/Control\".get_size()*$\"../CloseButton/Sprite2D\".get_scale()) # Making it equal to sprite size self.size.x = get_parent().size.x # Making it to be on whole top side + + PanelLabel.set_size(self.get_size() - $\"../CloseButton/Sprite2D/Control\".get_size()*$\"../CloseButton/Sprite2D\".get_scale()) # Not letting it clip over X button + PanelLabel.text = String(get_parent().PanelName) " [sub_resource type="GDScript" id="GDScript_vtk7h"] @@ -50,6 +56,19 @@ offset_right = 40.0 offset_bottom = 40.0 script = SubResource("GDScript_c3oah") +[node name="Label" type="Label" parent="TopPanel"] +layout_mode = 1 +anchors_preset = 4 +anchor_top = 0.5 +anchor_bottom = 0.5 +offset_top = -11.5 +offset_right = 40.0 +offset_bottom = 11.5 +grow_vertical = 2 +horizontal_alignment = 1 +vertical_alignment = 1 +autowrap_mode = 3 + [node name="CloseButton" type="Button" parent="."] layout_mode = 1 offset_right = 9.0 @@ -77,4 +96,3 @@ mouse_filter = 2 [connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"] [connection signal="gui_input" from="TopPanel" to="." method="_on_top_panel_gui_input"] [connection signal="pressed" from="CloseButton" to="." method="_on_close_button_pressed"] -[connection signal="pressed" from="CloseButton" to="." method="_on_button_pressed"] diff --git a/game/src/Game/GameSession/MainManagamentPanel/ProductionPanel.gd b/game/src/Game/GameSession/MainManagamentPanel/ProductionPanel.gd new file mode 100644 index 0000000..c4e3eb6 --- /dev/null +++ b/game/src/Game/GameSession/MainManagamentPanel/ProductionPanel.gd @@ -0,0 +1,7 @@ +extends Button +var PopPanel = load("res://src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn") + +func _on_pressed(): + var spawn = PopPanel.instantiate() + spawn.PanelName = "EXAMPLE_POPUP" + $"../../..".add_child(spawn) # Spawning window on MainManagamentPanel diff --git a/game/src/Game/GameSession/MainManagamentPanel/TechnologyPanel.gd b/game/src/Game/GameSession/MainManagamentPanel/TechnologyPanel.gd new file mode 100644 index 0000000..c4e3eb6 --- /dev/null +++ b/game/src/Game/GameSession/MainManagamentPanel/TechnologyPanel.gd @@ -0,0 +1,7 @@ +extends Button +var PopPanel = load("res://src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn") + +func _on_pressed(): + var spawn = PopPanel.instantiate() + spawn.PanelName = "EXAMPLE_POPUP" + $"../../..".add_child(spawn) # Spawning window on MainManagamentPanel diff --git a/game/src/Game/GameSession/MainManagamentPanel/TradePanel.gd b/game/src/Game/GameSession/MainManagamentPanel/TradePanel.gd new file mode 100644 index 0000000..c4e3eb6 --- /dev/null +++ b/game/src/Game/GameSession/MainManagamentPanel/TradePanel.gd @@ -0,0 +1,7 @@ +extends Button +var PopPanel = load("res://src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn") + +func _on_pressed(): + var spawn = PopPanel.instantiate() + spawn.PanelName = "EXAMPLE_POPUP" + $"../../..".add_child(spawn) # Spawning window on MainManagamentPanel |