Skip to content

Commit

Permalink
mapObj: Implement CoinCollectHintObj
Browse files Browse the repository at this point in the history
  • Loading branch information
german77 committed Jan 14, 2025
1 parent 6580ece commit e3648db
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 3 deletions.
6 changes: 3 additions & 3 deletions data/odyssey_functions.csv
Original file line number Diff line number Diff line change
Expand Up @@ -14701,9 +14701,9 @@ Address,Quality,Size,Name
0x000000710024fd1c,U,000076,_ZNK2al10FunctorV0MIP25CloudStepKeyMoveComponentMS1_FvvEE5cloneEv
0x000000710024fd68,U,000004,_ZN2al10FunctorV0MIP25CloudStepKeyMoveComponentMS1_FvvEED0Ev
0x000000710024fd6c,U,000140,
0x000000710024fdf8,U,000148,_ZN18CoinCollectHintObjC2EPKc
0x000000710024fe8c,U,000160,_ZN18CoinCollectHintObjC1EPKc
0x000000710024ff2c,U,000112,_ZN18CoinCollectHintObj4initERKN2al13ActorInitInfoE
0x000000710024fdf8,O,000148,_ZN18CoinCollectHintObjC2EPKc
0x000000710024fe8c,O,000160,_ZN18CoinCollectHintObjC1EPKc
0x000000710024ff2c,O,000112,_ZN18CoinCollectHintObj4initERKN2al13ActorInitInfoE
0x000000710024ff9c,U,000124,_ZN16CollapseSandHillC2EPKc
0x0000007100250018,U,000136,_ZN16CollapseSandHillC1EPKc
0x00000071002500a0,U,000100,_ZN16CollapseSandHill4initERKN2al13ActorInitInfoE
Expand Down
36 changes: 36 additions & 0 deletions src/Item/CoinCollectHolder.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#pragma once

#include <basis/seadTypes.h>
#include <math/seadVector.h>

#include "Library/Scene/ISceneObj.h"

namespace al {
class IUseSceneObjHolder;
} // namespace al

class CoinCollect;
class CoinCollect2D;
class CoinCollectHintObj;

class CoinCollectHolder : public al::ISceneObj {
public:
CoinCollectHolder();

const char* getSceneObjName() const override;

void registerCoinCollect(CoinCollect*);
void registerCoinCollect2D(CoinCollect2D*);
void registerHintObj(CoinCollectHintObj*);

bool tryFindAliveCoinCollect(const sead::Vector3f&, bool) const;
bool tryFindAliveCoinCollect(const sead::Vector3f&, f32, f32, bool) const;
bool tryFindDeadButHintEnableCoinCollect() const;
bool tryFindAliveCoinCollect2D(const sead::Vector3f&, bool) const;
bool tryFindAliveCoinCollect2D(const sead::Vector3f&, f32, f32, bool) const;
bool tryFindExStageHintObjTrans(sead::Vector3f*, const char*);
};

namespace rs {
CoinCollectHolder* createCoinCollectHolder(const al::IUseSceneObjHolder* objHolder);
} // namespace rs
24 changes: 24 additions & 0 deletions src/MapObj/CoinCollectHintObj.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#include "MapObj/CoinCollectHintObj.h"

#include "Library/LiveActor/ActorInitFunction.h"
#include "Library/LiveActor/ActorPoseKeeper.h"
#include "Library/Placement/PlacementFunction.h"
#include "Library/Scene/SceneUtil.h"

#include "Item/CoinCollectHolder.h"
#include "Scene/SceneObjFactory.h"

CoinCollectHintObj::CoinCollectHintObj(const char* name) : al::LiveActor(name) {}

void CoinCollectHintObj::init(const al::ActorInitInfo& initInfo) {
al::initActorSceneInfo(this, initInfo);
al::getStringArg(&mStageName, initInfo, "CoinCollectStageName");
al::getTrans(&mTrans, initInfo);

rs::createCoinCollectHolder(this);
CoinCollectHolder* holder =
(CoinCollectHolder*)al::getSceneObj(this, SceneObjID_CoinCollectHolder);
holder->registerHintObj(this);

makeActorDead();
}
20 changes: 20 additions & 0 deletions src/MapObj/CoinCollectHintObj.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#pragma once

#include <math/seadVector.h>

#include "Library/LiveActor/LiveActor.h"

namespace al {
class ActorInitInfo;
} // namespace al

class CoinCollectHintObj : public al::LiveActor {
public:
CoinCollectHintObj(const char* name);

void init(const al::ActorInitInfo& info) override;

private:
const char* mStageName = nullptr;
sead::Vector3f mTrans = sead::Vector3f::zero;
};

0 comments on commit e3648db

Please sign in to comment.