Refine settings tabs and data folder access
This commit is contained in:
parent
5daf97967a
commit
1aa77180a4
3 changed files with 131 additions and 10 deletions
|
|
@ -235,7 +235,7 @@ func _connect_controls() -> void:
|
|||
)
|
||||
%ControllerMapping.pressed.connect(_open_controller_mapping)
|
||||
%KeyboardMapping.pressed.connect(_open_keyboard_mouse_mapping)
|
||||
%OpenDataFolder.pressed.connect(_open_data_folder)
|
||||
%OpenDataFolder.pressed.connect(_confirm_open_data_folder)
|
||||
%ChangeDataFolder.pressed.connect(_choose_data_folder)
|
||||
%ExportPlayerIdentity.pressed.connect(
|
||||
_choose_identity_export.bind("player")
|
||||
|
|
@ -635,6 +635,32 @@ func _open_data_folder() -> void:
|
|||
_feedback.text = "could not open the data folder."
|
||||
|
||||
|
||||
func _confirm_open_data_folder() -> void:
|
||||
if _data_root == null:
|
||||
_feedback.text = "the data folder is unavailable."
|
||||
return
|
||||
var dialog := ConfirmationDialog.new()
|
||||
dialog.title = "open data folder?"
|
||||
dialog.ok_button_text = "open folder"
|
||||
dialog.cancel_button_text = "cancel"
|
||||
dialog.dialog_text = (
|
||||
"open this folder outside NETfishing?\n\n" + _data_root.root_path
|
||||
)
|
||||
dialog.confirmed.connect(func() -> void:
|
||||
_open_data_folder()
|
||||
dialog.queue_free()
|
||||
)
|
||||
dialog.canceled.connect(dialog.queue_free)
|
||||
if _interface_fonts != null:
|
||||
_interface_fonts.apply_utility_theme(dialog)
|
||||
add_child(dialog)
|
||||
dialog.popup_centered(Vector2i(620, 300))
|
||||
_configure_confirmation_dialog.call_deferred(
|
||||
dialog,
|
||||
dialog.get_cancel_button(),
|
||||
)
|
||||
|
||||
|
||||
func _copy_player_fingerprint() -> void:
|
||||
var fingerprint: String = (
|
||||
_player_identity.fingerprint if _player_identity != null else ""
|
||||
|
|
|
|||
|
|
@ -30,9 +30,10 @@ theme_override_constants/margin_bottom = 18
|
|||
|
||||
[node name="Layout" type="VBoxContainer" parent="MainPanel/OuterMargin"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 8
|
||||
theme_override_constants/separation = -26
|
||||
|
||||
[node name="Heading" type="Label" parent="MainPanel/OuterMargin/Layout"]
|
||||
custom_minimum_size = Vector2(0, 66)
|
||||
layout_mode = 2
|
||||
theme_override_font_sizes/font_size = 30
|
||||
text = "settings"
|
||||
|
|
@ -90,7 +91,7 @@ palette_index = 1
|
|||
|
||||
[node name="ContentPanel" type="PanelContainer" parent="MainPanel/OuterMargin/Layout"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 440)
|
||||
custom_minimum_size = Vector2(0, 474)
|
||||
layout_mode = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
|
|
@ -610,7 +611,15 @@ size_flags_horizontal = 3
|
|||
focus_mode = 2
|
||||
text = "import host identity"
|
||||
|
||||
[node name="SettingsFeedback" type="Label" parent="MainPanel/OuterMargin/Layout"]
|
||||
[node name="FooterGroup" type="MarginContainer" parent="MainPanel/OuterMargin/Layout"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/margin_top = 34
|
||||
|
||||
[node name="FooterLayout" type="VBoxContainer" parent="MainPanel/OuterMargin/Layout/FooterGroup"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 8
|
||||
|
||||
[node name="SettingsFeedback" type="Label" parent="MainPanel/OuterMargin/Layout/FooterGroup/FooterLayout"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 24)
|
||||
layout_mode = 2
|
||||
|
|
@ -619,19 +628,19 @@ horizontal_alignment = 1
|
|||
vertical_alignment = 1
|
||||
text_overrun_behavior = 3
|
||||
|
||||
[node name="Footer" type="HBoxContainer" parent="MainPanel/OuterMargin/Layout"]
|
||||
[node name="Footer" type="HBoxContainer" parent="MainPanel/OuterMargin/Layout/FooterGroup/FooterLayout"]
|
||||
layout_mode = 2
|
||||
theme_override_constants/separation = 12
|
||||
alignment = 2
|
||||
|
||||
[node name="ApplySettingsButton" type="Button" parent="MainPanel/OuterMargin/Layout/Footer"]
|
||||
[node name="ApplySettingsButton" type="Button" parent="MainPanel/OuterMargin/Layout/FooterGroup/FooterLayout/Footer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(180, 44)
|
||||
layout_mode = 2
|
||||
focus_mode = 2
|
||||
text = "apply"
|
||||
|
||||
[node name="SettingsBackButton" type="Button" parent="MainPanel/OuterMargin/Layout/Footer"]
|
||||
[node name="SettingsBackButton" type="Button" parent="MainPanel/OuterMargin/Layout/FooterGroup/FooterLayout/Footer"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(180, 44)
|
||||
layout_mode = 2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue