diff options
| author | Eugene Sandulenko | 2006-05-18 16:44:44 +0000 | 
|---|---|---|
| committer | Eugene Sandulenko | 2006-05-18 16:44:44 +0000 | 
| commit | e98278228158a0a7aa69450bf44c912ac508a207 (patch) | |
| tree | 91b5cf428e6e7e2761c1782f2c76ad13d16a7a58 /engines/scumm/dialogs.cpp | |
| parent | e950d171f56a1d8ae9d41146284a506cd9d6e429 (diff) | |
| download | scummvm-rg350-e98278228158a0a7aa69450bf44c912ac508a207.tar.gz scummvm-rg350-e98278228158a0a7aa69450bf44c912ac508a207.tar.bz2 scummvm-rg350-e98278228158a0a7aa69450bf44c912ac508a207.zip | |
Fix bug #1483272: "GUI: SCUMM pause dialog breaks upon scaler switch". Also
fix same problem in scumm help dialog.
svn-id: r22522
Diffstat (limited to 'engines/scumm/dialogs.cpp')
| -rw-r--r-- | engines/scumm/dialogs.cpp | 47 | 
1 files changed, 34 insertions, 13 deletions
| diff --git a/engines/scumm/dialogs.cpp b/engines/scumm/dialogs.cpp index 17b86067f9..bfe1e31a6b 100644 --- a/engines/scumm/dialogs.cpp +++ b/engines/scumm/dialogs.cpp @@ -712,11 +712,32 @@ enum {  HelpDialog::HelpDialog(const GameSettings &game)  	: ScummDialog("scummhelp"), _game(game) { +	_title = new StaticTextWidget(this, "scummhelp_title", ""); + +	_page = 1; + +	_numPages = ScummHelp::numPages(_game.id); + +	_prevButton = new GUI::ButtonWidget(this, "scummhelp_prev", "Previous", kPrevCmd, 'P'); +	_nextButton = new GUI::ButtonWidget(this, "scummhelp_next", "Next", kNextCmd, 'N'); +	new GUI::ButtonWidget(this, "scummhelp_close", "Close", kCloseCmd, 'C'); +	_prevButton->clearFlags(WIDGET_ENABLED); + +	// Dummy entries +	for (int i = 0; i < HELP_NUM_LINES; i++) { +		_key[i] = new StaticTextWidget(this, 0, 0, 10, 10, "", kTextAlignLeft); +		_dsc[i] = new StaticTextWidget(this, 0, 0, 10, 10, "", kTextAlignLeft); +	} + +} + +void HelpDialog::handleScreenChanged() { +	ScummDialog::handleScreenChanged(); +  	_drawingHints &= ~GUI::THEME_HINT_SPECIAL_COLOR;  	int lineHeight = g_gui.getFontHeight(); -	_title = new StaticTextWidget(this, "scummhelp_title", "");  	int keyX = g_gui.evaluator()->getVar("scummhelp_key.x");  	int keyYoff = g_gui.evaluator()->getVar("scummhelp_key.yoffset");  	int keyW = g_gui.evaluator()->getVar("scummhelp_key.w"); @@ -727,18 +748,12 @@ HelpDialog::HelpDialog(const GameSettings &game)  	int dscH = g_gui.evaluator()->getVar("scummhelp_dsc.h");  	for (int i = 0; i < HELP_NUM_LINES; i++) { -		_key[i] = new StaticTextWidget(this, keyX, keyYoff + lineHeight * (i + 2), keyW, keyH, "", kTextAlignLeft); -		_dsc[i] = new StaticTextWidget(this, dscX, dscYoff + lineHeight * (i + 2), dscW, dscH, "", kTextAlignLeft); +		_key[i]->setPos(keyX, keyYoff + lineHeight * (i + 2)); +		_key[i]->setSize(keyW, keyH); +		_dsc[i]->setPos(dscX, dscYoff + lineHeight * (i + 2)); +		_dsc[i]->setSize(dscW, dscH);  	} -	_page = 1; -	_numPages = ScummHelp::numPages(game.id); - -	_prevButton = new GUI::ButtonWidget(this, "scummhelp_prev", "Previous", kPrevCmd, 'P'); -	_nextButton = new GUI::ButtonWidget(this, "scummhelp_next", "Next", kNextCmd, 'N'); -	new GUI::ButtonWidget(this, "scummhelp_close", "Close", kCloseCmd, 'C'); -	_prevButton->clearFlags(WIDGET_ENABLED); -  	displayKeyBindings();  } @@ -803,10 +818,16 @@ InfoDialog::InfoDialog(ScummEngine *scumm, const String& message)  }  void InfoDialog::setInfoText(const String& message) { +	_message = message; + +	handleScreenChanged(); +} + +void InfoDialog::handleScreenChanged() {  	const int screenW = g_system->getOverlayWidth();  	const int screenH = g_system->getOverlayHeight(); -	int width = g_gui.getStringWidth(message) + 16; +	int width = g_gui.getStringWidth(_message) + 16;  	int height = g_gui.getFontHeight() + 8;  	_w = width; @@ -814,7 +835,7 @@ void InfoDialog::setInfoText(const String& message) {  	_x = (screenW - width) / 2;  	_y = (screenH - height) / 2; -	new StaticTextWidget(this, 4, 4, _w - 8, _h, message, kTextAlignCenter); +	new StaticTextWidget(this, 4, 4, _w - 8, _h, _message, kTextAlignCenter);  }  const Common::String InfoDialog::queryResString(int stringno) { | 
