Esempio n. 1
0
void WidgetFiles::show(SaveMode mode) {
	Events &events = *_vm->_events;
	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
	Common::Point mousePos = events.mousePos();

	if (_vm->_showOriginalSavesDialog) {
		// Render and display the file dialog
		_fileMode = mode;
		ui._menuMode = FILES_MODE;
		_selector = _oldSelector = -1;
		_scroll = true;
		createSavegameList();

		// Set up the display area
		_bounds = Common::Rect(SHERLOCK_SCREEN_WIDTH * 2 / 3, (_surface.fontHeight() + 1) *
			(FILES_LINES_COUNT + 1) + 17);
		_bounds.moveTo(mousePos.x - _bounds.width() / 2, mousePos.y - _bounds.height() / 2);

		// Create the surface and render its contents
		_surface.create(_bounds.width(), _bounds.height());
		render(RENDER_ALL);

		summonWindow();
		ui._menuMode = FILES_MODE;
	} else if (mode == SAVEMODE_LOAD) {
		showScummVMRestoreDialog();
	} else {
		showScummVMSaveDialog();
	}
}
Esempio n. 2
0
void WidgetPassword::show() {
	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
	ImageFile &images = *ui._interfaceImages;

	// Set the up window to be centered on the screen
	_bounds = Common::Rect(_surface.widestChar() * 20 + 6, (_surface.fontHeight() + 7) * 2 + 3);
	_bounds.moveTo(SHERLOCK_SCREEN_WIDTH / 2 - _bounds.width() / 2, SHERLOCK_SCREEN_HEIGHT / 2 - _bounds.height() / 2);

	// Create the surface
	_surface.create(_bounds.width(), _bounds.height());
	_surface.fill(TRANSPARENCY);
	makeInfoArea();

	// Draw the header area
	_surface.writeString(FIXED(EnterPassword), Common::Point((_bounds.width() - _surface.stringWidth(FIXED(EnterPassword))) / 2, 5), INFO_TOP);
	_surface.hLine(3, _surface.fontHeight() + 7, _bounds.width() - 4, INFO_TOP);
	_surface.hLine(3, _surface.fontHeight() + 8, _bounds.width() - 4, INFO_MIDDLE);
	_surface.hLine(3, _surface.fontHeight() + 9, _bounds.width() - 4, INFO_BOTTOM);
	_surface.transBlitFrom(images[4], Common::Point(0, _surface.fontHeight() + 7 - 1));
	_surface.transBlitFrom(images[5], Common::Point(_bounds.width() - images[5]._width, _surface.fontHeight() + 7 - 1));

	// Set the password entry data
	_cursorPos = Common::Point(_surface.widestChar(), _surface.fontHeight() + 12);
	_password = "";
	_index = 0;
	_cursorColor = 192;
	_insert = true;

	// Show the dialog
	ui._menuMode = PASSWORD_MODE;
	summonWindow();
}
Esempio n. 3
0
void WidgetOptions::load() {
	Events &events = *_vm->_events;
	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
	_centerPos = events.mousePos();

	render();

	summonWindow();
	ui._menuMode = OPTION_MODE;
}
Esempio n. 4
0
void WidgetQuit::show() {
	Events &events = *_vm->_events;
	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
	ImageFile &images = *ui._interfaceImages;
	Common::Point mousePos = events.mousePos();
	const char *YES = FIXED(Yes);
	const char *NO = FIXED(No);

	// Set up the display area
	_bounds = Common::Rect(_surface.stringWidth(FIXED(AreYouSureYou)) + _surface.widestChar() * 2,
		(_surface.fontHeight() + 7) * 4);
	_bounds.moveTo(mousePos.x - _bounds.width() / 2, mousePos.y - _bounds.height() / 2);

	// Create the surface
	_surface.create(_bounds.width(), _bounds.height());
	_surface.clear(TRANSPARENCY);
	makeInfoArea();

	// Draw the message text
	_surface.writeString(FIXED(AreYouSureYou), Common::Point((_surface.width() - _surface.stringWidth(FIXED(AreYouSureYou))) / 2, 5), INFO_TOP);
	_surface.writeString(FIXED(WishToQuit), Common::Point((_surface.width() - _surface.stringWidth(FIXED(WishToQuit))) / 2,
		_surface.fontHeight() + 9), INFO_TOP);

	// Draw the horizontal bars seperating the commands and the message
	int yp = (_surface.fontHeight() + 4) * 2 + 3;
	for (int idx = 0; idx < 2; ++idx) {
		_surface.SHtransBlitFrom(images[4], Common::Point(0, yp - 1));
		_surface.SHtransBlitFrom(images[5], Common::Point(_surface.width() - images[5]._width, yp - 1));
		_surface.hLine(3, yp, _surface.width() - 4, INFO_TOP);
		_surface.hLine(3, yp + 1, _surface.width() - 4, INFO_MIDDLE);
		_surface.hLine(3, yp + 2, _surface.width() - 4, INFO_BOTTOM);

		const char *btn = (idx == 0) ? YES : NO;
		_surface.writeString(btn, Common::Point((_bounds.width() - _surface.stringWidth(btn)) / 2, yp + 5), INFO_TOP);
		yp += _surface.fontHeight() + 7;
	}

	ui._menuMode = QUIT_MODE;
	summonWindow();
}