Refactor UI/Interface misc to TitleCase (#13354)

* Refactor LandTool to Namespace

* Refactor Theme to TitleCase

* Refactor ViewportInteraction to TitleCase
This commit is contained in:
pizza2004 2020-11-03 03:59:00 -07:00 committed by GitHub
parent 6cc3f2f4a8
commit b0fd5f93d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 202 additions and 199 deletions

View File

@ -134,7 +134,7 @@ public:
void Draw(rct_drawpixelinfo* dpi) override
{
auto bgColour = theme_get_colour(WC_CHAT, 0);
auto bgColour = ThemeGetColour(WC_CHAT, 0);
chat_draw(dpi, bgColour);
_inGameConsole.Draw(dpi);
}

View File

@ -30,7 +30,7 @@ class WindowManager final : public IWindowManager
public:
void Init() override
{
theme_manager_initialise();
ThemeManagerInitialise();
window_guest_list_init_vars();
window_new_ride_init_vars();
}

View File

@ -346,7 +346,7 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, int32_t sta
if (_ticksSinceDragStart < 500)
{
// If the user pressed the right mouse button for less than 500 ticks, interpret as right click
viewport_interaction_right_click(screenCoords);
ViewportInteractionRightClick(screenCoords);
}
}
break;
@ -399,7 +399,7 @@ static void GameHandleInputMouse(const ScreenCoordsXY& screenCoords, int32_t sta
}
else if (!(_inputFlags & INPUT_FLAG_4))
{
viewport_interaction_left_click(screenCoords);
ViewportInteractionLeftClick(screenCoords);
}
}
break;
@ -1087,7 +1087,7 @@ void ProcessMouseOver(const ScreenCoordsXY& screenCoords)
case WWT_VIEWPORT:
if (!(_inputFlags & INPUT_FLAG_TOOL_ACTIVE))
{
if (viewport_interaction_left_over(screenCoords))
if (ViewportInteractionLeftOver(screenCoords))
{
SetCursor(CursorID::HandPoint);
return;
@ -1140,7 +1140,7 @@ void ProcessMouseOver(const ScreenCoordsXY& screenCoords)
}
}
viewport_interaction_right_over(screenCoords);
ViewportInteractionRightOver(screenCoords);
SetCursor(cursorId);
}

View File

