2024-03-22 21:39:04 +01:00
|
|
|
/*****************************************************************************
|
2024-12-31 20:30:04 +01:00
|
|
|
* Copyright (c) 2014-2025 OpenRCT2 developers
|
2024-03-22 21:39:04 +01:00
|
|
|
*
|
|
|
|
|
* 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.
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#include "Objective.h"
|
|
|
|
|
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
#include <openrct2/localisation/Formatter.h>
|
2024-07-12 22:18:43 +02:00
|
|
|
#include <openrct2/localisation/Localisation.Date.h>
|
2024-03-22 21:39:04 +01:00
|
|
|
#include <openrct2/ride/Ride.h>
|
|
|
|
|
#include <openrct2/ride/RideData.h>
|
|
|
|
|
#include <openrct2/scenario/Scenario.h>
|
|
|
|
|
|
2024-07-31 05:26:53 +01:00
|
|
|
namespace OpenRCT2::Ui
|
2024-03-22 21:39:04 +01:00
|
|
|
{
|
2024-07-31 05:26:53 +01:00
|
|
|
const StringId kObjectiveNames[] = {
|
|
|
|
|
STR_OBJECTIVE_NONE,
|
|
|
|
|
STR_OBJECTIVE_GUESTS_BY,
|
|
|
|
|
STR_OBJECTIVE_PARK_VALUE_BY,
|
|
|
|
|
STR_OBJECTIVE_HAVE_FUN,
|
|
|
|
|
STR_OBJECTIVE_BUILD_THE_BEST,
|
|
|
|
|
STR_OBJECTIVE_10_ROLLERCOASTERS,
|
|
|
|
|
STR_OBJECTIVE_GUESTS_AND_RATING,
|
|
|
|
|
STR_OBJECTIVE_MONTHLY_RIDE_INCOME,
|
|
|
|
|
STR_OBJECTIVE_10_ROLLERCOASTERS_LENGTH,
|
|
|
|
|
STR_OBJECTIVE_FINISH_5_ROLLERCOASTERS,
|
|
|
|
|
STR_OBJECTIVE_REPLAY_LOAN_AND_PARK_VALUE,
|
|
|
|
|
STR_OBJECTIVE_MONTHLY_FOOD_INCOME,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void formatObjective(Formatter& ft, Objective objective)
|
2024-03-22 21:39:04 +01:00
|
|
|
{
|
2024-07-31 05:26:53 +01:00
|
|
|
if (objective.Type == OBJECTIVE_BUILD_THE_BEST)
|
2024-03-22 21:39:04 +01:00
|
|
|
{
|
2024-07-31 05:26:53 +01:00
|
|
|
StringId rideTypeString = STR_NONE;
|
|
|
|
|
auto rideTypeId = objective.RideId;
|
|
|
|
|
if (rideTypeId != RIDE_TYPE_NULL && rideTypeId < RIDE_TYPE_COUNT)
|
|
|
|
|
{
|
|
|
|
|
rideTypeString = GetRideTypeDescriptor(rideTypeId).Naming.Name;
|
|
|
|
|
}
|
|
|
|
|
ft.Add<StringId>(rideTypeString);
|
|
|
|
|
}
|
|
|
|
|
else if (objective.Type == OBJECTIVE_GUESTS_BY)
|
|
|
|
|
{
|
|
|
|
|
ft.Add<int32_t>(objective.NumGuests);
|
|
|
|
|
ft.Add<int16_t>(DateGetTotalMonths(MONTH_OCTOBER, objective.Year));
|
|
|
|
|
}
|
|
|
|
|
else if (objective.Type == OBJECTIVE_GUESTS_AND_RATING)
|
|
|
|
|
{
|
|
|
|
|
ft.Add<int32_t>(objective.NumGuests);
|
|
|
|
|
}
|
|
|
|
|
else if (objective.Type == OBJECTIVE_10_ROLLERCOASTERS_LENGTH)
|
|
|
|
|
{
|
|
|
|
|
ft.Add<int16_t>(objective.MinimumLength);
|
2024-03-22 21:39:04 +01:00
|
|
|
}
|
|
|
|
|
else
|
2024-07-31 05:26:53 +01:00
|
|
|
{
|
|
|
|
|
ft.Add<int16_t>(objective.NumGuests);
|
|
|
|
|
ft.Add<int16_t>(DateGetTotalMonths(MONTH_OCTOBER, objective.Year));
|
|
|
|
|
if (objective.Type == OBJECTIVE_FINISH_5_ROLLERCOASTERS)
|
|
|
|
|
ft.Add<uint16_t>(objective.MinimumExcitement);
|
|
|
|
|
else
|
|
|
|
|
ft.Add<money64>(objective.Currency);
|
|
|
|
|
}
|
2024-03-22 21:39:04 +01:00
|
|
|
}
|
2024-07-31 05:26:53 +01:00
|
|
|
} // namespace OpenRCT2::Ui
|