mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2025-12-24 08:12:53 +01:00
Move bottom toolbar to UI module
This commit is contained in:
@@ -141,6 +141,7 @@
|
||||
C6136C551E21893500F3ED2B /* view_clipping.c in Sources */ = {isa = PBXBuildFile; fileRef = C6136C541E21893500F3ED2B /* view_clipping.c */; };
|
||||
C61ADB1F1FB6A0A70024F2EF /* TopToolbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C61ADB1E1FB6A0A60024F2EF /* TopToolbar.cpp */; };
|
||||
C61ADB211FB7DC060024F2EF /* Scenery.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C61ADB201FB7DC060024F2EF /* Scenery.cpp */; };
|
||||
C61ADB231FBBCB8B0024F2EF /* GameBottomToolbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C61ADB221FBBCB8A0024F2EF /* GameBottomToolbar.cpp */; };
|
||||
C61FB2721FA3E25D0095FB9D /* ObjectLoadError.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C61FB2701FA3E25C0095FB9D /* ObjectLoadError.cpp */; };
|
||||
C61FB2731FA3E25D0095FB9D /* TextInput.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C61FB2711FA3E25C0095FB9D /* TextInput.cpp */; };
|
||||
C61FB7241CF86356004CE991 /* NetworkUser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C61FB7221CF86356004CE991 /* NetworkUser.cpp */; };
|
||||
@@ -210,7 +211,6 @@
|
||||
C666EE161F33E3800061AA04 /* EditorBottomToolbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666ED831F33E3520061AA04 /* EditorBottomToolbar.cpp */; };
|
||||
C666EE181F33E3800061AA04 /* EditorMain.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666ED851F33E3520061AA04 /* EditorMain.cpp */; };
|
||||
C666EE1A1F33E3800061AA04 /* EditorObjectSelection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666ED871F33E3520061AA04 /* EditorObjectSelection.cpp */; };
|
||||
C666EE1F1F33E3800061AA04 /* GameBottomToolbar.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666ED8C1F33E3520061AA04 /* GameBottomToolbar.cpp */; };
|
||||
C666EE451F33E3800061AA04 /* TileInspector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EDB21F33E3520061AA04 /* TileInspector.cpp */; };
|
||||
C666EE4D1F33E3800061AA04 /* Tooltip.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EDBA1F33E3520061AA04 /* Tooltip.cpp */; };
|
||||
C666EE6B1F37ACB10061AA04 /* About.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C666EE551F37ACB10061AA04 /* About.cpp */; };
|
||||
@@ -767,6 +767,7 @@
|
||||
C6136C541E21893500F3ED2B /* view_clipping.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = view_clipping.c; sourceTree = "<group>"; };
|
||||
C61ADB1E1FB6A0A60024F2EF /* TopToolbar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TopToolbar.cpp; sourceTree = "<group>"; };
|
||||
C61ADB201FB7DC060024F2EF /* Scenery.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Scenery.cpp; sourceTree = "<group>"; };
|
||||
C61ADB221FBBCB8A0024F2EF /* GameBottomToolbar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GameBottomToolbar.cpp; sourceTree = "<group>"; };
|
||||
C61FB2701FA3E25C0095FB9D /* ObjectLoadError.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ObjectLoadError.cpp; sourceTree = "<group>"; };
|
||||
C61FB2711FA3E25C0095FB9D /* TextInput.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextInput.cpp; sourceTree = "<group>"; };
|
||||
C61FB7221CF86356004CE991 /* NetworkUser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NetworkUser.cpp; sourceTree = "<group>"; usesTabs = 0; };
|
||||
@@ -826,8 +827,6 @@
|
||||
C666ED831F33E3520061AA04 /* EditorBottomToolbar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorBottomToolbar.cpp; sourceTree = "<group>"; };
|
||||
C666ED851F33E3520061AA04 /* EditorMain.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorMain.cpp; sourceTree = "<group>"; };
|
||||
C666ED871F33E3520061AA04 /* EditorObjectSelection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = EditorObjectSelection.cpp; sourceTree = "<group>"; };
|
||||
C666ED8C1F33E3520061AA04 /* GameBottomToolbar.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = GameBottomToolbar.cpp; sourceTree = "<group>"; };
|
||||
C666EDA61F33E3520061AA04 /* RideConstruction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RideConstruction.cpp; sourceTree = "<group>"; };
|
||||
C666EDB21F33E3520061AA04 /* TileInspector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TileInspector.cpp; sourceTree = "<group>"; };
|
||||
C666EDBA1F33E3520061AA04 /* Tooltip.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Tooltip.cpp; sourceTree = "<group>"; };
|
||||
C666EE551F37ACB10061AA04 /* About.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = About.cpp; sourceTree = "<group>"; };
|
||||
@@ -2525,10 +2524,8 @@
|
||||
C666ED831F33E3520061AA04 /* EditorBottomToolbar.cpp */,
|
||||
C666ED851F33E3520061AA04 /* EditorMain.cpp */,
|
||||
C666ED871F33E3520061AA04 /* EditorObjectSelection.cpp */,
|
||||
C666ED8C1F33E3520061AA04 /* GameBottomToolbar.cpp */,
|
||||
C654DF3E1F69C18C0040F43D /* Intent.cpp */,
|
||||
C654DF3F1F69C18C0040F43D /* Intent.h */,
|
||||
C666EDA61F33E3520061AA04 /* RideConstruction.cpp */,
|
||||
F76C854A1EC4E7CD00FA49E2 /* tile_inspector.h */,
|
||||
C666EDB21F33E3520061AA04 /* TileInspector.cpp */,
|
||||
C666EDBA1F33E3520061AA04 /* Tooltip.cpp */,
|
||||
@@ -2695,6 +2692,7 @@
|
||||
C654DF1E1F69C0430040F43D /* Error.cpp */,
|
||||
C654DF1F1F69C0430040F43D /* Finances.cpp */,
|
||||
C64644F21F3FA4120026AC2D /* Footpath.cpp */,
|
||||
C61ADB221FBBCB8A0024F2EF /* GameBottomToolbar.cpp */,
|
||||
C685E5161F8907840090598F /* Guest.cpp */,
|
||||
C654DF201F69C0430040F43D /* GuestList.cpp */,
|
||||
C654DF211F69C0430040F43D /* InstallTrack.cpp */,
|
||||
@@ -3165,6 +3163,7 @@
|
||||
4C93F1411F8B744400A9330D /* HeartlineTwisterCoaster.cpp in Sources */,
|
||||
4C93F1BC1F8E185600A9330D /* Marketing.cpp in Sources */,
|
||||
C666EE791F37ACB10061AA04 /* ServerStart.cpp in Sources */,
|
||||
C61ADB231FBBCB8B0024F2EF /* GameBottomToolbar.cpp in Sources */,
|
||||
C666EE7E1F37ACB10061AA04 /* TitleOptions.cpp in Sources */,
|
||||
4C8B42721EEB1AE400F015CA /* HardwareDisplayDrawingEngine.cpp in Sources */,
|
||||
4C93F1BA1F8E185600A9330D /* Award.cpp in Sources */,
|
||||
@@ -3387,7 +3386,6 @@
|
||||
F76C860B1EC4E88300FA49E2 /* Imaging.cpp in Sources */,
|
||||
F76C860D1EC4E88300FA49E2 /* input.c in Sources */,
|
||||
F76C860F1EC4E88300FA49E2 /* chat.c in Sources */,
|
||||
C666EE1F1F33E3800061AA04 /* GameBottomToolbar.cpp in Sources */,
|
||||
F76C86111EC4E88300FA49E2 /* colour.c in Sources */,
|
||||
F76C86131EC4E88300FA49E2 /* console.c in Sources */,
|
||||
F76C86161EC4E88300FA49E2 /* Fonts.cpp in Sources */,
|
||||
|
||||
@@ -39,6 +39,8 @@ public:
|
||||
{
|
||||
case WC_ABOUT:
|
||||
return window_about_open();
|
||||
case WC_BOTTOM_TOOLBAR:
|
||||
return window_game_bottom_toolbar_open();
|
||||
case WC_CHANGELOG:
|
||||
return window_changelog_open();
|
||||
case WC_CHEATS:
|
||||
@@ -307,6 +309,10 @@ public:
|
||||
case INTENT_ACTION_REFRESH_SCENERY:
|
||||
window_scenery_reset_selected_scenery_items();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_INVALIDATE_TICKER_NEWS:
|
||||
window_game_bottom_toolbar_invalidate_news_item();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -259,7 +259,7 @@ static void shortcut_remove_top_bottom_toolbar_toggle()
|
||||
if (gScreenFlags == 0)
|
||||
{
|
||||
context_open_window(WC_TOP_TOOLBAR);
|
||||
window_game_bottom_toolbar_open();
|
||||
context_open_window(WC_BOTTOM_TOOLBAR);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -14,21 +14,22 @@
|
||||
*****************************************************************************/
|
||||
#pragma endregion
|
||||
|
||||
#include "../config/Config.h"
|
||||
#include "../Context.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../world/Climate.h"
|
||||
#include "../core/Math.hpp"
|
||||
#include <openrct2-ui/windows/Window.h>
|
||||
|
||||
#include "../game.h"
|
||||
#include "../input.h"
|
||||
#include "../interface/themes.h"
|
||||
#include "../interface/widget.h"
|
||||
#include "../localisation/date.h"
|
||||
#include "../localisation/localisation.h"
|
||||
#include "../management/NewsItem.h"
|
||||
#include "../peep/Staff.h"
|
||||
#include "../sprites.h"
|
||||
#include <openrct2/config/Config.h>
|
||||
#include <openrct2/Context.h>
|
||||
#include <openrct2/core/Math.hpp>
|
||||
#include <openrct2/game.h>
|
||||
#include <openrct2/input.h>
|
||||
#include <openrct2/interface/themes.h>
|
||||
#include <openrct2/interface/widget.h>
|
||||
#include <openrct2/localisation/date.h>
|
||||
#include <openrct2/localisation/localisation.h>
|
||||
#include <openrct2/management/NewsItem.h>
|
||||
#include <openrct2/OpenRCT2.h>
|
||||
#include <openrct2/peep/Staff.h>
|
||||
#include <openrct2/sprites.h>
|
||||
#include <openrct2/world/Climate.h>
|
||||
|
||||
enum WINDOW_GAME_BOTTOM_TOOLBAR_WIDGET_IDX {
|
||||
WIDX_LEFT_OUTSET,
|
||||
@@ -125,7 +126,7 @@ static void window_game_bottom_toolbar_invalidate_dirty_widgets(rct_window *w);
|
||||
* Creates the main game bottom toolbar window.
|
||||
* rct2: 0x0066B52F (part of 0x0066B3E8)
|
||||
*/
|
||||
void window_game_bottom_toolbar_open()
|
||||
rct_window * window_game_bottom_toolbar_open()
|
||||
{
|
||||
sint32 screenWidth = context_get_width();
|
||||
sint32 screenHeight = context_get_height();
|
||||
@@ -155,6 +156,8 @@ void window_game_bottom_toolbar_open()
|
||||
// Reset the middle widget to not show by default.
|
||||
// If it is required to be shown news_update will reshow it.
|
||||
window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].type = WWT_EMPTY;
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -146,3 +146,6 @@ bool window_scenery_set_selected_item(sint32 sceneryId);
|
||||
void window_scenery_set_default_placement_configuration();
|
||||
void window_scenery_init();
|
||||
void window_scenery_reset_selected_scenery_items();
|
||||
|
||||
rct_window * window_game_bottom_toolbar_open();
|
||||
void window_game_bottom_toolbar_invalidate_news_item();
|
||||
|
||||
@@ -146,7 +146,7 @@ void game_create_windows()
|
||||
{
|
||||
context_open_window(WC_MAIN_WINDOW);
|
||||
context_open_window(WC_TOP_TOOLBAR);
|
||||
window_game_bottom_toolbar_open();
|
||||
context_open_window(WC_BOTTOM_TOOLBAR);
|
||||
window_resize_gui(context_get_width(), context_get_height());
|
||||
}
|
||||
|
||||
|
||||
@@ -713,8 +713,6 @@ void window_update_viewport_ride_music();
|
||||
void window_relocate_windows(sint32 width, sint32 height);
|
||||
void window_resize_gui(sint32 width, sint32 height);
|
||||
void window_resize_gui_scenario_editor(sint32 width, sint32 height);
|
||||
void window_game_bottom_toolbar_open();
|
||||
void window_game_bottom_toolbar_invalidate_news_item();
|
||||
void window_ride_construct(rct_window *w);
|
||||
void ride_construction_toolupdate_entrance_exit(sint32 screenX, sint32 screenY);
|
||||
void ride_construction_toolupdate_construct(sint32 screenX, sint32 screenY);
|
||||
|
||||
@@ -95,7 +95,8 @@ void news_item_init_queue()
|
||||
gPeepWarningThrottle[i] = 0;
|
||||
}
|
||||
|
||||
window_game_bottom_toolbar_invalidate_news_item();
|
||||
auto intent = Intent(INTENT_ACTION_INVALIDATE_TICKER_NEWS);
|
||||
context_broadcast_intent(&intent);
|
||||
}
|
||||
|
||||
static void news_item_tick_current()
|
||||
@@ -139,7 +140,8 @@ void news_item_update_current()
|
||||
if (news_item_is_queue_empty())
|
||||
return;
|
||||
|
||||
window_game_bottom_toolbar_invalidate_news_item();
|
||||
auto intent = Intent(INTENT_ACTION_INVALIDATE_TICKER_NEWS);
|
||||
context_broadcast_intent(&intent);
|
||||
|
||||
// Update the current news item
|
||||
news_item_tick_current();
|
||||
@@ -183,7 +185,8 @@ void news_item_close_current()
|
||||
newsItems[10].Type = NEWS_ITEM_NULL;
|
||||
|
||||
// Invalidate current news item bar
|
||||
window_game_bottom_toolbar_invalidate_news_item();
|
||||
auto intent = Intent(INTENT_ACTION_INVALIDATE_TICKER_NEWS);
|
||||
context_broadcast_intent(&intent);
|
||||
}
|
||||
|
||||
static void news_item_shift_history_up()
|
||||
@@ -436,7 +439,8 @@ void news_item_disable_news(uint8 type, uint32 assoc)
|
||||
newsItem->Flags |= NEWS_FLAG_HAS_BUTTON;
|
||||
if (i == 0)
|
||||
{
|
||||
window_game_bottom_toolbar_invalidate_news_item();
|
||||
auto intent = Intent(INTENT_ACTION_INVALIDATE_TICKER_NEWS);
|
||||
context_broadcast_intent(&intent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,7 @@ extern "C" {
|
||||
INTENT_ACTION_INIT_SCENERY,
|
||||
INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG,
|
||||
INTENT_ACTION_REFRESH_SCENERY,
|
||||
INTENT_ACTION_INVALIDATE_TICKER_NEWS,
|
||||
};
|
||||
|
||||
Intent *intent_create(rct_windowclass clss);
|
||||
|
||||
Reference in New Issue
Block a user