@ -271,7 +271,7 @@ void InGameConsole::Draw(rct_drawpixelinfo* dpi) const
// Set font
gCurrentFontSpriteBase = (gConfigInterface.console_small_font ? FONT_SPRITE_BASE_SMALL : FONT_SPRITE_BASE_MEDIUM);
gCurrentFontFlags = 0;
uint8_t textColour = NOT_TRANSLUCENT(theme_get_colour(WC_CONSOLE, 1));
uint8_t textColour = NOT_TRANSLUCENT(ThemeGetColour(WC_CONSOLE, 1));
const int32_t lineHeight = font_get_line_height(gCurrentFontSpriteBase);
const int32_t maxLines = GetNumVisibleLines();
@ -301,7 +301,7 @@ void InGameConsole::Draw(rct_drawpixelinfo* dpi) const
dpi, { { _consoleLeft, _consoleBottom - lineHeight - 10 }, { _consoleRight, _consoleBottom - 1 } }, PALETTE_51);
// Paint background colour.
uint8_t backgroundColour = theme_get_colour(WC_CONSOLE, 0);
uint8_t backgroundColour = ThemeGetColour(WC_CONSOLE, 0);
gfx_fill_rect_inset(
dpi, _consoleLeft, _consoleTop, _consoleRight, _consoleBottom, backgroundColour, INSET_RECT_FLAG_FILL_NONE);
gfx_fill_rect_inset(

View File

@ -44,7 +44,7 @@ ObjectEntryIndex gLandToolTerrainEdge;
money32 gWaterToolRaiseCost;
money32 gWaterToolLowerCost;
uint32_t land_tool_size_to_sprite_index(uint16_t size)
uint32_t LandTool::SizeToSpriteIndex(uint16_t size)
{
if (size <= MAX_TOOL_SIZE_WITH_SPRITE)
{
@ -56,7 +56,7 @@ uint32_t land_tool_size_to_sprite_index(uint16_t size)
}
}
void land_tool_show_surface_style_dropdown(rct_window* w, rct_widget* widget, uint8_t currentSurfaceType)
void LandTool::ShowSurfaceStyleDropdown(rct_window* w, rct_widget* widget, uint8_t currentSurfaceType)
{
auto& objManager = GetContext()->GetObjectManager();
@ -89,7 +89,7 @@ void land_tool_show_surface_style_dropdown(rct_window* w, rct_widget* widget, ui
gDropdownDefaultIndex = defaultIndex;
}
void land_tool_show_edge_style_dropdown(rct_window* w, rct_widget* widget, uint8_t currentEdgeType)
void LandTool::ShowEdgeStyleDropdown(rct_window* w, rct_widget* widget, uint8_t currentEdgeType)
{
auto& objManager = GetContext()->GetObjectManager();

View File

@ -26,6 +26,9 @@ extern ObjectEntryIndex gLandToolTerrainEdge;
extern money32 gWaterToolRaiseCost;
extern money32 gWaterToolLowerCost;
uint32_t land_tool_size_to_sprite_index(uint16_t size);
void land_tool_show_surface_style_dropdown(rct_window* w, rct_widget* widget, uint8_t currentSurfaceType);
void land_tool_show_edge_style_dropdown(rct_window* w, rct_widget* widget, uint8_t currentEdgeType);
namespace LandTool
{
uint32_t SizeToSpriteIndex(uint16_t size);
void ShowSurfaceStyleDropdown(rct_window* w, rct_widget* widget, uint8_t currentSurfaceType);
void ShowEdgeStyleDropdown(rct_window* w, rct_widget* widget, uint8_t currentEdgeType);
} // namespace LandTool

View File

@ -625,7 +625,7 @@ namespace ThemeManager
if (!configValid)
{
String::DiscardDuplicate(&gConfigInterface.current_theme_preset, theme_manager_get_available_theme_config_name(1));
String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(1));
}
}
@ -658,38 +658,38 @@ namespace ThemeManager
}
} // namespace ThemeManager
void theme_manager_load_available_themes()
void ThemeManagerLoadAvailableThemes()
{
ThemeManager::GetAvailableThemes(&ThemeManager::AvailableThemes);
}
size_t theme_manager_get_num_available_themes()
size_t ThemeManagerGetNumAvailableThemes()
{
return ThemeManager::AvailableThemes.size();
}
const utf8* theme_manager_get_available_theme_path(size_t index)
const utf8* ThemeManagerGetAvailableThemePath(size_t index)
{
return ThemeManager::AvailableThemes[index].Path.c_str();
}
const utf8* theme_manager_get_available_theme_config_name(size_t index)
const utf8* ThemeManagerGetAvailableThemeConfigName(size_t index)
{
return ThemeManager::AvailableThemes[index].Name.c_str();
}
const utf8* theme_manager_get_available_theme_name(size_t index)
const utf8* ThemeManagerGetAvailableThemeName(size_t index)
{
if (index < ThemeManager::NumPredefinedThemes)
return language_get_string(PredefinedThemes[index].Name);
return ThemeManager::AvailableThemes[index].Name.c_str();
}
size_t theme_manager_get_active_available_theme_index()
size_t ThemeManagerGetAvailableThemeIndex()
{
return ThemeManager::ActiveAvailableThemeIndex;
}
void theme_manager_set_active_available_theme(size_t index)
void ThemeManagerSetActiveAvailableTheme(size_t index)
{
if (index < ThemeManager::NumPredefinedThemes)
{
@ -707,17 +707,17 @@ void theme_manager_set_active_available_theme(size_t index)
}
}
ThemeManager::ActiveAvailableThemeIndex = index;
String::DiscardDuplicate(&gConfigInterface.current_theme_preset, theme_manager_get_available_theme_config_name(index));
String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(index));
colour_scheme_update_all();
ColourSchemeUpdateAll();
}
size_t theme_get_index_for_name(const utf8* name)
size_t ThemeGetIndexForName(const utf8* name)
{
size_t count = ThemeManager::AvailableThemes.size();
for (size_t i = 0; i < count; i++)
{
const utf8* tn = theme_manager_get_available_theme_name(i);
const utf8* tn = ThemeManagerGetAvailableThemeName(i);
if (String::Equals(tn, name, true))
{
return i;
@ -726,7 +726,7 @@ size_t theme_get_index_for_name(const utf8* name)
return SIZE_MAX;
}
uint8_t theme_get_colour(rct_windowclass wc, uint8_t index)
uint8_t ThemeGetColour(rct_windowclass wc, uint8_t index)
{
const UIThemeWindowEntry* entry = ThemeManager::CurrentTheme->GetEntry(wc);
if (entry == nullptr)
@ -744,7 +744,7 @@ uint8_t theme_get_colour(rct_windowclass wc, uint8_t index)
}
}
void theme_set_colour(rct_windowclass wc, uint8_t index, colour_t colour)
void ThemeSetColour(rct_windowclass wc, uint8_t index, colour_t colour)
{
UIThemeWindowEntry entry{};
entry.WindowClass = wc;
@ -767,27 +767,27 @@ void theme_set_colour(rct_windowclass wc, uint8_t index, colour_t colour)
entry.Theme.Colours[index] = colour;
ThemeManager::CurrentTheme->SetEntry(&entry);
theme_save();
ThemeSave();
}
uint8_t theme_get_flags()
uint8_t ThemeGetFlags()
{
return ThemeManager::CurrentTheme->Flags;
}
void theme_set_flags(uint8_t flags)
void ThemeSetFlags(uint8_t flags)
{
ThemeManager::CurrentTheme->Flags = flags;
theme_save();
ThemeSave();
}
void theme_save()
void ThemeSave()
{
ThemeManager::EnsureThemeDirectoryExists();
ThemeManager::CurrentTheme->WriteToFile(ThemeManager::CurrentThemePath);
}
void theme_rename(const utf8* name)
void ThemeRename(const utf8* name)
{
const auto oldPath = ThemeManager::CurrentThemePath;
@ -799,19 +799,19 @@ void theme_rename(const utf8* name)
ThemeManager::CurrentTheme->Name = name;
ThemeManager::CurrentTheme->WriteToFile(ThemeManager::CurrentThemePath);
theme_manager_load_available_themes();
ThemeManagerLoadAvailableThemes();
for (size_t i = 0; i < ThemeManager::AvailableThemes.size(); i++)
{
if (Path::Equals(newPath, ThemeManager::AvailableThemes[i].Path))
{
ThemeManager::ActiveAvailableThemeIndex = i;
String::DiscardDuplicate(&gConfigInterface.current_theme_preset, theme_manager_get_available_theme_config_name(1));
String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(1));
break;
}
}
}
void theme_duplicate(const utf8* name)
void ThemeDuplicate(const utf8* name)
{
ThemeManager::EnsureThemeDirectoryExists();
auto newPath = ThemeManager::GetThemeFileName(name);
@ -825,32 +825,32 @@ void theme_duplicate(const utf8* name)
ThemeManager::LoadTheme(newPath);
theme_manager_load_available_themes();
ThemeManagerLoadAvailableThemes();
for (size_t i = 0; i < ThemeManager::AvailableThemes.size(); i++)
{
if (Path::Equals(newPath, ThemeManager::AvailableThemes[i].Path))
{
ThemeManager::ActiveAvailableThemeIndex = i;
String::DiscardDuplicate(&gConfigInterface.current_theme_preset, theme_manager_get_available_theme_config_name(i));
String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(i));
break;
}
}
}
void theme_delete()
void ThemeDelete()
{
File::Delete(ThemeManager::CurrentThemePath);
ThemeManager::LoadTheme(const_cast<UITheme*>(&PredefinedThemeRCT2));
ThemeManager::ActiveAvailableThemeIndex = 1;
String::DiscardDuplicate(&gConfigInterface.current_theme_preset, theme_manager_get_available_theme_config_name(1));
String::DiscardDuplicate(&gConfigInterface.current_theme_preset, ThemeManagerGetAvailableThemeConfigName(1));
}
void theme_manager_initialise()
void ThemeManagerInitialise()
{
ThemeManager::Initialise();
}
uint8_t theme_desc_get_num_colours(rct_windowclass wc)
uint8_t ThemeDescGetNumColours(rct_windowclass wc)
{
const WindowThemeDesc* desc = GetWindowThemeDescriptor(wc);
if (desc == nullptr)
@ -860,7 +860,7 @@ uint8_t theme_desc_get_num_colours(rct_windowclass wc)
return desc->NumColours;
}
rct_string_id theme_desc_get_name(rct_windowclass wc)
rct_string_id ThemeDescGetName(rct_windowclass wc)
{
const WindowThemeDesc* desc = GetWindowThemeDescriptor(wc);
if (desc == nullptr)
@ -870,17 +870,17 @@ rct_string_id theme_desc_get_name(rct_windowclass wc)
return desc->WindowName;
}
void colour_scheme_update_all()
void ColourSchemeUpdateAll()
{
window_visit_each([](rct_window* w) { colour_scheme_update(w); });
window_visit_each([](rct_window* w) { ColourSchemeUpdate(w); });
}
void colour_scheme_update(rct_window* window)
void ColourSchemeUpdate(rct_window* window)
{
colour_scheme_update_by_class(window, window->classification);
ColourSchemeUpdateByClass(window, window->classification);
}
void colour_scheme_update_by_class(rct_window* window, rct_windowclass classification)
void ColourSchemeUpdateByClass(rct_window* window, rct_windowclass classification)
{
const WindowTheme* windowTheme;
const UIThemeWindowEntry* entry = ThemeManager::CurrentTheme->GetEntry(classification);

View File

@ -21,28 +21,28 @@ enum
UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR = 1 << 4,
};
void colour_scheme_update(rct_window* window);
void colour_scheme_update_all();
void colour_scheme_update_by_class(rct_window* window, rct_windowclass classification);
void ColourSchemeUpdate(rct_window* window);
void ColourSchemeUpdateAll();
void ColourSchemeUpdateByClass(rct_window* window, rct_windowclass classification);
void theme_manager_initialise();
void theme_manager_load_available_themes();
size_t theme_manager_get_num_available_themes();
const utf8* theme_manager_get_available_theme_path(size_t index);
const utf8* theme_manager_get_available_theme_config_name(size_t index);
const utf8* theme_manager_get_available_theme_name(size_t index);
size_t theme_manager_get_active_available_theme_index();
void theme_manager_set_active_available_theme(size_t index);
size_t theme_get_index_for_name(const utf8* name);
void ThemeManagerInitialise();
void ThemeManagerLoadAvailableThemes();
size_t ThemeManagerGetNumAvailableThemes();
const utf8* ThemeManagerGetAvailableThemePath(size_t index);
const utf8* ThemeManagerGetAvailableThemeConfigName(size_t index);
const utf8* ThemeManagerGetAvailableThemeName(size_t index);
size_t ThemeManagerGetAvailableThemeIndex();
void ThemeManagerSetActiveAvailableTheme(size_t index);
size_t ThemeGetIndexForName(const utf8* name);
colour_t theme_get_colour(rct_windowclass wc, uint8_t index);
void theme_set_colour(rct_windowclass wc, uint8_t index, colour_t colour);
uint8_t theme_get_flags();
void theme_set_flags(uint8_t flags);
void theme_save();
void theme_rename(const utf8* name);
void theme_duplicate(const utf8* name);
void theme_delete();
colour_t ThemeGetColour(rct_windowclass wc, uint8_t index);
void ThemeSetColour(rct_windowclass wc, uint8_t index, colour_t colour);
uint8_t ThemeGetFlags();
void ThemeSetFlags(uint8_t flags);
void ThemeSave();
void ThemeRename(const utf8* name);
void ThemeDuplicate(const utf8* name);
void ThemeDelete();
uint8_t theme_desc_get_num_colours(rct_windowclass wc);
rct_string_id theme_desc_get_name(rct_windowclass wc);
uint8_t ThemeDescGetNumColours(rct_windowclass wc);
rct_string_id ThemeDescGetName(rct_windowclass wc);

