diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/ThemeParser.cpp | 10 | ||||
-rw-r--r-- | gui/about.cpp | 41 | ||||
-rw-r--r-- | gui/credits.h | 41 | ||||
-rw-r--r-- | gui/launcher.cpp | 4 | ||||
-rw-r--r-- | gui/predictivedialog.cpp | 5 | ||||
-rw-r--r-- | gui/themes/default.inc | 2 | ||||
-rw-r--r-- | gui/themes/scummclassic.zip | bin | 104007 -> 104059 bytes | |||
-rw-r--r-- | gui/themes/scummclassic/classic_layout.stx | 1 | ||||
-rw-r--r-- | gui/themes/scummclassic/classic_layout_lowres.stx | 1 | ||||
-rw-r--r-- | gui/themes/scummmodern.zip | bin | 1462312 -> 1462338 bytes | |||
-rw-r--r-- | gui/themes/scummmodern/scummmodern_layout_lowres.stx | 1 | ||||
-rw-r--r-- | gui/themes/translations.dat | bin | 415454 -> 441486 bytes | |||
-rw-r--r-- | gui/widgets/list.cpp | 15 | ||||
-rw-r--r-- | gui/widgets/list.h | 1 |
14 files changed, 100 insertions, 22 deletions
diff --git a/gui/ThemeParser.cpp b/gui/ThemeParser.cpp index 8285aff7ca..bd5b406ca8 100644 --- a/gui/ThemeParser.cpp +++ b/gui/ThemeParser.cpp @@ -335,11 +335,15 @@ bool ThemeParser::parserCallback_drawstep(ParserNode *node) { drawstep->drawingCall = getDrawingFunctionCallback(functionName); - if (drawstep->drawingCall == 0) + if (drawstep->drawingCall == 0) { + delete drawstep; return parserError(functionName + " is not a valid drawing function name"); + } - if (!parseDrawStep(node, drawstep, true)) + if (!parseDrawStep(node, drawstep, true)) { + delete drawstep; return false; + } _theme->addDrawStep(getParentNode(node)->values["id"], *drawstep); delete drawstep; @@ -691,7 +695,7 @@ bool ThemeParser::parserCallback_layout(ParserNode *node) { return false; } - Common::parseBool(node->values["center"], center); + (void)Common::parseBool(node->values["center"], center); if (node->values["type"] == "vertical") _theme->getEvaluator()->addLayout(GUI::ThemeLayout::kLayoutVertical, spacing, center); diff --git a/gui/about.cpp b/gui/about.cpp index e2b7064279..088971f273 100644 --- a/gui/about.cpp +++ b/gui/about.cpp @@ -37,14 +37,16 @@ enum { kScrollMillisPerPixel = 60 }; -// The following commands can be put at the start of a line (all subject to change): -// \C, \L, \R -- set center/left/right alignment -// \c0 - \c4 -- set a custom color: -// 0 normal text (green) -// 1 highlighted text (light green) -// 2 light border (light gray) -// 3 dark border (dark gray) -// 4 background (black) +// Every Line should start with a letter followed by a digit. Currently those can be +// (all subject to change) +// Letter: +// C, L, R -- set center/left/right alignment +// A -- ASCII text to replace the next (latin1) line +// Digit: +// 0 - 2 -- set a custom color: +// 0 normal text +// 1 highlighted text +// 2 disabled text // TODO: Maybe add a tab/indent feature; that is, make it possible to specify // an amount by which that line shall be indented (the indent of course would have // to be considered while performing any word wrapping, too). @@ -137,9 +139,26 @@ void AboutDialog::addLine(const char *str) { } else { Common::String format(str, 2); str += 2; - + + static Common::String asciiStr; + if (format[0] == 'A') { + bool useAscii = false; +#ifdef USE_TRANSLATION + // We could use TransMan.getCurrentCharset() but rather than compare strings + // it is easier to use TransMan.getCharsetMapping() (non null in case of non + // ISO-8859-1 mapping) + useAscii = (TransMan.getCharsetMapping() != NULL); +#endif + if (useAscii) + asciiStr = str; + return; + } StringArray wrappedLines; - g_gui.getFont().wordWrapText(str, _w - 2 * _xOff, wrappedLines); + if (!asciiStr.empty()) { + g_gui.getFont().wordWrapText(asciiStr, _w - 2 * _xOff, wrappedLines); + asciiStr.clear(); + } else + g_gui.getFont().wordWrapText(str, _w - 2 * _xOff, wrappedLines); for (StringArray::const_iterator i = wrappedLines.begin(); i != wrappedLines.end(); ++i) { _lines.push_back(format + *i); @@ -285,7 +304,7 @@ void AboutDialog::reflowLayout() { int maxW = _w - 2*_xOff; _w = 0; for (i = 0; i < ARRAYSIZE(credits); i++) { - int tmp = g_gui.getStringWidth(credits[i] + 5); + int tmp = g_gui.getStringWidth(credits[i]) + 5; if (_w < tmp && tmp <= maxW) { _w = tmp; } diff --git a/gui/credits.h b/gui/credits.h index 237d97d56c..81d46b2b73 100644 --- a/gui/credits.h +++ b/gui/credits.h @@ -6,6 +6,7 @@ static const char *credits[] = { "C0""Eugene Sandulenko", "", "C1""PR Office", +"A0""Arnaud Boutonne", "C0""Arnaud Boutonn\351", "C2""Public Relations Officer, Project Administrator", "C0""Eugene Sandulenko", @@ -26,6 +27,7 @@ static const char *credits[] = { "", "C1""Engine Teams", "C1""SCUMM", +"A0""Torbjorn Andersson", "C0""Torbj\366rn Andersson", "C0""James Brown", "C2""(retired)", @@ -66,6 +68,7 @@ static const char *credits[] = { "C2""(retired)", "", "C1""AGOS", +"A0""Torbjorn Andersson", "C0""Torbj\366rn Andersson", "C0""Paul Gilbert", "C0""Travis Howell", @@ -75,6 +78,7 @@ static const char *credits[] = { "C2""(retired)", "", "C1""CGE", +"A0""Arnaud Boutonne", "C0""Arnaud Boutonn\351", "C0""Paul Gilbert", "", @@ -104,6 +108,7 @@ static const char *credits[] = { "C0""Pawel Kolodziejski", "", "C1""DreamWeb", +"A0""Torbjorn Andersson", "C0""Torbj\366rn Andersson", "C0""Bertrand Augereau", "C0""Filippos Karapetis", @@ -112,7 +117,9 @@ static const char *credits[] = { "C0""Willem Jan Palenstijn", "", "C1""Gob", +"A0""Torbjorn Andersson", "C0""Torbj\366rn Andersson", +"A0""Arnaud Boutonne", "C0""Arnaud Boutonn\351", "C0""Sven Hesse", "C0""Eugene Sandulenko", @@ -122,12 +129,19 @@ static const char *credits[] = { "C0""Scott Thomas", "C0""Jordi Vilalta Prat", "", +"C1""Hopkins", +"A0""Arnaud Boutonne", +"C0""Arnaud Boutonn\351", +"C0""Paul Gilbert", +"", "C1""Hugo", +"A0""Arnaud Boutonne", "C0""Arnaud Boutonn\351", "C0""Oystein Eftevaag", "C0""Eugene Sandulenko", "", "C1""Kyra", +"A0""Torbjorn Andersson", "C0""Torbj\366rn Andersson", "C2""VQA Player", "C0""Oystein Eftevaag", @@ -170,6 +184,7 @@ static const char *credits[] = { "C0""Joost Peters", "", "C1""SAGA", +"A0""Torbjorn Andersson", "C0""Torbj\366rn Andersson", "C0""Daniel Balsom", "C2""Original engine reimplementation author (retired)", @@ -191,6 +206,7 @@ static const char *credits[] = { "C0""Lars Skovlund", "", "C1""Sky", +"A0""Robert Goeffringmann", "C0""Robert G\366ffringmann", "C2""(retired)", "C0""Oliver Kiehl", @@ -202,10 +218,12 @@ static const char *credits[] = { "C2""PSX version support", "C0""Thierry Crozat", "C2""Mac version support", +"A0""Robert Goeffringmann", "C0""Robert G\366ffringmann", "C2""(retired)", "", "C1""Sword2", +"A0""Torbjorn Andersson", "C0""Torbj\366rn Andersson", "C0""Fabio Battaglia", "C2""PSX version support", @@ -213,6 +231,7 @@ static const char *credits[] = { "C2""(retired)", "", "C1""Sword25", +"A0""Torbjorn Andersson", "C0""Torbj\366rn Andersson", "C0""Paul Gilbert", "C0""Max Horn", @@ -227,6 +246,7 @@ static const char *credits[] = { "C2""(retired)", "", "C1""Tinsel", +"A0""Torbjorn Andersson", "C0""Torbj\366rn Andersson", "C0""Fabio Battaglia", "C2""PSX version support", @@ -242,6 +262,7 @@ static const char *credits[] = { "C0""Filippos Karapetis", "", "C1""Tony", +"A0""Arnaud Boutonne", "C0""Arnaud Boutonn\351", "C0""Paul Gilbert", "C0""Alyssa Milburn", @@ -249,11 +270,13 @@ static const char *credits[] = { "C1""Toon", "C0""Sylvain Dupont", "", +"A1""Touche", "C1""Touch\351", "C0""Gregory Montoir", "C2""(retired)", "", "C1""TsAGE", +"A0""Arnaud Boutonne", "C0""Arnaud Boutonn\351", "C0""Paul Gilbert", "", @@ -262,6 +285,7 @@ static const char *credits[] = { "C2""(retired)", "", "C1""Wintermute", +"A0""Einar Johan T. Somaaen", "C0""Einar Johan T. S\370m\345en", "", "", @@ -309,6 +333,7 @@ static const char *credits[] = { "C2""(retired)", "", "C1""PlayStation 2", +"A0""Robert Goeffringmann", "C0""Robert G\366ffringmann", "C2""(retired)", "C0""Max Lingua", @@ -355,6 +380,9 @@ static const char *credits[] = { "C2""Heavily improved de-/encoder for DXA videos", "C0""Jochen Hoenicke", "C2""Speaker & PCjr sound support, AdLib work (retired)", +"A0""Daniel ter Laan", +"C0""Dani\353l ter Laan", +"C2""Restoring original Drascula tracks, and writing convert_dxa.bat", "C0""Chris Page", "C2""Return to launcher, savestate improvements, leak fixes, ... (GSoC 2008 task) (retired)", "C0""Robin Watts", @@ -417,9 +445,11 @@ static const char *credits[] = { "", "C1""Packages", "C1""AmigaOS 4", +"A0""Hans-Joerg Frieden", "C0""Hans-J\366rg Frieden", "C2""(retired)", "C0""Hubert Maier", +"A0""Juha Niemimaki", "C0""Juha Niemim\344ki", "C2""(retired)", "", @@ -449,6 +479,7 @@ static const char *credits[] = { "", "C1""MorphOS", "C0""Fabien Coeurjoly", +"A0""Ruediger Hanke", "C0""R\374diger Hanke", "C2""(retired)", "", @@ -486,6 +517,7 @@ static const char *credits[] = { "C0""Jordi Vilalta Prat", "", "C1""Czech", +"A0""Zbynik Schwarz", "C0""Zbyn\354k Schwarz", "", "C1""Danish", @@ -512,10 +544,13 @@ static const char *credits[] = { "C1""Italian", "C0""Matteo Angelino", "", +"A1""Norwegian (Bokmaal)", "C1""Norwegian (Bokm\345l)", +"A0""Einar Johan Somaaen", "C0""Einar Johan S\370m\345en", "", "C1""Norwegian (Nynorsk)", +"A0""Einar Johan Somaaen", "C0""Einar Johan S\370m\345en", "", "C1""Polish", @@ -528,6 +563,7 @@ static const char *credits[] = { "C0""Eugene Sandulenko", "", "C1""Spanish", +"A0""Tomas Maidagan", "C0""Tom\341s Maidagan", "C0""Jordi Vilalta Prat", "", @@ -539,6 +575,7 @@ static const char *credits[] = { "", "", "C1""Websites (design)", +"A0""Dobo Balazs", "C0""Dob\363 Bal\341zs", "C2""Website design", "C0""William Claydon", @@ -567,6 +604,7 @@ static const char *credits[] = { "C2""Sound support for C64 version of MM/Zak, Loom PCE support", "C0""Janne Huttunen", "C2""V3 actor mask support, Dig/FT SMUSH audio", +"A0""Kovacs Endre Janos", "C0""Kov\341cs Endre J\341nos", "C2""Several fixes for Simon1", "C0""Jeroen Janssen", @@ -591,12 +629,14 @@ static const char *credits[] = { "C2""Sound support for Amiga SCUMM V2/V3 games, MM NES support", "C0""Robert Crossfield", "C2""Improved support for Apple II/C64 versions of MM", +"A0""Andreas Roever", "C0""Andreas R\366ver", "C2""Broken Sword I & II MPEG2 cutscene support", "C0""Edward Rudd", "C2""Fixes for playing MP3 versions of MI1/Loom audio", "C0""Daniel Schepler", "C2""Final MI1 CD music support, initial Ogg Vorbis support", +"A0""Andre Souza", "C0""Andr\351 Souza", "C2""SDL-based OpenGL renderer", "C0""Tom Frost", @@ -713,6 +753,7 @@ static const char *credits[] = { "C2""For deep tech details about C64 Zak & MM", "C0""Sarien Team", "C2""Original AGI engine code", +"A0""Jimmi Thogersen", "C0""Jimmi Th\370gersen", "C2""For ScummRev, and much obscure code/documentation", "C0""Tristan", diff --git a/gui/launcher.cpp b/gui/launcher.cpp index 0f4867ced5..4e35b54db8 100644 --- a/gui/launcher.cpp +++ b/gui/launcher.cpp @@ -1128,7 +1128,7 @@ void LauncherDialog::reflowLayout() { if (g_gui.xmlEval()->getVar("Globals.ShowLauncherLogo") == 1 && g_gui.theme()->supportsImages()) { StaticTextWidget *ver = (StaticTextWidget *)findWidget("Launcher.Version"); if (ver) { - ver->setAlign((Graphics::TextAlign)g_gui.xmlEval()->getVar("Launcher.Version.Align", Graphics::kTextAlignCenter)); + ver->setAlign(g_gui.xmlEval()->getWidgetTextHAlign("Launcher.Version")); ver->setLabel(gScummVMVersionDate); } @@ -1139,7 +1139,7 @@ void LauncherDialog::reflowLayout() { } else { StaticTextWidget *ver = (StaticTextWidget *)findWidget("Launcher.Version"); if (ver) { - ver->setAlign((Graphics::TextAlign)g_gui.xmlEval()->getVar("Launcher.Version.Align", Graphics::kTextAlignCenter)); + ver->setAlign(g_gui.xmlEval()->getWidgetTextHAlign("Launcher.Version")); ver->setLabel(gScummVMFullVersion); } diff --git a/gui/predictivedialog.cpp b/gui/predictivedialog.cpp index ed18847a40..5ce093e054 100644 --- a/gui/predictivedialog.cpp +++ b/gui/predictivedialog.cpp @@ -779,7 +779,7 @@ bool PredictiveDialog::searchWord(const char *const where, const Common::String } void PredictiveDialog::addWord(Dict &dict, const Common::String &word, const Common::String &code) { - char *newLine; + char *newLine = 0; Common::String tmpCode = code + ' '; int line = binarySearch(dict.dictLine, tmpCode, dict.dictLineCount); if (line >= 0) { @@ -856,6 +856,9 @@ void PredictiveDialog::addWord(Dict &dict, const Common::String &word, const Com char **newDictLine = (char **)calloc(1, sizeof(char *) * (dict.dictLineCount + 1)); if (!newDictLine) { warning("Predictive Dialog: cannot allocate memory for index buffer"); + + free(newLine); + return; } newDictLine[dict.dictLineCount] = '\0'; diff --git a/gui/themes/default.inc b/gui/themes/default.inc index b0db4735e7..6d8e6baac7 100644 --- a/gui/themes/default.inc +++ b/gui/themes/default.inc @@ -683,6 +683,7 @@ "<layout type='vertical' center='true' padding='6,6,2,2'> " "<widget name='Version' " "height='Globals.Line.Height' " +"textalign='center' " "/> " "<layout type='horizontal' spacing='5' padding='0,0,0,0'> " "<widget name='SearchDesc' " @@ -1815,6 +1816,7 @@ "<layout type='vertical' center='true' padding='16,16,8,8'> " "<widget name='Version' " "height='Globals.Line.Height' " +"textalign='center' " "/> " "<layout type='horizontal' spacing='5' padding='10,0,0,0'> " "<widget name='SearchDesc' " diff --git a/gui/themes/scummclassic.zip b/gui/themes/scummclassic.zip Binary files differindex 3529288f23..297ff20344 100644 --- a/gui/themes/scummclassic.zip +++ b/gui/themes/scummclassic.zip diff --git a/gui/themes/scummclassic/classic_layout.stx b/gui/themes/scummclassic/classic_layout.stx index 656d7801cb..180e8fba74 100644 --- a/gui/themes/scummclassic/classic_layout.stx +++ b/gui/themes/scummclassic/classic_layout.stx @@ -107,6 +107,7 @@ <layout type = 'vertical' center = 'true' padding = '16, 16, 8, 8'> <widget name = 'Version' height = 'Globals.Line.Height' + textalign = 'center' /> <layout type = 'horizontal' spacing = '5' padding = '10, 0, 0, 0'> <widget name = 'SearchDesc' diff --git a/gui/themes/scummclassic/classic_layout_lowres.stx b/gui/themes/scummclassic/classic_layout_lowres.stx index 097f4d6e44..8bb03dea17 100644 --- a/gui/themes/scummclassic/classic_layout_lowres.stx +++ b/gui/themes/scummclassic/classic_layout_lowres.stx @@ -105,6 +105,7 @@ <layout type = 'vertical' center = 'true' padding = '6, 6, 2, 2'> <widget name = 'Version' height = 'Globals.Line.Height' + textalign = 'center' /> <layout type = 'horizontal' spacing = '5' padding = '0, 0, 0, 0'> <widget name = 'SearchDesc' diff --git a/gui/themes/scummmodern.zip b/gui/themes/scummmodern.zip Binary files differindex 8daabf87dc..dbd84992e6 100644 --- a/gui/themes/scummmodern.zip +++ b/gui/themes/scummmodern.zip diff --git a/gui/themes/scummmodern/scummmodern_layout_lowres.stx b/gui/themes/scummmodern/scummmodern_layout_lowres.stx index 5e6ba32a5d..9658402f82 100644 --- a/gui/themes/scummmodern/scummmodern_layout_lowres.stx +++ b/gui/themes/scummmodern/scummmodern_layout_lowres.stx @@ -103,6 +103,7 @@ <layout type = 'vertical' center = 'true' padding = '4, 4, 2, 2' spacing = '2'> <widget name = 'Version' height = 'Globals.Line.Height' + textalign = 'center' /> <layout type = 'horizontal' spacing = '5' padding = '0, 0, 2, 2'> <widget name = 'SearchDesc' diff --git a/gui/themes/translations.dat b/gui/themes/translations.dat Binary files differindex 9b9b7bbea6..7bd1316208 100644 --- a/gui/themes/translations.dat +++ b/gui/themes/translations.dat diff --git a/gui/widgets/list.cpp b/gui/widgets/list.cpp index 95d39c4f24..473d5f04df 100644 --- a/gui/widgets/list.cpp +++ b/gui/widgets/list.cpp @@ -206,6 +206,7 @@ void ListWidget::scrollTo(int item) { if (_currentPos != item) { _currentPos = item; + checkBounds(); scrollBarRecalc(); } } @@ -467,6 +468,7 @@ void ListWidget::handleCommand(CommandSender *sender, uint32 cmd, uint32 data) { case kSetPositionCmd: if (_currentPos != (int)data) { _currentPos = data; + checkBounds(); draw(); // Scrollbar actions cause list focus (which triggers a redraw) @@ -550,6 +552,13 @@ Common::Rect ListWidget::getEditRect() const { return r; } +void ListWidget::checkBounds() { + if (_currentPos < 0 || _entriesPerPage > (int)_list.size()) + _currentPos = 0; + else if (_currentPos + _entriesPerPage > (int)_list.size()) + _currentPos = _list.size() - _entriesPerPage; +} + void ListWidget::scrollToCurrent() { // Only do something if the current item is not in our view port if (_selectedItem < _currentPos) { @@ -560,11 +569,7 @@ void ListWidget::scrollToCurrent() { _currentPos = _selectedItem - _entriesPerPage + 1; } - if (_currentPos < 0 || _entriesPerPage > (int)_list.size()) - _currentPos = 0; - else if (_currentPos + _entriesPerPage > (int)_list.size()) - _currentPos = _list.size() - _entriesPerPage; - + checkBounds(); _scrollBar->_currentPos = _currentPos; _scrollBar->recalc(); } diff --git a/gui/widgets/list.h b/gui/widgets/list.h index 47613b79f3..d18a82dd3f 100644 --- a/gui/widgets/list.h +++ b/gui/widgets/list.h @@ -145,6 +145,7 @@ protected: void receivedFocusWidget(); void lostFocusWidget(); + void checkBounds(); void scrollToCurrent(); int *_textWidth; |