diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/ThemeParser.cpp | 4 | ||||
-rw-r--r-- | gui/ThemeParser.h | 2 | ||||
-rw-r--r-- | gui/credits.h | 22 | ||||
-rw-r--r-- | gui/launcher.cpp | 2 | ||||
-rw-r--r-- | gui/options.cpp | 2 | ||||
-rw-r--r-- | gui/predictivedialog.cpp | 18 | ||||
-rw-r--r-- | gui/saveload-dialog.cpp | 70 | ||||
-rw-r--r-- | gui/saveload-dialog.h | 1 | ||||
-rw-r--r-- | gui/widget.cpp | 2 | ||||
-rw-r--r-- | gui/widgets/editable.h | 4 | ||||
-rw-r--r-- | gui/widgets/list.h | 1 |
11 files changed, 105 insertions, 23 deletions
diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp index 9a85399ed1..8285aff7ca 100644 --- a/gui/ThemeParser.cpp +++ b/gui/ThemeParser.cpp @@ -548,11 +548,11 @@ bool ThemeParser::parseDrawStep(ParserNode *stepNode, Graphics::DrawStep *drawst else return parserError("'" + stepNode->values["fill"] + "' is not a valid fill mode for a shape."); } - + if (stepNode->values.contains("padding")) { val = stepNode->values["padding"]; int pr, pt, pl, pb; - if (parseIntegerKey(val, 4, &pl, &pt, &pr, &pb)) + if (parseIntegerKey(val, 4, &pl, &pt, &pr, &pb)) drawstep->padding.left = pl, drawstep->padding.top = pt, drawstep->padding.right = pr, diff --git a/gui/ThemeParser.h b/gui/ThemeParser.h index 82f774b803..360e3da009 100644 --- a/gui/ThemeParser.h +++ b/gui/ThemeParser.h @@ -139,7 +139,7 @@ protected: XML_PROP(height, false) XML_PROP(xpos, false) XML_PROP(ypos, false) - XML_PROP(padding, false) + XML_PROP(padding, false) XML_PROP(orientation, false) XML_PROP(file, false) KEY_END() diff --git a/gui/credits.h b/gui/credits.h index fdde2da821..37c5a7bd95 100644 --- a/gui/credits.h +++ b/gui/credits.h @@ -159,6 +159,9 @@ static const char *credits[] = { "C1""Parallaction", "C0""peres", "", +"C1""Pegasus", +"C0""Matthew Hoops", +"", "C1""Queen", "C0""David Eriksson", "C2""(retired)", @@ -234,6 +237,11 @@ static const char *credits[] = { "C0""Filippos Karapetis", "C0""Joost Peters", "", +"C1""Tony", +"C0""Arnaud Boutonn\351", +"C0""Paul Gilbert", +"C0""Alyssa Milburn", +"", "C1""Toon", "C0""Sylvain Dupont", "", @@ -249,6 +257,9 @@ static const char *credits[] = { "C0""Gregory Montoir", "C2""(retired)", "", +"C1""Wintermute", +"C0""Einar Johan T. S\370m\345en", +"", "", "C1""Backend Teams", "C1""Android", @@ -482,6 +493,7 @@ static const char *credits[] = { "C1""German", "C0""Simon Sawatzki", "C0""Lothar Serra Mari", +"C2""(retired)", "", "C1""Hungarian", "C0""Alex Bevilacqua", @@ -679,6 +691,8 @@ static const char *credits[] = { "C2""For generously providing hosting for our buildbot, SVN repository, planet and doxygen sites as well as tons of HD space", "C0""DOSBox Team", "C2""For their awesome OPL2 and OPL3 emulator", +"C0""Yusuke Kamiyamane", +"C2""For contributing some GUI icons ", "C0""Till Kresslein", "C2""For design of modern ScummVM GUI", "C0""Jezar", @@ -695,8 +709,6 @@ static const char *credits[] = { "C2""For additional work on the original MT-32 emulator", "C0""James Woodcock", "C2""Soundtrack enhancements", -"C0""Some icons by Yusuke Kamiyamane", -"C0""", "C0""Tony Warriner and everyone at Revolution Software Ltd. for sharing with us the source of some of their brilliant games, allowing us to release Beneath a Steel Sky as freeware... and generally being supportive above and beyond the call of duty.", "C0""", "C0""John Passfield and Steve Stamatiadis for sharing the source of their classic title, Flight of the Amazon Queen and also being incredibly supportive.", @@ -717,7 +729,11 @@ static const char *credits[] = { "C0""", "C0""Neil Dodwell and David Dew from Creative Reality for providing the source of Dreamweb and for their tremendous support.", "C0""", -"C0""Janusz Wisniewski and Miroslaw Liminowicz from Laboratorium Komputerowe Avalon for providing full source code for Soltys and letting us to redistribute the game.", +"C0""Janusz Wisniewski and Miroslaw Liminowicz from Laboratorium Komputerowe Avalon for providing full source code for Soltys and letting us redistribute the game.", +"C0""", +"C0""Jan Nedoma for providing the sources to the Wintermute-engine, and for his support while porting the engine to ScummVM.", +"C0""", +"C0""Bob Bell, Michel Kripalani, Tommy Yune, from Presto Studios for providing the source code of The Journeyman Project: Pegasus Prime.", "C0""", "", }; diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 26fafa5279..0f4867ced5 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -166,7 +166,7 @@ EditGameDialog::EditGameDialog(const String &domain, const String &desc) } else { warning("Plugin for target \"%s\" not found! Game specific settings might be missing", domain.c_str()); } - + // GAME: Path to game data (r/o), extra data (r/o), and save data (r/w) String gamePath(ConfMan.get("path", _domain)); String extraPath(ConfMan.get("extrapath", _domain)); diff --git a/gui/options.cpp b/gui/options.cpp index 4fc37c93da..4868f1876d 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -992,7 +992,7 @@ void OptionsDialog::addEngineControls(GuiObject *boss, const Common::String &pre ExtraGuiOptions::const_iterator iter; for (iter = engineOptions.begin(); iter != engineOptions.end(); ++iter, ++i) { Common::String id = Common::String::format("%d", i); - _engineCheckboxes.push_back(new CheckboxWidget(boss, + _engineCheckboxes.push_back(new CheckboxWidget(boss, prefix + "customOption" + id + "Checkbox", _(iter->label), _(iter->tooltip))); } } diff --git a/gui/predictivedialog.cpp b/gui/predictivedialog.cpp index b827d49416..ed18847a40 100644 --- a/gui/predictivedialog.cpp +++ b/gui/predictivedialog.cpp @@ -71,7 +71,7 @@ PredictiveDialog::PredictiveDialog() : Dialog("Predictive") { _btns = (ButtonWidget **)calloc(1, sizeof(ButtonWidget *) * 16); - _btns[kCancelAct] = new ButtonWidget(this, "Predictive.Cancel", _("Cancel") , 0, kCancelCmd); + _btns[kCancelAct] = new ButtonWidget(this, "Predictive.Cancel", _("Cancel") , 0, kCancelCmd); _btns[kOkAct] = new ButtonWidget(this, "Predictive.OK", _("Ok") , 0, kOkCmd); _btns[kBtn1Act] = new ButtonWidget(this, "Predictive.Button1", "1 `-.&" , 0, kBut1Cmd); _btns[kBtn2Act] = new ButtonWidget(this, "Predictive.Button2", "2 abc" , 0, kBut2Cmd); @@ -84,10 +84,10 @@ PredictiveDialog::PredictiveDialog() : Dialog("Predictive") { _btns[kBtn9Act] = new ButtonWidget(this, "Predictive.Button9", "9 wxyz" , 0, kBut9Cmd); _btns[kBtn0Act] = new ButtonWidget(this, "Predictive.Button0", "0" , 0, kBut0Cmd); // I18N: You must leave "#" as is, only word 'next' is translatable - _btns[kNextAct] = new ButtonWidget(this, "Predictive.Next", _("# next") , 0, kNextCmd); + _btns[kNextAct] = new ButtonWidget(this, "Predictive.Next", _("# next") , 0, kNextCmd); _btns[kAddAct] = new ButtonWidget(this, "Predictive.Add", _("add") , 0, kAddCmd); _btns[kAddAct]->setEnabled(false); - + #ifndef DISABLE_FANCY_THEMES _btns[kDelAct] = new PicButtonWidget(this, "Predictive.Delete", _("Delete char"), kDelCmd); ((PicButtonWidget *)_btns[kDelAct])->useThemeTransparency(true); @@ -214,7 +214,7 @@ void PredictiveDialog::handleKeyDown(Common::KeyState state) { _navigationwithkeys = true; if (_lastbutton == kBtn1Act || _lastbutton == kBtn4Act || _lastbutton == kBtn7Act) _currBtn = ButtonId(_lastbutton + 2); - else if (_lastbutton == kDelAct) + else if (_lastbutton == kDelAct) _currBtn = kBtn1Act; else if (_lastbutton == kModeAct) _currBtn = kNextAct; @@ -227,7 +227,7 @@ void PredictiveDialog::handleKeyDown(Common::KeyState state) { else _currBtn = ButtonId(_lastbutton - 1); - + if (_mode != kModeAbc && _lastbutton == kCancelAct) _currBtn = kOkAct; @@ -237,7 +237,7 @@ void PredictiveDialog::handleKeyDown(Common::KeyState state) { _navigationwithkeys = true; if (_lastbutton == kBtn3Act || _lastbutton == kBtn6Act || _lastbutton == kBtn9Act || _lastbutton == kOkAct) _currBtn = ButtonId(_lastbutton - 2); - else if (_lastbutton == kDelAct) + else if (_lastbutton == kDelAct) _currBtn = kBtn3Act; else if (_lastbutton == kBtn0Act) _currBtn = kNextAct; @@ -249,7 +249,7 @@ void PredictiveDialog::handleKeyDown(Common::KeyState state) { _currBtn = kAddAct; else _currBtn = ButtonId(_lastbutton + 1); - + if (_mode != kModeAbc && _lastbutton == kOkAct) _currBtn = kCancelAct; _needRefresh = true; @@ -260,7 +260,7 @@ void PredictiveDialog::handleKeyDown(Common::KeyState state) { _currBtn = kDelAct; else if (_lastbutton == kDelAct) _currBtn = kOkAct; - else if (_lastbutton == kModeAct) + else if (_lastbutton == kModeAct) _currBtn = kBtn7Act; else if (_lastbutton == kBtn0Act) _currBtn = kBtn8Act; @@ -286,7 +286,7 @@ void PredictiveDialog::handleKeyDown(Common::KeyState state) { _currBtn = kBtn0Act; else if (_lastbutton == kBtn9Act) _currBtn = kNextAct; - else if (_lastbutton == kModeAct) + else if (_lastbutton == kModeAct) _currBtn = kAddAct; else if (_lastbutton == kBtn0Act) _currBtn = kCancelAct; diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp index 850dfcc78f..df8dda7470 100644 --- a/gui/saveload-dialog.cpp +++ b/gui/saveload-dialog.cpp @@ -422,7 +422,28 @@ void SaveLoadChooserSimple::updateSelection(bool redraw) { } } +void SaveLoadChooserSimple::open() { + SaveLoadChooserDialog::open(); + + // Scroll the list to the last used entry. + _list->scrollTo(ConfMan.getInt("gui_saveload_last_pos")); +} + void SaveLoadChooserSimple::close() { + // Save the current scroll position/used entry. + const int result = getResult(); + if (result >= 0) { + ConfMan.setInt("gui_saveload_last_pos", result); + } else { + // Use the current scroll position here. + // TODO: This means we canceled the dialog (or switch to the grid). Do + // we want to save this position here? Does the user want that? + // TODO: Do we want to save the current scroll position or the + // currently selected item here? The scroll position is what the user + // currently sees and seems to make more sense. + ConfMan.setInt("gui_saveload_last_pos", _list->getCurrentScrollPos()); + } + _metaEngine = 0; _target.clear(); _saveList.clear(); @@ -590,10 +611,29 @@ void SaveLoadChooserGrid::handleMouseWheel(int x, int y, int direction) { void SaveLoadChooserGrid::open() { SaveLoadChooserDialog::open(); - _curPage = 0; _saveList = _metaEngine->listSaves(_target.c_str()); _resultString.clear(); + // Load information to restore the last page the user had open. + assert(_entriesPerPage != 0); + const uint lastPos = ConfMan.getInt("gui_saveload_last_pos"); + const uint listSize = _saveList.size(); + uint bestMatch = 0; + uint diff = 0xFFFFFFFF; + + // We look for the nearest available slot, since a slot might be missing + // due to the user deleting it via the list based chooser, by deleting + // it by hand, etc. + for (uint i = 0; i < listSize; ++i) { + uint curDiff = ABS(_saveList[i].getSaveSlot() - (int)lastPos); + if (curDiff < diff) { + diff = curDiff; + bestMatch = i; + } + } + + _curPage = bestMatch / _entriesPerPage; + // Determine the next free save slot for save mode if (_saveMode) { int lastSlot = -1; @@ -703,7 +743,7 @@ void SaveLoadChooserGrid::reflowLayout() { if (!_saveMode) { buttonCmd += 1; } - + PicButtonWidget *button = new PicButtonWidget(container, dstX, dstY, buttonWidth, buttonHeight, 0, buttonCmd); dstY += buttonHeight; @@ -718,6 +758,24 @@ void SaveLoadChooserGrid::reflowLayout() { } void SaveLoadChooserGrid::close() { + // Save the current page. + const int result = getResult(); + if (result >= 0 && result != _nextFreeSaveSlot) { + // If the user selected a slot we use that one. We ignore new slots + // here, since otherwise the dialog would reset to page 0 when the + // user cancels the savename dialog. + ConfMan.setInt("gui_saveload_last_pos", result); + } else { + // Otherwise save the first entry on the current page. + // This is less precise than the solution above, since the number of + // entries shown differs between save and load version of the dialog, + // thus it might wrap to a different page than expected. + // Similar things happen on resolution changes. + // TODO: Should we ignore this here? Is the user likely to be + // interested in having this page restored when he canceled? + ConfMan.setInt("gui_saveload_last_pos", !_saveList.empty() ? _saveList[_curPage * _entriesPerPage].getSaveSlot() : 0); + } + SaveLoadChooserDialog::close(); hideButtons(); } @@ -737,6 +795,12 @@ int SaveLoadChooserGrid::runIntern() { slot = runModal(); } while (_saveMode && slot >= 0 && !selectDescription()); + // Special case for new save games. We need to handle this here, since + // we cannot handle it in close() without problems. + if (slot == _nextFreeSaveSlot) { + ConfMan.setInt("gui_saveload_last_pos", slot); + } + return slot; } @@ -826,7 +890,7 @@ void SaveLoadChooserGrid::updateSaves() { } } - const uint numPages = (_entriesPerPage != 0) ? (_saveList.size() / _entriesPerPage + 1) : 1; + const uint numPages = (_entriesPerPage != 0 && !_saveList.empty()) ? ((_saveList.size() + _entriesPerPage - 1) / _entriesPerPage) : 1; _pageDisplay->setLabel(Common::String::format("%u/%u", _curPage + 1, numPages)); if (_curPage > 0) diff --git a/gui/saveload-dialog.h b/gui/saveload-dialog.h index 9d0350d69d..6f7d95f73f 100644 --- a/gui/saveload-dialog.h +++ b/gui/saveload-dialog.h @@ -103,6 +103,7 @@ public: virtual SaveLoadChooserType getType() const { return kSaveLoadDialogList; } #endif // !DISABLE_SAVELOADCHOOSER_GRID + virtual void open(); virtual void close(); private: virtual int runIntern(); diff --git a/gui/widget.cpp b/gui/widget.cpp index c5ca628576..4ffb63e945 100644 --- a/gui/widget.cpp +++ b/gui/widget.cpp @@ -366,7 +366,7 @@ void ButtonWidget::startAnimatePressedState() { } void ButtonWidget::wantTickle(bool tickled) { - if (tickled) + if (tickled) ((GUI::Dialog *)_boss)->setTickleWidget(this); else ((GUI::Dialog *)_boss)->unSetTickleWidget(); diff --git a/gui/widgets/editable.h b/gui/widgets/editable.h index 7e453c1204..4a18d5e689 100644 --- a/gui/widgets/editable.h +++ b/gui/widgets/editable.h @@ -77,10 +77,10 @@ public: protected: virtual void startEditMode() = 0; virtual void endEditMode() = 0; - virtual void abortEditMode() = 0; + virtual void abortEditMode() = 0; virtual Common::Rect getEditRect() const = 0; virtual int getCaretOffset() const; - void drawCaret(bool erase); + void drawCaret(bool erase); bool adjustOffset(); void makeCaretVisible(); diff --git a/gui/widgets/list.h b/gui/widgets/list.h index 41fae37a71..47613b79f3 100644 --- a/gui/widgets/list.h +++ b/gui/widgets/list.h @@ -105,6 +105,7 @@ public: void scrollTo(int item); void scrollToEnd(); + int getCurrentScrollPos() const { return _currentPos; } void enableQuickSelect(bool enable) { _quickSelect = enable; } String getQuickSelectString() const { return _quickSelectStr; } |