Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Renamed RocketLaunchLUP to MultiZoneEntrance #1185

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion dCommon/dEnums/eReplicaComponentType.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ enum class eReplicaComponentType : uint32_t {
TRADE,
USER_CONTROL,
IGNORE_LIST,
ROCKET_LAUNCH_LUP,
MULTI_ZONE_ENTRANCE,
BUFF_REAL, // the real buff component, should just be name BUFF
INTERACTION_MANAGER,
DONATION_VENDOR,
Expand Down
8 changes: 4 additions & 4 deletions dGame/Entity.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "Component.h"
#include "ControllablePhysicsComponent.h"
#include "RenderComponent.h"
#include "RocketLaunchLupComponent.h"
#include "MultiZoneEntranceComponent.h"
#include "CharacterComponent.h"
#include "DestroyableComponent.h"
#include "BuffComponent.h"
Expand Down Expand Up @@ -451,9 +451,9 @@ void Entity::Initialize() {
m_Components.insert(std::make_pair(eReplicaComponentType::INVENTORY, comp));
}
// if this component exists, then we initialize it. it's value is always 0
if (compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::ROCKET_LAUNCH_LUP, -1) != -1) {
auto comp = new RocketLaunchLupComponent(this);
m_Components.insert(std::make_pair(eReplicaComponentType::ROCKET_LAUNCH_LUP, comp));
if (compRegistryTable->GetByIDAndType(m_TemplateID, eReplicaComponentType::MULTI_ZONE_ENTRANCE, -1) != -1) {
auto comp = new MultiZoneEntranceComponent(this);
m_Components.insert(std::make_pair(eReplicaComponentType::MULTI_ZONE_ENTRANCE, comp));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion dGame/dComponents/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ set(DGAME_DCOMPONENTS_SOURCES "BaseCombatAIComponent.cpp"
"RebuildComponent.cpp"
"RenderComponent.cpp"
"RigidbodyPhantomPhysicsComponent.cpp"
"RocketLaunchLupComponent.cpp"
"MultiZoneEntranceComponent.cpp"
"RocketLaunchpadControlComponent.cpp"
"ScriptedActivityComponent.cpp"
"ShootingGalleryComponent.cpp"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#include "RocketLaunchLupComponent.h"
#include "MultiZoneEntranceComponent.h"
#include "RocketLaunchpadControlComponent.h"
#include "InventoryComponent.h"
#include "CharacterComponent.h"

RocketLaunchLupComponent::RocketLaunchLupComponent(Entity* parent) : Component(parent) {
MultiZoneEntranceComponent::MultiZoneEntranceComponent(Entity* parent) : Component(parent) {
m_Parent = parent;
std::string zoneString = GeneralUtils::UTF16ToWTF8(m_Parent->GetVar<std::u16string>(u"MultiZoneIDs"));
std::stringstream ss(zoneString);
Expand All @@ -14,17 +14,17 @@ RocketLaunchLupComponent::RocketLaunchLupComponent(Entity* parent) : Component(p
}
}

RocketLaunchLupComponent::~RocketLaunchLupComponent() {}
MultiZoneEntranceComponent::~MultiZoneEntranceComponent() {}

void RocketLaunchLupComponent::OnUse(Entity* originator) {
void MultiZoneEntranceComponent::OnUse(Entity* originator) {
auto* rocket = originator->GetComponent<CharacterComponent>()->RocketEquip(originator);
if (!rocket) return;

// the LUP world menu is just the property menu, the client knows how to handle it
GameMessages::SendPropertyEntranceBegin(m_Parent->GetObjectID(), m_Parent->GetSystemAddress());
}

void RocketLaunchLupComponent::OnSelectWorld(Entity* originator, uint32_t index) {
void MultiZoneEntranceComponent::OnSelectWorld(Entity* originator, uint32_t index) {
auto* rocketLaunchpadControlComponent = m_Parent->GetComponent<RocketLaunchpadControlComponent>();
if (!rocketLaunchpadControlComponent) return;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,23 @@
#pragma once

#include "Entity.h"
#include "GameMessages.h"
#include "Component.h"
#include "eReplicaComponentType.h"

/**
* Component that handles the LUP/WBL rocket launchpad that can be interacted with to travel to WBL worlds.
*
*/
class RocketLaunchLupComponent : public Component {
class MultiZoneEntranceComponent : public Component {
public:
static const eReplicaComponentType ComponentType = eReplicaComponentType::ROCKET_LAUNCH_LUP;
static const eReplicaComponentType ComponentType = eReplicaComponentType::MULTI_ZONE_ENTRANCE;

/**
* Constructor for this component, builds the m_LUPWorlds vector
* @param parent parent that contains this component
*/
RocketLaunchLupComponent(Entity* parent);
~RocketLaunchLupComponent() override;
MultiZoneEntranceComponent(Entity* parent);
~MultiZoneEntranceComponent() override;

/**
* Handles an OnUse event from some entity, preparing it for launch to some other world
Expand Down
4 changes: 2 additions & 2 deletions dGame/dComponents/RocketLaunchpadControlComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
#include "ChatPackets.h"
#include "MissionComponent.h"
#include "PropertyEntranceComponent.h"
#include "RocketLaunchLupComponent.h"
#include "MultiZoneEntranceComponent.h"
#include "dServer.h"
#include "PacketUtils.h"
#include "eObjectWorldState.h"
Expand Down Expand Up @@ -94,7 +94,7 @@ void RocketLaunchpadControlComponent::OnUse(Entity* originator) {
return;
}

auto* rocketLaunchLUP = m_Parent->GetComponent<RocketLaunchLupComponent>();
auto* rocketLaunchLUP = m_Parent->GetComponent<MultiZoneEntranceComponent>();
if (rocketLaunchLUP) {
return;
}
Expand Down
8 changes: 4 additions & 4 deletions dGame/dGameMessages/GameMessages.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "dConfig.h"
#include "TeamManager.h"
#include "ChatPackets.h"
#include "RocketLaunchLupComponent.h"
#include "MultiZoneEntranceComponent.h"
#include "eUnequippableActiveType.h"
#include "eMovementPlatformState.h"
#include "LeaderboardManager.h"
Expand Down Expand Up @@ -2795,9 +2795,9 @@ void GameMessages::HandleEnterProperty(RakNet::BitStream* inStream, Entity* enti
return;
}

auto rocketLaunchLupComponent = entity->GetComponent<RocketLaunchLupComponent>();
if (rocketLaunchLupComponent != nullptr) {
rocketLaunchLupComponent->OnSelectWorld(player, index);
auto multiZoneEntranceComponent = entity->GetComponent<MultiZoneEntranceComponent>();
if (multiZoneEntranceComponent != nullptr) {
multiZoneEntranceComponent->OnSelectWorld(player, index);
}
}

Expand Down
Loading