mirror of
https://github.com/isledecomp/isle-portable.git
synced 2024-11-22 15:37:55 -05:00
Implement/match Ambulance::HandleButtonDown (#1028)
This commit is contained in:
parent
33c64bb002
commit
cf7246ac6c
3 changed files with 37 additions and 3 deletions
|
@ -38,6 +38,7 @@ extern MxAtomId* g_isleScript;
|
||||||
|
|
||||||
LegoEntity* PickEntity(MxLong, MxLong);
|
LegoEntity* PickEntity(MxLong, MxLong);
|
||||||
LegoROI* PickROI(MxLong, MxLong);
|
LegoROI* PickROI(MxLong, MxLong);
|
||||||
|
LegoROI* PickParentROI(MxLong p_a, MxLong p_b);
|
||||||
MxS16 CountTotalTreeNodes(LegoTreeNode* p_node);
|
MxS16 CountTotalTreeNodes(LegoTreeNode* p_node);
|
||||||
void FUN_1003e050(LegoAnimPresenter* p_presenter);
|
void FUN_1003e050(LegoAnimPresenter* p_presenter);
|
||||||
Extra::ActionType MatchActionString(const char*);
|
Extra::ActionType MatchActionString(const char*);
|
||||||
|
|
|
@ -236,10 +236,26 @@ MxLong Ambulance::HandleEndAction(MxEndActionNotificationParam& p_param)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x100367c0
|
// FUNCTION: LEGO1 0x100367c0
|
||||||
|
// FUNCTION: BETA10 0x100230bf
|
||||||
MxLong Ambulance::HandleButtonDown(LegoControlManagerEvent& p_param)
|
MxLong Ambulance::HandleButtonDown(LegoControlManagerEvent& p_param)
|
||||||
{
|
{
|
||||||
// TODO
|
if (m_unk0x170 == 1) {
|
||||||
|
LegoROI* roi = PickROI(p_param.GetX(), p_param.GetY());
|
||||||
|
|
||||||
|
if (roi != NULL && !strcmpi(roi->GetName(), "ps-gate")) {
|
||||||
|
m_unk0x170 = 3;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
roi = PickParentROI(p_param.GetX(), p_param.GetY());
|
||||||
|
|
||||||
|
if (roi != NULL && !strcmpi(roi->GetName(), "gd")) {
|
||||||
|
m_unk0x170 = 3;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,24 @@
|
||||||
// FUNCTION: LEGO1 0x1003dd70
|
// FUNCTION: LEGO1 0x1003dd70
|
||||||
LegoROI* PickROI(MxLong p_a, MxLong p_b)
|
LegoROI* PickROI(MxLong p_a, MxLong p_b)
|
||||||
{
|
{
|
||||||
return (LegoROI*) VideoManager()->Get3DManager()->GetLego3DView()->Pick(p_a, p_b);
|
LegoVideoManager* videoManager = VideoManager();
|
||||||
|
Lego3DView* view = videoManager->Get3DManager()->GetLego3DView();
|
||||||
|
return (LegoROI*) view->Pick(p_a, p_b);
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION: LEGO1 0x1003dd90
|
||||||
|
// FUNCTION: BETA10 0x100d3449
|
||||||
|
LegoROI* PickParentROI(MxLong p_a, MxLong p_b)
|
||||||
|
{
|
||||||
|
LegoVideoManager* videoManager = VideoManager();
|
||||||
|
Lego3DView* view = videoManager->Get3DManager()->GetLego3DView();
|
||||||
|
LegoROI* roi = (LegoROI*) view->Pick(p_a, p_b);
|
||||||
|
|
||||||
|
while (roi != NULL && roi->GetParentROI() != NULL) {
|
||||||
|
roi = (LegoROI*) roi->GetParentROI();
|
||||||
|
}
|
||||||
|
|
||||||
|
return roi;
|
||||||
}
|
}
|
||||||
|
|
||||||
// STUB: LEGO1 0x1003ddc0
|
// STUB: LEGO1 0x1003ddc0
|
||||||
|
|
Loading…
Reference in a new issue