Refactor settings types to use scripting API

This commit is contained in:
Wojtek Figat
2021-01-05 14:14:34 +01:00
parent cc8e78b505
commit be319c446d
75 changed files with 955 additions and 1431 deletions

View File

@@ -119,7 +119,10 @@ bool GameBase::Init()
}
// Preload first scene asset data
GameBaseImpl::FirstScene = GameSettings::FirstScene;
const auto gameSettings = GameSettings::Get();
if (!gameSettings)
return true;
GameBaseImpl::FirstScene = gameSettings->FirstScene;
return false;
}
@@ -261,8 +264,8 @@ void GameBaseImpl::OnSplashScreenEnd()
// Load the first scene
LOG(Info, "Loading the first scene");
const auto sceneId = FirstScene ? FirstScene.GetID() : Guid::Empty;
FirstScene.Unlink();
const auto sceneId = GameSettings::FirstScene;
if (Level::LoadSceneAsync(sceneId))
{
LOG(Fatal, "Cannot load the first scene.");