forked from rosebudai/OpenRCT2-Web
Rename members of AnimationPeepType
This commit is contained in:
16 files changed
+56
-56
No files matched your search
@@ -1337,15 +1337,15 @@ namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
case AnimationPeepType::Handyman:
|
||||
case AnimationPeepType::handyman:
|
||||
return STR_HANDYMAN_PLURAL;
|
||||
case AnimationPeepType::Mechanic:
|
||||
case AnimationPeepType::mechanic:
|
||||
return STR_MECHANIC_PLURAL;
|
||||
case AnimationPeepType::Security:
|
||||
case AnimationPeepType::security:
|
||||
return STR_SECURITY_GUARD_PLURAL;
|
||||
case AnimationPeepType::Entertainer:
|
||||
case AnimationPeepType::entertainer:
|
||||
return STR_ENTERTAINER_PLURAL;
|
||||
case AnimationPeepType::Guest:
|
||||
case AnimationPeepType::guest:
|
||||
default:
|
||||
return STR_GUESTS;
|
||||
}
|
||||
|
||||
@@ -628,7 +628,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
{
|
||||
// Tab 1 image
|
||||
auto i = (_selectedTab == TabId::Individual ? _tabAnimationIndex & ~3 : 0);
|
||||
auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::Guest);
|
||||
auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::guest);
|
||||
i += animObj->GetPeepAnimation(PeepAnimationGroup::Normal).base_image + 1;
|
||||
GfxDrawSprite(
|
||||
rt, ImageId(i, COLOUR_GREY, COLOUR_DARK_OLIVE_GREEN),
|
||||
|
||||
@@ -1234,7 +1234,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
spriteIdx = spriteIdx.WithIndexOffset((currentFrame / 8) % 8);
|
||||
GfxDrawSprite(rt, spriteIdx, windowPos + ScreenCoordsXY{ widgets[WIDX_TAB_3].left, widgets[WIDX_TAB_3].top });
|
||||
|
||||
auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::Guest);
|
||||
auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::guest);
|
||||
ImageId peepImage(
|
||||
animObj->GetPeepAnimation(PeepAnimationGroup::Normal).base_image + 1, COLOUR_BRIGHT_RED, COLOUR_TEAL);
|
||||
if (page == WINDOW_PARK_PAGE_GUESTS)
|
||||
|
||||
@@ -1326,7 +1326,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
if (page == WINDOW_RIDE_PAGE_CUSTOMER)
|
||||
spriteIndex = pickedPeepFrame & ~3;
|
||||
|
||||
auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::Guest);
|
||||
auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::guest);
|
||||
spriteIndex += animObj->GetPeepAnimation(PeepAnimationGroup::Normal).base_image + 1;
|
||||
|
||||
GfxDrawSprite(
|
||||
|
||||
@@ -143,7 +143,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
return;
|
||||
|
||||
if (staff->isEntertainer())
|
||||
_availableCostumes = getAvailableCostumeStrings(AnimationPeepType::Entertainer);
|
||||
_availableCostumes = getAvailableCostumeStrings(AnimationPeepType::entertainer);
|
||||
|
||||
ViewportInit();
|
||||
}
|
||||
@@ -165,7 +165,7 @@ namespace OpenRCT2::Ui::Windows
|
||||
return;
|
||||
|
||||
if (staff->isEntertainer())
|
||||
_availableCostumes = getAvailableCostumeStrings(AnimationPeepType::Entertainer);
|
||||
_availableCostumes = getAvailableCostumeStrings(AnimationPeepType::entertainer);
|
||||
}
|
||||
|
||||
void onMouseUp(WidgetIndex widgetIndex) override
|
||||
|
||||
@@ -595,10 +595,10 @@ namespace OpenRCT2::Ui::Windows
|
||||
void DrawTabImages(RenderTarget& rt) const
|
||||
{
|
||||
const auto& gameState = getGameState();
|
||||
DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_HANDYMEN, AnimationPeepType::Handyman, gameState.park.staffHandymanColour);
|
||||
DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_MECHANICS, AnimationPeepType::Mechanic, gameState.park.staffMechanicColour);
|
||||
DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_SECURITY, AnimationPeepType::Security, gameState.park.staffSecurityColour);
|
||||
DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_ENTERTAINERS, AnimationPeepType::Entertainer);
|
||||
DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_HANDYMEN, AnimationPeepType::handyman, gameState.park.staffHandymanColour);
|
||||
DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_MECHANICS, AnimationPeepType::mechanic, gameState.park.staffMechanicColour);
|
||||
DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_SECURITY, AnimationPeepType::security, gameState.park.staffSecurityColour);
|
||||
DrawTabImage(rt, WINDOW_STAFF_LIST_TAB_ENTERTAINERS, AnimationPeepType::entertainer);
|
||||
}
|
||||
|
||||
void DrawTabImage(RenderTarget& rt, int32_t tabIndex, AnimationPeepType type, colour_t colour) const
|
||||
|
||||
@@ -474,11 +474,11 @@ namespace OpenRCT2::Editor
|
||||
|
||||
using OpenRCT2::AnimationPeepType;
|
||||
constexpr std::pair<AnimationPeepType, StringId> kPeepCheckPairs[] = {
|
||||
{ AnimationPeepType::Guest, STR_AT_LEAST_ONE_GUEST_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED },
|
||||
{ AnimationPeepType::Handyman, STR_AT_LEAST_ONE_HANDYMAN_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED },
|
||||
{ AnimationPeepType::Mechanic, STR_AT_LEAST_ONE_MECHANIC_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED },
|
||||
{ AnimationPeepType::Security, STR_AT_LEAST_ONE_SECURITY_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED },
|
||||
{ AnimationPeepType::Entertainer, STR_AT_LEAST_ONE_ENTERTAINER_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED },
|
||||
{ AnimationPeepType::guest, STR_AT_LEAST_ONE_GUEST_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED },
|
||||
{ AnimationPeepType::handyman, STR_AT_LEAST_ONE_HANDYMAN_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED },
|
||||
{ AnimationPeepType::mechanic, STR_AT_LEAST_ONE_MECHANIC_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED },
|
||||
{ AnimationPeepType::security, STR_AT_LEAST_ONE_SECURITY_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED },
|
||||
{ AnimationPeepType::entertainer, STR_AT_LEAST_ONE_ENTERTAINER_PEEP_ANIMATIONS_OBJECT_MUST_BE_SELECTED },
|
||||
};
|
||||
|
||||
for (auto& pair : kPeepCheckPairs)
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
if (_staffType == static_cast<uint8_t>(StaffType::Entertainer))
|
||||
{
|
||||
auto costumes = findAllPeepAnimationsIndexesForType(AnimationPeepType::Entertainer);
|
||||
auto costumes = findAllPeepAnimationsIndexesForType(AnimationPeepType::entertainer);
|
||||
if (std::find(costumes.begin(), costumes.end(), _costumeIndex) == costumes.end())
|
||||
{
|
||||
LOG_ERROR("Unavailable entertainer costume %u", static_cast<uint32_t>(_costumeIndex));
|
||||
@@ -150,7 +150,7 @@ namespace OpenRCT2::GameActions
|
||||
|
||||
auto animPeepType = AnimationPeepType(static_cast<uint8_t>(_staffType) + 1);
|
||||
ObjectEntryIndex animObjectIndex = _costumeIndex;
|
||||
if (animPeepType != AnimationPeepType::Entertainer)
|
||||
if (animPeepType != AnimationPeepType::entertainer)
|
||||
animObjectIndex = findPeepAnimationsIndexForType(animPeepType);
|
||||
|
||||
newPeep->Name = nullptr;
|
||||
|
||||
@@ -7272,7 +7272,7 @@ Guest* Guest::Generate(const CoordsXYZ& coords)
|
||||
|
||||
Guest* peep = gameState.entities.CreateEntity<Guest>();
|
||||
|
||||
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Guest);
|
||||
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::guest);
|
||||
peep->AnimationGroup = PeepAnimationGroup::Normal;
|
||||
peep->OutsideOfPark = true;
|
||||
peep->State = PeepState::Falling;
|
||||
|
||||
@@ -480,8 +480,8 @@ static void ConsoleCommandStaff(InteractiveConsole& console, const arguments_t&
|
||||
console.WriteFormatLine("staff set energy <staff id> <value 0-255>");
|
||||
console.WriteFormatLine("staff set costume <staff id> <costume id>");
|
||||
|
||||
auto _availableCostumeIndexes = findAllPeepAnimationsIndexesForType(AnimationPeepType::Entertainer);
|
||||
auto _availableCostumeObjects = findAllPeepAnimationsObjectForType(AnimationPeepType::Entertainer);
|
||||
auto _availableCostumeIndexes = findAllPeepAnimationsIndexesForType(AnimationPeepType::entertainer);
|
||||
auto _availableCostumeObjects = findAllPeepAnimationsObjectForType(AnimationPeepType::entertainer);
|
||||
|
||||
for (auto i = 0u; i < _availableCostumeIndexes.size(); i++)
|
||||
{
|
||||
|
||||
@@ -22,11 +22,11 @@ namespace OpenRCT2
|
||||
{
|
||||
static const EnumMap<AnimationPeepType> animationPeepTypeMap(
|
||||
{
|
||||
{ "guest", AnimationPeepType::Guest },
|
||||
{ "handyman", AnimationPeepType::Handyman },
|
||||
{ "mechanic", AnimationPeepType::Mechanic },
|
||||
{ "security", AnimationPeepType::Security },
|
||||
{ "entertainer", AnimationPeepType::Entertainer },
|
||||
{ "guest", AnimationPeepType::guest },
|
||||
{ "handyman", AnimationPeepType::handyman },
|
||||
{ "mechanic", AnimationPeepType::mechanic },
|
||||
{ "security", AnimationPeepType::security },
|
||||
{ "entertainer", AnimationPeepType::entertainer },
|
||||
});
|
||||
|
||||
void PeepAnimationsObject::Load()
|
||||
|
||||
@@ -102,15 +102,15 @@ namespace OpenRCT2
|
||||
{
|
||||
switch (peepType)
|
||||
{
|
||||
case AnimationPeepType::Guest:
|
||||
case AnimationPeepType::guest:
|
||||
return availableGuestAnimations;
|
||||
case AnimationPeepType::Handyman:
|
||||
case AnimationPeepType::handyman:
|
||||
return availableHandymanAnimations;
|
||||
case AnimationPeepType::Mechanic:
|
||||
case AnimationPeepType::mechanic:
|
||||
return availableMechanicAnimations;
|
||||
case AnimationPeepType::Security:
|
||||
case AnimationPeepType::security:
|
||||
return availableSecurityAnimations;
|
||||
case AnimationPeepType::Entertainer:
|
||||
case AnimationPeepType::entertainer:
|
||||
default:
|
||||
return availableEntertainerAnimations;
|
||||
}
|
||||
@@ -121,14 +121,14 @@ namespace OpenRCT2
|
||||
switch (staffType)
|
||||
{
|
||||
case StaffType::Handyman:
|
||||
return AnimationPeepType::Handyman;
|
||||
return AnimationPeepType::handyman;
|
||||
case StaffType::Mechanic:
|
||||
return AnimationPeepType::Mechanic;
|
||||
return AnimationPeepType::mechanic;
|
||||
case StaffType::Security:
|
||||
return AnimationPeepType::Security;
|
||||
return AnimationPeepType::security;
|
||||
case StaffType::Entertainer:
|
||||
default:
|
||||
return AnimationPeepType::Entertainer;
|
||||
return AnimationPeepType::entertainer;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -26,11 +26,11 @@ namespace OpenRCT2
|
||||
|
||||
enum class AnimationPeepType : uint8_t
|
||||
{
|
||||
Guest,
|
||||
Handyman,
|
||||
Mechanic,
|
||||
Security,
|
||||
Entertainer,
|
||||
guest,
|
||||
handyman,
|
||||
mechanic,
|
||||
security,
|
||||
entertainer,
|
||||
};
|
||||
|
||||
const EnumMap<PeepAnimationType>& getAnimationsByPeepType(AnimationPeepType peepType);
|
||||
|
||||
@@ -1274,7 +1274,7 @@ namespace OpenRCT2::RCT1
|
||||
{
|
||||
// TODO: Entities are currently read from the global state, change this once entities are stored
|
||||
// in the passed gameState.
|
||||
auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::Guest);
|
||||
auto* animObj = findPeepAnimationsObjectForType(AnimationPeepType::guest);
|
||||
for (auto* peep : EntityList<Guest>())
|
||||
{
|
||||
const auto& spriteBounds = animObj->GetSpriteBounds(peep->AnimationGroup, peep->AnimationType);
|
||||
|
||||
@@ -848,7 +848,7 @@ namespace OpenRCT2::Scripting
|
||||
std::vector<std::string> ScGuest::availableAnimations_get() const
|
||||
{
|
||||
std::vector<std::string> availableAnimations{};
|
||||
for (auto& animation : getAnimationsByPeepType(AnimationPeepType::Guest))
|
||||
for (auto& animation : getAnimationsByPeepType(AnimationPeepType::guest))
|
||||
{
|
||||
availableAnimations.push_back(std::string(animation.first));
|
||||
}
|
||||
@@ -859,7 +859,7 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
std::vector<uint32_t> spriteIds{};
|
||||
|
||||
auto& availableGuestAnimations = getAnimationsByPeepType(AnimationPeepType::Guest);
|
||||
auto& availableGuestAnimations = getAnimationsByPeepType(AnimationPeepType::guest);
|
||||
auto animationType = availableGuestAnimations.TryGet(groupKey);
|
||||
if (animationType == std::nullopt)
|
||||
{
|
||||
@@ -895,7 +895,7 @@ namespace OpenRCT2::Scripting
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
auto& availableGuestAnimations = getAnimationsByPeepType(AnimationPeepType::Guest);
|
||||
auto& availableGuestAnimations = getAnimationsByPeepType(AnimationPeepType::guest);
|
||||
std::string_view action = availableGuestAnimations[peep->AnimationType];
|
||||
|
||||
// Special consideration for sitting peeps
|
||||
@@ -910,7 +910,7 @@ namespace OpenRCT2::Scripting
|
||||
{
|
||||
ThrowIfGameStateNotMutable();
|
||||
|
||||
auto& availableGuestAnimations = getAnimationsByPeepType(AnimationPeepType::Guest);
|
||||
auto& availableGuestAnimations = getAnimationsByPeepType(AnimationPeepType::guest);
|
||||
auto newType = availableGuestAnimations.TryGet(groupKey);
|
||||
if (newType == std::nullopt)
|
||||
{
|
||||
|
||||
@@ -78,25 +78,25 @@ namespace OpenRCT2::Scripting
|
||||
if (value == "handyman" && peep->AssignedStaffType != StaffType::Handyman)
|
||||
{
|
||||
peep->AssignedStaffType = StaffType::Handyman;
|
||||
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Handyman);
|
||||
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::handyman);
|
||||
peep->AnimationGroup = PeepAnimationGroup::Normal;
|
||||
}
|
||||
else if (value == "mechanic" && !peep->IsMechanic())
|
||||
{
|
||||
peep->AssignedStaffType = StaffType::Mechanic;
|
||||
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Mechanic);
|
||||
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::mechanic);
|
||||
peep->AnimationGroup = PeepAnimationGroup::Normal;
|
||||
}
|
||||
else if (value == "security" && peep->AssignedStaffType != StaffType::Security)
|
||||
{
|
||||
peep->AssignedStaffType = StaffType::Security;
|
||||
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Security);
|
||||
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::security);
|
||||
peep->AnimationGroup = PeepAnimationGroup::Normal;
|
||||
}
|
||||
else if (value == "entertainer" && !peep->isEntertainer())
|
||||
{
|
||||
peep->AssignedStaffType = StaffType::Entertainer;
|
||||
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::Entertainer);
|
||||
peep->AnimationObjectIndex = findPeepAnimationsIndexForType(AnimationPeepType::entertainer);
|
||||
peep->AnimationGroup = PeepAnimationGroup::Normal;
|
||||
}
|
||||
|
||||
@@ -243,17 +243,17 @@ namespace OpenRCT2::Scripting
|
||||
switch (staffType)
|
||||
{
|
||||
case StaffType::Handyman:
|
||||
animPeepType = AnimationPeepType::Handyman;
|
||||
animPeepType = AnimationPeepType::handyman;
|
||||
break;
|
||||
case StaffType::Mechanic:
|
||||
animPeepType = AnimationPeepType::Mechanic;
|
||||
animPeepType = AnimationPeepType::mechanic;
|
||||
break;
|
||||
case StaffType::Security:
|
||||
animPeepType = AnimationPeepType::Security;
|
||||
animPeepType = AnimationPeepType::security;
|
||||
break;
|
||||
case StaffType::Entertainer:
|
||||
default:
|
||||
animPeepType = AnimationPeepType::Entertainer;
|
||||
animPeepType = AnimationPeepType::entertainer;
|
||||
}
|
||||
return getAnimationsByPeepType(animPeepType);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user