Ticket #8668: indy3_iq_points_updated.diff

File indy3_iq_points_updated.diff, 2.0 KB (added by SF/mthreepwood, 17 years ago)

Updated Patch

  • 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

     
    496496                // Fall back to default behavior
    497497                ScummEngine::processKeyboard(lastKeyHit);
    498498        }
     499
     500        // i brings up an IQ dialog in Indy3
     501
     502        if (lastKeyHit == 105 && _game.id == GID_INDY3) {
     503                //SCUMM var 244 is the episode score
     504                //and var 245 is the series score
     505                Dialog *indy3IQPointsDialog;
     506                char text[50];
     507
     508                //FIXME: Currently, the series score does not work properly
     509                //This workaround just sets it equal to the episode score
     510                //However, at the end of the game, it does show the episode
     511                //score by itself
     512                int a = _scummVars[245];
     513                if (!a)
     514                        a = _scummVars[244];
     515
     516                sprintf (text, "IQ Points: Episode = %d, Series = %d", _scummVars[244], a);
     517                indy3IQPointsDialog = new Indy3IQPointsDialog(this, text);
     518                runDialog(*indy3IQPointsDialog);
     519                delete indy3IQPointsDialog;
     520        }
    499521}
    500522
    501523void ScummEngine::processKeyboard(int lastKeyHit) {