mirror of
https://github.com/Relintai/broken_seals.git
synced 2024-12-18 01:06:47 +01:00
Added interface options to the ingame menu. These are the character specific. Added an option to save a character's actionbars as the default.
This commit is contained in:
parent
e5d127c079
commit
cddda7d5e2
@ -1,9 +1,10 @@
|
||||
[gd_scene load_steps=5 format=2]
|
||||
[gd_scene load_steps=6 format=2]
|
||||
|
||||
[ext_resource path="res://ui/theme/ui_theme.tres" type="Theme" id=1]
|
||||
[ext_resource path="res://ui/options/Options.tscn" type="PackedScene" id=2]
|
||||
[ext_resource path="res://ui/ingame_menu/ExitButton.gd" type="Script" id=3]
|
||||
[ext_resource path="res://ui/keybinds/Keybinds.tscn" type="PackedScene" id=4]
|
||||
[ext_resource path="res://ui/interface/InterfaceOptions.tscn" type="PackedScene" id=5]
|
||||
|
||||
[node name="IngameMenu" type="Control"]
|
||||
anchor_right = 1.0
|
||||
@ -31,7 +32,7 @@ __meta__ = {
|
||||
margin_left = 4.0
|
||||
margin_top = 4.0
|
||||
margin_right = 151.0
|
||||
margin_bottom = 132.0
|
||||
margin_bottom = 166.0
|
||||
|
||||
[node name="Resume" type="Button" parent="Menu/VBoxContainer"]
|
||||
margin_right = 147.0
|
||||
@ -44,16 +45,25 @@ margin_right = 147.0
|
||||
margin_bottom = 60.5702
|
||||
text = "Keybinds"
|
||||
|
||||
[node name="Options" type="Button" parent="Menu/VBoxContainer"]
|
||||
[node name="Interface" type="Button" parent="Menu/VBoxContainer"]
|
||||
margin_top = 68.0
|
||||
margin_right = 147.0
|
||||
margin_bottom = 94.5702
|
||||
text = "Options"
|
||||
text = "Interface"
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
|
||||
[node name="Exit" type="Button" parent="Menu/VBoxContainer"]
|
||||
[node name="Options" type="Button" parent="Menu/VBoxContainer"]
|
||||
margin_top = 102.0
|
||||
margin_right = 147.0
|
||||
margin_bottom = 128.57
|
||||
text = "Options"
|
||||
|
||||
[node name="Exit" type="Button" parent="Menu/VBoxContainer"]
|
||||
margin_top = 136.0
|
||||
margin_right = 147.0
|
||||
margin_bottom = 162.57
|
||||
text = "Exit"
|
||||
script = ExtResource( 3 )
|
||||
|
||||
@ -78,6 +88,18 @@ margin_left = -426.0
|
||||
margin_top = -270.0
|
||||
margin_right = 426.0
|
||||
margin_bottom = 270.0
|
||||
|
||||
[node name="InterfaceOptions" parent="." instance=ExtResource( 5 )]
|
||||
visible = false
|
||||
anchor_left = 0.5
|
||||
anchor_top = 0.5
|
||||
anchor_right = 0.5
|
||||
anchor_bottom = 0.5
|
||||
margin_left = -331.0
|
||||
margin_top = -224.5
|
||||
margin_right = 331.0
|
||||
margin_bottom = 224.5
|
||||
[connection signal="pressed" from="Menu/VBoxContainer/Resume" to="." method="hide"]
|
||||
[connection signal="pressed" from="Menu/VBoxContainer/Keybinds" to="KeybindWindow" method="show"]
|
||||
[connection signal="pressed" from="Menu/VBoxContainer/Interface" to="InterfaceOptions" method="show"]
|
||||
[connection signal="pressed" from="Menu/VBoxContainer/Options" to="Options" method="show"]
|
||||
|
6
game/ui/interface/InterfaceOptions.gd
Normal file
6
game/ui/interface/InterfaceOptions.gd
Normal file
@ -0,0 +1,6 @@
|
||||
extends PanelContainer
|
||||
|
||||
export(NodePath) var actionbar_set_default_button_path : NodePath
|
||||
|
||||
func set_player(p_player: Entity) -> void:
|
||||
get_node(actionbar_set_default_button_path).set_player(p_player)
|
52
game/ui/interface/InterfaceOptions.tscn
Normal file
52
game/ui/interface/InterfaceOptions.tscn
Normal file
@ -0,0 +1,52 @@
|
||||
[gd_scene load_steps=3 format=2]
|
||||
|
||||
[ext_resource path="res://ui/interface/SetActionbarAsDefault.gd" type="Script" id=1]
|
||||
[ext_resource path="res://ui/interface/InterfaceOptions.gd" type="Script" id=2]
|
||||
|
||||
[node name="InterfaceOptions" type="PanelContainer"]
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
script = ExtResource( 2 )
|
||||
__meta__ = {
|
||||
"_edit_use_anchors_": false
|
||||
}
|
||||
actionbar_set_default_button_path = NodePath("VBoxContainer2/VBoxContainer/SetActionbarAsDefault")
|
||||
|
||||
[node name="VBoxContainer2" type="VBoxContainer" parent="."]
|
||||
margin_left = 7.0
|
||||
margin_top = 7.0
|
||||
margin_right = 1017.0
|
||||
margin_bottom = 593.0
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer2"]
|
||||
margin_right = 1010.0
|
||||
margin_bottom = 30.0
|
||||
size_flags_horizontal = 3
|
||||
|
||||
[node name="Label" type="Label" parent="VBoxContainer2/HBoxContainer"]
|
||||
margin_top = 8.0
|
||||
margin_right = 966.0
|
||||
margin_bottom = 22.0
|
||||
size_flags_horizontal = 3
|
||||
text = "Interface options"
|
||||
|
||||
[node name="Button" type="Button" parent="VBoxContainer2/HBoxContainer"]
|
||||
margin_left = 970.0
|
||||
margin_right = 1010.0
|
||||
margin_bottom = 30.0
|
||||
rect_min_size = Vector2( 40, 30 )
|
||||
text = "X"
|
||||
|
||||
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer2"]
|
||||
margin_top = 34.0
|
||||
margin_right = 1010.0
|
||||
margin_bottom = 586.0
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
|
||||
[node name="SetActionbarAsDefault" type="Button" parent="VBoxContainer2/VBoxContainer"]
|
||||
margin_right = 1010.0
|
||||
margin_bottom = 20.0
|
||||
text = "Set current actionbar setup as default"
|
||||
script = ExtResource( 1 )
|
||||
[connection signal="pressed" from="VBoxContainer2/HBoxContainer/Button" to="." method="hide"]
|
16
game/ui/interface/SetActionbarAsDefault.gd
Normal file
16
game/ui/interface/SetActionbarAsDefault.gd
Normal file
@ -0,0 +1,16 @@
|
||||
extends Button
|
||||
|
||||
var _player : Entity
|
||||
|
||||
func set_player(p_player: Entity) -> void:
|
||||
_player = p_player
|
||||
|
||||
func _pressed():
|
||||
if _player && is_instance_valid(_player):
|
||||
var abp : ActionBarProfile = _player.get_action_bar_profile()
|
||||
|
||||
var cp : ClassProfile = ProfileManager.getc_player_profile().get_class_profile(_player.gets_entity_data().get_path())
|
||||
|
||||
cp.get_default_action_bar_profile().from_actionbar_profile(abp)
|
||||
|
||||
ProfileManager.save()
|
@ -44,6 +44,7 @@ size_flags_vertical = 3
|
||||
tab_align = 0
|
||||
|
||||
[node name="Video" type="VBoxContainer" parent="PanelContainer/VBoxContainer/TabContainer"]
|
||||
visible = false
|
||||
anchor_right = 1.0
|
||||
anchor_bottom = 1.0
|
||||
margin_left = 4.0
|
||||
|
@ -45,7 +45,7 @@ script = ExtResource( 1 )
|
||||
__meta__ = {
|
||||
"_edit_lock_": true
|
||||
}
|
||||
child_controls = [ NodePath("Unitframes"), NodePath("Actionbars"), NodePath("Windows/SpellBookWindow"), NodePath("Buttons"), NodePath("Castbar"), NodePath("AuraFrame"), NodePath("Windows/Inventory"), NodePath("Windows/LootWindow"), NodePath("Windows/TalentWindow"), NodePath("Windows/CraftingWindow"), NodePath("IngameMenu/KeybindWindow"), NodePath("Windows/CharacterWindow"), NodePath("Windows/TrainerWindow") ]
|
||||
child_controls = [ NodePath("Unitframes"), NodePath("Actionbars"), NodePath("Windows/SpellBookWindow"), NodePath("Buttons"), NodePath("Castbar"), NodePath("AuraFrame"), NodePath("Windows/Inventory"), NodePath("Windows/LootWindow"), NodePath("Windows/TalentWindow"), NodePath("Windows/CraftingWindow"), NodePath("IngameMenu/KeybindWindow"), NodePath("Windows/CharacterWindow"), NodePath("Windows/TrainerWindow"), NodePath("IngameMenu/InterfaceOptions") ]
|
||||
|
||||
[node name="TouchTargetControls" type="MarginContainer" parent="GUI"]
|
||||
visible = false
|
||||
|
Loading…
Reference in New Issue
Block a user