NEVERHOOD: Skip creating hotbox for "making of" is it's unavailable.

Otherwise it  creates an invisible button that can still be clicked and
results in a button press animation followed by a brief read screen.

Reported by: -=CHE@TER=-
This commit is contained in:
Vladimir Serbinenko 2023-02-02 14:03:54 +01:00
parent 31618a13f5
commit d3f87c97ee
2 changed files with 10 additions and 0 deletions

View File

@ -344,6 +344,13 @@ uint32 MenuButton::handleMessage(int messageNum, const MessageParam &param, Enti
return messageResult;
}
bool MainMenu::hasMakingOf() const {
for (uint i = 0; kMakingOfSmackerFileHashList[i]; i++)
if (_vm->_res->exists(kMakingOfSmackerFileHashList[i]))
return true;
return false;
}
MainMenu::MainMenu(NeverhoodEngine *vm, Module *parentModule)
: Scene(vm, parentModule) {
@ -382,6 +389,8 @@ MainMenu::MainMenu(NeverhoodEngine *vm, Module *parentModule)
insertStaticSprite(0x0C24C0EE, 100); // "Music is off" button
for (uint buttonIndex = 0; buttonIndex < 9; ++buttonIndex) {
if (buttonIndex == kMainMenuMakingOf && !hasMakingOf())
continue;
Sprite *menuButton = insertSprite<MenuButton>(this, buttonIndex,
kMenuButtonFileHashes[buttonIndex], kMenuButtonCollisionBounds[buttonIndex]);
addCollisionSprite(menuButton);

View File

@ -78,6 +78,7 @@ protected:
class MainMenu : public Scene {
public:
MainMenu(NeverhoodEngine *vm, Module *parentModule);
bool hasMakingOf() const;
protected:
uint32 handleMessage(int messageNum, const MessageParam &param, Entity *sender);
};