Commit a5b69951 authored by gerstrong@gmail.com's avatar gerstrong@gmail.com

Messagebox with events fixes

parent de53f935
......@@ -89,7 +89,8 @@ bool CLevelPlay::loadLevel(const int sprVar, const Uint16 level)
const std::string level_text = "LEVEL" + itoa(level) + "_LOAD_TEXT";
const std::string loading_text = gBehaviorEngine.getString(level_text);
showMsgWithBmp( sprVar, loading_text, "KEENTHUMBSUPLOADING", LEFT, true );
showMsgWithBmp( sprVar, loading_text, "KEENTHUMBSUPLOADING",
LEFT, true, nullptr );
mMap.drawAll();
......
......@@ -440,7 +440,8 @@ void CPlayGameGalaxy::pumpEvent(const CEvent *evPtr)
const auto sprVar = mInventoryVec[ev->who].mSpriteVar;
showMsgWithBmp( sprVar, loading_text, "KEENTHUMBSUPLOADING", LEFT, true);
showMsgWithBmp( sprVar, loading_text, "KEENTHUMBSUPLOADING",
LEFT, true, nullptr);
const EventExitLevel &evCopy = *ev;
......
......@@ -58,7 +58,7 @@ bool CWorldMap::init()
showMsgWithBmp(mInventoryVec[0].mSpriteVar,
loading_text,
"KEENTHUMBSUPLOADING",
LEFT, true);
LEFT, true, nullptr);
}
mMap.drawAll();
......
......@@ -380,7 +380,7 @@ void CPlayerWM::processMoving()
{
// Tell the player he cannot climb yet
showMsgWithBmp(mSprVar, gBehaviorEngine.getString("KEEN_ROPE_REQUIRED"),
"KEENTALKING", RIGHT, false);
"KEENTALKING", RIGHT, false, nullptr);
moveYDir(-(climbDir<<CSF)/2);
}
}
......@@ -535,7 +535,7 @@ void CPlayerWM::processMoving()
gSound.playSound( SOUND_CANT_DO, SoundPlayMode::PLAY_PAUSEALL );
showMsgWithBmp(mSprVar,
gBehaviorEngine.getString("CANT_SWIM_TEXT"),
105, LEFT, false);
105, LEFT, false, nullptr);
m_cantswim = true;
}
......
......@@ -128,12 +128,12 @@ void CMessageBoxBitmapGalaxy::render()
}
void showMsgWithBmp(const int sprVar,
const std::string &text,
const std::string &bmp,
const direction_t alignment, const bool animation,
CEvent *closeEv)
const std::string &bmp,
const direction_t alignment,
const bool animation,
CEvent *closeEv)
{
CMessageBoxBitmapGalaxy *pMsgBoxBmp =
new CMessageBoxBitmapGalaxy( sprVar, text,
......
......@@ -57,14 +57,14 @@ void showMsgWithBmp(const int sprVar, const std::string &text,
const std::string &bmp,
const direction_t alignment,
const bool animation,
CEvent *closeEv = nullptr);
CEvent *closeEv);
void showMsgWithBmp(const int sprVar, const std::string &text,
const unsigned int bmpID,
const direction_t alignment ,
const bool animation,
CEvent *closeEv = nullptr);
CEvent *closeEv);
}
......
......@@ -36,11 +36,16 @@ void CDiveSuit::getTouchedBy(CSpriteObject &theObject)
gSound.playSound( SOUND_GET_WETSUIT, SoundPlayMode::PLAY_PAUSEALL );
taken = swimsuit = true;
auto evExit = new EventExitLevel(mpMap->getLevel(), true, false, player->getSpecialIdx());
auto evExit = new EventExitLevel(mpMap->getLevel(), true,
false, player->getSpecialIdx());
evExit->playSound = true;
showMsgWithBmp( 0, gBehaviorEngine.getString("SWIM_SUIT_TEXT"), "KEENTHUMBSUP", LEFT, evExit);
showMsgWithBmp( 0,
gBehaviorEngine.getString("SWIM_SUIT_TEXT"),
"KEENTHUMBSUP",
LEFT,
false,
evExit);
player->m_Inventory.Item.m_gem.clear();
}
......
......@@ -189,7 +189,7 @@ void CRocket::getTouchedBy(CSpriteObject& theObject)
// Tell the player he cannot climb yet
showMsgWithBmp(player->getSpriteVariantIdx(),
gBehaviorEngine.getString("KEEN_KEYCARD_REQUIRED"),
29, RIGHT, false);
29, RIGHT, false, nullptr);
player->moveYDir((1<<CSF)/2);
}
}
......
......@@ -45,7 +45,9 @@ void CSpecialItem::getTouchedBy(CSpriteObject& theObject)
exitEvent->playSound = true;
// Show got item message
showMsgWithBmp( player->getSpriteVariantIdx(), gBehaviorEngine.getString(answermap[mFoeID-0x63]), 30, LEFT, exitEvent );
showMsgWithBmp( player->getSpriteVariantIdx(),
gBehaviorEngine.getString(answermap[mFoeID-0x63]),
30, LEFT, false, exitEvent );
player->m_Inventory.Item.m_gem.clear();
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment