Compare commits

...

19 Commits

Author SHA1 Message Date
katerid 3987d1cfd5
Merge a8b180936d into 81e068c7b2 2024-05-09 01:49:06 +00:00
Aaron van Geffen 81e068c7b2
Merge pull request #21990 from AaronVanGeffen/config-include
Remove Config.h include (and therefore Drawing.h) from many places
2024-05-09 00:00:42 +02:00
Aaron van Geffen a61a561d01 Remove Currency.h include from Localisation.h 2024-05-08 23:41:42 +02:00
Aaron van Geffen a627cf7a1e Remove Drawing.h include from Config.h 2024-05-08 23:18:53 +02:00
Aaron van Geffen ca6f142a97 Remove Config.h include from many places 2024-05-08 22:29:32 +02:00
Michael Steenbeek ca1118c2f1
Merge pull request #21985 from AaronVanGeffen/guest-constants
Use constants for balloon/umbrella/hat sprites in more places
2024-05-08 22:23:22 +02:00
Aaron van Geffen 779e65d8b2 GameBottomToolbar: use constants for balloon/umbrella/hat sprites 2024-05-07 23:00:46 +02:00
Aaron van Geffen 73c592b137 Guest window: use constants for balloon/umbrella/hat sprites 2024-05-07 23:00:36 +02:00
Kateri Darr a8b180936d fixed up all instances of SCROLLABLE_ROW_HEIGHT 2024-04-26 17:23:54 -04:00
Kateri Darr af4fe9bf5f Starting to work on Window.h with scrollable_row_height 2024-04-26 16:39:31 -04:00
Kateri Darr a94f488410 fixing some final things up before I start from a clean slate 2024-04-26 14:58:26 -04:00
Kateri Darr 36b876f2f7 trying to see if the build issues are from something I did 2024-04-26 14:53:09 -04:00
Kateri Darr a7e59b1a02 attempting to start from a clean slate and want to make sure nothing is broken 2024-04-26 14:10:25 -04:00
Kateri Darr 5134623074 changing openrct2Version, trying to do nothing with openrct2Name 2024-04-26 13:37:15 -04:00
Kateri Darr 4a5fcfd4d9 new attempt at concatenating a constexpr 2024-04-26 13:15:00 -04:00
Kateri Darr c4e65b00c5 testing if this changed any of the problems from RootCommands.cpp 2024-04-26 12:47:16 -04:00
Kateri Darr d02a03f214 constexpr in Version.h 2024-04-26 00:44:31 -04:00
Kateri Darr fb9dca4678 reset 2024-04-26 00:42:52 -04:00
Kateri Darr be8f949969 changing #define to constexpr in Version.h 2024-04-26 00:40:31 -04:00
63 changed files with 219 additions and 280 deletions

View File

@ -1,85 +0,0 @@
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}",
"${workspaceRoot}/src/**"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
],
"cStandard": "c11",
"cppStandard": "c++20"
},
{
"name": "Linux",
"includePath": [
"/usr/include",
"/usr/include/SDL2",
"/usr/local/include",
"${workspaceRoot}",
"${workspaceRoot}/src"
],
"defines": [
"ENABLE_SCRIPTING"
],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}",
"${workspaceRoot}/src"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"compilerPath": "/usr/bin/clang",
"cStandard": "c11",
"cppStandard": "c++17"
},
{
"name": "Win32",
"includePath": [
"${workspaceRoot}",
"${workspaceRoot}/src",
"${workspaceRoot}/src/thirdparty",
"${workspaceRoot}/lib/Win32/include",
"${workspaceRoot}/lib/x64/include",
"${workspaceRoot}/lib/googletest/googletest/include"
],
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE",
"ENABLE_SCRIPTING"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"cStandard": "c11",
"cppStandard": "c++17"
}
],
"version": 4
}

View File

