Ticket #8599: AGI_MouseInSavegameDialog.patch
File AGI_MouseInSavegameDialog.patch, 1.8 KB (added by , 18 years ago) |
---|
-
savegame.cpp
458 458 sprintf(saveLoadSlot, "%s.%.3d", _targetName.c_str(), num); 459 459 return saveLoadSlot; 460 460 } 461 461 462 462 int AgiEngine::selectSlot() { 463 463 int i, key, active = 0; 464 464 int rc = -1; 465 465 int hm = 2, vm = 3; /* box margins */ 466 int xmin, xmax, slotClicked; 466 467 char desc[NUM_SLOTS][40]; 467 468 468 469 for (i = 0; i < NUM_SLOTS; i++) { 469 470 char fileName[MAX_PATH]; 470 471 Common::InSaveFile *in; 471 472 472 debugC(4, kDebugLevelMain | kDebugLevelSavegame, " Game id seems to be%s", _targetName.c_str());473 debugC(4, kDebugLevelMain | kDebugLevelSavegame, "Current game id is %s", _targetName.c_str()); 473 474 sprintf(fileName, "%s", getSavegameFilename(i)); 474 475 if (!(in = _saveFileMan->openForLoading(fileName))) { 475 476 debugC(4, kDebugLevelMain | kDebugLevelSavegame, "File %s does not exist", fileName); … … 496 497 printText(dstr, 0, hm + 1, vm + 4 + i, 497 498 (40 - 2 * hm) - 1, i == active ? MSG_BOX_COLOUR : MSG_BOX_TEXT, 498 499 i == active ? MSG_BOX_TEXT : MSG_BOX_COLOUR); 499 500 500 } 501 501 502 502 _gfx->pollTimer(); /* msdos driver -> does nothing */ … … 510 510 rc = -1; 511 511 goto getout; 512 512 case BUTTON_LEFT: 513 xmin = (hm + 1) * CHAR_COLS; 514 xmax = xmin + CHAR_COLS * 34; 515 if ((int)g_mouse.x >= xmin && (int)g_mouse.x <= xmax) { 516 slotClicked = ((int)g_mouse.y-1)/CHAR_COLS-(vm+4); 517 if (slotClicked >= 0 && slotClicked < NUM_SLOTS) 518 active = slotClicked; 519 } 513 520 break; 514 521 case KEY_DOWN: 515 522 active++; … … 568 575 _gfx->flushBlock(3 * CHAR_COLS, 11 * CHAR_LINES - 1, 569 576 37 * CHAR_COLS, 12 * CHAR_LINES); 570 577 571 getString(2, 11, 3 3, MAX_STRINGS);578 getString(2, 11, 31, MAX_STRINGS); 572 579 _gfx->printCharacter(3, 11, _game.cursorChar, MSG_BOX_COLOUR, MSG_BOX_TEXT); 573 580 do { 574 581 mainCycle();