diff --git a/src/openrct2-ui/windows/GameBottomToolbar.cpp b/src/openrct2-ui/windows/GameBottomToolbar.cpp index e1a0dd6be0..9971599a5f 100644 --- a/src/openrct2-ui/windows/GameBottomToolbar.cpp +++ b/src/openrct2-ui/windows/GameBottomToolbar.cpp @@ -244,12 +244,12 @@ namespace OpenRCT2::Ui::Windows auto screenCoords = windowPos + ScreenCoordsXY{ middleOutsetWidget.midX(), middleOutsetWidget.top + 11 }; int32_t itemWidth = middleOutsetWidget.width() - 62; DrawNewsTicker( - rt, screenCoords, itemWidth, COLOUR_BRIGHT_GREEN, STR_BOTTOM_TOOLBAR_NEWS_TEXT, newsItem->Text, - newsItem->Ticks); + rt, screenCoords, itemWidth, COLOUR_BRIGHT_GREEN, STR_BOTTOM_TOOLBAR_NEWS_TEXT, newsItem->text, + newsItem->ticks); const auto& newsSubjectWidget = widgets[WIDX_NEWS_SUBJECT]; screenCoords = windowPos + ScreenCoordsXY{ newsSubjectWidget.left, newsSubjectWidget.top }; - switch (newsItem->Type) + switch (newsItem->type) { case News::ItemType::Ride: GfxDrawSprite(rt, ImageId(SPR_RIDE), screenCoords); @@ -257,7 +257,7 @@ namespace OpenRCT2::Ui::Windows case News::ItemType::PeepOnRide: case News::ItemType::Peep: { - if (newsItem->HasButton()) + if (newsItem->hasButton()) break; RenderTarget clippedRT; @@ -266,7 +266,7 @@ namespace OpenRCT2::Ui::Windows break; } - auto peep = TryGetEntity(EntityId::FromUnderlying(newsItem->Assoc)); + auto peep = TryGetEntity(EntityId::FromUnderlying(newsItem->assoc)); if (peep == nullptr) return; @@ -325,7 +325,7 @@ namespace OpenRCT2::Ui::Windows GfxDrawSprite(rt, ImageId(SPR_FINANCE), screenCoords); break; case News::ItemType::Research: - GfxDrawSprite(rt, ImageId(newsItem->Assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords); + GfxDrawSprite(rt, ImageId(newsItem->assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords); break; case News::ItemType::Peeps: GfxDrawSprite(rt, ImageId(SPR_GUESTS), screenCoords); @@ -452,7 +452,7 @@ namespace OpenRCT2::Ui::Windows break; case WIDX_NEWS_SUBJECT: newsItem = News::GetItem(0); - News::OpenSubject(newsItem->Type, newsItem->Assoc); + News::OpenSubject(newsItem->type, newsItem->assoc); break; case WIDX_NEWS_LOCATE: if (News::IsQueueEmpty()) @@ -461,7 +461,7 @@ namespace OpenRCT2::Ui::Windows { newsItem = News::GetItem(0); - auto subjectLoc = News::GetSubjectLocation(newsItem->Type, newsItem->Assoc); + auto subjectLoc = News::GetSubjectLocation(newsItem->type, newsItem->assoc); if (!subjectLoc.has_value()) break; @@ -591,18 +591,18 @@ namespace OpenRCT2::Ui::Windows disabled_widgets &= ~(1uLL << WIDX_NEWS_LOCATE); // Find out if the news item is no longer valid - auto subjectLoc = News::GetSubjectLocation(newsItem->Type, newsItem->Assoc); + auto subjectLoc = News::GetSubjectLocation(newsItem->type, newsItem->assoc); if (!subjectLoc.has_value()) disabled_widgets |= (1uLL << WIDX_NEWS_LOCATE); - if (!(newsItem->TypeHasSubject())) + if (!(newsItem->typeHasSubject())) { disabled_widgets |= (1uLL << WIDX_NEWS_SUBJECT); widgets[WIDX_NEWS_SUBJECT].type = WindowWidgetType::Empty; } - if (newsItem->HasButton()) + if (newsItem->hasButton()) { disabled_widgets |= (1uLL << WIDX_NEWS_SUBJECT); disabled_widgets |= (1uLL << WIDX_NEWS_LOCATE); diff --git a/src/openrct2-ui/windows/News.cpp b/src/openrct2-ui/windows/News.cpp index abc8d31cd5..f6718a4713 100644 --- a/src/openrct2-ui/windows/News.cpp +++ b/src/openrct2-ui/windows/News.cpp @@ -102,19 +102,19 @@ namespace OpenRCT2::Ui::Windows } const auto& newsItem = gameState.newsItems.GetArchived()[j]; - if (newsItem.HasButton()) + if (newsItem.hasButton()) { return; } if (_pressedButtonIndex == 1) { - News::OpenSubject(newsItem.Type, newsItem.Assoc); + News::OpenSubject(newsItem.type, newsItem.assoc); } else if (_pressedButtonIndex > 1) { static WindowBase* _mainWindow; - auto subjectLoc = News::GetSubjectLocation(newsItem.Type, newsItem.Assoc); + auto subjectLoc = News::GetSubjectLocation(newsItem.type, newsItem.assoc); if (subjectLoc.has_value() && (_mainWindow = WindowGetMain()) != nullptr) { WindowScrollToLocation(*_mainWindow, subjectLoc.value()); @@ -138,18 +138,18 @@ namespace OpenRCT2::Ui::Windows { if (mutableScreenCoords.y < itemHeight) { - if (newsItem.HasButton() || mutableScreenCoords.y < 14 || mutableScreenCoords.y >= 38 + if (newsItem.hasButton() || mutableScreenCoords.y < 14 || mutableScreenCoords.y >= 38 || mutableScreenCoords.x < 328) { buttonIndex = 0; break; } - if (mutableScreenCoords.x < 351 && newsItem.TypeHasSubject()) + if (mutableScreenCoords.x < 351 && newsItem.typeHasSubject()) { buttonIndex = 1; break; } - if (mutableScreenCoords.x < 376 && newsItem.TypeHasLocation()) + if (mutableScreenCoords.x < 376 && newsItem.typeHasLocation()) { buttonIndex = 2; break; @@ -200,20 +200,20 @@ namespace OpenRCT2::Ui::Windows // Date text { auto ft = Formatter(); - ft.Add(DateDayNames[newsItem.Day - 1]); - ft.Add(DateGameMonthNames[DateGetMonth(newsItem.MonthYear)]); + ft.Add(DateDayNames[newsItem.day - 1]); + ft.Add(DateGameMonthNames[DateGetMonth(newsItem.monthYear)]); DrawTextBasic(rt, { 2, y }, STR_NEWS_DATE_FORMAT, ft, { COLOUR_WHITE, FontStyle::Small }); } // Item text { auto ft = Formatter(); - ft.Add(newsItem.Text.c_str()); + ft.Add(newsItem.text.c_str()); DrawTextWrapped( rt, { 2, y + lineHeight }, 325, STR_BOTTOM_TOOLBAR_NEWS_TEXT, ft, { COLOUR_BRIGHT_GREEN, FontStyle::Small }); } // Subject button - if ((newsItem.TypeHasSubject()) && !(newsItem.HasButton())) + if ((newsItem.typeHasSubject()) && !(newsItem.hasButton())) { auto screenCoords = ScreenCoordsXY{ 328, y + lineHeight + 4 }; @@ -228,7 +228,7 @@ namespace OpenRCT2::Ui::Windows } GfxFillRectInset(rt, { screenCoords, screenCoords + ScreenCoordsXY{ 23, 23 } }, colours[2], press); - switch (newsItem.Type) + switch (newsItem.type) { case News::ItemType::Ride: GfxDrawSprite(rt, ImageId(SPR_RIDE), screenCoords); @@ -242,7 +242,7 @@ namespace OpenRCT2::Ui::Windows break; } - auto peep = TryGetEntity(EntityId::FromUnderlying(newsItem.Assoc)); + auto peep = TryGetEntity(EntityId::FromUnderlying(newsItem.assoc)); if (peep == nullptr) { break; @@ -276,7 +276,7 @@ namespace OpenRCT2::Ui::Windows GfxDrawSprite(rt, ImageId(SPR_FINANCE), screenCoords); break; case News::ItemType::Research: - GfxDrawSprite(rt, ImageId(newsItem.Assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords); + GfxDrawSprite(rt, ImageId(newsItem.assoc < 0x10000 ? SPR_NEW_SCENERY : SPR_NEW_RIDE), screenCoords); break; case News::ItemType::Peeps: GfxDrawSprite(rt, ImageId(SPR_GUESTS), screenCoords); @@ -295,7 +295,7 @@ namespace OpenRCT2::Ui::Windows } // Location button - if ((newsItem.TypeHasLocation()) && !(newsItem.HasButton())) + if ((newsItem.typeHasLocation()) && !(newsItem.hasButton())) { auto screenCoords = ScreenCoordsXY{ 352, y + lineHeight + 4 }; diff --git a/src/openrct2/ReplayManager.cpp b/src/openrct2/ReplayManager.cpp index f9729fc1c6..9d876355ee 100644 --- a/src/openrct2/ReplayManager.cpp +++ b/src/openrct2/ReplayManager.cpp @@ -354,7 +354,7 @@ namespace OpenRCT2 _currentRecording.reset(); News::Item* news = News::AddItemToQueue(News::ItemType::Blank, "Replay recording stopped", 0); - news->SetFlags(News::ItemFlags::HasButton); // Has no subject. + news->setFlags(News::ItemFlags::HasButton); // Has no subject. return result; } @@ -480,7 +480,7 @@ namespace OpenRCT2 if (_mode == ReplayMode::PLAYING) { News::Item* news = News::AddItemToQueue(News::ItemType::Blank, "Replay playback complete", 0); - news->SetFlags(News::ItemFlags::HasButton); // Has no subject. + news->setFlags(News::ItemFlags::HasButton); // Has no subject. } // When normalizing the output we don't touch the mode. diff --git a/src/openrct2/management/NewsItem.cpp b/src/openrct2/management/NewsItem.cpp index 14033d8708..1567663115 100644 --- a/src/openrct2/management/NewsItem.cpp +++ b/src/openrct2/management/NewsItem.cpp @@ -121,7 +121,7 @@ void News::InitQueue(GameState_t& gameState) uint16_t News::ItemQueues::IncrementTicks() { - return ++Current().Ticks; + return ++Current().ticks; } static void TickCurrent() @@ -137,7 +137,7 @@ static void TickCurrent() int32_t News::ItemQueues::RemoveTime() const { - if (!Recent[5].IsEmpty() && !Recent[4].IsEmpty() && !Recent[3].IsEmpty() && !Recent[2].IsEmpty()) + if (!Recent[5].isEmpty() && !Recent[4].isEmpty() && !Recent[3].isEmpty() && !Recent[2].isEmpty()) { return 256; } @@ -146,7 +146,7 @@ int32_t News::ItemQueues::RemoveTime() const bool News::ItemQueues::CurrentShouldBeArchived() const { - return Current().Ticks >= RemoveTime(); + return Current().ticks >= RemoveTime(); } /** @@ -299,7 +299,7 @@ News::Item* News::ItemQueues::FirstOpenOrNewSlot() // The for loop above guarantees there is always an extra element to use assert(Recent.capacity() - Recent.size() >= 2); auto newsItem = res + 1; - newsItem->Type = News::ItemType::Null; + newsItem->type = News::ItemType::Null; return &*res; } @@ -327,13 +327,13 @@ News::Item* News::AddItemToQueue(News::ItemType type, const utf8* text, uint32_t { auto& date = GetDate(); News::Item* newsItem = getGameState().newsItems.FirstOpenOrNewSlot(); - newsItem->Type = type; - newsItem->Flags = 0; - newsItem->Assoc = assoc; // Make optional for Award, Money, Graph and Null - newsItem->Ticks = 0; - newsItem->MonthYear = static_cast(date.GetMonthsElapsed()); - newsItem->Day = date.GetDay() + 1; - newsItem->Text = text; + newsItem->type = type; + newsItem->flags = 0; + newsItem->assoc = assoc; // Make optional for Award, Money, Graph and Null + newsItem->ticks = 0; + newsItem->monthYear = static_cast(date.GetMonthsElapsed()); + newsItem->day = date.GetDay() + 1; + newsItem->text = text; return newsItem; } @@ -439,9 +439,9 @@ void News::DisableNewsItems(News::ItemType type, uint32_t assoc) auto& gameState = getGameState(); // TODO: write test invalidating windows gameState.newsItems.ForeachRecentNews([type, assoc, &gameState](auto& newsItem) { - if (type == newsItem.Type && assoc == newsItem.Assoc) + if (type == newsItem.type && assoc == newsItem.assoc) { - newsItem.SetFlags(News::ItemFlags::HasButton); + newsItem.setFlags(News::ItemFlags::HasButton); if (&newsItem == &gameState.newsItems.Current()) { auto intent = Intent(INTENT_ACTION_INVALIDATE_TICKER_NEWS); @@ -451,9 +451,9 @@ void News::DisableNewsItems(News::ItemType type, uint32_t assoc) }); gameState.newsItems.ForeachArchivedNews([type, assoc](auto& newsItem) { - if (type == newsItem.Type && assoc == newsItem.Assoc) + if (type == newsItem.type && assoc == newsItem.assoc) { - newsItem.SetFlags(News::ItemFlags::HasButton); + newsItem.setFlags(News::ItemFlags::HasButton); auto* windowMgr = Ui::GetWindowManager(); windowMgr->InvalidateByClass(WindowClass::RecentNews); } @@ -473,7 +473,7 @@ void News::RemoveItem(int32_t index) auto& gameState = getGameState(); // News item is already null, no need to remove it - if (gameState.newsItems[index].Type == News::ItemType::Null) + if (gameState.newsItems[index].type == News::ItemType::Null) return; size_t newsBoundary = index < News::ItemHistoryStart ? News::ItemHistoryStart : News::MaxItems; @@ -481,7 +481,7 @@ void News::RemoveItem(int32_t index) { gameState.newsItems[i] = gameState.newsItems[i + 1]; } - gameState.newsItems[newsBoundary - 1].Type = News::ItemType::Null; + gameState.newsItems[newsBoundary - 1].type = News::ItemType::Null; } void News::importNewsItems( diff --git a/src/openrct2/management/NewsItem.h b/src/openrct2/management/NewsItem.h index 4eb89d7fcc..30aa5a542a 100644 --- a/src/openrct2/management/NewsItem.h +++ b/src/openrct2/management/NewsItem.h @@ -64,22 +64,22 @@ namespace OpenRCT2::News */ struct Item { - News::ItemType Type = News::ItemType::Null; - uint8_t Flags{}; - uint32_t Assoc{}; - uint16_t Ticks{}; - uint16_t MonthYear{}; - uint8_t Day{}; - std::string Text{}; + News::ItemType type = News::ItemType::Null; + uint8_t flags{}; + uint32_t assoc{}; + uint16_t ticks{}; + uint16_t monthYear{}; + uint8_t day{}; + std::string text{}; - constexpr bool IsEmpty() const noexcept + constexpr bool isEmpty() const noexcept { - return Type == News::ItemType::Null; + return type == News::ItemType::Null; } - constexpr uint8_t GetTypeProperties() const + constexpr uint8_t getTypeProperties() const { - switch (Type) + switch (type) { case News::ItemType::Blank: return News::ItemTypeProperty::HasLocation; @@ -101,24 +101,24 @@ namespace OpenRCT2::News } } - void SetFlags(uint8_t flag) + void setFlags(uint8_t flag) { - Flags |= flag; + flags |= flag; } - constexpr bool TypeHasSubject() const + constexpr bool typeHasSubject() const { - return this->GetTypeProperties() & News::ItemTypeProperty::HasSubject; + return this->getTypeProperties() & News::ItemTypeProperty::HasSubject; } - constexpr bool TypeHasLocation() const + constexpr bool typeHasLocation() const { - return this->GetTypeProperties() & News::ItemTypeProperty::HasLocation; + return this->getTypeProperties() & News::ItemTypeProperty::HasLocation; } - constexpr bool HasButton() const noexcept + constexpr bool hasButton() const noexcept { - return Flags & News::ItemFlags::HasButton; + return flags & News::ItemFlags::HasButton; } }; @@ -146,7 +146,7 @@ namespace OpenRCT2::News ItemQueue() { - std::get<0>(Queue).Type = News::ItemType::Null; + std::get<0>(Queue).type = News::ItemType::Null; } constexpr iterator begin() noexcept @@ -163,7 +163,7 @@ namespace OpenRCT2::News } iterator end() noexcept { - return std::find_if(std::begin(Queue), std::end(Queue), [](const_reference item) { return item.IsEmpty(); }); + return std::find_if(std::begin(Queue), std::end(Queue), [](const_reference item) { return item.isEmpty(); }); } const_iterator end() const noexcept { @@ -171,12 +171,12 @@ namespace OpenRCT2::News } const_iterator cend() const noexcept { - return std::find_if(std::cbegin(Queue), std::cend(Queue), [](const_reference item) { return item.IsEmpty(); }); + return std::find_if(std::cbegin(Queue), std::cend(Queue), [](const_reference item) { return item.isEmpty(); }); } constexpr bool empty() const noexcept { - return std::get<0>(Queue).IsEmpty(); + return std::get<0>(Queue).isEmpty(); } size_type size() const noexcept @@ -204,7 +204,7 @@ namespace OpenRCT2::News void pop_front() { std::move(std::begin(Queue) + 1, std::end(Queue), std::begin(Queue)); - Queue[N - 1].Type = News::ItemType::Null; + Queue[N - 1].type = News::ItemType::Null; } void push_back(const_reference item) @@ -221,7 +221,7 @@ namespace OpenRCT2::News *it = item; ++it; if (std::distance(it, std::end(Queue))) - it->Type = News::ItemType::Null; + it->type = News::ItemType::Null; } } diff --git a/src/openrct2/park/ParkFile.cpp b/src/openrct2/park/ParkFile.cpp index c12ce4fe3d..b2fa45831a 100644 --- a/src/openrct2/park/ParkFile.cpp +++ b/src/openrct2/park/ParkFile.cpp @@ -1155,20 +1155,20 @@ namespace OpenRCT2 static void ReadWriteNewsItem(OrcaStream::ChunkStream& cs, News::Item& item) { - cs.ReadWrite(item.Type); - cs.ReadWrite(item.Flags); - cs.ReadWrite(item.Assoc); - cs.ReadWrite(item.Ticks); - cs.ReadWrite(item.MonthYear); - cs.ReadWrite(item.Day); + cs.ReadWrite(item.type); + cs.ReadWrite(item.flags); + cs.ReadWrite(item.assoc); + cs.ReadWrite(item.ticks); + cs.ReadWrite(item.monthYear); + cs.ReadWrite(item.day); if (cs.GetMode() == OrcaStream::Mode::READING) { auto s = cs.Read(); - item.Text = s; + item.text = s; } else { - cs.Write(std::string_view(item.Text)); + cs.Write(std::string_view(item.text)); } } diff --git a/src/openrct2/rct1/S4Importer.cpp b/src/openrct2/rct1/S4Importer.cpp index 62fe9d11b1..01f419a8d9 100644 --- a/src/openrct2/rct1/S4Importer.cpp +++ b/src/openrct2/rct1/S4Importer.cpp @@ -2209,25 +2209,25 @@ namespace OpenRCT2::RCT1 if (src.Type == 0) break; - dst.Type = static_cast(src.Type); - dst.Flags = src.Flags; - dst.Ticks = src.Ticks; - dst.MonthYear = src.MonthYear; - dst.Day = src.Day; - dst.Text = ConvertFormattedStringToOpenRCT2(std::string_view(src.Text, sizeof(src.Text))); + dst.type = static_cast(src.Type); + dst.flags = src.Flags; + dst.ticks = src.Ticks; + dst.monthYear = src.MonthYear; + dst.day = src.Day; + dst.text = ConvertFormattedStringToOpenRCT2(std::string_view(src.Text, sizeof(src.Text))); - if (dst.Type == News::ItemType::Research) + if (dst.type == News::ItemType::Research) { uint8_t researchItem = src.Assoc & 0x000000FF; uint8_t researchType = (src.Assoc & 0x00FF0000) >> 16; ::ResearchItem tmpResearchItem = {}; ConvertResearchEntry(&tmpResearchItem, researchItem, researchType); - dst.Assoc = tmpResearchItem.rawValue; + dst.assoc = tmpResearchItem.rawValue; } else { - dst.Assoc = src.Assoc; + dst.assoc = src.Assoc; } output.emplace_back(dst); diff --git a/src/openrct2/rct2/S6Importer.cpp b/src/openrct2/rct2/S6Importer.cpp index 5f9674561a..183d1f659e 100644 --- a/src/openrct2/rct2/S6Importer.cpp +++ b/src/openrct2/rct2/S6Importer.cpp @@ -339,13 +339,13 @@ namespace OpenRCT2::RCT2 } News::Item dst{}; - dst.Type = static_cast(src.Type); - dst.Flags = src.Flags; - dst.Assoc = src.Assoc; - dst.Ticks = src.Ticks; - dst.MonthYear = src.MonthYear; - dst.Day = src.Day; - dst.Text = ConvertFormattedStringToOpenRCT2(std::string_view(src.Text, sizeof(src.Text))); + dst.type = static_cast(src.Type); + dst.flags = src.Flags; + dst.assoc = src.Assoc; + dst.ticks = src.Ticks; + dst.monthYear = src.MonthYear; + dst.day = src.Day; + dst.text = ConvertFormattedStringToOpenRCT2(std::string_view(src.Text, sizeof(src.Text))); output.emplace_back(dst); index++; diff --git a/src/openrct2/scripting/bindings/world/ScPark.cpp b/src/openrct2/scripting/bindings/world/ScPark.cpp index b15336d8a1..cd2b5a6144 100644 --- a/src/openrct2/scripting/bindings/world/ScPark.cpp +++ b/src/openrct2/scripting/bindings/world/ScPark.cpp @@ -370,11 +370,11 @@ namespace OpenRCT2::Scripting // End the lists by setting next item to null if (index < News::ItemHistoryStart) { - gameState.newsItems[index].Type = News::ItemType::Null; + gameState.newsItems[index].type = News::ItemType::Null; } if (archiveIndex < News::MaxItems) { - gameState.newsItems[archiveIndex].Type = News::ItemType::Null; + gameState.newsItems[archiveIndex].type = News::ItemType::Null; } } diff --git a/src/openrct2/scripting/bindings/world/ScParkMessage.cpp b/src/openrct2/scripting/bindings/world/ScParkMessage.cpp index 65f19a4ee4..9a38e6a355 100644 --- a/src/openrct2/scripting/bindings/world/ScParkMessage.cpp +++ b/src/openrct2/scripting/bindings/world/ScParkMessage.cpp @@ -56,7 +56,7 @@ namespace OpenRCT2::Scripting auto msg = GetMessage(); if (msg != nullptr) { - return msg->MonthYear; + return msg->monthYear; } return 0; } @@ -67,7 +67,7 @@ namespace OpenRCT2::Scripting auto msg = GetMessage(); if (msg != nullptr) { - msg->MonthYear = value; + msg->monthYear = value; } } @@ -76,7 +76,7 @@ namespace OpenRCT2::Scripting auto msg = GetMessage(); if (msg != nullptr) { - return msg->Day; + return msg->day; } return 0; } @@ -87,7 +87,7 @@ namespace OpenRCT2::Scripting auto msg = GetMessage(); if (msg != nullptr) { - msg->Day = value; + msg->day = value; } } @@ -96,7 +96,7 @@ namespace OpenRCT2::Scripting auto msg = GetMessage(); if (msg != nullptr) { - return msg->Ticks; + return msg->ticks; } return 0; } @@ -107,7 +107,7 @@ namespace OpenRCT2::Scripting auto msg = GetMessage(); if (msg != nullptr) { - msg->Ticks = value; + msg->ticks = value; } } @@ -116,7 +116,7 @@ namespace OpenRCT2::Scripting auto msg = GetMessage(); if (msg != nullptr) { - return GetParkMessageType(msg->Type); + return GetParkMessageType(msg->type); } return {}; } @@ -127,7 +127,7 @@ namespace OpenRCT2::Scripting auto msg = GetMessage(); if (msg != nullptr) { - msg->Type = GetParkMessageType(value); + msg->type = GetParkMessageType(value); } } @@ -136,7 +136,7 @@ namespace OpenRCT2::Scripting auto msg = GetMessage(); if (msg != nullptr) { - return msg->Assoc; + return msg->assoc; } return 0; } @@ -147,7 +147,7 @@ namespace OpenRCT2::Scripting auto msg = GetMessage(); if (msg != nullptr) { - msg->Assoc = value; + msg->assoc = value; } } @@ -156,7 +156,7 @@ namespace OpenRCT2::Scripting auto msg = GetMessage(); if (msg != nullptr) { - return msg->Text; + return msg->text; } return {}; } @@ -167,7 +167,7 @@ namespace OpenRCT2::Scripting auto msg = GetMessage(); if (msg != nullptr) { - msg->Text = value; + msg->text = value; } } diff --git a/src/openrct2/scripting/bindings/world/ScParkMessage.hpp b/src/openrct2/scripting/bindings/world/ScParkMessage.hpp index 1e86c9cbbd..69f57e4a5a 100644 --- a/src/openrct2/scripting/bindings/world/ScParkMessage.hpp +++ b/src/openrct2/scripting/bindings/world/ScParkMessage.hpp @@ -52,12 +52,12 @@ namespace OpenRCT2::Scripting inline News::Item FromDuk(const DukValue& value) { News::Item result{}; - result.Type = GetParkMessageType(value["type"].as_string()); - result.Assoc = value["subject"].as_uint(); - result.Ticks = value["tickCount"].as_uint(); - result.MonthYear = value["month"].as_uint(); - result.Day = value["day"].as_uint(); - result.Text = value["text"].as_string(); + result.type = GetParkMessageType(value["type"].as_string()); + result.assoc = value["subject"].as_uint(); + result.ticks = value["tickCount"].as_uint(); + result.monthYear = value["month"].as_uint(); + result.day = value["day"].as_uint(); + result.text = value["text"].as_string(); return result; }