@ -52,7 +52,7 @@ static Widget WindowAssetPacksWidgets[] = {
class AssetPacksWindow final : public Window
{
private:
static constexpr int32_t ItemHeight = SCROLLABLE_ROW_HEIGHT + 1;
static constexpr int32_t ItemHeight = kScrollableRowHeight + 1;
static constexpr int32_t ItemCheckBoxSize = ItemHeight - 3;
std::optional<size_t> _highlightedIndex;
std::optional<size_t> _selectedIndex;

View File

@ -17,7 +17,6 @@
#include <openrct2/OpenRCT2.h>
#include <openrct2/actions/CheatSetAction.h>
#include <openrct2/actions/ParkSetDateAction.h>
#include <openrct2/config/Config.h>
#include <openrct2/localisation/Date.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Localisation.h>

View File

@ -14,6 +14,7 @@
#include <openrct2/core/String.hpp>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/interface/Colour.h>
#include <openrct2/localisation/Currency.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/util/Util.h>

View File

@ -230,11 +230,11 @@ static Widget _inventionListDragWidgets[] = {
ScreenSize size{};
if (scrollIndex == 0)
{
size.height = static_cast<int32_t>(gameState.ResearchItemsInvented.size()) * SCROLLABLE_ROW_HEIGHT;
size.height = static_cast<int32_t>(gameState.ResearchItemsInvented.size()) * kScrollableRowHeight;
}
else
{
size.height = static_cast<int32_t>(gameState.ResearchItemsUninvented.size()) * SCROLLABLE_ROW_HEIGHT;
size.height = static_cast<int32_t>(gameState.ResearchItemsUninvented.size()) * kScrollableRowHeight;
}
return size;
}
@ -279,14 +279,14 @@ static Widget _inventionListDragWidgets[] = {
GfxClear(dpi, paletteIndex);
int16_t boxWidth = widgets[WIDX_RESEARCH_ORDER_SCROLL].width();
int32_t itemY = -SCROLLABLE_ROW_HEIGHT;
int32_t itemY = -kScrollableRowHeight;
auto* dragItem = WindowEditorInventionsListDragGetItem();
const auto& researchList = scrollIndex == 0 ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented;
for (const auto& researchItem : researchList)
{
itemY += SCROLLABLE_ROW_HEIGHT;
if (itemY + SCROLLABLE_ROW_HEIGHT < dpi.y || itemY >= dpi.y + dpi.height)
itemY += kScrollableRowHeight;
if (itemY + kScrollableRowHeight < dpi.y || itemY >= dpi.y + dpi.height)
continue;
if (_selectedResearchItem == &researchItem)
@ -296,7 +296,7 @@ static Widget _inventionListDragWidgets[] = {
{
// Highlight
top = itemY;
bottom = itemY + SCROLLABLE_ROW_HEIGHT - 1;
bottom = itemY + kScrollableRowHeight - 1;
}
else
{
@ -559,7 +559,7 @@ static Widget _inventionListDragWidgets[] = {
auto& researchList = isInvented ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented;
for (auto& researchItem : researchList)
{
y -= SCROLLABLE_ROW_HEIGHT;
y -= kScrollableRowHeight;
if (y < 0)
{
return &researchItem;
@ -575,7 +575,7 @@ static Widget _inventionListDragWidgets[] = {
auto& researchList = isInvented ? gameState.ResearchItemsInvented : gameState.ResearchItemsUninvented;
for (auto& researchItem : researchList)
{
y -= SCROLLABLE_ROW_HEIGHT;
y -= kScrollableRowHeight;
if (y < 0)
{
return &researchItem;

View File

@ -584,7 +584,7 @@ static std::vector<Widget> _window_editor_object_selection_widgets = {
*/
ScreenSize OnScrollGetSize(int32_t scrollIndex) override
{
const auto newHeight = static_cast<int32_t>(_listItems.size() * SCROLLABLE_ROW_HEIGHT);
const auto newHeight = static_cast<int32_t>(_listItems.size() * kScrollableRowHeight);
return { 0, newHeight };
}
@ -729,7 +729,7 @@ static std::vector<Widget> _window_editor_object_selection_widgets = {
for (size_t i = 0; i < _listItems.size(); i++)
{
const auto& listItem = _listItems[i];
if (screenCoords.y + SCROLLABLE_ROW_HEIGHT >= dpi.y && screenCoords.y <= dpi.y + dpi.height)
if (screenCoords.y + kScrollableRowHeight >= dpi.y && screenCoords.y <= dpi.y + dpi.height)
{
// Draw checkbox
if (!(gScreenFlags & SCREEN_FLAGS_TRACK_MANAGER) && !(*listItem.flags & 0x20))
@ -741,7 +741,7 @@ static std::vector<Widget> _window_editor_object_selection_widgets = {
&& !(*listItem.flags & ObjectSelectionFlags::Flag6);
if (highlighted)
{
auto bottom = screenCoords.y + (SCROLLABLE_ROW_HEIGHT - 1);
auto bottom = screenCoords.y + (kScrollableRowHeight - 1);
GfxFilterRect(dpi, { 0, screenCoords.y, width, bottom }, FilterPaletteID::PaletteDarken1);
}
@ -800,7 +800,7 @@ static std::vector<Widget> _window_editor_object_selection_widgets = {
ft.Add<const char*>(gCommonStringFormatBuffer);
DrawTextEllipsised(dpi, screenCoords, width_limit, STR_STRING, ft, { colour, FontStyle::Medium, darkness });
}
screenCoords.y += SCROLLABLE_ROW_HEIGHT;
screenCoords.y += kScrollableRowHeight;
}
}
@ -1538,7 +1538,7 @@ static std::vector<Widget> _window_editor_object_selection_widgets = {
*/
int32_t GetObjectFromObjectSelection(ObjectType object_type, int32_t y)
{
int32_t listItemIndex = y / SCROLLABLE_ROW_HEIGHT;
int32_t listItemIndex = y / kScrollableRowHeight;
if (listItemIndex < 0 || static_cast<size_t>(listItemIndex) >= _listItems.size())
return -1;

View File

@ -16,7 +16,6 @@
#include <openrct2/GameState.h>
#include <openrct2/actions/ParkSetLoanAction.h>
#include <openrct2/actions/ParkSetResearchFundingAction.h>
#include <openrct2/config/Config.h>
#include <openrct2/localisation/Date.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Localisation.h>

View File

@ -26,6 +26,7 @@
#include <openrct2/management/Finance.h>
#include <openrct2/management/NewsItem.h>
#include <openrct2/peep/PeepAnimationData.h>
#include <openrct2/peep/PeepSpriteIds.h>
#include <openrct2/sprites.h>
#include <openrct2/world/Park.h>
@ -296,15 +297,18 @@ static Widget window_game_bottom_toolbar_widgets[] =
auto* guest = peep->As<Guest>();
if (guest != nullptr)
{
if (image_id_base >= 0x2A1D && image_id_base < 0x2A3D)
if (image_id_base >= kPeepSpriteBalloonStateWatchRideId
&& image_id_base < kPeepSpriteBalloonStateSittingIdleId + 4)
{
GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->BalloonColour), clipCoords);
}
else if (image_id_base >= 0x2BBD && image_id_base < 0x2BDD)
if (image_id_base >= kPeepSpriteUmbrellaStateNoneId
&& image_id_base < kPeepSpriteUmbrellaStateSittingIdleId + 4)
{
GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->UmbrellaColour), clipCoords);
}
else if (image_id_base >= 0x29DD && image_id_base < 0x29FD)
if (image_id_base >= kPeepSpriteHatStateWatchRideId
&& image_id_base < kPeepSpriteHatStateSittingIdleId + 4)
{
GfxDrawSprite(cliped_dpi, ImageId(image_id_base + 32, guest->HatColour), clipCoords);
}

View File

@ -28,6 +28,7 @@
#include <openrct2/management/Marketing.h>
#include <openrct2/network/network.h>
#include <openrct2/peep/PeepAnimationData.h>
#include <openrct2/peep/PeepSpriteIds.h>
#include <openrct2/ride/RideData.h>
#include <openrct2/ride/ShopItem.h>
#include <openrct2/scenario/Scenario.h>
@ -561,19 +562,21 @@ static_assert(_guestWindowPageWidgets.size() == WINDOW_GUEST_PAGE_COUNT);
if (guest != nullptr)
{
// If holding a balloon
if (animationFrame >= 0x2A1D && animationFrame < 0x2A3D)
if (animationFrame >= kPeepSpriteBalloonStateWatchRideId
&& animationFrame < kPeepSpriteBalloonStateSittingIdleId + 4)
{
GfxDrawSprite(clipDpi, ImageId(animationFrame + 32, guest->BalloonColour), screenCoords);
}
// If holding umbrella
if (animationFrame >= 0x2BBD && animationFrame < 0x2BDD)
if (animationFrame >= kPeepSpriteUmbrellaStateNoneId
&& animationFrame < kPeepSpriteUmbrellaStateSittingIdleId + 4)
{
GfxDrawSprite(clipDpi, ImageId(animationFrame + 32, guest->UmbrellaColour), screenCoords);
}
// If wearing hat
if (animationFrame >= 0x29DD && animationFrame < 0x29FD)
if (animationFrame >= kPeepSpriteHatStateWatchRideId && animationFrame < kPeepSpriteHatStateSittingIdleId + 4)
{
GfxDrawSprite(clipDpi, ImageId(animationFrame + 32, guest->HatColour), screenCoords);
}

View File

@ -14,7 +14,6 @@
#include <openrct2/Context.h>
#include <openrct2/Game.h>
#include <openrct2/GameState.h>
#include <openrct2/config/Config.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/entity/EntityRegistry.h>
#include <openrct2/entity/Guest.h>
@ -130,9 +129,9 @@ static Widget window_guest_list_widgets[] = {
char Name[256];
};
static constexpr uint8_t SUMMARISED_GUEST_ROW_HEIGHT = SCROLLABLE_ROW_HEIGHT + 11;
static constexpr uint8_t SUMMARISED_GUEST_ROW_HEIGHT = kScrollableRowHeight + 11;
static constexpr auto GUESTS_PER_PAGE = 2000;
static constexpr const auto GUEST_PAGE_HEIGHT = GUESTS_PER_PAGE * SCROLLABLE_ROW_HEIGHT;
static constexpr const auto GUEST_PAGE_HEIGHT = GUESTS_PER_PAGE * kScrollableRowHeight;
static constexpr size_t MaxGroups = 240;
TabId _selectedTab{};
@ -501,7 +500,7 @@ static Widget window_guest_list_widgets[] = {
{
case TabId::Individual:
// Count the number of guests
y = static_cast<int32_t>(_guestList.size()) * SCROLLABLE_ROW_HEIGHT;
y = static_cast<int32_t>(_guestList.size()) * kScrollableRowHeight;
_numPages = (_guestList.size() + GUESTS_PER_PAGE - 1) / GUESTS_PER_PAGE;
if (_numPages == 0)
_selectedPage = 0;
@ -540,7 +539,7 @@ static Widget window_guest_list_widgets[] = {
void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
auto i = screenCoords.y / (_selectedTab == TabId::Individual ? SCROLLABLE_ROW_HEIGHT : SUMMARISED_GUEST_ROW_HEIGHT);
auto i = screenCoords.y / (_selectedTab == TabId::Individual ? kScrollableRowHeight : SUMMARISED_GUEST_ROW_HEIGHT);
i += static_cast<int32_t>(_selectedPage * GUESTS_PER_PAGE);
if (static_cast<size_t>(i) != _highlightedIndex)
{
@ -555,7 +554,7 @@ static Widget window_guest_list_widgets[] = {
{
case TabId::Individual:
{
auto i = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
auto i = screenCoords.y / kScrollableRowHeight;
i += static_cast<int32_t>(_selectedPage * GUESTS_PER_PAGE);
for (const auto& guestItem : _guestList)
{
@ -668,14 +667,14 @@ static Widget window_guest_list_widgets[] = {
for (const auto& guestItem : _guestList)
{
// Check if y is beyond the scroll control
if (y + SCROLLABLE_ROW_HEIGHT + 1 >= -0x7FFF && y + SCROLLABLE_ROW_HEIGHT + 1 > dpi.y && y < 0x7FFF
if (y + kScrollableRowHeight + 1 >= -0x7FFF && y + kScrollableRowHeight + 1 > dpi.y && y < 0x7FFF
&& y < dpi.y + dpi.height)
{
// Highlight backcolour and text colour (format)
StringId format = STR_BLACK_STRING;
if (index == _highlightedIndex)
{
GfxFilterRect(dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
GfxFilterRect(dpi, { 0, y, 800, y + kScrollableRowHeight - 1 }, FilterPaletteID::PaletteDarken1);
format = STR_WINDOW_COLOUR_2_STRINGID;
}
@ -723,7 +722,7 @@ static Widget window_guest_list_widgets[] = {
break;
}
}
y += SCROLLABLE_ROW_HEIGHT;
y += kScrollableRowHeight;
index++;
}
}

View File

@ -904,14 +904,14 @@ static Widget window_loadsave_widgets[] =
ScreenSize OnScrollGetSize(int32_t scrollIndex) override
{
return { 0, no_list_items * SCROLLABLE_ROW_HEIGHT };
return { 0, no_list_items * kScrollableRowHeight };
}
void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
int32_t selectedItem;
selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
selectedItem = screenCoords.y / kScrollableRowHeight;
if (selectedItem >= no_list_items)
return;
@ -924,7 +924,7 @@ static Widget window_loadsave_widgets[] =
{
int32_t selectedItem;
selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
selectedItem = screenCoords.y / kScrollableRowHeight;
if (selectedItem >= no_list_items)
return;
@ -965,11 +965,11 @@ static Widget window_loadsave_widgets[] =
for (int32_t i = 0; i < no_list_items; i++)
{
int32_t y = i * SCROLLABLE_ROW_HEIGHT;
int32_t y = i * kScrollableRowHeight;
if (y > dpi.y + dpi.height)
break;
if (y + SCROLLABLE_ROW_HEIGHT < dpi.y)
if (y + kScrollableRowHeight < dpi.y)
continue;
StringId stringId = STR_BLACK_STRING;
@ -978,7 +978,7 @@ static Widget window_loadsave_widgets[] =
if (i == selected_list_item)
{
stringId = STR_WINDOW_COLOUR_2_STRINGID;
GfxFilterRect(dpi, { 0, y, listWidth, y + SCROLLABLE_ROW_HEIGHT }, FilterPaletteID::PaletteDarken1);
GfxFilterRect(dpi, { 0, y, listWidth, y + kScrollableRowHeight }, FilterPaletteID::PaletteDarken1);
}
// display a marker next to the currently loaded game file
if (_listItems[i].loaded)

View File

@ -569,7 +569,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
Invalidate();
}
screenSize = { 0, NetworkGetNumPlayers() * SCROLLABLE_ROW_HEIGHT };
screenSize = { 0, NetworkGetNumPlayers() * kScrollableRowHeight };
int32_t i = screenSize.height - window_multiplayer_players_widgets[WIDX_LIST].bottom
+ window_multiplayer_players_widgets[WIDX_LIST].top + 21;
if (i < 0)
@ -590,7 +590,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
Invalidate();
}
screenSize = { 0, NetworkGetNumActions() * SCROLLABLE_ROW_HEIGHT };
screenSize = { 0, NetworkGetNumActions() * kScrollableRowHeight };
int32_t i = screenSize.height - window_multiplayer_groups_widgets[WIDX_LIST].bottom
+ window_multiplayer_groups_widgets[WIDX_LIST].top + 21;
if (i < 0)
@ -612,7 +612,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
{
case WINDOW_MULTIPLAYER_PAGE_PLAYERS:
{
int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
int32_t index = screenCoords.y / kScrollableRowHeight;
if (index >= no_list_items)
return;
@ -626,7 +626,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
case WINDOW_MULTIPLAYER_PAGE_GROUPS:
{
int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
int32_t index = screenCoords.y / kScrollableRowHeight;
if (index >= no_list_items)
return;
@ -648,7 +648,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
case WINDOW_MULTIPLAYER_PAGE_PLAYERS:
case WINDOW_MULTIPLAYER_PAGE_GROUPS:
{
int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
int32_t index = screenCoords.y / kScrollableRowHeight;
if (index >= no_list_items)
return;
@ -751,7 +751,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
break;
}
if (screenCoords.y + SCROLLABLE_ROW_HEIGHT + 1 >= dpi.y)
if (screenCoords.y + kScrollableRowHeight + 1 >= dpi.y)
{
thread_local std::string _buffer;
_buffer.reserve(512);
@ -762,7 +762,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
if (listPosition == selected_list_item)
{
GfxFilterRect(
dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 },
dpi, { 0, screenCoords.y, 800, screenCoords.y + kScrollableRowHeight - 1 },
FilterPaletteID::PaletteDarken1);
_buffer += NetworkGetPlayerName(player);
colour = colours[2];
@ -831,7 +831,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
screenCoords.x = 356;
GfxDrawString(dpi, screenCoords, _buffer.c_str(), { colour });
}
screenCoords.y += SCROLLABLE_ROW_HEIGHT;
screenCoords.y += kScrollableRowHeight;
listPosition++;
}
}
@ -893,7 +893,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
if (i == selected_list_item)
{
GfxFilterRect(
dpi, { 0, screenCoords.y, 800, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 },
dpi, { 0, screenCoords.y, 800, screenCoords.y + kScrollableRowHeight - 1 },
FilterPaletteID::PaletteDarken1);
}
if (screenCoords.y > dpi.y + dpi.height)
@ -901,7 +901,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
break;
}
if (screenCoords.y + SCROLLABLE_ROW_HEIGHT + 1 >= dpi.y)
if (screenCoords.y + kScrollableRowHeight + 1 >= dpi.y)
{
int32_t groupindex = NetworkGetGroupIndex(_selectedGroup);
if (groupindex != -1)
@ -918,7 +918,7 @@ static constexpr StringId WindowMultiplayerPageTitles[] = {
ft.Add<uint16_t>(NetworkGetActionNameStringID(i));
DrawTextBasic(dpi, { 10, screenCoords.y }, STR_WINDOW_COLOUR_2_STRINGID, ft);
}
screenCoords.y += SCROLLABLE_ROW_HEIGHT;
screenCoords.y += kScrollableRowHeight;
}
}

View File

@ -465,19 +465,19 @@ static Widget window_object_load_error_widgets[] = {
ScreenSize OnScrollGetSize(const int32_t scrollIndex) override
{
return ScreenSize(0, no_list_items * SCROLLABLE_ROW_HEIGHT);
return ScreenSize(0, no_list_items * kScrollableRowHeight);
}
void OnScrollMouseDown(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
const auto selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
const auto selectedItem = screenCoords.y / kScrollableRowHeight;
SelectObjectFromList(selectedItem);
}
void OnScrollMouseOver(const int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
// Highlight item that the cursor is over, or remove highlighting if none
const auto selectedItem = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
const auto selectedItem = screenCoords.y / kScrollableRowHeight;
if (selectedItem < 0 || selectedItem >= no_list_items)
_highlightedIndex = -1;
else
@ -513,15 +513,15 @@ static Widget window_object_load_error_widgets[] = {
for (int32_t i = 0; i < no_list_items; i++)
{
ScreenCoordsXY screenCoords;
screenCoords.y = i * SCROLLABLE_ROW_HEIGHT;
screenCoords.y = i * kScrollableRowHeight;
if (screenCoords.y > dpi.y + dpi.height)
break;
if (screenCoords.y + SCROLLABLE_ROW_HEIGHT < dpi.y)
if (screenCoords.y + kScrollableRowHeight < dpi.y)
continue;
const auto screenRect = ScreenRect{ { 0, screenCoords.y },
{ listWidth, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } };
{ listWidth, screenCoords.y + kScrollableRowHeight - 1 } };
// If hovering over item, change the color and fill the backdrop.
if (i == selected_list_item)
GfxFillRect(dpi, screenRect, ColourMapA[colours[1]].darker);

View File

@ -18,7 +18,6 @@
#include <openrct2/GameState.h>
#include <openrct2/actions/RideDemolishAction.h>
#include <openrct2/actions/RideSetStatusAction.h>
#include <openrct2/config/Config.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/interface/Colour.h>
#include <openrct2/localisation/Formatter.h>
@ -386,7 +385,7 @@ static Widget _rideListWidgets[] = {
*/
ScreenSize OnScrollGetSize(int32_t scrollIndex) override
{
const auto newHeight = static_cast<int32_t>(_rideList.size() * SCROLLABLE_ROW_HEIGHT);
const auto newHeight = static_cast<int32_t>(_rideList.size() * kScrollableRowHeight);
if (selected_list_item != -1)
{
selected_list_item = -1;
@ -411,7 +410,7 @@ static Widget _rideListWidgets[] = {
*/
void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
const auto index = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
const auto index = screenCoords.y / kScrollableRowHeight;
if (index < 0 || static_cast<size_t>(index) >= _rideList.size())
return;
@ -437,7 +436,7 @@ static Widget _rideListWidgets[] = {
*/
void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
const auto index = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
const auto index = screenCoords.y / kScrollableRowHeight;
if (index < 0 || static_cast<size_t>(index) >= _rideList.size())
return;
@ -552,7 +551,7 @@ static Widget _rideListWidgets[] = {
if (i == static_cast<size_t>(selected_list_item))
{
// Background highlight
GfxFilterRect(dpi, { 0, y, 800, y + SCROLLABLE_ROW_HEIGHT - 1 }, FilterPaletteID::PaletteDarken1);
GfxFilterRect(dpi, { 0, y, 800, y + kScrollableRowHeight - 1 }, FilterPaletteID::PaletteDarken1);
format = (_quickDemolishMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID);
}
@ -742,7 +741,7 @@ static Widget _rideListWidgets[] = {
ft.Add<StringId>(formatSecondary);
}
DrawTextEllipsised(dpi, { 160, y - 1 }, 157, format, ft);
y += SCROLLABLE_ROW_HEIGHT;
y += kScrollableRowHeight;
}
}

View File

@ -263,7 +263,7 @@ static Widget window_shortcut_change_widgets[] = {
ScreenSize OnScrollGetSize(int32_t scrollIndex) override
{
auto h = static_cast<int32_t>(_list.size() * SCROLLABLE_ROW_HEIGHT);
auto h = static_cast<int32_t>(_list.size() * kScrollableRowHeight);
auto bottom = std::max(0, h - widgets[WIDX_SCROLL].bottom + widgets[WIDX_SCROLL].top + 21);
if (bottom < scrolls[0].v_top)
{
@ -275,7 +275,7 @@ static Widget window_shortcut_change_widgets[] = {
void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
auto index = static_cast<int_fast16_t>((screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT);
auto index = static_cast<int_fast16_t>((screenCoords.y - 1) / kScrollableRowHeight);
if (static_cast<size_t>(index) < _list.size())
{
_highlightedItem = index;
@ -289,7 +289,7 @@ static Widget window_shortcut_change_widgets[] = {
void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
auto selectedItem = static_cast<size_t>((screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT);
auto selectedItem = static_cast<size_t>((screenCoords.y - 1) / kScrollableRowHeight);
if (selectedItem < _list.size())
{
// Is this a separator?
@ -314,13 +314,13 @@ static Widget window_shortcut_change_widgets[] = {
for (size_t i = 0; i < _list.size(); ++i)
{
auto y = static_cast<int32_t>(1 + i * SCROLLABLE_ROW_HEIGHT);
auto y = static_cast<int32_t>(1 + i * kScrollableRowHeight);
if (y > dpi.y + dpi.height)
{
break;
}
if (y + SCROLLABLE_ROW_HEIGHT < dpi.y)
if (y + kScrollableRowHeight < dpi.y)
{
continue;
}
@ -504,7 +504,7 @@ static Widget window_shortcut_change_widgets[] = {
void DrawSeparator(DrawPixelInfo& dpi, int32_t y, int32_t scrollWidth)
{
const int32_t top = y + (SCROLLABLE_ROW_HEIGHT / 2) - 1;
const int32_t top = y + (kScrollableRowHeight / 2) - 1;
GfxFillRect(dpi, { { 0, top }, { scrollWidth, top } }, ColourMapA[colours[0]].mid_dark);
GfxFillRect(dpi, { { 0, top + 1 }, { scrollWidth, top + 1 } }, ColourMapA[colours[0]].lightest);
}
@ -516,7 +516,7 @@ static Widget window_shortcut_change_widgets[] = {
if (isHighlighted)
{
format = STR_WINDOW_COLOUR_2_STRINGID;
GfxFilterRect(dpi, { 0, y - 1, scrollWidth, y + (SCROLLABLE_ROW_HEIGHT - 2) }, FilterPaletteID::PaletteDarken1);
GfxFilterRect(dpi, { 0, y - 1, scrollWidth, y + (kScrollableRowHeight - 2) }, FilterPaletteID::PaletteDarken1);
}
auto bindingOffset = (scrollWidth * 2) / 3;

View File

@ -323,7 +323,7 @@ static Widget _staffListWidgets[] = {
Invalidate();
}
auto scrollHeight = static_cast<int32_t>(_staffList.size()) * SCROLLABLE_ROW_HEIGHT;
auto scrollHeight = static_cast<int32_t>(_staffList.size()) * kScrollableRowHeight;
auto i = scrollHeight - widgets[WIDX_STAFF_LIST_LIST].bottom + widgets[WIDX_STAFF_LIST_LIST].top + 21;
if (i < 0)
i = 0;
@ -339,7 +339,7 @@ static Widget _staffListWidgets[] = {
void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
auto i = static_cast<size_t>(screenCoords.y / SCROLLABLE_ROW_HEIGHT);
auto i = static_cast<size_t>(screenCoords.y / kScrollableRowHeight);
if (i != _highlightedIndex)
{
_highlightedIndex = static_cast<size_t>(i);
@ -349,7 +349,7 @@ static Widget _staffListWidgets[] = {
void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
int32_t i = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
int32_t i = screenCoords.y / kScrollableRowHeight;
for (const auto& entry : _staffList)
{
if (i == 0)
@ -409,7 +409,7 @@ static Widget _staffListWidgets[] = {
if (i == _highlightedIndex)
{
GfxFilterRect(dpi, { 0, y, 800, y + (SCROLLABLE_ROW_HEIGHT - 1) }, FilterPaletteID::PaletteDarken1);
GfxFilterRect(dpi, { 0, y, 800, y + (kScrollableRowHeight - 1) }, FilterPaletteID::PaletteDarken1);
format = (_quickFireMode ? STR_LIGHTPINK_STRINGID : STR_WINDOW_COLOUR_2_STRINGID);
}
@ -451,7 +451,7 @@ static Widget _staffListWidgets[] = {
}
}
y += SCROLLABLE_ROW_HEIGHT;
y += kScrollableRowHeight;
i++;
}
}

View File

@ -13,7 +13,6 @@
#include <openrct2-ui/interface/Widget.h>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/Context.h>
#include <openrct2/config/Config.h>
#include <openrct2/core/String.hpp>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/localisation/Formatter.h>

View File

@ -15,7 +15,6 @@
#include <openrct2/Context.h>
#include <openrct2/Game.h>
#include <openrct2/Input.h>
#include <openrct2/config/Config.h>
#include <openrct2/drawing/Drawing.h>
#include <openrct2/localisation/Formatter.h>
#include <openrct2/localisation/Localisation.h>

View File

@ -993,7 +993,7 @@ static uint64_t PageDisabledWidgets[] = {
ScreenSize OnScrollGetSize(int32_t scrollIndex) override
{
return ScreenSize(WW - 30, windowTileInspectorElementCount * SCROLLABLE_ROW_HEIGHT);
return ScreenSize(WW - 30, windowTileInspectorElementCount * kScrollableRowHeight);
}
void OnScrollMouseDown(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
@ -1003,7 +1003,7 @@ static uint64_t PageDisabledWidgets[] = {
return;
// Because the list items are displayed in reverse order, subtract the calculated index from the amount of elements
const int16_t index = windowTileInspectorElementCount - (screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT - 1;
const int16_t index = windowTileInspectorElementCount - (screenCoords.y - 1) / kScrollableRowHeight - 1;
const ScreenRect checkboxColumnRect{ { 2, 0 }, { 15, screenCoords.y } };
if (index >= 0 && checkboxColumnRect.Contains(screenCoords))
{ // Checkbox was clicked
@ -1017,7 +1017,7 @@ static uint64_t PageDisabledWidgets[] = {
void OnScrollMouseOver(int32_t scrollIndex, const ScreenCoordsXY& screenCoords) override
{
int16_t index = windowTileInspectorElementCount - (screenCoords.y - 1) / SCROLLABLE_ROW_HEIGHT - 1;
int16_t index = windowTileInspectorElementCount - (screenCoords.y - 1) / kScrollableRowHeight - 1;
if (index < 0 || index >= windowTileInspectorElementCount)
_highlightedIndex = -1;
else
@ -1584,7 +1584,7 @@ static uint64_t PageDisabledWidgets[] = {
}
ScreenCoordsXY screenCoords{};
screenCoords.y = SCROLLABLE_ROW_HEIGHT * (windowTileInspectorElementCount - 1);
screenCoords.y = kScrollableRowHeight * (windowTileInspectorElementCount - 1);
int32_t i = 0;
char buffer[256];
@ -1601,7 +1601,7 @@ static uint64_t PageDisabledWidgets[] = {
// Draw row background colour
auto fillRectangle = ScreenRect{ { 0, screenCoords.y },
{ listWidth, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } };
{ listWidth, screenCoords.y + kScrollableRowHeight - 1 } };
if (selectedRow)
GfxFillRect(dpi, fillRectangle, ColourMapA[colours[1]].mid_dark);
else if (hoveredRow)
@ -1718,7 +1718,7 @@ static uint64_t PageDisabledWidgets[] = {
if (last)
DrawTextBasic(dpi, screenCoords + ScreenCoordsXY{ LastFlagColumnXY.x, 0 }, stringFormat, checkboxFormatter);
screenCoords.y -= SCROLLABLE_ROW_HEIGHT;
screenCoords.y -= kScrollableRowHeight;
i++;
} while (!(tileElement++)->IsLastForTile());
}

View File

@ -10,7 +10,6 @@
#include <openrct2-ui/interface/Widget.h>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/Context.h>
#include <openrct2/config/Config.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>

View File

@ -18,7 +18,6 @@
#include <openrct2/ParkImporter.h>
#include <openrct2/PlatformEnvironment.h>
#include <openrct2/actions/LoadOrQuitAction.h>
#include <openrct2/config/Config.h>
#include <openrct2/localisation/Localisation.h>
#include <openrct2/sprites.h>
#include <openrct2/ui/UiContext.h>

View File

@ -10,7 +10,6 @@
#include <openrct2-ui/interface/Widget.h>
#include <openrct2-ui/windows/Window.h>
#include <openrct2/Context.h>
#include <openrct2/config/Config.h>
#include <openrct2/localisation/Localisation.h>
namespace OpenRCT2::Ui::Windows

View File

@ -172,7 +172,7 @@ static Widget _trackListWidgets[] = {
maxItems++;
}
int32_t index = screenCoords.y / SCROLLABLE_ROW_HEIGHT;
int32_t index = screenCoords.y / kScrollableRowHeight;
if (index < 0 || static_cast<uint32_t>(index) >= maxItems)
{
index = -1;
@ -328,7 +328,7 @@ static Widget _trackListWidgets[] = {
// Extra item: custom design
numItems++;
}
int32_t scrollHeight = static_cast<int32_t>(numItems * SCROLLABLE_ROW_HEIGHT);
int32_t scrollHeight = static_cast<int32_t>(numItems * kScrollableRowHeight);
return { width, scrollHeight };
}
@ -519,7 +519,7 @@ static Widget _trackListWidgets[] = {
{
// Vehicle design not available
DrawTextEllipsised(dpi, screenPos, 368, STR_VEHICLE_DESIGN_UNAVAILABLE, {}, { TextAlignment::CENTRE });
screenPos.y -= SCROLLABLE_ROW_HEIGHT;
screenPos.y -= kScrollableRowHeight;
}
if (_loadedTrackDesign->track_flags & TRACK_DESIGN_FLAG_SCENERY_UNAVAILABLE)
@ -529,7 +529,7 @@ static Widget _trackListWidgets[] = {
// Scenery not available
DrawTextEllipsised(
dpi, screenPos, 368, STR_DESIGN_INCLUDES_SCENERY_WHICH_IS_UNAVAILABLE, {}, { TextAlignment::CENTRE });
screenPos.y -= SCROLLABLE_ROW_HEIGHT;
screenPos.y -= kScrollableRowHeight;
}
}
@ -696,7 +696,7 @@ static Widget _trackListWidgets[] = {
{
// Highlight
GfxFilterRect(
dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } },
dpi, { screenCoords, { width, screenCoords.y + kScrollableRowHeight - 1 } },
FilterPaletteID::PaletteDarken1);
stringId = STR_WINDOW_COLOUR_2_STRINGID;
}
@ -708,20 +708,20 @@ static Widget _trackListWidgets[] = {
auto ft = Formatter();
ft.Add<StringId>(STR_BUILD_CUSTOM_DESIGN);
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft);
screenCoords.y += SCROLLABLE_ROW_HEIGHT;
screenCoords.y += kScrollableRowHeight;
listIndex++;
}
for (auto i : _filteredTrackIds)
{
if (screenCoords.y + SCROLLABLE_ROW_HEIGHT >= dpi.y && screenCoords.y < dpi.y + dpi.height)
if (screenCoords.y + kScrollableRowHeight >= dpi.y && screenCoords.y < dpi.y + dpi.height)
{
StringId stringId;
if (listIndex == static_cast<size_t>(selected_list_item))
{
// Highlight
GfxFilterRect(
dpi, { screenCoords, { width, screenCoords.y + SCROLLABLE_ROW_HEIGHT - 1 } },
dpi, { screenCoords, { width, screenCoords.y + kScrollableRowHeight - 1 } },
FilterPaletteID::PaletteDarken1);
stringId = STR_WINDOW_COLOUR_2_STRINGID;
}
@ -737,7 +737,7 @@ static Widget _trackListWidgets[] = {
DrawTextBasic(dpi, screenCoords - ScreenCoordsXY{ 0, 1 }, stringId, ft);
}
screenCoords.y += SCROLLABLE_ROW_HEIGHT;
screenCoords.y += kScrollableRowHeight;
listIndex++;
}
}

View File

@ -12,7 +12,6 @@
#include "GameState.h"
#include "actions/CheatSetAction.h"
#include "actions/ParkSetLoanAction.h"
#include "config/Config.h"
#include "core/DataSerialiser.h"
#include "localisation/Localisation.h"
#include "network/network.h"

View File

@ -15,6 +15,7 @@
#include "core/Path.hpp"
#include "core/String.hpp"
#include "platform/Platform.h"
#include "util/Util.h"
using namespace OpenRCT2;

View File

@ -84,4 +84,4 @@ struct NewVersionInfo
std::string url;
};
NewVersionInfo GetLatestVersion();
NewVersionInfo GetLatestVersion();

View File

@ -11,7 +11,6 @@
#include "../Context.h"
#include "../GameState.h"
#include "../config/Config.h"
#include "../core/MemoryStream.h"
#include "../drawing/Drawing.h"
#include "../localisation/Localisation.h"

View File

@ -12,6 +12,7 @@
#include "../OpenRCT2.h"
#include "../core/Console.hpp"
#include "../core/String.hpp"
#include "../drawing/Font.h"
#include "../platform/Platform.h"
#include <cstring>

View File

@ -487,4 +487,4 @@ static void PrintLaunchInformation()
Console::WriteLine();
// TODO Print other potential information (e.g. user, hardware)
}
}

View File

@ -11,6 +11,7 @@
#include "../Game.h"
#include "../GameState.h"
#include "../OpenRCT2.h"
#include "../config/ConfigTypes.h"
#include "../core/Console.hpp"
#include "../entity/EntityRegistry.h"
#include "../network/network.h"

View File

@ -10,19 +10,13 @@
#pragma once
#include "../core/String.hpp"
#include "../drawing/Drawing.h"
#include "../localisation/Currency.h"
#include "../localisation/CurrencyTypes.h"
#include "ConfigTypes.h"
#include <atomic>
#include <string>
enum class MeasurementFormat : int32_t;
enum class TemperatureUnit : int32_t;
enum class ScaleQuality : int32_t;
enum class Sort : int32_t;
enum class VirtualFloorStyles : int32_t;
enum class DrawingEngine : int32_t;
enum class TitleMusicKind : int32_t;
struct Gx;
struct GeneralConfiguration
{
@ -221,43 +215,6 @@ struct PluginConfiguration
u8string AllowedHosts;
};
enum class Sort : int32_t
{
NameAscending,
NameDescending,
DateAscending,
DateDescending,
};
enum class TemperatureUnit : int32_t
{
Celsius,
Fahrenheit
};
enum class ScaleQuality : int32_t
{
NearestNeighbour,
Linear,
SmoothNearestNeighbour
};
enum class MeasurementFormat : int32_t
{
Imperial,
Metric,
SI
};
enum class TitleMusicKind : int32_t
{
None,
Random,
OpenRCT2,
RCT1,
RCT2,
};
extern GeneralConfiguration gConfigGeneral;
extern InterfaceConfiguration gConfigInterface;
extern SoundConfiguration gConfigSound;

View File

@ -0,0 +1,58 @@
/*****************************************************************************
* Copyright (c) 2014-2024 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include <cstdint>
enum class MeasurementFormat : int32_t;
enum class TemperatureUnit : int32_t;
enum class CurrencyType : uint8_t;
enum class ScaleQuality : int32_t;
enum class Sort : int32_t;
enum class VirtualFloorStyles : int32_t;
enum class DrawingEngine : int32_t;
enum class TitleMusicKind : int32_t;
enum class Sort : int32_t
{
NameAscending,
NameDescending,
DateAscending,
DateDescending,
};
enum class TemperatureUnit : int32_t
{
Celsius,
Fahrenheit
};
enum class ScaleQuality : int32_t
{
NearestNeighbour,
Linear,
SmoothNearestNeighbour
};
enum class MeasurementFormat : int32_t
{
Imperial,
Metric,
SI
};
enum class TitleMusicKind : int32_t
{
None,
Random,
OpenRCT2,
RCT1,
RCT2,
};

View File

@ -10,7 +10,6 @@
#include "NewDrawing.h"
#include "../Context.h"
#include "../config/Config.h"
#include "../drawing/Drawing.h"
#include "../interface/Screenshot.h"
#include "../localisation/StringIds.h"

View File

@ -19,8 +19,10 @@
# include "../OpenRCT2.h"
# include "../core/Numerics.hpp"
# include "../core/String.hpp"
# include "../drawing/Font.h"
# include "../localisation/LocalisationService.h"
# include "../platform/Platform.h"
# include "../util/Util.h"
# include "DrawingLock.hpp"
# include "TTF.h"

View File

@ -15,7 +15,6 @@
#include "../Input.h"
#include "../actions/StaffSetOrdersAction.h"
#include "../audio/audio.h"
#include "../config/Config.h"
#include "../core/DataSerialiser.h"
#include "../entity/EntityRegistry.h"
#include "../interface/Viewport.h"

View File

@ -16,6 +16,7 @@
#include "../PlatformEnvironment.h"
#include "../actions/CheatSetAction.h"
#include "../audio/audio.h"
#include "../config/Config.h"
#include "../core/Console.hpp"
#include "../core/File.h"
#include "../core/Imaging.h"

View File

@ -11,6 +11,7 @@
#include "../Context.h"
#include "../OpenRCT2.h"
#include "../config/ConfigTypes.h"
#include "../platform/Platform.h"
#include "../scripting/ScriptEngine.h"

View File

@ -41,7 +41,7 @@ enum class CloseWindowModifier : uint8_t;
constexpr uint8_t CloseButtonWidth = 10;
#define SCROLLABLE_ROW_HEIGHT 12
constexpr uint8_t kScrollableRowHeight = 12;
constexpr uint8_t kListRowHeight = 12;
constexpr uint8_t kTableCellHeight = 12;
constexpr uint8_t kButtonFaceHeight = 12;

View File

@ -176,6 +176,7 @@
<ClInclude Include="common.h" />
<ClInclude Include="config\Config.h" />
<ClInclude Include="config\ConfigEnum.hpp" />
<ClInclude Include="config\ConfigTypes.h" />
<ClInclude Include="config\IniReader.hpp" />
<ClInclude Include="config\IniWriter.hpp" />
<ClInclude Include="Context.h" />
@ -278,6 +279,7 @@
<ClInclude Include="Limits.h" />
<ClInclude Include="localisation\ConversionTables.h" />
<ClInclude Include="localisation\Currency.h" />
<ClInclude Include="localisation\CurrencyTypes.h" />
<ClInclude Include="localisation\Date.h" />
<ClInclude Include="localisation\FormatCodes.h" />
<ClInclude Include="localisation\Formatter.h" />

View File

@ -12,38 +12,7 @@
#include "../common.h"
#include "../core/String.hpp"
#include "../util/Util.h"
// List of currencies
enum class CurrencyType : uint8_t
{
Pounds, // British Pound
Dollars, // US Dollar
Franc, // French Franc
DeutscheMark, // Deutsche Mark
Yen, // Japanese Yen
Peseta, // Spanish Peseta
Lira, // Italian Lira
Guilders, // Dutch Gilder
Krona, // Swedish Krona
Euros, // Euro
Won, // South Korean Won
Rouble, // Russian Rouble
CzechKoruna, // Czech koruna
HKD, // Hong Kong Dollar
TWD, // New Taiwan Dollar
Yuan, // Chinese Yuan
Forint, // Hungarian Forint
Custom, // Custom currency
Count // Last item
};
enum class CurrencyAffix
{
Prefix,
Suffix
};
#include "CurrencyTypes.h"
#define CURRENCY_SYMBOL_MAX_SIZE 8
#define CURRENCY_RATE_MAX_NUM_DIGITS 9
@ -62,6 +31,7 @@ struct CurrencyDescriptor
};
// List of currency formats
// TODO: refactor into getter
extern CurrencyDescriptor CurrencyDescriptors[EnumValue(CurrencyType::Count)];
/**

View File

@ -0,0 +1,44 @@
/*****************************************************************************
* Copyright (c) 2014-2024 OpenRCT2 developers
*
* For a complete list of all authors, please refer to contributors.md
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
*
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#pragma once
#include <cstdint>
// List of currencies
enum class CurrencyType : uint8_t
{
Pounds, // British Pound
Dollars, // US Dollar
Franc, // French Franc
DeutscheMark, // Deutsche Mark
Yen, // Japanese Yen
Peseta, // Spanish Peseta
Lira, // Italian Lira
Guilders, // Dutch Gilder
Krona, // Swedish Krona
Euros, // Euro
Won, // South Korean Won
Rouble, // Russian Rouble
CzechKoruna, // Czech koruna
HKD, // Hong Kong Dollar
TWD, // New Taiwan Dollar
Yuan, // Chinese Yuan
Forint, // Hungarian Forint
Custom, // Custom currency
Count // Last item
};
enum class CurrencyAffix
{
Prefix,
Suffix
};

View File

@ -11,6 +11,7 @@
#include "../config/Config.h"
#include "../util/Util.h"
#include "Currency.h"
#include "Formatter.h"
#include "Localisation.h"
#include "StringIds.h"

View File

@ -26,6 +26,7 @@
#include "../management/Marketing.h"
#include "../ride/Ride.h"
#include "../util/Util.h"
#include "Currency.h"
#include "Date.h"
#include "Formatting.h"
#include "Localisation.h"

View File

@ -10,7 +10,6 @@
#pragma once
#include "../management/Marketing.h"
#include "Currency.h"
#include "Date.h"
#include "FormatCodes.h"
#include "Language.h"

View File

@ -1,3 +1,4 @@
/*****************************************************************************
* Copyright (c) 2014-2024 OpenRCT2 developers
*

View File

@ -13,7 +13,6 @@
#include "../OpenRCT2.h"
#include "../PlatformEnvironment.h"
#include "../common.h"
#include "../config/Config.h"
#include "../core/Console.hpp"
#include "../core/DataSerialiser.h"
#include "../core/FileIndex.hpp"

View File

@ -14,6 +14,7 @@
#include "../core/Guard.hpp"
#include "../drawing/Drawing.h"
#include "../interface/Viewport.h"
#include "../localisation/Currency.h"
#include "../localisation/Formatting.h"
#include "../localisation/Localisation.h"
#include "../localisation/LocalisationService.h"

View File

@ -11,7 +11,6 @@
#include "../../Game.h"
#include "../../GameState.h"
#include "../../config/Config.h"
#include "../../interface/Viewport.h"
#include "../../localisation/Date.h"
#include "../../object/SmallSceneryEntry.h"

View File

@ -16,9 +16,9 @@
#include "../Context.h"
#include "../Game.h"
#include "../config/Config.h"
#include "../core/File.h"
#include "../core/Path.hpp"
#include "../localisation/Currency.h"
#include "../localisation/Localisation.h"
#include "Platform.h"

View File

@ -14,7 +14,6 @@
# include "../Date.h"
# include "../core/Memory.hpp"
# include "../core/Path.hpp"
# include "../core/String.hpp"
# include "../util/Util.h"
# include <cerrno>

View File

@ -10,7 +10,8 @@
#pragma once
#include "../common.h"
#include "../config/Config.h"
#include "../config/ConfigTypes.h"
#include "../core/String.hpp"
#include <ctime>
#include <string>
@ -42,6 +43,7 @@ enum class SPECIAL_FOLDER
struct RealWorldDate;
struct RealWorldTime;
struct TTFFontDescriptor;
namespace Platform
{

View File

@ -14,7 +14,6 @@
#include "../GameState.h"
#include "../OpenRCT2.h"
#include "../ParkImporter.h"
#include "../config/Config.h"
#include "../core/Console.hpp"
#include "../core/FileStream.h"
#include "../core/IStream.hpp"

View File

@ -8,7 +8,6 @@
*****************************************************************************/
#include "../TrackImporter.h"
#include "../config/Config.h"
#include "../core/FileStream.h"
#include "../core/MemoryStream.h"
#include "../core/Path.hpp"

View File

@ -11,7 +11,6 @@
#include "../Context.h"
#include "../PlatformEnvironment.h"
#include "../config/Config.h"
#include "../core/Collections.hpp"
#include "../core/Console.hpp"
#include "../core/File.h"

View File

@ -10,7 +10,6 @@
#include "../Context.h"
#include "../Game.h"
#include "../audio/audio.h"
#include "../config/Config.h"
#include "../interface/Viewport.h"
#include "../localisation/Localisation.h"
#include "../localisation/StringIds.h"

View File

@ -7,7 +7,6 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include "../../config/Config.h"
#include "../../entity/EntityRegistry.h"
#include "../../entity/Guest.h"
#include "../../interface/Viewport.h"

View File

@ -8,7 +8,6 @@
*****************************************************************************/
#include "../../common.h"
#include "../../config/Config.h"
#include "../../interface/Viewport.h"
#include "../../paint/Paint.h"
#include "../../paint/support/WoodenSupports.h"

View File

@ -7,7 +7,6 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include "../../config/Config.h"
#include "../../entity/EntityRegistry.h"
#include "../../interface/Viewport.h"
#include "../../paint/Paint.h"

View File

@ -7,7 +7,6 @@
* OpenRCT2 is licensed under the GNU General Public License version 3.
*****************************************************************************/
#include "../config/Config.h"
#include "../drawing/X8DrawingEngine.h"
#include "UiContext.h"
#include "WindowManager.h"

View File

@ -11,7 +11,7 @@
#include "../Context.h"
#include "../common.h"
#include "../config/Config.h"
#include "../config/ConfigTypes.h"
#include "../interface/Cursors.h"
#include <memory>

View File

@ -20,7 +20,6 @@
#include "../actions/ParkEntranceRemoveAction.h"
#include "../actions/WallRemoveAction.h"
#include "../audio/audio.h"
#include "../config/Config.h"
#include "../core/Guard.hpp"
#include "../interface/Cursors.h"
#include "../interface/Viewport.h"

View File

@ -16,7 +16,6 @@
#include "../GameState.h"
#include "../OpenRCT2.h"
#include "../actions/ParkSetParameterAction.h"
#include "../config/Config.h"
#include "../core/Memory.hpp"
#include "../core/String.hpp"
#include "../entity/Litter.h"

View File

@ -18,7 +18,6 @@
#include <openrct2/OpenRCT2.h>
#include <openrct2/ParkImporter.h>
#include <openrct2/audio/AudioContext.h>
#include <openrct2/config/Config.h>
#include <openrct2/core/Crypt.h>
#include <openrct2/core/File.h>
#include <openrct2/core/MemoryStream.h>