The SpellBook is now a module aswell.

This commit is contained in:
Relintai 2020-09-24 10:32:00 +02:00
parent 6bcb37b339
commit 020f744e78
8 changed files with 207 additions and 233 deletions

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=21 format=2]
[gd_scene load_steps=19 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]
@ -7,11 +7,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/windows/SpellBookWindow.tscn" type="PackedScene" id=17]
[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/spellbook_icon.tres" type="Texture" id=23]
[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]
@ -52,33 +50,10 @@ __meta__ = {
"_edit_use_anchors_": false
}
image_button = ExtResource( 30 )
spell_book_path = NodePath("../Windows/SpellBookWindow")
spell_book_button_path = NodePath("SpellBookButton")
lock_button_path = NodePath("LockButton")
[node name="SpellBookButton" type="Button" parent="GUI/Buttons"]
margin_right = 25.0
margin_bottom = 40.0
rect_min_size = Vector2( 25, 30 )
hint_tooltip = "SpellBook"
focus_mode = 0
toggle_mode = true
enabled_focus_mode = 0
keep_pressed_outside = true
[node name="TextureRect" type="TextureRect" parent="GUI/Buttons/SpellBookButton"]
anchor_right = 1.0
anchor_bottom = 1.0
texture = ExtResource( 23 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="BagButton" type="Button" parent="GUI/Buttons"]
margin_left = 25.0
margin_right = 50.0
margin_right = 25.0
margin_bottom = 40.0
rect_min_size = Vector2( 25, 30 )
hint_tooltip = "Inventory"
@ -98,8 +73,8 @@ __meta__ = {
}
[node name="TalentButton" type="Button" parent="GUI/Buttons"]
margin_left = 50.0
margin_right = 75.0
margin_left = 25.0
margin_right = 50.0
margin_bottom = 40.0
rect_min_size = Vector2( 25, 30 )
hint_tooltip = "Inventory"
@ -119,8 +94,8 @@ __meta__ = {
}
[node name="CraftingButton" 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 )
hint_tooltip = "Inventory"
@ -140,8 +115,8 @@ __meta__ = {
}
[node name="LockButton" 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
@ -171,8 +146,8 @@ __meta__ = {
}
[node name="Menu" type="Button" parent="GUI/Buttons"]
margin_left = 125.0
margin_right = 150.0
margin_left = 100.0
margin_right = 125.0
margin_bottom = 40.0
rect_min_size = Vector2( 25, 30 )
focus_mode = 0
@ -192,13 +167,6 @@ __meta__ = {
[node name="Windows" type="CanvasLayer" parent="GUI"]
layer = 2
[node name="SpellBookWindow" parent="GUI/Windows" instance=ExtResource( 17 )]
visible = false
margin_left = 60.0
margin_top = 50.0
margin_right = 561.0
opener_button_path = NodePath("../../Buttons/SpellBookButton")
[node name="TalentWindow" parent="GUI/Windows" instance=ExtResource( 11 )]
visible = false
anchor_right = 0.0
@ -255,7 +223,6 @@ margin_bottom = 502.847
[node name="IngameMenu" parent="GUI" instance=ExtResource( 2 )]
visible = false
[connection signal="toggled" from="GUI/Buttons/SpellBookButton" to="GUI/Windows/SpellBookWindow" method="_on_SpellBookButton_toggled"]
[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"]

View File

@ -20,7 +20,6 @@ extends Control
# 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(NodePath) var spell_entry_container_path : NodePath
@ -48,7 +47,6 @@ var _character_class : EntityClassData
var _spells : Array
func _ready() -> void:
opener_button = get_node_or_null(opener_button_path) as BaseButton
connect("visibility_changed", self, "on_visibility_changed")
_spell_entries.clear()
@ -210,7 +208,7 @@ func on_visibility_changed():
if !visible && opener_button.pressed:
opener_button.pressed = false
func _on_SpellBookButton_toggled(button_pressed):
func _on_button_toggled(button_pressed):
if button_pressed:
if !visible:
show()

View File

@ -0,0 +1,176 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://ui/spellbook/SpellBookWindow.gd" type="Script" id=2]
[ext_resource path="res://ui/spellbook/SpellContainer.tscn" type="PackedScene" id=3]
[node name="SpellBookWindow" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 1 )
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
spell_entry_container_path = NodePath("PanelContainer/PagedContent/GridContainer")
prev_button_path = NodePath("PanelContainer/PagedContent/Controls/HBoxContainer/Button2")
next_button_path = NodePath("PanelContainer/PagedContent/Controls/HBoxContainer/Button")
spell_points_label_path = NodePath("PanelContainer/PagedContent/Controls/HBoxContainer/SpellPoints")
show_not_learned = false
[node name="PanelContainer" type="PanelContainer" parent="."]
margin_left = 79.0
margin_top = 65.0
margin_right = 535.0
margin_bottom = 483.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PagedContent" type="VBoxContainer" parent="PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 452.0
margin_bottom = 414.0
[node name="Header" type="HBoxContainer" parent="PanelContainer/PagedContent"]
margin_right = 448.0
margin_bottom = 30.0
[node name="Label" type="Label" parent="PanelContainer/PagedContent/Header"]
margin_top = 7.0
margin_right = 54.0
margin_bottom = 22.0
text = "Spellbook"
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/PagedContent/Header"]
margin_left = 58.0
margin_right = 404.0
margin_bottom = 30.0
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 1
[node name="Button" type="Button" parent="PanelContainer/PagedContent/Header/HBoxContainer"]
margin_left = 123.0
margin_right = 223.0
margin_bottom = 30.0
rect_min_size = Vector2( 100, 0 )
text = "Nature"
[node name="Button" type="Button" parent="PanelContainer/PagedContent/Header"]
margin_left = 408.0
margin_right = 448.0
margin_bottom = 30.0
rect_min_size = Vector2( 40, 30 )
text = "X"
[node name="GridContainer" type="GridContainer" parent="PanelContainer/PagedContent"]
margin_top = 38.0
margin_right = 448.0
margin_bottom = 372.0
size_flags_horizontal = 3
size_flags_vertical = 3
columns = 2
[node name="SpellContainer" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 3 )]
margin_left = 0.0
margin_top = 0.0
margin_right = 222.0
margin_bottom = 63.0
[node name="SpellContainer2" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 3 )]
margin_left = 226.0
margin_top = 0.0
margin_right = 448.0
margin_bottom = 63.0
[node name="SpellContainer3" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 3 )]
margin_left = 0.0
margin_top = 67.0
margin_right = 222.0
margin_bottom = 130.0
[node name="SpellContainer4" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 3 )]
margin_left = 226.0
margin_top = 67.0
margin_right = 448.0
margin_bottom = 130.0
[node name="SpellContainer5" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 3 )]
margin_left = 0.0
margin_top = 134.0
margin_right = 222.0
margin_bottom = 197.0
[node name="SpellContainer6" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 3 )]
margin_left = 226.0
margin_top = 134.0
margin_right = 448.0
margin_bottom = 197.0
[node name="SpellContainer7" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 3 )]
margin_left = 0.0
margin_top = 201.0
margin_right = 222.0
margin_bottom = 264.0
[node name="SpellContainer8" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 3 )]
margin_left = 226.0
margin_top = 201.0
margin_right = 448.0
margin_bottom = 264.0
[node name="SpellContainer9" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 3 )]
margin_left = 0.0
margin_top = 268.0
margin_right = 222.0
margin_bottom = 331.0
[node name="SpellContainer10" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 3 )]
margin_left = 226.0
margin_top = 268.0
margin_right = 448.0
margin_bottom = 331.0
[node name="Controls" type="MarginContainer" parent="PanelContainer/PagedContent"]
margin_top = 380.0
margin_right = 448.0
margin_bottom = 410.0
custom_constants/margin_right = 2
custom_constants/margin_top = 2
custom_constants/margin_left = 2
custom_constants/margin_bottom = 2
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/PagedContent/Controls"]
margin_left = 2.0
margin_top = 2.0
margin_right = 446.0
margin_bottom = 28.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Button2" type="Button" parent="PanelContainer/PagedContent/Controls/HBoxContainer"]
margin_right = 145.0
margin_bottom = 26.5702
size_flags_horizontal = 3
size_flags_vertical = 3
text = "< Previous page"
[node name="SpellPoints" type="Label" parent="PanelContainer/PagedContent/Controls/HBoxContainer"]
margin_left = 149.0
margin_top = 5.0
margin_right = 294.0
margin_bottom = 20.0
size_flags_horizontal = 3
align = 1
valign = 1
[node name="Button" type="Button" parent="PanelContainer/PagedContent/Controls/HBoxContainer"]
margin_left = 298.0
margin_right = 444.0
margin_bottom = 26.5702
size_flags_horizontal = 3
size_flags_vertical = 3
text = "Next page >"
[connection signal="pressed" from="PanelContainer/PagedContent/Header/Button" to="." method="hide"]

