Updated the UI. Also added the things that were missing.

This commit is contained in:
Relintai 2021-02-21 00:39:10 +01:00
parent ccae78e3be
commit 2c8a120b8e
105 changed files with 3450 additions and 1550 deletions

View File

@ -394,8 +394,9 @@ func on_c_controlled_changed(val):
add_child(camera)
camera.current = true
var uiscn : PackedScene = ResourceLoader.load("res://ui/player_ui/player_ui.tscn")
var ui = uiscn.instance()
#var uiscn : PackedScene = ResourceLoader.load("res://ui/player_ui/player_ui.tscn")
#var ui = uiscn.instance()
var ui = DataManager.request_instance(DataManager.PLAYER_UI_INSTANCE)
add_child(ui)
# set_process_input(true)

View File

@ -209,6 +209,8 @@ window/stretch/mode="2d"
window/stretch/aspect="expand"
mouse_cursor/sensitivity=0.9
window/size/viewport_scale=100
window/size/ui_scale=1.2
window/size/ui_scale_touch=1.0
[ess]

View File

@ -260,4 +260,5 @@ margin_top = 439.0
margin_right = 728.0
margin_bottom = 465.57
text = "Close"
[connection signal="pressed" from="PanelContainer/VBoxContainer/Close" to="." method="hide"]

View File