View File

@ -40,19 +40,19 @@
#include <openrct2/world/Surface.h>
#include <openrct2/world/Wall.h>
static void viewport_interaction_remove_scenery(TileElement* tileElement, const CoordsXY& mapCoords);
static void viewport_interaction_remove_footpath(TileElement* tileElement, const CoordsXY& mapCoords);
static void viewport_interaction_remove_footpath_item(TileElement* tileElement, const CoordsXY& mapCoords);
static void viewport_interaction_remove_park_wall(TileElement* tileElement, const CoordsXY& mapCoords);
static void viewport_interaction_remove_large_scenery(TileElement* tileElement, const CoordsXY& mapCoords);
static void viewport_interaction_remove_park_entrance(TileElement* tileElement, CoordsXY mapCoords);
static Peep* viewport_interaction_get_closest_peep(ScreenCoordsXY screenCoords, int32_t maxDistance);
static void ViewportInteractionRemoveScenery(TileElement* tileElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveFootpath(TileElement* tileElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveFootpathItem(TileElement* tileElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveParkWall(TileElement* tileElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveLargeScenery(TileElement* tileElement, const CoordsXY& mapCoords);
static void ViewportInteractionRemoveParkEntrance(TileElement* tileElement, CoordsXY mapCoords);
static Peep* ViewportInteractionGetClosestPeep(ScreenCoordsXY screenCoords, int32_t maxDistance);
/**
*
* rct2: 0x006ED9D0
*/
InteractionInfo viewport_interaction_get_item_left(const ScreenCoordsXY& screenCoords)
InteractionInfo ViewportInteractionGetItemLeft(const ScreenCoordsXY& screenCoords)
{
InteractionInfo info{};
// No click input for scenario editor or track manager
@ -133,7 +133,7 @@ InteractionInfo viewport_interaction_get_item_left(const ScreenCoordsXY& screenC
// If nothing is under cursor, find a close by peep
if (info.SpriteType == VIEWPORT_INTERACTION_ITEM_NONE)
{
auto peep = viewport_interaction_get_closest_peep(screenCoords, 32);
auto peep = ViewportInteractionGetClosestPeep(screenCoords, 32);
if (peep != nullptr)
{
info.Entity = peep;
@ -147,9 +147,9 @@ InteractionInfo viewport_interaction_get_item_left(const ScreenCoordsXY& screenC
return info;
}
bool viewport_interaction_left_over(const ScreenCoordsXY& screenCoords)
bool ViewportInteractionLeftOver(const ScreenCoordsXY& screenCoords)
{
auto info = viewport_interaction_get_item_left(screenCoords);
auto info = ViewportInteractionGetItemLeft(screenCoords);
switch (info.SpriteType)
{
@ -162,9 +162,9 @@ bool viewport_interaction_left_over(const ScreenCoordsXY& screenCoords)
}
}
bool viewport_interaction_left_click(const ScreenCoordsXY& screenCoords)
bool ViewportInteractionLeftClick(const ScreenCoordsXY& screenCoords)
{
auto info = viewport_interaction_get_item_left(screenCoords);
auto info = ViewportInteractionGetItemLeft(screenCoords);
switch (info.SpriteType)
{
@ -232,7 +232,7 @@ bool viewport_interaction_left_click(const ScreenCoordsXY& screenCoords)
*
* rct2: 0x006EDE88
*/
InteractionInfo viewport_interaction_get_item_right(const ScreenCoordsXY& screenCoords)
InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoords)
{
rct_scenery_entry* sceneryEntry;
Ride* ride;
@ -496,9 +496,9 @@ InteractionInfo viewport_interaction_get_item_right(const ScreenCoordsXY& screen
return info;
}
bool viewport_interaction_right_over(const ScreenCoordsXY& screenCoords)
bool ViewportInteractionRightOver(const ScreenCoordsXY& screenCoords)
{
auto info = viewport_interaction_get_item_right(screenCoords);
auto info = ViewportInteractionGetItemRight(screenCoords);
return info.SpriteType != VIEWPORT_INTERACTION_ITEM_NONE;
}
@ -507,10 +507,10 @@ bool viewport_interaction_right_over(const ScreenCoordsXY& screenCoords)
*
* rct2: 0x006E8A62
*/
bool viewport_interaction_right_click(const ScreenCoordsXY& screenCoords)
bool ViewportInteractionRightClick(const ScreenCoordsXY& screenCoords)
{
CoordsXYE tileElement;
auto info = viewport_interaction_get_item_right(screenCoords);
auto info = ViewportInteractionGetItemRight(screenCoords);
switch (info.SpriteType)
{
@ -543,22 +543,22 @@ bool viewport_interaction_right_click(const ScreenCoordsXY& screenCoords)
ride_modify(&tileElement);
break;
case VIEWPORT_INTERACTION_ITEM_SCENERY:
viewport_interaction_remove_scenery(info.Element, info.Loc);
ViewportInteractionRemoveScenery(info.Element, info.Loc);
break;
case VIEWPORT_INTERACTION_ITEM_FOOTPATH:
viewport_interaction_remove_footpath(info.Element, info.Loc);
ViewportInteractionRemoveFootpath(info.Element, info.Loc);
break;
case VIEWPORT_INTERACTION_ITEM_FOOTPATH_ITEM:
viewport_interaction_remove_footpath_item(info.Element, info.Loc);
ViewportInteractionRemoveFootpathItem(info.Element, info.Loc);
break;
case VIEWPORT_INTERACTION_ITEM_PARK:
viewport_interaction_remove_park_entrance(info.Element, info.Loc);
ViewportInteractionRemoveParkEntrance(info.Element, info.Loc);
break;
case VIEWPORT_INTERACTION_ITEM_WALL:
viewport_interaction_remove_park_wall(info.Element, info.Loc);
ViewportInteractionRemoveParkWall(info.Element, info.Loc);
break;
case VIEWPORT_INTERACTION_ITEM_LARGE_SCENERY:
viewport_interaction_remove_large_scenery(info.Element, info.Loc);
ViewportInteractionRemoveLargeScenery(info.Element, info.Loc);
break;
case VIEWPORT_INTERACTION_ITEM_BANNER:
context_open_detail_window(WD_BANNER, info.Element->AsBanner()->GetIndex());
@ -572,7 +572,7 @@ bool viewport_interaction_right_click(const ScreenCoordsXY& screenCoords)
*
* rct2: 0x006E08D2
*/
static void viewport_interaction_remove_scenery(TileElement* tileElement, const CoordsXY& mapCoords)
static void ViewportInteractionRemoveScenery(TileElement* tileElement, const CoordsXY& mapCoords)
{
auto removeSceneryAction = SmallSceneryRemoveAction(
{ mapCoords.x, mapCoords.y, tileElement->GetBaseZ() }, tileElement->AsSmallScenery()->GetSceneryQuadrant(),
@ -585,7 +585,7 @@ static void viewport_interaction_remove_scenery(TileElement* tileElement, const
*
* rct2: 0x006A614A
*/
static void viewport_interaction_remove_footpath(TileElement* tileElement, const CoordsXY& mapCoords)
static void ViewportInteractionRemoveFootpath(TileElement* tileElement, const CoordsXY& mapCoords)
{
rct_window* w;
TileElement* tileElement2;
@ -613,7 +613,7 @@ static void viewport_interaction_remove_footpath(TileElement* tileElement, const
*
* rct2: 0x006A61AB
*/
static void viewport_interaction_remove_footpath_item(TileElement* tileElement, const CoordsXY& mapCoords)
static void ViewportInteractionRemoveFootpathItem(TileElement* tileElement, const CoordsXY& mapCoords)
{
auto footpathAdditionRemoveAction = FootpathAdditionRemoveAction({ mapCoords.x, mapCoords.y, tileElement->GetBaseZ() });
GameActions::Execute(&footpathAdditionRemoveAction);
@ -623,7 +623,7 @@ static void viewport_interaction_remove_footpath_item(TileElement* tileElement,
*
* rct2: 0x00666C0E
*/
void viewport_interaction_remove_park_entrance(TileElement* tileElement, CoordsXY mapCoords)
void ViewportInteractionRemoveParkEntrance(TileElement* tileElement, CoordsXY mapCoords)
{
int32_t rotation = tileElement->GetDirectionWithOffset(1);
switch (tileElement->AsEntrance()->GetSequenceIndex())
@ -643,7 +643,7 @@ void viewport_interaction_remove_park_entrance(TileElement* tileElement, CoordsX
*
* rct2: 0x006E57A9
*/
static void viewport_interaction_remove_park_wall(TileElement* tileElement, const CoordsXY& mapCoords)
static void ViewportInteractionRemoveParkWall(TileElement* tileElement, const CoordsXY& mapCoords)
{
rct_scenery_entry* sceneryEntry = tileElement->AsWall()->GetEntry();
if (sceneryEntry->wall.scrolling_mode != SCROLLING_MODE_NONE)
@ -662,7 +662,7 @@ static void viewport_interaction_remove_park_wall(TileElement* tileElement, cons
*
* rct2: 0x006B88DC
*/
static void viewport_interaction_remove_large_scenery(TileElement* tileElement, const CoordsXY& mapCoords)
static void ViewportInteractionRemoveLargeScenery(TileElement* tileElement, const CoordsXY& mapCoords)
{
rct_scenery_entry* sceneryEntry = tileElement->AsLargeScenery()->GetEntry();
@ -680,7 +680,7 @@ static void viewport_interaction_remove_large_scenery(TileElement* tileElement,
}
}
static Peep* viewport_interaction_get_closest_peep(ScreenCoordsXY screenCoords, int32_t maxDistance)
static Peep* ViewportInteractionGetClosestPeep(ScreenCoordsXY screenCoords, int32_t maxDistance)
{
rct_window* w;
rct_viewport* viewport;
@ -721,7 +721,7 @@ static Peep* viewport_interaction_get_closest_peep(ScreenCoordsXY screenCoords,
*
* rct2: 0x0068A15E
*/
CoordsXY sub_68A15E(const ScreenCoordsXY& screenCoords)
CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoords)
{
rct_window* window = window_find_from_point(screenCoords);
if (window == nullptr || window->viewport == nullptr)

View File

@ -171,7 +171,7 @@ rct_window* window_create(
w->var_4AE = 0;
w->viewport_smart_follow_sprite = SPRITE_INDEX_NULL;
colour_scheme_update(w);
ColourSchemeUpdate(w);
w->Invalidate();
return w;
}

View File

@ -206,7 +206,7 @@ static void window_clear_scenery_invalidate(rct_window* w)
| (gClearLargeScenery ? (1 << WIDX_LARGE_SCENERY) : 0) | (gClearFootpath ? (1 << WIDX_FOOTPATH) : 0);
// Update the preview image (for tool sizes up to 7)
window_clear_scenery_widgets[WIDX_PREVIEW].image = land_tool_size_to_sprite_index(gLandToolSize);
window_clear_scenery_widgets[WIDX_PREVIEW].image = LandTool::SizeToSpriteIndex(gLandToolSize);
}
/**

View File

@ -315,7 +315,7 @@ static void hide_next_step_button()
*/
void window_editor_bottom_toolbar_invalidate(rct_window* w)
{
colour_scheme_update_by_class(
ColourSchemeUpdateByClass(
w, (gScreenFlags & SCREEN_FLAGS_SCENARIO_EDITOR) ? WC_EDITOR_SCENARIO_BOTTOM_TOOLBAR : WC_EDITOR_TRACK_BOTTOM_TOOLBAR);
uint16_t screenWidth = context_get_width();

View File

@ -283,7 +283,7 @@ static void window_game_bottom_toolbar_invalidate(rct_window* w)
if (News::IsQueueEmpty())
{
if (!(theme_get_flags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR))
if (!(ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR))
{
window_game_bottom_toolbar_widgets[WIDX_MIDDLE_OUTSET].type = WWT_EMPTY;
window_game_bottom_toolbar_widgets[WIDX_MIDDLE_INSET].type = WWT_EMPTY;
@ -362,7 +362,7 @@ static void window_game_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* d
w->windowPos.x + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].right,
w->windowPos.y + window_game_bottom_toolbar_widgets[WIDX_RIGHT_OUTSET].bottom, PALETTE_51);
if (theme_get_flags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)
if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)
{
// Draw grey background
gfx_filter_rect(
@ -381,7 +381,7 @@ static void window_game_bottom_toolbar_paint(rct_window* w, rct_drawpixelinfo* d
{
window_game_bottom_toolbar_draw_news_item(dpi, w);
}
else if (theme_get_flags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)
else if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)
{
window_game_bottom_toolbar_draw_middle_panel(dpi, w);
}

View File

@ -160,10 +160,10 @@ static void window_land_mousedown(rct_window* w, rct_widgetindex widgetIndex, rc
switch (widgetIndex)
{
case WIDX_FLOOR:
land_tool_show_surface_style_dropdown(w, widget, _selectedFloorTexture);
LandTool::ShowSurfaceStyleDropdown(w, widget, _selectedFloorTexture);
break;
case WIDX_WALL:
land_tool_show_edge_style_dropdown(w, widget, _selectedWallTexture);
LandTool::ShowEdgeStyleDropdown(w, widget, _selectedWallTexture);
break;
case WIDX_PREVIEW:
window_land_inputsize(w);
@ -308,7 +308,7 @@ static void window_land_invalidate(rct_window* w)
window_land_widgets[WIDX_FLOOR].image = surfaceImage;
window_land_widgets[WIDX_WALL].image = edgeImage;
// Update the preview image (for tool sizes up to 7)
window_land_widgets[WIDX_PREVIEW].image = land_tool_size_to_sprite_index(gLandToolSize);
window_land_widgets[WIDX_PREVIEW].image = LandTool::SizeToSpriteIndex(gLandToolSize);
}
/**

View File

@ -227,7 +227,7 @@ static void window_land_rights_invalidate(rct_window* w)
: WIDX_BUY_CONSTRUCTION_RIGHTS));
// Update the preview image
window_land_rights_widgets[WIDX_PREVIEW].image = land_tool_size_to_sprite_index(gLandToolSize);
window_land_rights_widgets[WIDX_PREVIEW].image = LandTool::SizeToSpriteIndex(gLandToolSize);
// Disable ownership and/or construction buying functions if there are no tiles left for sale
if (gLandRemainingOwnershipSales == 0)

View File

@ -776,7 +776,7 @@ static void window_map_invalidate(rct_window* w)
for (i = 0; i < 4; i++)
w->widgets[WIDX_LAND_OWNED_CHECKBOX + i].type = WWT_CHECKBOX;
w->widgets[WIDX_LAND_TOOL].image = land_tool_size_to_sprite_index(_landRightsToolSize);
w->widgets[WIDX_LAND_TOOL].image = LandTool::SizeToSpriteIndex(_landRightsToolSize);
}
}
else
@ -1172,7 +1172,7 @@ static void window_map_set_land_rights_tool_update(const ScreenCoordsXY& screenC
static CoordsXYZD place_park_entrance_get_map_position(const ScreenCoordsXY& screenCoords)
{
CoordsXYZD parkEntranceMapPosition{ 0, 0, 0, INVALID_DIRECTION };
const CoordsXY mapCoords = sub_68A15E(screenCoords);
const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords);
parkEntranceMapPosition = { mapCoords.x, mapCoords.y, 0, INVALID_DIRECTION };
if (parkEntranceMapPosition.isNull())
return parkEntranceMapPosition;

View File

@ -557,10 +557,10 @@ static void window_mapgen_base_mousedown(rct_window* w, rct_widgetindex widgetIn
w->Invalidate();
break;
case WIDX_FLOOR_TEXTURE:
land_tool_show_surface_style_dropdown(w, widget, _floorTexture);
LandTool::ShowSurfaceStyleDropdown(w, widget, _floorTexture);
break;
case WIDX_WALL_TEXTURE:
land_tool_show_edge_style_dropdown(w, widget, _wallTexture);
LandTool::ShowEdgeStyleDropdown(w, widget, _wallTexture);
break;
}
}
@ -891,10 +891,10 @@ static void window_mapgen_simplex_mousedown(rct_window* w, rct_widgetindex widge
w->Invalidate();
break;
case WIDX_SIMPLEX_FLOOR_TEXTURE:
land_tool_show_surface_style_dropdown(w, widget, _floorTexture);
LandTool::ShowSurfaceStyleDropdown(w, widget, _floorTexture);
break;
case WIDX_SIMPLEX_WALL_TEXTURE:
land_tool_show_edge_style_dropdown(w, widget, _wallTexture);
LandTool::ShowEdgeStyleDropdown(w, widget, _wallTexture);
break;
case WIDX_SIMPLEX_PLACE_TREES_CHECKBOX:
_placeTrees ^= 1;

View File

@ -57,7 +57,7 @@ const Formatter& GetMapTooltip()
*/
void window_map_tooltip_update_visibility()
{
if (theme_get_flags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)
if (ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR)
{
// The map tooltip is drawn by the bottom toolbar
window_invalidate_by_class(WC_BOTTOM_TOOLBAR);

View File

@ -1663,19 +1663,19 @@ static void window_options_controls_mousedown(rct_window* w, rct_widgetindex wid
switch (widgetIndex)
{
case WIDX_THEMES_DROPDOWN:
uint32_t num_items = static_cast<uint32_t>(theme_manager_get_num_available_themes());
uint32_t num_items = static_cast<uint32_t>(ThemeManagerGetNumAvailableThemes());
for (size_t i = 0; i < num_items; i++)
{
gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM;
gDropdownItemsArgs[i] = reinterpret_cast<uintptr_t>(theme_manager_get_available_theme_name(i));
gDropdownItemsArgs[i] = reinterpret_cast<uintptr_t>(ThemeManagerGetAvailableThemeName(i));
}
WindowDropdownShowTextCustomWidth(
{ w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[1], 0,
Dropdown::Flag::StayOpen, num_items, widget->width() - 3);
Dropdown::SetChecked(static_cast<int32_t>(theme_manager_get_active_available_theme_index()), true);
Dropdown::SetChecked(static_cast<int32_t>(ThemeManagerGetAvailableThemeIndex()), true);
widget_invalidate(w, WIDX_THEMES_DROPDOWN);
break;
}
@ -1691,7 +1691,7 @@ static void window_options_controls_dropdown(rct_window* w, rct_widgetindex widg
case WIDX_THEMES_DROPDOWN:
if (dropdownIndex != -1)
{
theme_manager_set_active_available_theme(dropdownIndex);
ThemeManagerSetActiveAvailableTheme(dropdownIndex);
}
config_save_default();
break;
@ -1713,8 +1713,8 @@ static void window_options_controls_invalidate(rct_window* w)
widget_set_checkbox_value(w, WIDX_TOOLBAR_SHOW_MUTE, gConfigInterface.toolbar_show_mute);
widget_set_checkbox_value(w, WIDX_TOOLBAR_SHOW_CHAT, gConfigInterface.toolbar_show_chat);
size_t activeAvailableThemeIndex = theme_manager_get_active_available_theme_index();
const utf8* activeThemeName = theme_manager_get_available_theme_name(activeAvailableThemeIndex);
size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex();
const utf8* activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex);
auto ft = Formatter::Common();
ft.Add<utf8*>(activeThemeName);

View File

@ -662,7 +662,7 @@ static void window_park_entrance_invalidate(rct_window* w)
window_park_entrance_widgets[WIDX_STATUS].top = w->height - 13;
window_park_entrance_widgets[WIDX_STATUS].bottom = w->height - 3;
if (theme_get_flags() & UITHEME_FLAG_USE_LIGHTS_PARK)
if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_PARK)
{
window_park_entrance_widgets[WIDX_OPEN_OR_CLOSE].type = WWT_EMPTY;
if (gScenarioObjective.Type == OBJECTIVE_GUESTS_AND_RATING)

View File

@ -1818,7 +1818,7 @@ static void window_ride_main_mouseup(rct_window* w, rct_widgetindex widgetIndex)
static void window_ride_main_resize(rct_window* w)
{
int32_t minHeight = 180;
if (theme_get_flags() & UITHEME_FLAG_USE_LIGHTS_RIDE)
if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE)
{
minHeight += 20 + RCT1_LIGHT_OFFSET;
@ -2426,7 +2426,7 @@ static void window_ride_main_invalidate(rct_window* w)
window_align_tabs(w, WIDX_TAB_1, WIDX_TAB_10);
if (theme_get_flags() & UITHEME_FLAG_USE_LIGHTS_RIDE)
if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE)
{
window_ride_main_widgets[WIDX_OPEN].type = WWT_EMPTY;
window_ride_main_widgets[WIDX_CLOSE_LIGHT].type = WWT_IMGBTN;

View File

@ -2151,7 +2151,7 @@ static std::optional<CoordsXY> ride_get_place_position_from_screen_position(Scre
if (!_trackPlaceCtrlState)
{
mapCoords = sub_68A15E(screenCoords);
mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords);
if (mapCoords.isNull())
return std::nullopt;

View File

@ -512,7 +512,7 @@ static void window_ride_list_invalidate(rct_window* w)
w->widgets[WIDX_QUICK_DEMOLISH].right = w->width - 2;
w->widgets[WIDX_QUICK_DEMOLISH].left = w->width - 25;
if (theme_get_flags() & UITHEME_FLAG_USE_LIGHTS_RIDE)
if (ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE)
{
w->widgets[WIDX_OPEN_CLOSE_ALL].type = WWT_EMPTY;
w->widgets[WIDX_CLOSE_LIGHT].type = WWT_IMGBTN;

View File

@ -424,8 +424,8 @@ static void window_scenarioselect_paint(rct_window* w, rct_drawpixelinfo* dpi)
window_draw_widgets(w, dpi);
format = (theme_get_flags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT) ? STR_SMALL_WINDOW_COLOUR_2_STRINGID
: STR_WINDOW_COLOUR_2_STRINGID;
format = (ThemeGetFlags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT) ? STR_SMALL_WINDOW_COLOUR_2_STRINGID
: STR_WINDOW_COLOUR_2_STRINGID;
// Text for each tab
for (uint32_t i = 0; i < std::size(ScenarioOriginStringIds); i++)
@ -543,10 +543,10 @@ static void window_scenarioselect_scrollpaint(rct_window* w, rct_drawpixelinfo*
uint8_t paletteIndex = ColourMapA[w->colours[1]].mid_light;
gfx_clear(dpi, paletteIndex);
rct_string_id highlighted_format = (theme_get_flags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT)
rct_string_id highlighted_format = (ThemeGetFlags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT)
? STR_WHITE_STRING
: STR_WINDOW_COLOUR_2_STRINGID;
rct_string_id unhighlighted_format = (theme_get_flags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT)
rct_string_id unhighlighted_format = (ThemeGetFlags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT)
? STR_WHITE_STRING
: STR_BLACK_STRING;

View File

@ -204,7 +204,7 @@ static void window_scenery_scatter_invalidate(rct_window* w)
}
// Update the preview image (for tool sizes up to 7)
window_scenery_scatter_widgets[WIDX_PREVIEW].image = land_tool_size_to_sprite_index(gWindowSceneryScatterSize);
window_scenery_scatter_widgets[WIDX_PREVIEW].image = LandTool::SizeToSpriteIndex(gWindowSceneryScatterSize);
}
static void window_scenery_scatter_paint(rct_window* w, rct_drawpixelinfo* dpi)

View File

@ -307,7 +307,7 @@ static void window_server_start_textinput(rct_window* w, rct_widgetindex widgetI
static void window_server_start_invalidate(rct_window* w)
{
colour_scheme_update_by_class(w, WC_SERVER_LIST);
ColourSchemeUpdateByClass(w, WC_SERVER_LIST);
widget_set_checkbox_value(w, WIDX_ADVERTISE_CHECKBOX, gConfigNetwork.advertise);
auto ft = Formatter::Common();

View File

@ -735,7 +735,7 @@ void window_staff_unknown_05(rct_window* w)
*/
void window_staff_stats_invalidate(rct_window* w)
{
colour_scheme_update_by_class(w, static_cast<rct_windowclass>(WC_STAFF));
ColourSchemeUpdateByClass(w, static_cast<rct_windowclass>(WC_STAFF));
if (window_staff_page_widgets[w->page] != w->widgets)
{
@ -774,7 +774,7 @@ void window_staff_stats_invalidate(rct_window* w)
*/
void window_staff_options_invalidate(rct_window* w)
{
colour_scheme_update_by_class(w, static_cast<rct_windowclass>(WC_STAFF));
ColourSchemeUpdateByClass(w, static_cast<rct_windowclass>(WC_STAFF));
if (window_staff_page_widgets[w->page] != w->widgets)
{
@ -856,7 +856,7 @@ void window_staff_options_invalidate(rct_window* w)
*/
void window_staff_overview_invalidate(rct_window* w)
{
colour_scheme_update_by_class(w, static_cast<rct_windowclass>(WC_STAFF));
ColourSchemeUpdateByClass(w, static_cast<rct_windowclass>(WC_STAFF));
if (window_staff_page_widgets[w->page] != w->widgets)
{

View File

@ -354,31 +354,31 @@ static void window_themes_mouseup(rct_window* w, rct_widgetindex widgetIndex)
window_close(w);
break;
case WIDX_THEMES_DUPLICATE_BUTTON:;
activeAvailableThemeIndex = theme_manager_get_active_available_theme_index();
activeThemeName = theme_manager_get_available_theme_name(activeAvailableThemeIndex);
activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex();
activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex);
window_text_input_open(
w, widgetIndex, STR_TITLE_EDITOR_ACTION_DUPLICATE, STR_THEMES_PROMPT_ENTER_THEME_NAME, STR_STRING,
reinterpret_cast<uintptr_t>(activeThemeName), 64);
break;
case WIDX_THEMES_DELETE_BUTTON:
if (theme_get_flags() & UITHEME_FLAG_PREDEFINED)
if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED)
{
context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {});
}
else
{
theme_delete();
ThemeDelete();
}
break;
case WIDX_THEMES_RENAME_BUTTON:
if (theme_get_flags() & UITHEME_FLAG_PREDEFINED)
if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED)
{
context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {});
}
else
{
activeAvailableThemeIndex = theme_manager_get_active_available_theme_index();
activeThemeName = theme_manager_get_available_theme_name(activeAvailableThemeIndex);
activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex();
activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex);
window_text_input_open(
w, widgetIndex, STR_TRACK_MANAGE_RENAME, STR_THEMES_PROMPT_ENTER_THEME_NAME, STR_STRING,
reinterpret_cast<uintptr_t>(activeThemeName), 64);
@ -501,67 +501,67 @@ static void window_themes_mousedown(rct_window* w, rct_widgetindex widgetIndex,
w->Invalidate();
break;
case WIDX_THEMES_PRESETS_DROPDOWN:
theme_manager_load_available_themes();
num_items = static_cast<int32_t>(theme_manager_get_num_available_themes());
ThemeManagerLoadAvailableThemes();
num_items = static_cast<int32_t>(ThemeManagerGetNumAvailableThemes());
widget--;
for (int32_t i = 0; i < num_items; i++)
{
gDropdownItemsFormat[i] = STR_OPTIONS_DROPDOWN_ITEM;
gDropdownItemsArgs[i] = reinterpret_cast<uintptr_t>(theme_manager_get_available_theme_name(i));
gDropdownItemsArgs[i] = reinterpret_cast<uintptr_t>(ThemeManagerGetAvailableThemeName(i));
}
WindowDropdownShowTextCustomWidth(
{ w->windowPos.x + widget->left, w->windowPos.y + widget->top }, widget->height() + 1, w->colours[1], 0,
Dropdown::Flag::StayOpen, num_items, widget->width() - 3);
Dropdown::SetChecked(static_cast<int32_t>(theme_manager_get_active_available_theme_index()), true);
Dropdown::SetChecked(static_cast<int32_t>(ThemeManagerGetAvailableThemeIndex()), true);
break;
case WIDX_THEMES_RCT1_RIDE_LIGHTS:
if (theme_get_flags() & UITHEME_FLAG_PREDEFINED)
if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED)
{
context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {});
}
else
{
theme_set_flags(theme_get_flags() ^ UITHEME_FLAG_USE_LIGHTS_RIDE);
theme_save();
ThemeSetFlags(ThemeGetFlags() ^ UITHEME_FLAG_USE_LIGHTS_RIDE);
ThemeSave();
window_invalidate_all();
}
break;
case WIDX_THEMES_RCT1_PARK_LIGHTS:
if (theme_get_flags() & UITHEME_FLAG_PREDEFINED)
if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED)
{
context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {});
}
else
{
theme_set_flags(theme_get_flags() ^ UITHEME_FLAG_USE_LIGHTS_PARK);
theme_save();
ThemeSetFlags(ThemeGetFlags() ^ UITHEME_FLAG_USE_LIGHTS_PARK);
ThemeSave();
window_invalidate_all();
}
break;
case WIDX_THEMES_RCT1_SCENARIO_FONT:
if (theme_get_flags() & UITHEME_FLAG_PREDEFINED)
if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED)
{
context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {});
}
else
{
theme_set_flags(theme_get_flags() ^ UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT);
theme_save();
ThemeSetFlags(ThemeGetFlags() ^ UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT);
ThemeSave();
window_invalidate_all();
}
break;
case WIDX_THEMES_RCT1_BOTTOM_TOOLBAR:
if (theme_get_flags() & UITHEME_FLAG_PREDEFINED)
if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED)
{
context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_NONE, {});
}
else
{
theme_set_flags(theme_get_flags() ^ UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR);
theme_save();
ThemeSetFlags(ThemeGetFlags() ^ UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR);
ThemeSave();
window_invalidate_all();
}
}
@ -575,10 +575,10 @@ static void window_themes_dropdown(rct_window* w, rct_widgetindex widgetIndex, i
if (dropdownIndex != -1)
{
rct_windowclass wc = get_window_class_tab_index(_colour_index_1);
uint8_t colour = theme_get_colour(wc, _colour_index_2);
uint8_t colour = ThemeGetColour(wc, _colour_index_2);
colour = (colour & COLOUR_FLAG_TRANSLUCENT) | dropdownIndex;
theme_set_colour(wc, _colour_index_2, colour);
colour_scheme_update_all();
ThemeSetColour(wc, _colour_index_2, colour);
ColourSchemeUpdateAll();
window_invalidate_all();
_colour_index_1 = -1;
_colour_index_2 = -1;
@ -587,7 +587,7 @@ static void window_themes_dropdown(rct_window* w, rct_widgetindex widgetIndex, i
case WIDX_THEMES_PRESETS_DROPDOWN:
if (dropdownIndex != -1)
{
theme_manager_set_active_available_theme(dropdownIndex);
ThemeManagerSetActiveAvailableTheme(dropdownIndex);
}
break;
}
@ -631,13 +631,13 @@ void window_themes_scrollmousedown(rct_window* w, int32_t scrollIndex, const Scr
_colour_index_2 = ((screenCoords.x - _button_offset_x) / 12);
rct_windowclass wc = get_window_class_tab_index(_colour_index_1);
int32_t numColours = theme_desc_get_num_colours(wc);
int32_t numColours = ThemeDescGetNumColours(wc);
if (_colour_index_2 < numColours)
{
if (screenCoords.x >= _button_offset_x && screenCoords.x < _button_offset_x + 12 * 6 && y2 >= _button_offset_y
&& y2 < _button_offset_y + 11)
{
if (theme_get_flags() & UITHEME_FLAG_PREDEFINED)
if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED)
{
context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_THEMES_DESC_CANT_CHANGE_THIS_THEME, {});
}
@ -655,7 +655,7 @@ void window_themes_scrollmousedown(rct_window* w, int32_t scrollIndex, const Scr
.top
+ 12;
uint8_t colour = theme_get_colour(wc, _colour_index_2);
uint8_t colour = ThemeGetColour(wc, _colour_index_2);
WindowDropdownShowColour(w, &(window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK]), w->colours[1], colour);
widget_invalidate(w, WIDX_THEMES_LIST);
}
@ -664,13 +664,13 @@ void window_themes_scrollmousedown(rct_window* w, int32_t scrollIndex, const Scr
screenCoords.x >= _button_offset_x && screenCoords.x < _button_offset_x + 12 * 6 - 1 && y2 >= _check_offset_y
&& y2 < _check_offset_y + 11)
{
if (theme_get_flags() & UITHEME_FLAG_PREDEFINED)
if (ThemeGetFlags() & UITHEME_FLAG_PREDEFINED)
{
context_show_error(STR_THEMES_ERR_CANT_CHANGE_THIS_THEME, STR_THEMES_DESC_CANT_CHANGE_THIS_THEME, {});
}
else
{
uint8_t colour = theme_get_colour(wc, _colour_index_2);
uint8_t colour = ThemeGetColour(wc, _colour_index_2);
if (colour & COLOUR_FLAG_TRANSLUCENT)
{
colour &= ~COLOUR_FLAG_TRANSLUCENT;
@ -679,8 +679,8 @@ void window_themes_scrollmousedown(rct_window* w, int32_t scrollIndex, const Scr
{
colour |= COLOUR_FLAG_TRANSLUCENT;
}
theme_set_colour(wc, _colour_index_2, colour);
colour_scheme_update_all();
ThemeSetColour(wc, _colour_index_2, colour);
ColourSchemeUpdateAll();
window_invalidate_all();
}
}
@ -703,15 +703,15 @@ static void window_themes_textinput(rct_window* w, rct_widgetindex widgetIndex,
case WIDX_THEMES_RENAME_BUTTON:
if (filename_valid_characters(text))
{
if (theme_get_index_for_name(text) == SIZE_MAX)
if (ThemeGetIndexForName(text) == SIZE_MAX)
{
if (widgetIndex == WIDX_THEMES_DUPLICATE_BUTTON)
{
theme_duplicate(text);
ThemeDuplicate(text);
}
else
{
theme_rename(text);
ThemeRename(text);
}
w->Invalidate();
}
@ -786,11 +786,11 @@ void window_themes_invalidate(rct_window* w)
window_themes_widgets[WIDX_THEMES_PRESETS_DROPDOWN].type = WWT_EMPTY;
window_themes_widgets[WIDX_THEMES_COLOURBTN_MASK].type = WWT_EMPTY;
widget_set_checkbox_value(w, WIDX_THEMES_RCT1_RIDE_LIGHTS, theme_get_flags() & UITHEME_FLAG_USE_LIGHTS_RIDE);
widget_set_checkbox_value(w, WIDX_THEMES_RCT1_PARK_LIGHTS, theme_get_flags() & UITHEME_FLAG_USE_LIGHTS_PARK);
widget_set_checkbox_value(w, WIDX_THEMES_RCT1_RIDE_LIGHTS, ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_RIDE);
widget_set_checkbox_value(w, WIDX_THEMES_RCT1_PARK_LIGHTS, ThemeGetFlags() & UITHEME_FLAG_USE_LIGHTS_PARK);
widget_set_checkbox_value(
w, WIDX_THEMES_RCT1_SCENARIO_FONT, theme_get_flags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT);
widget_set_checkbox_value(w, WIDX_THEMES_RCT1_BOTTOM_TOOLBAR, theme_get_flags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR);
w, WIDX_THEMES_RCT1_SCENARIO_FONT, ThemeGetFlags() & UITHEME_FLAG_USE_ALTERNATIVE_SCENARIO_SELECT_FONT);
widget_set_checkbox_value(w, WIDX_THEMES_RCT1_BOTTOM_TOOLBAR, ThemeGetFlags() & UITHEME_FLAG_USE_FULL_BOTTOM_TOOLBAR);
}
else
{
@ -822,8 +822,8 @@ void window_themes_paint(rct_window* w, rct_drawpixelinfo* dpi)
dpi, STR_THEMES_LABEL_CURRENT_THEME, nullptr, w->colours[1],
w->windowPos + ScreenCoordsXY{ 10, window_themes_widgets[WIDX_THEMES_PRESETS].top + 1 });
size_t activeAvailableThemeIndex = theme_manager_get_active_available_theme_index();
const utf8* activeThemeName = theme_manager_get_available_theme_name(activeAvailableThemeIndex);
size_t activeAvailableThemeIndex = ThemeManagerGetAvailableThemeIndex();
const utf8* activeThemeName = ThemeManagerGetAvailableThemeName(activeAvailableThemeIndex);
auto ft = Formatter();
ft.Add<const utf8*>(activeThemeName);
@ -893,12 +893,12 @@ void window_themes_scrollpaint(rct_window* w, rct_drawpixelinfo* dpi, int32_t sc
}
rct_windowclass wc = get_window_class_tab_index(i);
int32_t numColours = theme_desc_get_num_colours(wc);
int32_t numColours = ThemeDescGetNumColours(wc);
for (uint8_t j = 0; j < numColours; j++)
{
gfx_draw_string_left(dpi, theme_desc_get_name(wc), nullptr, w->colours[1], { 2, screenCoords.y + 4 });
gfx_draw_string_left(dpi, ThemeDescGetName(wc), nullptr, w->colours[1], { 2, screenCoords.y + 4 });
uint8_t colour = theme_get_colour(wc, j);
uint8_t colour = ThemeGetColour(wc, j);
uint32_t image = SPRITE_ID_PALETTE_COLOUR_1(colour & ~COLOUR_FLAG_TRANSLUCENT) | SPR_PALETTE_BTN;
if (i == _colour_index_1 && j == _colour_index_2)
{

View File

@ -580,7 +580,7 @@ static void window_title_command_editor_update(rct_window* w)
static void window_title_command_editor_tool_down(
rct_window* w, rct_widgetindex widgetIndex, const ScreenCoordsXY& screenCoords)
{
auto info = viewport_interaction_get_item_left(screenCoords);
auto info = ViewportInteractionGetItemLeft(screenCoords);
if (info.SpriteType == VIEWPORT_INTERACTION_ITEM_SPRITE)
{
@ -641,7 +641,7 @@ static void window_title_command_editor_tool_down(
static void window_title_command_editor_invalidate(rct_window* w)
{
colour_scheme_update_by_class(w, WC_TITLE_EDITOR);
ColourSchemeUpdateByClass(w, WC_TITLE_EDITOR);
window_title_command_editor_widgets[WIDX_TEXTBOX_FULL].type = WWT_EMPTY;
window_title_command_editor_widgets[WIDX_TEXTBOX_X].type = WWT_EMPTY;

View File

@ -1547,7 +1547,7 @@ static void sub_6E1F34(
// If CTRL not pressed
if (!gSceneryCtrlPressed)
{
const CoordsXY mapCoords = sub_68A15E(screenPos);
const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenPos);
gridPos = mapCoords;
if (gridPos.isNull())

View File

@ -257,7 +257,7 @@ static void window_track_place_toolupdate(rct_window* w, rct_widgetindex widgetI
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
// Get the tool map position
CoordsXY mapCoords = sub_68A15E(screenCoords);
CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords);
if (mapCoords.isNull())
{
window_track_place_clear_provisional();
@ -322,7 +322,7 @@ static void window_track_place_tooldown(rct_window* w, rct_widgetindex widgetInd
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_CONSTRUCT;
gMapSelectFlags &= ~MAP_SELECT_FLAG_ENABLE_ARROW;
const CoordsXY mapCoords = sub_68A15E(screenCoords);
const CoordsXY mapCoords = ViewportInteractionGetTileStartAtCursor(screenCoords);
if (mapCoords.isNull())
return;

View File

@ -182,7 +182,7 @@ static void window_water_invalidate(rct_window* w)
w->pressed_widgets |= (1 << WIDX_PREVIEW);
// Update the preview image
window_water_widgets[WIDX_PREVIEW].image = land_tool_size_to_sprite_index(gLandToolSize);
window_water_widgets[WIDX_PREVIEW].image = LandTool::SizeToSpriteIndex(gLandToolSize);
}
/**

View File

@ -151,14 +151,14 @@ InteractionInfo get_map_coordinates_from_pos(const ScreenCoordsXY& screenCoords,
InteractionInfo get_map_coordinates_from_pos_window(rct_window* window, const ScreenCoordsXY& screenCoords, int32_t flags);
InteractionInfo set_interaction_info_from_paint_session(paint_session* session, uint16_t filter);
InteractionInfo viewport_interaction_get_item_left(const ScreenCoordsXY& screenCoords);
bool viewport_interaction_left_over(const ScreenCoordsXY& screenCoords);
bool viewport_interaction_left_click(const ScreenCoordsXY& screenCoords);
InteractionInfo viewport_interaction_get_item_right(const ScreenCoordsXY& screenCoords);
bool viewport_interaction_right_over(const ScreenCoordsXY& screenCoords);
bool viewport_interaction_right_click(const ScreenCoordsXY& screenCoords);
InteractionInfo ViewportInteractionGetItemLeft(const ScreenCoordsXY& screenCoords);
bool ViewportInteractionLeftOver(const ScreenCoordsXY& screenCoords);
bool ViewportInteractionLeftClick(const ScreenCoordsXY& screenCoords);
InteractionInfo ViewportInteractionGetItemRight(const ScreenCoordsXY& screenCoords);
bool ViewportInteractionRightOver(const ScreenCoordsXY& screenCoords);
bool ViewportInteractionRightClick(const ScreenCoordsXY& screenCoords);
CoordsXY sub_68A15E(const ScreenCoordsXY& screenCoords);
CoordsXY ViewportInteractionGetTileStartAtCursor(const ScreenCoordsXY& screenCoords);
void sub_68B2B7(paint_session* session, const CoordsXY& mapCoords);
void viewport_invalidate(rct_viewport* viewport, int32_t left, int32_t top, int32_t right, int32_t bottom);