mirror of https://github.com/OpenRCT2/OpenRCT2.git
Compare commits
10 Commits
187e1550fc
...
916d014ca2
Author | SHA1 | Date |
---|---|---|
ltsSmitty | 916d014ca2 | |
Aaron van Geffen | 81e068c7b2 | |
Aaron van Geffen | a61a561d01 | |
Aaron van Geffen | a627cf7a1e | |
Aaron van Geffen | ca6f142a97 | |
Michael Steenbeek | ca1118c2f1 | |
Aaron van Geffen | 779e65d8b2 | |
Aaron van Geffen | 73c592b137 | |
ltsSmitty | 8105fb64ce | |
Smitty Penman | 84142f2173 |
|
@ -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>
|
||||
|
|
|
@ -194,7 +194,8 @@ namespace OpenRCT2::Ui::Windows
|
|||
&& !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(gClearSceneryCost);
|
||||
auto modifiedCost = FinanceGetModifiedCost(gClearSceneryCost,ExpenditureType::Landscaping);
|
||||
ft.Add<money64>(modifiedCost);
|
||||
screenCoords.x = window_clear_scenery_widgets[WIDX_PREVIEW].midX() + windowPos.x;
|
||||
screenCoords.y = window_clear_scenery_widgets[WIDX_PREVIEW].bottom + windowPos.y + 5 + 27;
|
||||
DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE });
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -88,7 +88,8 @@ static Widget window_ride_demolish_widgets[] =
|
|||
: STR_DEMOLISH_RIDE_ID_MONEY;
|
||||
auto ft = Formatter();
|
||||
currentRide->FormatNameTo(ft);
|
||||
ft.Add<money64>(_demolishRideCost);
|
||||
auto modifiedCost = FinanceGetModifiedCost(_demolishRideCost,ExpenditureType::RideConstruction);
|
||||
ft.Add<money64>(modifiedCost);
|
||||
|
||||
ScreenCoordsXY stringCoords(windowPos.x + WW / 2, windowPos.y + (WH / 2) - 3);
|
||||
DrawTextWrapped(dpi, stringCoords, WW - 4, stringId, ft, { TextAlignment::CENTRE });
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -505,7 +505,8 @@ static constexpr uint8_t ConstructionPreviewImages[][4] = {
|
|||
if (!(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(_windowFootpathCost);
|
||||
auto updatedCost = FinanceGetModifiedCost(_windowFootpathCost,ExpenditureType::Landscaping);
|
||||
ft.Add<money64>(updatedCost);
|
||||
DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -354,7 +354,8 @@ static Widget window_install_track_widgets[] = {
|
|||
if (td6->cost != 0)
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(td6->cost);
|
||||
auto cost = FinanceGetModifiedCost(td6->cost, ExpenditureType::RideConstruction);
|
||||
ft.Add<money64>(cost);
|
||||
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -270,7 +270,8 @@ static Widget window_land_widgets[] = {
|
|||
if (gLandToolRaiseCost != kMoney64Undefined && gLandToolRaiseCost != 0)
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(gLandToolRaiseCost);
|
||||
auto raiseCost = FinanceGetModifiedCost(gLandToolRaiseCost, ExpenditureType::Landscaping);
|
||||
ft.Add<money64>(raiseCost);
|
||||
DrawTextBasic(dpi, screenCoords, STR_RAISE_COST_AMOUNT, ft, { TextAlignment::CENTRE });
|
||||
}
|
||||
screenCoords.y += 10;
|
||||
|
@ -279,7 +280,8 @@ static Widget window_land_widgets[] = {
|
|||
if (gLandToolLowerCost != kMoney64Undefined && gLandToolLowerCost != 0)
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(gLandToolLowerCost);
|
||||
auto lowerCost = FinanceGetModifiedCost(gLandToolLowerCost, ExpenditureType::Landscaping);
|
||||
ft.Add<money64>(lowerCost);
|
||||
DrawTextBasic(dpi, screenCoords, STR_LOWER_COST_AMOUNT, ft, { TextAlignment::CENTRE });
|
||||
}
|
||||
screenCoords.y += 50;
|
||||
|
@ -304,7 +306,8 @@ static Widget window_land_widgets[] = {
|
|||
if (price != 0)
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(price);
|
||||
auto modifiedPrice = FinanceGetModifiedCost(price, ExpenditureType::Landscaping);
|
||||
ft.Add<money64>(modifiedPrice);
|
||||
DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -232,7 +232,8 @@ static Widget window_land_rights_widgets[] = {
|
|||
&& !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(_landRightsCost);
|
||||
auto modifiedCost = FinanceGetModifiedCost(_landRightsCost, ExpenditureType::LandPurchase);
|
||||
ft.Add<money64>(modifiedCost);
|
||||
screenCoords = { window_land_rights_widgets[WIDX_PREVIEW].midX() + windowPos.x,
|
||||
window_land_rights_widgets[WIDX_PREVIEW].bottom + windowPos.y + 32 };
|
||||
DrawTextBasic(dpi, screenCoords, STR_COST_AMOUNT, ft, { TextAlignment::CENTRE });
|
||||
|
|
|
@ -968,7 +968,8 @@ static Widget window_new_ride_widgets[] = {
|
|||
stringId = STR_NEW_RIDE_COST_FROM;
|
||||
|
||||
ft = Formatter();
|
||||
ft.Add<money64>(price);
|
||||
auto modifiedPrice = FinanceGetModifiedCost(price,ExpenditureType::RideConstruction);
|
||||
ft.Add<money64>(modifiedPrice);
|
||||
DrawTextBasic(dpi, screenPos + ScreenCoordsXY{ textWidth, 51 }, stringId, ft, { TextAlignment::RIGHT });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1581,7 +1581,7 @@ static Widget _rideConstructionWidgets[] = {
|
|||
if (_currentTrackPrice != kMoney64Undefined && !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(_currentTrackPrice);
|
||||
ft.Add<money64>(FinanceGetModifiedCost(_currentTrackPrice,ExpenditureType::RideConstruction));
|
||||
DrawTextBasic(dpi, screenCoords, STR_COST_LABEL, ft, { TextAlignment::CENTRE });
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -802,10 +802,11 @@ static Widget WindowSceneryBaseWidgets[] = {
|
|||
}
|
||||
|
||||
auto [name, price] = GetNameAndPrice(selectedSceneryEntry);
|
||||
if (price != kMoney64Undefined && !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
|
||||
auto modifiedPrice = FinanceGetModifiedCost(price,ExpenditureType::Landscaping);
|
||||
if (modifiedPrice != kMoney64Undefined && !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(price);
|
||||
ft.Add<money64>(modifiedPrice);
|
||||
|
||||
// -14
|
||||
DrawTextBasic(
|
||||
|
|
|
@ -935,7 +935,8 @@ static Widget _staffOptionsWidgets[] = {
|
|||
if (!(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(GetStaffWage(staff->AssignedStaffType));
|
||||
auto modifiedCost = FinanceGetModifiedCost(GetStaffWage(staff->AssignedStaffType),ExpenditureType::Wages);
|
||||
ft.Add<money64>(modifiedCost);
|
||||
DrawTextBasic(dpi, screenCoords, STR_STAFF_STAT_WAGES, ft);
|
||||
screenCoords.y += kListRowHeight;
|
||||
}
|
||||
|
|
|
@ -293,7 +293,8 @@ static Widget _staffListWidgets[] = {
|
|||
if (!(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
|
||||
{
|
||||
auto ft = Formatter();
|
||||
ft.Add<money64>(GetStaffWage(GetSelectedStaffType()));
|
||||
auto modifiedWage = FinanceGetModifiedCost(GetStaffWage(GetSelectedStaffType()),ExpenditureType::Wages);
|
||||
ft.Add<money64>(modifiedWage);
|
||||
DrawTextBasic(dpi, windowPos + ScreenCoordsXY{ width - 155, 32 }, STR_COST_PER_MONTH, ft);
|
||||
}
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -667,7 +667,8 @@ static Widget _trackListWidgets[] = {
|
|||
if (_loadedTrackDesign->cost != 0)
|
||||
{
|
||||
ft = Formatter();
|
||||
ft.Add<uint32_t>(_loadedTrackDesign->cost);
|
||||
auto modifiedCost = FinanceGetModifiedCost(_loadedTrackDesign->cost,ExpenditureType::RideConstruction);
|
||||
ft.Add<uint32_t>(modifiedCost);
|
||||
DrawTextBasic(dpi, screenPos, STR_TRACK_LIST_COST_AROUND, ft);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -77,6 +77,7 @@ namespace OpenRCT2
|
|||
uint8_t BankLoanInterestRate;
|
||||
money64 MaxBankLoan;
|
||||
money64 ExpenditureTable[EXPENDITURE_TABLE_MONTH_COUNT][EnumValue(ExpenditureType::Count)];
|
||||
uint16_t CostMultiplierExpenditureTable[EnumValue(ExpenditureType::Count)];
|
||||
random_engine_t ScenarioRand;
|
||||
TileCoordsXY MapSize;
|
||||
money64 LandPrice;
|
||||
|
|
|
@ -15,6 +15,7 @@
|
|||
#include "core/Path.hpp"
|
||||
#include "core/String.hpp"
|
||||
#include "platform/Platform.h"
|
||||
#include "util/Util.h"
|
||||
|
||||
using namespace OpenRCT2;
|
||||
|
||||
|
|
|
@ -210,12 +210,13 @@ namespace GameActions
|
|||
|
||||
if (result.Error == GameActions::Status::Ok)
|
||||
{
|
||||
if (!FinanceCheckAffordability(result.Cost, action->GetFlags()))
|
||||
auto modifiedCost = FinanceGetModifiedCost(result.Cost, result.Expenditure);
|
||||
if (!FinanceCheckAffordability(modifiedCost, action->GetFlags()))
|
||||
{
|
||||
result.Error = GameActions::Status::InsufficientFunds;
|
||||
result.ErrorTitle = STR_CANT_DO_THIS;
|
||||
result.ErrorMessage = STR_NOT_ENOUGH_CASH_REQUIRES;
|
||||
Formatter(result.ErrorMessageArgs.data()).Add<uint32_t>(result.Cost);
|
||||
Formatter(result.ErrorMessageArgs.data()).Add<uint32_t>(modifiedCost);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
|
@ -373,10 +374,11 @@ namespace GameActions
|
|||
return result;
|
||||
|
||||
// Update money balance
|
||||
if (result.Error == GameActions::Status::Ok && FinanceCheckMoneyRequired(flags) && result.Cost != 0)
|
||||
auto modifiedCost = FinanceGetModifiedCost(result.Cost, result.Expenditure);
|
||||
if (result.Error == GameActions::Status::Ok && FinanceCheckMoneyRequired(flags) && modifiedCost != 0)
|
||||
{
|
||||
FinancePayment(result.Cost, result.Expenditure);
|
||||
MoneyEffect::Create(result.Cost, result.Position);
|
||||
FinancePayment(modifiedCost, result.Expenditure);
|
||||
MoneyEffect::Create(modifiedCost, result.Position);
|
||||
}
|
||||
|
||||
if (!(actionFlags & GameActions::Flags::ClientOnly) && result.Error == GameActions::Status::Ok)
|
||||
|
@ -391,9 +393,9 @@ namespace GameActions
|
|||
|
||||
NetworkSetPlayerLastAction(playerIndex, action->GetType());
|
||||
NetworkIncrementPlayerNumCommands(playerIndex);
|
||||
if (result.Cost > 0)
|
||||
if (modifiedCost > 0)
|
||||
{
|
||||
NetworkAddPlayerMoneySpent(playerIndex, result.Cost);
|
||||
NetworkAddPlayerMoneySpent(playerIndex, modifiedCost);
|
||||
}
|
||||
|
||||
if (!result.Position.IsNull())
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
};
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -1695,7 +1695,10 @@ bool Guest::DecideAndBuyItem(Ride& ride, const ShopItem shopItem, money64 price)
|
|||
}
|
||||
|
||||
if (!(gameState.Park.Flags & PARK_FLAGS_NO_MONEY))
|
||||
FinancePayment(shopItemDescriptor.Cost, expenditure);
|
||||
{
|
||||
money64 modifiedCost = FinanceGetModifiedCost(shopItemDescriptor.Cost, expenditure);
|
||||
FinancePayment(modifiedCost, expenditure);
|
||||
}
|
||||
|
||||
// Sets the expenditure type to *_FOODDRINK_SALES or *_SHOP_SALES appropriately.
|
||||
expenditure = static_cast<ExpenditureType>(static_cast<int32_t>(expenditure) - 1);
|
||||
|
@ -2302,16 +2305,18 @@ void Guest::SpendMoney(money64& peep_expend_type, money64 amount, ExpenditureTyp
|
|||
{
|
||||
assert(!(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY));
|
||||
|
||||
CashInPocket = std::max(0.00_GBP, static_cast<money64>(CashInPocket) - amount);
|
||||
CashSpent += amount;
|
||||
auto modifiedCost = FinanceGetModifiedCost(amount, expenditure);
|
||||
|
||||
peep_expend_type += amount;
|
||||
CashInPocket = std::max(0.00_GBP, static_cast<money64>(CashInPocket) - modifiedCost);
|
||||
CashSpent += modifiedCost;
|
||||
|
||||
peep_expend_type += modifiedCost;
|
||||
|
||||
WindowInvalidateByNumber(WindowClass::Peep, Id);
|
||||
|
||||
FinancePayment(-amount, expenditure);
|
||||
FinancePayment(-modifiedCost, expenditure);
|
||||
|
||||
MoneyEffect::CreateAt(amount, GetLocation(), true);
|
||||
MoneyEffect::CreateAt(modifiedCost, GetLocation(), true);
|
||||
|
||||
OpenRCT2::Audio::Play3D(OpenRCT2::Audio::SoundId::Purchase, GetLocation());
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "../Context.h"
|
||||
#include "../OpenRCT2.h"
|
||||
#include "../config/ConfigTypes.h"
|
||||
#include "../platform/Platform.h"
|
||||
#include "../scripting/ScriptEngine.h"
|
||||
|
||||
|
|
|
@ -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" />
|
||||
|
|
|
@ -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)];
|
||||
|
||||
/**
|
||||
|
|
|
@ -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
|
||||
};
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "../config/Config.h"
|
||||
#include "../util/Util.h"
|
||||
#include "Currency.h"
|
||||
#include "Formatter.h"
|
||||
#include "Localisation.h"
|
||||
#include "StringIds.h"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
#pragma once
|
||||
|
||||
#include "../management/Marketing.h"
|
||||
#include "Currency.h"
|
||||
#include "Date.h"
|
||||
#include "FormatCodes.h"
|
||||
#include "Language.h"
|
||||
|
|
|
@ -91,6 +91,14 @@ void FinancePayment(money64 amount, ExpenditureType type)
|
|||
ContextBroadcastIntent(&intent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculate the cost multiplier with the expenditure modifier applied.
|
||||
*/
|
||||
money64 FinanceGetModifiedCost(money64 cost, ExpenditureType type)
|
||||
{
|
||||
return cost * GetGameState().CostMultiplierExpenditureTable[EnumValue(type)] / 100;
|
||||
}
|
||||
|
||||
/**
|
||||
* Pays the wages of all active staff members in the park.
|
||||
* rct2: 0x006C18A9
|
||||
|
@ -106,7 +114,8 @@ void FinancePayWages()
|
|||
|
||||
for (auto peep : EntityList<Staff>())
|
||||
{
|
||||
FinancePayment(GetStaffWage(peep->AssignedStaffType) / 4, ExpenditureType::Wages);
|
||||
auto modifiedCost = FinanceGetModifiedCost(GetStaffWage(peep->AssignedStaffType), ExpenditureType::Wages);
|
||||
FinancePayment(modifiedCost / 4, ExpenditureType::Wages);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -123,7 +132,8 @@ void FinancePayResearch()
|
|||
}
|
||||
|
||||
const uint8_t level = gameState.ResearchFundingLevel;
|
||||
FinancePayment(research_cost_table[level] / 4, ExpenditureType::Research);
|
||||
auto modifiedCost = FinanceGetModifiedCost(research_cost_table[level], ExpenditureType::Research);
|
||||
FinancePayment(modifiedCost / 4, ExpenditureType::Research);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -147,7 +157,8 @@ void FinancePayInterest()
|
|||
? (current_loan / 2400)
|
||||
: (current_loan * 5 * current_interest_rate) >> 14;
|
||||
|
||||
FinancePayment(interest_to_pay, ExpenditureType::Interest);
|
||||
auto modifiedCost = FinanceGetModifiedCost(interest_to_pay, ExpenditureType::Interest);
|
||||
FinancePayment(modifiedCost, ExpenditureType::Interest);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -167,12 +178,12 @@ void FinancePayRideUpkeep()
|
|||
|
||||
if (ride.status != RideStatus::Closed && !(GetGameState().Park.Flags & PARK_FLAGS_NO_MONEY))
|
||||
{
|
||||
auto upkeep = ride.upkeep_cost;
|
||||
if (upkeep != kMoney64Undefined)
|
||||
auto modifiedUpkeep = FinanceGetModifiedCost(ride.upkeep_cost, ExpenditureType::RideRunningCosts);
|
||||
if (modifiedUpkeep != kMoney64Undefined)
|
||||
{
|
||||
ride.total_profit -= upkeep;
|
||||
ride.total_profit -= modifiedUpkeep;
|
||||
ride.window_invalidate_flags |= RIDE_INVALIDATE_RIDE_INCOME;
|
||||
FinancePayment(upkeep, ExpenditureType::RideRunningCosts);
|
||||
FinancePayment(modifiedUpkeep, ExpenditureType::RideRunningCosts);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -214,6 +225,7 @@ void FinanceInit()
|
|||
for (uint32_t i = 0; i < static_cast<int32_t>(ExpenditureType::Count); i++)
|
||||
{
|
||||
gameState.ExpenditureTable[0][i] = 0;
|
||||
gameState.CostMultiplierExpenditureTable[i] = 50;
|
||||
}
|
||||
|
||||
gameState.CurrentExpenditure = 0;
|
||||
|
|
|
@ -57,3 +57,4 @@ money64 FinanceGetMaximumLoan();
|
|||
money64 FinanceGetCurrentCash();
|
||||
|
||||
money64 FinanceGetLastMonthShopProfit();
|
||||
money64 FinanceGetModifiedCost(money64 cost, ExpenditureType type);
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
||||
{
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "../TrackImporter.h"
|
||||
#include "../config/Config.h"
|
||||
#include "../core/FileStream.h"
|
||||
#include "../core/MemoryStream.h"
|
||||
#include "../core/Path.hpp"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -8,7 +8,6 @@
|
|||
*****************************************************************************/
|
||||
|
||||
#include "../../common.h"
|
||||
#include "../../config/Config.h"
|
||||
#include "../../interface/Viewport.h"
|
||||
#include "../../paint/Paint.h"
|
||||
#include "../../paint/support/WoodenSupports.h"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
|
||||
#include "../Context.h"
|
||||
#include "../common.h"
|
||||
#include "../config/Config.h"
|
||||
#include "../config/ConfigTypes.h"
|
||||
#include "../interface/Cursors.h"
|
||||
|
||||
#include <memory>
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue