forked from rosebudai/OpenRCT2-Web
Make rct_windowclass strong type WindowClass
This already revealed some places where implicit conversions were done, including some where its use was nonsense (MouseInput.cpp). The changes to the Intent class were necessary to keep things working, and this splits things up more neatly.
This commit is contained in:
1 parent
ebe38a91ce
commit
7f29e4e39c
145 files changed
+1331
-1235
No files matched your search
@@ -110,7 +110,7 @@ private:
|
||||
|
||||
if (_downloadStatusInfo == DownloadStatusInfo())
|
||||
{
|
||||
context_force_close_window_by_class(WC_NETWORK_STATUS);
|
||||
context_force_close_window_by_class(WindowClass::NetworkStatus);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -133,7 +133,7 @@ private:
|
||||
str_downloading_objects, sizeof(str_downloading_objects), STR_DOWNLOADING_OBJECTS_FROM, ft.Data());
|
||||
}
|
||||
|
||||
auto intent = Intent(WC_NETWORK_STATUS);
|
||||
auto intent = Intent(WindowClass::NetworkStatus);
|
||||
intent.putExtra(INTENT_EXTRA_MESSAGE, std::string(str_downloading_objects));
|
||||
intent.putExtra(INTENT_EXTRA_CALLBACK, []() -> void { _downloadingObjects = false; });
|
||||
context_open_intent(&intent);
|
||||
@@ -564,10 +564,10 @@ public:
|
||||
rct_window* WindowObjectLoadErrorOpen(utf8* path, size_t numMissingObjects, const ObjectEntryDescriptor* missingObjects)
|
||||
{
|
||||
// Check if window is already open
|
||||
auto* window = window_bring_to_front_by_class(WC_OBJECT_LOAD_ERROR);
|
||||
auto* window = window_bring_to_front_by_class(WindowClass::ObjectLoadError);
|
||||
if (window == nullptr)
|
||||
{
|
||||
window = WindowCreate<ObjectLoadErrorWindow>(WC_OBJECT_LOAD_ERROR, WW, WH, 0);
|
||||
window = WindowCreate<ObjectLoadErrorWindow>(WindowClass::ObjectLoadError, WW, WH, 0);
|
||||
}
|
||||
|
||||
static_cast<ObjectLoadErrorWindow*>(window)->Initialise(path, numMissingObjects, missingObjects);
|
||||
|
||||
Reference in new issue
Block a user