This commit is contained in:
Relintai 2019-11-20 14:30:34 +01:00
parent 1715506d4a
commit 8559193d21
142 changed files with 7711 additions and 0 deletions

View File

@ -0,0 +1,48 @@
extends Control
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export (PackedScene) var action_bar_entry_scene
export (NodePath) var child_container_path
var child_container
# 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() -> void:
child_container = get_node(child_container_path)
# pass # Replace with function body.
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func set_actionbar_entry(action_bar_entry : ActionBarEntry, player: Entity) -> void:
#rect_size = Vector2(action_bar_entry.size, (action_bar_entry.size) * action_bar_entry.slot_num)
#set_anchors_preset(Control.PRESET_BOTTOM_RIGHT, false)
#margin_left = action_bar_entry.action_bar_id * -(action_bar_entry.size + 5) - 10
margin_top = - ((action_bar_entry.size) * action_bar_entry.slot_num)
#margin_bottom = 0
margin_right = -((action_bar_entry.action_bar_id - 1) * action_bar_entry.size)
margin_left = -((action_bar_entry.action_bar_id) * action_bar_entry.size)
for i in range(action_bar_entry.slot_num):
var b : ActionBarButtonEntry = action_bar_entry.get_button_for_slotid(i)
#for i in range(action_bar_entry.get_action_bar_entry_count()):
#var b = action_bar_entry.get_button(i)
var s : Node = action_bar_entry_scene.instance()
child_container.add_child(s)
s.set_player(player)
s.set_button_entry(b, player)
s.owner = child_container

View File

