mirror of
https://github.com/OpenRCT2/OpenRCT2.git
synced 2025-01-22 10:21:57 -05:00
Open campaign tab from finished campaign news
When a marketing campaign is finished, it is likely the player wants to renew it. This change allows the ‘Campaigns’ tab in the 'Finances' window to be opened from the news item of the finished campaign.
This commit is contained in:
parent
a8499f5010
commit
9688d93e46
13 changed files with 33 additions and 10 deletions
|
@ -13,6 +13,7 @@
|
|||
- Improved: [#18428] [Plugin] Add widget description interfaces to documentation.
|
||||
- Improved: [#18487] Mini Helicopters track can now draw spinning tunnels.
|
||||
- Improved: [#18013, #18016, #18018, #18019, #18514] Added colour presets to Spiral Slide, Dodgems, Boat Hire, Flying Saucers, and Car Ride.
|
||||
- Change: [#17677] Open campaign window from finished campaign news.
|
||||
- Change: [#17998] Show cursor when using inverted mouse dragging.
|
||||
- Change: [#18230] Make the large flat to steep pieces available on the corkscrew roller coaster without cheats.
|
||||
- Change: [#18381] Convert custom invisible paths to the built-in ones.
|
||||
|
|
2
distribution/openrct2.d.ts
vendored
2
distribution/openrct2.d.ts
vendored
|
@ -1915,7 +1915,7 @@ declare global {
|
|||
* The type of park message, including icon and behaviour.
|
||||
*/
|
||||
type ParkMessageType =
|
||||
"attraction" | "peep_on_attraction" | "peep" | "money" | "blank" | "research" | "guests" | "award" | "chart";
|
||||
"attraction" | "peep_on_attraction" | "peep" | "money" | "blank" | "research" | "guests" | "award" | "chart" | "campaign";
|
||||
|
||||
interface ParkMessage {
|
||||
/**
|
||||
|
|
|
@ -174,6 +174,8 @@ public:
|
|||
return WindowChangelogOpen(WV_CHANGELOG);
|
||||
case WV_NEW_VERSION_INFO:
|
||||
return WindowChangelogOpen(WV_NEW_VERSION_INFO);
|
||||
case WV_FINANCE_MARKETING:
|
||||
return WindowFinancesMarketingOpen();
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
|
|
|
@ -1014,6 +1014,16 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
static FinancesWindow* FinancesWindowOpen(uint8_t page)
|
||||
{
|
||||
auto* window = WindowFocusOrCreate<FinancesWindow>(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10);
|
||||
|
||||
if (window != nullptr && page != WINDOW_FINANCES_PAGE_SUMMARY)
|
||||
window->SetPage(page);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
rct_window* WindowFinancesOpen()
|
||||
{
|
||||
return WindowFocusOrCreate<FinancesWindow>(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10);
|
||||
|
@ -1021,10 +1031,10 @@ rct_window* WindowFinancesOpen()
|
|||
|
||||
rct_window* WindowFinancesResearchOpen()
|
||||
{
|
||||
auto* window = WindowFocusOrCreate<FinancesWindow>(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10);
|
||||
|
||||
if (window != nullptr)
|
||||
window->SetPage(WINDOW_FINANCES_PAGE_RESEARCH);
|
||||
|
||||
return window;
|
||||
return FinancesWindowOpen(WINDOW_FINANCES_PAGE_RESEARCH);
|
||||
}
|
||||
|
||||
rct_window* WindowFinancesMarketingOpen()
|
||||
{
|
||||
return FinancesWindowOpen(WINDOW_FINANCES_PAGE_MARKETING);
|
||||
}
|
||||
|
|
|
@ -630,6 +630,7 @@ static void WindowGameBottomToolbarDrawNewsItem(rct_drawpixelinfo* dpi, rct_wind
|
|||
break;
|
||||
}
|
||||
case News::ItemType::Money:
|
||||
case News::ItemType::Campaign:
|
||||
gfx_draw_sprite(dpi, ImageId(SPR_FINANCE), screenCoords);
|
||||
break;
|
||||
case News::ItemType::Research:
|
||||
|
|
|
@ -264,6 +264,7 @@ public:
|
|||
break;
|
||||
}
|
||||
case News::ItemType::Money:
|
||||
case News::ItemType::Campaign:
|
||||
gfx_draw_sprite(&dpi, ImageId(SPR_FINANCE), screenCoords);
|
||||
break;
|
||||
case News::ItemType::Research:
|
||||
|
|
|
@ -79,6 +79,7 @@ rct_window* WindowAssetPacksOpen();
|
|||
// WC_FINANCES
|
||||
rct_window* WindowFinancesOpen();
|
||||
rct_window* WindowFinancesResearchOpen();
|
||||
rct_window* WindowFinancesMarketingOpen();
|
||||
|
||||
// WC_PARK_INFORMATION
|
||||
rct_window* WindowParkAwardsOpen();
|
||||
|
|
|
@ -1828,7 +1828,7 @@ static int32_t cc_add_news_item([[maybe_unused]] InteractiveConsole& console, [[
|
|||
if (argv.size() < 2)
|
||||
{
|
||||
console.WriteLineWarning("Too few arguments");
|
||||
static_assert(News::ItemTypeCount == 10, "News::ItemType::Count changed, update console command!");
|
||||
static_assert(News::ItemTypeCount == 11, "News::ItemType::Count changed, update console command!");
|
||||
console.WriteLine("add_news_item <type> <message> [assoc]");
|
||||
console.WriteLine("type is one of:");
|
||||
console.WriteLine(" 0 (News::ItemType::Null)");
|
||||
|
@ -1841,6 +1841,7 @@ static int32_t cc_add_news_item([[maybe_unused]] InteractiveConsole& console, [[
|
|||
console.WriteLine(" 7 (News::ItemType::Peeps)");
|
||||
console.WriteLine(" 8 (News::ItemType::Award)");
|
||||
console.WriteLine(" 9 (News::ItemType::Graph)");
|
||||
console.WriteLine(" 10 (News::ItemType::Campaign)");
|
||||
console.WriteLine("message is the message to display, wrapped in quotes for multiple words");
|
||||
console.WriteLine("assoc is the associated id of ride/peep/tile/etc. If the selected ItemType doesn't need an assoc "
|
||||
"(Null, Money, Award, Graph), you can leave this field blank");
|
||||
|
|
|
@ -375,6 +375,7 @@ enum
|
|||
WV_EDITOR_BOTTOM_TOOLBAR,
|
||||
WV_CHANGELOG,
|
||||
WV_NEW_VERSION_INFO,
|
||||
WV_FINANCE_MARKETING,
|
||||
};
|
||||
|
||||
enum WindowDetail
|
||||
|
|
|
@ -88,7 +88,7 @@ static void marketing_raise_finished_notification(const MarketingCampaign& campa
|
|||
ft.Add<StringId>(GetShopItemDescriptor(campaign.ShopItemType).Naming.Plural);
|
||||
}
|
||||
|
||||
News::AddItemToQueue(News::ItemType::Money, MarketingCampaignNames[campaign.Type][2], 0, ft);
|
||||
News::AddItemToQueue(News::ItemType::Campaign, MarketingCampaignNames[campaign.Type][2], 0, ft);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -385,6 +385,9 @@ void News::OpenSubject(News::ItemType type, int32_t subject)
|
|||
case News::ItemType::Money:
|
||||
ContextOpenWindow(WindowClass::Finances);
|
||||
break;
|
||||
case News::ItemType::Campaign:
|
||||
ContextOpenWindowView(WV_FINANCE_MARKETING);
|
||||
break;
|
||||
case News::ItemType::Research:
|
||||
{
|
||||
auto item = ResearchItem(subject, ResearchCategory::Transport, 0);
|
||||
|
|
|
@ -36,6 +36,7 @@ namespace News
|
|||
Peeps,
|
||||
Award,
|
||||
Graph,
|
||||
Campaign,
|
||||
Count
|
||||
};
|
||||
|
||||
|
@ -81,6 +82,7 @@ namespace News
|
|||
case News::ItemType::Peeps:
|
||||
case News::ItemType::Award:
|
||||
case News::ItemType::Graph:
|
||||
case News::ItemType::Campaign:
|
||||
return News::ItemTypeProperty::HasSubject;
|
||||
case News::ItemType::Ride:
|
||||
case News::ItemType::PeepOnRide:
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
namespace OpenRCT2::Scripting
|
||||
{
|
||||
static constexpr const char* ParkMessageTypeStrings[] = {
|
||||
"attraction", "peep_on_attraction", "peep", "money", "blank", "research", "guests", "award", "chart",
|
||||
"attraction", "peep_on_attraction", "peep", "money", "blank", "research", "guests", "award", "chart", "campaign",
|
||||
};
|
||||
|
||||
inline News::ItemType GetParkMessageType(const std::string& key)
|
||||
|
|
Loading…
Reference in a new issue