The TalentWindow is a module now aswell.

This commit is contained in:
Relintai 2020-09-24 10:39:34 +02:00
parent 020f744e78
commit 2bab93e6c7
5 changed files with 135 additions and 156 deletions

View File

@ -1,15 +1,13 @@
[gd_scene load_steps=19 format=2]
[gd_scene load_steps=17 format=2]
[ext_resource path="res://player/GUI.gd" type="Script" id=1]
[ext_resource path="res://ui/ingame_menu/IngameMenu.tscn" type="PackedScene" id=2]
[ext_resource path="res://ui/theme/menu_icon.tres" type="Texture" id=6]
[ext_resource path="res://ui/buttons/Buttons.gd" type="Script" id=9]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=10]
[ext_resource path="res://ui/windows/TalentWindow.tscn" type="PackedScene" id=11]
[ext_resource path="res://ui/bags/Bag.tscn" type="PackedScene" id=15]
[ext_resource path="res://ui/loot_window/LootWindow.tscn" type="PackedScene" id=19]
[ext_resource path="res://ui/windows/CraftingWindow.tscn" type="PackedScene" id=20]
[ext_resource path="res://ui/theme/talent_icon.tres" type="Texture" id=22]
[ext_resource path="res://ui/theme/bag_icon.tres" type="Texture" id=24]
[ext_resource path="res://ui/theme/locked_icon.tres" type="Texture" id=25]
[ext_resource path="res://ui/theme/unlocked_icon.tres" type="Texture" id=26]
@ -72,7 +70,7 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="TalentButton" type="Button" parent="GUI/Buttons"]
[node name="CraftingButton" type="Button" parent="GUI/Buttons"]
margin_left = 25.0
margin_right = 50.0
margin_bottom = 40.0
@ -83,27 +81,6 @@ toggle_mode = true
enabled_focus_mode = 0
keep_pressed_outside = true
[node name="TextureRect4" type="TextureRect" parent="GUI/Buttons/TalentButton"]
anchor_right = 1.0
anchor_bottom = 1.0
texture = ExtResource( 22 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CraftingButton" type="Button" parent="GUI/Buttons"]
margin_left = 50.0
margin_right = 75.0
margin_bottom = 40.0
rect_min_size = Vector2( 25, 30 )
hint_tooltip = "Inventory"
focus_mode = 0
toggle_mode = true
enabled_focus_mode = 0
keep_pressed_outside = true
[node name="TextureRect5" type="TextureRect" parent="GUI/Buttons/CraftingButton"]
anchor_right = 1.0
anchor_bottom = 1.0
@ -115,8 +92,8 @@ __meta__ = {
}
[node name="LockButton" type="Button" parent="GUI/Buttons"]
margin_left = 75.0
margin_right = 100.0
margin_left = 50.0
margin_right = 75.0
margin_bottom = 40.0
rect_min_size = Vector2( 25, 30 )
focus_mode = 0
@ -146,8 +123,8 @@ __meta__ = {
}
[node name="Menu" type="Button" parent="GUI/Buttons"]
margin_left = 100.0
margin_right = 125.0
margin_left = 75.0
margin_right = 100.0
margin_bottom = 40.0
rect_min_size = Vector2( 25, 30 )
focus_mode = 0
@ -167,16 +144,6 @@ __meta__ = {
[node name="Windows" type="CanvasLayer" parent="GUI"]
layer = 2
[node name="TalentWindow" parent="GUI/Windows" instance=ExtResource( 11 )]
visible = false
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 62.0
margin_top = 54.0
margin_right = 656.0
margin_bottom = 513.0
opener_button_path = NodePath("../../Buttons/TalentButton")
[node name="CraftingWindow" parent="GUI/Windows" instance=ExtResource( 20 )]
visible = false
margin_left = 31.0
@ -224,7 +191,6 @@ margin_bottom = 502.847
[node name="IngameMenu" parent="GUI" instance=ExtResource( 2 )]
visible = false
[connection signal="toggled" from="GUI/Buttons/BagButton" to="GUI/Windows/Inventory" method="_on_BagButton_toggled"]
[connection signal="toggled" from="GUI/Buttons/TalentButton" to="GUI/Windows/TalentWindow" method="_on_TalentButton_toggled"]
[connection signal="toggled" from="GUI/Buttons/CraftingButton" to="GUI/Windows/CraftingWindow" method="_on_CraftingButton_toggled"]
[connection signal="pressed" from="GUI/Buttons/Menu" to="GUI/IngameMenu" method="show"]

View File

@ -1,4 +1,4 @@
extends PanelContainer
extends Control
# Copyright (c) 2019-2020 Péter Magyar
#
@ -20,7 +20,6 @@ extends PanelContainer
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
export(NodePath) var opener_button_path : NodePath
var opener_button : BaseButton
export(PackedScene) var spec_scene : PackedScene
@ -35,7 +34,6 @@ var _data : EntityData
var _player : Entity
func _ready():
opener_button = get_node_or_null(opener_button_path) as BaseButton
connect("visibility_changed", self, "on_visibility_changed")
_spec_container = get_node(spec_container_path)
@ -111,7 +109,7 @@ func on_visibility_changed():
if !visible && opener_button.pressed:
opener_button.pressed = false
func _on_TalentButton_toggled(button_pressed):
func _on_button_toggled(button_pressed):
if button_pressed:
if !visible:
show()

View File

@ -0,0 +1,115 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://ui/talents/Spec.tscn" type="PackedScene" id=2]
[ext_resource path="res://ui/talents/TalentWindow.gd" type="Script" id=3]
[ext_resource path="res://ui/talents/talent_switcher_button.tscn" type="PackedScene" id=4]
[node name="TalentWindow" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 1 )
script = ExtResource( 3 )
spec_scene = ExtResource( 2 )
spec_switcher_scene = ExtResource( 4 )
spec_container_path = NodePath("PanelContainer/VBoxContainer/HBoxContainer/PanelContainer2/VBoxContainer/TabContainer2")
spec_switcher_path = NodePath("PanelContainer/VBoxContainer/Header/SpecSwitcher")
[node name="PanelContainer" type="PanelContainer" parent="."]
margin_left = 68.0
margin_top = 87.0
margin_right = 643.0
margin_bottom = 525.0
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 571.0
margin_bottom = 434.0
[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
margin_right = 567.0
margin_bottom = 30.0
rect_min_size = Vector2( 0, 30 )
alignment = 1
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/Header"]
margin_top = 7.0
margin_right = 42.0
margin_bottom = 22.0
text = "Talents"
[node name="SpecSwitcher" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Header"]
margin_left = 46.0
margin_right = 523.0
margin_bottom = 30.0
size_flags_horizontal = 3
alignment = 1
[node name="Button" type="Button" parent="PanelContainer/VBoxContainer/Header"]
margin_left = 527.0
margin_right = 567.0
margin_bottom = 30.0
rect_min_size = Vector2( 40, 30 )
text = "X"
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 38.0
margin_right = 567.0
margin_bottom = 430.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="PanelContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/HBoxContainer"]
margin_right = 185.0
margin_bottom = 392.0
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.49
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer/PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 181.0
margin_bottom = 388.0
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HBoxContainer/PanelContainer/VBoxContainer"]
margin_right = 177.0
margin_bottom = 15.0
text = "Body"
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer/PanelContainer/VBoxContainer"]
margin_top = 23.0
margin_right = 177.0
margin_bottom = 384.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="PanelContainer2" type="PanelContainer" parent="PanelContainer/VBoxContainer/HBoxContainer"]
margin_left = 189.0
margin_right = 567.0
margin_bottom = 392.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer/PanelContainer2"]
margin_left = 4.0
margin_top = 4.0
margin_right = 374.0
margin_bottom = 388.0
[node name="Label2" type="Label" parent="PanelContainer/VBoxContainer/HBoxContainer/PanelContainer2/VBoxContainer"]
visible = false
margin_right = 672.0
margin_bottom = 15.0
text = "Class"
[node name="TabContainer2" type="TabContainer" parent="PanelContainer/VBoxContainer/HBoxContainer/PanelContainer2/VBoxContainer"]
margin_right = 370.0
margin_bottom = 384.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="PanelContainer/VBoxContainer/Header/Button" to="." method="hide"]

View File

@ -0,0 +1,12 @@
[gd_resource type="Resource" load_steps=4 format=2]
[ext_resource path="res://ui/theme/talent_icon.tres" type="Texture" id=1]
[ext_resource path="res://scripts/game_modules/ui_window_module.gd" type="Script" id=2]
[ext_resource path="res://ui/talents/TalentWindow.tscn" type="PackedScene" id=3]
[resource]
script = ExtResource( 2 )
enabled = true
character_scene = ExtResource( 3 )
opener_button_texture = ExtResource( 1 )
index = 2

View File

@ -1,112 +0,0 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://ui/talents/Spec.tscn" type="PackedScene" id=2]
[ext_resource path="res://ui/windows/TalentWindow.gd" type="Script" id=3]
[ext_resource path="res://ui/talents/talent_switcher_button.tscn" type="PackedScene" id=4]
[node name="TalentWindow" type="PanelContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 1 )
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
spec_scene = ExtResource( 2 )
spec_switcher_scene = ExtResource( 4 )
spec_container_path = NodePath("VBoxContainer/HBoxContainer/PanelContainer2/VBoxContainer/TabContainer2")
spec_switcher_path = NodePath("VBoxContainer/Header/SpecSwitcher")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 4.0
margin_top = 4.0
margin_right = 1020.0
margin_bottom = 596.0
[node name="Header" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 1016.0
margin_bottom = 30.0
rect_min_size = Vector2( 0, 30 )
alignment = 1
[node name="Label" type="Label" parent="VBoxContainer/Header"]
margin_top = 7.0
margin_right = 42.0
margin_bottom = 22.0
text = "Talents"
[node name="SpecSwitcher" type="HBoxContainer" parent="VBoxContainer/Header"]
margin_left = 46.0
margin_right = 972.0
margin_bottom = 30.0
size_flags_horizontal = 3
alignment = 1
[node name="Button" type="Button" parent="VBoxContainer/Header"]
margin_left = 976.0
margin_right = 1016.0
margin_bottom = 30.0
rect_min_size = Vector2( 40, 30 )
text = "X"
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 38.0
margin_right = 1016.0
margin_bottom = 592.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/HBoxContainer"]
margin_right = 332.0
margin_bottom = 554.0
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.49
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 328.0
margin_bottom = 550.0
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer/PanelContainer/VBoxContainer"]
margin_right = 324.0
margin_bottom = 15.0
text = "Body"
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/PanelContainer/VBoxContainer"]
margin_top = 23.0
margin_right = 324.0
margin_bottom = 546.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="PanelContainer2" type="PanelContainer" parent="VBoxContainer/HBoxContainer"]
margin_left = 336.0
margin_right = 1016.0
margin_bottom = 554.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer/PanelContainer2"]
margin_left = 4.0
margin_top = 4.0
margin_right = 676.0
margin_bottom = 550.0
[node name="Label2" type="Label" parent="VBoxContainer/HBoxContainer/PanelContainer2/VBoxContainer"]
visible = false
margin_right = 672.0
margin_bottom = 15.0
text = "Class"
[node name="TabContainer2" type="TabContainer" parent="VBoxContainer/HBoxContainer/PanelContainer2/VBoxContainer"]
margin_right = 672.0
margin_bottom = 546.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[connection signal="pressed" from="VBoxContainer/Header/Button" to="." method="hide"]