View File

@ -1,9 +1,9 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://ui/windows/SpellDragAndDropSpellBook.gd" type="Script" id=1]
[ext_resource path="res://ui/windows/SpellContainer.gd" type="Script" id=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=3]
[ext_resource path="res://ui/spellbook/SpellEntryPopup.gd" type="Script" id=5]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://ui/spellbook/SpellDragAndDropSpellBook.gd" type="Script" id=2]
[ext_resource path="res://ui/spellbook/SpellContainer.gd" type="Script" id=3]
[ext_resource path="res://ui/spellbook/SpellEntryPopup.gd" type="Script" id=4]
[node name="SpellContainer" type="Control"]
margin_left = 290.0
@ -12,8 +12,8 @@ margin_right = 576.0
margin_bottom = 370.0
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource( 3 )
script = ExtResource( 2 )
theme = ExtResource( 1 )
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
@ -42,7 +42,7 @@ margin_bottom = 60.0
margin_right = 55.0
margin_bottom = 56.0
rect_min_size = Vector2( 55, 55 )
script = ExtResource( 1 )
script = ExtResource( 2 )
[node name="CenterContainer" type="MarginContainer" parent="PanelContainer/HBoxContainer/Button"]
margin_left = 4.0
@ -77,7 +77,7 @@ margin_left = 64.0
margin_top = 4.0
margin_right = 360.0
margin_bottom = 207.0
script = ExtResource( 5 )
script = ExtResource( 4 )
__meta__ = {
"_edit_use_anchors_": false
}

