Skip to content

Commit

Permalink
Close OpenRCT2#21569: Remove 'Window' from Window Open function names (
Browse files Browse the repository at this point in the history
…OpenRCT2#21613)

* Close OpenRCT2#21569: Remove 'Window' from Window Open function names

Windows are all under the OpenRCT2::Ui::Windows namespace. As such, "Window" is removed from the Open functions names.

* Update Contributors.md

* Fix formatting TrackMangeOpen

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>

* Fix formatting TrackPlaceOpen

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>

---------

Co-authored-by: Tulio Leao <tupaschoal@gmail.com>
  • Loading branch information
CoryfY and tupaschoal authored Mar 17, 2024
1 parent 8963234 commit 3f81a49
Show file tree
Hide file tree
Showing 75 changed files with 276 additions and 277 deletions.
1 change: 1 addition & 0 deletions contributors.md
Original file line number Diff line number Diff line change
Expand Up @@ -235,6 +235,7 @@ Appreciation for contributors who have provided substantial work, but are no lon
* Aram Kazorian (aramk-hub)
* Harry Hopkinson (Harry-Hopkinson)
* Jan Kelemen (jan-kelemen)
* Cory Ye (CoryfY)

## Toolchain
* (Balletie) - macOS
Expand Down
170 changes: 84 additions & 86 deletions src/openrct2-ui/WindowManager.cpp

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/openrct2-ui/input/Shortcuts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ static void ShortcutOpenCheatWindow()

static void ShortcutOpenKeyboardShortcutsWindow()
{
WindowShortcutKeysOpen();
ShortcutKeysOpen();
}

static void ShortcutOpenTransparencyWindow()
Expand Down
6 changes: 3 additions & 3 deletions src/openrct2-ui/scripting/ScUi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ namespace OpenRCT2::Scripting

void showError(const std::string& title, const std::string& message)
{
WindowErrorOpen(title, message);
ErrorOpen(title, message);
}

void showTextInput(const DukValue& desc)
Expand Down Expand Up @@ -282,7 +282,7 @@ namespace OpenRCT2::Scripting
else
throw DukException();

