Same for the trainer window.

This commit is contained in:
Relintai 2020-09-24 17:03:47 +02:00
parent 2e14445d8d
commit 93097ada5e
6 changed files with 171 additions and 199 deletions

View File

@ -1,4 +1,4 @@
[gd_scene load_steps=11 format=2]
[gd_scene load_steps=10 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]
@ -9,7 +9,6 @@
[ext_resource path="res://ui/theme/unlocked_icon.tres" type="Texture" id=26]
[ext_resource path="res://ui/player_ui/player_ui.gd" type="Script" id=28]
[ext_resource path="res://ui/buttons/ImageButton.tscn" type="PackedScene" id=30]
[ext_resource path="res://ui/windows/TrainerWindow.tscn" type="PackedScene" id=31]
[node name="GUILayer" type="CanvasLayer"]
script = ExtResource( 28 )
@ -95,15 +94,6 @@ __meta__ = {
[node name="Windows" type="CanvasLayer" parent="GUI"]
layer = 2
[node name="TrainerWindow" parent="GUI/Windows" instance=ExtResource( 31 )]
visible = false
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 58.7329
margin_top = 50.7239
margin_right = 446.733
margin_bottom = 542.724
[node name="IngameMenu" parent="GUI" instance=ExtResource( 2 )]
visible = false
[connection signal="pressed" from="GUI/Buttons/Menu" to="GUI/IngameMenu" method="show"]

View File

@ -1,3 +1,5 @@
extends Control
# Copyright (c) 2019-2020 Péter Magyar
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
@ -18,8 +20,6 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
extends PanelContainer
export(NodePath) var spell_entry_container_path : NodePath
export(NodePath) var learn_button_path : NodePath
export(NodePath) var cost_label_path : NodePath

View File

@ -0,0 +1,157 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/trainer/TrainerWindow.gd" type="Script" id=1]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2]
[node name="TrainerWindow" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource( 2 )
script = ExtResource( 1 )
spell_entry_container_path = NodePath("PanelContainer/VBoxContainer/PanelContainer3/ScrollContainer/Spells")
learn_button_path = NodePath("PanelContainer/VBoxContainer/HBoxContainer/Train")
cost_label_path = NodePath("PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer2/Price")
spell_icon_path = NodePath("PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer/Icon")
spell_name_label_path = NodePath("PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer2/Name")
spell_description_label_path = NodePath("PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer2/Description")
spell_requirements_label_path = NodePath("PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer2/Requirements")
[node name="PanelContainer" type="PanelContainer" parent="."]
margin_left = 49.0
margin_top = 40.0
margin_right = 436.0
margin_bottom = 498.0
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 383.0
margin_bottom = 454.0
[node name="HBoxContainer2" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
margin_right = 379.0
margin_bottom = 26.0
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HBoxContainer2"]
margin_top = 5.0
margin_right = 345.0
margin_bottom = 20.0
size_flags_horizontal = 3
text = "Trainer"
[node name="Button" type="Button" parent="PanelContainer/VBoxContainer/HBoxContainer2"]
margin_left = 349.0
margin_right = 379.0
margin_bottom = 26.5702
rect_min_size = Vector2( 30, 0 )
text = "X"
[node name="PanelContainer3" type="PanelContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 34.0
margin_right = 379.0
margin_bottom = 221.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer/PanelContainer3"]
margin_left = 4.0
margin_top = 4.0
margin_right = 375.0
margin_bottom = 183.0
size_flags_horizontal = 3
size_flags_vertical = 3
scroll_horizontal_enabled = false
[node name="Spells" type="VBoxContainer" parent="PanelContainer/VBoxContainer/PanelContainer3/ScrollContainer"]
margin_right = 371.0
size_flags_horizontal = 3
custom_constants/separation = 2
[node name="PanelContainer2" type="PanelContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 229.0
margin_right = 379.0
margin_bottom = 416.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/PanelContainer2"]
margin_left = 4.0
margin_top = 4.0
margin_right = 375.0
margin_bottom = 183.0
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer"]
margin_right = 371.0
margin_bottom = 156.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer"]
margin_right = 60.0
margin_bottom = 156.0
[node name="Icon" type="TextureRect" parent="PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer"]
margin_right = 60.0
margin_bottom = 60.0
rect_min_size = Vector2( 60, 60 )
expand = true
[node name="VBoxContainer2" type="VBoxContainer" parent="PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer"]
margin_left = 64.0
margin_right = 371.0
margin_bottom = 156.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Name" type="Label" parent="PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer2"]
margin_right = 307.0
margin_bottom = 15.0
size_flags_horizontal = 3
size_flags_vertical = 5
[node name="Requirements" type="Label" parent="PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer2"]
margin_top = 23.0
margin_right = 307.0
margin_bottom = 38.0
size_flags_horizontal = 3
size_flags_vertical = 5
[node name="Description" type="Label" parent="PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer2"]
margin_top = 46.0
margin_right = 307.0
margin_bottom = 156.0
size_flags_horizontal = 3
size_flags_vertical = 7
autowrap = true
[node name="HBoxContainer2" type="HBoxContainer" parent="PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer"]
margin_top = 164.0
margin_right = 371.0
margin_bottom = 179.0
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer2"]
margin_right = 36.0
margin_bottom = 15.0
text = "Costs "
[node name="Price" type="Label" parent="PanelContainer/VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer2"]
margin_left = 40.0
margin_right = 40.0
margin_bottom = 15.0
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 424.0
margin_right = 379.0
margin_bottom = 450.0
alignment = 2
[node name="Train" type="Button" parent="PanelContainer/VBoxContainer/HBoxContainer"]
margin_left = 279.0
margin_right = 379.0
margin_bottom = 26.5702
rect_min_size = Vector2( 100, 0 )
text = "Learn"
[connection signal="pressed" from="PanelContainer/VBoxContainer/HBoxContainer2/Button" to="." method="hide"]

View File

@ -0,0 +1,11 @@
[gd_resource type="Resource" load_steps=3 format=2]
[ext_resource path="res://ui/trainer/TrainerWindow.tscn" type="PackedScene" id=1]
[ext_resource path="res://scripts/game_modules/ui_window_module.gd" type="Script" id=2]
[resource]
script = ExtResource( 2 )
enabled = true
scene = ExtResource( 1 )
index = -1
add_button = false

View File

@ -1,153 +0,0 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/windows/TrainerWindow.gd" type="Script" id=1]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2]
[node name="TrainerWindow" type="PanelContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource( 2 )
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
spell_entry_container_path = NodePath("VBoxContainer/PanelContainer3/ScrollContainer/Spells")
learn_button_path = NodePath("VBoxContainer/HBoxContainer/Train")
cost_label_path = NodePath("VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer2/Price")
spell_icon_path = NodePath("VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer/Icon")
spell_name_label_path = NodePath("VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer2/Name")
spell_description_label_path = NodePath("VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer2/Description")
spell_requirements_label_path = NodePath("VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer2/Requirements")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 4.0
margin_top = 4.0
margin_right = 1020.0
margin_bottom = 596.0
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 1016.0
margin_bottom = 26.0
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer2"]
margin_top = 5.0
margin_right = 982.0
margin_bottom = 20.0
size_flags_horizontal = 3
text = "Trainer"
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer2"]
margin_left = 986.0
margin_right = 1016.0
margin_bottom = 26.5702
rect_min_size = Vector2( 30, 0 )
text = "X"
[node name="PanelContainer3" type="PanelContainer" parent="VBoxContainer"]
margin_top = 34.0
margin_right = 1016.0
margin_bottom = 292.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/PanelContainer3"]
margin_left = 4.0
margin_top = 4.0
margin_right = 1012.0
margin_bottom = 254.0
size_flags_horizontal = 3
size_flags_vertical = 3
scroll_horizontal_enabled = false
[node name="Spells" type="VBoxContainer" parent="VBoxContainer/PanelContainer3/ScrollContainer"]
margin_right = 1008.0
size_flags_horizontal = 3
custom_constants/separation = 2
[node name="PanelContainer2" type="PanelContainer" parent="VBoxContainer"]
margin_top = 300.0
margin_right = 1016.0
margin_bottom = 558.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/PanelContainer2"]
margin_left = 4.0
margin_top = 4.0
margin_right = 1012.0
margin_bottom = 254.0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/PanelContainer2/VBoxContainer"]
margin_right = 1008.0
margin_bottom = 227.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer"]
margin_right = 60.0
margin_bottom = 227.0
[node name="Icon" type="TextureRect" parent="VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer"]
margin_right = 60.0
margin_bottom = 60.0
rect_min_size = Vector2( 60, 60 )
expand = true
[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer"]
margin_left = 64.0
margin_right = 1008.0
margin_bottom = 227.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Name" type="Label" parent="VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer2"]
margin_right = 944.0
margin_bottom = 15.0
size_flags_horizontal = 3
size_flags_vertical = 5
[node name="Requirements" type="Label" parent="VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer2"]
margin_top = 23.0
margin_right = 944.0
margin_bottom = 38.0
size_flags_horizontal = 3
size_flags_vertical = 5
[node name="Description" type="Label" parent="VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer/VBoxContainer2"]
margin_top = 46.0
margin_right = 944.0
margin_bottom = 227.0
size_flags_horizontal = 3
size_flags_vertical = 7
autowrap = true
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/PanelContainer2/VBoxContainer"]
margin_top = 235.0
margin_right = 1008.0
margin_bottom = 250.0
[node name="Label" type="Label" parent="VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer2"]
margin_right = 36.0
margin_bottom = 15.0
text = "Costs "
[node name="Price" type="Label" parent="VBoxContainer/PanelContainer2/VBoxContainer/HBoxContainer2"]
margin_left = 40.0
margin_right = 40.0
margin_bottom = 15.0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 566.0
margin_right = 1016.0
margin_bottom = 592.0
alignment = 2
[node name="Train" type="Button" parent="VBoxContainer/HBoxContainer"]
margin_left = 916.0
margin_right = 1016.0
margin_bottom = 26.5702
rect_min_size = Vector2( 100, 0 )
text = "Learn"
[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Button" to="." method="hide"]

View File

@ -1,33 +0,0 @@
extends VBoxContainer
# Copyright (c) 2019-2020 Péter Magyar
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass