FULLPIPE: Implement lift_animateButton()

This commit is contained in:
Eugene Sandulenko 2014-02-01 13:09:55 +02:00
parent 74850348d5
commit 3dbd8817c3
13 changed files with 47 additions and 13 deletions

View File

@ -218,6 +218,7 @@ namespace Fullpipe {
#define SC_MAP 5222
#define SC_TITLES 5166
#define SND_CMN_031 3516
#define SND_CMN_032 3517
#define SND_CMN_060 4921
#define SND_CMN_061 4922
#define SND_CMN_070 5199

View File

@ -288,7 +288,7 @@ public:
void lift_clickButton();
void lift_walkAndGo();
void lift_goAnimation();
void lift_sub1(StaticANIObject *ani);
void lift_animateButton(StaticANIObject *button);
void lift_startExitQueue();
void lift_sub05(ExCommand *ex);
bool lift_checkButton(const char *varname);

View File

@ -338,8 +338,41 @@ void FullpipeEngine::lift_goAnimation() { if (_lastLiftButton) {
}
}
void FullpipeEngine::lift_sub1(StaticANIObject *ani) {
warning("STUB: FullpipeEngine::lift_sub1()");
void FullpipeEngine::lift_animateButton(StaticANIObject *button) {
int butId = lift_getButtonIdP(button->_statics->_staticsId);
if (butId && butId != button->_statics->_staticsId) {
if (button == _lastLiftButton) {
playSound(SND_CMN_032, 0);
} else {
if (_lastLiftButton) {
int id = lift_getButtonIdN(_lastLiftButton->_statics->_staticsId);
if (id)
_lastLiftButton->_statics = _lastLiftButton->getStaticsById(id);
_lastLiftButton = 0;
}
if (_aniMan->isIdle() && !(_aniMan->_flags & 0x100)) {
_lastLiftButton = button;
button->_statics = button->getStaticsById(butId);
ExCommand *ex = new ExCommand(0, 35, SND_CMN_032, 0, 0, 0, 1, 0, 0, 0);
ex->_excFlags |= 3;
ex->_field_14 = 1;
ex->postMessage();
int id = lift_getButtonIdH(_lastLiftButton->_statics->_staticsId);
if (id) {
_lastLiftButton->_statics = _lastLiftButton->getStaticsById(id);
lift_walkAndGo();
}
}
}
}
}
void FullpipeEngine::lift_startExitQueue() {

View File

@ -246,7 +246,7 @@ int sceneHandler03(ExCommand *ex) {
{
StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(ex->_sceneClickX, ex->_sceneClickY);
if (ani && ani->_id == ANI_LIFTBUTTON) {
g_fp->lift_sub1(ani);
g_fp->lift_animateButton(ani);
ex->_messageKind = 0;
return 0;

View File

@ -647,7 +647,7 @@ int sceneHandler06(ExCommand *ex) {
if (st) {
if (!g_vars->scene06_arcadeEnabled && st->_id == ANI_LIFTBUTTON) {
g_fp->lift_sub1(st);
g_fp->lift_animateButton(st);
ex->_messageKind = 0;
return 0;
}

View File

@ -185,7 +185,7 @@ int sceneHandler10(ExCommand *ex) {
StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(ex->_sceneClickX, ex->_sceneClickY);
if (ani && ani->_id == ANI_LIFTBUTTON) {
g_fp->lift_sub1(ani);
g_fp->lift_animateButton(ani);
ex->_messageKind = 0;
return 0;

View File

@ -820,7 +820,7 @@ int sceneHandler14(ExCommand *cmd) {
StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
if (ani && ani->_id == ANI_LIFTBUTTON) {
g_fp->lift_sub1(ani);
g_fp->lift_animateButton(ani);
cmd->_messageKind = 0;
break;
}

View File

@ -171,7 +171,7 @@ int sceneHandler15(ExCommand *cmd) {
StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
if (ani && ani->_id == ANI_LIFTBUTTON) {
g_fp->lift_sub1(ani);
g_fp->lift_animateButton(ani);
cmd->_messageKind = 0;
}

View File

@ -123,7 +123,7 @@ int sceneHandler30(ExCommand *cmd) {
StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(g_fp->_sceneRect.left + cmd->_x, g_fp->_sceneRect.top + cmd->_y);
if (ani && ani->_id == ANI_LIFTBUTTON) {
g_fp->lift_sub1(ani);
g_fp->lift_animateButton(ani);
cmd->_messageKind = 0;
}

View File

@ -403,7 +403,7 @@ int sceneHandler32(ExCommand *cmd) {
StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(cmd->_sceneClickX, cmd->_sceneClickY);
if (ani && ani->_id == ANI_LIFTBUTTON) {
g_fp->lift_sub1(ani);
g_fp->lift_animateButton(ani);
cmd->_messageKind = 0;
break;

View File

@ -426,7 +426,7 @@ int sceneHandler34(ExCommand *cmd) {
}
if (ani->_id == ANI_LIFTBUTTON) {
g_fp->lift_sub1(ani);
g_fp->lift_animateButton(ani);
cmd->_messageKind = 0;

View File

@ -208,7 +208,7 @@ int sceneHandler35(ExCommand *cmd) {
if (ani)
if (ani->_id == ANI_LIFTBUTTON) {
g_fp->lift_sub1(ani);
g_fp->lift_animateButton(ani);
cmd->_messageKind = 0;
break;
}

View File

@ -376,7 +376,7 @@ int sceneHandler38(ExCommand *cmd) {
StaticANIObject *ani = g_fp->_currentScene->getStaticANIObjectAtPos(g_fp->_sceneRect.left + cmd->_x, g_fp->_sceneRect.top + cmd->_y);
if (ani && ani->_id == ANI_LIFTBUTTON) {
g_fp->lift_sub1(ani);
g_fp->lift_animateButton(ani);
cmd->_messageKind = 0;
}