WindowLoadsaveOpen(
LoadsaveOpen(
loadSaveType, defaultPath,
[this, plugin, callback](int32_t result, std::string_view path) {
if (result == MODAL_RESULT_OK)
Expand All @@ -304,7 +304,7 @@ namespace OpenRCT2::Scripting
auto plugin = _scriptEngine.GetExecInfo().GetCurrentPlugin();
auto callback = desc["callback"];

WindowScenarioselectOpen([this, plugin, callback](std::string_view path) {
ScenarioselectOpen([this, plugin, callback](std::string_view path) {
auto dukValue = GetScenarioFile(path);
_scriptEngine.ExecutePluginCall(plugin, callback, { dukValue }, false);
});
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/About.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ static Widget *_windowAboutPageWidgets[] = {
*
* rct2: 0x0066D2AC
*/
WindowBase* WindowAboutOpen()
WindowBase* AboutOpen()
{
return WindowFocusOrCreate<AboutWindow>(WindowClass::About, WW, WH, WF_CENTRE_SCREEN);
}
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/AssetPacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ static Widget WindowAssetPacksWidgets[] = {
}
};

WindowBase* WindowAssetPacksOpen()
WindowBase* AssetPacksOpen()
{
auto flags = WF_AUTO_POSITION | WF_CENTRE_SCREEN;
return WindowFocusOrCreate<AssetPacksWindow>(WindowClass::AssetPacks, WW, WH, flags);
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/Banner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ static Widget window_banner_widgets[] = {
*
* rct2: 0x006BA305
*/
WindowBase* WindowBannerOpen(rct_windownumber number)
WindowBase* BannerOpen(rct_windownumber number)
{
auto w = static_cast<BannerWindow*>(WindowBringToFrontByNumber(WindowClass::Banner, number));

Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/Changelog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ static Widget _windowChangelogWidgets[] = {
}
};

WindowBase* WindowChangelogOpen(int personality)
WindowBase* ChangelogOpen(int personality)
{
auto* window = WindowBringToFrontByClass(WindowClass::Changelog);
if (window == nullptr)
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/Cheats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,7 @@ static StringId window_cheats_page_titles[] = {
}
};

WindowBase* WindowCheatsOpen()
WindowBase* CheatsOpen()
{
auto* window = WindowBringToFrontByClass(WindowClass::Cheats);
if (window == nullptr)
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/ClearScenery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ namespace OpenRCT2::Ui::Windows
}
};

WindowBase* WindowClearSceneryOpen()
WindowBase* ClearSceneryOpen()
{
auto* w = static_cast<CleanSceneryWindow*>(WindowBringToFrontByClass(WindowClass::ClearScenery));

Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/CustomCurrency.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ static Widget window_custom_currency_widgets[] = {
}
};

WindowBase* CustomCurrencyWindowOpen()
WindowBase* CustomCurrencyOpen()
{
return WindowFocusOrCreate<CustomCurrencyWindow>(WindowClass::CustomCurrencyConfig, WW, WH, WF_CENTRE_SCREEN);
}
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/DebugPaint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static Widget window_debug_paint_widgets[] = {
}
};

WindowBase* WindowDebugPaintOpen()
WindowBase* DebugPaintOpen()
{
auto* window = WindowFocusOrCreate<DebugPaintWindow>(
WindowClass::DebugPaint, { 16, ContextGetHeight() - 16 - 33 - WINDOW_HEIGHT }, WINDOW_WIDTH, WINDOW_HEIGHT,
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/DemolishRidePrompt.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ static Widget window_ride_demolish_widgets[] =
}
};

WindowBase* WindowRideDemolishPromptOpen(const Ride& ride)
WindowBase* RideDemolishPromptOpen(const Ride& ride)
{
WindowBase* w;
DemolishRidePromptWindow* newWindow;
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/EditorBottomToolbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ static Widget _editorBottomToolbarWidgets[] = {
* Creates the main editor top toolbar window.
* rct2: 0x0066F052 (part of 0x0066EF38)
*/
WindowBase* WindowEditorBottomToolbarOpen()
WindowBase* EditorBottomToolbarOpen()
{
auto* window = WindowCreate<EditorBottomToolbarWindow>(
WindowClass::BottomToolbar, ScreenCoordsXY(0, ContextGetHeight() - 32), ContextGetWidth(), 32,
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/EditorInventionsList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ static Widget _inventionListDragWidgets[] = {
*
* rct2: 0x00684E04
*/
WindowBase* WindowEditorInventionsListOpen()
WindowBase* EditorInventionsListOpen()
{
return WindowFocusOrCreate<InventionListWindow>(
WindowClass::EditorInventionList, WW, WH, WF_NO_SCROLLING | WF_RESIZABLE | WF_CENTRE_SCREEN);
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/EditorObjectSelection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1568,7 +1568,7 @@ static std::vector<Widget> _window_editor_object_selection_widgets = {
*
* rct2: 0x006AA64E
*/
WindowBase* WindowEditorObjectSelectionOpen()
WindowBase* EditorObjectSelectionOpen()
{
return WindowFocusOrCreate<EditorObjectSelectionWindow>(
WindowClass::EditorObjectSelection, 755, 400, WF_10 | WF_RESIZABLE | WF_CENTRE_SCREEN);
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/EditorObjectiveOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ static uint64_t window_editor_objective_options_page_hold_down_widgets[] = {
*
* rct2: 0x0067137D
*/
WindowBase* WindowEditorObjectiveOptionsOpen()
WindowBase* EditorObjectiveOptionsOpen()
{
auto window = WindowBringToFrontByClass(WindowClass::EditorObjectiveOptions);
if (window != nullptr)
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/EditorScenarioOptions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1282,7 +1282,7 @@ static uint32_t window_editor_scenario_options_page_hold_down_widgets[] = {
#pragma endregion
};

WindowBase* WindowEditorScenarioOptionsOpen()
WindowBase* EditorScenarioOptionsOpen()
{
return WindowFocusOrCreate<EditorScenarioOptionsWindow>(WindowClass::EditorScenarioOptions, 280, 148, WF_NO_SCROLLING);
}
Expand Down
6 changes: 3 additions & 3 deletions src/openrct2-ui/windows/Error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static Widget window_error_widgets[] = {
}
};

WindowBase* WindowErrorOpen(std::string_view title, std::string_view message)
WindowBase* ErrorOpen(std::string_view title, std::string_view message)
{
std::string buffer = "{BLACK}";
buffer.append(title);
Expand Down Expand Up @@ -166,10 +166,10 @@ static Widget window_error_widgets[] = {
WF_STICK_TO_FRONT | WF_TRANSPARENT | WF_RESIZABLE);
}

WindowBase* WindowErrorOpen(StringId title, StringId message, const Formatter& args)
WindowBase* ErrorOpen(StringId title, StringId message, const Formatter& args)
{
auto titlez = FormatStringIDLegacy(title, args.Data());
auto messagez = FormatStringIDLegacy(message, args.Data());
return WindowErrorOpen(titlez, messagez);
return ErrorOpen(titlez, messagez);
}
} // namespace OpenRCT2::Ui::Windows
6 changes: 3 additions & 3 deletions src/openrct2-ui/windows/Finances.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -968,17 +968,17 @@ static Widget _windowFinancesResearchWidgets[] =
return window;
}

WindowBase* WindowFinancesOpen()
WindowBase* FinancesOpen()
{
return WindowFocusOrCreate<FinancesWindow>(WindowClass::Finances, WW_OTHER_TABS, WH_SUMMARY, WF_10);
}

WindowBase* WindowFinancesResearchOpen()
WindowBase* FinancesResearchOpen()
{
return FinancesWindowOpen(WINDOW_FINANCES_PAGE_RESEARCH);
}

WindowBase* WindowFinancesMarketingOpen()
WindowBase* FinancesMarketingOpen()
{
return FinancesWindowOpen(WINDOW_FINANCES_PAGE_MARKETING);
}
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/Footpath.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1426,7 +1426,7 @@ static constexpr uint8_t ConstructionPreviewImages[][4] = {
*
* rct2: 0x006A7C43
*/
WindowBase* WindowFootpathOpen()
WindowBase* FootpathOpen()
{
if (!FootpathSelectDefault())
{
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/GameBottomToolbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ static Widget window_game_bottom_toolbar_widgets[] =
/**
* Creates the main game bottom toolbar window.
*/
WindowBase* WindowGameBottomToolbarOpen()
WindowBase* GameBottomToolbarOpen()
{
int32_t screenWidth = ContextGetWidth();
int32_t screenHeight = ContextGetHeight();
Expand Down
4 changes: 2 additions & 2 deletions src/openrct2-ui/windows/Guest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1906,15 +1906,15 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT);
* rct2: 0x006989E9
*
*/
WindowBase* WindowGuestOpen(Peep* peep)
WindowBase* GuestOpen(Peep* peep)
{
if (peep == nullptr)
{
return nullptr;
}
if (peep->Is<Staff>())
{
return WindowStaffOpen(peep);
return StaffOpen(peep);
}

auto* window = static_cast<GuestWindow*>(WindowBringToFrontByNumber(WindowClass::Peep, peep->Id.ToUnderlying()));
Expand Down
8 changes: 4 additions & 4 deletions src/openrct2-ui/windows/GuestList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ static Widget window_guest_list_widgets[] = {
auto guest = GetEntity<Guest>(guestItem.Id);
if (guest != nullptr)
{
WindowGuestOpen(guest);
GuestOpen(guest);
}
break;
}
Expand Down Expand Up @@ -965,7 +965,7 @@ static Widget window_guest_list_widgets[] = {
}
};

WindowBase* WindowGuestListOpen()
WindowBase* GuestListOpen()
{
auto* window = WindowBringToFrontByClass(WindowClass::GuestList);
if (window == nullptr)
Expand All @@ -978,9 +978,9 @@ static Widget window_guest_list_widgets[] = {
/**
* @param index The number of the ride or index of the thought
*/
WindowBase* WindowGuestListOpenWithFilter(GuestListFilterType type, int32_t index)
WindowBase* GuestListOpenWithFilter(GuestListFilterType type, int32_t index)
{
auto* w = static_cast<GuestListWindow*>(WindowGuestListOpen());
auto* w = static_cast<GuestListWindow*>(GuestListOpen());
if (w != nullptr)
{
w->SetFilter(type, index);
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/InstallTrack.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ static Widget window_install_track_widgets[] = {
}
};

WindowBase* WindowInstallTrackOpen(const utf8* path)
WindowBase* InstallTrackOpen(const utf8* path)
{
auto trackDesign = TrackDesignImport(path);
if (trackDesign == nullptr)
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/Land.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -348,7 +348,7 @@ static Widget window_land_widgets[] = {
}
};

WindowBase* WindowLandOpen()
WindowBase* LandOpen()
{
return WindowFocusOrCreate<LandWindow>(WindowClass::Land, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0);
}
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/LandRights.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ static Widget window_land_rights_widgets[] = {
}
};

WindowBase* WindowLandRightsOpen()
WindowBase* LandRightsOpen()
{
return WindowFocusOrCreate<LandRightsWindow>(
WindowClass::LandRights, ScreenCoordsXY(ContextGetWidth() - WW, 29), WW, WH, 0);
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/LoadSave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ static Widget window_loadsave_widgets[] =
#pragma endregion
};

WindowBase* WindowLoadsaveOpen(
WindowBase* LoadsaveOpen(
int32_t type, std::string_view defaultPath, std::function<void(int32_t result, std::string_view)> callback,
TrackDesign* trackDesign)
{
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static Widget _mainWidgets[] = {
* Creates the main window that holds the main viewport.
* rct2: 0x0066B3E8
*/
WindowBase* WindowMainOpen()
WindowBase* MainOpen()
{
return WindowCreate<MainWindow>(
WindowClass::MainWindow, { 0, 0 }, ContextGetWidth(), ContextGetHeight(), WF_STICK_TO_BACK);
Expand Down
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/Map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,7 @@ static constexpr ScreenCoordsXY MiniMapOffsets[] = {
}
};

WindowBase* WindowMapOpen()
WindowBase* MapOpen()
{
try
{
Expand Down
4 changes: 2 additions & 2 deletions src/openrct2-ui/windows/MapGen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1390,14 +1390,14 @@ static uint64_t PressedWidgets[WINDOW_MAPGEN_PAGE_COUNT] = {
}
};

WindowBase* WindowMapgenOpen()
WindowBase* MapgenOpen()
{
return WindowFocusOrCreate<MapGenWindow>(WindowClass::Mapgen, WW, WH, WF_10 | WF_AUTO_POSITION | WF_CENTRE_SCREEN);
}

static void HeightmapLoadsaveCallback(int32_t result, const utf8* path)
{
auto* w = static_cast<MapGenWindow*>(WindowMapgenOpen());
auto* w = static_cast<MapGenWindow*>(MapgenOpen());
w->AfterLoadingHeightMap(result, path);
}
} // namespace OpenRCT2::Ui::Windows
2 changes: 1 addition & 1 deletion src/openrct2-ui/windows/MazeConstruction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ static Widget window_maze_construction_widgets[] = {
}
};

WindowBase* WindowMazeConstructionOpen()
WindowBase* MazeConstructionOpen()
{
return WindowFocusOrCreate<MazeConstructionWindow>(
WindowClass::RideConstruction, ScreenCoordsXY(0, 29), WW, WH, WF_NO_AUTO_CLOSE);
Expand Down
4 changes: 2 additions & 2 deletions src/openrct2-ui/windows/Multiplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
void OnScrollDraw(int32_t scrollIndex, DrawPixelInfo& dpi) override;
};

WindowBase* WindowMultiplayerOpen()
WindowBase* MultiplayerOpen()
{
// Check if window is already open
WindowBase* window = WindowBringToFrontByClass(WindowClass::Multiplayer);
Expand Down Expand Up @@ -620,7 +620,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
Invalidate();

int32_t player = (IsServerPlayerInvisible() ? index + 1 : index);
WindowPlayerOpen(NetworkGetPlayerID(player));
PlayerOpen(NetworkGetPlayerID(player));
break;
}

Expand Down
4 changes: 2 additions & 2 deletions src/openrct2-ui/windows/NetworkStatus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ static Widget window_network_status_widgets[] = {
std::string _password;
};

WindowBase* WindowNetworkStatusOpen(const std::string& text, close_callback onClose)
WindowBase* NetworkStatusOpen(const std::string& text, close_callback onClose)
{
auto window = WindowFocusOrCreate<NetworkStatusWindow>(
WindowClass::NetworkStatus, 420, 90, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN);
Expand All @@ -152,7 +152,7 @@ static Widget window_network_status_widgets[] = {
networkWindow->Close();
}

WindowBase* WindowNetworkStatusOpenPassword()
WindowBase* NetworkStatusOpenPassword()
{
auto window = WindowFocusOrCreate<NetworkStatusWindow>(
WindowClass::NetworkStatus, 420, 90, WF_10 | WF_TRANSPARENT | WF_CENTRE_SCREEN);
Expand Down
Loading

0 comments on commit 3f81a49

Please sign in to comment.