Add localisable progress status messages

This commit is contained in:
Aaron van Geffen 2024-04-24 19:40:46 +02:00
parent 7c4be9ce92
commit 9f45d40bae
5 changed files with 32 additions and 6 deletions

View File

@ -3702,6 +3702,11 @@ STR_6627 :Track speed too high!
STR_6628 :Can only be placed on path edges!
STR_6629 :Align toolbar buttons horizontally centred
STR_6630 :This setting will align the toolbar buttons horizontally in the centre of the screen. The traditional way of aligning them is in the left and right corner.
STR_6631 :Loading...
STR_6632 :Checking object files...
STR_6633 :Checking scenario files...
STR_6634 :Checking track design files...
STR_6635 :Checking asset packs...
#############
# Scenarios #

View File

@ -505,18 +505,24 @@ namespace OpenRCT2
ContextInit();
_preloaderScene->AddJob([&]() {
_objectRepository->LoadOrConstruct(_localisationService->GetCurrentLanguage());
auto currentLanguage = _localisationService->GetCurrentLanguage();
_preloaderScene->UpdateCaption(STR_CHECKING_OBJECT_FILES);
_objectRepository->LoadOrConstruct(currentLanguage);
if (!gOpenRCT2Headless)
{
_preloaderScene->UpdateCaption(STR_CHECKING_ASSET_PACKS);
_assetPackManager->Scan();
_assetPackManager->LoadEnabledAssetPacks();
_assetPackManager->Reload();
}
_trackDesignRepository->Scan(_localisationService->GetCurrentLanguage());
_preloaderScene->UpdateCaption(STR_CHECKING_TRACK_DESIGN_FILES);
_trackDesignRepository->Scan(currentLanguage);
_scenarioRepository->Scan(_localisationService->GetCurrentLanguage());
_preloaderScene->UpdateCaption(STR_CHECKING_SCENARIO_FILES);
_scenarioRepository->Scan(currentLanguage);
});
TitleSequenceManager::Scan();

View File

@ -3855,6 +3855,12 @@ enum : uint16_t
STR_OPTIONS_TOOLBAR_BUTTONS_CENTRED = 6629,
STR_OPTIONS_TOOLBAR_BUTTONS_CENTRED_TIP = 6630,
STR_LOADING_GENERIC = 6631,
STR_CHECKING_OBJECT_FILES = 6632,
STR_CHECKING_SCENARIO_FILES = 6633,
STR_CHECKING_TRACK_DESIGN_FILES = 6634,
STR_CHECKING_ASSET_PACKS = 6635,
// Have to include resource strings (from scenarios and objects) for the time being now that language is partially working
/* MAX_STR_COUNT = 32768 */ // MAX_STR_COUNT - upper limit for number of strings, not the current count strings
};

View File

@ -16,6 +16,7 @@
#include "../../audio/audio.h"
#include "../../interface/Viewport.h"
#include "../../interface/Window.h"
#include "../../localisation/LocalisationService.h"
#include "../../localisation/StringIds.h"
#include "../../windows/Intent.h"
@ -37,9 +38,7 @@ void PreloaderScene::Load()
ContextOpenWindow(WindowClass::MainWindow);
WindowResizeGui(ContextGetWidth(), ContextGetHeight());
auto intent = Intent(WindowClass::NetworkStatus);
intent.PutExtra(INTENT_EXTRA_MESSAGE, std::string{ "Loading..." });
ContextOpenIntent(&intent);
UpdateCaption(STR_LOADING_GENERIC);
LOG_VERBOSE("PreloaderScene::Load() finished");
}
@ -62,6 +61,15 @@ void PreloaderScene::Tick()
}
}
void PreloaderScene::UpdateCaption(StringId stringId)
{
LOG_VERBOSE("PreloaderScene::UpdateCaption()");
auto intent = Intent(WindowClass::NetworkStatus);
intent.PutExtra(INTENT_EXTRA_MESSAGE, GetContext().GetLocalisationService().GetString(stringId));
ContextOpenIntent(&intent);
};
void PreloaderScene::Stop()
{
Audio::StopAll();

View File

@ -23,6 +23,7 @@ namespace OpenRCT2
void Load() override;
void Tick() override;
void Stop() override;
void UpdateCaption(StringId stringId);
void AddJob(const std::function<void()>& fn)
{
_jobs.AddTask(fn);