Ticket #8148: mi-cheat.diff

File mi-cheat.diff, 3.3 KB (added by eriktorbjorn, 17 years ago)

Patch against a December 17 CVS snapshot

  • scummvm/scumm/dialogs.h

    diff -ur ScummVM-cvs20021217/scummvm/scumm/dialogs.h ScummVM-cvs20021217+hack/scummvm/scumm/dialogs.h
    old new  
    120120                { close(); }
    121121        virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers)
    122122                {
    123                         if (ascii == ' ')  // Close pause dialog if space key is pressed
    124                                 close();
    125                         else
    126                                 ScummDialog::handleKeyDown(ascii, keycode, modifiers);
     123                        setResult(ascii);
     124                        close();
    127125                }
    128126protected:
    129127        void setInfoText (const String& message);
     
    132130class PauseDialog : public InfoDialog {
    133131public:
    134132        PauseDialog(NewGui *gui, Scumm *scumm);
     133        virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers)
     134                {
     135                        if (ascii == ' ')  // Close pause dialog if space key is pressed
     136                                close();
     137                        else
     138                                ScummDialog::handleKeyDown(ascii, keycode, modifiers);
     139                }
    135140};
    136141
    137142#ifdef _WIN32_WCE
  • scummvm/scumm/scumm.h

    diff -ur ScummVM-cvs20021217/scummvm/scumm/scumm.h ScummVM-cvs20021217+hack/scummvm/scumm/scumm.h
    old new  
    953953#endif
    954954
    955955        /* Scumm Vars */
     956        byte VAR_KEYPRESS;
    956957        byte VAR_EGO;
    957958        byte VAR_CAMERA_POS_X;
    958959        byte VAR_HAVE_MSG;
  • scummvm/scumm/scummvm.cpp

    diff -ur ScummVM-cvs20021217/scummvm/scumm/scummvm.cpp ScummVM-cvs20021217+hack/scummvm/scumm/scummvm.cpp
    old new  
    13971397                                                resourceStats();
    13981398                                        else
    13991399                                                _keyPressed = event.kbd.ascii;  // Normal key press, pass on to the game.
     1400                                } else if (event.kbd.flags==(OSystem::KBD_CTRL | OSystem::KBD_ALT)) {
     1401                                        // I don't know if this is correct, but
     1402                                        // I do know that Ctrl-Alt-W should be
     1403                                        // 273, because that's what MI2 checks
     1404                                        // for in its "instant win" cheat.
     1405                                        _keyPressed = event.kbd.ascii + 250;
    14001406                                } else
    14011407                                        _keyPressed = event.kbd.ascii;  // Normal key press, pass on to the game.
    14021408                                break;
  • scummvm/scumm/string.cpp

    diff -ur ScummVM-cvs20021217/scummvm/scumm/string.cpp ScummVM-cvs20021217+hack/scummvm/scumm/string.cpp
    old new  
    425425                _string[3].color = 4;
    426426
    427427        InfoDialog* dialog = new InfoDialog(_newgui, this, (char*)buf);
    428         runDialog (dialog);
     428        // FIXME: I know this is the right thing to do for MI1 and MI2. For
     429        // all other games it's just a guess.
     430        _vars[VAR_KEYPRESS] = runDialog (dialog);
    429431        delete dialog;
    430432
    431433        _messagePtr = tmp;
  • scummvm/scumm/vars.cpp

    diff -ur ScummVM-cvs20021217/scummvm/scumm/vars.cpp ScummVM-cvs20021217+hack/scummvm/scumm/vars.cpp
    old new  
    2626
    2727void Scumm::setupScummVars()
    2828{
     29        VAR_KEYPRESS = 0;
    2930        VAR_EGO = 1;
    3031        VAR_CAMERA_POS_X = 2;
    3132        VAR_HAVE_MSG = 3;
     
    113114
    114115void Scumm_v7::setupScummVars()
    115116{
     117        VAR_KEYPRESS = 0;
    116118        VAR_MOUSE_X = 1;
    117119        VAR_MOUSE_Y = 2;
    118120        VAR_VIRT_MOUSE_X = 3;