feat: 实现了加载本地数据功能
This commit is contained in:
@@ -1,14 +1,26 @@
|
||||
extends Node2D
|
||||
|
||||
func _ready() -> void:
|
||||
init_sources()
|
||||
init_text()
|
||||
|
||||
func init_text() -> void:
|
||||
$DataSetting/LineEdit.text = GameManager.data_origin
|
||||
$IPBeginSetting/LineEdit.text = GameManager.ip_begin
|
||||
$UsernameSetting/LineEdit.text = GameManager.username
|
||||
$LoadSource/ChooseSource.select(GameManager.source)
|
||||
|
||||
func init_sources() -> void:
|
||||
DownloadManager.get_sources()
|
||||
var options = $LoadSource/ChooseSource
|
||||
for source_name in GameManager.sources:
|
||||
options.add_item(source_name)
|
||||
|
||||
func _on_save_button_pressed() -> void:
|
||||
GameManager.data_origin = $DataSetting/LineEdit.text
|
||||
GameManager.ip_begin = $IPBeginSetting/LineEdit.text
|
||||
GameManager.username = $UsernameSetting/LineEdit.text
|
||||
GameManager.source = $LoadSource/ChooseSource.get_selected()
|
||||
SceneManager.goto_scene("main_menu")
|
||||
|
||||
|
||||
@@ -29,3 +41,9 @@ func _on_download_button_pressed() -> void:
|
||||
DownloadManager.load_resource()
|
||||
$Tips.text = "提示:完成加载"
|
||||
|
||||
|
||||
|
||||
func _on_load_button_pressed() -> void:
|
||||
DownloadManager.uuid = GameManager.sources[$LoadSource/ChooseSource.text]
|
||||
DownloadManager.load_resource()
|
||||
$Tips.text = "提示:完成加载"
|
||||
|
||||
Reference in New Issue
Block a user