You've already forked OpenRCT2-Unity
mirror of
https://github.com/izzy2lost/OpenRCT2-Unity.git
synced 2026-03-10 12:38:22 -07:00
Clang tidy Part 1: Ui Project Function Names (#15956)
* Add NOLINT around STL using classes and vendor functions * Apply clang-tidy to ui project function names * Undo scripting clang-format * Upper case OpenRCT2 and RCT2
This commit is contained in:
@@ -40,36 +40,36 @@ void CursorRepository::SetCurrentCursor(CursorID cursorId)
|
||||
{
|
||||
if (_currentCursor != cursorId)
|
||||
{
|
||||
SDL_Cursor* cursor = _scaledCursors.at(_currentCursorScale).getScaledCursor(cursorId);
|
||||
SDL_Cursor* cursor = _scaledCursors.at(_currentCursorScale).GetScaledCursor(cursorId);
|
||||
SDL_SetCursor(cursor);
|
||||
_currentCursor = cursorId;
|
||||
}
|
||||
}
|
||||
|
||||
static bool getBit(const uint8_t data[], size_t x, size_t y, size_t width) noexcept
|
||||
static bool GetBit(const uint8_t data[], size_t x, size_t y, size_t width) noexcept
|
||||
{
|
||||
const size_t position = y * width + x;
|
||||
return (data[position / 8] & (1 << (7 - (x % 8)))) != 0;
|
||||
}
|
||||
|
||||
static void setBit(uint8_t data[], size_t x, size_t y, size_t width) noexcept
|
||||
static void SetBit(uint8_t data[], size_t x, size_t y, size_t width) noexcept
|
||||
{
|
||||
size_t position = y * width + x;
|
||||
data[position / 8] |= (1 << (7 - (position % 8)));
|
||||
}
|
||||
|
||||
static void drawRect(uint8_t data[], size_t x, size_t y, size_t width, size_t scale) noexcept
|
||||
static void DrawRect(uint8_t data[], size_t x, size_t y, size_t width, size_t scale) noexcept
|
||||
{
|
||||
for (size_t outY = (y * scale); outY < ((1 + y) * scale); outY++)
|
||||
{
|
||||
for (size_t outX = (x * scale); outX < ((1 + x) * scale); outX++)
|
||||
{
|
||||
setBit(data, outX, outY, width * scale);
|
||||
SetBit(data, outX, outY, width * scale);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static std::vector<uint8_t> scaleDataArray(const uint8_t data[], size_t width, size_t height, size_t scale)
|
||||
static std::vector<uint8_t> ScaleDataArray(const uint8_t data[], size_t width, size_t height, size_t scale)
|
||||
{
|
||||
const size_t length = width * height;
|
||||
|
||||
@@ -80,11 +80,11 @@ static std::vector<uint8_t> scaleDataArray(const uint8_t data[], size_t width, s
|
||||
{
|
||||
for (size_t x = 0; x < width; x++)
|
||||
{
|
||||
const bool value = getBit(data, x, y, width);
|
||||
const bool value = GetBit(data, x, y, width);
|
||||
if (!value)
|
||||
continue;
|
||||
|
||||
drawRect(res.data(), x, y, width, scale);
|
||||
DrawRect(res.data(), x, y, width, scale);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,8 +95,8 @@ SDL_Cursor* CursorRepository::Create(const CursorData* cursorInfo, uint8_t scale
|
||||
{
|
||||
const auto integer_scale = static_cast<int>(round(scale));
|
||||
|
||||
auto data = scaleDataArray(cursorInfo->Data, CURSOR_BIT_WIDTH, CURSOR_HEIGHT, static_cast<size_t>(integer_scale));
|
||||
auto mask = scaleDataArray(cursorInfo->Mask, CURSOR_BIT_WIDTH, CURSOR_HEIGHT, static_cast<size_t>(integer_scale));
|
||||
auto data = ScaleDataArray(cursorInfo->Data, CURSOR_BIT_WIDTH, CURSOR_HEIGHT, static_cast<size_t>(integer_scale));
|
||||
auto mask = ScaleDataArray(cursorInfo->Mask, CURSOR_BIT_WIDTH, CURSOR_HEIGHT, static_cast<size_t>(integer_scale));
|
||||
|
||||
auto* cursor = SDL_CreateCursor(
|
||||
data.data(), mask.data(), BASE_CURSOR_WIDTH * integer_scale, BASE_CURSOR_HEIGHT * integer_scale,
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace OpenRCT2::Ui
|
||||
}
|
||||
}
|
||||
|
||||
SDL_Cursor* getScaledCursor(CursorID cursorId)
|
||||
SDL_Cursor* GetScaledCursor(CursorID cursorId)
|
||||
{
|
||||
return _cursors[EnumValue(cursorId)];
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ using namespace OpenRCT2;
|
||||
using namespace OpenRCT2::Audio;
|
||||
using namespace OpenRCT2::Ui;
|
||||
|
||||
template<typename T> static std::shared_ptr<T> to_shared(std::unique_ptr<T>&& src)
|
||||
template<typename T> static std::shared_ptr<T> ToShared(std::unique_ptr<T>&& src)
|
||||
{
|
||||
return std::shared_ptr<T>(std::move(src));
|
||||
}
|
||||
@@ -54,9 +54,9 @@ int main(int argc, const char** argv)
|
||||
else
|
||||
{
|
||||
// Run OpenRCT2 with a UI context
|
||||
auto env = to_shared(CreatePlatformEnvironment());
|
||||
auto audioContext = to_shared(CreateAudioContext());
|
||||
auto uiContext = to_shared(CreateUiContext(env));
|
||||
auto env = ToShared(CreatePlatformEnvironment());
|
||||
auto audioContext = ToShared(CreateAudioContext());
|
||||
auto uiContext = ToShared(CreateUiContext(env));
|
||||
context = CreateContext(env, audioContext, uiContext);
|
||||
}
|
||||
rc = context->RunOpenRCT2(argc, argv);
|
||||
|
||||
@@ -32,7 +32,7 @@ public:
|
||||
void Init() override
|
||||
{
|
||||
ThemeManagerInitialise();
|
||||
window_new_ride_init_vars();
|
||||
WindowNewRideInitVars();
|
||||
}
|
||||
|
||||
rct_window* OpenWindow(rct_windowclass wc) override
|
||||
@@ -40,97 +40,97 @@ public:
|
||||
switch (wc)
|
||||
{
|
||||
case WC_ABOUT:
|
||||
return window_about_open();
|
||||
return WindowAboutOpen();
|
||||
case WC_BOTTOM_TOOLBAR:
|
||||
return window_game_bottom_toolbar_open();
|
||||
return WindowGameBottomToolbarOpen();
|
||||
case WC_CHANGELOG:
|
||||
return OpenView(WV_CHANGELOG);
|
||||
case WC_CHEATS:
|
||||
return window_cheats_open();
|
||||
return WindowCheatsOpen();
|
||||
case WC_CLEAR_SCENERY:
|
||||
return window_clear_scenery_open();
|
||||
return WindowClearSceneryOpen();
|
||||
case WC_CUSTOM_CURRENCY_CONFIG:
|
||||
return custom_currency_window_open();
|
||||
return CustomCurrencyWindowOpen();
|
||||
case WC_DEBUG_PAINT:
|
||||
return window_debug_paint_open();
|
||||
return WindowDebugPaintOpen();
|
||||
case WC_EDITOR_INVENTION_LIST:
|
||||
return window_editor_inventions_list_open();
|
||||
return WindowEditorInventionsListOpen();
|
||||
case WC_EDITOR_OBJECT_SELECTION:
|
||||
return window_editor_object_selection_open();
|
||||
return WindowEditorObjectSelectionOpen();
|
||||
case WC_EDITOR_OBJECTIVE_OPTIONS:
|
||||
return window_editor_objective_options_open();
|
||||
return WindowEditorObjectiveOptionsOpen();
|
||||
case WC_EDITOR_SCENARIO_OPTIONS:
|
||||
return window_editor_scenario_options_open();
|
||||
return WindowEditorScenarioOptionsOpen();
|
||||
case WC_FINANCES:
|
||||
return window_finances_open();
|
||||
return WindowFinancesOpen();
|
||||
case WC_FOOTPATH:
|
||||
return window_footpath_open();
|
||||
return WindowFootpathOpen();
|
||||
case WC_GUEST_LIST:
|
||||
return window_guest_list_open();
|
||||
return WindowGuestListOpen();
|
||||
case WC_LAND:
|
||||
return window_land_open();
|
||||
return WindowLandOpen();
|
||||
case WC_LAND_RIGHTS:
|
||||
return window_land_rights_open();
|
||||
return WindowLandRightsOpen();
|
||||
case WC_MAIN_WINDOW:
|
||||
return window_main_open();
|
||||
return WindowMainOpen();
|
||||
case WC_MAP:
|
||||
return window_map_open();
|
||||
return WindowMapOpen();
|
||||
case WC_MAPGEN:
|
||||
return window_mapgen_open();
|
||||
return WindowMapgenOpen();
|
||||
case WC_MULTIPLAYER:
|
||||
return window_multiplayer_open();
|
||||
return WindowMultiplayerOpen();
|
||||
case WC_CONSTRUCT_RIDE:
|
||||
return window_new_ride_open();
|
||||
return WindowNewRideOpen();
|
||||
case WC_PARK_INFORMATION:
|
||||
return window_park_entrance_open();
|
||||
return WindowParkEntranceOpen();
|
||||
case WC_RECENT_NEWS:
|
||||
return window_news_open();
|
||||
return WindowNewsOpen();
|
||||
case WC_RIDE_CONSTRUCTION:
|
||||
return window_ride_construction_open();
|
||||
return WindowRideConstructionOpen();
|
||||
case WC_RESEARCH:
|
||||
return window_research_open();
|
||||
return WindowResearchOpen();
|
||||
case WC_RIDE_LIST:
|
||||
return window_ride_list_open();
|
||||
return WindowRideListOpen();
|
||||
case WC_NOTIFICATION_OPTIONS:
|
||||
return window_news_options_open();
|
||||
return WindowNewsOptionsOpen();
|
||||
case WC_OPTIONS:
|
||||
return window_options_open();
|
||||
return WindowOptionsOpen();
|
||||
case WC_SAVE_PROMPT:
|
||||
return window_save_prompt_open();
|
||||
return WindowSavePromptOpen();
|
||||
case WC_SCENERY:
|
||||
return window_scenery_open();
|
||||
return WindowSceneryOpen();
|
||||
case WC_SCENERY_SCATTER:
|
||||
return window_scenery_scatter_open();
|
||||
return WindowSceneryScatterOpen();
|
||||
#ifndef DISABLE_NETWORK
|
||||
case WC_SERVER_LIST:
|
||||
return window_server_list_open();
|
||||
return WindowServerListOpen();
|
||||
case WC_SERVER_START:
|
||||
return window_server_start_open();
|
||||
return WindowServerStartOpen();
|
||||
#endif
|
||||
case WC_KEYBOARD_SHORTCUT_LIST:
|
||||
return window_shortcut_keys_open();
|
||||
return WindowShortcutKeysOpen();
|
||||
case WC_STAFF_LIST:
|
||||
return window_staff_list_open();
|
||||
return WindowStaffListOpen();
|
||||
case WC_THEMES:
|
||||
return window_themes_open();
|
||||
return WindowThemesOpen();
|
||||
case WC_TILE_INSPECTOR:
|
||||
return window_tile_inspector_open();
|
||||
return WindowTileInspectorOpen();
|
||||
case WC_TITLE_EXIT:
|
||||
return window_title_exit_open();
|
||||
return WindowTitleExitOpen();
|
||||
case WC_TITLE_LOGO:
|
||||
return window_title_logo_open();
|
||||
return WindowTitleLogoOpen();
|
||||
case WC_TITLE_MENU:
|
||||
return window_title_menu_open();
|
||||
return WindowTitleMenuOpen();
|
||||
case WC_TITLE_OPTIONS:
|
||||
return window_title_options_open();
|
||||
return WindowTitleOptionsOpen();
|
||||
case WC_TOP_TOOLBAR:
|
||||
return window_top_toolbar_open();
|
||||
return WindowTopToolbarOpen();
|
||||
case WC_VIEW_CLIPPING:
|
||||
return window_view_clipping_open();
|
||||
return WindowViewClippingOpen();
|
||||
case WC_VIEWPORT:
|
||||
return window_viewport_open();
|
||||
return WindowViewportOpen();
|
||||
case WC_WATER:
|
||||
return window_water_open();
|
||||
return WindowWaterOpen();
|
||||
default:
|
||||
Console::Error::WriteLine("Unhandled window class (%d)", wc);
|
||||
return nullptr;
|
||||
@@ -142,33 +142,33 @@ public:
|
||||
switch (view)
|
||||
{
|
||||
case WV_PARK_AWARDS:
|
||||
return window_park_awards_open();
|
||||
return WindowParkAwardsOpen();
|
||||
case WV_PARK_RATING:
|
||||
return window_park_rating_open();
|
||||
return WindowParkRatingOpen();
|
||||
case WV_PARK_OBJECTIVE:
|
||||
return window_park_objective_open();
|
||||
return WindowParkObjectiveOpen();
|
||||
case WV_PARK_GUESTS:
|
||||
return window_park_guests_open();
|
||||
return WindowParkGuestsOpen();
|
||||
case WV_FINANCES_RESEARCH:
|
||||
return window_finances_research_open();
|
||||
return WindowFinancesResearchOpen();
|
||||
case WV_RIDE_RESEARCH:
|
||||
if (gConfigInterface.toolbar_show_research)
|
||||
{
|
||||
return this->OpenWindow(WC_RESEARCH);
|
||||
}
|
||||
return window_new_ride_open_research();
|
||||
return WindowNewRideOpenResearch();
|
||||
case WV_MAZE_CONSTRUCTION:
|
||||
return window_maze_construction_open();
|
||||
return WindowMazeConstructionOpen();
|
||||
case WV_NETWORK_PASSWORD:
|
||||
return window_network_status_open_password();
|
||||
return WindowNetworkStatusOpenPassword();
|
||||
case WV_EDITOR_BOTTOM_TOOLBAR:
|
||||
return window_editor_bottom_toolbar_open();
|
||||
return WindowEditorBottomToolbarOpen();
|
||||
case WV_EDITOR_MAIN:
|
||||
return window_editor_main_open();
|
||||
return WindowEditorMainOpen();
|
||||
case WV_CHANGELOG:
|
||||
return window_changelog_open(WV_CHANGELOG);
|
||||
return WindowChangelogOpen(WV_CHANGELOG);
|
||||
case WV_NEW_VERSION_INFO:
|
||||
return window_changelog_open(WV_NEW_VERSION_INFO);
|
||||
return WindowChangelogOpen(WV_NEW_VERSION_INFO);
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
@@ -179,20 +179,20 @@ public:
|
||||
switch (type)
|
||||
{
|
||||
case WD_BANNER:
|
||||
return window_banner_open(id);
|
||||
return WindowBannerOpen(id);
|
||||
case WD_DEMOLISH_RIDE:
|
||||
return window_ride_demolish_prompt_open(get_ride(static_cast<ride_id_t>(id)));
|
||||
return WindowRideDemolishPromptOpen(get_ride(static_cast<ride_id_t>(id)));
|
||||
case WD_REFURBISH_RIDE:
|
||||
return window_ride_refurbish_prompt_open(get_ride(static_cast<ride_id_t>(id)));
|
||||
return WindowRideRefurbishPromptOpen(get_ride(static_cast<ride_id_t>(id)));
|
||||
case WD_NEW_CAMPAIGN:
|
||||
return window_new_campaign_open(id);
|
||||
return WindowNewCampaignOpen(id);
|
||||
case WD_SIGN:
|
||||
return window_sign_open(id);
|
||||
return WindowSignOpen(id);
|
||||
case WD_SIGN_SMALL:
|
||||
return window_sign_small_open(id);
|
||||
return WindowSignSmallOpen(id);
|
||||
|
||||
case WD_PLAYER:
|
||||
return window_player_open(id);
|
||||
return WindowPlayerOpen(id);
|
||||
|
||||
default:
|
||||
return nullptr;
|
||||
@@ -201,12 +201,12 @@ public:
|
||||
|
||||
rct_window* ShowError(rct_string_id title, rct_string_id message, const Formatter& args) override
|
||||
{
|
||||
return window_error_open(title, message, args);
|
||||
return WindowErrorOpen(title, message, args);
|
||||
}
|
||||
|
||||
rct_window* ShowError(std::string_view title, std::string_view message) override
|
||||
{
|
||||
return window_error_open(title, message);
|
||||
return WindowErrorOpen(title, message);
|
||||
}
|
||||
|
||||
rct_window* OpenIntent(Intent* intent) override
|
||||
@@ -214,13 +214,13 @@ public:
|
||||
switch (intent->GetWindowClass())
|
||||
{
|
||||
case WC_PEEP:
|
||||
return window_guest_open(static_cast<Peep*>(intent->GetPointerExtra(INTENT_EXTRA_PEEP)));
|
||||
return WindowGuestOpen(static_cast<Peep*>(intent->GetPointerExtra(INTENT_EXTRA_PEEP)));
|
||||
case WC_FIRE_PROMPT:
|
||||
return window_staff_fire_prompt_open(static_cast<Peep*>(intent->GetPointerExtra(INTENT_EXTRA_PEEP)));
|
||||
return WindowStaffFirePromptOpen(static_cast<Peep*>(intent->GetPointerExtra(INTENT_EXTRA_PEEP)));
|
||||
case WC_INSTALL_TRACK:
|
||||
return window_install_track_open(intent->GetStringExtra(INTENT_EXTRA_PATH).c_str());
|
||||
return WindowInstallTrackOpen(intent->GetStringExtra(INTENT_EXTRA_PATH).c_str());
|
||||
case WC_GUEST_LIST:
|
||||
return window_guest_list_open_with_filter(
|
||||
return WindowGuestListOpenWithFilter(
|
||||
static_cast<GuestListFilterType>(intent->GetSIntExtra(INTENT_EXTRA_GUEST_LIST_FILTER)),
|
||||
intent->GetSIntExtra(INTENT_EXTRA_RIDE_ID));
|
||||
case WC_LOADSAVE:
|
||||
@@ -230,7 +230,7 @@ public:
|
||||
loadsave_callback callback = reinterpret_cast<loadsave_callback>(
|
||||
intent->GetPointerExtra(INTENT_EXTRA_CALLBACK));
|
||||
TrackDesign* trackDesign = static_cast<TrackDesign*>(intent->GetPointerExtra(INTENT_EXTRA_TRACK_DESIGN));
|
||||
auto* w = window_loadsave_open(
|
||||
auto* w = WindowLoadsaveOpen(
|
||||
type, defaultName,
|
||||
[callback](int32_t result, std::string_view path) {
|
||||
if (callback != nullptr)
|
||||
@@ -242,20 +242,20 @@ public:
|
||||
return w;
|
||||
}
|
||||
case WC_MANAGE_TRACK_DESIGN:
|
||||
return window_track_manage_open(
|
||||
return WindowTrackManageOpen(
|
||||
static_cast<track_design_file_ref*>(intent->GetPointerExtra(INTENT_EXTRA_TRACK_DESIGN)));
|
||||
case WC_NETWORK_STATUS:
|
||||
{
|
||||
std::string message = intent->GetStringExtra(INTENT_EXTRA_MESSAGE);
|
||||
close_callback callback = intent->GetCloseCallbackExtra(INTENT_EXTRA_CALLBACK);
|
||||
return window_network_status_open(message.c_str(), callback);
|
||||
return WindowNetworkStatusOpen(message.c_str(), callback);
|
||||
}
|
||||
case WC_OBJECT_LOAD_ERROR:
|
||||
{
|
||||
std::string path = intent->GetStringExtra(INTENT_EXTRA_PATH);
|
||||
auto objects = static_cast<const ObjectEntryDescriptor*>(intent->GetPointerExtra(INTENT_EXTRA_LIST));
|
||||
size_t count = intent->GetUIntExtra(INTENT_EXTRA_LIST_COUNT);
|
||||
window_object_load_error_open(const_cast<utf8*>(path.c_str()), count, objects);
|
||||
WindowObjectLoadErrorOpen(const_cast<utf8*>(path.c_str()), count, objects);
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
@@ -263,35 +263,35 @@ public:
|
||||
{
|
||||
const auto rideId = static_cast<ride_id_t>(intent->GetSIntExtra(INTENT_EXTRA_RIDE_ID));
|
||||
auto ride = get_ride(rideId);
|
||||
return ride == nullptr ? nullptr : window_ride_main_open(ride);
|
||||
return ride == nullptr ? nullptr : WindowRideMainOpen(ride);
|
||||
}
|
||||
case WC_TRACK_DESIGN_PLACE:
|
||||
return window_track_place_open(
|
||||
return WindowTrackPlaceOpen(
|
||||
static_cast<track_design_file_ref*>(intent->GetPointerExtra(INTENT_EXTRA_TRACK_DESIGN)));
|
||||
case WC_TRACK_DESIGN_LIST:
|
||||
{
|
||||
RideSelection rideItem;
|
||||
rideItem.Type = intent->GetUIntExtra(INTENT_EXTRA_RIDE_TYPE);
|
||||
rideItem.EntryIndex = intent->GetUIntExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX);
|
||||
return window_track_list_open(rideItem);
|
||||
return WindowTrackListOpen(rideItem);
|
||||
}
|
||||
case WC_SCENARIO_SELECT:
|
||||
return window_scenarioselect_open(
|
||||
return WindowScenarioselectOpen(
|
||||
reinterpret_cast<scenarioselect_callback>(intent->GetPointerExtra(INTENT_EXTRA_CALLBACK)), false);
|
||||
case WD_VEHICLE:
|
||||
return window_ride_open_vehicle(static_cast<Vehicle*>(intent->GetPointerExtra(INTENT_EXTRA_VEHICLE)));
|
||||
return WindowRideOpenVehicle(static_cast<Vehicle*>(intent->GetPointerExtra(INTENT_EXTRA_VEHICLE)));
|
||||
case WD_TRACK:
|
||||
return window_ride_open_track(static_cast<TileElement*>(intent->GetPointerExtra(INTENT_EXTRA_TILE_ELEMENT)));
|
||||
return WindowRideOpenTrack(static_cast<TileElement*>(intent->GetPointerExtra(INTENT_EXTRA_TILE_ELEMENT)));
|
||||
case INTENT_ACTION_NEW_RIDE_OF_TYPE:
|
||||
{
|
||||
// Open ride list window
|
||||
auto w = window_new_ride_open();
|
||||
auto w = WindowNewRideOpen();
|
||||
|
||||
// Switch to right tab and scroll to ride location
|
||||
RideSelection rideItem;
|
||||
rideItem.Type = intent->GetUIntExtra(INTENT_EXTRA_RIDE_TYPE);
|
||||
rideItem.EntryIndex = intent->GetUIntExtra(INTENT_EXTRA_RIDE_ENTRY_INDEX);
|
||||
window_new_ride_focus(rideItem);
|
||||
WindowNewRideFocus(rideItem);
|
||||
|
||||
return w;
|
||||
}
|
||||
@@ -306,11 +306,11 @@ public:
|
||||
switch (intent.GetWindowClass())
|
||||
{
|
||||
case INTENT_ACTION_MAP:
|
||||
window_map_reset();
|
||||
WindowMapReset();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_REFRESH_NEW_RIDES:
|
||||
window_new_ride_init_vars();
|
||||
WindowNewRideInitVars();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_REFRESH_CAMPAIGN_RIDE_LIST:
|
||||
@@ -324,14 +324,14 @@ public:
|
||||
auto window = window_find_by_class(WC_RIDE_LIST);
|
||||
if (window != nullptr)
|
||||
{
|
||||
window_ride_list_refresh_list(window);
|
||||
WindowRideListRefreshList(window);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case INTENT_ACTION_UPDATE_MAZE_CONSTRUCTION:
|
||||
window_maze_construction_update_pressed_widgets();
|
||||
WindowMazeConstructionUpdatePressedWidgets();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_RIDE_CONSTRUCTION_FOCUS:
|
||||
@@ -353,31 +353,31 @@ public:
|
||||
}
|
||||
|
||||
case INTENT_ACTION_RIDE_CONSTRUCTION_UPDATE_PIECES:
|
||||
window_ride_construction_update_enabled_track_pieces();
|
||||
WindowRideConstructionUpdateEnabledTrackPieces();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_RIDE_CONSTRUCTION_UPDATE_ACTIVE_ELEMENTS:
|
||||
window_ride_construction_update_active_elements_impl();
|
||||
WindowRideConstructionUpdateActiveElementsImpl();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_INIT_SCENERY:
|
||||
window_scenery_init();
|
||||
WindowSceneryInit();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_SET_DEFAULT_SCENERY_CONFIG:
|
||||
window_scenery_set_default_placement_configuration();
|
||||
WindowScenerySetDefaultPlacementConfiguration();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_REFRESH_SCENERY:
|
||||
window_scenery_reset_selected_scenery_items();
|
||||
WindowSceneryResetSelectedSceneryItems();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_INVALIDATE_TICKER_NEWS:
|
||||
window_game_bottom_toolbar_invalidate_news_item();
|
||||
WindowGameBottomToolbarInvalidateNewsItem();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_REFRESH_GUEST_LIST:
|
||||
window_guest_list_refresh_list();
|
||||
WindowGuestListRefreshList();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_REFRESH_STAFF_LIST:
|
||||
@@ -387,7 +387,7 @@ public:
|
||||
}
|
||||
|
||||
case INTENT_ACTION_CLEAR_TILE_INSPECTOR_CLIPBOARD:
|
||||
window_tile_inspector_clear_clipboard();
|
||||
WindowTileInspectorClearClipboard();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_INVALIDATE_VEHICLE_WINDOW:
|
||||
@@ -433,7 +433,7 @@ public:
|
||||
gToolbarDirtyFlags |= BTM_TB_DIRTY_FLAG_PEEP_COUNT;
|
||||
window_invalidate_by_class(WC_GUEST_LIST);
|
||||
window_invalidate_by_class(WC_PARK_INFORMATION);
|
||||
window_guest_list_refresh_list();
|
||||
WindowGuestListRefreshList();
|
||||
break;
|
||||
|
||||
case INTENT_ACTION_UPDATE_PARK_RATING:
|
||||
@@ -491,7 +491,7 @@ public:
|
||||
switch (windowClass)
|
||||
{
|
||||
case WC_NETWORK_STATUS:
|
||||
window_network_status_close();
|
||||
WindowNetworkStatusClose();
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -501,7 +501,7 @@ public:
|
||||
|
||||
void UpdateMapTooltip() override
|
||||
{
|
||||
window_map_tooltip_update_visibility();
|
||||
WindowMapTooltipUpdateVisibility();
|
||||
}
|
||||
|
||||
void HandleInput() override
|
||||
|
||||
@@ -27,15 +27,16 @@ public:
|
||||
: _numInstances(0)
|
||||
{
|
||||
}
|
||||
[[nodiscard]] bool empty() const
|
||||
|
||||
[[nodiscard]] bool empty() const // NOLINT(readability-identifier-naming)
|
||||
{
|
||||
return _numInstances == 0;
|
||||
}
|
||||
void clear()
|
||||
void clear() // NOLINT(readability-identifier-naming)
|
||||
{
|
||||
_numInstances = 0;
|
||||
}
|
||||
T& allocate()
|
||||
T& allocate() // NOLINT(readability-identifier-naming)
|
||||
{
|
||||
if (_numInstances + 1 > _instances.size())
|
||||
{
|
||||
@@ -43,7 +44,7 @@ public:
|
||||
}
|
||||
return _instances[_numInstances++];
|
||||
}
|
||||
T& insert(const T& value)
|
||||
T& insert(const T& value) // NOLINT(readability-identifier-naming)
|
||||
{
|
||||
if (_numInstances + 1 > _instances.size())
|
||||
{
|
||||
@@ -51,11 +52,11 @@ public:
|
||||
}
|
||||
return _instances[_numInstances++] = value;
|
||||
}
|
||||
[[nodiscard]] size_t size() const
|
||||
[[nodiscard]] size_t size() const // NOLINT(readability-identifier-naming)
|
||||
{
|
||||
return _numInstances;
|
||||
}
|
||||
const T* data() const
|
||||
const T* data() const // NOLINT(readability-identifier-naming)
|
||||
{
|
||||
return _instances.data();
|
||||
}
|
||||
@@ -64,27 +65,27 @@ public:
|
||||
return _instances.at(idx);
|
||||
}
|
||||
|
||||
typename std::vector<T>::iterator begin()
|
||||
typename std::vector<T>::iterator begin() // NOLINT(readability-identifier-naming)
|
||||
{
|
||||
return _instances.begin();
|
||||
}
|
||||
typename std::vector<T>::const_iterator begin() const
|
||||
typename std::vector<T>::const_iterator begin() const // NOLINT(readability-identifier-naming)
|
||||
{
|
||||
return _instances.cbegin();
|
||||
}
|
||||
typename std::vector<T>::const_iterator cbegin() const
|
||||
typename std::vector<T>::const_iterator cbegin() const // NOLINT(readability-identifier-naming)
|
||||
{
|
||||
return _instances.cbegin();
|
||||
}
|
||||
typename std::vector<T>::iterator end()
|
||||
typename std::vector<T>::iterator end() // NOLINT(readability-identifier-naming)
|
||||
{
|
||||
return _instances.begin() + _numInstances;
|
||||
}
|
||||
typename std::vector<T>::const_iterator end() const
|
||||
typename std::vector<T>::const_iterator end() const // NOLINT(readability-identifier-naming)
|
||||
{
|
||||
return _instances.cbegin() + _numInstances;
|
||||
}
|
||||
typename std::vector<T>::const_iterator cend() const
|
||||
typename std::vector<T>::const_iterator cend() const // NOLINT(readability-identifier-naming)
|
||||
{
|
||||
return _instances.cbegin() + _numInstances;
|
||||
}
|
||||
|
||||
@@ -202,7 +202,7 @@ void InputManager::Process(const InputEvent& e)
|
||||
{
|
||||
if (e.State == InputEventState::Release)
|
||||
{
|
||||
window_text_input_key(w, e.Button);
|
||||
WindowTextInputKey(w, e.Button);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -280,7 +280,7 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, MouseState
|
||||
switch (_inputState)
|
||||
{
|
||||
case InputState::Reset:
|
||||
window_tooltip_reset(screenCoords);
|
||||
WindowTooltipReset(screenCoords);
|
||||
// fall-through
|
||||
case InputState::Normal:
|
||||
switch (state)
|
||||
@@ -936,7 +936,7 @@ static void InputWidgetOver(const ScreenCoordsXY& screenCoords, rct_window* w, r
|
||||
WidgetScrollGetPart(w, widget, screenCoords, newScreenCoords, &scroll_part, &scrollId);
|
||||
|
||||
if (scroll_part != SCROLL_PART_VIEW)
|
||||
window_tooltip_close();
|
||||
WindowTooltipClose();
|
||||
else
|
||||
{
|
||||
window_event_scroll_mouseover_call(w, scrollId, newScreenCoords);
|
||||
@@ -1374,7 +1374,7 @@ void InputStateWidgetPressed(
|
||||
if (gDropdownIsColour && gDropdownLastColourHover != dropdown_index)
|
||||
{
|
||||
gDropdownLastColourHover = dropdown_index;
|
||||
window_tooltip_close();
|
||||
WindowTooltipClose();
|
||||
|
||||
static constexpr const rct_string_id colourTooltips[] = {
|
||||
STR_COLOUR_BLACK_TIP,
|
||||
@@ -1410,7 +1410,7 @@ void InputStateWidgetPressed(
|
||||
STR_COLOUR_BRIGHT_PINK_TIP,
|
||||
STR_COLOUR_LIGHT_PINK_TIP,
|
||||
};
|
||||
window_tooltip_show(OpenRCT2String{ colourTooltips[dropdown_index], {} }, screenCoords);
|
||||
WindowTooltipShow(OpenRCT2String{ colourTooltips[dropdown_index], {} }, screenCoords);
|
||||
}
|
||||
|
||||
if (dropdown_index < Dropdown::ItemsMaxSize && Dropdown::IsDisabled(dropdown_index))
|
||||
@@ -1429,7 +1429,7 @@ void InputStateWidgetPressed(
|
||||
else
|
||||
{
|
||||
gDropdownLastColourHover = -1;
|
||||
window_tooltip_close();
|
||||
WindowTooltipClose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1443,7 +1443,7 @@ static void InputUpdateTooltip(rct_window* w, rct_widgetindex widgetIndex, const
|
||||
if (_tooltipNotShownTicks > 50 && w != nullptr && WidgetIsVisible(w, widgetIndex))
|
||||
{
|
||||
gTooltipTimeout = 0;
|
||||
window_tooltip_open(w, widgetIndex, screenCoords);
|
||||
WindowTooltipOpen(w, widgetIndex, screenCoords);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1458,7 +1458,7 @@ static void InputUpdateTooltip(rct_window* w, rct_widgetindex widgetIndex, const
|
||||
|| gTooltipWidget.window_number != w->number || gTooltipWidget.widget_index != widgetIndex
|
||||
|| !WidgetIsVisible(w, widgetIndex))
|
||||
{
|
||||
window_tooltip_close();
|
||||
WindowTooltipClose();
|
||||
}
|
||||
|
||||
gTooltipTimeout += gCurrentDeltaTime;
|
||||
|
||||
@@ -131,7 +131,7 @@ static const ScreenCoordsXY ScreenCoordsForHistoryIndex(
|
||||
return coords;
|
||||
}
|
||||
|
||||
static const FinancialTooltipInfo finance_tooltip_info_from_money(
|
||||
static const FinancialTooltipInfo FinanceTooltipInfoFromMoney(
|
||||
const money64* history, const int32_t historyCount, const int32_t modifier, const int32_t offset,
|
||||
const ScreenRect& chartFrame, const ScreenCoordsXY& cursorPosition)
|
||||
{
|
||||
@@ -246,8 +246,7 @@ namespace Graph
|
||||
return;
|
||||
}
|
||||
|
||||
const auto info = finance_tooltip_info_from_money(
|
||||
history, ChartMaxDataCount, modifier, offset, chartFrame, cursorPosition);
|
||||
const auto info = FinanceTooltipInfoFromMoney(history, ChartMaxDataCount, modifier, offset, chartFrame, cursorPosition);
|
||||
|
||||
if (info.money == MONEY64_UNDEFINED)
|
||||
{
|
||||
|
||||
@@ -436,7 +436,7 @@ static void WidgetTextInset(rct_drawpixelinfo* dpi, rct_window* w, rct_widgetind
|
||||
WidgetText(dpi, w, widgetIndex);
|
||||
}
|
||||
|
||||
static std::pair<rct_string_id, void*> widget_get_stringid_and_args(const rct_widget& widget)
|
||||
static std::pair<rct_string_id, void*> WidgetGetStringidAndArgs(const rct_widget& widget)
|
||||
{
|
||||
auto stringId = widget.text;
|
||||
void* formatArgs = gCommonFormatArgs;
|
||||
@@ -471,7 +471,7 @@ static void WidgetGroupboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widget
|
||||
auto textRight = l;
|
||||
|
||||
// Text
|
||||
auto [stringId, formatArgs] = widget_get_stringid_and_args(widget);
|
||||
auto [stringId, formatArgs] = WidgetGetStringidAndArgs(widget);
|
||||
if (stringId != STR_NONE)
|
||||
{
|
||||
uint8_t colour = w->colours[widget.colour] & 0x7F;
|
||||
@@ -639,7 +639,7 @@ static void WidgetCheckboxDraw(rct_drawpixelinfo* dpi, rct_window* w, rct_widget
|
||||
if (widget.text == STR_NONE)
|
||||
return;
|
||||
|
||||
auto [stringId, formatArgs] = widget_get_stringid_and_args(widget);
|
||||
auto [stringId, formatArgs] = WidgetGetStringidAndArgs(widget);
|
||||
gfx_draw_string_left_centred(dpi, stringId, formatArgs, colour, { midLeft + ScreenCoordsXY{ 14, 0 } });
|
||||
}
|
||||
|
||||
|
||||
@@ -756,5 +756,5 @@ void Window::TextInputOpen(
|
||||
rct_widgetindex callWidget, rct_string_id title, rct_string_id description, const Formatter& descriptionArgs,
|
||||
rct_string_id existingText, uintptr_t existingArgs, int32_t maxLength)
|
||||
{
|
||||
window_text_input_open(this, callWidget, title, description, descriptionArgs, existingText, existingArgs, maxLength);
|
||||
WindowTextInputOpen(this, callWidget, title, description, descriptionArgs, existingText, existingArgs, maxLength);
|
||||
}
|
||||
|
||||
@@ -215,7 +215,7 @@ namespace OpenRCT2::Scripting
|
||||
|
||||
void showError(const std::string& title, const std::string& message)
|
||||
{
|
||||
window_error_open(title, message);
|
||||
WindowErrorOpen(title, message);
|
||||
}
|
||||
|
||||
void showTextInput(const DukValue& desc)
|
||||
@@ -229,7 +229,7 @@ namespace OpenRCT2::Scripting
|
||||
auto initialValue = AsOrDefault(desc["initialValue"], "");
|
||||
auto maxLength = AsOrDefault(desc["maxLength"], MaxLengthAllowed);
|
||||
auto callback = desc["callback"];
|
||||
window_text_input_open(
|
||||
WindowTextInputOpen(
|
||||
title, description, initialValue, std::clamp(maxLength, 0, MaxLengthAllowed),
|
||||
[this, plugin, callback](std::string_view value) {
|
||||
auto dukValue = ToDuk(_scriptEngine.GetContext(), value);
|
||||
@@ -266,7 +266,7 @@ namespace OpenRCT2::Scripting
|
||||
else
|
||||
throw DukException();
|
||||
|
||||
window_loadsave_open(
|
||||
WindowLoadsaveOpen(
|
||||
loadSaveType, defaultPath,
|
||||
[this, plugin, callback](int32_t result, std::string_view path) {
|
||||
if (result == MODAL_RESULT_OK)
|
||||
@@ -288,7 +288,7 @@ namespace OpenRCT2::Scripting
|
||||
auto plugin = _scriptEngine.GetExecInfo().GetCurrentPlugin();
|
||||
auto callback = desc["callback"];
|
||||
|
||||
window_scenarioselect_open(
|
||||
WindowScenarioselectOpen(
|
||||
[this, plugin, callback](std::string_view path) {
|
||||
auto dukValue = GetScenarioFile(path);
|
||||
_scriptEngine.ExecutePluginCall(plugin, callback, { dukValue }, false);
|
||||
|
||||
@@ -91,25 +91,25 @@ static uint64_t window_about_page_enabled_widgets[] = {
|
||||
DEFAULT_ENABLED_WIDGETS,
|
||||
};
|
||||
|
||||
static void window_about_openrct2_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_about_openrct2_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_about_openrct2_invalidate(rct_window *w);
|
||||
static void WindowAboutOpenRCT2Mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void WindowAboutOpenRCT2Paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void WindowAboutOpenRCT2Invalidate(rct_window *w);
|
||||
|
||||
static void window_about_rct2_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_about_rct2_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_about_openrct2_common_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void WindowAboutRCT2Mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void WindowAboutRCT2Paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void WindowAboutOpenRCT2CommonPaint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
||||
static rct_window_event_list window_about_openrct2_events([](auto& events)
|
||||
{
|
||||
events.mouse_up = &window_about_openrct2_mouseup;
|
||||
events.invalidate = &window_about_openrct2_invalidate;
|
||||
events.paint = &window_about_openrct2_paint;
|
||||
events.mouse_up = &WindowAboutOpenRCT2Mouseup;
|
||||
events.invalidate = &WindowAboutOpenRCT2Invalidate;
|
||||
events.paint = &WindowAboutOpenRCT2Paint;
|
||||
});
|
||||
|
||||
static rct_window_event_list window_about_rct2_events([](auto& events)
|
||||
{
|
||||
events.mouse_up = &window_about_rct2_mouseup;
|
||||
events.paint = &window_about_rct2_paint;
|
||||
events.mouse_up = &WindowAboutRCT2Mouseup;
|
||||
events.paint = &WindowAboutRCT2Paint;
|
||||
});
|
||||
|
||||
static rct_window_event_list *window_about_page_events[] = {
|
||||
@@ -118,13 +118,13 @@ static rct_window_event_list *window_about_page_events[] = {
|
||||
};
|
||||
// clang-format on
|
||||
|
||||
static void window_about_set_page(rct_window* w, int32_t page);
|
||||
static void WindowAboutSetPage(rct_window* w, int32_t page);
|
||||
|
||||
/**
|
||||
*
|
||||
* rct2: 0x0066D2AC
|
||||
*/
|
||||
rct_window* window_about_open()
|
||||
rct_window* WindowAboutOpen()
|
||||
{
|
||||
rct_window* window;
|
||||
|
||||
@@ -135,7 +135,7 @@ rct_window* window_about_open()
|
||||
|
||||
window = WindowCreateCentred(WW, WH, window_about_page_events[WINDOW_ABOUT_PAGE_OPENRCT2], WC_ABOUT, 0);
|
||||
|
||||
window_about_set_page(window, WINDOW_ABOUT_PAGE_OPENRCT2);
|
||||
WindowAboutSetPage(window, WINDOW_ABOUT_PAGE_OPENRCT2);
|
||||
|
||||
WindowInitScrollWidgets(window);
|
||||
|
||||
@@ -144,7 +144,7 @@ rct_window* window_about_open()
|
||||
|
||||
#pragma region OpenRCT2
|
||||
|
||||
static void window_about_openrct2_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
static void WindowAboutOpenRCT2Mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -153,7 +153,7 @@ static void window_about_openrct2_mouseup(rct_window* w, rct_widgetindex widgetI
|
||||
break;
|
||||
case WIDX_TAB_ABOUT_OPENRCT2:
|
||||
case WIDX_TAB_ABOUT_RCT2:
|
||||
window_about_set_page(w, widgetIndex - WIDX_TAB_ABOUT_OPENRCT2);
|
||||
WindowAboutSetPage(w, widgetIndex - WIDX_TAB_ABOUT_OPENRCT2);
|
||||
break;
|
||||
case WIDX_JOIN_DISCORD:
|
||||
OpenRCT2::GetContext()->GetUiContext()->OpenURL("https://discord.gg/ZXZd8D8");
|
||||
@@ -170,7 +170,7 @@ static void window_about_openrct2_mouseup(rct_window* w, rct_widgetindex widgetI
|
||||
}
|
||||
}
|
||||
|
||||
static void window_about_openrct2_common_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
static void WindowAboutOpenRCT2CommonPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
{
|
||||
WindowDrawWidgets(w, dpi);
|
||||
|
||||
@@ -196,9 +196,9 @@ static void window_about_openrct2_common_paint(rct_window* w, rct_drawpixelinfo*
|
||||
}
|
||||
}
|
||||
|
||||
static void window_about_openrct2_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
static void WindowAboutOpenRCT2Paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
{
|
||||
window_about_openrct2_common_paint(w, dpi);
|
||||
WindowAboutOpenRCT2CommonPaint(w, dpi);
|
||||
|
||||
// Draw logo on placeholder widget
|
||||
ScreenCoordsXY logoCoords = w->windowPos
|
||||
@@ -220,7 +220,7 @@ static void window_about_openrct2_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
DrawTextWrapped(dpi, centrePos, width, STR_STRING, ft, { w->colours[1], TextAlignment::CENTRE });
|
||||
}
|
||||
|
||||
static void window_about_openrct2_invalidate(rct_window* w)
|
||||
static void WindowAboutOpenRCT2Invalidate(rct_window* w)
|
||||
{
|
||||
if (w->page == WINDOW_ABOUT_PAGE_OPENRCT2 && OpenRCT2::GetContext()->HasNewVersionInfo())
|
||||
{
|
||||
@@ -238,7 +238,7 @@ static void window_about_openrct2_invalidate(rct_window* w)
|
||||
*
|
||||
* rct2: 0x0066D4D5
|
||||
*/
|
||||
static void window_about_rct2_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
static void WindowAboutRCT2Mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -247,7 +247,7 @@ static void window_about_rct2_mouseup(rct_window* w, rct_widgetindex widgetIndex
|
||||
break;
|
||||
case WIDX_TAB_ABOUT_OPENRCT2:
|
||||
case WIDX_TAB_ABOUT_RCT2:
|
||||
window_about_set_page(w, widgetIndex - WIDX_TAB_ABOUT_OPENRCT2);
|
||||
WindowAboutSetPage(w, widgetIndex - WIDX_TAB_ABOUT_OPENRCT2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
@@ -256,9 +256,9 @@ static void window_about_rct2_mouseup(rct_window* w, rct_widgetindex widgetIndex
|
||||
*
|
||||
* rct2: 0x0066D321
|
||||
*/
|
||||
static void window_about_rct2_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
static void WindowAboutRCT2Paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
{
|
||||
window_about_openrct2_common_paint(w, dpi);
|
||||
WindowAboutOpenRCT2CommonPaint(w, dpi);
|
||||
|
||||
int32_t yPage = w->windowPos.y + w->widgets[WIDX_PAGE_BACKGROUND].top + 5;
|
||||
|
||||
@@ -293,7 +293,7 @@ static void window_about_rct2_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
|
||||
#pragma endregion RCT2
|
||||
|
||||
static void window_about_set_page(rct_window* w, int32_t page)
|
||||
static void WindowAboutSetPage(rct_window* w, int32_t page)
|
||||
{
|
||||
w->page = page;
|
||||
w->frame_no = 0;
|
||||
|
||||
@@ -200,7 +200,7 @@ public:
|
||||
break;
|
||||
}
|
||||
case WIDX_BANNER_TEXT:
|
||||
window_text_input_raw_open(
|
||||
WindowTextInputRawOpen(
|
||||
this, WIDX_BANNER_TEXT, STR_BANNER_TEXT, STR_ENTER_BANNER_TEXT, {}, banner->GetText().c_str(), 32);
|
||||
break;
|
||||
case WIDX_BANNER_NO_ENTRY:
|
||||
@@ -297,7 +297,7 @@ public:
|
||||
*
|
||||
* rct2: 0x006BA305
|
||||
*/
|
||||
rct_window* window_banner_open(rct_windownumber number)
|
||||
rct_window* WindowBannerOpen(rct_windownumber number)
|
||||
{
|
||||
auto w = static_cast<BannerWindow*>(window_bring_to_front_by_number(WC_BANNER, number));
|
||||
|
||||
|
||||
@@ -314,7 +314,7 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
rct_window* window_changelog_open(int personality)
|
||||
rct_window* WindowChangelogOpen(int personality)
|
||||
{
|
||||
auto* window = window_bring_to_front_by_class(WC_CHANGELOG);
|
||||
if (window == nullptr)
|
||||
|
||||
@@ -866,7 +866,7 @@ private:
|
||||
break;
|
||||
case WIDX_MONEY_SPINNER:
|
||||
money_to_string(_moneySpinnerValue, _moneySpinnerText, MONEY_STRING_MAXLENGTH, false);
|
||||
window_text_input_raw_open(
|
||||
WindowTextInputRawOpen(
|
||||
this, WIDX_MONEY_SPINNER, STR_ENTER_NEW_VALUE, STR_ENTER_NEW_VALUE, {}, _moneySpinnerText,
|
||||
MONEY_STRING_MAXLENGTH);
|
||||
break;
|
||||
@@ -1199,7 +1199,7 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
rct_window* window_cheats_open()
|
||||
rct_window* WindowCheatsOpen()
|
||||
{
|
||||
auto* window = window_bring_to_front_by_class(WC_CHEATS);
|
||||
if (window == nullptr)
|
||||
|
||||
@@ -81,7 +81,7 @@ public:
|
||||
|
||||
void OnClose() override
|
||||
{
|
||||
if (clear_scenery_tool_is_active())
|
||||
if (ClearSceneryToolIsActive())
|
||||
tool_cancel();
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ public:
|
||||
{
|
||||
frame_no++;
|
||||
// Close window if another tool is open
|
||||
if (!clear_scenery_tool_is_active())
|
||||
if (!ClearSceneryToolIsActive())
|
||||
Close();
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
rct_window* window_clear_scenery_open()
|
||||
rct_window* WindowClearSceneryOpen()
|
||||
{
|
||||
auto* w = static_cast<CleanSceneryWindow*>(window_bring_to_front_by_class(WC_CLEAR_SCENERY));
|
||||
|
||||
|
||||
@@ -43,24 +43,24 @@ static rct_widget window_custom_currency_widgets[] = {
|
||||
};
|
||||
|
||||
|
||||
static void custom_currency_window_mousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void custom_currency_window_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void custom_currency_window_dropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void custom_currency_window_text_input(struct rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void custom_currency_window_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void CustomCurrencyWindowMousedown(rct_window *w, rct_widgetindex widgetIndex, rct_widget *widget);
|
||||
static void CustomCurrencyWindowMouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void CustomCurrencyWindowDropdown(rct_window *w, rct_widgetindex widgetIndex, int32_t dropdownIndex);
|
||||
static void CustomCurrencyWindowTextInput(struct rct_window *w, rct_widgetindex widgetIndex, char *text);
|
||||
static void CustomCurrencyWindowPaint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
||||
|
||||
static rct_window_event_list _windowCustomCurrencyEvents([](auto& events)
|
||||
{
|
||||
events.mouse_up = &custom_currency_window_mouseup;
|
||||
events.mouse_down = &custom_currency_window_mousedown;
|
||||
events.dropdown = &custom_currency_window_dropdown;
|
||||
events.text_input = &custom_currency_window_text_input;
|
||||
events.paint = &custom_currency_window_paint;
|
||||
events.mouse_up = &CustomCurrencyWindowMouseup;
|
||||
events.mouse_down = &CustomCurrencyWindowMousedown;
|
||||
events.dropdown = &CustomCurrencyWindowDropdown;
|
||||
events.text_input = &CustomCurrencyWindowTextInput;
|
||||
events.paint = &CustomCurrencyWindowPaint;
|
||||
});
|
||||
// clang-format on
|
||||
|
||||
rct_window* custom_currency_window_open()
|
||||
rct_window* CustomCurrencyWindowOpen()
|
||||
{
|
||||
rct_window* window;
|
||||
|
||||
@@ -83,7 +83,7 @@ rct_window* custom_currency_window_open()
|
||||
return window;
|
||||
}
|
||||
|
||||
static void custom_currency_window_mousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget)
|
||||
static void CustomCurrencyWindowMousedown(rct_window* w, rct_widgetindex widgetIndex, rct_widget* widget)
|
||||
{
|
||||
widget = &w->widgets[widgetIndex - 1];
|
||||
|
||||
@@ -133,26 +133,26 @@ static void custom_currency_window_mousedown(rct_window* w, rct_widgetindex widg
|
||||
break;
|
||||
|
||||
case WIDX_SYMBOL_TEXT:
|
||||
window_text_input_raw_open(
|
||||
WindowTextInputRawOpen(
|
||||
w, WIDX_SYMBOL_TEXT, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_TITLE, STR_CUSTOM_CURRENCY_SYMBOL_INPUT_DESC, {},
|
||||
CurrencyDescriptors[EnumValue(CurrencyType::Custom)].symbol_unicode, CURRENCY_SYMBOL_MAX_SIZE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void custom_currency_window_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
static void CustomCurrencyWindowMouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
case WIDX_RATE:
|
||||
window_text_input_open(
|
||||
WindowTextInputOpen(
|
||||
w, WIDX_RATE, STR_RATE_INPUT_TITLE, STR_RATE_INPUT_DESC, {}, STR_FORMAT_INTEGER,
|
||||
static_cast<uint32_t>(CurrencyDescriptors[EnumValue(CurrencyType::Custom)].rate), CURRENCY_RATE_MAX_NUM_DIGITS);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static void custom_currency_window_dropdown([[maybe_unused]] rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
static void CustomCurrencyWindowDropdown([[maybe_unused]] rct_window* w, rct_widgetindex widgetIndex, int32_t dropdownIndex)
|
||||
{
|
||||
if (dropdownIndex == -1)
|
||||
return;
|
||||
@@ -177,7 +177,7 @@ static void custom_currency_window_dropdown([[maybe_unused]] rct_window* w, rct_
|
||||
}
|
||||
}
|
||||
|
||||
static void custom_currency_window_text_input([[maybe_unused]] struct rct_window* w, rct_widgetindex widgetIndex, char* text)
|
||||
static void CustomCurrencyWindowTextInput([[maybe_unused]] struct rct_window* w, rct_widgetindex widgetIndex, char* text)
|
||||
{
|
||||
if (text == nullptr)
|
||||
return;
|
||||
@@ -209,7 +209,7 @@ static void custom_currency_window_text_input([[maybe_unused]] struct rct_window
|
||||
}
|
||||
}
|
||||
|
||||
static void custom_currency_window_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
static void CustomCurrencyWindowPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
{
|
||||
auto ft = Formatter::Common();
|
||||
ft.Add<money64>(MONEY(10, 0));
|
||||
|
||||
@@ -45,19 +45,19 @@ static rct_widget window_debug_paint_widgets[] = {
|
||||
WIDGETS_END,
|
||||
};
|
||||
|
||||
static void window_debug_paint_mouseup(rct_window * w, rct_widgetindex widgetIndex);
|
||||
static void window_debug_paint_invalidate(rct_window * w);
|
||||
static void window_debug_paint_paint(rct_window * w, rct_drawpixelinfo * dpi);
|
||||
static void WindowDebugPaintMouseup(rct_window * w, rct_widgetindex widgetIndex);
|
||||
static void WindowDebugPaintInvalidate(rct_window * w);
|
||||
static void WindowDebugPaintPaint(rct_window * w, rct_drawpixelinfo * dpi);
|
||||
|
||||
static rct_window_event_list window_debug_paint_events([](auto& events)
|
||||
{
|
||||
events.mouse_up = &window_debug_paint_mouseup;
|
||||
events.invalidate = &window_debug_paint_invalidate;
|
||||
events.paint = &window_debug_paint_paint;
|
||||
events.mouse_up = &WindowDebugPaintMouseup;
|
||||
events.invalidate = &WindowDebugPaintInvalidate;
|
||||
events.paint = &WindowDebugPaintPaint;
|
||||
});
|
||||
// clang-format on
|
||||
|
||||
rct_window* window_debug_paint_open()
|
||||
rct_window* WindowDebugPaintOpen()
|
||||
{
|
||||
rct_window* window;
|
||||
|
||||
@@ -84,7 +84,7 @@ rct_window* window_debug_paint_open()
|
||||
return window;
|
||||
}
|
||||
|
||||
static void window_debug_paint_mouseup([[maybe_unused]] rct_window* w, rct_widgetindex widgetIndex)
|
||||
static void WindowDebugPaintMouseup([[maybe_unused]] rct_window* w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -115,7 +115,7 @@ static void window_debug_paint_mouseup([[maybe_unused]] rct_window* w, rct_widge
|
||||
}
|
||||
}
|
||||
|
||||
static void window_debug_paint_invalidate(rct_window* w)
|
||||
static void WindowDebugPaintInvalidate(rct_window* w)
|
||||
{
|
||||
const auto& ls = OpenRCT2::GetContext()->GetLocalisationService();
|
||||
const auto currentLanguage = ls.GetCurrentLanguage();
|
||||
@@ -158,7 +158,7 @@ static void window_debug_paint_invalidate(rct_window* w)
|
||||
WidgetSetCheckboxValue(w, WIDX_TOGGLE_SHOW_DIRTY_VISUALS, gShowDirtyVisuals);
|
||||
}
|
||||
|
||||
static void window_debug_paint_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
static void WindowDebugPaintPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
{
|
||||
WindowDrawWidgets(w, dpi);
|
||||
}
|
||||
|
||||
@@ -46,26 +46,26 @@ static rct_widget window_ride_refurbish_widgets[] = {
|
||||
WIDGETS_END,
|
||||
};
|
||||
|
||||
static void window_ride_demolish_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_ride_demolish_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void window_ride_refurbish_mouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void window_ride_refurbish_paint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void WindowRideDemolishMouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void WindowRideDemolishPaint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
static void WindowRideRefurbishMouseup(rct_window *w, rct_widgetindex widgetIndex);
|
||||
static void WindowRideRefurbishPaint(rct_window *w, rct_drawpixelinfo *dpi);
|
||||
|
||||
//0x0098E2E4
|
||||
static rct_window_event_list window_ride_demolish_events([](auto& events)
|
||||
{
|
||||
events.mouse_up = &window_ride_demolish_mouseup;
|
||||
events.paint = &window_ride_demolish_paint;
|
||||
events.mouse_up = &WindowRideDemolishMouseup;
|
||||
events.paint = &WindowRideDemolishPaint;
|
||||
});
|
||||
// clang-format on
|
||||
|
||||
static rct_window_event_list window_ride_refurbish_events([](auto& events) {
|
||||
events.mouse_up = &window_ride_refurbish_mouseup;
|
||||
events.paint = &window_ride_refurbish_paint;
|
||||
events.mouse_up = &WindowRideRefurbishMouseup;
|
||||
events.paint = &WindowRideRefurbishPaint;
|
||||
});
|
||||
|
||||
/** Based off of rct2: 0x006B486A */
|
||||
rct_window* window_ride_demolish_prompt_open(Ride* ride)
|
||||
rct_window* WindowRideDemolishPromptOpen(Ride* ride)
|
||||
{
|
||||
rct_window* w;
|
||||
|
||||
@@ -90,7 +90,7 @@ rct_window* window_ride_demolish_prompt_open(Ride* ride)
|
||||
return w;
|
||||
}
|
||||
|
||||
rct_window* window_ride_refurbish_prompt_open(Ride* ride)
|
||||
rct_window* WindowRideRefurbishPromptOpen(Ride* ride)
|
||||
{
|
||||
rct_window* w;
|
||||
|
||||
@@ -119,7 +119,7 @@ rct_window* window_ride_refurbish_prompt_open(Ride* ride)
|
||||
*
|
||||
* rct2: 0x006B4933
|
||||
*/
|
||||
static void window_ride_demolish_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
static void WindowRideDemolishMouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -136,7 +136,7 @@ static void window_ride_demolish_mouseup(rct_window* w, rct_widgetindex widgetIn
|
||||
}
|
||||
}
|
||||
|
||||
static void window_ride_refurbish_mouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
static void WindowRideRefurbishMouseup(rct_window* w, rct_widgetindex widgetIndex)
|
||||
{
|
||||
switch (widgetIndex)
|
||||
{
|
||||
@@ -157,7 +157,7 @@ static void window_ride_refurbish_mouseup(rct_window* w, rct_widgetindex widgetI
|
||||
*
|
||||
* rct2: 0x006B48E5
|
||||
*/
|
||||
static void window_ride_demolish_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
static void WindowRideDemolishPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
{
|
||||
WindowDrawWidgets(w, dpi);
|
||||
|
||||
@@ -174,7 +174,7 @@ static void window_ride_demolish_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
}
|
||||
}
|
||||
|
||||
static void window_ride_refurbish_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
static void WindowRideRefurbishPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
{
|
||||
WindowDrawWidgets(w, dpi);
|
||||
|
||||
|
||||
@@ -89,12 +89,12 @@ void Dropdown::SetDisabled(int32_t index, bool value)
|
||||
_dropdownItemsDisabled[index] = value;
|
||||
}
|
||||
|
||||
static void window_dropdown_paint(rct_window* w, rct_drawpixelinfo* dpi);
|
||||
static void WindowDropdownPaint(rct_window* w, rct_drawpixelinfo* dpi);
|
||||
|
||||
// clang-format off
|
||||
static rct_window_event_list window_dropdown_events([](auto& events)
|
||||
{
|
||||
events.paint = &window_dropdown_paint;
|
||||
events.paint = &WindowDropdownPaint;
|
||||
});
|
||||
// clang-format on
|
||||
|
||||
@@ -285,7 +285,7 @@ void WindowDropdownClose()
|
||||
window_close_by_class(WC_DROPDOWN);
|
||||
}
|
||||
|
||||
static void window_dropdown_paint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
static void WindowDropdownPaint(rct_window* w, rct_drawpixelinfo* dpi)
|
||||
{
|
||||
WindowDrawWidgets(w, dpi);
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user