Unify menu presentation and fix UI regressions
This commit is contained in:
parent
3734d4a168
commit
b18d9392d8
35 changed files with 588 additions and 361 deletions
|
|
@ -26,17 +26,17 @@ const DIRECT_WORKFLOW_HELP: String = (
|
|||
@onready var _name_helper: Label = %NameHelper
|
||||
@onready var _server_list: ItemList = %ServerList
|
||||
@onready var _details: Label = %Details
|
||||
@onready var _direct_button: BubbleButton = %DirectButton
|
||||
@onready var _saved_button: BubbleButton = %SavedButton
|
||||
@onready var _recent_button: BubbleButton = %RecentButton
|
||||
@onready var _join_button: BubbleButton = %JoinButton
|
||||
@onready var _save_button: BubbleButton = %SaveButton
|
||||
@onready var _edit_button: BubbleButton = %EditButton
|
||||
@onready var _favorite_button: BubbleButton = %FavoriteButton
|
||||
@onready var _delete_button: BubbleButton = %DeleteButton
|
||||
@onready var _cancel_button: BubbleButton = %CancelButton
|
||||
@onready var _back_button: BubbleButton = %BackButton
|
||||
@onready var _open_close_button: BubbleButton = %OpenCloseButton
|
||||
@onready var _direct_button: Button = %DirectButton
|
||||
@onready var _saved_button: Button = %SavedButton
|
||||
@onready var _recent_button: Button = %RecentButton
|
||||
@onready var _join_button: Button = %JoinButton
|
||||
@onready var _save_button: Button = %SaveButton
|
||||
@onready var _edit_button: Button = %EditButton
|
||||
@onready var _favorite_button: Button = %FavoriteButton
|
||||
@onready var _delete_button: Button = %DeleteButton
|
||||
@onready var _cancel_button: Button = %CancelButton
|
||||
@onready var _back_button: Button = %BackButton
|
||||
@onready var _open_close_button: Button = %OpenCloseButton
|
||||
@onready var _status: Label = %Status
|
||||
@onready var _session_summary: Label = %SessionSummary
|
||||
@onready var _delete_confirmation: BubbleConfirmationPage = (
|
||||
|
|
@ -56,6 +56,19 @@ var _delete_armed: bool = false
|
|||
|
||||
|
||||
func _ready() -> void:
|
||||
UtilityPageStyle.apply_page(self)
|
||||
var paper := get_node("Paper") as PanelContainer
|
||||
paper.add_theme_stylebox_override(
|
||||
"panel", UtilityPageStyle.panel_style()
|
||||
)
|
||||
for button: BaseButton in [
|
||||
_direct_button, _saved_button, _recent_button, _join_button,
|
||||
_save_button, _edit_button, _favorite_button, _delete_button,
|
||||
_cancel_button, _back_button, _open_close_button,
|
||||
]:
|
||||
UtilityPageStyle.apply_button(button)
|
||||
UtilityPageStyle.apply_line_edit(_address)
|
||||
UtilityPageStyle.apply_line_edit(_name_edit)
|
||||
_direct_button.pressed.connect(_set_mode.bind(Mode.DIRECT))
|
||||
_saved_button.pressed.connect(_set_mode.bind(Mode.SAVED))
|
||||
_recent_button.pressed.connect(_set_mode.bind(Mode.RECENT))
|
||||
|
|
@ -126,6 +139,7 @@ func open_page(preserved_endpoint: String = "") -> void:
|
|||
elif _address.text.is_empty():
|
||||
_address.text = "127.0.0.1:7777"
|
||||
show()
|
||||
UtilityPageStyle.animate_in(self)
|
||||
_set_mode(_mode)
|
||||
if _mode == Mode.DIRECT:
|
||||
_address.grab_focus()
|
||||
|
|
|
|||
|
|
@ -1,8 +1,7 @@
|
|||
[gd_scene load_steps=13 format=3]
|
||||
[gd_scene load_steps=12 format=3]
|
||||
|
||||
[ext_resource type="Script" path="res://ui/network/join_game_page.gd" id="1_script"]
|
||||
[ext_resource type="Theme" path="res://ui/game_theme.tres" id="2_theme"]
|
||||
[ext_resource type="PackedScene" path="res://ui/components/bubble_menu/bubble_button.tscn" id="3_bubble"]
|
||||
[ext_resource type="PackedScene" path="res://ui/components/bubble_menu/bubble_confirmation_page.tscn" id="4_confirmation"]
|
||||
|
||||
[sub_resource type="StyleBoxFlat" id="StyleBox_paper"]
|
||||
|
|
@ -128,41 +127,23 @@ layout_mode = 2
|
|||
theme_override_constants/separation = 14
|
||||
alignment = 1
|
||||
|
||||
[node name="DirectButton" parent="Paper/Margin/Layout/Modes" instance=ExtResource("3_bubble")]
|
||||
[node name="DirectButton" type="Button" parent="Paper/Margin/Layout/Modes"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(100, 72)
|
||||
layout_mode = 2
|
||||
text = "direct"
|
||||
neutral_size = Vector2(100, 72)
|
||||
minimum_font_size = 16
|
||||
maximum_font_size = 19
|
||||
horizontal_amplitude = 0.0
|
||||
vertical_amplitude = 0.0
|
||||
deformation_amplitude = 0.0
|
||||
|
||||
[node name="SavedButton" parent="Paper/Margin/Layout/Modes" instance=ExtResource("3_bubble")]
|
||||
[node name="SavedButton" type="Button" parent="Paper/Margin/Layout/Modes"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(100, 72)
|
||||
layout_mode = 2
|
||||
text = "saved"
|
||||
neutral_size = Vector2(100, 72)
|
||||
minimum_font_size = 16
|
||||
maximum_font_size = 19
|
||||
horizontal_amplitude = 0.0
|
||||
vertical_amplitude = 0.0
|
||||
deformation_amplitude = 0.0
|
||||
|
||||
[node name="RecentButton" parent="Paper/Margin/Layout/Modes" instance=ExtResource("3_bubble")]
|
||||
[node name="RecentButton" type="Button" parent="Paper/Margin/Layout/Modes"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(100, 72)
|
||||
layout_mode = 2
|
||||
text = "recent"
|
||||
neutral_size = Vector2(100, 72)
|
||||
minimum_font_size = 16
|
||||
maximum_font_size = 19
|
||||
horizontal_amplitude = 0.0
|
||||
vertical_amplitude = 0.0
|
||||
deformation_amplitude = 0.0
|
||||
|
||||
[node name="AddressLabel" type="Label" parent="Paper/Margin/Layout"]
|
||||
unique_name_in_owner = true
|
||||
|
|
@ -290,106 +271,58 @@ layout_mode = 2
|
|||
theme_override_constants/separation = 7
|
||||
alignment = 1
|
||||
|
||||
[node name="JoinButton" parent="Paper/Margin/Layout/Actions" instance=ExtResource("3_bubble")]
|
||||
[node name="JoinButton" type="Button" parent="Paper/Margin/Layout/Actions"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(82, 72)
|
||||
layout_mode = 2
|
||||
text = "join"
|
||||
neutral_size = Vector2(82, 72)
|
||||
minimum_font_size = 15
|
||||
maximum_font_size = 18
|
||||
horizontal_amplitude = 0.0
|
||||
vertical_amplitude = 0.0
|
||||
deformation_amplitude = 0.0
|
||||
|
||||
[node name="SaveButton" parent="Paper/Margin/Layout/Actions" instance=ExtResource("3_bubble")]
|
||||
[node name="SaveButton" type="Button" parent="Paper/Margin/Layout/Actions"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(82, 72)
|
||||
layout_mode = 2
|
||||
text = "save\nserver"
|
||||
neutral_size = Vector2(82, 72)
|
||||
minimum_font_size = 14
|
||||
maximum_font_size = 17
|
||||
horizontal_amplitude = 0.0
|
||||
vertical_amplitude = 0.0
|
||||
deformation_amplitude = 0.0
|
||||
|
||||
[node name="EditButton" parent="Paper/Margin/Layout/Actions" instance=ExtResource("3_bubble")]
|
||||
[node name="EditButton" type="Button" parent="Paper/Margin/Layout/Actions"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(76, 68)
|
||||
layout_mode = 2
|
||||
text = "edit"
|
||||
neutral_size = Vector2(76, 68)
|
||||
minimum_font_size = 14
|
||||
maximum_font_size = 17
|
||||
horizontal_amplitude = 0.0
|
||||
vertical_amplitude = 0.0
|
||||
deformation_amplitude = 0.0
|
||||
|
||||
[node name="FavoriteButton" parent="Paper/Margin/Layout/Actions" instance=ExtResource("3_bubble")]
|
||||
[node name="FavoriteButton" type="Button" parent="Paper/Margin/Layout/Actions"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(88, 68)
|
||||
layout_mode = 2
|
||||
text = "favorite"
|
||||
neutral_size = Vector2(88, 68)
|
||||
minimum_font_size = 13
|
||||
maximum_font_size = 16
|
||||
horizontal_amplitude = 0.0
|
||||
vertical_amplitude = 0.0
|
||||
deformation_amplitude = 0.0
|
||||
|
||||
[node name="DeleteButton" parent="Paper/Margin/Layout/Actions" instance=ExtResource("3_bubble")]
|
||||
[node name="DeleteButton" type="Button" parent="Paper/Margin/Layout/Actions"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(82, 68)
|
||||
layout_mode = 2
|
||||
text = "delete"
|
||||
neutral_size = Vector2(82, 68)
|
||||
minimum_font_size = 13
|
||||
maximum_font_size = 16
|
||||
horizontal_amplitude = 0.0
|
||||
vertical_amplitude = 0.0
|
||||
deformation_amplitude = 0.0
|
||||
|
||||
[node name="OpenCloseButton" parent="Paper/Margin/Layout/Actions" instance=ExtResource("3_bubble")]
|
||||
[node name="OpenCloseButton" type="Button" parent="Paper/Margin/Layout/Actions"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(88, 72)
|
||||
layout_mode = 2
|
||||
text = "open\ngame"
|
||||
neutral_size = Vector2(88, 72)
|
||||
minimum_font_size = 14
|
||||
maximum_font_size = 17
|
||||
horizontal_amplitude = 0.0
|
||||
vertical_amplitude = 0.0
|
||||
deformation_amplitude = 0.0
|
||||
|
||||
[node name="CancelButton" parent="Paper/Margin/Layout/Actions" instance=ExtResource("3_bubble")]
|
||||
[node name="CancelButton" type="Button" parent="Paper/Margin/Layout/Actions"]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
custom_minimum_size = Vector2(76, 68)
|
||||
layout_mode = 2
|
||||
text = "cancel"
|
||||
neutral_size = Vector2(76, 68)
|
||||
minimum_font_size = 14
|
||||
maximum_font_size = 17
|
||||
horizontal_amplitude = 0.0
|
||||
vertical_amplitude = 0.0
|
||||
deformation_amplitude = 0.0
|
||||
|
||||
[node name="BackButton" parent="Paper/Margin/Layout/Actions" instance=ExtResource("3_bubble")]
|
||||
[node name="BackButton" type="Button" parent="Paper/Margin/Layout/Actions"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(76, 68)
|
||||
layout_mode = 2
|
||||
text = "back"
|
||||
neutral_size = Vector2(76, 68)
|
||||
minimum_font_size = 14
|
||||
maximum_font_size = 17
|
||||
horizontal_amplitude = 0.0
|
||||
vertical_amplitude = 0.0
|
||||
deformation_amplitude = 0.0
|
||||
|
||||
[node name="DeleteConfirmation" parent="." instance=ExtResource("4_confirmation")]
|
||||
unique_name_in_owner = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue