using System.Threading.Tasks; using ColdMint.scripts.inventory; using ColdMint.scripts.map; using ColdMint.scripts.map.LayoutParsingStrategy; using ColdMint.scripts.map.layoutStrategy; using ColdMint.scripts.map.RoomPlacer; using ColdMint.scripts.utils; using Godot; namespace ColdMint.scripts.loader.sceneLoader; /// /// Game scene loader /// 游戏场景加载器 /// public partial class GameSceneLoader : SceneLoaderTemplate { private Label? _seedLabel; public override Task InitializeData() { RenderingServer.SetDefaultClearColor(Color.FromHsv(0, 0, 0)); //Loading the blood bar scene //加载血条场景 var healthBarUi = GetNode("CanvasLayer/Control/VBoxContainer/HealthBarUi"); GameSceneDepend.HealthBarUi = healthBarUi; //Load HotBar //加载HotBar var hotBar = GetNode("CanvasLayer/Control/VBoxContainer/HotBar"); GameSceneDepend.HotBar = hotBar; //Backpack Ui container //背包Ui容器 var backpackUiContainer = GetNode("CanvasLayer/BackpackUIContainer"); GameSceneDepend.BackpackUiContainer = backpackUiContainer; //Load operation prompt //加载操作提示 var operationTip = GetNode("CanvasLayer/Control/VBoxContainer/OperationTip"); GameSceneDepend.OperationTipLabel = operationTip; //Loaded weapon container //加载武器容器 var weaponContainer = GetNode("WeaponContainer"); GameSceneDepend.WeaponContainer = weaponContainer; //Load projectile container //加载抛射体容器 var projectileContainer = GetNode("ProjectileContainer"); GameSceneDepend.ProjectileContainer = projectileContainer; //Load Packsack container //加载背包容器 var packsackContainer = GetNode("PacksackContainer"); GameSceneDepend.PacksackContainer = packsackContainer; //Load AICharacter container //加载AICharacter容器 var aiCharacterContainer = GetNode("AICharacterContainer"); GameSceneDepend.AiCharacterContainer = aiCharacterContainer; //Load player container //加载玩家容器 var playerContainer = GetNode("PlayerContainer"); GameSceneDepend.PlayerContainer = playerContainer; //Load the room container node //加载房间容器节点 var miniMapContainerNode = GetNode("CanvasLayer/Control/MapContainer/MiniMap/RoomPreviewContainer"); GameSceneDepend.MiniMapContainerNode = miniMapContainerNode; //计算迷你地图的中点 var mapContainer = GetNode("CanvasLayer/Control/MapContainer/MiniMap"); GameSceneDepend.MiniMapMidpointCoordinate = mapContainer.Size / 2; return Task.CompletedTask; } public override async Task LoadScene() { var debugMode = Config.IsDebug(); var recreateMapButton = GetNodeOrNull