forked from xiangwang25/whale-town-front-v2
feat: add taskbook onboarding UI
This commit is contained in:
@@ -34,6 +34,7 @@ var _guideFooter: HBoxContainer
|
||||
var _guidePrevButton: Button
|
||||
var _guideNextButton: Button
|
||||
var _guideDotsContainer: HBoxContainer
|
||||
var _guideTaskBookButton: Button
|
||||
var _guideCurrentPage: int = 0
|
||||
var _guideTween: Tween
|
||||
|
||||
@@ -75,6 +76,9 @@ func _onStartPressed() -> void:
|
||||
_showGuide()
|
||||
|
||||
func _showGuide() -> void:
|
||||
var taskManager := get_node_or_null("/root/TaskManager")
|
||||
if taskManager != null and taskManager.has_method("report_activity"):
|
||||
taskManager.call("report_activity", "guide_opened")
|
||||
panelContainer.custom_minimum_size = Vector2(720, 560)
|
||||
titleLabel.text = "新人引导手册"
|
||||
logoContainer.visible = false
|
||||
@@ -162,6 +166,12 @@ func _buildGuideUi() -> void:
|
||||
_guideNextButton.pressed.connect(_onGuideNextPressed)
|
||||
_guideFooter.add_child(_guideNextButton)
|
||||
|
||||
_guideTaskBookButton = _createGuideButton("任务书")
|
||||
_guideTaskBookButton.name = "TaskBookButton"
|
||||
_guideTaskBookButton.custom_minimum_size = Vector2(96, 44)
|
||||
_guideTaskBookButton.pressed.connect(_onGuideTaskBookPressed)
|
||||
_guideFooter.add_child(_guideTaskBookButton)
|
||||
|
||||
func _createGuideButton(text: String) -> Button:
|
||||
var button := Button.new()
|
||||
button.custom_minimum_size = Vector2(56, 44)
|
||||
@@ -285,6 +295,12 @@ func _onGuideNextPressed() -> void:
|
||||
_guideCurrentPage += 1
|
||||
_updateGuideUi()
|
||||
|
||||
func _onGuideTaskBookPressed() -> void:
|
||||
var taskBook := get_node_or_null("/root/TaskBookPanel")
|
||||
if taskBook != null and taskBook.has_method("show_panel"):
|
||||
taskBook.call("show_panel")
|
||||
queue_free()
|
||||
|
||||
func _disableChatUiMouseInput() -> void:
|
||||
var currentScene := get_tree().current_scene
|
||||
if currentScene != null:
|
||||
|
||||
Reference in New Issue
Block a user