aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2016-07-23 09:13:55 -0400
committerPaul Gilbert2016-07-23 09:13:55 -0400
commit4bad949717c9179e9192b0edf6b81b9012fd0fbf (patch)
tree37c067a41c8d67e8530730ec0100b9d132fa5631
parent9a69ee3f44ee6ad72da8f5bacf3329f95d86707f (diff)
downloadscummvm-rg350-4bad949717c9179e9192b0edf6b81b9012fd0fbf.tar.gz
scummvm-rg350-4bad949717c9179e9192b0edf6b81b9012fd0fbf.tar.bz2
scummvm-rg350-4bad949717c9179e9192b0edf6b81b9012fd0fbf.zip
TITANIC: Add Continue Save dialog slots rendering and selection
-rw-r--r--engines/titanic/continue_save_dialog.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/engines/titanic/continue_save_dialog.cpp b/engines/titanic/continue_save_dialog.cpp
index 5a881c1ac6..483b308db9 100644
--- a/engines/titanic/continue_save_dialog.cpp
+++ b/engines/titanic/continue_save_dialog.cpp
@@ -60,7 +60,7 @@ void CContinueSaveDialog::addSavegame(int slot, const CString &name) {
}
Rect CContinueSaveDialog::getSlotBounds(int index) {
- return Rect(360, 168 + index * 12, 556, 180 + index * 12);
+ return Rect(360, 164 + index * 19, 556, 180 + index * 19);
}
int CContinueSaveDialog::show() {
@@ -157,8 +157,12 @@ void CContinueSaveDialog::renderButtons() {
}
void CContinueSaveDialog::renderSlots() {
- for (int idx = 0; idx < SAVEGAME_SLOTS_COUNT; ++idx)
+ for (uint idx = 0; idx < _saves.size(); ++idx) {
+ byte rgb = (_highlightedSlot == idx) ? 255 : 0;
+ _slotNames[idx].setColor(rgb, rgb, rgb);
+ _slotNames[idx].setLineColor(0, rgb, rgb, rgb);
_slotNames[idx].draw(CScreenManager::_screenManagerPtr);
+ }
}
void CContinueSaveDialog::mouseMove(const Point &mousePos) {
@@ -185,7 +189,14 @@ void CContinueSaveDialog::leftButtonUp(const Point &mousePos) {
// Start a new game
_selectedSlot = -1;
} else {
- // TODO: Slot highlighting
+ // Check whether a filled in slot was selected
+ for (uint idx = 0; idx < _saves.size(); ++idx) {
+ if (getSlotBounds(idx).contains(mousePos)) {
+ _highlightedSlot = idx;
+ render();
+ break;
+ }
+ }
}
}