Compare commits

...

6 Commits

Author SHA1 Message Date
Aaron van Geffen 45fd3a53e9
Merge 96a7da9462 into 81e068c7b2 2024-05-09 01:37:52 +02: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
Aaron van Geffen 96a7da9462 Re-introduce message on successful screenshot 2024-05-07 17:00:57 +02:00
46 changed files with 132 additions and 109 deletions

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

@ -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

@ -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>

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>

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

@ -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

@ -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

@ -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

@ -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"
@ -90,6 +91,13 @@ void ScreenshotCheck()
if (!screenshotPath.empty())
{
OpenRCT2::Audio::Play(OpenRCT2::Audio::SoundId::WindowOpen, 100, ContextGetWidth() / 2);
// Show user that screenshot saved successfully
const auto filename = Path::GetFileName(screenshotPath);
Formatter ft;
ft.Add<StringId>(STR_STRING);
ft.Add<const utf8*>(filename.c_str());
ContextShowError(STR_SCREENSHOT_SAVED_AS, STR_NONE, ft);
}
else
{

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

@ -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

@ -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>