mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-27 05:32:45 +00:00
NEVERHOOD: Implement cheat framework and "itsshowtime" cheat
This commit is contained in:
parent
0ca10425b6
commit
de56f3f6be
@ -464,6 +464,13 @@ uint32 DiskplayerScene::handleMessage(int messageNum, const MessageParam ¶m,
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NM_CHEAT:
|
||||
if (param.asInteger() == 0x2C034A29 && !_dropKey && !_hasAllDisks) { // "itsshowtime"
|
||||
for (uint i = 0; i < 20; i++)
|
||||
setSubVar(VA_HAS_TAPE, i, 1);
|
||||
sendMessage(_parentModule, 0x1009, 0);
|
||||
}
|
||||
break;
|
||||
case NM_ANIMATION_UPDATE:
|
||||
tuneIn();
|
||||
break;
|
||||
|
@ -142,6 +142,17 @@ void GameModule::handleAsciiKey(char key) {
|
||||
debug(2, "GameModule::handleAsciiKey()");
|
||||
sendMessage(_childObject, 0x000A, (uint32)key);
|
||||
}
|
||||
|
||||
if (key == '\n' || key == '\r') {
|
||||
if (!_currentCheat.empty() && _childObject) {
|
||||
uint32 cheatHash = calcHash(_currentCheat.c_str());
|
||||
debug(2, "GameModule: cheat=\"%s\" (0x%08x)", _currentCheat.c_str(), cheatHash);
|
||||
sendMessage(_childObject, NM_CHEAT, cheatHash);
|
||||
} else if (!_currentCheat.empty())
|
||||
debug(2, "GameModule: cheat=\"%s\" but no child", _currentCheat.c_str());
|
||||
_currentCheat.clear();
|
||||
} else if (key)
|
||||
_currentCheat += key;
|
||||
}
|
||||
|
||||
void GameModule::handleKeyDown(Common::KeyCode keyCode) {
|
||||
|
@ -68,6 +68,7 @@ protected:
|
||||
bool _restartGameRequested;
|
||||
bool _canRequestMainMenu;
|
||||
bool _mainMenuRequested;
|
||||
Common::String _currentCheat;
|
||||
uint32 handleMessage(int messageNum, const MessageParam ¶m, Entity *sender);
|
||||
void createModuleByHash(uint32 nameHash);
|
||||
void updateModule();
|
||||
|
@ -32,6 +32,7 @@ enum NeverhoodMessage {
|
||||
NM_MOUSE_SHOW = 0x101E,
|
||||
NM_KEYPRESS_SPACE = 0x0009,
|
||||
NM_KEYPRESS_ESC = 0x000C,
|
||||
NM_CHEAT = 0x000D,
|
||||
NM_ANIMATION_START = 0x100D,
|
||||
NM_SCENE_LEAVE = 0x1019,
|
||||
NM_PRIORITY_CHANGE = 0x1022,
|
||||
|
Loading…
x
Reference in New Issue
Block a user