View File

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

View File

@ -1,179 +0,0 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://ui/windows/SpellContainer.tscn" type="PackedScene" id=1]
[ext_resource path="res://ui/windows/SpellBookWindow.gd" type="Script" id=4]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=5]
[node name="SpellBookWindow" type="PanelContainer"]
margin_right = 884.0
margin_bottom = 510.0
theme = ExtResource( 5 )
script = ExtResource( 4 )
__meta__ = {
"_edit_use_anchors_": false
}
spell_entry_container_path = NodePath("PagedContent/GridContainer")
prev_button_path = NodePath("PagedContent/Controls/HBoxContainer/Button2")
next_button_path = NodePath("PagedContent/Controls/HBoxContainer/Button")
spell_points_label_path = NodePath("PagedContent/Controls/HBoxContainer/SpellPoints")
show_not_learned = false
[node name="PagedContent" type="VBoxContainer" parent="."]
margin_left = 4.0
margin_top = 4.0
margin_right = 880.0
margin_bottom = 506.0
[node name="Header" type="HBoxContainer" parent="PagedContent"]
margin_right = 876.0
margin_bottom = 30.0
[node name="Label" type="Label" parent="PagedContent/Header"]
margin_top = 7.0
margin_right = 54.0
margin_bottom = 22.0
text = "Spellbook"
[node name="HBoxContainer" type="HBoxContainer" parent="PagedContent/Header"]
margin_left = 58.0
margin_right = 832.0
margin_bottom = 30.0
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 1
[node name="Button" type="Button" parent="PagedContent/Header/HBoxContainer"]
margin_left = 337.0
margin_right = 437.0
margin_bottom = 30.0
rect_min_size = Vector2( 100, 0 )
text = "Nature"
[node name="Button" type="Button" parent="PagedContent/Header"]
margin_left = 836.0
margin_right = 876.0
margin_bottom = 30.0
rect_min_size = Vector2( 40, 30 )
text = "X"
[node name="GridContainer" type="GridContainer" parent="PagedContent"]
margin_top = 38.0
margin_right = 876.0
margin_bottom = 464.0
size_flags_horizontal = 3
size_flags_vertical = 3
columns = 2
[node name="SpellContainer" parent="PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 0.0
margin_top = 0.0
margin_right = 436.0
margin_bottom = 67.0
[node name="SpellContainer2" parent="PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 440.0
margin_top = 0.0
margin_right = 876.0
margin_bottom = 67.0
[node name="SpellContainer3" parent="PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 0.0
margin_top = 71.0
margin_right = 436.0
margin_bottom = 138.0
[node name="SpellContainer4" parent="PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 440.0
margin_top = 71.0
margin_right = 876.0
margin_bottom = 138.0
[node name="SpellContainer5" parent="PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 0.0
margin_top = 142.0
margin_right = 436.0
margin_bottom = 209.0
[node name="SpellContainer6" parent="PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 440.0
margin_top = 142.0
margin_right = 876.0
margin_bottom = 209.0
[node name="SpellContainer7" parent="PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 0.0
margin_top = 213.0
margin_right = 436.0
margin_bottom = 280.0
[node name="SpellContainer8" parent="PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 440.0
margin_top = 213.0
margin_right = 876.0
margin_bottom = 280.0
[node name="SpellContainer9" parent="PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 0.0
margin_top = 284.0
margin_right = 436.0
margin_bottom = 351.0
[node name="SpellContainer10" parent="PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 440.0
margin_top = 284.0
margin_right = 876.0
margin_bottom = 351.0
[node name="SpellContainer11" parent="PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 0.0
margin_top = 355.0
margin_right = 436.0
margin_bottom = 422.0
[node name="SpellContainer12" parent="PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 440.0
margin_top = 355.0
margin_right = 876.0
margin_bottom = 422.0
[node name="Controls" type="MarginContainer" parent="PagedContent"]
margin_top = 472.0
margin_right = 876.0
margin_bottom = 502.0
custom_constants/margin_right = 2
custom_constants/margin_top = 2
custom_constants/margin_left = 2
custom_constants/margin_bottom = 2
[node name="HBoxContainer" type="HBoxContainer" parent="PagedContent/Controls"]
margin_left = 2.0
margin_top = 2.0
margin_right = 874.0
margin_bottom = 28.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Button2" type="Button" parent="PagedContent/Controls/HBoxContainer"]
margin_right = 288.0
margin_bottom = 26.5702
size_flags_horizontal = 3
size_flags_vertical = 3
text = "< Previous page"
[node name="SpellPoints" type="Label" parent="PagedContent/Controls/HBoxContainer"]
margin_left = 292.0
margin_top = 5.0
margin_right = 580.0
margin_bottom = 20.0
size_flags_horizontal = 3
align = 1
valign = 1
[node name="Button" type="Button" parent="PagedContent/Controls/HBoxContainer"]
margin_left = 584.0
margin_right = 872.0
margin_bottom = 26.5702
size_flags_horizontal = 3
size_flags_vertical = 3
text = "Next page >"
[connection signal="pressed" from="PagedContent/Header/Button" to="." method="hide"]