@ -53,6 +53,8 @@ func _ready() -> void:
keybind_text = get_node(keybind_text_path) as Label
button.connect("pressed", self, "_on_button_pressed")
ProfileManager.connect("keybinds_changed", self, "on_keybinds_changed")
func _exit_tree():
if icon_rect.texture != null:
@ -116,8 +118,29 @@ func set_button_entry(action_bar_button_entry: ActionBarButtonEntry, p_player: E
if not InputMap.has_action(action_name):
InputMap.add_action(action_name)
on_keybinds_changed()
iea.action = action_name
iea.pressed = true
var sc : ShortCut = ShortCut.new()
sc.shortcut = iea
shortcut = sc
setup_icon()
refresh_known()
func on_keybinds_changed():
var action_name : String = "actionbar_" + str(button_entry.action_bar_id) + "_" + str(button_entry.slot_id)
keybind_text.text = ""
if not InputMap.has_action(action_name):
return
var action_list : Array = InputMap.get_action_list(action_name)
keybind_text.text = ""
for action in action_list:
if action is InputEventKey:
var s : String = ""
@ -141,14 +164,6 @@ func set_button_entry(action_bar_button_entry: ActionBarButtonEntry, p_player: E
keybind_text.text = s
iea.action = action_name
iea.pressed = true
var sc : ShortCut = ShortCut.new()
sc.shortcut = iea
shortcut = sc
setup_icon()
func setup_icon() -> void:
if (button_entry.type == ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_NONE):
if icon_rect.texture != null:
@ -276,6 +291,27 @@ func drop_data(pos, esd) -> void:
setup_icon()
refresh_known()
func refresh_known():
if !player:
set_known(true)
return
if (button_entry.type == ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_NONE):
set_known(true)
elif (button_entry.type == ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_SPELL):
var spell = ESS.resource_db.get_spell_path(button_entry.item_path)
set_known(player.spell_hasc(spell))
elif (button_entry.type == ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_ITEM):
set_known(true)
func set_known(val : bool):
if val:
icon_rect.modulate = Color(1, 1, 1, 1)
else:
icon_rect.modulate = Color(0.5, 0.5, 0.5, 1)
func set_player(p_player: Entity) -> void:
if not player == null:
@ -287,6 +323,9 @@ func set_player(p_player: Entity) -> void:
player.disconnect("cgcd_started", self, "_cgcd_started")
player.disconnect("cgcd_finished", self, "_cgcd_finished")
player.disconnect("cspell_added", self, "_cspell_added")
player.disconnect("cspell_removed", self, "_cspell_removed")
player = null
player = p_player
@ -304,7 +343,17 @@ func set_player(p_player: Entity) -> void:
player.connect("cgcd_started", self, "_cgcd_started")
player.connect("cgcd_finished", self, "_cgcd_finished")
player.connect("cspell_added", self, "_cspell_added")
player.connect("cspell_removed", self, "_cspell_removed")
func _cspell_added(entity: Entity, spell: Spell):
if button_entry.type == ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_SPELL && button_entry.item_path == spell.resource_path:
set_known(true)
func _cspell_removed(entity: Entity, spell: Spell):
if button_entry.type == ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_SPELL && button_entry.item_path == spell.resource_path:
set_known(false)
func _ccooldown_added(id : int, value : float) -> void:
if id == spell_id:
@ -327,7 +376,7 @@ func _ccategory_cooldown_removed(id : int, value : float) -> void:
categ_cd = 0
func _cgcd_started(value :float) -> void:
func _cgcd_started(e : Entity, value :float) -> void:
if not has_gcd:
return
@ -335,5 +384,5 @@ func _cgcd_started(value :float) -> void:
show_cooldown_timer(value)
set_process(true)
func _cgcd_finished() -> void:
func _cgcd_finished(val) -> void:
gcd = 0

View File

@ -50,8 +50,6 @@ func _centity_data_changed(cls: EntityData) -> void:
_abp = _player.get_action_bar_profile()
_abp.connect("changed", self, "on_changed")
for i in range(_abp.get_action_bar_count()):
var abe = _abp.get_action_bar(i)
var s = actionbar_scene.instance()
@ -62,8 +60,6 @@ func _centity_data_changed(cls: EntityData) -> void:
s.owner = self
func on_changed():
ProfileManager.save()
func clear_actionbars() -> void:
var children = get_children()

View File

@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/actionbars/Actionbars.gd" type="Script" id=1]
[ext_resource path="res://ui/actionbars/ActionBar.tscn" type="PackedScene" id=2]
[node name="Actionbars" type="HBoxContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 0
alignment = 2
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
actionbar_scene = ExtResource( 2 )

View File

@ -0,0 +1,10 @@
[gd_resource type="Resource" load_steps=3 format=2]
[ext_resource path="res://scripts/game_modules/ui_gui_child_module.gd" type="Script" id=1]
[ext_resource path="res://ui/actionbars/Actionbars.tscn" type="PackedScene" id=2]
[resource]
script = ExtResource( 1 )
enabled = true
scene = ExtResource( 2 )
hide = false

View File

@ -1,4 +1,4 @@
extends MarginContainer
extends Control
# Copyright (c) 2019-2020 Péter Magyar
#

View File

@ -3,38 +3,41 @@
[ext_resource path="res://ui/auraframe/AuraFrame.gd" type="Script" id=1]
[ext_resource path="res://ui/auraframe/AuraEntry.tscn" type="PackedScene" id=2]
[node name="AuraFrame" type="MarginContainer"]
anchor_left = 1.0
[node name="AuraFrame" type="Control"]
anchor_right = 1.0
margin_left = -376.0
margin_right = -1.0
margin_bottom = 160.0
anchor_bottom = 1.0
mouse_filter = 2
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
aura_entry_scene = ExtResource( 2 )
buff_container_path = NodePath("VBoxContainer/Buffs")
debuff_container_path = NodePath("VBoxContainer/Debuffs")
buff_container_path = NodePath("MarginContainer/VBoxContainer/Buffs")
debuff_container_path = NodePath("MarginContainer/VBoxContainer/Debuffs")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_right = 375.0
margin_bottom = 160.0
[node name="MarginContainer" type="MarginContainer" parent="."]
anchor_left = 1.0
anchor_right = 1.0
margin_left = -335.0
margin_bottom = 157.0
[node name="VBoxContainer" type="VBoxContainer" parent="MarginContainer"]
margin_right = 335.0
margin_bottom = 157.0
mouse_filter = 2
[node name="Buffs" type="GridContainer" parent="VBoxContainer"]
margin_right = 375.0
[node name="Buffs" type="GridContainer" parent="MarginContainer/VBoxContainer"]
margin_right = 335.0
margin_bottom = 76.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
columns = 9
[node name="Debuffs" type="GridContainer" parent="VBoxContainer"]
margin_top = 84.0
margin_right = 375.0
margin_bottom = 160.0
[node name="Debuffs" type="GridContainer" parent="MarginContainer/VBoxContainer"]
margin_top = 80.0
margin_right = 335.0
margin_bottom = 157.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3

View File

@ -0,0 +1,10 @@
[gd_resource type="Resource" load_steps=3 format=2]
[ext_resource path="res://scripts/game_modules/ui_gui_child_module.gd" type="Script" id=1]
[ext_resource path="res://ui/auraframe/AuraFrame.tscn" type="PackedScene" id=2]
[resource]
script = ExtResource( 1 )
enabled = true
scene = ExtResource( 2 )
hide = false

View File

@ -30,6 +30,9 @@ var loaded : bool = false
var _config_file : ConfigFile = ConfigFile.new()
var _settings : Dictionary = {
"rendering" : {
"window_size" : OS.window_size,
"window_position" : OS.window_position,
"viewport_scale" : ProjectSettings.get("display/window/size/viewport_scale"),
"thread_model" : ProjectSettings.get("rendering/threads/thread_model"),
"borderless" : ProjectSettings.get("display/window/size/borderless"),
@ -41,6 +44,8 @@ var _settings : Dictionary = {
},
"ui" : {
"touchscreen_mode" : OS.has_touchscreen_ui_hint(),
"ui_scale" : ProjectSettings.get("display/window/size/ui_scale"),
"ui_scale_touch" : ProjectSettings.get("display/window/size/ui_scale_touch"),
},
"debug" : {
"debug_info" : false
@ -65,7 +70,30 @@ func _ready():
InputMap.action_erase_event(action, a)
InputMap.action_add_event(action, nie)
set_stretch()
setup_window()
func _exit_tree():
if OS.window_fullscreen:
return
var wp : Vector2 = OS.window_position
var ws : Vector2 = OS.window_size
var wpr = get_value("rendering", "window_position")
var wsr = get_value("rendering", "window_size")
if int(wp.x) != int(wpr.x) || \
int(wp.y) != int(wpr.y) || \
int(ws.x) != int(wsr.x) || \
int(ws.y) != int(wsr.y):
#don't use set_value() here, as the app is quitting
_settings["rendering"]["window_size"] = ws
_settings["rendering"]["window_position"] = wp
save_settings()
func set_value(section, key, value) -> void:
_settings[section][key] = value
@ -117,6 +145,9 @@ func set_rendering_fullscreen(value : bool) -> void:
ProjectSettings.set("display/window/size/fullscreen", value)
OS.window_fullscreen = value
if !value:
setup_window()
func set_rendering_always_on_top(value : bool) -> void:
ProjectSettings.set("display/window/size/always_on_top", value)
OS.set_window_always_on_top(value)
@ -140,4 +171,57 @@ func set_rendering_vsync_via_compositor(value : bool) -> void:
ProjectSettings.set("display/window/vsync/vsync_via_compositor", value)
OS.vsync_via_compositor = value
func set_ui_touchscreen_mode(value : bool) -> void:
set_stretch()
func set_ui_ui_scale(value : float) -> void:
ProjectSettings.set("rendering/window/size/ui_scale", value)
set_stretch()
func set_ui_ui_scale_touch(value : float) -> void:
ProjectSettings.set("rendering/window/size/ui_scale_touch", value)
set_stretch()
func set_stretch():
if !loaded:
return
var stretch_mode : String = ProjectSettings.get("display/window/stretch/mode")
var stretch_aspect : String = ProjectSettings.get("display/window/stretch/aspect")
var stretch_size : Vector2 = Vector2(ProjectSettings.get("display/window/size/width"), ProjectSettings.get("display/window/size/height"))
var stretch_shrink : float = ProjectSettings.get("display/window/stretch/shrink")
var uiscale : float = 1
if !get_value("ui", "touchscreen_mode"):
uiscale = get_value("ui", "ui_scale")
else:
uiscale = get_value("ui", "ui_scale_touch")
stretch_size *= uiscale
var sml_sm = SceneTree.STRETCH_MODE_DISABLED;
if (stretch_mode == "2d"):
sml_sm = SceneTree.STRETCH_MODE_2D;
elif (stretch_mode == "viewport"):
sml_sm = SceneTree.STRETCH_MODE_VIEWPORT;
var sml_aspect = SceneTree.STRETCH_ASPECT_IGNORE;
if (stretch_aspect == "keep"):
sml_aspect = SceneTree.STRETCH_ASPECT_KEEP;
elif (stretch_aspect == "keep_width"):
sml_aspect = SceneTree.STRETCH_ASPECT_KEEP_WIDTH;
elif (stretch_aspect == "keep_height"):
sml_aspect = SceneTree.STRETCH_ASPECT_KEEP_HEIGHT;
elif (stretch_aspect == "expand"):
sml_aspect = SceneTree.STRETCH_ASPECT_EXPAND;
get_tree().set_screen_stretch(sml_sm, sml_aspect, stretch_size, stretch_shrink)
func setup_window():
if OS.window_fullscreen:
return
OS.window_position = get_value("rendering", "window_position")
OS.window_size = get_value("rendering", "window_size")

View File

@ -6,255 +6,260 @@
[ext_resource path="res://ui/bags/EquipmentSlot.tscn" type="PackedScene" id=4]
[ext_resource path="res://ui/bags/ItemTooltip.tscn" type="PackedScene" id=5]
[node name="Inventory" type="PanelContainer"]
[node name="Inventory" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
theme = ExtResource( 1 )
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
inventory_item_scene = ExtResource( 3 )
inventory_item_container_path = NodePath("VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/ScrollContainer/GridContainer")
item_tooltip_path = NodePath("TooltipContainer/ItemTooltip")
inventory_slots = [ NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer/Head"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2/Neck"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2/Shoulder"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3/Chest"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2/Hands"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4/Belt"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5/Legs"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5/Feet"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3/Ring1"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3/Ring2"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4/Trinket1"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4/Trinket2"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer/MainHand"), NodePath("VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer/OffHand") ]
inventory_item_container_path = NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/ScrollContainer/GridContainer")
item_tooltip_path = NodePath("ItemTooltip")
inventory_slots = [ NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer/Head"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2/Neck"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2/Shoulder"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3/Chest"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2/Hands"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4/Belt"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5/Legs"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5/Feet"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3/Ring1"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3/Ring2"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4/Trinket1"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4/Trinket2"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer/MainHand"), NodePath("PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer/OffHand") ]
[node name="VBoxContainer" type="VBoxContainer" parent="."]
[node name="PanelContainer" type="PanelContainer" parent="."]
margin_left = 103.0
margin_top = 37.0
margin_right = 692.0
margin_bottom = 527.0
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 1020.0
margin_bottom = 596.0
margin_right = 585.0
margin_bottom = 486.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 1016.0
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
margin_right = 581.0
margin_bottom = 26.0
[node name="BagName" type="Label" parent="VBoxContainer/HBoxContainer"]
[node name="BagName" type="Label" parent="PanelContainer/VBoxContainer/HBoxContainer"]
margin_top = 5.0
margin_right = 982.0
margin_right = 547.0
margin_bottom = 20.0
size_flags_horizontal = 3
size_flags_vertical = 6
text = "Inventory"
align = 1
[node name="CloseButton" type="Button" parent="VBoxContainer/HBoxContainer"]
margin_left = 986.0
margin_right = 1016.0
margin_bottom = 26.269
[node name="CloseButton" type="Button" parent="PanelContainer/VBoxContainer/HBoxContainer"]
margin_left = 551.0
margin_right = 581.0
margin_bottom = 26.5702
rect_min_size = Vector2( 30, 20 )
text = "X"
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"]
[node name="HBoxContainer3" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 34.0
margin_right = 1016.0
margin_bottom = 592.0
margin_right = 581.0
margin_bottom = 482.0
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 1
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/HBoxContainer3"]
[node name="PanelContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3"]
margin_right = 227.96
margin_bottom = 558.0
margin_bottom = 448.0
rect_min_size = Vector2( 227.96, 0 )
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer"]
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 223.96
margin_bottom = 554.0
margin_bottom = 444.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 10
alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 96.0
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 41.0
margin_right = 219.0
margin_bottom = 146.0
margin_bottom = 91.0
size_flags_horizontal = 3
alignment = 1
[node name="Head" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer" instance=ExtResource( 4 )]
[node name="Head" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer" instance=ExtResource( 4 )]
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 156.0
[node name="HBoxContainer2" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 101.0
margin_right = 219.0
margin_bottom = 206.0
margin_bottom = 151.0
size_flags_horizontal = 3
alignment = 1
[node name="Shoulder" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2" instance=ExtResource( 4 )]
[node name="Shoulder" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2" instance=ExtResource( 4 )]
margin_left = 30.0
margin_right = 80.0
text = "sh"
equip_slot = 2
[node name="Neck" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2" instance=ExtResource( 4 )]
[node name="Neck" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2" instance=ExtResource( 4 )]
text = "Neck"
equip_slot = 1
[node name="Hands" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2" instance=ExtResource( 4 )]
[node name="Hands" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer2" instance=ExtResource( 4 )]
margin_left = 138.0
margin_right = 188.0
text = "Hands"
equip_slot = 4
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 216.0
[node name="HBoxContainer3" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 161.0
margin_right = 219.0
margin_bottom = 266.0
margin_bottom = 211.0
size_flags_horizontal = 3
alignment = 1
[node name="Ring1" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3" instance=ExtResource( 4 )]
[node name="Ring1" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3" instance=ExtResource( 4 )]
margin_left = 30.0
margin_right = 80.0
text = "Ring"
equip_slot = 8
texture_path = NodePath("../Ring1/MarginContainer/TextureRect")
[node name="Chest" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3" instance=ExtResource( 4 )]
[node name="Chest" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3" instance=ExtResource( 4 )]
text = "Chest"
equip_slot = 3
[node name="Ring2" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3" instance=ExtResource( 4 )]
[node name="Ring2" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer3" instance=ExtResource( 4 )]
margin_left = 138.0
margin_right = 188.0
text = "Ring"
equip_slot = 9
[node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 276.0
[node name="HBoxContainer4" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 221.0
margin_right = 219.0
margin_bottom = 326.0
margin_bottom = 271.0
size_flags_horizontal = 3
alignment = 1
[node name="Trinket1" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4" instance=ExtResource( 4 )]
[node name="Trinket1" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4" instance=ExtResource( 4 )]
margin_left = 30.0
margin_right = 80.0
text = "Tr"
equip_slot = 10
[node name="Belt" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4" instance=ExtResource( 4 )]
[node name="Belt" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4" instance=ExtResource( 4 )]
text = "Belt"
equip_slot = 5
[node name="Trinket2" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4" instance=ExtResource( 4 )]
[node name="Trinket2" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer4" instance=ExtResource( 4 )]
margin_left = 138.0
margin_right = 188.0
text = "Tr"
equip_slot = 11
[node name="HBoxContainer5" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 336.0
[node name="HBoxContainer5" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 281.0
margin_right = 219.0
margin_bottom = 386.0
margin_bottom = 331.0
size_flags_horizontal = 3
alignment = 1
[node name="Legs" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5" instance=ExtResource( 4 )]
[node name="Legs" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5" instance=ExtResource( 4 )]
margin_left = 57.0
margin_right = 107.0
text = "Legs"
equip_slot = 6
[node name="Feet" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5" instance=ExtResource( 4 )]
[node name="Feet" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer5" instance=ExtResource( 4 )]
margin_left = 111.0
margin_right = 161.0
text = "Feet"
equip_slot = 7
[node name="HBoxContainer6" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 396.0
[node name="HBoxContainer6" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 341.0
margin_right = 219.0
margin_bottom = 454.0
margin_bottom = 399.0
size_flags_horizontal = 3
alignment = 1
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6"]
[node name="PanelContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6"]
margin_left = 53.0
margin_right = 165.0
margin_bottom = 58.0
size_flags_horizontal = 0
size_flags_vertical = 0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer"]
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 108.0
margin_bottom = 54.0
[node name="MainHand" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer" instance=ExtResource( 4 )]
[node name="MainHand" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer" instance=ExtResource( 4 )]
margin_left = 0.0
margin_right = 50.0
text = "MH"
equip_slot = 12
[node name="OffHand" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer" instance=ExtResource( 4 )]
[node name="OffHand" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer6/PanelContainer/HBoxContainer" instance=ExtResource( 4 )]
margin_left = 54.0
margin_right = 104.0
text = "OH"
equip_slot = 13
texture_path = NodePath("../OffHand/MarginContainer/TextureRect")
[node name="PanelContainer2" type="PanelContainer" parent="VBoxContainer/HBoxContainer3"]
[node name="PanelContainer2" type="PanelContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3"]
margin_left = 231.0
margin_right = 1016.0
margin_bottom = 558.0
margin_right = 581.0
margin_bottom = 448.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer2"]
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2"]
margin_left = 4.0
margin_top = 4.0
margin_right = 781.0
margin_bottom = 554.0
margin_right = 346.0
margin_bottom = 444.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer"]
margin_right = 777.0
margin_bottom = 516.0
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer"]
margin_right = 342.0
margin_bottom = 406.0
size_flags_horizontal = 3
size_flags_vertical = 3
scroll_horizontal_enabled = false
[node name="GridContainer" type="GridContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/ScrollContainer"]
[node name="GridContainer" type="GridContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/ScrollContainer"]
size_flags_horizontal = 2
size_flags_vertical = 2
custom_constants/vseparation = 5
custom_constants/hseparation = 5
columns = 6
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer"]
margin_top = 524.0
margin_right = 777.0
margin_bottom = 550.0
[node name="HBoxContainer2" type="HBoxContainer" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer"]
margin_top = 414.0
margin_right = 342.0
margin_bottom = 440.0
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/HBoxContainer2"]
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/HBoxContainer2"]
margin_top = 5.0
margin_right = 743.0
margin_right = 308.0
margin_bottom = 20.0
size_flags_horizontal = 3
text = "190 "
align = 2
[node name="ResizeButton" type="Button" parent="VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/HBoxContainer2"]
margin_left = 747.0
margin_right = 777.0
margin_bottom = 26.269
[node name="ResizeButton" type="Button" parent="PanelContainer/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/HBoxContainer2"]
margin_left = 312.0
margin_right = 342.0
margin_bottom = 26.5702
rect_min_size = Vector2( 30, 20 )
[node name="TooltipContainer" type="Control" parent="."]
[node name="ItemTooltip" parent="." instance=ExtResource( 5 )]
toplevel = false
margin_left = 4.0
margin_top = 4.0
margin_right = 1020.0
margin_bottom = 596.0
mouse_filter = 2
margin_right = 299.0
margin_bottom = 227.0
[node name="ItemTooltip" parent="TooltipContainer" instance=ExtResource( 5 )]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/CloseButton" to="." method="hide"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/HBoxContainer/CloseButton" to="." method="hide"]

View File

@ -190,7 +190,7 @@ func drop_data(pos, esd) -> void:
player.item_crequest_swap(slot_id, esd.get_meta("slot_id"))
setup_icon()
elif esd.type == ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_EQUIPPED_ITEM:
player.equip_crequest(ESS.resource_db.get_item_template_path(esd.item_path).id, slot_id)
player.equip_crequest(ESS.resource_db.get_item_template_path(esd.item_path).equip_slot, slot_id)
setup_icon()
func set_slot_id(pslot_id : int) -> void:
@ -231,7 +231,7 @@ func _ccooldown_removed(id : int, value : float) -> void:
if id == spell_id:
cd = 0
func _cgcd_started(value :float) -> void:
func _cgcd_started(entity: Entity, value :float) -> void:
if not has_gcd:
return
@ -239,7 +239,7 @@ func _cgcd_started(value :float) -> void:
show_cooldown_timer(value)
set_process(true)
func _cgcd_finished() -> void:
func _cgcd_finished(entity) -> void:
gcd = 0
func _on_button_pressed() -> void:

View File

@ -50,6 +50,8 @@ func set_player(player: Entity) -> void:
_player.connect("equip_con_success", self, "equip_con_success")
equip_con_success(player, equip_slot, player.equip_getc_slot(equip_slot), null, 0)
func drop_data(position, data):
if _player == null:
return
@ -98,7 +100,7 @@ func equip_con_success(entity: Entity, pequip_slot: int, item: ItemInstance, old
return
_item_instance = item
if item == null:
_texture.texture = null
return

View File

@ -1,4 +1,4 @@
extends PanelContainer
extends Control
# Copyright (c) 2019-2020 Péter Magyar
#
@ -20,6 +20,8 @@ extends PanelContainer
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
var opener_button : BaseButton
export(PackedScene) var inventory_item_scene : PackedScene
export(NodePath) var inventory_item_container_path : NodePath
export(NodePath) var item_tooltip_path : NodePath
@ -46,6 +48,7 @@ func _ready() -> void:
func set_player(p_player: Entity) -> void:
if _player != null:
_player.disconnect("cbag_changed", self, "cbag_changed")
_player.disconnect("equip_con_success", self, "equip_con_success")
for ie in _inventory_item_container.get_children():
ie.queue_free()
@ -53,6 +56,7 @@ func set_player(p_player: Entity) -> void:
_player = p_player
_player.connect("cbag_changed", self, "cbag_changed")
_player.connect("equip_con_success", self, "equip_con_success")
cbag_changed(_player, _player.cbag)
@ -121,13 +125,25 @@ func item_removed(bag: Bag, item: ItemInstance, slot_id: int) -> void:
func item_swapped(bag: Bag, item1_slot : int, item2_slot: int) -> void:
refresh_bags()
func on_visibility_changed() -> void:
func equip_con_success(entity, equip_slot, item, old_item, bag_slot) -> void:
refresh_bags()
func on_visibility_changed():
refresh_bags()
if opener_button:
if visible && !opener_button.pressed:
opener_button.pressed = true
return
if !visible && opener_button.pressed:
opener_button.pressed = false
func _on_BagButton_toggled(button_pressed):
func _on_button_toggled(button_pressed):
if button_pressed:
show()
if !visible:
show()
else:
hide()
if visible:
hide()

View File

@ -1,7 +1,9 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/windows/inventory/ItemEntry.tscn" type="PackedScene" id=1]
[ext_resource path="res://ui/windows/base/BaseWindow.tscn" type="PackedScene" id=2]
[ext_resource path="res://ui/bags/ItemEntry.tscn" type="PackedScene" id=1]
[ext_resource path="res://ui/bags/BaseWindow.tscn" type="PackedScene" id=2]
[node name="InventoryWindow" type="Control"]
margin_right = 888.0

View File

@ -0,0 +1,13 @@
[gd_resource type="Resource" load_steps=4 format=2]
[ext_resource path="res://ui/theme/bag_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/bags/Bag.tscn" type="PackedScene" id=3]
[resource]
script = ExtResource( 2 )
enabled = true
scene = ExtResource( 3 )
opener_button_texture = ExtResource( 1 )
index = 3
add_button = true

View File

@ -20,6 +20,8 @@ extends Control
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
export (PackedScene) var image_button : PackedScene
export (NodePath) var spell_book_path
export (NodePath) var spell_book_button_path
var spell_book
@ -34,6 +36,26 @@ func _ready():
lock_button = get_node(lock_button_path)
lock_button.connect("pressed", self, "_lock_button_click")
func add_image_button(texture : Texture, index : int = -1) -> Button:
var button : Button = image_button.instance() as Button
button.set_meta("button_index", index)
button.get_child(0).texture = texture
add_child(button)
for ch in get_children():
var button_index : int = get_child_count()
if ch.has_meta("button_index"):
button_index = ch.get_meta("button_index")
if button_index != -1:
move_child(ch, button_index)
return button
func set_player(p_player):
player = p_player

View File

@ -0,0 +1,26 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://ui/theme/character_icon.tres" type="Texture" id=1]
[node name="ImageButton" type="Button"]
margin_right = 25.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
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureRect" type="TextureRect" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
texture = ExtResource( 1 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -0,0 +1,10 @@
[gd_resource type="Resource" load_steps=3 format=2]
[ext_resource path="res://scripts/game_modules/ui_gui_child_module.gd" type="Script" id=1]
[ext_resource path="res://ui/castbar/Castbar.tscn" type="PackedScene" id=2]
[resource]
script = ExtResource( 1 )
enabled = true
scene = ExtResource( 2 )
hide = true

View File

@ -0,0 +1,33 @@
extends Control
#export(NodePath) var opener_button_path : NodePath
var opener_button : BaseButton
export(NodePath) var container_path : NodePath
var container : Node
var _player : Entity
func _ready():
# opener_button = get_node_or_null(opener_button_path) as BaseButton
container = get_node(container_path)
func set_player(p_player: Entity) -> void:
_player = p_player
for c in container.get_children():
if c.has_method("set_player"):
c.set_player(_player)
func _on_button_toggled(button_pressed):
if button_pressed:
show()
else:
hide()
func _on_Button_pressed():
if opener_button:
opener_button.pressed = false
hide()

View File

@ -0,0 +1,385 @@
[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/character/CharacterWindow.gd" type="Script" id=2]
[ext_resource path="res://ui/character/SingleStatRow.tscn" type="PackedScene" id=3]
[node name="CharacterWindow" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
theme = ExtResource( 1 )
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
container_path = NodePath("Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer")
[node name="Panel" type="PanelContainer" parent="."]
margin_left = 52.0
margin_top = 54.0
margin_right = 288.0
margin_bottom = 421.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="Panel"]
margin_left = 4.0
margin_top = 4.0
margin_right = 232.0
margin_bottom = 363.0
[node name="HBoxContainer" type="HBoxContainer" parent="Panel/VBoxContainer"]
margin_right = 228.0
margin_bottom = 30.0
rect_min_size = Vector2( 0, 30 )
[node name="Label" type="Label" parent="Panel/VBoxContainer/HBoxContainer"]
margin_top = 7.0
margin_right = 194.0
margin_bottom = 22.0
size_flags_horizontal = 3
text = "Character"
[node name="Button" type="Button" parent="Panel/VBoxContainer/HBoxContainer"]
margin_left = 198.0
margin_right = 228.0
margin_bottom = 30.0
rect_min_size = Vector2( 30, 30 )
text = "X"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HBoxContainer2" type="HBoxContainer" parent="Panel/VBoxContainer"]
margin_top = 38.0
margin_right = 228.0
margin_bottom = 359.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="ScrollContainer" type="ScrollContainer" parent="Panel/VBoxContainer/HBoxContainer2"]
margin_right = 228.0
margin_bottom = 321.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="MarginContainer" type="MarginContainer" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer"]
margin_right = 218.0
margin_bottom = 1066.0
size_flags_horizontal = 3
custom_constants/margin_right = 8
custom_constants/margin_left = 6
[node name="VBoxContainer" type="VBoxContainer" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer"]
margin_left = 6.0
margin_right = 210.0
margin_bottom = 1066.0
size_flags_horizontal = 3
[node name="Agility" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_right = 204.0
stat_name = "Agility"
[node name="Strength" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 23.0
margin_right = 204.0
margin_bottom = 38.0
stat_name = "Strength"
[node name="Stamina" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 46.0
margin_right = 204.0
margin_bottom = 61.0
stat_name = "Stamina"
[node name="Intellect" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 69.0
margin_right = 204.0
margin_bottom = 84.0
stat_name = "Intellect"
[node name="Spirit" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 92.0
margin_right = 204.0
margin_bottom = 107.0
stat_name = "Spirit"
[node name="Separator" type="Control" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 115.0
margin_right = 204.0
margin_bottom = 119.0
rect_min_size = Vector2( 0, 4 )
[node name="Health" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 127.0
margin_right = 204.0
margin_bottom = 142.0
stat_name = "Health"
[node name="Mana" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 150.0
margin_right = 204.0
margin_bottom = 165.0
stat_name = "Mana"
[node name="Speed" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 173.0
margin_right = 204.0
margin_bottom = 188.0
stat_name = "Speed"
[node name="Haste" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 196.0
margin_right = 204.0
margin_bottom = 211.0
stat_name = "Haste"
[node name="HasteRating" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 219.0
margin_right = 204.0
margin_bottom = 234.0
stat_name = "Haste Rating"
[node name="Separator2" type="Control" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 242.0
margin_right = 204.0
margin_bottom = 246.0
rect_min_size = Vector2( 0, 4 )
[node name="Resilience" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 254.0
margin_right = 204.0
margin_bottom = 269.0
stat_name = "Resilience"
[node name="Armor" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 277.0
margin_right = 204.0
margin_bottom = 292.0
stat_name = "Armor"
[node name="Separator4" type="Control" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 300.0
margin_right = 204.0
margin_bottom = 304.0
rect_min_size = Vector2( 0, 4 )
[node name="AttackPower" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 312.0
margin_right = 204.0
margin_bottom = 327.0
stat_name = "Attack Power"
[node name="SpellPower" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 335.0
margin_right = 204.0
margin_bottom = 350.0
stat_name = "Spell Power"
[node name="MeleeCrit" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 358.0
margin_right = 204.0
margin_bottom = 373.0
stat_name = "Melee Crit"
[node name="MeleeCritBonus" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 381.0
margin_right = 204.0
margin_bottom = 396.0
stat_name = "Melee Crit Bonus"
[node name="SpellCrit" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 404.0
margin_right = 204.0
margin_bottom = 419.0
stat_name = "Spell Crit"
[node name="SpellCritBonus" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 427.0
margin_right = 204.0
margin_bottom = 442.0
stat_name = "Spell Crit Bonus"
[node name="Separator3" type="Control" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 450.0
margin_right = 204.0
margin_bottom = 454.0
rect_min_size = Vector2( 0, 4 )
[node name="Block" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 462.0
margin_right = 204.0
margin_bottom = 477.0
stat_name = "Block"
[node name="Parry" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 485.0
margin_right = 204.0
margin_bottom = 500.0
stat_name = "Parry"
[node name="DamageReduction" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 508.0
margin_right = 204.0
margin_bottom = 523.0
stat_name = "Damage Reduction"
[node name="MeleeDamageReduction" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 531.0
margin_right = 204.0
margin_bottom = 546.0
stat_name = "Melee Damage Reduction"
[node name="SpellDamageReduction" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 554.0
margin_right = 204.0
margin_bottom = 569.0
stat_name = "Spell Damage Reduction"
[node name="Separator5" type="Control" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 577.0
margin_right = 204.0
margin_bottom = 581.0
rect_min_size = Vector2( 0, 4 )
[node name="DamageTaken" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 589.0
margin_right = 204.0
margin_bottom = 604.0
stat_name = "Damage Taken"
[node name="HealTaken" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 612.0
margin_right = 204.0
margin_bottom = 627.0
stat_name = "Heal Taken"
[node name="Separator6" type="Control" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 635.0
margin_right = 204.0
margin_bottom = 639.0
rect_min_size = Vector2( 0, 4 )
[node name="MeleeDamage" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 647.0
margin_right = 204.0
margin_bottom = 662.0
stat_name = "Melee Damage"
[node name="SpellDamage" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 670.0
margin_right = 204.0
margin_bottom = 685.0
stat_name = "Spell Damage"
[node name="Separator7" type="Control" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 693.0
margin_right = 204.0
margin_bottom = 697.0
rect_min_size = Vector2( 0, 4 )
[node name="HolyResist" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 705.0
margin_right = 204.0
margin_bottom = 720.0
stat_name = "Holy Resist"
[node name="ShadowResist" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 728.0
margin_right = 204.0
margin_bottom = 743.0
stat_name = "Shadow Resist"
[node name="NatureResist" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 751.0
margin_right = 204.0
margin_bottom = 766.0
stat_name = "Nature Resist"
[node name="FireResist" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 774.0
margin_right = 204.0
margin_bottom = 789.0
stat_name = "Fire Resist"
[node name="FrostResist" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 797.0
margin_right = 204.0
margin_bottom = 812.0
stat_name = "Frost Resist"
[node name="LightningResist" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 820.0
margin_right = 204.0
margin_bottom = 835.0
stat_name = "Lightning Resist"
[node name="ChaosResist" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 843.0
margin_right = 204.0
margin_bottom = 858.0
stat_name = "Chaos Resist"
[node name="SilenceResist" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 866.0
margin_right = 204.0
margin_bottom = 881.0
stat_name = "Silence Resist"
[node name="FearResist" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 889.0
margin_right = 204.0
margin_bottom = 904.0
stat_name = "Fear Resist"
[node name="StunResist" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 912.0
margin_right = 204.0
margin_bottom = 927.0
stat_name = "Stun Resist"
[node name="Separator8" type="Control" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 935.0
margin_right = 204.0
margin_bottom = 939.0
rect_min_size = Vector2( 0, 4 )
[node name="Energy" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 947.0
margin_right = 204.0
margin_bottom = 962.0
stat_name = "Energy"
[node name="Rage" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 970.0
margin_right = 204.0
margin_bottom = 985.0
stat_name = "Rage"
[node name="XPRate" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 993.0
margin_right = 204.0
margin_bottom = 1008.0
stat_name = "XP Rate"
[node name="Separator9" type="Control" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 1016.0
margin_right = 204.0
margin_bottom = 1020.0
rect_min_size = Vector2( 0, 4 )
[node name="WeaponDamageMin" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 1028.0
margin_right = 204.0
margin_bottom = 1043.0
stat_name = "Weapon Damage Min"
[node name="WeaponDamageMax" parent="Panel/VBoxContainer/HBoxContainer2/ScrollContainer/MarginContainer/VBoxContainer" instance=ExtResource( 3 )]
margin_top = 1051.0
margin_right = 204.0
margin_bottom = 1066.0
stat_name = "Weapon Damage Max"
[connection signal="pressed" from="Panel/VBoxContainer/HBoxContainer/Button" to="." method="_on_Button_pressed"]

View File

@ -0,0 +1,38 @@
extends HBoxContainer
export(String) var stat_name : String
var stat_id : int
onready var stat_name_label : Label = $StatName as Label
onready var stat_value_label : Label = $Stat as Label
var _player : Entity
func _ready():
stat_id = ESS.stat_get_id(stat_name)
stat_name_label.text = stat_name
connect("visibility_changed", self, "on_visibility_changed")
func on_visibility_changed():
if _player:
stat_value_label.text = str(_player.stat_getc_current(stat_id)) + " "
else:
stat_value_label.text = str(0) + " "
func set_player(p_player: Entity) -> void:
_player = p_player
on_visibility_changed()
"""
Agility,Strength,Stamina,Intellect,Spirit,
Health,Mana,Speed,Global Cooldown,Haste,Haste Rating,
Resilience,Armor,Attack Power,Spell Power,Melee Crit,
Melee Crit Bonus,Spell Crit,Spell Crit Bonus,Block,Parry,Damage Reduction,
Melee Damage Reduction,Spell Damage Reduction,Damage Taken,Heal Taken,
Melee Damage,Spell Damage,Holy Resist,Shadow Resist,Nature Resist,
Fire Resist,Frost Resist,Lightning Resist,Chaos Resist,Silence Resist,Fear Resist,
Stun Resist,Energy,Rage,XP Rate,Weapon Damage Min,Weapon Damage Max
"""

View File

@ -0,0 +1,27 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://ui/character/SingleStatRow.gd" type="Script" id=1]
[node name="SingleStatRow" type="HBoxContainer"]
margin_right = 1016.0
margin_bottom = 15.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="StatName" type="Label" parent="."]
margin_right = 506.0
margin_bottom = 14.0
size_flags_horizontal = 3
size_flags_vertical = 6
valign = 1
[node name="Stat" type="Label" parent="."]
margin_left = 510.0
margin_right = 1016.0
margin_bottom = 14.0
size_flags_horizontal = 3
size_flags_vertical = 6
align = 2
valign = 1

View File

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

View File

@ -1,4 +1,4 @@
extends PanelContainer
extends Control
# Copyright (c) 2019-2020 Péter Magyar
#
@ -20,6 +20,8 @@ extends PanelContainer
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
var opener_button : BaseButton
export(PackedScene) var item_entry_scene : PackedScene
export(PackedScene) var recipe_selector_scene : PackedScene
@ -48,6 +50,8 @@ var _materials_container_main_on : Node
var _materials_container_main_off : Node
func _ready():
connect("visibility_changed", self, "on_visibility_changed")
_item_container = get_node(item_container_path)
_tools_container = get_node(tools_container_path)
_materials_container = get_node(materials_container_path)
@ -140,8 +144,19 @@ func select_recipe(recipe : CraftRecipe) -> void:
ie.set_item(_player, ih)
func _on_CraftingButton_toggled(button_pressed):
func on_visibility_changed():
if opener_button:
if visible && !opener_button.pressed:
opener_button.pressed = true
return
if !visible && opener_button.pressed:
opener_button.pressed = false
func _on_button_toggled(button_pressed):
if button_pressed:
show()
if !visible:
show()
else:
hide()
if visible:
hide()

View File

@ -0,0 +1,319 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://ui/crafting/CraftingWindow.gd" type="Script" id=2]
[ext_resource path="res://ui/crafting/RecipeSelector.tscn" type="PackedScene" id=3]
[ext_resource path="res://ui/crafting/ItemEntry.tscn" type="PackedScene" id=4]
[ext_resource path="res://ui/crafting/CraftItemDescription.gd" type="Script" id=5]
[sub_resource type="ButtonGroup" id=1]
[node name="CraftingWindow" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
theme = ExtResource( 1 )
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
item_entry_scene = ExtResource( 4 )
recipe_selector_scene = ExtResource( 3 )
item_container_path = NodePath("PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription")
tools_container_path = NodePath("PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/ToolsContainer")
materials_container_path = NodePath("PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/MaterialContainer")
recipe_selector_container_path = NodePath("PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2/Recipes/VBoxContainer")
recipe_selector_main_on = NodePath("PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2/Recipes")
recipe_selector_main_off = NodePath("PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2/CenterContainer2")
materials_container_main_on = NodePath("PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry")
materials_container_main_off = NodePath("PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CenterContainer")
[node name="PanelContainer" type="PanelContainer" parent="."]
margin_left = 43.0
margin_top = 36.0
margin_right = 995.0
margin_bottom = 577.0
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 948.0
margin_bottom = 537.0
[node name="Header" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
margin_right = 944.0
margin_bottom = 30.0
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/Header"]
margin_top = 7.0
margin_right = 900.0
margin_bottom = 22.0
size_flags_horizontal = 3
text = "Crafting"
[node name="Button" type="Button" parent="PanelContainer/VBoxContainer/Header"]
margin_left = 904.0
margin_right = 944.0
margin_bottom = 30.0
rect_min_size = Vector2( 40, 30 )
text = "X"
[node name="Categories" type="HBoxContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 38.0
margin_right = 944.0
margin_bottom = 64.0
[node name="HBoxContainer2" type="HBoxContainer" parent="PanelContainer/VBoxContainer/Categories"]
margin_right = 944.0
margin_bottom = 26.0
rect_min_size = Vector2( 0, 20 )
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 1
[node name="Alchemy" type="Button" parent="PanelContainer/VBoxContainer/Categories/HBoxContainer2"]
margin_left = 162.0
margin_right = 262.0
margin_bottom = 26.5702
rect_min_size = Vector2( 100, 0 )
toggle_mode = true
pressed = true
group = SubResource( 1 )
text = "Alchemy"
[node name="Smithing" type="Button" parent="PanelContainer/VBoxContainer/Categories/HBoxContainer2"]
margin_left = 266.0
margin_right = 366.0
margin_bottom = 26.5702
rect_min_size = Vector2( 100, 0 )
toggle_mode = true
group = SubResource( 1 )
text = "Smithing"
[node name="Enchanting" type="Button" parent="PanelContainer/VBoxContainer/Categories/HBoxContainer2"]
margin_left = 370.0
margin_right = 470.0
margin_bottom = 26.5702
rect_min_size = Vector2( 100, 0 )
toggle_mode = true
group = SubResource( 1 )
text = "Enchantig"
[node name="Engineering" type="Button" parent="PanelContainer/VBoxContainer/Categories/HBoxContainer2"]
margin_left = 474.0
margin_right = 574.0
margin_bottom = 26.5702
rect_min_size = Vector2( 100, 0 )
toggle_mode = true
group = SubResource( 1 )
text = "Engineering"
[node name="Tailoring" type="Button" parent="PanelContainer/VBoxContainer/Categories/HBoxContainer2"]
margin_left = 578.0
margin_right = 678.0
margin_bottom = 26.5702
rect_min_size = Vector2( 100, 0 )
toggle_mode = true
group = SubResource( 1 )
text = "Tailoring"
[node name="Other" type="Button" parent="PanelContainer/VBoxContainer/Categories/HBoxContainer2"]
margin_left = 682.0
margin_right = 782.0
margin_bottom = 26.5702
rect_min_size = Vector2( 100, 0 )
toggle_mode = true
group = SubResource( 1 )
text = "Other"
[node name="VBoxContainer" type="MarginContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 72.0
margin_right = 944.0
margin_bottom = 533.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer"]
margin_right = 944.0
margin_bottom = 461.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="PanelContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer"]
margin_right = 626.0
margin_bottom = 461.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="CraftEntry" type="VBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer"]
visible = false
margin_left = 4.0
margin_top = 4.0
margin_right = 718.0
margin_bottom = 516.0
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.6
custom_constants/separation = 10
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry"]
margin_right = 714.0
margin_bottom = 472.0
size_flags_horizontal = 3
size_flags_vertical = 3
scroll_horizontal_enabled = false
[node name="VBoxContainer2" type="VBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer"]
margin_right = 714.0
margin_bottom = 122.0
size_flags_horizontal = 3
[node name="CraftItemDescription" type="HBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2"]
margin_right = 714.0
margin_bottom = 60.0
alignment = 1
script = ExtResource( 5 )
icon_path = NodePath("VBoxContainer/PanelContainer/TextureRect")
name_label_path = NodePath("PanelContainer2/VBoxContainer/Label")
description_label_path = NodePath("PanelContainer2/VBoxContainer/RichTextLabel")
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription"]
margin_left = 175.0
margin_right = 235.0
margin_bottom = 60.0
[node name="PanelContainer" type="PanelContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription/VBoxContainer"]
margin_right = 60.0
margin_bottom = 60.0
rect_min_size = Vector2( 60, 60 )
[node name="TextureRect" type="TextureRect" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription/VBoxContainer/PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 56.0
margin_bottom = 56.0
expand = true
[node name="PanelContainer2" type="PanelContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription"]
margin_left = 239.0
margin_right = 539.0
margin_bottom = 60.0
rect_min_size = Vector2( 300, 0 )
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription/PanelContainer2"]
margin_left = 4.0
margin_top = 4.0
margin_right = 296.0
margin_bottom = 56.0
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription/PanelContainer2/VBoxContainer"]
margin_right = 292.0
margin_bottom = 15.0
[node name="RichTextLabel" type="RichTextLabel" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription/PanelContainer2/VBoxContainer"]
margin_top = 23.0
margin_right = 292.0
margin_bottom = 52.0
size_flags_vertical = 3
text = "
"
scroll_active = false
[node name="Label2" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2"]
margin_top = 68.0
margin_right = 714.0
margin_bottom = 83.0
text = "Tools"
[node name="ToolsContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2"]
margin_top = 91.0
margin_right = 714.0
margin_bottom = 91.0
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2"]
margin_top = 99.0
margin_right = 714.0
margin_bottom = 114.0
text = "Materials"
[node name="MaterialContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2"]
margin_top = 122.0
margin_right = 714.0
margin_bottom = 122.0
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry"]
margin_top = 482.0
margin_right = 714.0
margin_bottom = 512.0
alignment = 1
[node name="CraftButton" type="Button" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/HBoxContainer"]
margin_left = 307.0
margin_right = 407.0
margin_bottom = 30.0
rect_min_size = Vector2( 100, 30 )
text = "Craft"
[node name="CenterContainer" type="CenterContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 622.0
margin_bottom = 457.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CenterContainer"]
margin_left = 264.0
margin_top = 219.0
margin_right = 354.0
margin_bottom = 234.0
text = "Select a recipe"
align = 1
valign = 1
[node name="PanelContainer2" type="PanelContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer"]
margin_left = 630.0
margin_right = 944.0
margin_bottom = 461.0
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.5
[node name="Recipes" type="ScrollContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2"]
visible = false
margin_left = 4.0
margin_top = 4.0
margin_right = 286.0
margin_bottom = 516.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2/Recipes"]
margin_right = 282.0
size_flags_horizontal = 3
[node name="CenterContainer2" type="CenterContainer" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2"]
margin_left = 4.0
margin_top = 4.0
margin_right = 310.0
margin_bottom = 457.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2/CenterContainer2"]
margin_left = 123.0
margin_top = 219.0
margin_right = 183.0
margin_bottom = 234.0
text = "No recipes"
align = 1
valign = 1
[connection signal="pressed" from="PanelContainer/VBoxContainer/Header/Button" to="." method="hide"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/Categories/HBoxContainer2/Alchemy" to="." method="set_category" binds= [ 1 ]]
[connection signal="pressed" from="PanelContainer/VBoxContainer/Categories/HBoxContainer2/Smithing" to="." method="set_category" binds= [ 2 ]]
[connection signal="pressed" from="PanelContainer/VBoxContainer/Categories/HBoxContainer2/Enchanting" to="." method="set_category" binds= [ 4 ]]
[connection signal="pressed" from="PanelContainer/VBoxContainer/Categories/HBoxContainer2/Engineering" to="." method="set_category" binds= [ 5 ]]
[connection signal="pressed" from="PanelContainer/VBoxContainer/Categories/HBoxContainer2/Tailoring" to="." method="set_category" binds= [ 3 ]]
[connection signal="pressed" from="PanelContainer/VBoxContainer/Categories/HBoxContainer2/Other" to="." method="set_category" binds= [ 0 ]]
[connection signal="pressed" from="PanelContainer/VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/HBoxContainer/CraftButton" to="." method="request_craft"]

View File

@ -0,0 +1,13 @@
[gd_resource type="Resource" load_steps=4 format=2]
[ext_resource path="res://ui/theme/crafting_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/crafting/CraftingWindow.tscn" type="PackedScene" id=3]
[resource]
script = ExtResource( 2 )
enabled = true
scene = ExtResource( 3 )
opener_button_texture = ExtResource( 1 )
index = 4
add_button = true

View File

@ -0,0 +1,102 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://scripts/networking/SpawnPoint.gd" type="Script" id=2]
[node name="SpawnPoint" type="Spatial"]
script = ExtResource( 2 )
multi_player = true
gui_path = NodePath("PanelContainer")
host_button_path = NodePath("PanelContainer/VBoxContainer/host")
address_line_edit_path = NodePath("PanelContainer/VBoxContainer/VBoxContainer/address")
port_line_edit_path = NodePath("PanelContainer/VBoxContainer/VBoxContainer/port")
connect_button_path = NodePath("PanelContainer/VBoxContainer/VBoxContainer/connect")
naturalist_button_path = NodePath("PanelContainer/VBoxContainer/select naturalist")
terrarin_path = NodePath("..")
[node name="PanelContainer" type="PanelContainer" parent="."]
visible = false
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -126.0
margin_top = -169.5
margin_right = 126.0
margin_bottom = 169.5
theme = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 248.0
margin_bottom = 335.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 35
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer/VBoxContainer"]
margin_right = 244.0
margin_bottom = 140.0
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 4.0
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer"]
margin_right = 244.0
margin_bottom = 15.0
text = "Ip:"
[node name="address" type="LineEdit" parent="PanelContainer/VBoxContainer/VBoxContainer"]
margin_top = 23.0
margin_right = 244.0
margin_bottom = 47.3413
placeholder_text = "127.0.0.1"
[node name="Label2" type="Label" parent="PanelContainer/VBoxContainer/VBoxContainer"]
margin_top = 55.0
margin_right = 244.0
margin_bottom = 70.0
text = "Port:"
[node name="port" type="LineEdit" parent="PanelContainer/VBoxContainer/VBoxContainer"]
margin_top = 78.0
margin_right = 244.0
margin_bottom = 102.341
placeholder_text = "23223"
[node name="connect" type="Button" parent="PanelContainer/VBoxContainer/VBoxContainer"]
margin_top = 110.0
margin_right = 244.0
margin_bottom = 140.0
size_flags_horizontal = 3
size_flags_vertical = 3
text = "Connect"
[node name="host" type="Button" parent="PanelContainer/VBoxContainer"]
margin_top = 175.0
margin_right = 244.0
margin_bottom = 210.0
size_flags_horizontal = 3
size_flags_vertical = 3
text = "Host"
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer"]
margin_top = 245.0
margin_right = 244.0
margin_bottom = 260.0
size_flags_vertical = 1
text = "Class: (Just select for offline play):"
[node name="select naturalist" type="Button" parent="PanelContainer/VBoxContainer"]
margin_top = 295.0
margin_right = 244.0
margin_bottom = 331.0
size_flags_horizontal = 3
size_flags_vertical = 3
text = "Naturalist"

View File

@ -2,7 +2,6 @@
[ext_resource path="res://fonts/VT323-Regular.ttf" type="DynamicFontData" id=1]
[resource]
size = 11
font_data = ExtResource( 1 )

BIN
game/ui/icons/icon_add.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 564 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_add.png-617e288ed3bf67d2ba76ab9f47fbf4f0.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ui/icons/icon_add.png"
dest_files=[ "res://.import/icon_add.png-617e288ed3bf67d2ba76ab9f47fbf4f0.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=1
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

BIN
game/ui/icons/icon_edit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 627 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_edit.png-4e4d30376f2cfaefd3d39b2dce70ee57.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ui/icons/icon_edit.png"
dest_files=[ "res://.import/icon_edit.png-4e4d30376f2cfaefd3d39b2dce70ee57.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=1
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_joy_axis.png-d24cf014cc6938689bf543968d165c5a.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ui/icons/icon_joy_axis.png"
dest_files=[ "res://.import/icon_joy_axis.png-d24cf014cc6938689bf543968d165c5a.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=1
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 703 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_joy_button.png-393039a547dbf39d452b3aafcee9f20c.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ui/icons/icon_joy_button.png"
dest_files=[ "res://.import/icon_joy_button.png-393039a547dbf39d452b3aafcee9f20c.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=1
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_keyboard.png-58b4ebdc3868706f0d2ebc63fcba3a74.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ui/icons/icon_keyboard.png"
dest_files=[ "res://.import/icon_keyboard.png-58b4ebdc3868706f0d2ebc63fcba3a74.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=1
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 689 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_mouse.png-5bef59a63732b271e4a97478075d6992.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ui/icons/icon_mouse.png"
dest_files=[ "res://.import/icon_mouse.png-5bef59a63732b271e4a97478075d6992.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=1
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

Binary file not shown.

After

Width:  |  Height:  |  Size: 615 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/icon_remove.png-05b3a725226167bddcdc3b55463863b5.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ui/icons/icon_remove.png"
dest_files=[ "res://.import/icon_remove.png-05b3a725226167bddcdc3b55463863b5.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=1
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=false
process/premult_alpha=false
process/HDR_as_SRGB=false
process/invert_color=false
stream=false
size_limit=0
detect_3d=false
svg/scale=1.0

View File

@ -1,9 +1,10 @@
[gd_scene load_steps=5 format=2]
[gd_scene load_steps=6 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://ui/options/Options.tscn" type="PackedScene" id=2]
[ext_resource path="res://ui/ingame_menu/ExitButton.gd" type="Script" id=3]
[ext_resource path="res://ui/keybinds/Keybinds.tscn" type="PackedScene" id=4]
[ext_resource path="res://ui/interface/InterfaceOptions.tscn" type="PackedScene" id=5]
[node name="IngameMenu" type="Control"]
anchor_right = 1.0
@ -31,7 +32,7 @@ __meta__ = {
margin_left = 4.0
margin_top = 4.0
margin_right = 151.0
margin_bottom = 132.0
margin_bottom = 166.0
[node name="Resume" type="Button" parent="Menu/VBoxContainer"]
margin_right = 147.0
@ -44,16 +45,25 @@ margin_right = 147.0
margin_bottom = 60.5702
text = "Keybinds"
[node name="Options" type="Button" parent="Menu/VBoxContainer"]
[node name="Interface" type="Button" parent="Menu/VBoxContainer"]
margin_top = 68.0
margin_right = 147.0
margin_bottom = 94.5702
text = "Options"
text = "Interface"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Exit" type="Button" parent="Menu/VBoxContainer"]
[node name="Options" type="Button" parent="Menu/VBoxContainer"]
margin_top = 102.0
margin_right = 147.0
margin_bottom = 128.57
text = "Options"
[node name="Exit" type="Button" parent="Menu/VBoxContainer"]
margin_top = 136.0
margin_right = 147.0
margin_bottom = 162.57
text = "Exit"
script = ExtResource( 3 )
@ -78,6 +88,19 @@ margin_left = -426.0
margin_top = -270.0
margin_right = 426.0
margin_bottom = 270.0
[node name="InterfaceOptions" parent="." instance=ExtResource( 5 )]
visible = false
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -331.0
margin_top = -224.5
margin_right = 331.0
margin_bottom = 224.5
[connection signal="pressed" from="Menu/VBoxContainer/Resume" to="." method="hide"]
[connection signal="pressed" from="Menu/VBoxContainer/Keybinds" to="KeybindWindow" method="show"]
[connection signal="pressed" from="Menu/VBoxContainer/Interface" to="InterfaceOptions" method="show"]
[connection signal="pressed" from="Menu/VBoxContainer/Options" to="Options" method="show"]

View File

@ -0,0 +1,6 @@
extends PanelContainer
export(NodePath) var actionbar_set_default_button_path : NodePath
func set_player(p_player: Entity) -> void:
get_node(actionbar_set_default_button_path).set_player(p_player)

View File

@ -0,0 +1,52 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/interface/SetActionbarAsDefault.gd" type="Script" id=1]
[ext_resource path="res://ui/interface/InterfaceOptions.gd" type="Script" id=2]
[node name="InterfaceOptions" type="PanelContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
actionbar_set_default_button_path = NodePath("VBoxContainer2/VBoxContainer/SetActionbarAsDefault")
[node name="VBoxContainer2" type="VBoxContainer" parent="."]
margin_left = 7.0
margin_top = 7.0
margin_right = 1017.0
margin_bottom = 593.0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer2"]
margin_right = 1010.0
margin_bottom = 30.0
size_flags_horizontal = 3
[node name="Label" type="Label" parent="VBoxContainer2/HBoxContainer"]
margin_top = 8.0
margin_right = 966.0
margin_bottom = 22.0
size_flags_horizontal = 3
text = "Interface options"
[node name="Button" type="Button" parent="VBoxContainer2/HBoxContainer"]
margin_left = 970.0
margin_right = 1010.0
margin_bottom = 30.0
rect_min_size = Vector2( 40, 30 )
text = "X"
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer2"]
margin_top = 34.0
margin_right = 1010.0
margin_bottom = 586.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="SetActionbarAsDefault" type="Button" parent="VBoxContainer2/VBoxContainer"]
margin_right = 1010.0
margin_bottom = 20.0
text = "Set current actionbar setup as default"
script = ExtResource( 1 )
[connection signal="pressed" from="VBoxContainer2/HBoxContainer/Button" to="." method="hide"]

View File

@ -0,0 +1,16 @@
extends Button
var _player : Entity
func set_player(p_player: Entity) -> void:
_player = p_player
func _pressed():
if _player && is_instance_valid(_player):
var abp : ActionBarProfile = _player.get_action_bar_profile()
var cp : ClassProfile = ProfileManager.getc_player_profile().get_class_profile(_player.gets_entity_data().get_path())
cp.get_default_action_bar_profile().from_actionbar_profile(abp)
ProfileManager.save()

View File

@ -24,6 +24,24 @@ export(PackedScene) var keybind_category_scene : PackedScene
export(NodePath) var content_container_path : NodePath
var _player : Entity
func set_player(player : Entity):
if _player:
_player.disconnect("centity_data_changed", self, "on_data_changed")
_player = player
on_data_changed(_player.getc_entity_data())
_player.connect("centity_data_changed", self, "on_data_changed")
func on_data_changed(data):
if data:
ProfileManager.on_keybinds_changed(data.get_path())
InputMap.load_from_globals()
# Note for the reader:
#
@ -127,3 +145,12 @@ func a_ready():
# Do not start processing input until a button is pressed
set_process_input(false)
func close():
InputMap.load_from_globals()
if _player:
ProfileManager.on_keybinds_changed(_player.getc_entity_data().get_path())
hide()

View File

@ -1,8 +1,15 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=11 format=2]
[ext_resource path="res://ui/keybinds/Keybinds.gd" type="Script" id=1]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2]
[ext_resource path="res://ui/keybinds/KeybindCategory.tscn" type="PackedScene" id=3]
[ext_resource path="res://ui/icons/icon_mouse.png" type="Texture" id=4]
[ext_resource path="res://ui/icons/icon_keyboard.png" type="Texture" id=5]
[ext_resource path="res://ui/icons/icon_joy_button.png" type="Texture" id=6]
[ext_resource path="res://ui/icons/icon_remove.png" type="Texture" id=7]
[ext_resource path="res://ui/icons/icon_add.png" type="Texture" id=8]
[ext_resource path="res://ui/icons/icon_edit.png" type="Texture" id=9]
[ext_resource path="res://ui/icons/icon_joy_axis.png" type="Texture" id=10]
[node name="KeybindWindow" type="PanelContainer"]
anchor_right = 1.0
@ -13,7 +20,6 @@ __meta__ = {
"_edit_use_anchors_": false
}
keybind_category_scene = ExtResource( 3 )
content_container_path = NodePath("VBoxContainer/ScrollContainer/Content")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 4.0
@ -27,7 +33,7 @@ margin_bottom = 30.0
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer"]
margin_top = 7.0
margin_right = 968.0
margin_right = 972.0
margin_bottom = 22.0
size_flags_horizontal = 3
text = "Keybinds"
@ -39,17 +45,19 @@ margin_bottom = 30.0
rect_min_size = Vector2( 40, 30 )
text = "X"
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
[node name="InputMapEditor" type="InputMapEditor" parent="VBoxContainer"]
margin_top = 38.0
margin_right = 1016.0
margin_bottom = 554.0
size_flags_horizontal = 3
size_flags_vertical = 3
scroll_horizontal_enabled = false
[node name="Content" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"]
margin_right = 1016.0
size_flags_horizontal = 3
add_texture = ExtResource( 8 )
remove_texture = ExtResource( 7 )
edit_texture = ExtResource( 9 )
keyboard_texture = ExtResource( 5 )
joybutton_texture = ExtResource( 6 )
joyaxis_texture = ExtResource( 10 )
mouse_texture = ExtResource( 4 )
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 562.0
@ -58,8 +66,8 @@ margin_bottom = 592.0
alignment = 2
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer2"]
margin_left = 848.0
margin_right = 928.0
margin_left = 852.0
margin_right = 932.0
margin_bottom = 30.0
rect_min_size = Vector2( 80, 30 )
text = "Cancel"
@ -71,3 +79,6 @@ margin_bottom = 30.0
rect_min_size = Vector2( 80, 30 )
text = "OK"
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Button" to="." method="hide"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Button" to="." method="hide"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Button2" to="." method="close"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer2/Button2" to="VBoxContainer/InputMapEditor" method="queue_save"]

View File

@ -35,7 +35,7 @@ func _ready():
label = get_node(label_path) as RichTextLabel
if icon == null or label == null:
print("LootEntry is not setup correctly!")
Logger.error("LootEntry is not setup correctly!")
func on_click():
player.loot_crequest(index)

View File

@ -29,12 +29,14 @@ var player : Entity
var target_bag : Bag
func _ready():
get_node("../../../").loot_window = self
container = get_node(container_path)
connect("visibility_changed", self, "on_visibility_changed")
if entry_scene == null:
print("LootWindow: entry_scene is null")
Logger.error("LootWindow: entry_scene is null")
func refresh():
for child in container.get_children():
@ -57,7 +59,11 @@ func refresh():
func set_player(p_player : Entity) -> void:
player = p_player
player.connect("ctarget_bag_changed", self, "ctarget_bag_changed")
player.connect("onc_open_loot_winow_request", self, "onc_open_loot_winow_request")
player.connect("onc_open_winow_request", self, "onc_open_loot_winow_request")
func on_player_moved():
if visible:
hide()
func on_visibility_changed():
if visible:
@ -66,7 +72,7 @@ func on_visibility_changed():
if target_bag != null:
target_bag.disconnect("item_removed", self, "on_item_removed")
target_bag = null
func on_item_removed(bag: Bag, item: ItemInstance, slot_id: int) -> void:
refresh()
@ -82,5 +88,11 @@ func ctarget_bag_changed(entity: Entity, bag: Bag) -> void:
target_bag.connect("item_removed", self, "on_item_removed")
func onc_open_loot_winow_request() -> void:
func onc_open_loot_winow_request(window_id) -> void:
if window_id != EntityEnums.ENTITY_WINDOW_LOOT:
return
show()
if player.has_signal("player_moved") && !player.is_connected("player_moved", self, "on_player_moved"):
player.connect("player_moved", self, "on_player_moved", [], CONNECT_ONESHOT)

View File

@ -4,7 +4,7 @@
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2]
[ext_resource path="res://ui/loot_window/LootEntry.tscn" type="PackedScene" id=3]
[node name="LootWindow" type="PanelContainer"]
[node name="LootWindow" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
@ -14,37 +14,43 @@ __meta__ = {
"_edit_use_anchors_": false
}
entry_scene = ExtResource( 3 )
container_path = NodePath("VBoxContainer/ScrollContainer/container")
container_path = NodePath("PanelContainer/VBoxContainer/ScrollContainer/container")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
[node name="PanelContainer" type="PanelContainer" parent="."]
margin_left = 82.0
margin_top = 83.0
margin_right = 299.0
margin_bottom = 359.0
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 1020.0
margin_bottom = 596.0
margin_right = 213.0
margin_bottom = 272.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Label" type="Label" parent="VBoxContainer"]
margin_right = 1016.0
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer"]
margin_right = 209.0
margin_bottom = 15.0
text = "Loot"
align = 1
valign = 1
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
[node name="ScrollContainer" type="ScrollContainer" parent="PanelContainer/VBoxContainer"]
margin_top = 23.0
margin_right = 1016.0
margin_bottom = 558.0
margin_right = 209.0
margin_bottom = 234.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="container" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"]
margin_right = 1016.0
[node name="container" type="VBoxContainer" parent="PanelContainer/VBoxContainer/ScrollContainer"]
margin_right = 209.0
size_flags_horizontal = 3
[node name="Button" type="Button" parent="VBoxContainer"]
margin_top = 566.0
margin_right = 1016.0
margin_bottom = 592.269
[node name="Button" type="Button" parent="PanelContainer/VBoxContainer"]
margin_top = 242.0
margin_right = 209.0
margin_bottom = 268.57
text = "close"
[connection signal="pressed" from="VBoxContainer/Button" to="." method="hide"]
[connection signal="pressed" from="PanelContainer/VBoxContainer/Button" to="." method="hide"]

View File

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

View File

@ -68,10 +68,8 @@ margin_bottom = 70.0
property_category = "rendering"
property_name = "viewport_scale"
property_label = "Viewport Scale"
min_value = 20
max_value = 100
step = 5
prefix = ""
min_value = 20.0
step = 5.0
suffix = "%"
[node name="Borderless" parent="PanelContainer/VBoxContainer/TabContainer/Video" instance=ExtResource( 4 )]
@ -141,6 +139,28 @@ property_category = "ui"
property_name = "touchscreen_mode"
property_label = "Touchscreen Mode"
[node name="OptionsSpinboxRow" parent="PanelContainer/VBoxContainer/TabContainer/Interface" instance=ExtResource( 8 )]
margin_top = 58.0
margin_bottom = 82.0
property_category = "ui"
property_name = "ui_scale"
property_label = "UI Scale"
min_value = 0.2
max_value = 2.4
step = 0.01
rounded = false
[node name="OptionsSpinboxRow2" parent="PanelContainer/VBoxContainer/TabContainer/Interface" instance=ExtResource( 8 )]
margin_top = 90.0
margin_bottom = 114.0
property_category = "ui"
property_name = "ui_scale_touch"
property_label = "UI Scale Touch"
min_value = 0.2
max_value = 2.4
step = 0.01
rounded = false
[node name="Debug" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer"]
visible = false
anchor_right = 1.0
@ -152,18 +172,17 @@ margin_bottom = -4.0
size_flags_horizontal = 3
[node name="DebugInfo" type="CheckBox" parent="PanelContainer/VBoxContainer/TabContainer/Debug"]
margin_top = 32.0
margin_right = 527.0
margin_bottom = 58.5702
margin_bottom = 26.269
text = "Show Debug info"
script = ExtResource( 5 )
property_category = "debug"
property_name = "debug_info"
[node name="RemoveProfile" type="Button" parent="PanelContainer/VBoxContainer/TabContainer/Debug"]
margin_top = 66.0
margin_top = 34.0
margin_right = 527.0
margin_bottom = 92.5702
margin_bottom = 60.269
size_flags_horizontal = 3
text = "Remove Profile"
script = ExtResource( 2 )
@ -173,4 +192,5 @@ margin_top = 439.0
margin_right = 535.0
margin_bottom = 465.57
text = "Close"
[connection signal="pressed" from="PanelContainer/VBoxContainer/Close" to="." method="hide"]

View File

@ -26,9 +26,10 @@ export(String) var property_name : String
export(String) var property_label : String
export(int) var min_value : int = 0
export(int) var max_value : int = 100
export(int) var step : int = 1
export(float) var min_value : float = 0
export(float) var max_value : float = 100
export(float) var step : float = 1
export(bool) var rounded : bool = true
export(String) var prefix : String = ""
export(String) var suffix : String = ""
@ -47,6 +48,8 @@ func _ready():
_sb.prefix = prefix
_sb.suffix = suffix
_sb.rounded = rounded
if Engine.editor_hint:
return

View File

@ -11,7 +11,15 @@ script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
step = 0
property_category = ""
property_name = ""
property_label = ""
min_value = 0.0
max_value = 100.0
step = 0.0
rounded = true
prefix = ""
suffix = ""
[node name="Label" type="Label" parent="."]
margin_top = 5.0
@ -25,5 +33,6 @@ margin_right = 527.0
margin_bottom = 24.0
size_flags_horizontal = 3
size_flags_vertical = 3
step = 0.0
rounded = true
align = 1

View File

@ -20,11 +20,38 @@ extends CanvasLayer
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
export(NodePath) var loot_window_path : NodePath
export (String) var player_path : String = "../.."
export(NodePath) var gui_base_path : NodePath
export(NodePath) var buttons_path : NodePath
export(NodePath) var windows_path : NodePath
var gui_base : Node
var buttons : Node
var windows : Node
var loot_window : Control
func _ready():
loot_window = get_node(loot_window_path) as Control
initialize()
if player_path != null:
var player = get_node(player_path)
for c in windows.get_children():
if c.has_method("set_player"):
c.set_player(player)
for c in gui_base.get_children():
if c.has_method("set_player"):
c.set_player(player)
func initialize():
gui_base = get_node(gui_base_path)
buttons = get_node(buttons_path)
windows = get_node(windows_path)
func _on_Player_onc_open_loot_winow_request() -> void:
if loot_window != null:

View File

@ -1,35 +1,20 @@
[gd_scene load_steps=26 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]
[ext_resource path="res://player/Unitframes.gd" type="Script" id=3]
[ext_resource path="res://ui/errorframe/ErrorFrame.tscn" type="PackedScene" id=4]
[ext_resource path="res://ui/auraframe/AuraFrame.tscn" type="PackedScene" id=5]
[ext_resource path="res://ui/game_over_window/GameOverWindow.tscn" type="PackedScene" id=6]
[ext_resource path="res://ui/actionbars/Actionbars.gd" type="Script" id=8]
[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/unitframes/TargetUnitframe.tscn" type="PackedScene" id=12]
[ext_resource path="res://ui/actionbars/ActionBar.tscn" type="PackedScene" id=14]
[ext_resource path="res://ui/bags/Bag.tscn" type="PackedScene" id=15]
[ext_resource path="res://ui/castbar/Castbar.tscn" type="PackedScene" id=16]
[ext_resource path="res://ui/windows/SpellBookWindow.tscn" type="PackedScene" id=17]
[ext_resource path="res://ui/minimap/MiniMap.tscn" type="PackedScene" id=18]
[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/unitframes/UnitframeBase.tscn" type="PackedScene" id=21]
[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]
[ext_resource path="res://ui/player_ui/player_ui.gd" type="Script" id=28]
[ext_resource path="res://ui/windows/CharacterWindow.tscn" type="PackedScene" id=29]
[ext_resource path="res://ui/buttons/ImageButton.tscn" type="PackedScene" id=30]
[node name="GUILayer" type="CanvasLayer"]
layer = 5
script = ExtResource( 28 )
loot_window_path = NodePath("GUI/Windows/LootWindow")
gui_base_path = NodePath("GUI")
buttons_path = NodePath("GUI/Buttons")
windows_path = NodePath("GUI/Windows")
[node name="GUI" type="Control" parent="."]
anchor_right = 1.0
@ -40,144 +25,35 @@ script = ExtResource( 1 )
__meta__ = {
"_edit_lock_": true
}
child_controls = [ NodePath("Unitframes"), NodePath("Actionbars"), NodePath("Windows/SpellBookWindow"), NodePath("Buttons"), NodePath("Castbar"), NodePath("AuraFrame"), NodePath("Windows/Inventory"), NodePath("Windows/LootWindow"), NodePath("Windows/TalentWindow"), NodePath("Windows/CraftingWindow"), NodePath("Windows/GameOverWindow") ]
[node name="Buttons" type="Control" parent="GUI"]
anchor_left = 0.5
[node name="Buttons" type="HBoxContainer" parent="GUI"]
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
margin_left = -202.0
margin_top = -45.0
margin_right = 140.0
margin_top = -40.0
margin_right = 342.0
rect_min_size = Vector2( 0, 40 )
mouse_filter = 2
custom_constants/separation = 0
script = ExtResource( 9 )
__meta__ = {
"_edit_group_": true,
"_edit_use_anchors_": false
}
spell_book_path = NodePath("../Windows/SpellBookWindow")
spell_book_button_path = NodePath("HBoxContainer/SpellBookButton")
lock_button_path = NodePath("HBoxContainer/LockButton")
image_button = ExtResource( 30 )
lock_button_path = NodePath("LockButton")
[node name="HBoxContainer" type="HBoxContainer" parent="GUI/Buttons"]
[node name="LockButton" type="Button" parent="GUI/Buttons"]
margin_right = 25.0
margin_bottom = 40.0
rect_min_size = Vector2( 25, 30 )
focus_mode = 0
toggle_mode = true
enabled_focus_mode = 0
keep_pressed_outside = true
[node name="locked" type="TextureRect" parent="GUI/Buttons/LockButton"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
custom_constants/separation = 0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CharacterButton" type="Button" parent="GUI/Buttons/HBoxContainer"]
margin_right = 45.0
margin_bottom = 45.0
rect_min_size = Vector2( 45, 45 )
hint_tooltip = "Inventory"
focus_mode = 0
toggle_mode = true
enabled_focus_mode = 0
keep_pressed_outside = true
text = "Char"
[node name="SpellBookButton" type="Button" parent="GUI/Buttons/HBoxContainer"]
margin_left = 45.0
margin_right = 90.0
margin_bottom = 45.0
rect_min_size = Vector2( 45, 45 )
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/HBoxContainer/SpellBookButton"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -15.0
margin_top = -15.0
margin_right = 15.0
margin_bottom = 15.0
texture = ExtResource( 23 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="BagButton" type="Button" parent="GUI/Buttons/HBoxContainer"]
margin_left = 90.0
margin_right = 135.0
margin_bottom = 45.0
rect_min_size = Vector2( 45, 45 )
hint_tooltip = "Inventory"
focus_mode = 0
toggle_mode = true
enabled_focus_mode = 0
keep_pressed_outside = true
[node name="TextureRect2" type="TextureRect" parent="GUI/Buttons/HBoxContainer/BagButton"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -15.0
margin_top = -15.0
margin_right = 15.0
margin_bottom = 15.0
texture = ExtResource( 24 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TalentButton" type="Button" parent="GUI/Buttons/HBoxContainer"]
margin_left = 135.0
margin_right = 181.626
margin_bottom = 45.0
rect_min_size = Vector2( 45, 45 )
hint_tooltip = "Inventory"
focus_mode = 0
toggle_mode = true
enabled_focus_mode = 0
keep_pressed_outside = true
text = "Talent"
[node name="CraftingButton" type="Button" parent="GUI/Buttons/HBoxContainer"]
visible = false
margin_left = 181.0
margin_right = 226.0
margin_bottom = 45.0
rect_min_size = Vector2( 45, 45 )
hint_tooltip = "Inventory"
focus_mode = 0
toggle_mode = true
enabled_focus_mode = 0
keep_pressed_outside = true
text = "Craft"
[node name="LockButton" type="Button" parent="GUI/Buttons/HBoxContainer"]
margin_left = 181.0
margin_right = 226.0
margin_bottom = 45.0
rect_min_size = Vector2( 45, 45 )
focus_mode = 0
toggle_mode = true
enabled_focus_mode = 0
keep_pressed_outside = true
[node name="locked" type="TextureRect" parent="GUI/Buttons/HBoxContainer/LockButton"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -15.0
margin_top = -15.0
margin_right = 15.0
margin_bottom = 15.0
texture = ExtResource( 25 )
expand = true
stretch_mode = 6
@ -185,16 +61,10 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="unlocked" type="TextureRect" parent="GUI/Buttons/HBoxContainer/LockButton"]
[node name="unlocked" type="TextureRect" parent="GUI/Buttons/LockButton"]
visible = false
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -15.0
margin_top = -15.0
margin_right = 15.0
margin_bottom = 15.0
anchor_right = 1.0
anchor_bottom = 1.0
texture = ExtResource( 26 )
expand = true
stretch_mode = 6
@ -202,127 +72,31 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="Menu" type="Button" parent="GUI/Buttons/HBoxContainer"]
margin_left = 226.0
margin_right = 271.0
margin_bottom = 45.0
rect_min_size = Vector2( 45, 45 )
[node name="Menu" type="Button" parent="GUI/Buttons"]
margin_left = 25.0
margin_right = 50.0
margin_bottom = 40.0
rect_min_size = Vector2( 25, 30 )
focus_mode = 0
enabled_focus_mode = 0
keep_pressed_outside = true
text = "Menu"
[node name="Actionbars" type="HBoxContainer" parent="GUI"]
[node name="TextureRect3" type="TextureRect" parent="GUI/Buttons/Menu"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 0
alignment = 2
script = ExtResource( 8 )
texture = ExtResource( 6 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
actionbar_scene = ExtResource( 14 )
[node name="Windows" type="CanvasLayer" parent="GUI"]
layer = 6
[node name="CharacterWindow" parent="GUI/Windows" instance=ExtResource( 29 )]
visible = false
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 66.0
margin_top = 44.0
margin_right = 681.0
margin_bottom = 474.0
[node name="SpellBookWindow" parent="GUI/Windows" instance=ExtResource( 17 )]
visible = false
margin_left = 60.0
margin_top = 50.0
margin_right = 561.0
[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
[node name="CraftingWindow" parent="GUI/Windows" instance=ExtResource( 20 )]
visible = false
margin_left = 31.0
margin_top = 23.0
margin_right = -345.0
margin_bottom = -67.0
[node name="Inventory" parent="GUI/Windows" instance=ExtResource( 15 )]
visible = false
margin_left = 56.0
margin_top = 69.0
margin_right = -422.0
margin_bottom = -109.0
inventory_item_container_path = NodePath("../Inventory/VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/ScrollContainer/GridContainer")
[node name="LootWindow" parent="GUI/Windows" instance=ExtResource( 19 )]
visible = false
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 39.0
margin_top = 85.0
margin_right = 242.0
margin_bottom = 315.0
[node name="GameOverWindow" parent="GUI/Windows" instance=ExtResource( 6 )]
visible = false
[node name="Unitframes" type="Control" parent="GUI"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 1.0
margin_right = 1.0
mouse_filter = 2
script = ExtResource( 3 )
__meta__ = {
"_edit_lock_": true
}
player_unit_frame_path = NodePath("PlayerUnitFrame")
target_unit_frame_path = NodePath("TargetUnitframe")
[node name="PlayerUnitFrame" parent="GUI/Unitframes" instance=ExtResource( 21 )]
margin_right = 151.0
[node name="TargetUnitframe" parent="GUI/Unitframes" instance=ExtResource( 12 )]
visible = false
[node name="MiniMap" parent="GUI" instance=ExtResource( 18 )]
visible = false
[node name="AuraFrame" parent="GUI" instance=ExtResource( 5 )]
margin_left = -331.0
margin_bottom = 123.0
[node name="Castbar" parent="GUI" instance=ExtResource( 16 )]
visible = false
[node name="ErrorFrame" parent="GUI" instance=ExtResource( 4 )]
anchor_left = 0.5
anchor_right = 0.5
margin_left = -191.728
margin_top = 140.333
margin_right = 180.272
margin_bottom = 288.333
mouse_filter = 2
layer = 2
[node name="IngameMenu" parent="GUI" instance=ExtResource( 2 )]
visible = false
[connection signal="toggled" from="GUI/Buttons/HBoxContainer/CharacterButton" to="GUI/Windows/CharacterWindow" method="_on_CharacterButton_toggled"]
[connection signal="toggled" from="GUI/Buttons/HBoxContainer/SpellBookButton" to="GUI/Windows/SpellBookWindow" method="_on_SpellBookButton_toggled"]
[connection signal="toggled" from="GUI/Buttons/HBoxContainer/BagButton" to="GUI/Windows/Inventory" method="_on_BagButton_toggled"]
[connection signal="toggled" from="GUI/Buttons/HBoxContainer/TalentButton" to="GUI/Windows/TalentWindow" method="_on_TalentButton_toggled"]
[connection signal="toggled" from="GUI/Buttons/HBoxContainer/CraftingButton" to="GUI/Windows/CraftingWindow" method="_on_CraftingButton_toggled"]
[connection signal="pressed" from="GUI/Buttons/HBoxContainer/Menu" to="GUI/IngameMenu" method="show"]
[connection signal="pressed" from="GUI/Buttons/Menu" to="GUI/IngameMenu" method="show"]
[editable path="GUI/IngameMenu"]

View File

@ -20,6 +20,8 @@ extends Control
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
var opener_button : BaseButton
export(NodePath) var spell_entry_container_path : NodePath
export(NodePath) var prev_button_path : NodePath
export(NodePath) var next_button_path : NodePath
@ -45,6 +47,8 @@ var _character_class : EntityClassData
var _spells : Array
func _ready() -> void:
connect("visibility_changed", self, "on_visibility_changed")
_spell_entries.clear()
_spell_entry_container = get_node(spell_entry_container_path)
@ -58,6 +62,9 @@ func _ready() -> void:
_prev_button.connect("pressed", self, "dec_page")
_next_button.connect("pressed", self, "inc_page")
if ESS.use_spell_points:
_spell_points_label.text = ""
connect("visibility_changed", self, "_visibility_changed")
@ -129,7 +136,8 @@ func refresh_all() -> void:
if _page > _max_pages:
_page = _max_pages
_spell_points_label.text = "Free spell points: " + str(_player.getc_free_spell_points())
if ESS.use_spell_points:
_spell_points_label.text = "Free spell points: " + str(_player.getc_free_spell_points())
refresh_entries()
@ -191,9 +199,19 @@ class CustomSpellSorter:
return true
func on_visibility_changed():
if opener_button:
if visible && !opener_button.pressed:
opener_button.pressed = true
return
if !visible && opener_button.pressed:
opener_button.pressed = false
func _on_SpellBookButton_toggled(button_pressed):
func _on_button_toggled(button_pressed):
if button_pressed:
show()
if !visible:
show()
else:
hide()
if visible:
hide()

View File

@ -0,0 +1,178 @@
[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
mouse_filter = 2
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

@ -106,28 +106,45 @@ func spell_button_pressed() -> void:
_popup.popup(Rect2(pos, _popup.rect_size))
func update_spell_indicators():
if _spell_known:
# get_node(known_label_path).show()
# get_node(learn_button_path).hide()
modulate = known_color
if ESS.use_spell_points:
if _spell_known:
get_node(known_label_path).show()
get_node(learn_button_path).hide()
modulate = known_color
else:
if _spell != null:
if _spell.training_required_spell:
if not _player.spell_hasc(_spell.training_required_spell):
if ESS.use_spell_points:
get_node(known_label_path).hide()
get_node(learn_button_path).show()
modulate = unlearnable_color
return
if ESS.use_spell_points:
get_node(known_label_path).hide()
get_node(learn_button_path).show()
modulate = not_known_color
else:
if _spell != null:
if _spell.training_required_spell:
if not _player.spell_hasc(_spell.training_required_spell):
# get_node(known_label_path).hide()
# get_node(learn_button_path).show()
modulate = unlearnable_color
return
# get_node(known_label_path).hide()
# get_node(learn_button_path).show()
modulate = not_known_color
modulate = not_known_color
get_node(known_label_path).hide()
get_node(learn_button_path).hide()
if _spell_known:
modulate = known_color
else:
if _spell != null:
if _spell.training_required_spell:
if not _player.spell_hasc(_spell.training_required_spell):
modulate = unlearnable_color
return
modulate = not_known_color

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
}
@ -108,7 +108,7 @@ size_flags_horizontal = 3
[node name="Button" type="Button" parent="SpellEntryPopup/VBoxContainer/HBoxContainer"]
margin_left = 258.0
margin_right = 288.0
margin_bottom = 26.269
margin_bottom = 26.5702
rect_min_size = Vector2( 30, 0 )
text = "X"
@ -118,29 +118,29 @@ margin_right = 288.0
margin_bottom = 38.0
[node name="PanelContainer" type="PanelContainer" parent="SpellEntryPopup/VBoxContainer"]
visible = false
margin_top = 46.0
margin_right = 288.0
margin_bottom = 66.0
margin_bottom = 69.0
rect_min_size = Vector2( 0, 20 )
[node name="KnownLabel" type="Label" parent="SpellEntryPopup/VBoxContainer/PanelContainer"]
margin_top = 2.0
margin_right = 288.0
margin_bottom = 17.0
margin_left = 4.0
margin_top = 4.0
margin_right = 284.0
margin_bottom = 19.0
text = "Known"
align = 1
valign = 1
[node name="LearnButton" type="Button" parent="SpellEntryPopup/VBoxContainer"]
visible = false
margin_top = 46.0
margin_top = 77.0
margin_right = 288.0
margin_bottom = 72.269
margin_bottom = 103.57
text = "Learn"
[node name="RichTextLabel" type="RichTextLabel" parent="SpellEntryPopup/VBoxContainer"]
margin_top = 46.0
margin_top = 77.0
margin_right = 288.0
margin_bottom = 195.0
size_flags_horizontal = 3

View File

@ -0,0 +1,13 @@
[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
scene = ExtResource( 2 )
opener_button_texture = ExtResource( 1 )
index = 1
add_button = true

View File

@ -56,18 +56,23 @@ func _ready() -> void:
_rank_label = get_node(rank_label_path) as Label
_upgrade_button = get_node(upgrade_button_path) as Button
func set_player(player : Entity, spec : CharacterSpec, spec_index : int, row : int) -> void:
func set_player(player : Entity, spec : CharacterSpec, spec_index : int, row : int, pculomn : int) -> void:
if _player != null:
_player.disconnect("ctalent_learned", self, "ctalent_learned")
_player.disconnect("ctalent_reset", self, "ctalent_reset")
_player.disconnect("cclass_talent_learned", self, "ctalent_learned")
_player.disconnect("ccharacter_talent_learned", self, "ctalent_learned")
_player.disconnect("cclass_talent_reset", self, "ctalent_reset")
_player.disconnect("ccharacter_talent_reset", self, "ctalent_reset")
_row = row
_spec = spec
_player = player
_spec_index = spec_index
culomn = pculomn
_player.connect("ctalent_learned", self, "ctalent_learned")
_player.connect("ctalent_reset", self, "ctalent_reset")
_player.connect("cclass_talent_learned", self, "ctalent_learned")
_player.connect("ccharacter_talent_learned", self, "ctalent_learned")
_player.connect("cclass_talent_reset", self, "ctalent_reset")
_player.connect("ccharacter_talent_reset", self, "ctalent_reset")
refresh()
@ -86,7 +91,7 @@ func refresh() -> void:
if a == null:
break
if _player.talent_hasc(a.id):
if _player.class_talent_hasc(a.id):
known_rank_count += 1
rank_count += 1
@ -114,7 +119,7 @@ func open_popup() -> void:
_popup.popup(Rect2(p, _popup.rect_size))
func upgrade():
_player.talent_crequest_learn(_spec_index, _row, culomn)
_player.class_talent_crequest_learn(_spec_index, _row, culomn)
func ctalent_learned(entity: Entity, talent_id: int) -> void:
refresh()

View File

@ -20,6 +20,10 @@ extends HBoxContainer
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
export(PackedScene) var entry_scene : PackedScene
func set_player(player : Entity, spec : CharacterSpec, spec_index: int, row : int) -> void:
for ch in get_children():
ch.set_player(player, spec, spec_index, row)
for i in range(spec.get_num_columns(row)):
var ch : Node = entry_scene.instance()
add_child(ch)
ch.set_player(player, spec, spec_index, row, i)

View File

@ -14,31 +14,4 @@ script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TalentEntry" parent="." instance=ExtResource( 1 )]
margin_right = 198.0
margin_bottom = 600.0
[node name="TalentEntry2" parent="." instance=ExtResource( 1 )]
margin_left = 206.0
margin_right = 404.0
margin_bottom = 600.0
culomn = 1
[node name="TalentEntry3" parent="." instance=ExtResource( 1 )]
margin_left = 412.0
margin_right = 610.0
margin_bottom = 600.0
culomn = 2
[node name="TalentEntry4" parent="." instance=ExtResource( 1 )]
margin_left = 618.0
margin_right = 816.0
margin_bottom = 600.0
culomn = 3
[node name="TalentEntry5" parent="." instance=ExtResource( 1 )]
margin_left = 824.0
margin_right = 1024.0
margin_bottom = 600.0
culomn = 4
entry_scene = ExtResource( 1 )

View File

@ -1,4 +1,4 @@
extends PanelContainer
extends Control
# Copyright (c) 2019-2020 Péter Magyar
#
@ -20,6 +20,8 @@ extends PanelContainer
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
var opener_button : BaseButton
export(PackedScene) var spec_scene : PackedScene
export(PackedScene) var spec_switcher_scene : PackedScene
export(NodePath) var spec_container_path : NodePath
@ -32,6 +34,8 @@ var _data : EntityData
var _player : Entity
func _ready():
connect("visibility_changed", self, "on_visibility_changed")
_spec_container = get_node(spec_container_path)
_spec_switcher_container = get_node(spec_switcher_path)
@ -96,10 +100,19 @@ func centity_data_changed(data: EntityData) -> void:
s.set_spec(_player, spec, i)
func on_visibility_changed():
if opener_button:
if visible && !opener_button.pressed:
opener_button.pressed = true
return
if !visible && opener_button.pressed:
opener_button.pressed = false
func _on_TalentButton_toggled(button_pressed):
func _on_button_toggled(button_pressed):
if button_pressed:
show()
if !visible:
show()
else:
hide()
if visible:
hide()

View File

@ -0,0 +1,117 @@
[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
mouse_filter = 2
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,13 @@
[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
scene = ExtResource( 3 )
opener_button_texture = ExtResource( 1 )
index = 2
add_button = true

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

View File

@ -2,7 +2,6 @@
[ext_resource path="res://fonts/VT323-Regular.ttf" type="DynamicFontData" id=1]
[resource]
size = 21
font_data = ExtResource( 1 )

View File

@ -4,4 +4,4 @@
[resource]
atlas = ExtResource( 1 )
region = Rect2( 2, 101, 12, 14 )
region = Rect2( 0, 108, 20, 20 )

View File

@ -5,8 +5,8 @@
[resource]
texture = ExtResource( 1 )
region_rect = Rect2( 0, 0, 13, 14 )
margin_left = 5.0562
margin_right = 5.57024
margin_left = 5.0
margin_right = 5.0
margin_top = 6.0
margin_bottom = 5.57024
axis_stretch_horizontal = 2

View File

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=2]
[ext_resource path="res://ui/theme/GameUI.png" type="Texture" id=1]
[resource]
atlas = ExtResource( 1 )
region = Rect2( 105, 89, 20, 20 )

View File

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=2]
[ext_resource path="res://ui/theme/GameUI.png" type="Texture" id=1]
[resource]
atlas = ExtResource( 1 )
region = Rect2( 105, 108, 20, 20 )

View File

@ -4,4 +4,4 @@
[resource]
atlas = ExtResource( 1 )
region = Rect2( 31, 101, 12, 14 )
region = Rect2( 34, 108, 20, 20 )

View File

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=2]
[ext_resource path="res://ui/theme/GameUI.png" type="Texture" id=1]
[resource]
atlas = ExtResource( 1 )
region = Rect2( 68, 108, 20, 20 )

View File

@ -4,4 +4,4 @@
[resource]
atlas = ExtResource( 1 )
region = Rect2( 16, 101, 12, 14 )
region = Rect2( 17, 108, 20, 20 )

View File

@ -0,0 +1,7 @@
[gd_resource type="AtlasTexture" load_steps=2 format=2]
[ext_resource path="res://ui/theme/GameUI.png" type="Texture" id=1]
[resource]
atlas = ExtResource( 1 )
region = Rect2( 86, 108, 20, 20 )

File diff suppressed because one or more lines are too long

View File

@ -4,4 +4,4 @@
[resource]
atlas = ExtResource( 1 )
region = Rect2( 45, 101, 12, 14 )
region = Rect2( 50, 108, 20, 20 )

View File

@ -0,0 +1,227 @@
extends Control
# 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.
export(NodePath) var spell_entry_container_path : NodePath
export(NodePath) var learn_button_path : NodePath
export(NodePath) var cost_label_path : NodePath
export(NodePath) var spell_icon_path : NodePath
export(NodePath) var spell_name_label_path : NodePath
export(NodePath) var spell_description_label_path : NodePath
export(NodePath) var spell_requirements_label_path : NodePath
var _spell_entry_container : Node
var _spell_entries : Array
var _learn_button : Button
var _cost_label : Label
var _spell_icon : TextureRect
var _spell_name_label : Label
var _spell_description_label : Label
var _spell_requirements_label : Label
var _player : Entity
var _entity_data : EntityData
var _character_class : EntityClassData
var _spells : Array
var _spell_button_group : ButtonGroup
func _ready() -> void:
_spell_button_group = ButtonGroup.new()
_spell_entry_container = get_node(spell_entry_container_path)
_spell_icon = get_node(spell_icon_path) as TextureRect
_spell_name_label = get_node(spell_name_label_path) as Label
_spell_description_label = get_node(spell_description_label_path) as Label
_spell_requirements_label = get_node(spell_requirements_label_path) as Label
_learn_button = get_node(learn_button_path)
_cost_label = get_node(cost_label_path)
_learn_button.connect("pressed", self, "learn")
connect("visibility_changed", self, "_visibility_changed")
func learn() -> void:
if _character_class == null:
return
if _player == null:
return
var b : Button = _spell_button_group.get_pressed_button()
if b:
var spell : Spell = b.get_meta("spell")
_player.spell_learn_requestc(spell.id)
refresh_entries()
func refresh_entries() -> void:
if _character_class == null or _player == null:
return
for c in _spell_entry_container.get_children():
c.queue_free()
_spell_entries.clear()
for s in _spells:
var spell : Spell = s
if !spell:
continue
if _player.spell_hasc(spell):
continue
var b : Button = Button.new()
b.text = spell.text_name + " (rank " + str(spell.rank) + ")"
b.set_meta("spell", spell)
b.group = _spell_button_group
b.toggle_mode = true
b.connect("pressed", self, "_button_pressed")
_spell_entries.append(b)
_spell_entry_container.add_child(b)
if _spell_entries.size() > 0:
_spell_entries[0].pressed = true
_button_pressed()
func refresh_all() -> void:
if _player == null:
return
if _character_class == null:
return
refresh_entries()
func _visibility_changed() -> void:
if visible:
refresh_all()
func set_player(p_player: Entity) -> void:
if _player != null:
_player.disconnect("centity_data_changed", self, "centity_data_changed")
_player.disconnect("onc_open_winow_request", self, "onc_open_winow_request")
_player = p_player
_player.connect("centity_data_changed", self, "centity_data_changed")
_player.connect("onc_open_winow_request", self, "onc_open_winow_request")
if _player != null:
centity_data_changed(_player.centity_data)
else:
centity_data_changed(null)
func centity_data_changed(data: EntityData):
_spells.clear()
_entity_data = null
_character_class = null
if data == null:
return
_entity_data = _player.centity_data
_character_class = _entity_data.entity_class_data
if _character_class == null:
return
for i in range(_character_class.get_num_spells()):
_spells.append(_character_class.get_spell(i))
_spells.sort_custom(CustomSpellSorter, "sort")
refresh_all()
func _button_pressed():
var b : Button = _spell_button_group.get_pressed_button()
if b && b.has_meta("spell"):
var spell : Spell = b.get_meta("spell")
_spell_icon.texture = spell.icon
_spell_name_label.text = spell.text_name
_spell_description_label.text = spell.text_description
var req_str = "Required: "
if spell.training_required_spell:
req_str += spell.training_required_spell.text_name + " (rank " + str(spell.training_required_spell.rank) + ") "
if spell.level > 0:
req_str += "level " + str(spell.level)
_spell_requirements_label.text = req_str
_cost_label.text = str(spell.get_training_cost())
else:
_spell_icon.texture = null
_spell_name_label.text = ""
_spell_description_label.text = ""
_spell_requirements_label.text = ""
_cost_label.text = "0"
class CustomSpellSorter:
static func sort(a, b):
if a.level < b.level:
return true
elif a.level > b.level:
return false
else:
var res = a.text_name.casecmp_to(b.text_name)
if res == 0:
if a.rank < b.rank:
return true
return false
elif res == 1:
return false
return true
func onc_open_winow_request(window_id : int) -> void:
if window_id != EntityEnums.ENTITY_WINDOW_TRAINER:
return
show()
# if player.has_signal("player_moved") && !player.is_connected("player_moved", self, "on_player_moved"):
# player.connect("player_moved", self, "on_player_moved", [], CONNECT_ONESHOT)

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

@ -0,0 +1,89 @@
extends Control
# 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.
export(NodePath) var icon_path : NodePath
export(NodePath) var name_label_path : NodePath
#export(NodePath) var description_label_path : NodePath
export(NodePath) var quantity_spinbox_path : NodePath
export(NodePath) var learn_button_path : NodePath
export(NodePath) var spell_button_path : NodePath
export(NodePath) var popup_path : NodePath
export(Color) var known_color : Color = Color.white
export(Color) var not_known_color : Color = Color.gray
export(Color) var unlearnable_color : Color = Color.gray
var _icon : TextureRect
var _name_label : Label
#var _description_label : RichTextLabel
var _item_button : Button
var _popup : Popup
var _quantity_spinbox : SpinBox
var _vendor_item_data_entry : VendorItemDataEntry
var _player : Entity
var _index : int
func _ready() -> void:
_icon = get_node(icon_path) as TextureRect
_name_label = get_node(name_label_path) as Label
# _description_label = get_node(description_label_path) as RichTextLabel
_item_button = get_node(spell_button_path) as Button
_popup = get_node(popup_path) as Popup
_quantity_spinbox = get_node(quantity_spinbox_path) as SpinBox
func set_vendor_item(p_player : Entity, p_vide: VendorItemDataEntry, index : int) -> void:
_vendor_item_data_entry = p_vide
_player = p_player
_index = index
# _icon.set_spell(_spell)
_item_button.set_item(_vendor_item_data_entry)
_popup.set_item(_vendor_item_data_entry)
if _vendor_item_data_entry != null && _vendor_item_data_entry.item != null:
_icon.texture = _vendor_item_data_entry.item.icon
_name_label.text = _vendor_item_data_entry.item.text_name
else:
_icon.texture = null
_name_label.text = "....."
update_spell_indicators()
func spell_button_pressed() -> void:
var pos : Vector2 = _item_button.rect_global_position
pos.x += _item_button.rect_size.x
_popup.popup(Rect2(pos, _popup.rect_size))
func buy():
if !_player:
return
var count : int = _quantity_spinbox.value
_player.vendor_item_sbuy(_index, count)
func update_spell_indicators():
pass

View File

@ -0,0 +1,165 @@
[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/vendor_window/VendorEntryPopup.gd" type="Script" id=2]
[ext_resource path="res://ui/vendor_window/ItemDragAndDropVendor.gd" type="Script" id=3]
[ext_resource path="res://ui/vendor_window/ItemContainer.gd" type="Script" id=4]
[node name="ItemContainer" type="Control"]
margin_left = 290.0
margin_top = 306.0
margin_right = 576.0
margin_bottom = 370.0
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource( 1 )
script = ExtResource( 4 )
__meta__ = {
"_edit_use_anchors_": false
}
icon_path = NodePath("PanelContainer/HBoxContainer/Button/CenterContainer/Icon")
name_label_path = NodePath("PanelContainer/HBoxContainer/Name")
quantity_spinbox_path = NodePath("EntryPopup/VBoxContainer/Container/VBoxContainer/HBoxContainer/SpinBox")
learn_button_path = NodePath("EntryPopup/VBoxContainer/HBoxContainer/Button")
spell_button_path = NodePath("../ItemContainer/PanelContainer/HBoxContainer/Button")
popup_path = NodePath("EntryPopup")
not_known_color = Color( 0.596078, 0.596078, 0.596078, 1 )
unlearnable_color = Color( 0.772549, 0.192157, 0.192157, 1 )
[node name="PanelContainer" type="PanelContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 282.0
margin_bottom = 60.0
[node name="Button" type="Button" parent="PanelContainer/HBoxContainer"]
margin_right = 55.0
margin_bottom = 56.0
rect_min_size = Vector2( 55, 55 )
script = ExtResource( 3 )
[node name="CenterContainer" type="MarginContainer" parent="PanelContainer/HBoxContainer/Button"]
margin_left = 4.0
margin_top = 4.0
margin_right = 51.0
margin_bottom = 51.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Icon" type="TextureRect" parent="PanelContainer/HBoxContainer/Button/CenterContainer"]
margin_right = 47.0
margin_bottom = 47.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
expand = true
[node name="Name" type="Label" parent="PanelContainer/HBoxContainer"]
margin_left = 59.0
margin_top = 20.0
margin_right = 278.0
margin_bottom = 35.0
size_flags_horizontal = 3
text = "......"
[node name="EntryPopup" type="PopupPanel" parent="."]
margin_left = 64.0
margin_top = 4.0
margin_right = 360.0
margin_bottom = 207.0
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
label_path = NodePath("VBoxContainer/HBoxContainer/Label")
desc_label_path = NodePath("VBoxContainer/Container/VBoxContainer/RichTextLabel")
quantity_spinbox_path = NodePath("VBoxContainer/Container/VBoxContainer/HBoxContainer/SpinBox")
[node name="VBoxContainer" type="VBoxContainer" parent="EntryPopup"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 4.0
margin_right = -4.0
margin_bottom = -4.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HBoxContainer" type="HBoxContainer" parent="EntryPopup/VBoxContainer"]
margin_right = 288.0
margin_bottom = 26.0
[node name="Label" type="Label" parent="EntryPopup/VBoxContainer/HBoxContainer"]
margin_top = 5.0
margin_right = 254.0
margin_bottom = 20.0
size_flags_horizontal = 3
[node name="Button" type="Button" parent="EntryPopup/VBoxContainer/HBoxContainer"]
margin_left = 258.0
margin_right = 288.0
margin_bottom = 26.5702
rect_min_size = Vector2( 30, 0 )
text = "X"
[node name="HSeparator2" type="HSeparator" parent="EntryPopup/VBoxContainer"]
margin_top = 34.0
margin_right = 288.0
margin_bottom = 38.0
[node name="Container" type="VBoxContainer" parent="EntryPopup/VBoxContainer"]
margin_top = 46.0
margin_right = 288.0
margin_bottom = 195.0
rect_min_size = Vector2( 0, 20 )
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="EntryPopup/VBoxContainer/Container"]
margin_right = 288.0
margin_bottom = 149.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HBoxContainer" type="HBoxContainer" parent="EntryPopup/VBoxContainer/Container/VBoxContainer"]
margin_right = 288.0
margin_bottom = 26.0
[node name="SpinBox" type="SpinBox" parent="EntryPopup/VBoxContainer/Container/VBoxContainer/HBoxContainer"]
margin_right = 169.47
margin_bottom = 26.0
min_value = 1.0
value = 1.0
rounded = true
align = 1
[node name="LearnButton" type="Button" parent="EntryPopup/VBoxContainer/Container/VBoxContainer/HBoxContainer"]
margin_left = 173.0
margin_right = 288.0
margin_bottom = 26.5702
size_flags_horizontal = 3
text = "Buy"
[node name="RichTextLabel" type="RichTextLabel" parent="EntryPopup/VBoxContainer/Container/VBoxContainer"]
margin_top = 34.0
margin_right = 288.0
margin_bottom = 149.0
size_flags_horizontal = 3
size_flags_vertical = 3
[connection signal="pressed" from="PanelContainer/HBoxContainer/Button" to="." method="spell_button_pressed"]
[connection signal="pressed" from="EntryPopup/VBoxContainer/HBoxContainer/Button" to="EntryPopup" method="hide"]
[connection signal="pressed" from="EntryPopup/VBoxContainer/Container/VBoxContainer/HBoxContainer/LearnButton" to="." method="buy"]

View File

@ -1,4 +1,4 @@
extends VBoxContainer
extends Button
# Copyright (c) 2019-2020 Péter Magyar
#
@ -20,14 +20,26 @@ extends VBoxContainer
# 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"
var item : VendorItemDataEntry
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
func set_item(p_item):
item = p_item
func get_drag_data(pos):
if item == null || item.item:
return null
var tr = TextureRect.new()
tr.texture = item.item.icon
tr.expand = true
# tr.rect_size = rect_size
tr.rect_size = Vector2(45, 45)
set_drag_preview(tr)
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
var esd = ESDragAndDrop.new()
esd.type = ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_ITEM
esd.item_path = item.item.resource_path
return esd

View File

@ -0,0 +1,54 @@
extends PopupPanel
# 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.
export(NodePath) var label_path : NodePath
export(NodePath) var desc_label_path : NodePath
export(NodePath) var quantity_spinbox_path : NodePath
var _label : Label
var _desc_label : RichTextLabel
var _quantity_spinbox : SpinBox
var _item : ItemTemplate
var _item_data_entry : VendorItemDataEntry
func _ready():
_label = get_node(label_path) as Label
_desc_label = get_node(desc_label_path) as RichTextLabel
_quantity_spinbox = get_node(quantity_spinbox_path) as SpinBox
func set_item(item_data_entry : VendorItemDataEntry) -> void:
_item_data_entry = item_data_entry
if _item_data_entry == null:
return
_item = _item_data_entry.item
if _item == null:
return
_label.text = _item.text_name
_desc_label.text = _item.get_description()
_quantity_spinbox.max_value = _item.stack_size
_quantity_spinbox.value = 1

View File

@ -0,0 +1,161 @@
extends Control
# 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.
export(NodePath) var opener_button_path : NodePath
var opener_button : BaseButton
export(NodePath) var spell_entry_container_path : NodePath
export(NodePath) var prev_button_path : NodePath
export(NodePath) var next_button_path : NodePath
export(bool) var show_not_learned : bool = true
export(bool) var show_not_learnable : bool = false
var _spell_entry_container : Node
var _item_entries : Array
var _prev_button : Button
var _next_button : Button
var _player : Entity
var _page : int = 0
var _max_pages : int = 0
var _vendor_item_data : VendorItemData
func _ready() -> void:
opener_button = get_node_or_null(opener_button_path) as BaseButton
_item_entries.clear()
_spell_entry_container = get_node(spell_entry_container_path)
for i in range(_spell_entry_container.get_child_count()):
_item_entries.append(_spell_entry_container.get_child(i))
_prev_button = get_node(prev_button_path)
_next_button = get_node(next_button_path)
_prev_button.connect("pressed", self, "dec_page")
_next_button.connect("pressed", self, "inc_page")
connect("visibility_changed", self, "_visibility_changed")
func inc_page() -> void:
if _vendor_item_data == null:
return
_page += 1
if _page > _max_pages:
_page = _max_pages
refresh_entries()
func dec_page() -> void:
if _vendor_item_data == null:
return
_page -= 1
if _page < 0:
_page = 0
refresh_entries()
func refresh_entries() -> void:
if _player == null || _vendor_item_data == null:
return
var i : int = 0
var n : int = 0
# for n in range(len(_item_entries)):
while n < len(_item_entries):
var spindex : int = i + (_page * len(_item_entries))
if spindex >= _vendor_item_data.get_num_vendor_datas():
_item_entries[n].set_vendor_item(_player, null, 0)
i += 1
n += 1
continue
var vide : VendorItemDataEntry = _vendor_item_data.get_vendor_data(spindex)
if !vide:
continue
_item_entries[n].set_vendor_item(_player, vide, spindex)
i += 1
n += 1
func refresh_all() -> void:
if _player == null:
return
if _vendor_item_data == null:
return
_max_pages = int(_vendor_item_data.get_num_vendor_datas() / len(_item_entries))
if _page > _max_pages:
_page = _max_pages
refresh_entries()
func _visibility_changed() -> void:
if visible:
if !_player:
return
var t : Entity = _player.ctarget
if !t:
return
_vendor_item_data = t.getc_entity_data().entity_class_data.get_vendor_item_data()
_page = 0
refresh_all()
func set_player(p_player: Entity) -> void:
if _player != null:
_player.disconnect("onc_open_winow_request", self, "onc_open_winow_request")
_player = p_player
_player.connect("onc_open_winow_request", self, "onc_open_winow_request")
func onc_open_winow_request(window_id : int) -> void:
if window_id != EntityEnums.ENTITY_WINDOW_VENDOR:
return
show()
# if player.has_signal("player_moved") && !player.is_connected("player_moved", self, "on_player_moved"):
# player.connect("player_moved", self, "on_player_moved", [], CONNECT_ONESHOT)

View File

@ -0,0 +1,175 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://ui/vendor_window/ItemContainer.tscn" type="PackedScene" id=1]
[ext_resource path="res://ui/vendor_window/VendorWindow.gd" type="Script" id=4]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=5]
[node name="VendorWindow" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
theme = ExtResource( 5 )
script = ExtResource( 4 )
__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")
show_not_learned = false
[node name="PanelContainer" type="PanelContainer" parent="."]
margin_left = 64.0
margin_top = 39.0
margin_right = 580.0
margin_bottom = 507.0
[node name="PagedContent" type="VBoxContainer" parent="PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 512.0
margin_bottom = 464.0
[node name="Header" type="HBoxContainer" parent="PanelContainer/PagedContent"]
margin_right = 508.0
margin_bottom = 30.0
[node name="Label" type="Label" parent="PanelContainer/PagedContent/Header"]
margin_top = 7.0
margin_right = 36.0
margin_bottom = 22.0
text = "Vendor"
[node name="HBoxContainer" type="HBoxContainer" parent="PanelContainer/PagedContent/Header"]
margin_left = 40.0
margin_right = 464.0
margin_bottom = 30.0
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 1
[node name="Button" type="Button" parent="PanelContainer/PagedContent/Header"]
margin_left = 468.0
margin_right = 508.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 = 508.0
margin_bottom = 422.0
size_flags_horizontal = 3
size_flags_vertical = 3
columns = 2
[node name="ItemContainer" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 0.0
margin_top = 0.0
margin_right = 252.0
margin_bottom = 60.0
[node name="ItemContainer2" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 256.0
margin_top = 0.0
margin_right = 508.0
margin_bottom = 60.0
[node name="ItemContainer3" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 0.0
margin_top = 64.0
margin_right = 252.0
margin_bottom = 124.0
[node name="ItemContainer4" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 256.0
margin_top = 64.0
margin_right = 508.0
margin_bottom = 124.0
[node name="ItemContainer5" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 0.0
margin_top = 128.0
margin_right = 252.0
margin_bottom = 188.0
[node name="ItemContainer6" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 256.0
margin_top = 128.0
margin_right = 508.0
margin_bottom = 188.0
[node name="ItemContainer7" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 0.0
margin_top = 192.0
margin_right = 252.0
margin_bottom = 252.0
[node name="ItemContainer8" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 256.0
margin_top = 192.0
margin_right = 508.0
margin_bottom = 252.0
[node name="ItemContainer9" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 0.0
margin_top = 256.0
margin_right = 252.0
margin_bottom = 316.0
[node name="ItemContainer10" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 256.0
margin_top = 256.0
margin_right = 508.0
margin_bottom = 316.0
[node name="ItemContainer11" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 0.0
margin_top = 320.0
margin_right = 252.0
margin_bottom = 380.0
[node name="ItemContainer12" parent="PanelContainer/PagedContent/GridContainer" instance=ExtResource( 1 )]
margin_left = 256.0
margin_top = 320.0
margin_right = 508.0
margin_bottom = 380.0
[node name="Controls" type="MarginContainer" parent="PanelContainer/PagedContent"]
margin_top = 430.0
margin_right = 508.0
margin_bottom = 460.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 = 506.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 = 165.0
margin_bottom = 26.5702
size_flags_horizontal = 3
size_flags_vertical = 3
text = "< Previous page"
[node name="Spacer" type="Control" parent="PanelContainer/PagedContent/Controls/HBoxContainer"]
margin_left = 169.0
margin_right = 334.0
margin_bottom = 26.0
size_flags_horizontal = 3
[node name="Button" type="Button" parent="PanelContainer/PagedContent/Controls/HBoxContainer"]
margin_left = 338.0
margin_right = 504.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

@ -0,0 +1,11 @@
[gd_resource type="Resource" load_steps=3 format=2]
[ext_resource path="res://ui/vendor_window/VendorWindow.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,27 +0,0 @@
extends PanelContainer
# 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
func _on_CharacterButton_toggled(button_pressed):
if button_pressed:
show()
else:
hide()
func _on_Button_pressed():
hide()

View File

@ -1,75 +0,0 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://ui/windows/CharacterWindow.gd" type="Script" id=2]
[node name="CharacterWindow" type="PanelContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 1 )
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 4.0
margin_top = 4.0
margin_right = 1020.0
margin_bottom = 596.0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 1016.0
margin_bottom = 30.0
rect_min_size = Vector2( 0, 30 )
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer"]
margin_top = 7.0
margin_right = 982.0
margin_bottom = 22.0
size_flags_horizontal = 3
text = "Character"
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer"]
margin_left = 986.0
margin_right = 1016.0
margin_bottom = 30.0
rect_min_size = Vector2( 30, 30 )
text = "X"
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HBoxContainer2" 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/HBoxContainer2"]
margin_right = 387.0
margin_bottom = 554.0
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.62
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2/PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 383.0
margin_bottom = 550.0
[node name="PanelContainer2" type="PanelContainer" parent="VBoxContainer/HBoxContainer2"]
margin_left = 391.0
margin_right = 1016.0
margin_bottom = 554.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer2/PanelContainer2"]
margin_left = 4.0
margin_top = 4.0
margin_right = 621.0
margin_bottom = 550.0
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Button" to="." method="_on_Button_pressed"]

View File

@ -1,311 +0,0 @@
[gd_scene load_steps=7 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://ui/windows/CraftingWindow.gd" type="Script" id=2]
[ext_resource path="res://ui/crafting/RecipeSelector.tscn" type="PackedScene" id=3]
[ext_resource path="res://ui/crafting/ItemEntry.tscn" type="PackedScene" id=4]
[ext_resource path="res://ui/windows/CraftItemDescription.gd" type="Script" id=5]
[sub_resource type="ButtonGroup" id=1]
[node name="CraftingWindow" type="PanelContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 1 )
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
item_entry_scene = ExtResource( 4 )
recipe_selector_scene = ExtResource( 3 )
item_container_path = NodePath("VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription")
tools_container_path = NodePath("VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/ToolsContainer")
materials_container_path = NodePath("VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/MaterialContainer")
recipe_selector_container_path = NodePath("VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2/Recipes/VBoxContainer")
recipe_selector_main_on = NodePath("VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2/Recipes")
recipe_selector_main_off = NodePath("VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2/CenterContainer2")
materials_container_main_on = NodePath("VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry")
materials_container_main_off = NodePath("VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CenterContainer")
[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
[node name="Label" type="Label" parent="VBoxContainer/Header"]
margin_top = 7.0
margin_right = 972.0
margin_bottom = 22.0
size_flags_horizontal = 3
text = "Crafting"
[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="Categories" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 38.0
margin_right = 1016.0
margin_bottom = 64.0
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/Categories"]
margin_right = 1016.0
margin_bottom = 26.0
rect_min_size = Vector2( 0, 20 )
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 1
[node name="Alchemy" type="Button" parent="VBoxContainer/Categories/HBoxContainer2"]
margin_left = 198.0
margin_right = 298.0
margin_bottom = 26.269
rect_min_size = Vector2( 100, 0 )
toggle_mode = true
pressed = true
group = SubResource( 1 )
text = "Alchemy"
[node name="Smithing" type="Button" parent="VBoxContainer/Categories/HBoxContainer2"]
margin_left = 302.0
margin_right = 402.0
margin_bottom = 26.269
rect_min_size = Vector2( 100, 0 )
toggle_mode = true
group = SubResource( 1 )
text = "Smithing"
[node name="Enchanting" type="Button" parent="VBoxContainer/Categories/HBoxContainer2"]
margin_left = 406.0
margin_right = 506.0
margin_bottom = 26.269
rect_min_size = Vector2( 100, 0 )
toggle_mode = true
group = SubResource( 1 )
text = "Enchantig"
[node name="Engineering" type="Button" parent="VBoxContainer/Categories/HBoxContainer2"]
margin_left = 510.0
margin_right = 610.0
margin_bottom = 26.269
rect_min_size = Vector2( 100, 0 )
toggle_mode = true
group = SubResource( 1 )
text = "Engineering"
[node name="Tailoring" type="Button" parent="VBoxContainer/Categories/HBoxContainer2"]
margin_left = 614.0
margin_right = 714.0
margin_bottom = 26.269
rect_min_size = Vector2( 100, 0 )
toggle_mode = true
group = SubResource( 1 )
text = "Tailoring"
[node name="Other" type="Button" parent="VBoxContainer/Categories/HBoxContainer2"]
margin_left = 718.0
margin_right = 818.0
margin_bottom = 26.269
rect_min_size = Vector2( 100, 0 )
toggle_mode = true
group = SubResource( 1 )
text = "Other"
[node name="VBoxContainer" type="MarginContainer" parent="VBoxContainer"]
margin_top = 72.0
margin_right = 1016.0
margin_bottom = 592.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/VBoxContainer"]
margin_right = 1016.0
margin_bottom = 520.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer"]
margin_right = 674.0
margin_bottom = 520.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="CraftEntry" type="VBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer"]
visible = false
margin_left = 4.0
margin_top = 4.0
margin_right = 718.0
margin_bottom = 516.0
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.6
custom_constants/separation = 10
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry"]
margin_right = 714.0
margin_bottom = 472.0
size_flags_horizontal = 3
size_flags_vertical = 3
scroll_horizontal_enabled = false
[node name="VBoxContainer2" type="VBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer"]
margin_right = 714.0
margin_bottom = 122.0
size_flags_horizontal = 3
[node name="CraftItemDescription" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2"]
margin_right = 714.0
margin_bottom = 60.0
alignment = 1
script = ExtResource( 5 )
icon_path = NodePath("VBoxContainer/PanelContainer/TextureRect")
name_label_path = NodePath("PanelContainer2/VBoxContainer/Label")
description_label_path = NodePath("PanelContainer2/VBoxContainer/RichTextLabel")
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription"]
margin_left = 175.0
margin_right = 235.0
margin_bottom = 60.0
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription/VBoxContainer"]
margin_right = 60.0
margin_bottom = 60.0
rect_min_size = Vector2( 60, 60 )
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription/VBoxContainer/PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 56.0
margin_bottom = 56.0
expand = true
[node name="PanelContainer2" type="PanelContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription"]
margin_left = 239.0
margin_right = 539.0
margin_bottom = 60.0
rect_min_size = Vector2( 300, 0 )
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription/PanelContainer2"]
margin_left = 4.0
margin_top = 4.0
margin_right = 296.0
margin_bottom = 56.0
[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription/PanelContainer2/VBoxContainer"]
margin_right = 292.0
margin_bottom = 15.0
[node name="RichTextLabel" type="RichTextLabel" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2/CraftItemDescription/PanelContainer2/VBoxContainer"]
margin_top = 23.0
margin_right = 292.0
margin_bottom = 52.0
size_flags_vertical = 3
text = "
"
scroll_active = false
[node name="Label2" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2"]
margin_top = 68.0
margin_right = 714.0
margin_bottom = 83.0
text = "Tools"
[node name="ToolsContainer" type="VBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2"]
margin_top = 91.0
margin_right = 714.0
margin_bottom = 91.0
[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2"]
margin_top = 99.0
margin_right = 714.0
margin_bottom = 114.0
text = "Materials"
[node name="MaterialContainer" type="VBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/ScrollContainer/VBoxContainer2"]
margin_top = 122.0
margin_right = 714.0
margin_bottom = 122.0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry"]
margin_top = 482.0
margin_right = 714.0
margin_bottom = 512.0
alignment = 1
[node name="CraftButton" type="Button" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/HBoxContainer"]
margin_left = 307.0
margin_right = 407.0
margin_bottom = 30.0
rect_min_size = Vector2( 100, 30 )
text = "Craft"
[node name="CenterContainer" type="CenterContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 670.0
margin_bottom = 516.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CenterContainer"]
margin_left = 288.0
margin_top = 248.0
margin_right = 378.0
margin_bottom = 263.0
text = "Select a recipe"
align = 1
valign = 1
[node name="PanelContainer2" type="PanelContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer"]
margin_left = 678.0
margin_right = 1016.0
margin_bottom = 520.0
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 0.5
[node name="Recipes" type="ScrollContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2"]
visible = false
margin_left = 4.0
margin_top = 4.0
margin_right = 286.0
margin_bottom = 516.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2/Recipes"]
margin_right = 282.0
size_flags_horizontal = 3
[node name="CenterContainer2" type="CenterContainer" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2"]
margin_left = 4.0
margin_top = 4.0
margin_right = 334.0
margin_bottom = 516.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Label" type="Label" parent="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer2/CenterContainer2"]
margin_left = 135.0
margin_top = 248.0
margin_right = 195.0
margin_bottom = 263.0
text = "No recipes"
align = 1
valign = 1
[connection signal="pressed" from="VBoxContainer/Header/Button" to="." method="hide"]
[connection signal="pressed" from="VBoxContainer/Categories/HBoxContainer2/Alchemy" to="." method="set_category" binds= [ 1 ]]
[connection signal="pressed" from="VBoxContainer/Categories/HBoxContainer2/Smithing" to="." method="set_category" binds= [ 2 ]]
[connection signal="pressed" from="VBoxContainer/Categories/HBoxContainer2/Enchanting" to="." method="set_category" binds= [ 4 ]]
[connection signal="pressed" from="VBoxContainer/Categories/HBoxContainer2/Engineering" to="." method="set_category" binds= [ 5 ]]
[connection signal="pressed" from="VBoxContainer/Categories/HBoxContainer2/Tailoring" to="." method="set_category" binds= [ 3 ]]
[connection signal="pressed" from="VBoxContainer/Categories/HBoxContainer2/Other" to="." method="set_category" binds= [ 0 ]]
[connection signal="pressed" from="VBoxContainer/VBoxContainer/HBoxContainer/PanelContainer/CraftEntry/HBoxContainer/CraftButton" to="." method="request_craft"]

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")
[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 = 434.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"]
visible = false
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 = 438.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"]

Some files were not shown because too many files have changed in this diff Show More