aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
Diffstat (limited to 'gui')
-rw-r--r--gui/Tooltip.cpp2
-rw-r--r--gui/Tooltip.h33
-rw-r--r--gui/about.cpp2
-rw-r--r--gui/credits.h21
-rw-r--r--gui/debugger.cpp110
-rw-r--r--gui/debugger.h5
-rw-r--r--gui/dialog.cpp2
-rw-r--r--gui/launcher.cpp4
-rw-r--r--gui/options.cpp6
-rw-r--r--gui/saveload-dialog.cpp17
-rw-r--r--gui/themes/translations.datbin470115 -> 468051 bytes
11 files changed, 158 insertions, 44 deletions
diff --git a/gui/Tooltip.cpp b/gui/Tooltip.cpp
index e5f06bcafe..ba313ee34f 100644
--- a/gui/Tooltip.cpp
+++ b/gui/Tooltip.cpp
@@ -40,6 +40,8 @@ Tooltip::Tooltip() :
void Tooltip::setup(Dialog *parent, Widget *widget, int x, int y) {
assert(widget->hasTooltip());
+ _parent = parent;
+
_maxWidth = g_gui.xmlEval()->getVar("Globals.Tooltip.MaxWidth", 100);
_xdelta = g_gui.xmlEval()->getVar("Globals.Tooltip.XDelta", 0);
_ydelta = g_gui.xmlEval()->getVar("Globals.Tooltip.YDelta", 0);
diff --git a/gui/Tooltip.h b/gui/Tooltip.h
index f83fc40966..58b6d8a429 100644
--- a/gui/Tooltip.h
+++ b/gui/Tooltip.h
@@ -32,6 +32,9 @@ namespace GUI {
class Widget;
class Tooltip : public Dialog {
+private:
+ Dialog *_parent;
+
public:
Tooltip();
@@ -39,12 +42,30 @@ public:
void drawDialog();
protected:
- virtual void handleMouseDown(int x, int y, int button, int clickCount) { close(); }
- virtual void handleMouseUp(int x, int y, int button, int clickCount) { close(); }
- virtual void handleMouseWheel(int x, int y, int direction) { close(); }
- virtual void handleKeyDown(Common::KeyState state) { close(); }
- virtual void handleKeyUp(Common::KeyState state) { close(); }
- virtual void handleMouseMoved(int x, int y, int button) { close(); }
+ virtual void handleMouseDown(int x, int y, int button, int clickCount) {
+ close();
+ _parent->handleMouseDown(x + (getAbsX() - _parent->getAbsX()), y + (getAbsY() - _parent->getAbsY()), button, clickCount);
+ }
+ virtual void handleMouseUp(int x, int y, int button, int clickCount) {
+ close();
+ _parent->handleMouseUp(x + (getAbsX() - _parent->getAbsX()), y + (getAbsY() - _parent->getAbsY()), button, clickCount);
+ }
+ virtual void handleMouseWheel(int x, int y, int direction) {
+ close();
+ _parent->handleMouseWheel(x + (getAbsX() - _parent->getAbsX()), y + (getAbsX() - _parent->getAbsX()), direction);
+ }
+ virtual void handleKeyDown(Common::KeyState state) {
+ close();
+ _parent->handleKeyDown(state);
+ }
+ virtual void handleKeyUp(Common::KeyState state) {
+ close();
+ _parent->handleKeyUp(state);
+ }
+ virtual void handleMouseMoved(int x, int y, int button) {
+ close();
+ _parent->handleMouseMoved(x + (getAbsX() - _parent->getAbsX()), y + (getAbsY() - _parent->getAbsY()), button);
+ }
int _maxWidth;
int _xdelta, _ydelta;
diff --git a/gui/about.cpp b/gui/about.cpp
index b25efc1cd0..daec2b7e48 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -57,7 +57,7 @@ enum {
static const char *copyright_text[] = {
"",
-"C0""Copyright (C) 2001-2014 The ScummVM Team",
+"C0""Copyright (C) 2001-2015 The ScummVM Team",
"C0""http://www.scummvm.org",
"",
"C0""ScummVM is the legal property of its developers, whose names are too numerous to list here. Please refer to the COPYRIGHT file distributed with this binary.",
diff --git a/gui/credits.h b/gui/credits.h
index 5b33797a63..7ae12bf599 100644
--- a/gui/credits.h
+++ b/gui/credits.h
@@ -322,8 +322,10 @@ static const char *credits[] = {
"C0""Einar Johan T. S\370m\345en",
"C0""Tobia Tesan",
"",
-"C1""ZVision",
+"C1""Z-Vision",
"C0""Adrian Astley",
+"C0""Filippos Karapetis",
+"C0""Anton Yarcev",
"",
"",
"C1""Backend Teams",
@@ -580,7 +582,6 @@ static const char *credits[] = {
"C1""German",
"C0""Simon Sawatzki",
"C0""Lothar Serra Mari",
-"C2""(retired)",
"",
"C1""Hungarian",
"C0""Alex Bevilacqua",
@@ -630,6 +631,18 @@ static const char *credits[] = {
"C0""Alejandro G\363mez de la Mu\361oza",
"C2""Soltys Spanish translation",
"",
+"C1""CGE2",
+"A0""Arnaud Boutonne",
+"C0""Arnaud Boutonn\351",
+"C2""Sfinx English translation",
+"C0""Thierry Crozat",
+"C2""Sfinx English translation",
+"A0""Peter Bozso",
+"C0""Peter Bozs\363",
+"C2""Sfinx English translation editor",
+"C0""Ryan Clark",
+"C2""Sfinx English translation editor",
+"",
"C1""Drascula",
"C0""Thierry Crozat",
"C2""Improve French translation",
@@ -680,6 +693,8 @@ static const char *credits[] = {
"C2""Several Pegasus Prime patches",
"C0""Andreas Karlsson",
"C2""Initial port for SymbianOS",
+"C0""Stefan Kristiansson",
+"C2""Initial work on SDL2 support",
"C0""Claudio Matsuoka",
"C2""Daily Linux builds",
"C0""Thomas Mayer",
@@ -830,7 +845,7 @@ static const char *credits[] = {
"C0""James Woodcock",
"C2""Soundtrack enhancements",
"C0""Anton Yartsev",
-"C2""For the original re-implementation of the ZVision engine",
+"C2""For the original re-implementation of the Z-Vision engine",
"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.",
diff --git a/gui/debugger.cpp b/gui/debugger.cpp
index 216bd626fe..c9b435963d 100644
--- a/gui/debugger.cpp
+++ b/gui/debugger.cpp
@@ -87,6 +87,19 @@ Debugger::~Debugger() {
// Initialisation Functions
+int Debugger::getCharsPerLine() {
+#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER
+ const int charsPerLine = _debuggerDialog->getCharsPerLine();
+#elif defined(USE_READLINE)
+ int charsPerLine, rows;
+ rl_get_screen_size(&rows, &charsPerLine);
+#else
+ // Can we do better?
+ const int charsPerLine = 80;
+#endif
+ return charsPerLine;
+}
+
int Debugger::debugPrintf(const char *format, ...) {
va_list argptr;
@@ -101,6 +114,37 @@ int Debugger::debugPrintf(const char *format, ...) {
return count;
}
+void Debugger::debugPrintColumns(const Common::StringArray &list) {
+ uint maxLength = 0;
+ uint i, j;
+
+ for (i = 0; i < list.size(); i++) {
+ if (list[i].size() > maxLength)
+ maxLength = list[i].size();
+ }
+
+ uint charsPerLine = getCharsPerLine();
+ uint columnWidth = maxLength + 2;
+ uint columns = charsPerLine / columnWidth;
+
+ uint lines = list.size() / columns;
+
+ if (list.size() % columns)
+ lines++;
+
+ // This won't always use all available columns, but even if it did the
+ // number of lines should be the same so that's good enough.
+ for (i = 0; i < lines; i++) {
+ for (j = 0; j < columns; j++) {
+ uint pos = i + j * lines;
+ if (pos < list.size()) {
+ debugPrintf("%*s", -columnWidth, list[pos].c_str());
+ }
+ }
+ debugPrintf("\n");
+ }
+}
+
void Debugger::preEnter() {
g_engine->pauseEngine(true);
}
@@ -447,15 +491,7 @@ bool Debugger::cmdExit(int argc, const char **argv) {
// Print a list of all registered commands (and variables, if any),
// nicely word-wrapped.
bool Debugger::cmdHelp(int argc, const char **argv) {
-#ifndef USE_TEXT_CONSOLE_FOR_DEBUGGER
- const int charsPerLine = _debuggerDialog->getCharsPerLine();
-#elif defined(USE_READLINE)
- int charsPerLine, rows;
- rl_get_screen_size(&rows, &charsPerLine);
-#else
- // Can we do better?
- const int charsPerLine = 80;
-#endif
+ const int charsPerLine = getCharsPerLine();
int width, size;
uint i;
@@ -522,11 +558,25 @@ struct ArchiveMemberLess {
bool Debugger::cmdMd5(int argc, const char **argv) {
if (argc < 2) {
- debugPrintf("md5 <filename | pattern>\n");
+ debugPrintf("md5 [-n length] <filename | pattern>\n");
} else {
+ uint32 length = 0;
+ uint paramOffset = 0;
+
+ // If the user supplied an -n parameter, set the bytes to read
+ if (!strcmp(argv[1], "-n")) {
+ // Make sure that we have at least two more parameters
+ if (argc < 4) {
+ debugPrintf("md5 [-n length] <filename | pattern>\n");
+ return true;
+ }
+ length = atoi(argv[2]);
+ paramOffset = 2;
+ }
+
// Assume that spaces are part of a single filename.
- Common::String filename = argv[1];
- for (int i = 2; i < argc; i++) {
+ Common::String filename = argv[1 + paramOffset];
+ for (int i = 2 + paramOffset; i < argc; i++) {
filename = filename + " " + argv[i];
}
Common::ArchiveMemberList list;
@@ -536,9 +586,9 @@ bool Debugger::cmdMd5(int argc, const char **argv) {
} else {
sort(list.begin(), list.end(), ArchiveMemberLess());
for (Common::ArchiveMemberList::iterator iter = list.begin(); iter != list.end(); ++iter) {
- Common::ReadStream *stream = (*iter)->createReadStream();
- Common::String md5 = Common::computeStreamMD5AsString(*stream, 0);
- debugPrintf("%s %s\n", md5.c_str(), (*iter)->getDisplayName().c_str());
+ Common::SeekableReadStream *stream = (*iter)->createReadStream();
+ Common::String md5 = Common::computeStreamMD5AsString(*stream, length);
+ debugPrintf("%s %s %d\n", md5.c_str(), (*iter)->getDisplayName().c_str(), stream->size());
delete stream;
}
}
@@ -548,11 +598,25 @@ bool Debugger::cmdMd5(int argc, const char **argv) {
bool Debugger::cmdMd5Mac(int argc, const char **argv) {
if (argc < 2) {
- debugPrintf("md5mac <base filename>\n");
+ debugPrintf("md5mac [-n length] <base filename>\n");
} else {
+ uint32 length = 0;
+ uint paramOffset = 0;
+
+ // If the user supplied an -n parameter, set the bytes to read
+ if (!strcmp(argv[1], "-n")) {
+ // Make sure that we have at least two more parameters
+ if (argc < 4) {
+ debugPrintf("md5mac [-n length] <base filename>\n");
+ return true;
+ }
+ length = atoi(argv[2]);
+ paramOffset = 2;
+ }
+
// Assume that spaces are part of a single filename.
- Common::String filename = argv[1];
- for (int i = 2; i < argc; i++) {
+ Common::String filename = argv[1 + paramOffset];
+ for (int i = 2 + paramOffset; i < argc; i++) {
filename = filename + " " + argv[i];
}
Common::MacResManager macResMan;
@@ -568,13 +632,13 @@ bool Debugger::cmdMd5Mac(int argc, const char **argv) {
} else {
// The resource fork is probably the most relevant one.
if (macResMan.hasResFork()) {
- Common::String md5 = macResMan.computeResForkMD5AsString(0);
- debugPrintf("%s %s (resource)\n", md5.c_str(), macResMan.getBaseFileName().c_str());
+ Common::String md5 = macResMan.computeResForkMD5AsString(length);
+ debugPrintf("%s %s (resource) %d\n", md5.c_str(), macResMan.getBaseFileName().c_str(), macResMan.getResForkDataSize());
}
if (macResMan.hasDataFork()) {
- Common::ReadStream *stream = macResMan.getDataFork();
- Common::String md5 = Common::computeStreamMD5AsString(*stream, 0);
- debugPrintf("%s %s (data)\n", md5.c_str(), macResMan.getBaseFileName().c_str());
+ Common::SeekableReadStream *stream = macResMan.getDataFork();
+ Common::String md5 = Common::computeStreamMD5AsString(*stream, length);
+ debugPrintf("%s %s (data) %d\n", md5.c_str(), macResMan.getBaseFileName().c_str(), stream->size());
}
}
macResMan.close();
diff --git a/gui/debugger.h b/gui/debugger.h
index ef6f900974..bc9306c1de 100644
--- a/gui/debugger.h
+++ b/gui/debugger.h
@@ -28,6 +28,7 @@
#include "common/hashmap.h"
#include "common/hash-str.h"
#include "common/array.h"
+#include "common/str-array.h"
namespace GUI {
@@ -40,8 +41,12 @@ public:
Debugger();
virtual ~Debugger();
+ int getCharsPerLine();
+
int debugPrintf(const char *format, ...) GCC_PRINTF(2, 3);
+ void debugPrintColumns(const Common::StringArray &list);
+
/**
* The onFrame() method should be invoked by the engine at regular
* intervals (usually once per main loop iteration) whenever the
diff --git a/gui/dialog.cpp b/gui/dialog.cpp
index fa4e508494..315c24e9bf 100644
--- a/gui/dialog.cpp
+++ b/gui/dialog.cpp
@@ -219,7 +219,7 @@ void Dialog::handleMouseWheel(int x, int y, int direction) {
if (!w)
w = _focusedWidget;
if (w)
- w->handleMouseWheel(x, y, direction);
+ w->handleMouseWheel(x - (w->getAbsX() - _x), y - (w->getAbsY() - _y), direction);
}
void Dialog::handleKeyDown(Common::KeyState state) {
diff --git a/gui/launcher.cpp b/gui/launcher.cpp
index 4496c11a3d..5abf0aba26 100644
--- a/gui/launcher.cpp
+++ b/gui/launcher.cpp
@@ -1156,9 +1156,9 @@ void LauncherDialog::updateButtons() {
_loadButton->setEnabled(en);
_loadButton->draw();
}
- switchButtonsText(_addButton, "~A~dd Game...", "Mass Add...");
+ switchButtonsText(_addButton, "~A~dd Game...", _s("Mass Add..."));
#ifdef ENABLE_EVENTRECORDER
- switchButtonsText(_loadButton, "~L~oad...", "Record...");
+ switchButtonsText(_loadButton, "~L~oad...", _s("Record..."));
#endif
}
diff --git a/gui/options.cpp b/gui/options.cpp
index 726b89d437..ba247e5f15 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -445,11 +445,9 @@ void OptionsDialog::close() {
if (_oplPopUp) {
if (_enableAudioSettings) {
- const OPL::Config::EmulatorDescription *ed = OPL::Config::getAvailable();
- while (ed->name && ed->id != (int)_oplPopUp->getSelectedTag())
- ++ed;
+ const OPL::Config::EmulatorDescription *ed = OPL::Config::findDriver(_oplPopUp->getSelectedTag());
- if (ed->name)
+ if (ed)
ConfMan.set("opl_driver", ed->name, _domain);
else
ConfMan.removeKey("opl_driver", _domain);
diff --git a/gui/saveload-dialog.cpp b/gui/saveload-dialog.cpp
index 339ec95c50..a333c5fe57 100644
--- a/gui/saveload-dialog.cpp
+++ b/gui/saveload-dialog.cpp
@@ -654,16 +654,25 @@ void SaveLoadChooserGrid::open() {
// In case there was a gap found use the slot.
if (lastSlot + 1 < curSlot) {
- _nextFreeSaveSlot = lastSlot + 1;
- break;
+ // Check that the save slot can be used for user saves.
+ SaveStateDescriptor desc = _metaEngine->querySaveMetaInfos(_target.c_str(), lastSlot + 1);
+ if (!desc.getWriteProtectedFlag()) {
+ _nextFreeSaveSlot = lastSlot + 1;
+ break;
+ }
}
lastSlot = curSlot;
}
// Use the next available slot otherwise.
- if (_nextFreeSaveSlot == -1 && lastSlot + 1 < _metaEngine->getMaximumSaveSlot()) {
- _nextFreeSaveSlot = lastSlot + 1;
+ const int maxSlot = _metaEngine->getMaximumSaveSlot();
+ for (int i = lastSlot; _nextFreeSaveSlot == -1 && i < maxSlot; ++i) {
+ // Check that the save slot can be used for user saves.
+ SaveStateDescriptor desc = _metaEngine->querySaveMetaInfos(_target.c_str(), i + 1);
+ if (!desc.getWriteProtectedFlag()) {
+ _nextFreeSaveSlot = i + 1;
+ }
}
}
diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat
index bfa33d4feb..4225994810 100644
--- a/gui/themes/translations.dat
+++ b/gui/themes/translations.dat
Binary files differ