2015-12-26 13:12:30 +01:00
|
|
|
/* ScummVM - Graphic Adventure Engine
|
|
|
|
*
|
|
|
|
* 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 source distribution.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
*
|
|
|
|
* MIT License:
|
|
|
|
*
|
|
|
|
* Copyright (c) 2009 Alexei Svitkine, Eugene Sandulenko
|
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person
|
|
|
|
* obtaining a copy of this software and associated documentation
|
|
|
|
* files (the "Software"), to deal in the Software without
|
|
|
|
* restriction, including without limitation the rights to use,
|
|
|
|
* copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
* copies of the Software, and to permit persons to whom the
|
|
|
|
* Software is furnished to do so, subject to the following
|
|
|
|
* conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be
|
|
|
|
* included in all copies or substantial portions of the Software.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
|
|
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
|
|
|
* OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
|
|
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
|
|
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
|
|
|
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
|
|
|
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
|
|
* OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2016-01-03 21:59:57 +01:00
|
|
|
#include "common/timer.h"
|
2016-04-28 11:14:13 +02:00
|
|
|
#include "common/system.h"
|
2016-01-01 01:43:59 +01:00
|
|
|
#include "graphics/cursorman.h"
|
2016-03-23 10:21:36 +01:00
|
|
|
#include "graphics/primitives.h"
|
2016-07-29 11:43:28 +02:00
|
|
|
#include "graphics/macgui/macwindowmanager.h"
|
2016-07-29 11:45:52 +02:00
|
|
|
#include "graphics/macgui/macwindow.h"
|
2016-07-29 11:18:10 +02:00
|
|
|
#include "graphics/macgui/macmenu.h"
|
2016-01-09 01:25:23 +01:00
|
|
|
|
2015-12-26 13:12:30 +01:00
|
|
|
#include "wage/wage.h"
|
2015-12-28 12:38:26 +01:00
|
|
|
#include "wage/design.h"
|
|
|
|
#include "wage/entities.h"
|
2016-04-19 10:37:53 +02:00
|
|
|
#include "wage/gui.h"
|
2016-01-02 02:39:47 +01:00
|
|
|
#include "wage/world.h"
|
2015-12-26 13:12:30 +01:00
|
|
|
|
|
|
|
namespace Wage {
|
|
|
|
|
2016-07-29 11:17:23 +02:00
|
|
|
static const Graphics::MenuData menuSubItems[] = {
|
|
|
|
{ Graphics::kMenuHighLevel, "File", 0, 0, false },
|
|
|
|
{ Graphics::kMenuHighLevel, "Edit", 0, 0, false },
|
|
|
|
{ Graphics::kMenuFile, "New", Graphics::kMenuActionNew, 0, false },
|
|
|
|
{ Graphics::kMenuFile, "Open...", Graphics::kMenuActionOpen, 0, true },
|
|
|
|
{ Graphics::kMenuFile, "Close", Graphics::kMenuActionClose, 0, true },
|
|
|
|
{ Graphics::kMenuFile, "Save", Graphics::kMenuActionSave, 0, true },
|
|
|
|
{ Graphics::kMenuFile, "Save as...", Graphics::kMenuActionSaveAs, 0, true },
|
|
|
|
{ Graphics::kMenuFile, "Revert", Graphics::kMenuActionRevert, 0, false },
|
|
|
|
{ Graphics::kMenuFile, "Quit", Graphics::kMenuActionQuit, 0, true },
|
|
|
|
|
|
|
|
{ Graphics::kMenuEdit, "Undo", Graphics::kMenuActionUndo, 'Z', false },
|
|
|
|
{ Graphics::kMenuEdit, NULL, 0, 0, false },
|
|
|
|
{ Graphics::kMenuEdit, "Cut", Graphics::kMenuActionCut, 'K', false },
|
|
|
|
{ Graphics::kMenuEdit, "Copy", Graphics::kMenuActionCopy, 'C', false },
|
|
|
|
{ Graphics::kMenuEdit, "Paste", Graphics::kMenuActionPaste, 'V', false },
|
|
|
|
{ Graphics::kMenuEdit, "Clear", Graphics::kMenuActionClear, 'B', false },
|
2016-04-28 13:43:06 +02:00
|
|
|
|
|
|
|
{ 0, NULL, 0, 0, false }
|
|
|
|
};
|
|
|
|
|
2016-02-03 23:27:55 +01:00
|
|
|
static void cursorTimerHandler(void *refCon) {
|
2016-07-20 23:09:58 +03:00
|
|
|
Gui *gui = (Gui *)refCon;
|
2016-01-03 21:59:57 +01:00
|
|
|
|
|
|
|
int x = gui->_cursorX;
|
|
|
|
int y = gui->_cursorY;
|
|
|
|
|
|
|
|
if (x == 0 && y == 0)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (!gui->_screen.getPixels())
|
|
|
|
return;
|
|
|
|
|
2016-04-24 10:47:09 +02:00
|
|
|
x += gui->_consoleWindow->getInnerDimensions().left;
|
|
|
|
y += gui->_consoleWindow->getInnerDimensions().top;
|
2016-01-03 21:59:57 +01:00
|
|
|
|
2016-01-04 00:13:28 +01:00
|
|
|
gui->_screen.vLine(x, y, y + kCursorHeight, gui->_cursorState ? kColorBlack : kColorWhite);
|
2016-01-04 00:09:10 +01:00
|
|
|
|
|
|
|
if (!gui->_cursorOff)
|
|
|
|
gui->_cursorState = !gui->_cursorState;
|
2016-01-03 21:59:57 +01:00
|
|
|
|
2016-02-14 13:37:24 +01:00
|
|
|
gui->_cursorRect.left = x;
|
2016-02-25 11:29:06 +01:00
|
|
|
gui->_cursorRect.right = MIN<uint16>(x + 1, gui->_screen.w);
|
2016-02-14 13:37:24 +01:00
|
|
|
gui->_cursorRect.top = y;
|
2016-02-25 11:29:06 +01:00
|
|
|
gui->_cursorRect.bottom = MIN<uint16>(y + kCursorHeight, gui->_screen.h);
|
2016-02-14 13:37:24 +01:00
|
|
|
|
|
|
|
gui->_cursorDirty = true;
|
2016-01-03 21:59:57 +01:00
|
|
|
}
|
|
|
|
|
2016-07-29 11:44:38 +02:00
|
|
|
static bool sceneWindowCallback(Graphics::WindowClick click, Common::Event &event, void *gui);
|
|
|
|
static bool consoleWindowCallback(Graphics::WindowClick click, Common::Event &event, void *gui);
|
2016-04-28 15:25:14 +02:00
|
|
|
static void menuCommandsCallback(int action, Common::String &text, void *data);
|
|
|
|
|
2016-04-19 11:14:48 +02:00
|
|
|
|
2016-01-02 02:39:47 +01:00
|
|
|
Gui::Gui(WageEngine *engine) {
|
|
|
|
_engine = engine;
|
2015-12-28 12:38:26 +01:00
|
|
|
_scene = NULL;
|
|
|
|
_sceneDirty = true;
|
2016-01-02 02:53:30 +01:00
|
|
|
_consoleDirty = true;
|
2016-02-14 13:37:24 +01:00
|
|
|
_cursorDirty = false;
|
2016-01-03 15:31:24 +01:00
|
|
|
_consoleFullRedraw = true;
|
2015-12-28 12:38:26 +01:00
|
|
|
_screen.create(g_system->getWidth(), g_system->getHeight(), Graphics::PixelFormat::createFormatCLUT8());
|
2015-12-29 01:46:39 +01:00
|
|
|
|
2016-04-18 10:36:09 +02:00
|
|
|
_wm.setScreen(&_screen);
|
|
|
|
|
2015-12-31 17:45:36 +01:00
|
|
|
_scrollPos = 0;
|
2016-01-03 15:31:24 +01:00
|
|
|
_consoleLineHeight = 8; // Dummy value which makes sense
|
|
|
|
_consoleNumLines = 24; // Dummy value
|
2015-12-31 17:45:36 +01:00
|
|
|
|
2016-01-03 21:59:57 +01:00
|
|
|
_cursorX = 0;
|
|
|
|
_cursorY = 0;
|
|
|
|
_cursorState = false;
|
2016-01-04 00:09:10 +01:00
|
|
|
_cursorOff = false;
|
2016-01-03 21:59:57 +01:00
|
|
|
|
2016-02-03 11:01:41 +01:00
|
|
|
_inTextSelection = false;
|
2016-02-03 19:02:08 +01:00
|
|
|
_selectionStartX = _selectionStartY = -1;
|
|
|
|
_selectionEndX = _selectionEndY = -1;
|
2016-02-03 11:01:41 +01:00
|
|
|
|
2016-02-08 18:26:16 +01:00
|
|
|
_inputTextLineNum = 0;
|
|
|
|
|
2016-02-03 23:27:55 +01:00
|
|
|
g_system->getTimerManager()->installTimerProc(&cursorTimerHandler, 200000, this, "wageCursor");
|
2016-01-11 11:16:00 +01:00
|
|
|
|
2016-04-28 16:45:07 +02:00
|
|
|
_menu = _wm.addMenu();
|
2016-04-14 18:26:25 +02:00
|
|
|
|
2016-04-28 15:25:14 +02:00
|
|
|
_menu->setCommandsCallback(menuCommandsCallback, this);
|
|
|
|
|
2016-04-28 13:43:06 +02:00
|
|
|
_menu->addStaticMenus(menuSubItems);
|
2016-07-29 11:17:23 +02:00
|
|
|
_menu->addMenuSubItem(Graphics::kMenuAbout, _engine->_world->getAboutMenuItemName(), Graphics::kMenuActionAbout);
|
2016-04-28 13:43:06 +02:00
|
|
|
|
|
|
|
_commandsMenuId = _menu->addMenuItem(_engine->_world->_commandsMenuName.c_str());
|
|
|
|
regenCommandsMenu();
|
|
|
|
|
|
|
|
if (!_engine->_world->_weaponMenuDisabled) {
|
|
|
|
_weaponsMenuId = _menu->addMenuItem(_engine->_world->_weaponsMenuName.c_str());
|
|
|
|
|
|
|
|
regenWeaponsMenu();
|
|
|
|
} else {
|
|
|
|
_weaponsMenuId = -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
_menu->calcDimensions();
|
|
|
|
|
2016-04-28 12:09:08 +02:00
|
|
|
_sceneWindow = _wm.addWindow(false, false, false);
|
2016-04-19 11:14:48 +02:00
|
|
|
_sceneWindow->setCallback(sceneWindowCallback, this);
|
|
|
|
|
2016-04-28 12:09:08 +02:00
|
|
|
_consoleWindow = _wm.addWindow(true, true, true);
|
2016-04-19 11:14:48 +02:00
|
|
|
_consoleWindow->setCallback(consoleWindowCallback, this);
|
2015-12-26 13:12:30 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
Gui::~Gui() {
|
2016-01-06 23:40:41 +01:00
|
|
|
_screen.free();
|
2016-01-07 01:24:42 +01:00
|
|
|
_console.free();
|
2016-02-03 23:27:55 +01:00
|
|
|
g_system->getTimerManager()->removeTimerProc(&cursorTimerHandler);
|
2015-12-26 13:12:30 +01:00
|
|
|
}
|
|
|
|
|
2016-02-12 11:28:42 +01:00
|
|
|
void Gui::undrawCursor() {
|
|
|
|
_cursorOff = true;
|
|
|
|
_cursorState = false;
|
|
|
|
cursorTimerHandler(this);
|
|
|
|
_cursorOff = false;
|
|
|
|
}
|
|
|
|
|
2015-12-28 12:38:26 +01:00
|
|
|
void Gui::draw() {
|
2016-02-16 11:13:08 +01:00
|
|
|
if (_engine->_isGameOver) {
|
2016-04-25 19:47:08 +02:00
|
|
|
_wm.draw();
|
2016-02-16 11:13:08 +01:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2016-04-19 12:51:15 +02:00
|
|
|
if (!_engine->_world->_player->_currentScene)
|
|
|
|
return;
|
|
|
|
|
|
|
|
if (_scene != _engine->_world->_player->_currentScene) {
|
2016-04-05 18:18:25 +02:00
|
|
|
_sceneDirty = true;
|
|
|
|
|
2016-04-19 12:51:15 +02:00
|
|
|
_scene = _engine->_world->_player->_currentScene;
|
|
|
|
|
|
|
|
_sceneWindow->setDimensions(*_scene->_designBounds);
|
|
|
|
_sceneWindow->setTitle(_scene->_name);
|
|
|
|
_consoleWindow->setDimensions(*_scene->_textBounds);
|
|
|
|
|
2016-04-18 18:39:45 +02:00
|
|
|
_wm.setFullRefresh(true);
|
2015-12-28 12:38:26 +01:00
|
|
|
}
|
|
|
|
|
2016-04-18 18:39:45 +02:00
|
|
|
drawScene();
|
|
|
|
drawConsole();
|
|
|
|
|
|
|
|
_wm.draw();
|
|
|
|
|
2016-04-25 18:38:24 +02:00
|
|
|
if (_cursorDirty && _cursorRect.left < _screen.w && _cursorRect.bottom < _screen.h) {
|
2016-02-14 13:37:24 +01:00
|
|
|
g_system->copyRectToScreen(_screen.getBasePtr(_cursorRect.left, _cursorRect.top), _screen.pitch,
|
|
|
|
_cursorRect.left, _cursorRect.top, _cursorRect.width(), _cursorRect.height());
|
|
|
|
|
|
|
|
_cursorDirty = false;
|
|
|
|
}
|
|
|
|
|
2016-01-02 02:53:30 +01:00
|
|
|
_sceneDirty = false;
|
|
|
|
_consoleDirty = false;
|
2016-01-03 15:31:24 +01:00
|
|
|
_consoleFullRedraw = false;
|
2015-12-28 12:38:26 +01:00
|
|
|
}
|
|
|
|
|
2016-04-05 09:39:16 +02:00
|
|
|
void Gui::drawScene() {
|
2016-04-21 21:37:31 +02:00
|
|
|
if (!_sceneDirty)
|
2016-04-05 09:56:26 +02:00
|
|
|
return;
|
|
|
|
|
2016-04-19 10:56:42 +02:00
|
|
|
_scene->paint(_sceneWindow->getSurface(), 0, 0);
|
|
|
|
_sceneWindow->setDirty(true);
|
2016-04-15 10:08:33 +02:00
|
|
|
|
2016-04-05 09:39:16 +02:00
|
|
|
_sceneDirty = true;
|
|
|
|
_consoleDirty = true;
|
2016-04-25 19:47:08 +02:00
|
|
|
_menu->setDirty(true);
|
2016-04-05 09:39:16 +02:00
|
|
|
_consoleFullRedraw = true;
|
|
|
|
}
|
|
|
|
|
2016-07-29 11:44:38 +02:00
|
|
|
static bool sceneWindowCallback(Graphics::WindowClick click, Common::Event &event, void *g) {
|
2016-04-19 13:22:39 +02:00
|
|
|
Gui *gui = (Gui *)g;
|
|
|
|
|
2016-04-21 10:44:55 +02:00
|
|
|
return gui->processSceneEvents(click, event);
|
|
|
|
}
|
|
|
|
|
2016-07-29 11:44:38 +02:00
|
|
|
bool Gui::processSceneEvents(Graphics::WindowClick click, Common::Event &event) {
|
|
|
|
if (click == Graphics::kBorderInner && event.type == Common::EVENT_LBUTTONUP) {
|
2016-04-21 10:44:55 +02:00
|
|
|
Designed *obj = _scene->lookUpEntity(event.mouse.x - _sceneWindow->getDimensions().left,
|
|
|
|
event.mouse.y - _sceneWindow->getDimensions().top);
|
2016-04-19 13:22:39 +02:00
|
|
|
|
|
|
|
if (obj != nullptr)
|
2016-04-21 10:44:55 +02:00
|
|
|
_engine->processTurn(NULL, obj);
|
2016-04-19 13:22:39 +02:00
|
|
|
|
2016-04-21 10:44:55 +02:00
|
|
|
return true;
|
2016-04-19 13:22:39 +02:00
|
|
|
}
|
2016-04-21 10:44:55 +02:00
|
|
|
|
|
|
|
return false;
|
2016-04-19 11:14:48 +02:00
|
|
|
}
|
|
|
|
|
2016-04-05 09:39:16 +02:00
|
|
|
// Render console
|
|
|
|
void Gui::drawConsole() {
|
2016-04-21 21:37:31 +02:00
|
|
|
if (!_consoleDirty && !_consoleFullRedraw && !_sceneDirty)
|
2016-04-05 18:18:25 +02:00
|
|
|
return;
|
2016-04-05 09:39:16 +02:00
|
|
|
|
2016-07-29 11:44:38 +02:00
|
|
|
renderConsole(_consoleWindow->getSurface(), Common::Rect(Graphics::kBorderWidth - 2, Graphics::kBorderWidth - 2,
|
2016-04-24 10:47:09 +02:00
|
|
|
_consoleWindow->getDimensions().width(), _consoleWindow->getDimensions().height()));
|
2016-04-19 10:56:42 +02:00
|
|
|
_consoleWindow->setDirty(true);
|
2016-04-05 09:39:16 +02:00
|
|
|
}
|
|
|
|
|
2016-07-29 11:44:38 +02:00
|
|
|
static bool consoleWindowCallback(Graphics::WindowClick click, Common::Event &event, void *g) {
|
2016-04-19 11:14:48 +02:00
|
|
|
Gui *gui = (Gui *)g;
|
|
|
|
|
2016-04-21 10:44:55 +02:00
|
|
|
return gui->processConsoleEvents(click, event);
|
2016-03-23 10:21:36 +01:00
|
|
|
}
|
|
|
|
|
2016-04-28 15:25:14 +02:00
|
|
|
////////////////
|
|
|
|
// Menu stuff
|
|
|
|
////////////////
|
2016-01-29 18:31:19 +01:00
|
|
|
void Gui::regenCommandsMenu() {
|
2016-04-28 13:43:06 +02:00
|
|
|
_menu->createSubMenuFromString(_commandsMenuId, _engine->_world->_commandsMenu.c_str());
|
2016-01-29 18:31:19 +01:00
|
|
|
}
|
|
|
|
|
2016-01-15 11:25:50 +01:00
|
|
|
void Gui::regenWeaponsMenu() {
|
2016-04-28 13:43:06 +02:00
|
|
|
if (_engine->_world->_weaponMenuDisabled)
|
|
|
|
return;
|
|
|
|
|
|
|
|
_menu->clearSubMenu(_weaponsMenuId);
|
|
|
|
|
|
|
|
Chr *player = _engine->_world->_player;
|
|
|
|
ObjArray *weapons = player->getWeapons(true);
|
|
|
|
|
|
|
|
bool empty = true;
|
|
|
|
|
|
|
|
for (uint i = 0; i < weapons->size(); i++) {
|
|
|
|
Obj *obj = (*weapons)[i];
|
|
|
|
if (obj->_type == Obj::REGULAR_WEAPON ||
|
|
|
|
obj->_type == Obj::THROW_WEAPON ||
|
|
|
|
obj->_type == Obj::MAGICAL_OBJECT) {
|
|
|
|
Common::String command(obj->_operativeVerb);
|
|
|
|
command += " ";
|
|
|
|
command += obj->_name;
|
|
|
|
|
2016-07-29 11:17:23 +02:00
|
|
|
_menu->addMenuSubItem(_weaponsMenuId, command.c_str(), Graphics::kMenuActionCommand, 0, 0, true);
|
2016-04-28 13:43:06 +02:00
|
|
|
|
|
|
|
empty = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
delete weapons;
|
|
|
|
|
|
|
|
if (empty)
|
|
|
|
_menu->addMenuSubItem(_weaponsMenuId, "You have no weapons", 0, 0, 0, false);
|
2016-01-15 11:25:50 +01:00
|
|
|
}
|
|
|
|
|
2016-04-19 10:37:53 +02:00
|
|
|
bool Gui::processEvent(Common::Event &event) {
|
2016-04-25 19:54:26 +02:00
|
|
|
return _wm.processEvent(event);
|
2016-02-03 11:01:41 +01:00
|
|
|
}
|
|
|
|
|
2016-04-28 15:25:14 +02:00
|
|
|
void menuCommandsCallback(int action, Common::String &text, void *data) {
|
|
|
|
Gui *g = (Gui *)data;
|
|
|
|
|
|
|
|
g->executeMenuCommand(action, text);
|
|
|
|
}
|
|
|
|
|
|
|
|
void Gui::executeMenuCommand(int action, Common::String &text) {
|
|
|
|
switch(action) {
|
2016-07-29 11:17:23 +02:00
|
|
|
case Graphics::kMenuActionAbout:
|
|
|
|
case Graphics::kMenuActionNew:
|
|
|
|
case Graphics::kMenuActionClose:
|
|
|
|
case Graphics::kMenuActionRevert:
|
|
|
|
case Graphics::kMenuActionQuit:
|
2016-07-29 17:48:23 +06:00
|
|
|
break;
|
|
|
|
|
2016-07-29 11:17:23 +02:00
|
|
|
case Graphics::kMenuActionOpen:
|
2016-07-29 17:48:23 +06:00
|
|
|
_engine->scummVMSaveLoadDialog(false);
|
|
|
|
break;
|
|
|
|
|
2016-07-29 11:17:23 +02:00
|
|
|
case Graphics::kMenuActionSave:
|
|
|
|
case Graphics::kMenuActionSaveAs:
|
2016-07-29 17:48:23 +06:00
|
|
|
_engine->scummVMSaveLoadDialog(true);
|
|
|
|
break;
|
2016-04-28 15:25:14 +02:00
|
|
|
|
2016-07-29 11:17:23 +02:00
|
|
|
case Graphics::kMenuActionUndo:
|
2016-04-28 15:25:14 +02:00
|
|
|
actionUndo();
|
|
|
|
break;
|
2016-07-29 11:17:23 +02:00
|
|
|
case Graphics::kMenuActionCut:
|
2016-04-28 15:25:14 +02:00
|
|
|
actionCut();
|
|
|
|
break;
|
2016-07-29 11:17:23 +02:00
|
|
|
case Graphics::kMenuActionCopy:
|
2016-04-28 15:25:14 +02:00
|
|
|
actionCopy();
|
|
|
|
break;
|
2016-07-29 11:17:23 +02:00
|
|
|
case Graphics::kMenuActionPaste:
|
2016-04-28 15:25:14 +02:00
|
|
|
actionPaste();
|
|
|
|
break;
|
2016-07-29 11:17:23 +02:00
|
|
|
case Graphics::kMenuActionClear:
|
2016-04-28 15:25:14 +02:00
|
|
|
actionClear();
|
|
|
|
break;
|
|
|
|
|
2016-07-29 11:17:23 +02:00
|
|
|
case Graphics::kMenuActionCommand:
|
2016-04-28 15:25:14 +02:00
|
|
|
_engine->processTurn(&text, NULL);
|
|
|
|
break;
|
|
|
|
|
|
|
|
default:
|
|
|
|
warning("Unknown action: %d", action);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2015-12-26 13:12:30 +01:00
|
|
|
} // End of namespace Wage
|