1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-24 23:34:37 +01:00

Introduce context functions and intents for progress window

This commit is contained in:
Aaron van Geffen
2024-05-20 16:28:00 +02:00
parent e6fac7f870
commit 539bb5487e
10 changed files with 102 additions and 72 deletions

View File

@@ -269,11 +269,6 @@ public:
return nullptr;
}
case WindowClass::ProgressWindow:
{
std::string message = intent->GetStringExtra(INTENT_EXTRA_MESSAGE);
return ProgressWindowOpen(message);
}
case WindowClass::Ride:
{
const auto rideId = RideId::FromUnderlying(intent->GetSIntExtra(INTENT_EXTRA_RIDE_ID));
@@ -340,6 +335,26 @@ public:
return window;
}
case INTENT_ACTION_PROGRESS_OPEN:
{
std::string message = intent->GetStringExtra(INTENT_EXTRA_MESSAGE);
return ProgressWindowOpen(message);
}
case INTENT_ACTION_PROGRESS_SET:
{
uint32_t currentProgress = intent->GetUIntExtra(INTENT_EXTRA_PROGRESS_OFFSET);
uint32_t totalCount = intent->GetUIntExtra(INTENT_EXTRA_PROGRESS_TOTAL);
ProgressWindowSet(currentProgress, totalCount);
return nullptr;
}
case INTENT_ACTION_PROGRESS_CLOSE:
{
ProgressWindowClose();
return nullptr;
}
case INTENT_ACTION_NULL:
// Intent does not hold an intent action
break;