Remove GUI dependence on tscn files (#812)

* Remove unused options menu tscn

* Move SS14Window to pure C#

* Move SpriteView to pure C#

* Move EntitySpawnWindow and EntitySpawnItem to pure C#

* Removes using statements accidentally added by resharper

* Set EntitySpawnWindow default size to normal value

Note that in construction menu and storage menu this had to be done in the object initializer and didn't work if it was set in the Initialize function for the respective menus. For whatever reason setting it in the EntitySpawnWindow.Initialize works fine.
This commit is contained in:
moneyl
2019-05-24 10:57:13 -04:00
committed by Pieter-Jan Briers
parent 1b38996905
commit b92ea9a2aa
8 changed files with 166 additions and 561 deletions

View File

@@ -1,115 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Engine/Scenes/SS14Window/SS14Window.tscn" type="PackedScene" id=1]
[node name="SS14Window" instance=ExtResource( 1 )]
margin_left = 370.0
margin_top = 112.0
margin_right = 519.0
margin_bottom = 239.0
mouse_default_cursor_shape = 0
[node name="Contents" parent="." index="0"]
mouse_default_cursor_shape = 0
[node name="VBoxContainer" type="VBoxContainer" parent="Contents" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
[node name="VSyncCheckBox" type="CheckBox" parent="Contents/VBoxContainer" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 129.0
margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 )
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
custom_colors/font_color = Color( 1, 1, 1, 1 )
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
group = null
text = "VSync"
flat = false
align = 0
_sections_unfolded = [ "custom_colors" ]
[node name="FullscreenCheckBox" type="CheckBox" parent="Contents/VBoxContainer" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 28.0
margin_right = 129.0
margin_bottom = 52.0
rect_pivot_offset = Vector2( 0, 0 )
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
group = null
text = "FullScreen"
flat = false
align = 0
[node name="ApplyButton" type="Button" parent="Contents/VBoxContainer" index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 56.0
margin_right = 129.0
margin_bottom = 76.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
disabled = true
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Apply Changes"
flat = false
align = 1
_sections_unfolded = [ "Margin" ]
[node name="Header" parent="." index="1"]
mouse_default_cursor_shape = 0
[node name="Header Text" parent="Header" index="0"]
mouse_default_cursor_shape = 0
text = "Options Menu"
[node name="CloseButton" parent="Header" index="1"]
focus_mode = 2
mouse_default_cursor_shape = 0

View File

@@ -1,115 +0,0 @@
[gd_scene load_steps=2 format=2]
[sub_resource type="StyleBoxEmpty" id=1]
content_margin_left = -1.0
content_margin_right = -1.0
content_margin_top = -1.0
content_margin_bottom = -1.0
[node name="EntitySpawnItem" type="PanelContainer"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 102.0
margin_bottom = 32.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 1
custom_styles/panel = SubResource( 1 )
_sections_unfolded = [ "Grow Direction", "Mouse", "Rect", "Size Flags", "custom_styles" ]
[node name="Button" type="Button" parent="." index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 102.0
margin_bottom = 32.0
rect_pivot_offset = Vector2( 0, 0 )
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 3
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
group = null
flat = false
align = 1
_sections_unfolded = [ "Size Flags" ]
[node name="HBoxContainer" type="HBoxContainer" parent="." index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 102.0
margin_bottom = 32.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
_sections_unfolded = [ "Grow Direction", "Mouse", "Size Flags" ]
[node name="TextureWrap" type="Control" parent="HBoxContainer" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 32.0
margin_bottom = 32.0
rect_min_size = Vector2( 32, 32 )
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
rect_clip_content = true
_sections_unfolded = [ "Mouse", "Rect" ]
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/TextureWrap" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 4
size_flags_vertical = 4
_sections_unfolded = [ "Focus", "Grow Direction", "Hint", "Margin", "Mouse", "Rect", "Size Flags", "Theme" ]
[node name="Label" type="Label" parent="HBoxContainer" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 36.0
margin_top = 9.0
margin_right = 95.0
margin_bottom = 23.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Backpack"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
_sections_unfolded = [ "Mouse" ]

View File

@@ -1,222 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://Engine/Scenes/SS14Window/SS14Window.tscn" type="PackedScene" id=1]
[node name="SS14Window" instance=ExtResource( 1 )]
margin_right = 532.0
margin_bottom = 398.0
_sections_unfolded = [ "Margin" ]
[node name="Contents" parent="." index="0"]
mouse_filter = 1
[node name="HSplitContainer" type="HSplitContainer" parent="Contents" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
split_offset = 0
collapsed = false
dragger_visibility = 0
_sections_unfolded = [ "Mouse" ]
[node name="PrototypeListScrollContainer" type="ScrollContainer" parent="Contents/HSplitContainer" index="0"]
editor/display_folded = true
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 200.0
margin_bottom = 310.0
rect_min_size = Vector2( 200, 0 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = true
mouse_filter = 1
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 1
scroll_horizontal_enabled = true
scroll_horizontal = 0
scroll_vertical_enabled = true
scroll_vertical = 0
_sections_unfolded = [ "Anchor", "Grow Direction", "Margin", "Mouse", "Rect", "Scroll", "Size Flags" ]
[node name="PrototypeList" type="VBoxContainer" parent="Contents/HSplitContainer/PrototypeListScrollContainer" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 200.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 1
custom_constants/separation = 2
alignment = 0
_sections_unfolded = [ "Focus", "Hint", "Mouse", "Rect", "Size Flags", "custom_constants" ]
[node name="Options" type="VBoxContainer" parent="Contents/HSplitContainer" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 212.0
margin_right = 412.0
margin_bottom = 310.0
rect_min_size = Vector2( 200, 0 )
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 0
_sections_unfolded = [ "Hint", "Margin", "Mouse", "Rect" ]
[node name="SearchBar" type="LineEdit" parent="Contents/HSplitContainer/Options" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 200.0
margin_bottom = 24.0
rect_pivot_offset = Vector2( 0, 0 )
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 1
size_flags_horizontal = 1
size_flags_vertical = 1
focus_mode = 2
context_menu_enabled = true
placeholder_text = "Search Entities"
placeholder_alpha = 0.6
caret_blink = false
caret_blink_speed = 0.65
caret_position = 0
_sections_unfolded = [ "Placeholder" ]
[node name="Buttons!" type="HBoxContainer" parent="Contents/HSplitContainer/Options" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 28.0
margin_right = 200.0
margin_bottom = 48.0
rect_pivot_offset = Vector2( 0, 0 )
focus_mode = 2
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
alignment = 1
_sections_unfolded = [ "Mouse" ]
[node name="ClearButton" type="Button" parent="Contents/HSplitContainer/Options/Buttons!" index="0"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 98.0
margin_bottom = 20.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 1
disabled = true
toggle_mode = false
enabled_focus_mode = 2
shortcut = null
group = null
text = "Clear Search"
flat = false
align = 1
_sections_unfolded = [ "Grow Direction", "Rect", "Size Flags" ]
[node name="EraseButton" type="Button" parent="Contents/HSplitContainer/Options/Buttons!" index="1"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 102.0
margin_right = 200.0
margin_bottom = 20.0
rect_pivot_offset = Vector2( 0, 0 )
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 3
size_flags_vertical = 1
toggle_mode = true
enabled_focus_mode = 2
shortcut = null
group = null
text = "Erase Mode"
flat = false
align = 1
[node name="OverridePlacementText" type="Label" parent="Contents/HSplitContainer/Options" index="2"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 52.0
margin_right = 200.0
margin_bottom = 66.0
rect_pivot_offset = Vector2( 0, 0 )
mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 4
text = "Override Placement:"
percent_visible = 1.0
lines_skipped = 0
max_lines_visible = -1
[node name="OverrideMenu" type="OptionButton" parent="Contents/HSplitContainer/Options" index="3"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_top = 70.0
margin_right = 200.0
margin_bottom = 90.0
rect_pivot_offset = Vector2( 0, 0 )
focus_mode = 2
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
toggle_mode = false
action_mode = 0
enabled_focus_mode = 2
shortcut = null
group = null
flat = false
align = 0
selected = -1
items = [ ]
[node name="Header Text" parent="Header" index="0"]
text = "Entity Spawn Panel"

View File

@@ -1,53 +0,0 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://Engine/Scenes/SS14Window/closewindow.png" type="Texture" id=1]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.234375, 0.234375, 0.234375, 1 )
[node name="SS14Window" type="Panel"]
margin_left = 100.0
margin_top = 38.0
margin_right = 878.0
margin_bottom = 519.0
[node name="Contents" type="MarginContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 0.0
margin_top = 30.0
margin_right = 0.0
margin_bottom = 0.0
rect_min_size = Vector2( 50, 50 )
rect_clip_content = true
mouse_filter = 2
custom_constants/margin_right = 10
custom_constants/margin_left = 10
custom_constants/margin_bottom = 10
custom_constants/margin_top = 10
[node name="Header" type="Panel" parent="."]
anchor_right = 1.0
margin_bottom = 25.0
mouse_filter = 2
custom_styles/panel = SubResource( 1 )
[node name="Header Text" type="Label" parent="Header"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_right = -25.0
text = "Exemplary Window Title Here"
align = 1
valign = 1
clip_text = true
[node name="CloseButton" type="TextureButton" parent="Header"]
anchor_left = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -25.0
texture_normal = ExtResource( 1 )
expand = true
stretch_mode = 5

View File

@@ -1,17 +0,0 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://SpriteView.cs" type="Script" id=1]
[node name="SpriteView" type="Control"]
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 1.0
anchor_bottom = 1.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
script = ExtResource( 1 )