-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
222 additions
and
4 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[remap] | ||
|
||
importer="texture" | ||
type="CompressedTexture2D" | ||
uid="uid://cvfxeyui44yj6" | ||
path="res://.godot/imported/cancel.png-cc9794204b95b4d54a461409a3207cd9.ctex" | ||
metadata={ | ||
"vram_texture": false | ||
} | ||
|
||
[deps] | ||
|
||
source_file="res://art/ui/cancel.png" | ||
dest_files=["res://.godot/imported/cancel.png-cc9794204b95b4d54a461409a3207cd9.ctex"] | ||
|
||
[params] | ||
|
||
compress/mode=0 | ||
compress/high_quality=false | ||
compress/lossy_quality=0.7 | ||
compress/hdr_compression=1 | ||
compress/normal_map=0 | ||
compress/channel_pack=0 | ||
mipmaps/generate=false | ||
mipmaps/limit=-1 | ||
roughness/mode=0 | ||
roughness/src_normal="" | ||
process/fix_alpha_border=true | ||
process/premult_alpha=false | ||
process/normal_map_invert_y=false | ||
process/hdr_as_srgb=false | ||
process/hdr_clamp_exposure=false | ||
process/size_limit=0 | ||
detect_3d/compress_to=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
extends Button | ||
var Pan = load("res://src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn") | ||
|
||
func _on_pressed(): | ||
var spawn = Pan.instantiate() | ||
$"../../..".add_child(spawn) # Spawning window on MainManagamentPanel |
61 changes: 61 additions & 0 deletions
61
game/src/Game/GameSession/MainManagamentPanel/MainManagamentPanel.tscn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
[gd_scene load_steps=2 format=3 uid="uid://cyr5e31ucu44d"] | ||
|
||
[ext_resource type="Script" path="res://src/Game/GameSession/MainManagamentPanel/BudgetPanel.gd" id="1_5jsre"] | ||
|
||
[node name="MainManagamentPanel" type="Control"] | ||
layout_mode = 3 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
|
||
[node name="VBoxContainer" type="VBoxContainer" parent="."] | ||
custom_minimum_size = Vector2(700, 100) | ||
layout_mode = 2 | ||
offset_right = 700.0 | ||
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 | ||
|
||
[node name="BudgetPanel" type="Button" parent="VBoxContainer/HBoxContainer"] | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
script = ExtResource("1_5jsre") | ||
|
||
[node name="TechnologyPanel" type="Button" parent="VBoxContainer/HBoxContainer"] | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
|
||
[node name="PoliticsPanel" type="Button" parent="VBoxContainer/HBoxContainer"] | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
|
||
[node name="PopulationPanel" type="Button" parent="VBoxContainer/HBoxContainer"] | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
|
||
[node name="TradePanel" type="Button" parent="VBoxContainer/HBoxContainer"] | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
|
||
[node name="DiplomacyPanel" type="Button" parent="VBoxContainer/HBoxContainer"] | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
|
||
[node name="MilitaryPanel" type="Button" parent="VBoxContainer/HBoxContainer"] | ||
layout_mode = 2 | ||
size_flags_horizontal = 3 | ||
|
||
[node name="CountryPanel" type="Button" parent="VBoxContainer"] | ||
custom_minimum_size = Vector2(100, 60) | ||
layout_mode = 2 | ||
size_flags_horizontal = 0 | ||
|
||
[connection signal="pressed" from="VBoxContainer/HBoxContainer/BudgetPanel" to="VBoxContainer/HBoxContainer/BudgetPanel" method="_on_pressed"] |
24 changes: 24 additions & 0 deletions
24
game/src/Game/GameSession/MainManagamentPanel/PopupPanel.gd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
extends Control | ||
|
||
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() | ||
|
||
func _on_top_panel_gui_input(event): | ||
var far_point1 : Vector2 = Vector2(self.get_global_position().x,self.get_global_position().y) | ||
var far_point2 : Vector2 = Vector2(self.get_global_position().x+self.size.x,self.get_global_position().y+self.size.y) | ||
|
||
if Input.is_action_pressed(_action_click) and event is InputEventMouseMotion and _mouse_over_viewport: | ||
if far_point1.x+event.relative.x > 0 and far_point1.y+event.relative.y > 0 and far_point2.x+event.relative.x < get_viewport().size.x and far_point2.y+event.relative.y < get_viewport().size.y and get_global_mouse_position().x > 0 and get_global_mouse_position().y > 0 and get_global_mouse_position().x < get_viewport().size.x and get_global_mouse_position().y < get_viewport().size.y: | ||
set_position(self.get_screen_position()+event.relative) | ||
else: | ||
pass | ||
|
||
func _on_mouse_entered_viewport(): | ||
_mouse_over_viewport = true | ||
|
||
func _on_mouse_exited_viewport(): | ||
_mouse_over_viewport = false |
80 changes: 80 additions & 0 deletions
80
game/src/Game/GameSession/MainManagamentPanel/PopupPanel.tscn
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
[gd_scene load_steps=5 format=3 uid="uid://cigua67hys7yl"] | ||
|
||
[ext_resource type="Script" path="res://src/Game/GameSession/MainManagamentPanel/PopupPanel.gd" id="1_u7a8e"] | ||
[ext_resource type="Texture2D" uid="uid://cvfxeyui44yj6" path="res://art/ui/cancel.png" id="2_5e4k1"] | ||
|
||
[sub_resource type="GDScript" id="GDScript_c3oah"] | ||
script/source = "extends Panel | ||
|
||
func _ready(): | ||
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 | ||
" | ||
[sub_resource type="GDScript" id="GDScript_vtk7h"] | ||
script/source = "extends Button | ||
|
||
|
||
# Called when the node enters the scene tree for the first time. | ||
func _ready(): | ||
self.set_size($Sprite2D/Control.get_size()*$Sprite2D.get_scale()) # Making it equal to sprite size | ||
self.anchors_preset = 1 # Set it to the TOP RIGHT | ||
" | ||
[node name="PopupPanel" type="Control"] | ||
layout_mode = 3 | ||
anchors_preset = 8 | ||
anchor_left = 0.5 | ||
anchor_top = 0.5 | ||
anchor_right = 0.5 | ||
anchor_bottom = 0.5 | ||
offset_left = -125.0 | ||
offset_top = -100.0 | ||
offset_right = 125.0 | ||
offset_bottom = 100.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
script = ExtResource("1_u7a8e") | ||
[node name="Body" type="Panel" parent="."] | ||
layout_mode = 1 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
[node name="TopPanel" type="Panel" parent="."] | ||
layout_mode = 0 | ||
offset_right = 40.0 | ||
offset_bottom = 40.0 | ||
script = SubResource("GDScript_c3oah") | ||
[node name="CloseButton" type="Button" parent="."] | ||
layout_mode = 1 | ||
offset_right = 9.0 | ||
offset_bottom = 9.0 | ||
alignment = 0 | ||
script = SubResource("GDScript_vtk7h") | ||
[node name="Sprite2D" type="Sprite2D" parent="CloseButton"] | ||
scale = Vector2(0.1, 0.1) | ||
texture = ExtResource("2_5e4k1") | ||
centered = false | ||
[node name="Control" type="Control" parent="CloseButton/Sprite2D"] | ||
layout_mode = 3 | ||
anchors_preset = 15 | ||
anchor_right = 1.0 | ||
anchor_bottom = 1.0 | ||
grow_horizontal = 2 | ||
grow_vertical = 2 | ||
size_flags_horizontal = 3 | ||
size_flags_vertical = 3 | ||
mouse_filter = 2 | ||
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"] | ||
[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"] |