Ticket #8668: indy3_iq_points.diff

File indy3_iq_points.diff, 2.7 KB (added by SF/mthreepwood, 13 years ago)

Patch for IQ Points Dialog

  • dialogs.cpp

     
    910910        _timer = getMillis() + kDisplayDelay;
    911911}
    912912
     913Indy3IQPointsDialog::Indy3IQPointsDialog(ScummEngine *scumm, char* text)
     914        : InfoDialog(scumm, text) {
     915}
    913916
     917void Indy3IQPointsDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
     918        if (ascii == 'i')
     919                close();
     920        else
     921                ScummDialog::handleKeyDown(ascii, keycode, modifiers);
     922}
    914923
    915924} // End of namespace Scumm
    916925
  • dialogs.h

     
    232232        uint32 _timer;
    233233};
    234234
     235
     236//The Indy IQ dialog
     237class Indy3IQPointsDialog : public InfoDialog {
     238public:
     239        Indy3IQPointsDialog(ScummEngine *scumm, char* text);
     240        virtual void handleKeyDown(uint16 ascii, int keycode, int modifiers);
     241};
     242
    235243} // End of namespace Scumm
    236244
    237245#endif
  • input.cpp

     
    513513                saveloadkey = -1;
    514514        }
    515515
     516        // i brings up an IQ dialog in Indy3
     517
     518        if (lastKeyHit == 105 && _game.id == GID_INDY3) {
     519                indy3IQPointsDialog(_scummVars[244], _scummVars[245]);
     520        }
     521
    516522        if (lastKeyHit == saveloadkey) {
    517523                if (VAR_SAVELOAD_SCRIPT != 0xFF && _currentRoom != 0)
    518524                        runScript(VAR(VAR_SAVELOAD_SCRIPT), 0, 0, 0);
  • scumm.cpp

     
    22812281        runDialog(*_pauseDialog);
    22822282}
    22832283
     2284void ScummEngine::indy3IQPointsDialog(int a, int b) {
     2285        char text[50];
     2286       
     2287        //Since series score doesn't work right, set it equal to episode score
     2288        if (!b)
     2289                b = a;
     2290
     2291        sprintf (text, "IQ Points: Episode = %d, Series = %d", a, b);
     2292        if (!_indy3IQPointsDialog)
     2293                _indy3IQPointsDialog = new Indy3IQPointsDialog(this, text);
     2294        runDialog(*_indy3IQPointsDialog);
     2295        delete _indy3IQPointsDialog;
     2296        _indy3IQPointsDialog = 0;
     2297}
     2298
    22842299void ScummEngine::versionDialog() {
    22852300        if (!_versionDialog)
    22862301                _versionDialog = new PauseDialog(this, 1);
  • scumm.h

     
    498498
    499499protected:
    500500        Dialog *_pauseDialog;
     501        Dialog *_indy3IQPointsDialog;
    501502        Dialog *_versionDialog;
    502503        Dialog *_mainMenuDialog;
    503504
    504505        virtual int runDialog(Dialog &dialog);
    505506        void confirmExitDialog();
    506507        void confirmRestartDialog();
     508        void indy3IQPointsDialog(int a, int b);
    507509        void pauseDialog();
    508510        void versionDialog();
    509511        void mainMenuDialog();