@ -0,0 +1,30 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/actionbars/ActionBarEntry.tscn" type="PackedScene" id=1]
[ext_resource path="res://ui/actionbars/ActionBar.gd" type="Script" id=2]
[node name="ActionBar" type="Control"]
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -63.0
margin_top = -580.0
mouse_filter = 2
script = ExtResource( 2 )
__meta__ = {
"_edit_use_anchors_": false
}
action_bar_entry_scene = ExtResource( 1 )
child_container_path = NodePath("GridContainer")
[node name="GridContainer" type="GridContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/vseparation = 0
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -0,0 +1,276 @@
extends Button
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export (NodePath) var button_path : NodePath
export (NodePath) var icon_path : NodePath
export (NodePath) var cooldown_indicator_path : NodePath
export (NodePath) var cooldown_text_path : NodePath
export (NodePath) var keybind_text_path : NodePath
var button : Button
var icon_rect : TextureRect
var cooldown_indicator : TextureProgress
var cooldown_text : Label
var keybind_text : Label
var button_entry : ActionBarButtonEntry
var player : Entity
var spell_id : int = 0
var spell_type : int = 0
var cd : Cooldown = null
var categ_cd : CategoryCooldown = null
var has_gcd : bool = false
var gcd : float = 0.0
func _ready() -> void:
button = get_node(button_path) as Button
icon_rect = get_node(icon_path) as TextureRect
cooldown_indicator = get_node(cooldown_indicator_path) as TextureProgress
cooldown_text = get_node(cooldown_text_path) as Label
keybind_text = get_node(keybind_text_path) as Label
button.connect("pressed", self, "_on_button_pressed")
func _exit_tree():
if icon_rect.texture != null:
ThemeAtlas.unref_texture(icon_rect.texture)
func _process(delta : float) -> void:
if cd == null and categ_cd == null and gcd < 0.001:
set_process(false)
hide_cooldown_timer()
return
if gcd > 0.001:
gcd -= delta
if gcd < 0:
gcd = 0
var value : float = gcd
if cd != null and cd.remaining > value:
value = cd.remaining
if categ_cd != null and categ_cd.remaining > value:
value = categ_cd.remaining
set_cooldown_time(value)
func set_cooldown_time(time : float) -> void:
cooldown_indicator.value = time
cooldown_text.text = str(int(time))
func show_cooldown_timer(max_time : float) -> void:
if cooldown_indicator.visible and cooldown_indicator.max_value < max_time:
cooldown_indicator.max_value = max_time
if not cooldown_indicator.visible:
cooldown_indicator.max_value = max_time
cooldown_indicator.show()
cooldown_text.show()
func hide_cooldown_timer() -> void:
cooldown_indicator.hide()
cooldown_text.hide()
func set_button_entry(action_bar_button_entry: ActionBarButtonEntry, p_player: Entity) -> void:
player = p_player
button_entry = action_bar_button_entry
var iea : InputEventAction = InputEventAction.new()
var action_name : String = "actionbar_" + str(action_bar_button_entry.action_bar_id) + "_" + str(action_bar_button_entry.slot_id)
if not InputMap.has_action(action_name):
InputMap.add_action(action_name)
var action_list : Array = InputMap.get_action_list(action_name)
for action in action_list:
if action is InputEventKey:
var s : String = ""
if action.shift:
s += "S-"
if action.alt:
s += "A-"
if action.control:
s += "C-"
if action.command:
s += "Co-"
if action.meta:
s += "M-"
s += char(action.scancode)
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:
ThemeAtlas.unref_texture(icon_rect.texture)
icon_rect.texture = null
elif (button_entry.type == ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_SPELL):
if (button_entry.item_id == 0):
if icon_rect.texture != null:
ThemeAtlas.unref_texture(icon_rect.texture)
icon_rect.texture = null
return
if icon_rect.texture != null:
ThemeAtlas.unref_texture(icon_rect.texture)
icon_rect.texture = null
var spell = Entities.get_spell(button_entry.item_id)
if spell.icon != null:
icon_rect.texture = ThemeAtlas.add_texture(spell.icon)
# icon_rect.texture = spell.icon
spell_id = spell.id
spell_type = spell.spell_type
has_gcd = spell.cooldown_global_cooldown
func _on_button_pressed() -> void:
if (button_entry.type == ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_SPELL):
if (button_entry.item_id == 0):
return
player.crequest_spell_cast(button_entry.item_id)
func set_button_entry_data(type: int, item_id: int) -> void:
button_entry.type = type
button_entry.itekm_id = item_id
setup_icon()
func get_drag_data(pos: Vector2) -> Object:
if (button_entry.type == ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_NONE):
return null
if player.actionbar_locked:
return null
var tr = TextureRect.new()
tr.texture = icon_rect.texture
tr.expand = true
tr.rect_size = icon_rect.rect_size
set_drag_preview(tr)
var esd = ESDragAndDrop.new()
if (button_entry.type == ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_SPELL):
esd.type = ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_SPELL
elif (button_entry.type == ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_ITEM):
esd.type = ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_ITEM
esd.item_id = button_entry.item_id
button_entry.type = ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_NONE
button_entry.item_id = 0
# Profiles.save()
setup_icon()
return esd
func can_drop_data(pos, data) -> bool:
return data.is_class("ESDragAndDrop")
func drop_data(pos, esd) -> void:
if (esd.type == ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_SPELL):
button_entry.type = ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_SPELL
elif (esd.type == ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_ITEM):
button_entry.type = ActionBarButtonEntry.ACTION_BAR_BUTTON_ENTRY_TYPE_ITEM
button_entry.item_id = esd.item_id
setup_icon()
func set_player(p_player: Entity) -> void:
if not player == null:
player.disconnect("ccooldown_added", self, "_ccooldown_added")
player.disconnect("ccooldown_removed", self, "_ccooldown_removed")
player.disconnect("ccategory_cooldown_added", self, "_ccategory_cooldown_added")
player.disconnect("ccategory_cooldown_removed", self, "_ccategory_cooldown_removed")
player.disconnect("cgcd_started", self, "_cgcd_started")
player.disconnect("cgcd_finished", self, "_cgcd_finished")
player = null
player = p_player
if player == null:
return
# for i in range(player.getc_cooldown_count()):
# var cooldown : Cooldown = player.getc_cooldown(i)
player.connect("ccooldown_added", self, "_ccooldown_added")
player.connect("ccooldown_removed", self, "_ccooldown_removed")
player.connect("ccategory_cooldown_added", self, "_ccategory_cooldown_added")
player.connect("ccategory_cooldown_removed", self, "_ccategory_cooldown_removed")
player.connect("cgcd_started", self, "_cgcd_started")
player.connect("cgcd_finished", self, "_cgcd_finished")
func _ccooldown_added(cooldown : Cooldown) -> void:
if cooldown.spell_id == spell_id:
cd = cooldown
set_process(true)
show_cooldown_timer(cooldown.remaining)
func _ccooldown_removed(cooldown : Cooldown) -> void:
if cooldown.spell_id == spell_id:
cd = null
func _ccategory_cooldown_added(cooldown : CategoryCooldown) -> void:
if cooldown.category_id == spell_type:
categ_cd = cooldown
set_process(true)
show_cooldown_timer(cooldown.remaining)
func _ccategory_cooldown_removed(cooldown : CategoryCooldown) -> void:
if cooldown.category_id == spell_type:
categ_cd = null
func _cgcd_started(value :float) -> void:
if not has_gcd:
return
gcd = value
show_cooldown_timer(value)
set_process(true)
func _cgcd_finished() -> void:
gcd = 0

View File

@ -0,0 +1,93 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://ui/actionbars/ActionBarEntry.gd" type="Script" id=1]
[ext_resource path="res://ui/theme/cooldown_progress.png" type="Texture" id=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=3]
[ext_resource path="res://ui/theme/actionbar_dynamicfont.tres" type="DynamicFont" id=5]
[node name="ActionBarEntry" type="TouchButton"]
margin_top = 1.0
margin_right = 70.0
margin_bottom = 71.0
focus_mode = 0
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource( 3 )
shortcut_in_tooltip = false
action_mode = 0
button_mask = 3
enabled_focus_mode = 0
keep_pressed_outside = true
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
button_path = NodePath(".")
icon_path = NodePath("MarginContainer/TextureRect")
cooldown_indicator_path = NodePath("CooldownIndicator")
cooldown_text_path = NodePath("CooldownText")
keybind_text_path = NodePath("KeybindText")
[node name="MarginContainer" type="MarginContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
custom_constants/margin_right = 2
custom_constants/margin_top = 2
custom_constants/margin_left = 2
custom_constants/margin_bottom = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureRect" type="TextureRect" parent="MarginContainer"]
margin_left = 2.0
margin_top = 2.0
margin_right = 68.0
margin_bottom = 68.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
expand = true
[node name="CooldownIndicator" type="TextureProgress" parent="."]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
step = 0.0
texture_progress = ExtResource( 2 )
fill_mode = 5
nine_patch_stretch = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CooldownText" type="Label" parent="."]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_fonts/font = ExtResource( 5 )
align = 1
valign = 1
clip_text = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="KeybindText" type="Label" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 2.0
margin_top = 2.0
margin_right = -2.0
margin_bottom = -2.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -0,0 +1,52 @@
extends Node
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(PackedScene) var actionbar_scene
var _player : Entity
func set_player(p_player: Entity) -> void:
if not _player == null:
clear_actionbars()
_player.disconnect("centity_data_changed", self, "_centity_data_changed")
_player = null
_player = p_player
if _player == null:
return
_centity_data_changed(_player.centity_data)
_player.connect("centity_data_changed", self, "_centity_data_changed")
func _centity_data_changed(cls: EntityData) -> void:
clear_actionbars()
if cls == null:
return
var abp = _player.get_action_bar_profile()
for i in range(abp.get_action_bar_count()):
var abe = abp.get_action_bar(i)
var s = actionbar_scene.instance()
add_child(s)
s.set_actionbar_entry(abe, _player)
s.owner = self
func clear_actionbars() -> void:
var children = get_children()
for c in children:
c.queue_free()

View File

@ -0,0 +1,37 @@
tool
extends Node
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(bool) var create = false setget createf
export(bool) var delete = false setget deletef
func createf(value : bool) -> void:
if not value:
return
for i in range(6):
for j in range(12):
var actionstr : String = "input/actionbar_" + str(i) + "_" + str(j)
var action : Dictionary = Dictionary()
action["events"] = Array()
action["deadzone"] = 0.5
ProjectSettings.set(name, actionstr)
ProjectSettings.save()
func deletef(value : bool) -> void:
if not value:
return
for i in range(6):
for j in range(12):
var action : String = "input/actionbar_" + str(i) + "_" + str(j)
ProjectSettings.clear(action)
ProjectSettings.save()

View File

@ -0,0 +1,79 @@
extends VBoxContainer
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export (NodePath) var texture_rect_path : NodePath
export (NodePath) var tooltip_node_path : NodePath
export (NodePath) var time_label_path : NodePath
export (NodePath) var magic_bg_path : NodePath
export (NodePath) var bleed_bg_path : NodePath
export (NodePath) var poison_bg_path : NodePath
export (NodePath) var physical_bg_path : NodePath
export (NodePath) var curse_bg_path : NodePath
var texture_rect : TextureRect
var tooltip_node : Control
var time_label : Label
var magic_bg : Node
var bleed_bg : Node
var poison_bg : Node
var physical_bg : Node
var curse_bg : Node
var aura_data : AuraData
func _ready():
set_process(false)
texture_rect = get_node(texture_rect_path) as TextureRect
tooltip_node = get_node(tooltip_node_path) as Control
time_label = get_node(time_label_path) as Label
magic_bg = get_node(magic_bg_path) as Node
bleed_bg = get_node(bleed_bg_path) as Node
poison_bg = get_node(poison_bg_path) as Node
physical_bg = get_node(physical_bg_path) as Node
curse_bg = get_node(curse_bg_path) as Node
func _process(delta):
# if not aura_data.is_timed:
# return
time_label.text = str(int(aura_data.remaining_time)) + "s"
if (aura_data.remaining_time <= 0):
queue_free()
func set_aura_data(paura_data : AuraData):
aura_data = paura_data
if aura_data.is_timed:
set_process(true)
time_label.text = str(aura_data.remaining_time)
else:
set_process(false)
time_label.text = ""
tooltip_node.hint_tooltip = aura_data.aura.text_description
texture_rect.texture = aura_data.aura.icon
if aura_data.aura.debuff:
var aura_type : int = aura_data.aura.aura_type
if aura_type == SpellEnums.AURA_TYPE_MAGIC:
magic_bg.visible = true
elif aura_type == SpellEnums.AURA_TYPE_BLEED:
bleed_bg.visible = true
elif aura_type == SpellEnums.AURA_TYPE_CURSE:
curse_bg.visible = true
elif aura_type == SpellEnums.AURA_TYPE_PHYSICAL:
physical_bg.visible = true
elif aura_type == SpellEnums.AURA_TYPE_POISON:
poison_bg.visible = true
func get_aura_data() -> AuraData:
return aura_data

View File

@ -0,0 +1,94 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/auraframe/AuraEntry.gd" type="Script" id=1]
[ext_resource path="res://ui/theme/ui_dynamicfont_small.tres" type="DynamicFont" id=2]
[node name="AuraEntry" type="VBoxContainer"]
margin_right = 30.0
margin_bottom = 51.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
texture_rect_path = NodePath("MarginContainer/MarginContainer/TextureRect")
tooltip_node_path = NodePath("MarginContainer/MarginContainer")
time_label_path = NodePath("MarginContainer2/Label")
magic_bg_path = NodePath("MarginContainer/MagicBG")
bleed_bg_path = NodePath("MarginContainer/BleedBG")
poison_bg_path = NodePath("MarginContainer/PoisonBG")
physical_bg_path = NodePath("MarginContainer/PhysicalBG")
curse_bg_path = NodePath("MarginContainer/CurseBG")
[node name="MarginContainer" type="MarginContainer" parent="."]
margin_right = 30.0
margin_bottom = 30.0
rect_min_size = Vector2( 30, 30 )
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="MagicBG" type="ColorRect" parent="MarginContainer"]
visible = false
margin_right = 30.0
margin_bottom = 30.0
color = Color( 0.215686, 0.0666667, 0.772549, 1 )
[node name="BleedBG" type="ColorRect" parent="MarginContainer"]
visible = false
margin_right = 30.0
margin_bottom = 30.0
color = Color( 0.541176, 0, 0, 1 )
[node name="PoisonBG" type="ColorRect" parent="MarginContainer"]
visible = false
margin_right = 30.0
margin_bottom = 30.0
color = Color( 0, 0.301961, 0.027451, 1 )
[node name="PhysicalBG" type="ColorRect" parent="MarginContainer"]
visible = false
margin_right = 30.0
margin_bottom = 30.0
color = Color( 0.27451, 0.0627451, 0.0627451, 1 )
[node name="CurseBG" type="ColorRect" parent="MarginContainer"]
visible = false
margin_right = 30.0
margin_bottom = 30.0
color = Color( 0.172549, 0.0588235, 0.262745, 1 )
[node name="MarginContainer" type="MarginContainer" parent="MarginContainer"]
margin_right = 30.0
margin_bottom = 30.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/margin_right = 1
custom_constants/margin_top = 1
custom_constants/margin_left = 1
custom_constants/margin_bottom = 1
[node name="TextureRect" type="TextureRect" parent="MarginContainer/MarginContainer"]
margin_left = 1.0
margin_top = 1.0
margin_right = 29.0
margin_bottom = 29.0
size_flags_horizontal = 3
size_flags_vertical = 3
expand = true
[node name="MarginContainer2" type="MarginContainer" parent="."]
margin_top = 38.0
margin_right = 30.0
margin_bottom = 51.0
rect_min_size = Vector2( 30, 10 )
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Label" type="Label" parent="MarginContainer2"]
margin_right = 30.0
margin_bottom = 13.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_fonts/font = ExtResource( 2 )
align = 1
valign = 1
max_lines_visible = 1

View File

@ -0,0 +1,59 @@
extends MarginContainer
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export (PackedScene) var aura_entry_scene : PackedScene
export (NodePath) var buff_container_path : NodePath
export (NodePath) var debuff_container_path : NodePath
var buff_container_node : Node
var debuff_container_node : Node
var buff_nodes : Array
var debuff_nodes : Array
var entity : Entity
func _ready():
buff_container_node = get_node(buff_container_path)
debuff_container_node = get_node(debuff_container_path)
func set_target(pentity : Entity) -> void:
if entity != null:
pass
entity = pentity
entity.connect("caura_added", self, "on_caura_added")
entity.connect("caura_removed", self, "on_caura_removed")
func on_caura_added(aura_data : AuraData) -> void:
var created_node : Node = aura_entry_scene.instance()
if (not aura_data.aura.debuff):
buff_container_node.add_child(created_node)
created_node.owner = buff_container_node
else:
debuff_container_node.add_child(created_node)
created_node.owner = debuff_container_node
created_node.set_aura_data(aura_data)
func on_caura_removed(aura_data : AuraData) -> void:
if (not aura_data.aura.debuff):
for bn in buff_container_node.get_children():
if bn.get_aura_data() == aura_data:
buff_container_node.remove_child(bn)
bn.queue_free()
return
else:
for bn in debuff_container_node.get_children():
if bn.get_aura_data() == aura_data:
debuff_container_node.remove_child(bn)
bn.queue_free()
return
func set_player(player : Entity) -> void:
set_target(player)

View File

@ -0,0 +1,41 @@
[gd_scene load_steps=3 format=2]
[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
anchor_right = 1.0
margin_left = -376.0
margin_right = -1.0
margin_bottom = 160.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")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_right = 375.0
margin_bottom = 160.0
mouse_filter = 2
[node name="Buffs" type="GridContainer" parent="VBoxContainer"]
margin_right = 375.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
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
columns = 9

323
game/ui/bags/Bag.tscn Normal file
View File

@ -0,0 +1,323 @@
[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/bags/InventoryGUI.gd" type="Script" id=2]
[ext_resource path="res://ui/bags/BagEntry.tscn" type="PackedScene" id=3]
[ext_resource path="res://ui/bags/EquipmentSlot.tscn" type="PackedScene" id=4]
[ext_resource path="res://ui/bags/ItemPupop.gd" type="Script" id=5]
[node name="Inventory" type="PanelContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
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") ]
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 4.0
margin_top = 4.0
margin_right = 1020.0
margin_bottom = 596.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 1016.0
margin_bottom = 26.0
[node name="BagName" type="Label" parent="VBoxContainer/HBoxContainer"]
margin_top = 5.0
margin_right = 982.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
rect_min_size = Vector2( 30, 20 )
text = "X"
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 34.0
margin_right = 1016.0
margin_bottom = 592.0
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 1
[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/HBoxContainer3"]
margin_right = 227.96
margin_bottom = 558.0
rect_min_size = Vector2( 227.96, 0 )
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 223.96
margin_bottom = 554.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
margin_right = 219.0
margin_bottom = 146.0
size_flags_horizontal = 3
alignment = 1
[node name="Head" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer/HBoxContainer" instance=ExtResource( 4 )]
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer/VBoxContainer"]
margin_top = 156.0
margin_right = 219.0
margin_bottom = 206.0
size_flags_horizontal = 3
alignment = 1
[node name="Shoulder" parent="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 )]
text = "Neck"
equip_slot = 1
[node name="Hands" parent="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
margin_right = 219.0
margin_bottom = 266.0
size_flags_horizontal = 3
alignment = 1
[node name="Ring1" parent="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 )]
text = "Chest"
equip_slot = 3
[node name="Ring2" parent="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
margin_right = 219.0
margin_bottom = 326.0
size_flags_horizontal = 3
alignment = 1
[node name="Trinket1" parent="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 )]
text = "Belt"
equip_slot = 5
[node name="Trinket2" parent="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
margin_right = 219.0
margin_bottom = 386.0
size_flags_horizontal = 3
alignment = 1
[node name="Legs" parent="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 )]
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
margin_right = 219.0
margin_bottom = 454.0
size_flags_horizontal = 3
alignment = 1
[node name="PanelContainer" type="PanelContainer" parent="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"]
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 )]
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 )]
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"]
margin_left = 231.0
margin_right = 1016.0
margin_bottom = 558.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/HBoxContainer3/PanelContainer2"]
margin_left = 4.0
margin_top = 4.0
margin_right = 781.0
margin_bottom = 554.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
size_flags_horizontal = 3
size_flags_vertical = 3
scroll_horizontal_enabled = false
[node name="GridContainer" type="GridContainer" parent="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="Label" type="Label" parent="VBoxContainer/HBoxContainer3/PanelContainer2/VBoxContainer/HBoxContainer2"]
margin_top = 5.0
margin_right = 743.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
rect_min_size = Vector2( 30, 20 )
[node name="TooltipContainer" type="Control" parent="."]
margin_left = 4.0
margin_top = 4.0
margin_right = 1020.0
margin_bottom = 596.0
mouse_filter = 2
[node name="ItemTooltip" type="PopupPanel" parent="TooltipContainer"]
margin_right = 295.0
margin_bottom = 223.0
script = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": false
}
name_path = NodePath("../ItemTooltip/VBoxContainer/HBoxContainer/VBoxContainer/NameLabel")
description_path = NodePath("../ItemTooltip/VBoxContainer/DescriptionLabel")
[node name="VBoxContainer" type="VBoxContainer" parent="TooltipContainer/ItemTooltip"]
margin_left = 4.0
margin_top = 4.0
margin_right = 291.0
margin_bottom = 219.0
size_flags_horizontal = 3
size_flags_vertical = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="HBoxContainer" type="HBoxContainer" parent="TooltipContainer/ItemTooltip/VBoxContainer"]
margin_right = 287.0
margin_bottom = 26.0
[node name="VBoxContainer" type="VBoxContainer" parent="TooltipContainer/ItemTooltip/VBoxContainer/HBoxContainer"]
margin_right = 249.0
margin_bottom = 26.0
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 1
[node name="NameLabel" type="RichTextLabel" parent="TooltipContainer/ItemTooltip/VBoxContainer/HBoxContainer/VBoxContainer"]
margin_top = 4.0
margin_right = 249.0
margin_bottom = 22.0
rect_min_size = Vector2( 0, 18 )
size_flags_horizontal = 3
bbcode_enabled = true
[node name="Button" type="Button" parent="TooltipContainer/ItemTooltip/VBoxContainer/HBoxContainer"]
margin_left = 257.0
margin_right = 287.0
margin_bottom = 26.269
rect_min_size = Vector2( 30, 20 )
text = "X"
[node name="HSeparator" type="HSeparator" parent="TooltipContainer/ItemTooltip/VBoxContainer"]
margin_top = 34.0
margin_right = 287.0
margin_bottom = 42.0
size_flags_horizontal = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="DescriptionLabel" type="RichTextLabel" parent="TooltipContainer/ItemTooltip/VBoxContainer"]
margin_top = 50.0
margin_right = 287.0
margin_bottom = 215.0
size_flags_horizontal = 3
size_flags_vertical = 3
bbcode_enabled = true
[connection signal="pressed" from="VBoxContainer/HBoxContainer/CloseButton" to="." method="hide"]
[connection signal="pressed" from="TooltipContainer/ItemTooltip/VBoxContainer/HBoxContainer/Button" to="TooltipContainer/ItemTooltip" method="hide"]

206
game/ui/bags/BagEntry.gd Normal file
View File

@ -0,0 +1,206 @@
extends Button
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export (NodePath) var button_path : NodePath
export (NodePath) var icon_path : NodePath
export (NodePath) var cooldown_indicator_path : NodePath
export (NodePath) var cooldown_text_path : NodePath
var _tooltip : Popup
var button : Button
var icon_rect : TextureRect
var cooldown_indicator : TextureProgress
var cooldown_text : Label
var slot_id : int = 0
var item : ItemInstance
var player : Entity
var spell_id : int = 0
#var spell_type : int = 0
var cd : Cooldown = null
var has_gcd : bool = false
var gcd : float = 0.0
func _ready() -> void:
button = get_node(button_path) as Button
icon_rect = get_node(icon_path) as TextureRect
cooldown_indicator = get_node(cooldown_indicator_path) as TextureProgress
cooldown_text = get_node(cooldown_text_path) as Label
button.connect("pressed", self, "_on_button_pressed")
func _process(delta : float) -> void:
if cd == null and gcd < 0.001:
set_process(false)
hide_cooldown_timer()
return
if gcd > 0.001:
gcd -= delta
if gcd < 0:
gcd = 0
var value : float = gcd
if cd != null and cd.remaining > value:
value = cd.remaining
set_cooldown_time(value)
func set_cooldown_time(time : float) -> void:
cooldown_indicator.value = time
cooldown_text.text = str(int(time))
func show_cooldown_timer(max_time : float) -> void:
if cooldown_indicator.visible and cooldown_indicator.max_value < max_time:
cooldown_indicator.max_value = max_time
if not cooldown_indicator.visible:
cooldown_indicator.max_value = max_time
cooldown_indicator.show()
cooldown_text.show()
func hide_cooldown_timer() -> void:
cooldown_indicator.hide()
cooldown_text.hide()
func set_item_instance(pitem : ItemInstance) -> void:
item = pitem
setup_icon()
func setup_icon() -> void:
if (item == null):
icon_rect.texture = null
else:
if (item.get_item_template() == null):
icon_rect.texture = null
return
if item.item_template.use_spell != null:
var spell : Spell = item.item_template.use_spell
spell_id = spell.spell_id
has_gcd = spell.cooldown_global_cooldown
else:
spell_id = 0
has_gcd = false
icon_rect.texture = item.item_template.icon
func _on_button_pressed() -> void:
#if spell_id != 0:
# player.crequest_spell_cast(button_entry.item_id)
pass
func set_button_entry_data(ii : ItemInstance) -> void:
item = ii
setup_icon()
func get_drag_data(pos: Vector2) -> Object:
if item == null:
return null
var tr = TextureRect.new()
tr.texture = icon_rect.texture
tr.expand = true
tr.rect_size = icon_rect.rect_size
set_drag_preview(tr)
var esd = ESDragAndDrop.new()
esd.origin = self
esd.type = ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_INVENTORY_ITEM
esd.item_id = slot_id
setup_icon()
return esd
func can_drop_data(pos, data) -> bool:
return (data.is_class("ESDragAndDrop") and (data.type == ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_INVENTORY_ITEM or
data.type == ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_EQUIPPED_ITEM))
func drop_data(pos, esd) -> void:
if esd.type == ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_INVENTORY_ITEM:
player.crequest_item_swap(slot_id, esd.item_id)
setup_icon()
elif esd.type == ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_EQUIPPED_ITEM:
player.crequest_equip(esd.item_id, slot_id)
setup_icon()
func set_slot_id(pslot_id : int) -> void:
slot_id = pslot_id
func set_player(p_player: Entity) -> void:
if not player == null:
player.disconnect("ccooldown_added", self, "_ccooldown_added")
player.disconnect("ccooldown_removed", self, "_ccooldown_removed")
player.disconnect("cgcd_started", self, "_cgcd_started")
player.disconnect("cgcd_finished", self, "_cgcd_finished")
player = null
player = p_player
if player == null:
return
# for i in range(player.getc_cooldown_count()):
# var cooldown : Cooldown = player.getc_cooldown(i)
player.connect("ccooldown_added", self, "_ccooldown_added")
player.connect("ccooldown_removed", self, "_ccooldown_removed")
player.connect("cgcd_started", self, "_cgcd_started")
player.connect("cgcd_finished", self, "_cgcd_finished")
func _ccooldown_added(cooldown : Cooldown) -> void:
if cooldown.spell_id == spell_id:
cd = cooldown
set_process(true)
show_cooldown_timer(cooldown.remaining)
func _ccooldown_removed(cooldown : Cooldown) -> void:
if cooldown.spell_id == spell_id:
cd = null
func _cgcd_started(value :float) -> void:
if not has_gcd:
return
gcd = value
show_cooldown_timer(value)
set_process(true)
func _cgcd_finished() -> void:
gcd = 0
func _pressed():
if _tooltip != null and item != null:
var pos : Vector2 = rect_global_position
pos.x += rect_size.x
_tooltip.set_item(item)
_tooltip.popup(Rect2(pos, _tooltip.rect_size))
# _tooltip.pac
func set_tooltip_node(tooltip : Popup) -> void:
_tooltip = tooltip

View File

@ -0,0 +1,80 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://ui/bags/BagEntry.gd" type="Script" id=1]
[ext_resource path="res://ui/theme/cooldown_progress.png" type="Texture" id=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=3]
[ext_resource path="res://ui/theme/actionbar_dynamicfont.tres" type="DynamicFont" id=5]
[node name="BagEntry" type="Button"]
margin_top = 1.0
margin_right = 45.0
margin_bottom = 46.0
rect_min_size = Vector2( 45, 45 )
focus_mode = 0
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource( 3 )
shortcut_in_tooltip = false
action_mode = 0
button_mask = 3
enabled_focus_mode = 0
keep_pressed_outside = true
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
button_path = NodePath(".")
icon_path = NodePath("MarginContainer/TextureRect")
cooldown_indicator_path = NodePath("CooldownIndicator")
cooldown_text_path = NodePath("CooldownText")
[node name="MarginContainer" type="MarginContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
custom_constants/margin_right = 2
custom_constants/margin_top = 2
custom_constants/margin_left = 2
custom_constants/margin_bottom = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureRect" type="TextureRect" parent="MarginContainer"]
margin_left = 2.0
margin_top = 2.0
margin_right = 43.0
margin_bottom = 43.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
expand = true
[node name="CooldownIndicator" type="TextureProgress" parent="."]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
step = 0.0
texture_progress = ExtResource( 2 )
fill_mode = 5
nine_patch_stretch = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CooldownText" type="Label" parent="."]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
size_flags_vertical = 3
custom_fonts/font = ExtResource( 5 )
align = 1
valign = 1
clip_text = true
__meta__ = {
"_edit_use_anchors_": false
}

13
game/ui/bags/BagFrame.gd Normal file
View File

@ -0,0 +1,13 @@
extends Control
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(PackedScene) var bag_scene : PackedScene
export(NodePath) var container_path : NodePath = "BagContainerFrame"
var container : Control
func _ready() -> void:
container = get_node(container_path) as Control

View File

@ -0,0 +1,51 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/bags/Bag.tscn" type="PackedScene" id=1]
[ext_resource path="res://ui/bags/BagFrame.gd" type="Script" id=2]
[node name="BagFrame" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
script = ExtResource( 2 )
__meta__ = {
"_edit_lock_": true,
"_edit_use_anchors_": false
}
bag_scene = ExtResource( 1 )
container_path = NodePath("")
[node name="BagOpenerFrame" type="HBoxContainer" parent="."]
anchor_left = 1.0
anchor_top = 1.0
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = -39.0
margin_top = -37.0
grow_horizontal = 0
grow_vertical = 0
size_flags_horizontal = 0
size_flags_vertical = 0
alignment = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Button" type="Button" parent="BagOpenerFrame"]
margin_right = 40.0
margin_bottom = 40.0
rect_min_size = Vector2( 40, 40 )
text = "B"
[node name="Bag" parent="." instance=ExtResource( 1 )]
visible = false
margin_left = 68.0
margin_top = 115.0
margin_right = 551.0
margin_bottom = 432.0
grow_horizontal = 0
grow_vertical = 0
rect_min_size = Vector2( 100, 0 )
size_flags_horizontal = 10
size_flags_vertical = 10
[connection signal="pressed" from="BagOpenerFrame/Button" to="Bag" method="show"]

View File

@ -0,0 +1,87 @@
extends Button
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(int) var equip_slot : int
export(NodePath) var texture_path : NodePath
var _texture : TextureRect
var _tooltip : Popup
var _player : Entity
var _item_instance : ItemInstance
func _ready():
_texture = get_node(texture_path) as TextureRect
func set_tooltip_node(tooltip : Popup) -> void:
_tooltip = tooltip
func set_player(player: Entity) -> void:
if _player != null:
_player.disconnect("con_equip_success", self, "con_equip_success")
_player = player
if _player == null:
return
_player.connect("con_equip_success", self, "con_equip_success")
func drop_data(position, data):
if _player == null:
return
var dd : ESDragAndDrop = data as ESDragAndDrop
if dd.type == ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_EQUIPPED_ITEM:
#todo
return
if dd.type == ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_INVENTORY_ITEM:
_player.crequest_equip(equip_slot, dd.item_id)
func can_drop_data(position, data):
if _player == null:
return false
if data is ESDragAndDrop and (data.type == ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_EQUIPPED_ITEM or
data.type == ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_INVENTORY_ITEM):
return true
return false
func get_drag_data(position):
if _item_instance == null:
return null
var tr = TextureRect.new()
tr.texture = _texture.texture
tr.expand = true
tr.rect_size = _texture.rect_size
set_drag_preview(tr)
var esd = ESDragAndDrop.new()
esd.origin = self
esd.type = ESDragAndDrop.ES_DRAG_AND_DROP_TYPE_EQUIPPED_ITEM
esd.item_id = equip_slot
return esd
func con_equip_success(entity: Entity, pequip_slot: int, item: ItemInstance, old_item: ItemInstance, bag_slot: int):
if equip_slot != pequip_slot:
return
_item_instance = item
if item == null:
_texture.texture = null
return
_texture.texture = item.item_template.icon

View File

@ -0,0 +1,37 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://ui/bags/EquipmentSlot.gd" type="Script" id=1]
[node name="EquipmentSlot" type="Button"]
margin_left = 84.0
margin_right = 134.0
margin_bottom = 50.0
rect_min_size = Vector2( 50, 50 )
text = "Head"
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
texture_path = NodePath("MarginContainer/TextureRect")
[node name="MarginContainer" type="MarginContainer" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
custom_constants/margin_right = 5
custom_constants/margin_top = 5
custom_constants/margin_left = 5
custom_constants/margin_bottom = 5
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureRect" type="TextureRect" parent="MarginContainer"]
margin_left = 5.0
margin_top = 5.0
margin_right = 76.0
margin_bottom = 45.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
expand = true

View File

@ -0,0 +1,109 @@
extends PanelContainer
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(PackedScene) var inventory_item_scene : PackedScene
export(NodePath) var inventory_item_container_path : NodePath
export(NodePath) var item_tooltip_path : NodePath
export(Array, NodePath) var inventory_slots : Array
var _inventory_slots : Array
var _inventory_item_container : Node
var _tooltip : Popup
var _player : Entity = null
var _bag : Bag = null
func _ready() -> void:
_inventory_item_container = get_node(inventory_item_container_path)
_tooltip = get_node(item_tooltip_path)
for np in inventory_slots:
var es : Control = get_node(np) as Control
es.set_tooltip_node(_tooltip)
_inventory_slots.append(es)
connect("visibility_changed", self, "on_visibility_changed")
func set_player(p_player: Entity) -> void:
if _player != null:
_player.disconnect("cbag_changed", self, "cbag_changed")
for ie in _inventory_item_container.get_children():
ie.queue_free()
_player = p_player
_player.connect("cbag_changed", self, "cbag_changed")
cbag_changed(_player, _player.cbag)
for np in _inventory_slots:
np.set_player(_player)
refresh_bags()
func refresh_bags() -> void:
if _bag == null:
return
if not visible:
return
# if _bag.size == _inventory_item_container.get_child_count():
# return
for ie in _inventory_item_container.get_children():
ie.queue_free()
for i in range(_bag.get_size()):
var n : Node = inventory_item_scene.instance()
_inventory_item_container.add_child(n)
n.owner = _inventory_item_container
n.set_slot_id(i)
n.set_tooltip_node(_tooltip)
n.set_player(_player)
n.set_item_instance(_bag.get_item(i))
func cbag_changed(entity: Entity, bag: Bag) -> void:
if _bag != null:
_bag.disconnect("size_changed", self, "bag_size_changed")
_bag.disconnect("item_added", self, "bag_item_added")
_bag.disconnect("item_removed", self, "item_removed")
_bag.disconnect("item_swapped", self, "item_swapped")
_bag = entity.cbag
if _bag == null:
return
_bag.connect("size_changed", self, "bag_size_changed")
_bag.connect("item_added", self, "bag_item_added")
_bag.connect("item_count_changed", self, "item_count_changed")
_bag.connect("item_removed", self, "item_removed")
_bag.connect("item_swapped", self, "item_swapped")
# overburden_removed(bag: Bag)
# overburdened(bag: Bag)
func bag_size_changed(bag: Bag) -> void:
refresh_bags()
func bag_item_added(bag: Bag, item: ItemInstance, slot_id: int) -> void:
refresh_bags()
func item_count_changed(bag: Bag, item: ItemInstance, slot_id: int) -> void:
refresh_bags()
func item_removed(bag: Bag, item: ItemInstance, slot_id: int) -> void:
refresh_bags()
func item_swapped(bag: Bag, item1_slot : int, item2_slot: int) -> void:
refresh_bags()
func on_visibility_changed() -> void:
refresh_bags()

19
game/ui/bags/ItemPupop.gd Normal file
View File

@ -0,0 +1,19 @@
extends PopupPanel
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(NodePath) var name_path : NodePath
export(NodePath) var description_path : NodePath
var _name : RichTextLabel
var _description : RichTextLabel
func _ready():
_name = get_node(name_path) as RichTextLabel
_description = get_node(description_path) as RichTextLabel
func set_item(item : ItemInstance) -> void:
_name.bbcode_text = item.item_template.text_name
# _description.text = item.item_template.

View File

@ -0,0 +1,3 @@
[gd_resource type="ButtonGroup" format=2]
[resource]

View File

@ -0,0 +1,47 @@
extends Control
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export (NodePath) var spell_book_path
export (NodePath) var spell_book_button_path
var spell_book
var spell_book_button
export (NodePath) var lock_button_path
var lock_button
var player
func _ready():
spell_book = get_node(spell_book_path)
spell_book_button = get_node(spell_book_button_path)
spell_book_button.connect("pressed", self, "_spell_book_click")
lock_button = get_node(lock_button_path)
lock_button.connect("pressed", self, "_lock_button_click")
func set_player(p_player):
player = p_player
func _spell_book_click():
if spell_book.visible:
spell_book.hide()
else:
spell_book.show()
func _lock_button_click():
if player == null:
return
var cls = player.centity_data
if cls == null:
return
var profile = Profiles.get_class_profile(cls.id)
profile.actionbar_locked = not profile.actionbar_locked

View File

@ -0,0 +1,74 @@
extends MarginContainer
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export (NodePath) var progress_bar_path
export (NodePath) var label_path
var progress_bar : ProgressBar
var label : Label
var player : Entity = null
var spell_cast_info : SpellCastInfo = null
func _ready() -> void:
progress_bar = get_node(progress_bar_path)
progress_bar.min_value = 0
label = get_node(label_path)
hide()
set_process(false)
func _process(delta: float) -> void:
if not spell_cast_info.is_casting:
hide()
set_process(false)
progress_bar.value = spell_cast_info.current_cast_time
func set_player(p_player: Entity) -> void:
if not player == null:
player.disconnect("ccast_started", self, "_ccast_started")
player.disconnect("ccast_failed", self, "_ccast_failed")
player.disconnect("ccast_finished", self, "_ccast_finished")
player.disconnect("ccast_interrupted", self, "_ccast_interrupted")
player = p_player
player.connect("ccast_started", self, "_ccast_started")
player.connect("ccast_failed", self, "_ccast_failed")
player.connect("ccast_finished", self, "_ccast_finished")
player.connect("ccast_interrupted", self, "_ccast_interrupted")
func _ccast_started(pspell_cast_info: SpellCastInfo) -> void:
set_process(true)
spell_cast_info = pspell_cast_info
label.text = spell_cast_info.spell.get_name()
progress_bar.value = spell_cast_info.current_cast_time
progress_bar.max_value = spell_cast_info.cast_time
show()
func _ccast_failed(pspell_cast_info: SpellCastInfo) -> void:
set_process(false)
hide()
func _ccast_finished(pspell_cast_info: SpellCastInfo) -> void:
set_process(false)
hide()
func _ccast_interrupted(pspell_cast_info: SpellCastInfo) -> void:
set_process(false)
hide()

View File

@ -0,0 +1,22 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://ui/castbar/Castbar.gd" type="Script" id=1]
[node name="Castbar" type="MarginContainer"]
margin_left = 339.0
margin_top = 416.0
margin_right = 691.0
margin_bottom = 441.0
script = ExtResource( 1 )
progress_bar_path = NodePath("ProgressBar")
label_path = NodePath("Label")
[node name="ProgressBar" type="ProgressBar" parent="."]
margin_right = 352.0
margin_bottom = 25.0
[node name="Label" type="Label" parent="."]
margin_right = 352.0
margin_bottom = 25.0
align = 1
valign = 1

View File

@ -0,0 +1,31 @@
extends PanelContainer
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(NodePath) var icon_path : NodePath
export(NodePath) var label_path : NodePath
var _icon : TextureRect
var _label : Label
var _entity : Entity
var _crh : CraftRecipeHelper
func _ready():
_icon = get_node(icon_path) as TextureRect
_label = get_node(label_path) as Label
func set_item(entity: Entity, crh: CraftRecipeHelper) -> void:
_entity = entity
_crh = crh
refresh()
func refresh() -> void:
if _crh.item == null:
return
_icon.texture = _crh.item.icon
_label.text = _crh.item.text_name + " (" + str(_crh.count) + ")"

View File

@ -0,0 +1,45 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://ui/crafting/ItemEntry.gd" type="Script" id=1]
[node name="ItemEntry" type="PanelContainer"]
margin_right = 695.0
margin_bottom = 60.0
rect_min_size = Vector2( 100, 60 )
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
icon_path = NodePath("HBoxContainer/PanelContainer/TextureRect")
label_path = NodePath("HBoxContainer/Label")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
margin_left = 14.0
margin_top = 14.0
margin_right = 681.0
margin_bottom = 64.0
[node name="PanelContainer" type="PanelContainer" parent="HBoxContainer"]
margin_right = 50.0
margin_bottom = 50.0
rect_min_size = Vector2( 50, 50 )
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/PanelContainer"]
margin_left = 14.0
margin_top = 14.0
margin_right = 36.0
margin_bottom = 36.0
size_flags_horizontal = 3
size_flags_vertical = 3
expand = true
[node name="Label" type="Label" parent="HBoxContainer"]
margin_left = 58.0
margin_top = 12.0
margin_right = 667.0
margin_bottom = 37.0
size_flags_horizontal = 3
text = "Spanner"
align = 1

View File

@ -0,0 +1,17 @@
extends Button
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
var _recipe : CraftRecipe
var _crafting_window : Node
func set_recipe(recipe : CraftRecipe, crafting_window : Node) -> void:
_recipe = recipe
_crafting_window = crafting_window
text = recipe.item.item.text_name
func _pressed():
_crafting_window.select_recipe(_recipe)

View File

@ -0,0 +1,12 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://ui/crafting/RecipeSelector.gd" type="Script" id=1]
[node name="RecipeSelector" type="Button"]
margin_right = 303.0
margin_bottom = 40.0
rect_min_size = Vector2( 0, 40 )
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -0,0 +1,61 @@
extends Label
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
func _ready():
Settings.connect("setting_changed", self, "setting_changed")
if visible:
set_process(true)
else:
set_process(false)
func _exit_tree():
if Settings != null:
Settings.disconnect("setting_changed", self, "setting_changed")
func setting_changed(section, key, value):
if section == "debug" and key == "debug_info":
if value:
show()
set_process(true)
else:
hide()
set_process(false)
func _process(delta):
var a : String = "Fps: " + str(Performance.get_monitor(Performance.TIME_FPS)) + "\n"
# a += "time_process: " + str(Performance.get_monitor(Performance.TIME_PROCESS)) + "\n"
# a += "time_physics_process: " + str(Performance.get_monitor(Performance.TIME_PHYSICS_PROCESS)) + "\n"
a += "mem_static: " + str(Performance.get_monitor(Performance.MEMORY_STATIC)) + "\n"
a += "mem_dynamic: " + str(Performance.get_monitor(Performance.MEMORY_DYNAMIC)) + "\n"
# a += "mem_static_max: " + str(Performance.get_monitor(Performance.MEMORY_STATIC_MAX)) + "\n"
# a += "mem_dyn_max: " + str(Performance.get_monitor(Performance.MEMORY_DYNAMIC_MAX)) + "\n"
# a += "mem_msg_buf_max: " + str(Performance.get_monitor(Performance.MEMORY_MESSAGE_BUFFER_MAX)) + "\n"
a += "obj_count: " + str(Performance.get_monitor(Performance.OBJECT_COUNT)) + "\n"
a += "obj_res_count: " + str(Performance.get_monitor(Performance.OBJECT_RESOURCE_COUNT)) + "\n"
a += "obj_mode_count: " + str(Performance.get_monitor(Performance.OBJECT_NODE_COUNT)) + "\n"
a += "obj_orphan_mode_count: " + str(Performance.get_monitor(Performance.OBJECT_ORPHAN_NODE_COUNT)) + "\n"
a += "obj_in_frame: " + str(Performance.get_monitor(Performance.RENDER_OBJECTS_IN_FRAME)) + "\n"
a += "vert_in_frame: " + str(Performance.get_monitor(Performance.RENDER_VERTICES_IN_FRAME)) + "\n"
a += "mat_changes: " + str(Performance.get_monitor(Performance.RENDER_MATERIAL_CHANGES_IN_FRAME)) + "\n"
a += "shader_changes: " + str(Performance.get_monitor(Performance.RENDER_SHADER_CHANGES_IN_FRAME)) + "\n"
a += "surface_changes: " + str(Performance.get_monitor(Performance.RENDER_SURFACE_CHANGES_IN_FRAME)) + "\n"
a += "draw_calls: " + str(Performance.get_monitor(Performance.RENDER_DRAW_CALLS_IN_FRAME)) + "\n"
a += "vid_mem_used: " + str(Performance.get_monitor(Performance.RENDER_VIDEO_MEM_USED)) + "\n"
# a += "texture_mem_used: " + str(Performance.get_monitor(Performance.RENDER_TEXTURE_MEM_USED)) + "\n"
# a += "vertex_mem_used: " + str(Performance.get_monitor(Performance.RENDER_VERTEX_MEM_USED)) + "\n"
# a += "vid_mem_total: " + str(Performance.get_monitor(Performance.RENDER_USAGE_VIDEO_MEM_TOTAL)) + "\n"
# a += "phys_2d_active_obj: " + str(Performance.get_monitor(Performance.PHYSICS_2D_ACTIVE_OBJECTS)) + "\n"
# a += "phys_2d_coll_pairs: " + str(Performance.get_monitor(Performance.PHYSICS_2D_COLLISION_PAIRS)) + "\n"
# a += "phys_2d_island_count: " + str(Performance.get_monitor(Performance.PHYSICS_2D_ISLAND_COUNT)) + "\n"
# a += "phys_3d_active_obj: " + str(Performance.get_monitor(Performance.PHYSICS_3D_ACTIVE_OBJECTS)) + "\n"
# a += "phys_3d_coll_pairs: " + str(Performance.get_monitor(Performance.PHYSICS_3D_COLLISION_PAIRS)) + "\n"
# a += "phys_3d_island_count: " + str(Performance.get_monitor(Performance.PHYSICS_3D_ISLAND_COUNT)) + "\n"
# a += "audio_output_latency: " + str(Performance.get_monitor(Performance.AUDIO_OUTPUT_LATENCY)) + "\n"
text = a

View File

@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/debug/DebugInfo.gd" type="Script" id=1]
[ext_resource path="res://ui/debug/debuginfo_font.tres" type="DynamicFont" id=2]
[node name="DebugInfo" type="CanvasLayer"]
layer = 3
[node name="DebugInfo" type="Label" parent="."]
visible = false
anchor_bottom = 1.0
margin_right = 301.0
custom_fonts/font = ExtResource( 2 )
valign = 1
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -0,0 +1,101 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[ext_resource path="res://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

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

View File

@ -0,0 +1,5 @@
[gd_scene format=2]
[node name="ErrorFrame" type="MarginContainer"]
margin_right = 40.0
margin_bottom = 40.0

View File

@ -0,0 +1,12 @@
extends Button
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
func _ready():
connect("pressed", self, "on_click")
func on_click() -> void:
get_node("/root/Main").switch_scene(Main.StartSceneTypes.MENU)

View File

@ -0,0 +1,83 @@
[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/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]
[node name="IngameMenu" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
theme = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Menu" type="PanelContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -77.0
margin_top = -51.0
margin_right = 78.0
margin_bottom = 51.0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="Menu"]
margin_left = 4.0
margin_top = 4.0
margin_right = 151.0
margin_bottom = 132.0
[node name="Resume" type="Button" parent="Menu/VBoxContainer"]
margin_right = 147.0
margin_bottom = 26.269
text = "Resume"
[node name="Keybinds" type="Button" parent="Menu/VBoxContainer"]
margin_top = 34.0
margin_right = 147.0
margin_bottom = 60.269
text = "Keybinds"
[node name="Options" type="Button" parent="Menu/VBoxContainer"]
margin_top = 68.0
margin_right = 147.0
margin_bottom = 94.269
text = "Options"
[node name="Exit" type="Button" parent="Menu/VBoxContainer"]
margin_top = 102.0
margin_right = 147.0
margin_bottom = 128.269
text = "Exit"
script = ExtResource( 3 )
[node name="Options" parent="." instance=ExtResource( 2 )]
visible = false
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -307.0
margin_top = -220.0
margin_right = 307.0
margin_bottom = 220.0
[node name="KeybindWindow" parent="." instance=ExtResource( 4 )]
visible = false
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -426.0
margin_top = -270.0
margin_right = 426.0
margin_bottom = 270.0
[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/Options" to="Options" method="show"]

View File

@ -0,0 +1,9 @@
extends VBoxContainer
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(PackedScene) var keybind_entry_scene : PackedScene
export(NodePath) var content_container_path : NodePath

View File

@ -0,0 +1,29 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/keybinds/KeybindCategory.gd" type="Script" id=1]
[ext_resource path="res://ui/keybinds/KeybindEntry.tscn" type="PackedScene" id=2]
[node name="KeybindCategory" type="VBoxContainer"]
margin_right = 1016.0
margin_bottom = 23.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
keybind_entry_scene = ExtResource( 2 )
content_container_path = NodePath("VBoxContainer/content")
[node name="Label" type="Label" parent="."]
margin_right = 1016.0
margin_bottom = 25.0
text = "Category"
[node name="VBoxContainer" type="MarginContainer" parent="."]
margin_top = 33.0
margin_right = 1016.0
margin_bottom = 33.0
custom_constants/margin_left = 20
[node name="content" type="VBoxContainer" parent="VBoxContainer"]
margin_left = 20.0
margin_right = 1016.0

View File

@ -0,0 +1,23 @@
extends HBoxContainer
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# 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 query_keybind_1() -> void:
pass
func query_keybind_2() -> void:
pass

View File

@ -0,0 +1,34 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://ui/keybinds/KeybindEntry.gd" type="Script" id=1]
[node name="KeybindEntry" type="HBoxContainer"]
margin_right = 996.0
margin_bottom = 37.0
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="Label" parent="."]
margin_top = 6.0
margin_right = 580.0
margin_bottom = 31.0
size_flags_horizontal = 3
text = "Keybind"
[node name="Button" type="Button" parent="."]
margin_left = 588.0
margin_right = 788.0
margin_bottom = 37.0
rect_min_size = Vector2( 200, 30 )
text = "empty"
[node name="Button2" type="Button" parent="."]
margin_left = 796.0
margin_right = 996.0
margin_bottom = 37.0
rect_min_size = Vector2( 200, 30 )
text = "empty"
[connection signal="pressed" from="Button" to="." method="query_keybind_1"]
[connection signal="pressed" from="Button2" to="." method="query_keybind_2"]

View File

@ -0,0 +1,113 @@
extends Control
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(PackedScene) var keybind_category_scene : PackedScene
export(NodePath) var content_container_path : NodePath
# Note for the reader:
#
# This demo conveniently uses the same names for actions and for the container nodes
# that hold each remapping button. This allow to get back to the button based simply
# on the name of the corresponding action, but it might not be so simple in your project.
#
# A better approach for large-scale input remapping might be to do the connections between
# buttons and wait_for_input through the code, passing as arguments both the name of the
# action and the node, e.g.:
# button.connect("pressed", self, "wait_for_input", [ button, action ])
# Constants
const INPUT_ACTIONS = [ "move_up", "move_down", "move_left", "move_right", "jump" ]
const CONFIG_FILE = "user://input.cfg"
# Member variables
var action # To register the action the UI is currently handling
var button # Button node corresponding to the above action
# Load/save input mapping to a config file
# Changes done while testing the demo will be persistent, saved to CONFIG_FILE
func load_config():
var config = ConfigFile.new()
var err = config.load(CONFIG_FILE)
if err: # Assuming that file is missing, generate default config
for action_name in INPUT_ACTIONS:
var action_list = InputMap.get_action_list(action_name)
# There could be multiple actions in the list, but we save the first one by default
var scancode = OS.get_scancode_string(action_list[0].scancode)
config.set_value("input", action_name, scancode)
config.save(CONFIG_FILE)
else: # ConfigFile was properly loaded, initialize InputMap
for action_name in config.get_section_keys("input"):
# Get the key scancode corresponding to the saved human-readable string
var scancode = OS.find_scancode_from_string(config.get_value("input", action_name))
# Create a new event object based on the saved scancode
var event = InputEventKey.new()
event.scancode = scancode
# Replace old action (key) events by the new one
for old_event in InputMap.get_action_list(action_name):
if old_event is InputEventKey:
InputMap.action_erase_event(action_name, old_event)
InputMap.action_add_event(action_name, event)
func save_to_config(section, key, value):
"""Helper function to redefine a parameter in the settings file"""
var config = ConfigFile.new()
var err = config.load(CONFIG_FILE)
if err:
print("Error code when loading config file: ", err)
else:
config.set_value(section, key, value)
config.save(CONFIG_FILE)
# Input management
func wait_for_input(action_bind):
action = action_bind
# See note at the beginning of the script
button = get_node("bindings").get_node(action).get_node("Button")
get_node("contextual_help").text = "Press a key to assign to the '" + action + "' action."
set_process_input(true)
func a_input(event):
# Handle the first pressed key
if event is InputEventKey:
# Register the event as handled and stop polling
get_tree().set_input_as_handled()
set_process_input(false)
# Reinitialise the contextual help label
get_node("contextual_help").text = "Click a key binding to reassign it, or press the Cancel action."
if not event.is_action("ui_cancel"):
# Display the string corresponding to the pressed key
var scancode = OS.get_scancode_string(event.scancode)
button.text = scancode
# Start by removing previously key binding(s)
for old_event in InputMap.get_action_list(action):
InputMap.action_erase_event(action, old_event)
# Add the new key binding
InputMap.action_add_event(action, event)
save_to_config("input", action, scancode)
func a_ready():
# Load config if existing, if not it will be generated with default values
load_config()
# Initialise each button with the default key binding from InputMap
for action in INPUT_ACTIONS:
# We assume that the key binding that we want is the first one (0), if there are several
var input_event = InputMap.get_action_list(action)[0]
# See note at the beginning of the script
var button = get_node("bindings").get_node(action).get_node("Button")
button.text = OS.get_scancode_string(input_event.scancode)
button.connect("pressed", self, "wait_for_input", [action])
# Do not start processing input until a button is pressed
set_process_input(false)

View File

@ -0,0 +1,73 @@
[gd_scene load_steps=4 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]
[node name="KeybindWindow" type="PanelContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
theme = ExtResource( 2 )
script = ExtResource( 1 )
__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
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
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer"]
margin_top = 7.0
margin_right = 968.0
margin_bottom = 22.0
size_flags_horizontal = 3
text = "Keybinds"
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer"]
margin_left = 976.0
margin_right = 1016.0
margin_bottom = 30.0
rect_min_size = Vector2( 40, 30 )
text = "X"
[node name="ScrollContainer" type="ScrollContainer" 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
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 562.0
margin_right = 1016.0
margin_bottom = 592.0
alignment = 2
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer2"]
margin_left = 848.0
margin_right = 928.0
margin_bottom = 30.0
rect_min_size = Vector2( 80, 30 )
text = "Cancel"
[node name="Button2" type="Button" parent="VBoxContainer/HBoxContainer2"]
margin_left = 936.0
margin_right = 1016.0
margin_bottom = 30.0
rect_min_size = Vector2( 80, 30 )
text = "OK"
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Button" to="." method="hide"]

88
game/ui/login/Login.tscn Normal file
View File

@ -0,0 +1,88 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[node name="Login" type="PanelContainer"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -145.0
margin_top = -157.0
margin_right = 110.0
margin_bottom = 86.0
theme = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 4.0
margin_top = 4.0
margin_right = 251.0
margin_bottom = 242.0
custom_constants/separation = 10
alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 247.0
margin_bottom = 30.0
size_flags_horizontal = 3
[node name="Label3" type="Label" parent="VBoxContainer/HBoxContainer"]
margin_top = 7.0
margin_right = 199.0
margin_bottom = 22.0
size_flags_horizontal = 3
text = "Login"
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer"]
margin_left = 207.0
margin_right = 247.0
margin_bottom = 30.0
rect_min_size = Vector2( 40, 30 )
text = "X"
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
margin_top = 40.0
margin_right = 247.0
margin_bottom = 48.0
[node name="Label" type="Label" parent="VBoxContainer"]
margin_top = 58.0
margin_right = 247.0
margin_bottom = 73.0
text = "Username"
[node name="LineEdit" type="LineEdit" parent="VBoxContainer"]
margin_top = 83.0
margin_right = 247.0
margin_bottom = 107.341
[node name="Label2" type="Label" parent="VBoxContainer"]
margin_top = 117.0
margin_right = 247.0
margin_bottom = 132.0
text = "Password"
[node name="LineEdit2" type="LineEdit" parent="VBoxContainer"]
margin_top = 142.0
margin_right = 247.0
margin_bottom = 166.341
secret = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CheckBox" type="CheckBox" parent="VBoxContainer"]
margin_top = 176.0
margin_right = 247.0
margin_bottom = 202.269
text = "Remember me"
[node name="Button" type="Button" parent="VBoxContainer"]
margin_top = 212.0
margin_right = 247.0
margin_bottom = 238.269
text = "Login"
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Button" to="." method="hide"]

View File

@ -0,0 +1,33 @@
extends Control
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(NodePath) var icon_path : NodePath
export(NodePath) var label_path : NodePath
var icon : TextureRect
var label : RichTextLabel
var index : int
var player : Entity
var item : ItemInstance
func _ready():
icon = get_node(icon_path) as TextureRect
label = get_node(label_path) as RichTextLabel
if icon == null or label == null:
Logger.error("LootEntry is not setup correctly!")
func on_click():
player.crequest_loot(index)
func set_item(pindex : int, item_instance : ItemInstance, pplayer : Entity) -> void:
index = index
player = pplayer
item = item_instance
icon.texture = item.item_template.icon
label.bbcode_text = item.item_template.text_name

View File

@ -0,0 +1,61 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/loot_window/LootEntry.gd" type="Script" id=1]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2]
[node name="lootEntry" type="PanelContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_right = -3.0
margin_bottom = -3.0
rect_min_size = Vector2( 0, 40 )
size_flags_horizontal = 3
theme = ExtResource( 2 )
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
icon_path = NodePath("HBoxContainer/Button/TextureRect")
label_path = NodePath("HBoxContainer/Label")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
margin_left = 4.0
margin_top = 4.0
margin_right = 1017.0
margin_bottom = 593.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Button" type="Button" parent="HBoxContainer"]
margin_right = 46.0
margin_bottom = 589.0
rect_min_size = Vector2( 46, 46 )
[node name="TextureRect" type="TextureRect" parent="HBoxContainer/Button"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -20.0
margin_top = -20.0
margin_right = 20.0
margin_bottom = 20.0
rect_min_size = Vector2( 40, 40 )
size_flags_horizontal = 3
size_flags_vertical = 3
expand = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label" type="RichTextLabel" parent="HBoxContainer"]
margin_left = 50.0
margin_right = 1013.0
margin_bottom = 589.0
grow_horizontal = 2
grow_vertical = 2
size_flags_horizontal = 3
bbcode_enabled = true
text = "sdfsdfsdf"
scroll_active = false
[connection signal="pressed" from="HBoxContainer/Button" to="." method="on_click"]

View File

@ -0,0 +1,66 @@
extends Control
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(PackedScene) var entry_scene : PackedScene
export(NodePath) var container_path : NodePath
var container : Node
var player : Entity
var target_bag : Bag
func _ready():
container = get_node(container_path)
connect("visibility_changed", self, "on_visibility_changed")
if entry_scene == null:
Logger.error("LootWindow: entry_scene is null")
func refresh():
for child in container.get_children():
child.queue_free()
if target_bag == null:
return
for i in range(target_bag.get_size()):
var ii : ItemInstance = target_bag.get_item(i)
if ii:
var e : Node = entry_scene.instance()
container.add_child(e)
e.owner = container
e.set_item(i, ii, player)
func set_player(p_player : Entity) -> void:
player = p_player
player.connect("ctarget_bag_changed", self, "ctarget_bag_changed")
func on_visibility_changed():
if visible:
refresh()
else:
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()
func ctarget_bag_changed(entity: Entity, bag: Bag) -> void:
if target_bag != null:
target_bag.disconnect("item_removed", self, "on_item_removed")
target_bag = null
target_bag = bag
if target_bag == null:
return
target_bag.connect("item_removed", self, "on_item_removed")

View File

@ -0,0 +1,50 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://ui/loot_window/LootWindow.gd" type="Script" id=1]
[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"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
theme = ExtResource( 2 )
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
entry_scene = ExtResource( 3 )
container_path = NodePath("VBoxContainer/ScrollContainer/container")
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 4.0
margin_top = 4.0
margin_right = 1020.0
margin_bottom = 596.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Label" type="Label" parent="VBoxContainer"]
margin_right = 1016.0
margin_bottom = 15.0
text = "Loot"
align = 1
valign = 1
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
margin_top = 23.0
margin_right = 1016.0
margin_bottom = 558.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="container" type="VBoxContainer" parent="VBoxContainer/ScrollContainer"]
margin_right = 1016.0
size_flags_horizontal = 3
[node name="Button" type="Button" parent="VBoxContainer"]
margin_top = 566.0
margin_right = 1016.0
margin_bottom = 592.269
text = "close"
[connection signal="pressed" from="VBoxContainer/Button" to="." method="hide"]

47
game/ui/map/Map.tscn Normal file
View File

@ -0,0 +1,47 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[node name="Map" type="PanelContainer"]
margin_left = 55.5336
margin_top = 55.5336
margin_right = 821.534
margin_bottom = 545.534
theme = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 4.0
margin_top = 4.0
margin_right = 762.0
margin_bottom = 486.0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 758.0
margin_bottom = 40.0
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer"]
margin_top = 12.0
margin_right = 710.0
margin_bottom = 27.0
size_flags_horizontal = 3
text = "Map"
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer"]
margin_left = 718.0
margin_right = 758.0
margin_bottom = 40.0
rect_min_size = Vector2( 40, 40 )
text = "X"
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
margin_top = 48.0
margin_right = 758.0
margin_bottom = 482.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/ScrollContainer"]
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Button" to="." method="hide"]

View File

@ -0,0 +1,11 @@
[gd_scene format=2]
[node name="MiniMap" type="MarginContainer"]
anchor_left = 1.0
anchor_right = 1.0
margin_left = -196.0
margin_bottom = 189.0
mouse_filter = 2
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -0,0 +1,68 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://ui/nameplates/name_plate_theme.tres" type="Theme" id=1]
[ext_resource path="res://ui/nameplates/texture_progress_fg.tres" type="Texture" id=2]
[ext_resource path="res://player/NamePlate.gd" type="Script" id=3]
[node name="NamePlate" type="VBoxContainer"]
margin_right = 62.0
margin_bottom = 17.0
rect_scale = Vector2( 0.75, 0.75 )
mouse_filter = 2
theme = ExtResource( 1 )
custom_constants/separation = 0
script = ExtResource( 3 )
__meta__ = {
"_edit_use_anchors_": false
}
health_bar_path = NodePath("MarginContainer/TextureProgress")
health_bar_label_path = NodePath("MarginContainer/CenterContainer/Label")
normal_color = Color( 0.74902, 0.74902, 0.74902, 1 )
mouseover_scale = Vector2( 0.75, 0.75 )
[node name="Name" type="Label" parent="."]
margin_right = 62.0
margin_bottom = 15.0
custom_constants/line_spacing = 0
text = "Asda"
align = 1
valign = 1
[node name="MarginContainer" type="MarginContainer" parent="."]
margin_top = 15.0
margin_right = 62.0
margin_bottom = 17.0
size_flags_horizontal = 15
size_flags_vertical = 15
size_flags_stretch_ratio = 2.3
[node name="TextureProgress" type="TextureProgress" parent="MarginContainer"]
margin_right = 62.0
margin_bottom = 2.0
size_flags_horizontal = 3
size_flags_vertical = 3
value = 50.0
texture_under = ExtResource( 2 )
texture_progress = ExtResource( 2 )
tint_under = Color( 0.219608, 0.215686, 0.215686, 0.756863 )
tint_progress = Color( 0.917647, 0.0117647, 0.0117647, 1 )
nine_patch_stretch = true
stretch_margin_left = 1
stretch_margin_top = 1
stretch_margin_right = 1
stretch_margin_bottom = 1
[node name="CenterContainer" type="CenterContainer" parent="MarginContainer"]
visible = false
margin_right = 62.0
margin_bottom = 2.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Label" type="Label" parent="MarginContainer/CenterContainer"]
visible = false
margin_left = 22.0
margin_top = -7.0
margin_right = 40.0
margin_bottom = 8.0
text = "50%"

View File

@ -0,0 +1,7 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://data/fonts/VT323-Regular.ttf" type="DynamicFontData" id=1]
[resource]
size = 14
font_data = ExtResource( 1 )

View File

@ -0,0 +1,36 @@
[gd_resource type="Theme" load_steps=4 format=2]
[ext_resource path="res://ui/nameplates/name_plate_dynamicfont.tres" type="DynamicFont" id=1]
[sub_resource type="StyleBoxFlat" id=1]
bg_color = Color( 0.0627451, 0.0627451, 0.0627451, 0.823529 )
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
anti_aliasing = false
[sub_resource type="StyleBoxFlat" id=2]
bg_color = Color( 0.647059, 0, 0, 1 )
corner_radius_top_left = 5
corner_radius_top_right = 5
corner_radius_bottom_right = 5
corner_radius_bottom_left = 5
anti_aliasing = false
[resource]
default_font = ExtResource( 1 )
Label/colors/font_color = Color( 1, 1, 1, 1 )
Label/colors/font_color_shadow = Color( 0, 0, 0, 0 )
Label/colors/font_outline_modulate = Color( 1, 1, 1, 1 )
Label/constants/line_spacing = 6
Label/constants/shadow_as_outline = 0
Label/constants/shadow_offset_x = 0
Label/constants/shadow_offset_y = 0
Label/fonts/font = null
Label/styles/normal = null
ProgressBar/colors/font_color = Color( 0.94, 0.94, 0.94, 1 )
ProgressBar/colors/font_color_shadow = Color( 0, 0, 0, 1 )
ProgressBar/fonts/font = null
ProgressBar/styles/bg = SubResource( 1 )
ProgressBar/styles/fg = SubResource( 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( 31, 49, 10, 11 )

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( 31, 49, 10, 11 )

71
game/ui/numbers/Number.gd Normal file
View File

@ -0,0 +1,71 @@
extends Label
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(NodePath) var animation_player_path : NodePath = "AnimationPlayer"
export(Color) var damage_color : Color = Color.yellow
export(Color) var heal_color : Color = Color.green
var world_position : Vector3 = Vector3()
var animation_player : AnimationPlayer = null
var camera : Camera = null
func _ready() -> void:
animation_player = get_node(animation_player_path) as AnimationPlayer
animation_player.connect("animation_finished", self, "animation_finished")
set_process(false)
func _process(delta):
if camera == null:
return
var cam_pos : Vector3 = camera.global_transform.xform(Vector3())
var dstv : Vector3 = cam_pos - world_position
dstv.y = 0
# var dst : float = dstv.length_squared()
var cam_facing : Vector3 = -camera.global_transform.basis.z
var d : float = cam_facing.dot(dstv)
if d > 0:
if visible:
hide()
return
else:
if not visible:
show()
var screen_position : Vector2 = camera.unproject_position(world_position)
var new_pos : Vector2 = Vector2(screen_position.x + rect_position.x, screen_position.y + rect_position.y - 60)
set_position(new_pos)
func damage(pos : Vector3, value : int, crit : bool) -> void:
setup(pos, damage_color, value, crit)
func heal(pos : Vector3, value : int, crit : bool) -> void:
setup(pos, heal_color, value, crit)
func setup(pos : Vector3, color : Color, value : int, crit : bool) -> void:
world_position = pos
camera = get_tree().get_root().get_camera() as Camera
text = str(value)
add_color_override("font_color", color)
if crit:
animation_player.play("crit")
else:
animation_player.play("normal")
set_process(true)
func animation_finished(anim_name : String) -> void:
queue_free()

View File

@ -0,0 +1,92 @@
[gd_scene load_steps=5 format=2]
[ext_resource path="res://ui/numbers/Number.gd" type="Script" id=1]
[ext_resource path="res://ui/numbers/number_font.tres" type="DynamicFont" id=2]
[sub_resource type="Animation" id=1]
resource_name = "crit"
length = 1.5
tracks/0/type = "value"
tracks/0/path = NodePath(".:rect_scale")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 0.05, 0.3, 1.5 ),
"transitions": PoolRealArray( 1, 0.307786, 1, 1.36604 ),
"update": 0,
"values": [ Vector2( 0.1, 0.1 ), Vector2( 1.5, 1.5 ), Vector2( 1.3, 1.3 ), Vector2( 1.3, 1.3 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:rect_position")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 0.6, 1.5 ),
"transitions": PoolRealArray( 1, 1, 1 ),
"update": 0,
"values": [ Vector2( -50, 20 ), Vector2( -50, 20 ), Vector2( -50, 10 ) ]
}
tracks/2/type = "value"
tracks/2/path = NodePath(".:modulate")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/imported = false
tracks/2/enabled = true
tracks/2/keys = {
"times": PoolRealArray( 0, 1.2, 1.5 ),
"transitions": PoolRealArray( 1, 1, 4 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
}
[sub_resource type="Animation" id=2]
resource_name = "normal"
length = 2.0
tracks/0/type = "value"
tracks/0/path = NodePath(".:rect_position")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/keys = {
"times": PoolRealArray( 0, 2 ),
"transitions": PoolRealArray( 1, 1 ),
"update": 0,
"values": [ Vector2( -50, 20 ), Vector2( -50, 0 ) ]
}
tracks/1/type = "value"
tracks/1/path = NodePath(".:modulate")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/imported = false
tracks/1/enabled = true
tracks/1/keys = {
"times": PoolRealArray( 0, 1.5, 2 ),
"transitions": PoolRealArray( 1, 1, 4 ),
"update": 0,
"values": [ Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 1 ), Color( 1, 1, 1, 0 ) ]
}
[node name="Number" type="Label"]
modulate = Color( 1, 1, 1, 0 )
margin_left = -50.0
margin_right = 50.0
margin_bottom = 40.0006
rect_scale = Vector2( 1.3, 1.3 )
rect_pivot_offset = Vector2( 50, 20 )
custom_fonts/font = ExtResource( 2 )
custom_colors/font_color = Color( 0.870588, 0.898039, 0.0117647, 1 )
align = 1
valign = 1
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
anims/crit = SubResource( 1 )
anims/normal = SubResource( 2 )

View File

@ -0,0 +1,7 @@
[gd_resource type="DynamicFont" load_steps=2 format=2]
[ext_resource path="res://data/fonts/VT323-Regular.ttf" type="DynamicFontData" id=1]
[resource]
size = 12
font_data = ExtResource( 1 )

View File

@ -0,0 +1,17 @@
extends CheckBox
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(String) var property_category : String
export(String) var property_name : String
func _ready() -> void:
var p : bool = Settings.get_value(property_category, property_name) as bool
if p != pressed:
pressed = p
func _toggled(button_pressed : bool) -> void:
Settings.set_value(property_category, property_name, button_pressed)

View File

@ -0,0 +1,9 @@
extends HBoxContainer
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(String) var property_category : String
export(String) var property_name : String

View File

@ -0,0 +1,128 @@
[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/player_ui/RemoveProfile.gd" type="Script" id=2]
[ext_resource path="res://ui/options/OptionRow.gd" type="Script" id=3]
[ext_resource path="res://ui/options/Threads.gd" type="Script" id=4]
[ext_resource path="res://ui/options/OptionCheckBox.gd" type="Script" id=5]
[node name="Options" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
theme = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PanelContainer" type="PanelContainer" parent="."]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -271.5
margin_top = -236.5
margin_right = 271.5
margin_bottom = 236.5
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="PanelContainer"]
margin_left = 4.0
margin_top = 4.0
margin_right = 539.0
margin_bottom = 469.0
[node name="TabContainer" type="TabContainer" parent="PanelContainer/VBoxContainer"]
margin_right = 535.0
margin_bottom = 431.0
size_flags_horizontal = 3
size_flags_vertical = 3
tab_align = 0
[node name="Video" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 30.0
margin_right = -4.0
margin_bottom = -4.0
size_flags_horizontal = 3
[node name="Threads2" type="HBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer/Video"]
visible = false
margin_right = 519.0
margin_bottom = 26.0
size_flags_horizontal = 3
script = ExtResource( 3 )
property_category = "rendering/threads"
property_name = "thread_model"
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/TabContainer/Video/Threads2"]
margin_top = 5.0
margin_right = 255.0
margin_bottom = 20.0
size_flags_horizontal = 3
text = "asd"
[node name="Button" type="Button" parent="PanelContainer/VBoxContainer/TabContainer/Video/Threads2"]
margin_left = 263.0
margin_right = 519.0
margin_bottom = 26.269
size_flags_horizontal = 3
text = "tb"
[node name="Threads" type="HBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer/Video"]
margin_right = 527.0
margin_bottom = 26.0
size_flags_horizontal = 3
script = ExtResource( 4 )
[node name="Label" type="Label" parent="PanelContainer/VBoxContainer/TabContainer/Video/Threads"]
margin_top = 5.0
margin_right = 259.0
margin_bottom = 20.0
size_flags_horizontal = 3
text = "Thread Model"
[node name="OptionButton" type="OptionButton" parent="PanelContainer/VBoxContainer/TabContainer/Video/Threads"]
margin_left = 267.0
margin_right = 527.0
margin_bottom = 26.269
size_flags_horizontal = 3
align = 1
expand_icon = true
[node name="Debug" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
margin_left = 4.0
margin_top = 30.0
margin_right = -4.0
margin_bottom = -4.0
size_flags_horizontal = 3
[node name="DebugInfo" type="CheckBox" parent="PanelContainer/VBoxContainer/TabContainer/Debug"]
margin_right = 527.0
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 = 34.0
margin_right = 527.0
margin_bottom = 60.269
size_flags_horizontal = 3
text = "Remove Profile"
script = ExtResource( 2 )
[node name="Close" type="Button" parent="PanelContainer/VBoxContainer"]
margin_top = 439.0
margin_right = 535.0
margin_bottom = 465.269
text = "Close"
[connection signal="pressed" from="PanelContainer/VBoxContainer/Close" to="." method="hide"]

View File

@ -0,0 +1,19 @@
extends HBoxContainer
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
func _ready():
var ob : OptionButton = $OptionButton as OptionButton
ob.add_item("Single-Unsafe", 0)
ob.add_item("Single-Safe", 1)
ob.add_item("Multi Threaded", 2)
ob.selected = Settings.get_value("rendering", "thread_model")
ob.connect("item_selected", self, "item_selected")
func item_selected(id : int) -> void:
Settings.set_value("rendering", "thread_model", id)

View File

@ -0,0 +1,21 @@
extends Button
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# 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():
connect("pressed", self, "_on_pressed")
# Called every frame. 'delta' is the elapsed time since the previous frame.
#func _process(delta):
# pass
func _on_pressed():
var d : Directory = Directory.new()
d.remove("user://profile.save")

View File

@ -0,0 +1,15 @@
extends CanvasLayer
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(NodePath) var loot_window_path : NodePath
var loot_window : Control
func _ready():
loot_window = get_node(loot_window_path) as Control
func _on_Player_onc_open_loot_winow_request() -> void:
if loot_window != null:
loot_window.show()

View File

@ -0,0 +1,429 @@
[gd_scene load_steps=28 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/map/Map.tscn" type="PackedScene" id=6]
[ext_resource path="res://ui/touch_pad/TurnPanel.gd" type="Script" id=7]
[ext_resource path="res://ui/actionbars/Actionbars.gd" type="Script" id=8]
[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/touch_pad/analog.tscn" type="PackedScene" id=13]
[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/starmap/StarMap.tscn" type="PackedScene" id=22]
[ext_resource path="res://ui/theme/spellbook_icon.tres" type="Texture" id=23]
[ext_resource path="res://ui/theme/bag_icon.tres" type="Texture" id=24]
[ext_resource path="res://ui/theme/locked_icon.tres" type="Texture" id=25]
[ext_resource path="res://ui/theme/unlocked_icon.tres" type="Texture" id=26]
[ext_resource path="res://ui/player_ui/player_ui.gd" type="Script" id=28]
[node name="GUILayer" type="CanvasLayer"]
script = ExtResource( 28 )
loot_window_path = NodePath("GUI/Windows/LootWindow")
[node name="GUI" type="Control" parent="."]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
theme = ExtResource( 10 )
script = ExtResource( 1 )
__meta__ = {
"_edit_group_": true,
"_edit_lock_": true
}
player_path = NodePath("../..")
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") ]
[node name="TouchTargetControls" type="MarginContainer" parent="GUI"]
visible = false
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
custom_constants/margin_right = 272
custom_constants/margin_top = 481
custom_constants/margin_left = 60
custom_constants/margin_bottom = 41
__meta__ = {
"_edit_group_": true,
"_edit_lock_": true
}
[node name="HBoxContainer" type="HBoxContainer" parent="GUI/TouchTargetControls"]
margin_left = 60.0
margin_top = 481.0
margin_right = 752.0
margin_bottom = 559.0
mouse_filter = 2
size_flags_horizontal = 7
size_flags_vertical = 7
[node name="Control" type="Control" parent="GUI/TouchTargetControls/HBoxContainer"]
margin_right = 603.0
margin_bottom = 78.0
mouse_filter = 2
size_flags_horizontal = 15
size_flags_vertical = 15
size_flags_stretch_ratio = 12.0
[node name="TargetPad" type="Control" parent="GUI/TouchTargetControls/HBoxContainer"]
margin_left = 611.0
margin_right = 692.0
margin_bottom = 78.0
mouse_filter = 2
size_flags_horizontal = 15
size_flags_vertical = 15
size_flags_stretch_ratio = 1.6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Analog" parent="GUI/TouchTargetControls/HBoxContainer/TargetPad" instance=ExtResource( 13 )]
position = Vector2( 40, 30 )
listenerNodePath = NodePath("../../../../../..")
padname = "TargetPad"
[node name="TouchMovementControls" type="MarginContainer" parent="GUI"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
custom_constants/margin_right = 100
custom_constants/margin_top = 200
custom_constants/margin_left = 60
custom_constants/margin_bottom = 50
__meta__ = {
"_edit_group_": true,
"_edit_lock_": true
}
[node name="HBoxContainer" type="HBoxContainer" parent="GUI/TouchMovementControls"]
margin_left = 60.0
margin_top = 200.0
margin_right = 924.0
margin_bottom = 550.0
mouse_filter = 2
size_flags_horizontal = 7
size_flags_vertical = 7
[node name="TouchPad" type="Control" parent="GUI/TouchMovementControls/HBoxContainer"]
margin_right = 203.0
margin_bottom = 350.0
mouse_filter = 2
size_flags_horizontal = 15
size_flags_vertical = 15
[node name="Analog" parent="GUI/TouchMovementControls/HBoxContainer/TouchPad" instance=ExtResource( 13 )]
position = Vector2( 100, 290 )
listenerNodePath = NodePath("../../../../../..")
padname = "TouchPad"
[node name="Control" type="Control" parent="GUI/TouchMovementControls/HBoxContainer"]
margin_left = 207.0
margin_right = 533.0
margin_bottom = 350.0
mouse_filter = 2
size_flags_horizontal = 15
size_flags_vertical = 15
size_flags_stretch_ratio = 1.6
[node name="TurnPanel" type="Control" parent="GUI/TouchMovementControls/HBoxContainer"]
margin_left = 537.0
margin_right = 864.0
margin_bottom = 350.0
mouse_filter = 2
size_flags_horizontal = 15
size_flags_vertical = 15
size_flags_stretch_ratio = 1.6
[node name="Node2D" type="Node2D" parent="GUI/TouchMovementControls/HBoxContainer/TurnPanel"]
position = Vector2( -600, -200 )
script = ExtResource( 7 )
[node name="Buttons" type="Control" parent="GUI"]
anchor_left = 0.5
anchor_top = 1.0
anchor_right = 0.5
anchor_bottom = 1.0
margin_left = -202.0
margin_top = -45.0
margin_right = 140.0
mouse_filter = 2
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")
[node name="HBoxContainer" type="HBoxContainer" parent="GUI/Buttons"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
custom_constants/separation = 0
__meta__ = {
"_edit_use_anchors_": false
}
[node name="SpellBookButton" type="Button" parent="GUI/Buttons/HBoxContainer"]
margin_right = 45.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 = 45.0
margin_right = 90.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 = 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
text = "T"
[node name="CraftingButton" type="Button" parent="GUI/Buttons/HBoxContainer"]
margin_left = 135.0
margin_right = 180.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 = "Cr"
[node name="MapButton" type="Button" parent="GUI/Buttons/HBoxContainer"]
margin_left = 180.0
margin_right = 225.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 = "Map"
[node name="LockButton" type="Button" parent="GUI/Buttons/HBoxContainer"]
margin_left = 225.0
margin_right = 270.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
__meta__ = {
"_edit_use_anchors_": false
}
[node name="unlocked" type="TextureRect" parent="GUI/Buttons/HBoxContainer/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
texture = ExtResource( 26 )
expand = true
stretch_mode = 6
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Menu" type="Button" parent="GUI/Buttons/HBoxContainer"]
margin_left = 270.0
margin_right = 315.0
margin_bottom = 45.0
rect_min_size = Vector2( 45, 45 )
focus_mode = 0
enabled_focus_mode = 0
keep_pressed_outside = true
text = "M"
[node name="Actionbars" type="Control" parent="GUI"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource( 8 )
__meta__ = {
"_edit_lock_": true
}
actionbar_scene = ExtResource( 14 )
[node name="Windows" type="CanvasLayer" parent="GUI"]
layer = 2
[node name="SpellBookWindow" parent="GUI/Windows" instance=ExtResource( 17 )]
visible = false
margin_left = 60.0
margin_top = 50.0
margin_right = 561.0
[node name="TalentWindow" parent="GUI/Windows" instance=ExtResource( 11 )]
visible = false
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = 61.685
margin_top = 54.195
margin_right = 430.685
margin_bottom = 513.195
[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="StarMap" parent="GUI/Windows" instance=ExtResource( 22 )]
visible = false
[node name="Map" 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 )]
[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
margin_left = 382.0
margin_top = 461.0
margin_right = 607.0
margin_bottom = 480.0
mouse_filter = 2
[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
[node name="IngameMenu" parent="GUI" instance=ExtResource( 2 )]
visible = false
[connection signal="pressed" from="GUI/Buttons/HBoxContainer/BagButton" to="GUI/Windows/Inventory" method="show"]
[connection signal="pressed" from="GUI/Buttons/HBoxContainer/TalentButton" to="GUI/Windows/TalentWindow" method="show"]
[connection signal="pressed" from="GUI/Buttons/HBoxContainer/CraftingButton" to="GUI/Windows/CraftingWindow" method="show"]
[connection signal="pressed" from="GUI/Buttons/HBoxContainer/MapButton" to="GUI/Windows/Map" method="show"]
[connection signal="pressed" from="GUI/Buttons/HBoxContainer/Menu" to="GUI/IngameMenu" method="show"]

View File

@ -0,0 +1,114 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[node name="Register" type="PanelContainer"]
anchor_left = 0.5
anchor_top = 0.5
anchor_right = 0.5
anchor_bottom = 0.5
margin_left = -107.5
margin_top = -182.0
margin_right = 107.5
margin_bottom = 182.0
theme = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 4.0
margin_top = 4.0
margin_right = 211.0
margin_bottom = 360.0
custom_constants/separation = 10
alignment = 1
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 207.0
margin_bottom = 30.0
size_flags_horizontal = 3
[node name="Label3" type="Label" parent="VBoxContainer/HBoxContainer"]
margin_top = 7.0
margin_right = 159.0
margin_bottom = 22.0
size_flags_horizontal = 3
text = "Register"
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer"]
margin_left = 167.0
margin_right = 207.0
margin_bottom = 30.0
rect_min_size = Vector2( 40, 30 )
text = "X"
[node name="HSeparator" type="HSeparator" parent="VBoxContainer"]
margin_top = 40.0
margin_right = 207.0
margin_bottom = 48.0
[node name="Label" type="Label" parent="VBoxContainer"]
margin_top = 58.0
margin_right = 207.0
margin_bottom = 73.0
text = "Username"
[node name="LineEdit" type="LineEdit" parent="VBoxContainer"]
margin_top = 83.0
margin_right = 207.0
margin_bottom = 107.341
[node name="Label4" type="Label" parent="VBoxContainer"]
margin_top = 117.0
margin_right = 207.0
margin_bottom = 132.0
text = "Email"
[node name="LineEdit4" type="LineEdit" parent="VBoxContainer"]
margin_top = 142.0
margin_right = 207.0
margin_bottom = 166.341
[node name="Label2" type="Label" parent="VBoxContainer"]
margin_top = 176.0
margin_right = 207.0
margin_bottom = 191.0
text = "Password"
[node name="LineEdit2" type="LineEdit" parent="VBoxContainer"]
margin_top = 201.0
margin_right = 207.0
margin_bottom = 225.341
secret = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="Label3" type="Label" parent="VBoxContainer"]
margin_top = 235.0
margin_right = 207.0
margin_bottom = 250.0
text = "Password Again"
[node name="LineEdit3" type="LineEdit" parent="VBoxContainer"]
margin_top = 260.0
margin_right = 207.0
margin_bottom = 284.341
secret = true
__meta__ = {
"_edit_use_anchors_": false
}
[node name="CheckBox" type="CheckBox" parent="VBoxContainer"]
margin_top = 294.0
margin_right = 207.0
margin_bottom = 320.269
text = "I Accept the EULA"
[node name="Button" type="Button" parent="VBoxContainer"]
margin_top = 330.0
margin_right = 207.0
margin_bottom = 356.269
text = "Register"
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Button" to="." method="hide"]

View File

@ -0,0 +1,27 @@
extends PopupPanel
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(NodePath) var label_path : NodePath
export(NodePath) var desc_label_path : NodePath
var _label : Label
var _desc_label : RichTextLabel
var _spell : Spell
func _ready():
_label = get_node(label_path) as Label
_desc_label = get_node(desc_label_path) as RichTextLabel
func set_spell(spell : Spell) -> void:
_spell = spell
if _spell == null:
return
_label.text = _spell.text_name
_desc_label.text = _spell.text_description

View File

@ -0,0 +1,72 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
[node name="StarMap" type="PanelContainer"]
margin_right = 531.0
margin_bottom = 442.0
theme = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 4.0
margin_top = 4.0
margin_right = 527.0
margin_bottom = 438.0
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer"]
margin_right = 523.0
margin_bottom = 40.0
[node name="Label" type="Label" parent="VBoxContainer/HBoxContainer"]
margin_top = 12.0
margin_right = 475.0
margin_bottom = 27.0
size_flags_horizontal = 3
text = "Starmap"
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer"]
margin_left = 483.0
margin_right = 523.0
margin_bottom = 40.0
rect_min_size = Vector2( 40, 40 )
text = "X"
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
margin_top = 48.0
margin_right = 523.0
margin_bottom = 396.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="TextureRect" type="TextureRect" parent="VBoxContainer/ScrollContainer"]
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer"]
margin_top = 404.0
margin_right = 523.0
margin_bottom = 434.0
alignment = 1
[node name="Button" type="Button" parent="VBoxContainer/HBoxContainer2"]
margin_left = 133.0
margin_right = 213.0
margin_bottom = 30.0
rect_min_size = Vector2( 80, 30 )
text = "Search"
[node name="Button2" type="Button" parent="VBoxContainer/HBoxContainer2"]
margin_left = 221.0
margin_right = 301.0
margin_bottom = 30.0
rect_min_size = Vector2( 80, 30 )
text = "Custom"
[node name="Button3" type="Button" parent="VBoxContainer/HBoxContainer2"]
margin_left = 309.0
margin_right = 389.0
margin_bottom = 30.0
rect_min_size = Vector2( 80, 30 )
text = "Go"
[connection signal="pressed" from="VBoxContainer/HBoxContainer/Button" to="." method="hide"]

35
game/ui/talents/Spec.gd Normal file
View File

@ -0,0 +1,35 @@
extends ScrollContainer
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(PackedScene) var talent_row_scene : PackedScene
export(NodePath) var container_path : NodePath
var _container : Node
var _player : Entity
var _spec : CharacterSpec
var _spec_index : int
func _ready() -> void:
_container = get_node(container_path)
func set_spec(player : Entity, spec : CharacterSpec, spec_index: int) -> void:
for ch in _container.get_children():
ch.queue_free()
_player = player
_spec = spec
_spec_index = spec_index
if _player == null or _spec == null:
return
for i in range(spec.get_num_talent_rows()):
var r : Node = talent_row_scene.instance()
_container.add_child(r)
r.owner = self
r.set_player(player, spec, spec_index, i)

22
game/ui/talents/Spec.tscn Normal file
View File

@ -0,0 +1,22 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/talents/Spec.gd" type="Script" id=1]
[ext_resource path="res://ui/talents/TalentRow.tscn" type="PackedScene" id=2]
[node name="Spec" type="ScrollContainer"]
margin_right = 882.0
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
talent_row_scene = ExtResource( 2 )
container_path = NodePath("Container")
[node name="Container" type="VBoxContainer" parent="."]
margin_right = 858.0
size_flags_horizontal = 3
__meta__ = {
"_edit_use_anchors_": false
}

View File

@ -0,0 +1,109 @@
extends CenterContainer
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
export(NodePath) var main_container_path : NodePath
export(NodePath) var popup_path : NodePath
export(NodePath) var aura_name_label_path : NodePath
export(NodePath) var aura_description_label_path : NodePath
export(NodePath) var icon_rect_path : NodePath
export(NodePath) var rank_label_path : NodePath
export(NodePath) var upgrade_button_path : NodePath
export(int) var culomn : int
var _main_container : Control
var _popup : PopupPanel
var _aura_name_label : Label
var _aura_description_label : Label
var _icon_rect : TextureRect
var _rank_label : Label
var _upgrade_button : Button
var _row : int
var _spec_index : int
var _player : Entity
var _spec : CharacterSpec
func _ready() -> void:
_main_container = get_node(main_container_path) as Control
_popup = get_node(popup_path) as PopupPanel
_aura_name_label = get_node(aura_name_label_path) as Label
_aura_description_label = get_node(aura_description_label_path) as Label
_icon_rect = get_node(icon_rect_path) as TextureRect
_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:
if _player != null:
_player.disconnect("ctalent_learned", self, "ctalent_learned")
_player.disconnect("ctalent_reset", self, "ctalent_reset")
_row = row
_spec = spec
_player = player
_spec_index = spec_index
_player.connect("ctalent_learned", self, "ctalent_learned")
_player.connect("ctalent_reset", self, "ctalent_reset")
refresh()
func refresh() -> void:
var tr : TalentRowData = _spec.get_talent_row(_row)
if tr.get_talent(culomn, 0) == null:
_main_container.hide()
return
var rank_count : int = 0
var known_rank_count : int = 0
for i in range(TalentRowData.MAX_TALENTS_PER_ENTRY):
var a : Aura = tr.get_talent(culomn, i)
if a == null:
break
if _player.hasc_talent(a.id):
known_rank_count += 1
rank_count += 1
var ridx : int = known_rank_count - 1
if rank_count == known_rank_count:
_upgrade_button.hide()
else:
ridx += 1
_upgrade_button.show()
var aura : Aura = tr.get_talent(culomn, ridx)
_aura_name_label.text = aura.text_name
_aura_description_label.text = aura.text_description
_icon_rect.texture = aura.icon
_rank_label.text = str(known_rank_count) + "/" + str(rank_count)
func open_popup() -> void:
var p : Vector2 = rect_global_position
p.x += rect_size.x
_popup.popup(Rect2(p, _popup.rect_size))
func upgrade():
_player.crequest_talent_learn(_spec_index, _row, culomn)
func ctalent_learned(entity: Entity, talent_id: int) -> void:
refresh()
func ctalent_reset(entity: Entity) -> void:
refresh()

View File

@ -0,0 +1,110 @@
[gd_scene load_steps=3 format=2]
[ext_resource path="res://ui/talents/TalentEntry.gd" type="Script" id=1]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2]
[node name="TalentEntry" type="CenterContainer"]
margin_right = 40.0
margin_bottom = 40.0
rect_min_size = Vector2( 45, 45 )
size_flags_horizontal = 3
theme = ExtResource( 2 )
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}
main_container_path = NodePath("Button")
popup_path = NodePath("Button/PopupPanel")
aura_name_label_path = NodePath("Button/PopupPanel/VBoxContainer/HBoxContainer/Label")
aura_description_label_path = NodePath("Button/PopupPanel/VBoxContainer/Label")
icon_rect_path = NodePath("Button/MarginContainer/TextureRect")
rank_label_path = NodePath("Button/MarginContainer/TextureRect/Label")
upgrade_button_path = NodePath("Button/PopupPanel/VBoxContainer/HBoxContainer/Button")
[node name="Button" type="Button" parent="."]
margin_right = 45.0
margin_bottom = 45.0
rect_min_size = Vector2( 45, 45 )
[node name="MarginContainer" type="MarginContainer" parent="Button"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
custom_constants/margin_right = 3
custom_constants/margin_top = 3
custom_constants/margin_left = 3
custom_constants/margin_bottom = 3
__meta__ = {
"_edit_use_anchors_": false
}
[node name="TextureRect" type="TextureRect" parent="Button/MarginContainer"]
margin_left = 3.0
margin_top = 3.0
margin_right = 42.0
margin_bottom = 42.0
expand = true
[node name="Label" type="Label" parent="Button/MarginContainer/TextureRect"]
anchor_right = 1.0
anchor_bottom = 1.0
text = "2/2"
align = 2
valign = 2
__meta__ = {
"_edit_use_anchors_": false
}
[node name="PopupPanel" type="PopupPanel" parent="Button"]
margin_left = 41.592
margin_top = 1.58763
margin_right = 211.592
margin_bottom = 127.588
__meta__ = {
"_edit_use_anchors_": false
}
[node name="VBoxContainer" type="VBoxContainer" parent="Button/PopupPanel"]
margin_left = 4.0
margin_top = 4.0
margin_right = 166.0
margin_bottom = 122.0
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HBoxContainer" type="HBoxContainer" parent="Button/PopupPanel/VBoxContainer"]
margin_right = 162.0
margin_bottom = 30.0
[node name="Label" type="Label" parent="Button/PopupPanel/VBoxContainer/HBoxContainer"]
margin_top = 7.0
margin_right = 124.0
margin_bottom = 22.0
size_flags_horizontal = 3
text = "asdasdasdasdasda"
valign = 1
[node name="Button" type="Button" parent="Button/PopupPanel/VBoxContainer/HBoxContainer"]
margin_left = 132.0
margin_right = 162.0
margin_bottom = 30.0
rect_min_size = Vector2( 30, 30 )
text = "X"
[node name="Button" type="Button" parent="Button/PopupPanel/VBoxContainer"]
margin_top = 38.0
margin_right = 162.0
margin_bottom = 64.269
text = "Upgrade"
[node name="Label" type="Label" parent="Button/PopupPanel/VBoxContainer"]
margin_top = 72.0
margin_right = 162.0
margin_bottom = 118.0
size_flags_horizontal = 3
size_flags_vertical = 7
text = "increases your Dodge by 5%.
Also Adds 10% lols."
[connection signal="pressed" from="Button" to="." method="open_popup"]
[connection signal="pressed" from="Button/PopupPanel/VBoxContainer/HBoxContainer/Button" to="Button/PopupPanel" method="hide"]
[connection signal="pressed" from="Button/PopupPanel/VBoxContainer/Button" to="." method="upgrade"]

View File

@ -0,0 +1,9 @@
extends HBoxContainer
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
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)

View File

@ -0,0 +1,44 @@
[gd_scene load_steps=4 format=2]
[ext_resource path="res://ui/talents/TalentEntry.tscn" type="PackedScene" id=1]
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=2]
[ext_resource path="res://ui/talents/TalentRow.gd" type="Script" id=3]
[node name="TalentRow" type="HBoxContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
size_flags_horizontal = 3
theme = ExtResource( 2 )
alignment = 1
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

View File

@ -0,0 +1,16 @@
extends Button
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
var _index : int
var _spec_window : Node
func set_spec_index(spec_window : Node, index : int) -> void:
_index = index
_spec_window = spec_window
func _toggled(button_pressed):
if button_pressed:
_spec_window.select_spec(_index)

View File

@ -0,0 +1,14 @@
[gd_scene load_steps=2 format=2]
[ext_resource path="res://ui/talents/talent_switcher_button.gd" type="Script" id=1]
[node name="TalentSwitcher" type="Button"]
margin_left = 301.0
margin_right = 401.0
margin_bottom = 40.0
rect_min_size = Vector2( 70, 30 )
text = "Melee"
script = ExtResource( 1 )
__meta__ = {
"_edit_use_anchors_": false
}

BIN
game/ui/theme/GameUI.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

View File

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

View File

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

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( 2, 101, 12, 14 )

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( 1, 55, 13, 14 )

View File

@ -0,0 +1,14 @@
[gd_resource type="StyleBoxTexture" load_steps=2 format=2]
[ext_resource path="res://ui/theme/button_bg_atlas.tres" type="Texture" id=1]
[resource]
texture = ExtResource( 1 )
region_rect = Rect2( 0, 0, 13, 14 )
margin_left = 5.0562
margin_right = 5.57024
margin_top = 5.69876
margin_bottom = 5.57024
axis_stretch_horizontal = 2
axis_stretch_vertical = 2
modulate_color = Color( 0.772549, 0.772549, 0.772549, 1 )

View File

@ -0,0 +1,14 @@
[gd_resource type="StyleBoxTexture" load_steps=2 format=2]
[ext_resource path="res://ui/theme/button_bg_atlas.tres" type="Texture" id=1]
[resource]
texture = ExtResource( 1 )
region_rect = Rect2( 0, 0, 13, 14 )
margin_left = 5.57024
margin_right = 4.92768
margin_top = 5.18471
margin_bottom = 5.18471
axis_stretch_horizontal = 2
axis_stretch_vertical = 2
modulate_color = Color( 0.984314, 0.984314, 0.984314, 1 )

View File

@ -0,0 +1,14 @@
[gd_resource type="StyleBoxTexture" load_steps=2 format=2]
[ext_resource path="res://ui/theme/button_bg_atlas.tres" type="Texture" id=1]
[resource]
texture = ExtResource( 1 )
region_rect = Rect2( 0, 0, 13, 14 )
margin_left = 5.0562
margin_right = 4.92768
margin_top = 5.82727
margin_bottom = 5.0562
axis_stretch_horizontal = 2
axis_stretch_vertical = 2
modulate_color = Color( 0.807843, 0.807843, 0.807843, 1 )

View File

@ -0,0 +1,13 @@
[gd_resource type="StyleBoxTexture" load_steps=2 format=2]
[ext_resource path="res://ui/theme/button_bg_atlas.tres" type="Texture" id=1]
[resource]
texture = ExtResource( 1 )
region_rect = Rect2( 0, 0, 13, 14 )
margin_left = 4.15661
margin_right = 4.79917
margin_top = 4.67066
margin_bottom = 4.88346
axis_stretch_horizontal = 2
axis_stretch_vertical = 2

View File

@ -0,0 +1,14 @@
[gd_resource type="StyleBoxTexture" load_steps=2 format=2]
[ext_resource path="res://ui/theme/button_bg_atlas.tres" type="Texture" id=1]
[resource]
texture = ExtResource( 1 )
region_rect = Rect2( 0, 0, 13, 14 )
margin_left = 3.0
margin_right = 3.0
margin_top = 3.0
margin_bottom = 3.0
axis_stretch_horizontal = 2
axis_stretch_vertical = 2
modulate_color = Color( 0.431373, 0.431373, 0.431373, 1 )

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( 9, 46, 7, 7 )

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( 1, 46, 7, 7 )

Binary file not shown.

After

Width:  |  Height:  |  Size: 120 B

View File

@ -0,0 +1,34 @@
[remap]
importer="texture"
type="StreamTexture"
path="res://.import/cooldown_progress.png-021a0cda14b9a15b9ac04b9c9084d412.stex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://ui/theme/cooldown_progress.png"
dest_files=[ "res://.import/cooldown_progress.png-021a0cda14b9a15b9ac04b9c9084d412.stex" ]
[params]
compress/mode=0
compress/lossy_quality=0.7
compress/hdr_mode=0
compress/bptc_ldr=0
compress/normal_map=0
flags/repeat=0
flags/filter=false
flags/mipmaps=false
flags/anisotropic=false
flags/srgb=2
process/fix_alpha_border=true
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

@ -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( 1, 1, 10, 10 )

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( 31, 49, 10, 11 )

BIN
game/ui/theme/indicator.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

View File

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

View File

@ -0,0 +1,15 @@
[gd_resource type="StyleBoxTexture" load_steps=2 format=2]
[ext_resource path="res://ui/theme/button_bg_atlas.tres" type="Texture" id=1]
[resource]
texture = ExtResource( 1 )
region_rect = Rect2( 0, 0, 13, 14 )
margin_left = 4.54215
margin_right = 4.92768
margin_top = 4.54215
margin_bottom = 4.79917
expand_margin_top = 4.0
expand_margin_bottom = 4.0
axis_stretch_horizontal = 2
axis_stretch_vertical = 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( 31, 101, 12, 14 )

View File

@ -0,0 +1,13 @@
[gd_resource type="StyleBoxTexture" load_steps=2 format=2]
[ext_resource path="res://ui/theme/panel_bg_atlas.tres" type="Texture" id=1]
[resource]
texture = ExtResource( 1 )
region_rect = Rect2( 0, 0, 10, 11 )
margin_left = 4.0
margin_right = 4.0
margin_top = 4.0
margin_bottom = 4.0
axis_stretch_horizontal = 2
axis_stretch_vertical = 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( 31, 49, 10, 11 )

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( 1, 37, 7, 7 )

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( 9, 37, 7, 7 )

View File

@ -0,0 +1,14 @@
[gd_resource type="StyleBoxTexture" load_steps=2 format=2]
[ext_resource path="res://ui/theme/scrollbar_bg_atlas.tres" type="Texture" id=1]
[resource]
texture = ExtResource( 1 )
region_rect = Rect2( 0, 0, 10, 11 )
margin_left = 2.0
margin_right = 2.0
margin_top = 2.0
margin_bottom = 2.0
axis_stretch_horizontal = 2
axis_stretch_vertical = 2
modulate_color = Color( 0.976471, 0.976471, 0.976471, 1 )

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( 31, 49, 10, 11 )

View File

@ -0,0 +1,13 @@
[gd_resource type="StyleBoxTexture" load_steps=2 format=2]
[ext_resource path="res://ui/theme/panel_bg_atlas.tres" type="Texture" id=1]
[resource]
texture = ExtResource( 1 )
region_rect = Rect2( 0, 0, 10, 11 )
margin_left = 2.0
margin_right = 2.0
margin_top = 2.0
margin_bottom = 2.0
axis_stretch_horizontal = 2
axis_stretch_vertical = 2

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