forked from xiangwang25/whale-town-front-v2
feat: add nearby social interactions
This commit is contained in:
@@ -38,6 +38,7 @@ const DEFAULT_SETTINGS: Dictionary = {
|
||||
"ui_scale": 1.00,
|
||||
"fullscreen": false,
|
||||
"show_interaction_hints": true,
|
||||
"show_interaction_points": false,
|
||||
"show_name_always": false,
|
||||
"show_chat_bubbles": true,
|
||||
"world_notifications": true,
|
||||
@@ -45,6 +46,7 @@ const DEFAULT_SETTINGS: Dictionary = {
|
||||
"friend_request_notifications": true,
|
||||
"allow_nearby_private": true,
|
||||
"allow_nearby_friend_requests": true,
|
||||
"allow_nearby_profile": true,
|
||||
"mute_ui_sfx": false,
|
||||
}
|
||||
|
||||
@@ -73,6 +75,7 @@ var _transitionTween: Tween
|
||||
var _avatarUploadPending: bool = false
|
||||
|
||||
func _ready() -> void:
|
||||
add_to_group("whaletown_escape_dismissible")
|
||||
visible = false
|
||||
mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
set_process(false)
|
||||
@@ -95,6 +98,8 @@ func _notification(what: int) -> void:
|
||||
_position_panel()
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if get_viewport().is_input_handled():
|
||||
return
|
||||
if not _isOpen:
|
||||
return
|
||||
if event is InputEventKey:
|
||||
@@ -136,6 +141,15 @@ func hide_panel(saveBeforeClose: bool = false) -> void:
|
||||
func is_panel_open() -> bool:
|
||||
return _isOpen
|
||||
|
||||
func is_escape_dismissible() -> bool:
|
||||
return _isOpen
|
||||
|
||||
func get_escape_priority() -> int:
|
||||
return 700
|
||||
|
||||
func request_escape_close() -> void:
|
||||
hide_panel(true)
|
||||
|
||||
func _build_ui() -> void:
|
||||
_overlay = ColorRect.new()
|
||||
_overlay.name = "SettingsDimOverlay"
|
||||
@@ -344,6 +358,7 @@ func _render_basic_content() -> void:
|
||||
_content.add_child(_create_section("基础设置", [
|
||||
_create_toggle_row("window", "全屏显示", "fullscreen", "适合专注游玩,窗口模式方便调试"),
|
||||
_create_toggle_row("eye", "显示互动提示", "show_interaction_hints", "靠近 NPC、好友或公告板时显示按键提示"),
|
||||
_create_toggle_row("eye", "显示交互点", "show_interaction_points", "用白色圆圈直接标出当前地图内的交互目标"),
|
||||
_create_toggle_row("account", "始终显示名字", "show_name_always", "关闭时只在需要时显示玩家名称"),
|
||||
]))
|
||||
_content.add_child(_create_section("音频设置", [
|
||||
@@ -365,25 +380,27 @@ func _render_chat_content() -> void:
|
||||
_content.add_child(_create_section("聊天与社交", [
|
||||
_create_toggle_row("chat", "世界频道提醒", "world_notifications", "收到世界频道消息时保留轻提示"),
|
||||
_create_toggle_row("chat", "私聊提醒", "private_notifications", "好友或附近玩家私聊时提示"),
|
||||
_create_toggle_row("account", "好友请求提醒", "friend_request_notifications", "对方按 F 发起好友申请时显示在好友列表"),
|
||||
_create_toggle_row("account", "好友请求提醒", "friend_request_notifications", "附近玩家发起好友申请时显示在好友列表"),
|
||||
_create_toggle_row("chat", "显示聊天气泡", "show_chat_bubbles", "气泡发送会同时进入世界频道"),
|
||||
]))
|
||||
_content.add_child(_create_section("附近玩家权限", [
|
||||
_create_toggle_row("eye", "允许查看我的名片", "allow_nearby_profile", "关闭后陌生玩家无法在附近打开你的社区名片"),
|
||||
_create_toggle_row("chat", "允许附近私聊", "allow_nearby_private", "附近玩家按 E 可以发起悄悄话"),
|
||||
_create_toggle_row("account", "允许好友申请", "allow_nearby_friend_requests", "附近玩家按 F 可以发送好友申请"),
|
||||
_create_toggle_row("account", "允许好友申请", "allow_nearby_friend_requests", "附近玩家可通过互动列表发送好友申请"),
|
||||
]))
|
||||
|
||||
func _render_controls_content() -> void:
|
||||
_content.add_child(_create_section("操作说明", [
|
||||
_create_key_row("W A S D", "移动角色"),
|
||||
_create_key_row("方向键", "备用移动"),
|
||||
_create_key_row("E", "互动 / 附近私聊"),
|
||||
_create_key_row("F", "发送好友申请"),
|
||||
_create_key_row("方向键", "附近互动列表选择"),
|
||||
_create_key_row("E", "执行选中的互动"),
|
||||
_create_key_row("Esc", "关闭当前界面或结束当前互动"),
|
||||
_create_key_row("T", "打开聊天输入"),
|
||||
_create_key_row("Enter", "发送聊天消息"),
|
||||
]))
|
||||
_content.add_child(_create_section("操作辅助", [
|
||||
_create_toggle_row("eye", "显示互动提示", "show_interaction_hints", "靠近可交互目标时显示按键提示"),
|
||||
_create_toggle_row("eye", "显示交互点", "show_interaction_points", "用白色圆圈直接标出当前地图内的交互目标"),
|
||||
_create_hint_row("当前版本使用固定键位;这里的开关会控制地图内的互动提示显示。"),
|
||||
]))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user