diff --git a/CMakeLists.txt b/CMakeLists.txt
index 67fc2dbfe..74a43ede1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -177,7 +177,6 @@ include_directories(${UUID_INCLUDE_DIR})
endif (WIN32)
if (MSVC10)
set(PLATFORM_INCLUDE_DIR "")
- add_definitions(-DMYGUI_DONT_REPLACE_NULLPTR)
endif()
if (APPLE)
@@ -186,7 +185,13 @@ endif (APPLE)
# Dependencies
+# Fix for not visible pthreads functions for linker with glibc 2.15
+if (UNIX AND NOT APPLE)
+find_package (Threads)
+endif()
+
find_package(OGRE REQUIRED)
+find_package(MyGUI REQUIRED)
find_package(Boost REQUIRED COMPONENTS system filesystem program_options thread)
find_package(OIS REQUIRED)
find_package(OpenAL REQUIRED)
@@ -203,14 +208,14 @@ include_directories("."
${OGRE_INCLUDE_DIR} ${OGRE_INCLUDE_DIR}/Ogre ${OGRE_INCLUDE_DIR}/OGRE ${OGRE_PLUGIN_INCLUDE_DIRS}
${OIS_INCLUDE_DIRS} ${Boost_INCLUDE_DIR}
${PLATFORM_INCLUDE_DIR}
- ${CMAKE_HOME_DIRECTORY}/extern/mygui_3.0.1/MyGUIEngine/include
- ${CMAKE_HOME_DIRECTORY}/extern/mygui_3.0.1/OgrePlatform/include
+ ${MYGUI_INCLUDE_DIRS}
+ ${MYGUI_PLATFORM_INCLUDE_DIRS}
${OPENAL_INCLUDE_DIR}
${UUID_INCLUDE_DIR}
${LIBDIR}
)
-link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR})
+link_directories(${Boost_LIBRARY_DIRS} ${OGRE_LIB_DIR} ${MYGUI_LIB_DIR})
if(APPLE)
# List used Ogre plugins
@@ -220,15 +225,8 @@ if(APPLE)
"Plugin_ParticleFX")
endif(APPLE)
-add_subdirectory( extern/mygui_3.0.1 )
add_subdirectory( files/)
-
-# Make sure that certain libraries are used as static libraries
-# This is in effect turns off __declspec (dllexport) for windows
-# Each library will also need to be configured to build as a static lib
-
-# MyGUI: extern/mygui_3.0.0/
-add_definitions(-DMYGUI_STATIC)
+add_subdirectory( files/mygui )
# Specify build paths
@@ -323,7 +321,7 @@ if(DPKG_PROGRAM)
SET(CPACK_DEBIAN_PACKAGE_NAME "openmw")
SET(CPACK_DEBIAN_PACKAGE_VERSION "${VERSION_STRING}")
SET(CPACK_PACKAGE_EXECUTABLES "openmw;OpenMW esmtool;Esmtool omwlauncher;OMWLauncher")
- SET(CPACK_DEBIAN_PACKAGE_DEPENDS "libogre-1.7.3 (>= 1.7.3), libbullet0 (>= 2.77), libboost-filesystem1.46.1 (>= 1.46.1), libboost-program-options1.46.1 (>= 1.46.1), libboost-system1.46.1 (>= 1.46.1), libboost-thread1.46.1 (>= 1.46.1), libc6 (>= 2.11.2), libfreetype6 (>= 2.2.1), libgcc1 (>= 1:4.1.1), libmpg123-0 (>= 1.12.1), libois-1.3.0 (>= 1.3.0), libopenal1 (>= 1:1.12.854), libsndfile1 (>= 1.0.23), libstdc++6 (>= 4.4.5), libuuid1 (>= 2.17.2), libqtgui4 (>= 4.7.0)")
+ SET(CPACK_DEBIAN_PACKAGE_DEPENDS "nvidia-cg-toolkit (>= 2.1), libboost-filesystem1.46.1 (>= 1.46.1), libboost-program-options1.46.1 (>= 1.46.1), libboost-system1.46.1 (>= 1.46.1), libboost-thread1.46.1 (>= 1.46.1), libc6 (>= 2.11.2), libfreetype6 (>= 2.2.1), libgcc1 (>= 1:4.1.1), libmpg123-0 (>= 1.12.1), libois-1.3.0 (>= 1.3.0), libopenal1 (>= 1:1.12.854), libsndfile1 (>= 1.0.23), libstdc++6 (>= 4.4.5), libuuid1 (>= 2.17.2), libqtgui4 (>= 4.7.0)")
SET(CPACK_DEBIAN_PACKAGE_SECTION "Games")
@@ -459,7 +457,9 @@ if (WIN32)
endforeach(d)
set_target_properties(components PROPERTIES COMPILE_FLAGS ${WARNINGS})
- set_target_properties(omwlauncher PROPERTIES COMPILE_FLAGS ${WARNINGS})
+ if (BUILD_LAUNCHER)
+ set_target_properties(omwlauncher PROPERTIES COMPILE_FLAGS ${WARNINGS})
+ endif (BUILD_LAUNCHER)
set_target_properties(openmw PROPERTIES COMPILE_FLAGS ${WARNINGS})
endif(MSVC)
diff --git a/apps/launcher/datafilespage.cpp b/apps/launcher/datafilespage.cpp
index 054cbf141..c96fc2c7b 100644
--- a/apps/launcher/datafilespage.cpp
+++ b/apps/launcher/datafilespage.cpp
@@ -222,7 +222,7 @@ void DataFilesPage::setupDataFiles()
QMessageBox msgBox;
msgBox.setWindowTitle("Error detecting Morrowind installation");
- msgBox.setIcon(QMessageBox::Critical);
+ msgBox.setIcon(QMessageBox::Warning);
msgBox.setStandardButtons(QMessageBox::Cancel);
msgBox.setText(tr("Could not find the Data Files location \
The directory containing the Data Files was not found. \
@@ -279,72 +279,79 @@ void DataFilesPage::setupDataFiles()
const Files::MultiDirCollection &esp = fileCollections.getCollection(".esp");
for (Files::MultiDirCollection::TIter iter(esp.begin()); iter!=esp.end(); ++iter) {
- ESMReader fileReader;
- QStringList availableMasters; // Will contain all found masters
- fileReader.setEncoding(variables["encoding"].as());
- fileReader.open(iter->second.string());
+ try {
+ ESMReader fileReader;
+ QStringList availableMasters; // Will contain all found masters
+
+ fileReader.setEncoding(variables["encoding"].as());
+ fileReader.open(iter->second.string());
- // First we fill the availableMasters and the mMastersWidget
- ESMReader::MasterList mlist = fileReader.getMasters();
+ // First we fill the availableMasters and the mMastersWidget
+ ESMReader::MasterList mlist = fileReader.getMasters();
- for (unsigned int i = 0; i < mlist.size(); ++i) {
- const QString currentMaster = QString::fromStdString(mlist[i].name);
- availableMasters.append(currentMaster);
+ for (unsigned int i = 0; i < mlist.size(); ++i) {
+ const QString currentMaster = QString::fromStdString(mlist[i].name);
+ availableMasters.append(currentMaster);
- const QList itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly);
+ const QList itemList = mMastersWidget->findItems(currentMaster, Qt::MatchExactly);
- if (itemList.isEmpty()) { // Master is not yet in the widget
- mMastersWidget->insertRow(i);
+ if (itemList.isEmpty()) { // Master is not yet in the widget
+ mMastersWidget->insertRow(i);
- QTableWidgetItem *item = new QTableWidgetItem(currentMaster);
- item->setForeground(Qt::red);
- item->setFlags(item->flags() & ~(Qt::ItemIsSelectable));
+ QTableWidgetItem *item = new QTableWidgetItem(currentMaster);
+ item->setForeground(Qt::red);
+ item->setFlags(item->flags() & ~(Qt::ItemIsSelectable));
- mMastersWidget->setItem(i, 0, item);
+ mMastersWidget->setItem(i, 0, item);
+ }
}
- }
- availableMasters.sort(); // Sort the masters alphabetically
+ availableMasters.sort(); // Sort the masters alphabetically
- // Now we put the current plugin in the mDataFilesModel under its masters
- QStandardItem *parent = new QStandardItem(availableMasters.join(","));
+ // Now we put the current plugin in the mDataFilesModel under its masters
+ QStandardItem *parent = new QStandardItem(availableMasters.join(","));
- QString fileName = QString::fromStdString(boost::filesystem::path (iter->second.filename()).string());
- QStandardItem *child = new QStandardItem(fileName);
+ QString fileName = QString::fromStdString(boost::filesystem::path (iter->second.filename()).string());
+ QStandardItem *child = new QStandardItem(fileName);
- // Tooltip information
- QString author = QString::fromStdString(fileReader.getAuthor());
- float version = fileReader.getFVer();
- QString description = QString::fromStdString(fileReader.getDesc());
+ // Tooltip information
+ QString author = QString::fromStdString(fileReader.getAuthor());
+ float version = fileReader.getFVer();
+ QString description = QString::fromStdString(fileReader.getDesc());
- // For the date created/modified
- QFileInfo fi(QString::fromStdString(iter->second.string()));
+ // For the date created/modified
+ QFileInfo fi(QString::fromStdString(iter->second.string()));
- QString toolTip= QString("Author: %1 \
- Version: %2 \
- Description: \
- %3 \
- Created on: %4 \
- Last modified: %5")
- .arg(author)
- .arg(version)
- .arg(description)
- .arg(fi.created().toString(Qt::TextDate))
- .arg(fi.lastModified().toString(Qt::TextDate));
+ QString toolTip= QString("Author: %1 \
+ Version: %2 \
+ Description: \
+ %3 \
+ Created on: %4 \
+ Last modified: %5")
+ .arg(author)
+ .arg(version)
+ .arg(description)
+ .arg(fi.created().toString(Qt::TextDate))
+ .arg(fi.lastModified().toString(Qt::TextDate));
- child->setToolTip(toolTip);
+ child->setToolTip(toolTip);
- const QList masterList = mDataFilesModel->findItems(availableMasters.join(","));
+ const QList masterList = mDataFilesModel->findItems(availableMasters.join(","));
- if (masterList.isEmpty()) { // Masters node not yet in the mDataFilesModel
- parent->appendRow(child);
- mDataFilesModel->appendRow(parent);
- } else {
- // Masters node exists, append current plugin
- foreach (QStandardItem *currentItem, masterList) {
- currentItem->appendRow(child);
+ if (masterList.isEmpty()) { // Masters node not yet in the mDataFilesModel
+ parent->appendRow(child);
+ mDataFilesModel->appendRow(parent);
+ } else {
+ // Masters node exists, append current plugin
+ foreach (QStandardItem *currentItem, masterList) {
+ currentItem->appendRow(child);
+ }
}
+
+ } catch(std::runtime_error &e) {
+ // An error occurred while reading the .esp
+ continue;
}
}
diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt
index f416b996d..365600061 100644
--- a/apps/openmw/CMakeLists.txt
+++ b/apps/openmw/CMakeLists.txt
@@ -48,7 +48,7 @@ add_openmw_dir (mwsound
add_openmw_dir (mwworld
refdata world physicssystem scene environment globals class action nullaction actionteleport
containerstore actiontalk actiontake manualref player cellfunctors
- cells localscripts customdata weather inventorystore
+ cells localscripts customdata weather inventorystore ptr
)
add_openmw_dir (mwclass
@@ -85,17 +85,22 @@ add_definitions(${SOUND_DEFINE})
target_link_libraries(openmw
${OGRE_LIBRARIES}
- ${OGRE_STATIC_PLUGINS}
+ ${OGRE_STATIC_PLUGINS}
${OIS_LIBRARIES}
${Boost_LIBRARIES}
${OPENAL_LIBRARY}
${SOUND_INPUT_LIBRARY}
${BULLET_LIBRARIES}
+ ${MYGUI_LIBRARIES}
+ MyGUI.OgrePlatform #TODO MyGUI ogre platform is not added by the find script
components
- MyGUIEngine
- MyGUIOgrePlatform
)
+# Fix for not visible pthreads functions for linker with glibc 2.15
+if (UNIX AND NOT APPLE)
+target_link_libraries(openmw ${CMAKE_THREAD_LIBS_INIT})
+endif()
+
if(APPLE)
find_library(CARBON_FRAMEWORK Carbon)
target_link_libraries(openmw ${CARBON_FRAMEWORK})
diff --git a/apps/openmw/engine.cpp b/apps/openmw/engine.cpp
index 7f6dccf1f..433cc0c11 100644
--- a/apps/openmw/engine.cpp
+++ b/apps/openmw/engine.cpp
@@ -60,7 +60,7 @@ void OMW::Engine::executeLocalScripts()
MWScript::InterpreterContext interpreterContext (mEnvironment,
&script.second.getRefData().getLocals(), script.second);
- mScriptManager->run (script.first, interpreterContext);
+ mEnvironment.mScriptManager->run (script.first, interpreterContext);
if (mEnvironment.mWorld->hasCellChanged())
break;
@@ -182,7 +182,6 @@ OMW::Engine::Engine(Files::ConfigurationManager& configurationManager)
, mCompileAll (false)
, mReportFocus (false)
, mFocusTDiff (0)
- , mScriptManager (0)
, mScriptContext (0)
, mFSStrict (false)
, mCfgMgr(configurationManager)
@@ -199,7 +198,7 @@ OMW::Engine::~Engine()
delete mEnvironment.mMechanicsManager;
delete mEnvironment.mDialogueManager;
delete mEnvironment.mJournal;
- delete mScriptManager;
+ delete mEnvironment.mScriptManager;
delete mScriptContext;
delete mOgre;
}
@@ -352,18 +351,18 @@ void OMW::Engine::go()
mEnvironment);
mScriptContext->setExtensions (&mExtensions);
- mScriptManager = new MWScript::ScriptManager (mEnvironment.mWorld->getStore(), mVerboseScripts,
- *mScriptContext);
+ mEnvironment.mScriptManager = new MWScript::ScriptManager (mEnvironment.mWorld->getStore(),
+ mVerboseScripts, *mScriptContext);
mEnvironment.mGlobalScripts = new MWScript::GlobalScripts (mEnvironment.mWorld->getStore(),
- *mScriptManager);
+ *mEnvironment.mScriptManager);
// Create game mechanics system
mEnvironment.mMechanicsManager = new MWMechanics::MechanicsManager (mEnvironment);
// Create dialog system
mEnvironment.mJournal = new MWDialogue::Journal (mEnvironment);
- mEnvironment.mDialogueManager = new MWDialogue::DialogueManager (mEnvironment);
+ mEnvironment.mDialogueManager = new MWDialogue::DialogueManager (mEnvironment,mExtensions);
// load cell
ESM::Position pos;
@@ -397,7 +396,7 @@ void OMW::Engine::go()
// scripts
if (mCompileAll)
{
- std::pair result = mScriptManager->compileAll();
+ std::pair result = mEnvironment.mScriptManager->compileAll();
if (result.first)
std::cout
@@ -442,7 +441,7 @@ void OMW::Engine::activate()
if (!script.empty())
{
mEnvironment.mWorld->getLocalScripts().setIgnore (ptr);
- mScriptManager->run (script, interpreterContext);
+ mEnvironment.mScriptManager->run (script, interpreterContext);
}
if (!interpreterContext.hasActivationBeenHandled())
diff --git a/apps/openmw/engine.hpp b/apps/openmw/engine.hpp
index 5c5cdc018..690430784 100644
--- a/apps/openmw/engine.hpp
+++ b/apps/openmw/engine.hpp
@@ -78,10 +78,9 @@ namespace OMW
std::string mFocusName;
MWWorld::Environment mEnvironment;
- MWScript::ScriptManager *mScriptManager;
Compiler::Extensions mExtensions;
Compiler::Context *mScriptContext;
-
+
Files::Collections mFileCollections;
bool mFSStrict;
diff --git a/apps/openmw/mwdialogue/dialoguemanager.cpp b/apps/openmw/mwdialogue/dialoguemanager.cpp
index f78160cd7..50549f4a5 100644
--- a/apps/openmw/mwdialogue/dialoguemanager.cpp
+++ b/apps/openmw/mwdialogue/dialoguemanager.cpp
@@ -9,16 +9,36 @@
#include
+
#include "../mwworld/class.hpp"
#include "../mwworld/environment.hpp"
#include "../mwworld/world.hpp"
#include "../mwworld/refdata.hpp"
#include "../mwworld/player.hpp"
+#include "../mwworld/containerstore.hpp"
#include "../mwinput/inputmanager.hpp"
+#include "../mwgui/dialogue.hpp"
+#include "../mwgui/window_manager.hpp"
+
+#include "journal.hpp"
#include
+#include "../mwscript/extensions.hpp"
+#include "../mwscript/scriptmanager.hpp"
+
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "../mwscript/compilercontext.hpp"
+#include "../mwscript/interpretercontext.hpp"
+#include
+
namespace
{
std::string toLower (const std::string& name)
@@ -31,17 +51,18 @@ namespace
return lowerCase;
}
+
template
bool selectCompare (char comp, T1 value1, T2 value2)
{
switch (comp)
{
- case '0': return value1==value2;
- case '1': return value1!=value2;
- case '2': return value1>value2;
- case '3': return value1>=value2;
- case '4': return value1value2;
+ case '3': return value1>=value2;
+ case '4': return value1::const_iterator iter (info.selects.begin());
+ iter != info.selects.end(); ++iter)
+ {
+ ESM::DialInfo::SelectStruct select = *iter;
+ char type = select.selectRule[1];
+ if(type == '1')
+ {
+ char comp = select.selectRule[4];
+ std::string name = select.selectRule.substr (5);
+ std::string function = select.selectRule.substr(2,2);
+
+ int ifunction;
+ std::istringstream iss(function);
+ iss >> ifunction;
+ switch(ifunction)
+ {
+ case 39://PC Expelled
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 40://PC Common Disease
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 41://PC Blight Disease
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 43://PC Crime level
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 46://Same faction
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 48://Detected
+ if(!selectCompare(comp,1,select.i)) return false;
+ break;
+
+ case 49://Alarmed
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 50://choice
+
+ if(choice)
+ {
+ if(!selectCompare(comp,mChoice,select.i)) return false;
+ }
+ break;
+
+ case 60://PC Vampire
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 61://Level
+ if(!selectCompare(comp,1,select.i)) return false;
+ break;
+
+ case 62://Attacked
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 63://Talked to PC
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 64://PC Health
+ if(!selectCompare(comp,50,select.i)) return false;
+ break;
+
+ case 65://Creature target
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 66://Friend hit
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 67://Fight
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 68://Hello????
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 69://Alarm
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 70://Flee
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ case 71://Should Attack
+ if(!selectCompare(comp,0,select.i)) return false;
+ break;
+
+ default:
+ break;
+
+ }
+ }
+ }
+
+ return true;
+ }
+
bool DialogueManager::isMatching (const MWWorld::Ptr& actor,
const ESM::DialInfo::SelectStruct& select) const
{
@@ -124,58 +264,173 @@ namespace MWDialogue
{
char comp = select.selectRule[4];
std::string name = select.selectRule.substr (5);
-
- // TODO types 4, 5, 6, 7, 8, 9, A, B, C
+ std::string function = select.selectRule.substr(1,2);
switch (type)
{
- case '1': // function
+ case '1': // function
- return false; // TODO implement functions
+ return true; // TODO implement functions
- case '2': // global
+ case '2': // global
- if (select.type==ESM::VT_Short || select.type==ESM::VT_Int ||
- select.type==ESM::VT_Long)
- {
- if (!checkGlobal (comp, toLower (name), select.i, *mEnvironment.mWorld))
- return false;
- }
- else if (select.type==ESM::VT_Float)
- {
- if (!checkGlobal (comp, toLower (name), select.f, *mEnvironment.mWorld))
- return false;
- }
- else
- throw std::runtime_error (
- "unsupported variable type in dialogue info select");
+ if (select.type==ESM::VT_Short || select.type==ESM::VT_Int ||
+ select.type==ESM::VT_Long)
+ {
+ if (!checkGlobal (comp, toLower (name), select.i, *mEnvironment.mWorld))
+ return false;
+ }
+ else if (select.type==ESM::VT_Float)
+ {
+ if (!checkGlobal (comp, toLower (name), select.f, *mEnvironment.mWorld))
+ return false;
+ }
+ else
+ throw std::runtime_error (
+ "unsupported variable type in dialogue info select");
- return true;
+ return true;
- case '3': // local
+ case '3': // local
- if (select.type==ESM::VT_Short || select.type==ESM::VT_Int ||
- select.type==ESM::VT_Long)
- {
- if (!checkLocal (comp, toLower (name), select.i, actor,
- mEnvironment.mWorld->getStore()))
- return false;
- }
- else if (select.type==ESM::VT_Float)
- {
- if (!checkLocal (comp, toLower (name), select.f, actor,
- mEnvironment.mWorld->getStore()))
- return false;
- }
- else
- throw std::runtime_error (
- "unsupported variable type in dialogue info select");
+ if (select.type==ESM::VT_Short || select.type==ESM::VT_Int ||
+ select.type==ESM::VT_Long)
+ {
+ if (!checkLocal (comp, toLower (name), select.i, actor,
+ mEnvironment.mWorld->getStore()))
+ return false;
+ }
+ else if (select.type==ESM::VT_Float)
+ {
+ if (!checkLocal (comp, toLower (name), select.f, actor,
+ mEnvironment.mWorld->getStore()))
+ return false;
+ }
+ else
+ throw std::runtime_error (
+ "unsupported variable type in dialogue info select");
- return true;
+ return true;
- default:
+ case '4'://journal
+ if(select.type==ESM::VT_Int)
+ {
+ if(!selectCompare(comp,mEnvironment.mJournal->getJournalIndex(toLower(name)),select.i)) return false;
+ }
+ else
+ throw std::runtime_error (
+ "unsupported variable type in dialogue info select");
+
+ return true;
+
+ case '5'://item
+ {
+ MWWorld::Ptr player = mEnvironment.mWorld->getPlayer().getPlayer();
+ MWWorld::ContainerStore& store = MWWorld::Class::get (player).getContainerStore (player);
+
+ int sum = 0;
+
+ for (MWWorld::ContainerStoreIterator iter (store.begin()); iter!=store.end(); ++iter)
+ if (iter->getCellRef().refID==name)
+ sum += iter->getRefData().getCount();
+ if(!selectCompare(comp,sum,select.i)) return false;
+ }
+
+ return true;
+
+
+ case '6'://dead
+ if(!selectCompare(comp,0,select.i)) return false;
+
+ case '7':// not ID
+ if(select.type==ESM::VT_String ||select.type==ESM::VT_Int)//bug in morrowind here? it's not a short, it's a string
+ {
+ int isID = int(toLower(name)==toLower(MWWorld::Class::get (actor).getId (actor)));
+ if (selectCompare(comp,!isID,select.i)) return false;
+ }
+ else
+ throw std::runtime_error (
+ "unsupported variable type in dialogue info select");
+
+ return true;
+
+ case '8':// not faction
+ if(select.type==ESM::VT_Int)
+ {
+ ESMS::LiveCellRef* npc = actor.get();
+ int isFaction = int(toLower(npc->base->faction) == toLower(name));
+ if(selectCompare(comp,!isFaction,select.i))
+ return false;
+ }
+ else
+ throw std::runtime_error (
+ "unsupported variable type in dialogue info select");
+
+ return true;
+
+ case '9':// not class
+ if(select.type==ESM::VT_Int)
+ {
+ ESMS::LiveCellRef* npc = actor.get();
+ int isClass = int(toLower(npc->base->cls) == toLower(name));
+ if(selectCompare(comp,!isClass,select.i))
+ return false;
+ }
+ else
+ throw std::runtime_error (
+ "unsupported variable type in dialogue info select");
+
+ return true;
+
+ case 'A'://not Race
+ if(select.type==ESM::VT_Int)
+ {
+ ESMS::LiveCellRef* npc = actor.get();
+ int isRace = int(toLower(npc->base->race) == toLower(name));
+ if(selectCompare(comp,!isRace,select.i))
+ return false;
+ }
+ else
+ throw std::runtime_error (
+ "unsupported variable type in dialogue info select");
+
+ return true;
- std::cout << "unchecked select: " << type << " " << comp << " " << name << std::endl;
+ case 'B'://not Cell
+ if(select.type==ESM::VT_Int)
+ {
+ int isCell = int(toLower(actor.getCell()->cell->name) == toLower(name));
+ if(selectCompare(comp,!isCell,select.i))
+ return false;
+ }
+ else
+ throw std::runtime_error (
+ "unsupported variable type in dialogue info select");
+ return true;
+
+ case 'C'://not local
+ if (select.type==ESM::VT_Short || select.type==ESM::VT_Int ||
+ select.type==ESM::VT_Long)
+ {
+ if (checkLocal (comp, toLower (name), select.i, actor,
+ mEnvironment.mWorld->getStore()))
+ return false;
+ }
+ else if (select.type==ESM::VT_Float)
+ {
+ if (checkLocal (comp, toLower (name), select.f, actor,
+ mEnvironment.mWorld->getStore()))
+ return false;
+ }
+ else
+ throw std::runtime_error (
+ "unsupported variable type in dialogue info select");
+ return true;
+
+
+ default:
+
+ std::cout << "unchecked select: " << type << " " << comp << " " << name << std::endl;
}
}
@@ -189,6 +444,10 @@ namespace MWDialogue
if (toLower (info.actor)!=MWWorld::Class::get (actor).getId (actor))
return false;
+ //PC Faction
+ if(!info.pcFaction.empty()) return false;
+
+ //NPC race
if (!info.race.empty())
{
ESMS::LiveCellRef *cellRef = actor.get();
@@ -200,6 +459,7 @@ namespace MWDialogue
return false;
}
+ //NPC class
if (!info.clas.empty())
{
ESMS::LiveCellRef *cellRef = actor.get();
@@ -211,6 +471,7 @@ namespace MWDialogue
return false;
}
+ //NPC faction
if (!info.npcFaction.empty())
{
ESMS::LiveCellRef *cellRef = actor.get();
@@ -220,66 +481,320 @@ namespace MWDialogue
if (toLower (info.npcFaction)!=toLower (cellRef->base->faction))
return false;
+
+ //check NPC rank
+ if(cellRef->base->npdt52.gold != -10)
+ {
+ if(cellRef->base->npdt52.rank < info.data.rank) return false;
+ }
+ else
+ {
+ if(cellRef->base->npdt12.rank < info.data.rank) return false;
+ }
}
// TODO check player faction
+ //check gender
+ ESMS::LiveCellRef* npc = actor.get();
+ if(npc->base->flags&npc->base->Female)
+ {
+ if(static_cast (info.data.gender)==0) return false;
+ }
+ else
+ {
+ if(static_cast (info.data.gender)==1) return false;
+ }
+
+
// check cell
if (!info.cell.empty())
if (mEnvironment.mWorld->getPlayer().getPlayer().getCell()->cell->name != info.cell)
return false;
// TODO check DATAstruct
-
for (std::vector::const_iterator iter (info.selects.begin());
iter != info.selects.end(); ++iter)
if (!isMatching (actor, *iter))
return false;
- std::cout
- << "unchecked entries:" << std::endl
- << " player faction: " << info.pcFaction << std::endl
- << " disposition: " << info.data.disposition << std::endl
- << " NPC rank: " << static_cast (info.data.rank) << std::endl
- << " gender: " << static_cast (info.data.gender) << std::endl
- << " PC rank: " << static_cast (info.data.PCrank) << std::endl;
-
return true;
}
- DialogueManager::DialogueManager (MWWorld::Environment& environment) : mEnvironment (environment) {}
+ DialogueManager::DialogueManager (MWWorld::Environment& environment,const Compiler::Extensions& extensions) :
+ mEnvironment (environment),mCompilerContext (MWScript::CompilerContext::Type_Dialgoue, environment),
+ mErrorStream(std::cout.rdbuf()),mErrorHandler(mErrorStream)
+ {
+ mChoice = -1;
+ mIsInChoice = false;
+ mCompilerContext.setExtensions (&extensions);
+ }
+
+ void DialogueManager::addTopic(std::string topic)
+ {
+ knownTopics[toLower(topic)] = true;
+ }
+
+ void DialogueManager::parseText(std::string text)
+ {
+ std::list::iterator it;
+ for(it = actorKnownTopics.begin();it != actorKnownTopics.end();it++)
+ {
+ size_t pos = find_str_ci(text,*it,0);
+ if(pos !=std::string::npos)
+ {
+ if(pos==0)
+ {
+ knownTopics[*it] = true;
+ }
+ else if(text.substr(pos -1,1) == " ")
+ {
+ knownTopics[*it] = true;
+ }
+ }
+ }
+ updateTopics();
+ }
void DialogueManager::startDialogue (const MWWorld::Ptr& actor)
{
- std::cout << "talking with " << MWWorld::Class::get (actor).getName (actor) << std::endl;
+ mChoice = -1;
+ mIsInChoice = false;
- const ESM::Dialogue *dialogue = mEnvironment.mWorld->getStore().dialogs.find ("hello");
+ mActor = actor;
- for (std::vector::const_iterator iter (dialogue->mInfo.begin());
- iter!=dialogue->mInfo.end(); ++iter)
+ mDialogueMap.clear();
+ actorKnownTopics.clear();
+ ESMS::RecListT::MapType dialogueList = mEnvironment.mWorld->getStore().dialogs.list;
+ for(ESMS::RecListT::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++)
{
- if (isMatching (actor, *iter))
+ mDialogueMap[it->first] = it->second;
+ }
+
+ //initialise the GUI
+ mEnvironment.mInputManager->setGuiMode(MWGui::GM_Dialogue);
+ MWGui::DialogueWindow* win = mEnvironment.mWindowManager->getDialogueWindow();
+ win->startDialogue(MWWorld::Class::get (actor).getName (actor));
+
+ //setup the list of topics known by the actor. Topics who are also on the knownTopics list will be added to the GUI
+ updateTopics();
+
+ //greeting
+ bool greetingFound = false;
+ //ESMS::RecListT::MapType dialogueList = mEnvironment.mWorld->getStore().dialogs.list;
+ for(ESMS::RecListT::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++)
+ {
+ ESM::Dialogue ndialogue = it->second;
+ if(ndialogue.type == ESM::Dialogue::Greeting)
{
- // start dialogue
- std::cout << "found matching info record" << std::endl;
+ if (greetingFound) break;
+ for (std::vector::const_iterator iter (it->second.mInfo.begin());
+ iter!=it->second.mInfo.end(); ++iter)
+ {
+ if (isMatching (actor, *iter) && functionFilter(mActor,*iter,true))
+ {
+ if (!iter->sound.empty())
+ {
+ // TODO play sound
+ }
+
+ std::string text = iter->response;
+ parseText(text);
+ win->addText(iter->response);
+ executeScript(iter->resultScript);
+ greetingFound = true;
+ mLastTopic = it->first;
+ mLastDialogue = *iter;
+ break;
+ }
+ }
+ }
+ }
+ }
+
+ bool DialogueManager::compile (const std::string& cmd,std::vector& code)
+ {
+ try
+ {
+ mErrorHandler.reset();
+
+ std::istringstream input (cmd + "\n");
+
+ Compiler::Scanner scanner (mErrorHandler, input, mCompilerContext.getExtensions());
+
+ Compiler::Locals locals;
+
+ std::string actorScript = MWWorld::Class::get (mActor).getScript (mActor);
+
+ if (!actorScript.empty())
+ {
+ // grab local variables from actor's script, if available.
+ locals = mEnvironment.mScriptManager->getLocals (actorScript);
+ }
+
+ Compiler::ScriptParser parser(mErrorHandler,mCompilerContext, locals, false);
+
+ scanner.scan (parser);
+ if(mErrorHandler.isGood())
+ {
+ parser.getCode(code);
+ return true;
+ }
+ return false;
+ }
+ catch (const Compiler::SourceException& error)
+ {
+ // error has already been reported via error handler
+ }
+ catch (const std::exception& error)
+ {
+ printError (std::string ("An exception has been thrown: ") + error.what());
+ }
- std::cout << "response: " << iter->response << std::endl;
+ return false;
+ }
- if (!iter->sound.empty())
+ void DialogueManager::executeScript(std::string script)
+ {
+ std::vector code;
+ if(compile(script,code))
+ {
+ try
+ {
+ MWScript::InterpreterContext interpreterContext(mEnvironment,&mActor.getRefData().getLocals(),mActor);
+ Interpreter::Interpreter interpreter;
+ MWScript::installOpcodes (interpreter);
+ interpreter.run (&code[0], code.size(), interpreterContext);
+ }
+ catch (const std::exception& error)
+ {
+ printError (std::string ("An exception has been thrown: ") + error.what());
+ }
+ }
+ }
+
+ void DialogueManager::updateTopics()
+ {
+ std::list keywordList;
+ int choice = mChoice;
+ mChoice = -1;
+ actorKnownTopics.clear();
+ MWGui::DialogueWindow* win = mEnvironment.mWindowManager->getDialogueWindow();
+ ESMS::RecListT::MapType dialogueList = mEnvironment.mWorld->getStore().dialogs.list;
+ for(ESMS::RecListT::MapType::iterator it = dialogueList.begin(); it!=dialogueList.end();it++)
+ {
+ ESM::Dialogue ndialogue = it->second;
+ if(ndialogue.type == ESM::Dialogue::Topic)
+ {
+ for (std::vector::const_iterator iter (it->second.mInfo.begin());
+ iter!=it->second.mInfo.end(); ++iter)
{
- // TODO play sound
+ if (isMatching (mActor, *iter) && functionFilter(mActor,*iter,true))
+ {
+ actorKnownTopics.push_back(it->first);
+ //does the player know the topic?
+ if(knownTopics.find(toLower(it->first)) != knownTopics.end())
+ {
+ keywordList.push_back(it->first);
+ break;
+ }
+ }
}
+ }
+ }
+ win->setKeywords(keywordList);
+ mChoice = choice;
+ }
- if (!iter->resultScript.empty())
+ void DialogueManager::keywordSelected(std::string keyword)
+ {
+ if(!mIsInChoice)
+ {
+ if(mDialogueMap.find(keyword) != mDialogueMap.end())
+ {
+ ESM::Dialogue ndialogue = mDialogueMap[keyword];
+ if(ndialogue.type == ESM::Dialogue::Topic)
{
- std::cout << "script: " << iter->resultScript << std::endl;
- // TODO execute script
+ for (std::vector::const_iterator iter = ndialogue.mInfo.begin();
+ iter!=ndialogue.mInfo.end(); ++iter)
+ {
+ if (isMatching (mActor, *iter) && functionFilter(mActor,*iter,true))
+ {
+ std::string text = iter->response;
+ std::string script = iter->resultScript;
+
+ parseText(text);
+
+ MWGui::DialogueWindow* win = mEnvironment.mWindowManager->getDialogueWindow();
+ win->addTitle(keyword);
+ win->addText(iter->response);
+
+ executeScript(script);
+
+ mLastTopic = keyword;
+ mLastDialogue = *iter;
+ break;
+ }
+ }
}
+ }
+ }
- mEnvironment.mInputManager->setGuiMode(MWGui::GM_Dialogue);
- break;
+ updateTopics();
+ }
+
+ void DialogueManager::goodbyeSelected()
+ {
+ mEnvironment.mInputManager->setGuiMode(MWGui::GM_Game);
+ }
+
+ void DialogueManager::questionAnswered(std::string answere)
+ {
+ if(mChoiceMap.find(answere) != mChoiceMap.end())
+ {
+ mChoice = mChoiceMap[answere];
+
+ std::vector::const_iterator iter;
+ if(mDialogueMap.find(mLastTopic) != mDialogueMap.end())
+ {
+ ESM::Dialogue ndialogue = mDialogueMap[mLastTopic];
+ if(ndialogue.type == ESM::Dialogue::Topic)
+ {
+ for (std::vector::const_iterator iter = ndialogue.mInfo.begin();
+ iter!=ndialogue.mInfo.end(); ++iter)
+ {
+ if (isMatching (mActor, *iter) && functionFilter(mActor,*iter,true))
+ {
+ mChoiceMap.clear();
+ mChoice = -1;
+ mIsInChoice = false;
+ MWGui::DialogueWindow* win = mEnvironment.mWindowManager->getDialogueWindow();
+ std::string text = iter->response;
+ parseText(text);
+ win->addText(text);
+ executeScript(iter->resultScript);
+ mLastTopic = mLastTopic;
+ mLastDialogue = *iter;
+ break;
+ }
+ }
+ }
}
+ updateTopics();
}
}
+ void DialogueManager::printError(std::string error)
+ {
+ MWGui::DialogueWindow* win = mEnvironment.mWindowManager->getDialogueWindow();
+ win->addText(error);
+ }
+
+ void DialogueManager::askQuestion(std::string question, int choice)
+ {
+ MWGui::DialogueWindow* win = mEnvironment.mWindowManager->getDialogueWindow();
+ win->askQuestion(question);
+ mChoiceMap[question] = choice;
+ mIsInChoice = true;
+ }
}
diff --git a/apps/openmw/mwdialogue/dialoguemanager.hpp b/apps/openmw/mwdialogue/dialoguemanager.hpp
index 5b6b26240..260d8e339 100644
--- a/apps/openmw/mwdialogue/dialoguemanager.hpp
+++ b/apps/openmw/mwdialogue/dialoguemanager.hpp
@@ -3,7 +3,13 @@
#include
+#include
+#include "../mwscript/compilercontext.hpp"
+#include "../mwscript/interpretercontext.hpp"
+#include
+
#include "../mwworld/ptr.hpp"
+#include
namespace MWWorld
{
@@ -20,12 +26,48 @@ namespace MWDialogue
bool isMatching (const MWWorld::Ptr& actor, const ESM::DialInfo& info) const;
+ bool functionFilter(const MWWorld::Ptr& actor, const ESM::DialInfo& info,bool choice);
+
+ void parseText(std::string text);
+
+ void updateTopics();
+
+ std::map mDialogueMap;
+ std::map knownTopics;// Those are the topics the player knows.
+ std::list actorKnownTopics;
+
+ MWScript::CompilerContext mCompilerContext;
+ std::ostream mErrorStream;
+ Compiler::StreamErrorHandler mErrorHandler;
+
+
+ bool compile (const std::string& cmd,std::vector& code);
+ void executeScript(std::string script);
+ MWWorld::Ptr mActor;
+
+ void printError(std::string error);
+
+ int mChoice;
+ std::map mChoiceMap;
+ std::string mLastTopic;
+ ESM::DialInfo mLastDialogue;
+ bool mIsInChoice;
+
public:
- DialogueManager (MWWorld::Environment& environment);
+ DialogueManager (MWWorld::Environment& environment,const Compiler::Extensions& extensions);
void startDialogue (const MWWorld::Ptr& actor);
+ void addTopic(std::string topic);
+
+ void askQuestion(std::string question,int choice);
+
+ //calbacks for the GUI
+ void keywordSelected(std::string keyword);
+ void goodbyeSelected();
+ void questionAnswered(std::string answere);
+
};
}
diff --git a/apps/openmw/mwdialogue/journal.cpp b/apps/openmw/mwdialogue/journal.cpp
index 42cce5cf5..0715214eb 100644
--- a/apps/openmw/mwdialogue/journal.cpp
+++ b/apps/openmw/mwdialogue/journal.cpp
@@ -3,6 +3,9 @@
#include "../mwworld/environment.hpp"
+#include "../mwgui/window_manager.hpp"
+#include "../mwgui/messagebox.hpp"
+
namespace MWDialogue
{
Quest& Journal::getQuest (const std::string& id)
@@ -34,6 +37,10 @@ namespace MWDialogue
Quest& quest = getQuest (id);
quest.addEntry (entry, *mEnvironment.mWorld); // we are doing slicing on purpose here
+
+ std::vector empty;
+ std::string notification = "Your Journal has been updated.";
+ mEnvironment.mWindowManager->messageBox (notification, empty);
}
void Journal::setJournalIndex (const std::string& id, int index)
@@ -60,7 +67,12 @@ namespace MWDialogue
int Journal::getJournalIndex (const std::string& id) const
{
- return 0;
+ TQuestContainer::const_iterator iter = mQuests.find (id);
+
+ if (iter==mQuests.end())
+ return 0;
+
+ return iter->second.getIndex();
}
Journal::TEntryIter Journal::begin() const
diff --git a/apps/openmw/mwgui/birth.cpp b/apps/openmw/mwgui/birth.cpp
index 93dde9f1b..e9c15fab4 100644
--- a/apps/openmw/mwgui/birth.cpp
+++ b/apps/openmw/mwgui/birth.cpp
@@ -21,18 +21,18 @@ BirthDialog::BirthDialog(WindowManager& parWindowManager)
getWidget(birthList, "BirthsignList");
birthList->setScrollVisible(true);
- birthList->eventListSelectAccept = MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
- birthList->eventListMouseItemActivate = MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
- birthList->eventListChangePosition = MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
+ birthList->eventListSelectAccept += MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
+ birthList->eventListMouseItemActivate += MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
+ birthList->eventListChangePosition += MyGUI::newDelegate(this, &BirthDialog::onSelectBirth);
// TODO: These buttons should be managed by a Dialog class
MyGUI::ButtonPtr backButton;
getWidget(backButton, "BackButton");
- backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &BirthDialog::onBackClicked);
+ backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BirthDialog::onBackClicked);
MyGUI::ButtonPtr okButton;
getWidget(okButton, "OKButton");
- okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &BirthDialog::onOkClicked);
+ okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &BirthDialog::onOkClicked);
updateBirths();
updateSpells();
@@ -100,7 +100,7 @@ void BirthDialog::onBackClicked(MyGUI::Widget* _sender)
eventBack();
}
-void BirthDialog::onSelectBirth(MyGUI::List* _sender, size_t _index)
+void BirthDialog::onSelectBirth(MyGUI::ListBox* _sender, size_t _index)
{
if (_index == MyGUI::ITEM_NONE)
return;
@@ -188,7 +188,7 @@ void BirthDialog::updateSpells()
{
if (!categories[category].spells.empty())
{
- MyGUI::StaticTextPtr label = spellArea->createWidget("SandBrightText", coord, MyGUI::Align::Default, std::string("Label"));
+ MyGUI::TextBox* label = spellArea->createWidget("SandBrightText", coord, MyGUI::Align::Default, std::string("Label"));
label->setCaption(mWindowManager.getGameSettingString(categories[category].label, ""));
spellItems.push_back(label);
coord.top += lineHeight;
diff --git a/apps/openmw/mwgui/birth.hpp b/apps/openmw/mwgui/birth.hpp
index a55a774a5..b5f7db774 100644
--- a/apps/openmw/mwgui/birth.hpp
+++ b/apps/openmw/mwgui/birth.hpp
@@ -32,7 +32,7 @@ namespace MWGui
void open();
// Events
- typedef delegates::CDelegate0 EventHandle_Void;
+ typedef delegates::CMultiDelegate0 EventHandle_Void;
/** Event : Back button clicked.\n
signature : void method()\n
@@ -40,7 +40,7 @@ namespace MWGui
EventHandle_Void eventBack;
protected:
- void onSelectBirth(MyGUI::List* _sender, size_t _index);
+ void onSelectBirth(MyGUI::ListBox* _sender, size_t _index);
void onOkClicked(MyGUI::Widget* _sender);
void onBackClicked(MyGUI::Widget* _sender);
@@ -49,9 +49,9 @@ namespace MWGui
void updateBirths();
void updateSpells();
- MyGUI::ListPtr birthList;
+ MyGUI::ListBox* birthList;
MyGUI::WidgetPtr spellArea;
- MyGUI::StaticImagePtr birthImage;
+ MyGUI::ImageBox* birthImage;
std::vector spellItems;
std::string currentBirthId;
diff --git a/apps/openmw/mwgui/charactercreation.cpp b/apps/openmw/mwgui/charactercreation.cpp
index 1cb0593e7..ce5e744cc 100644
--- a/apps/openmw/mwgui/charactercreation.cpp
+++ b/apps/openmw/mwgui/charactercreation.cpp
@@ -121,7 +121,7 @@ void CharacterCreation::spawnDialog(const char id)
mNameDialog->setTextLabel(mWM->getGameSettingString("sName", "Name"));
mNameDialog->setTextInput(mPlayerName);
mNameDialog->setNextButtonShow(mCreationStage >= CSE_NameChosen);
- mNameDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone);
+ mNameDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onNameDialogDone);
mNameDialog->open();
break;
@@ -131,8 +131,8 @@ void CharacterCreation::spawnDialog(const char id)
mRaceDialog = new RaceDialog(*mWM);
mRaceDialog->setNextButtonShow(mCreationStage >= CSE_RaceChosen);
mRaceDialog->setRaceId(mPlayerRaceId);
- mRaceDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
- mRaceDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack);
+ mRaceDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogDone);
+ mRaceDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onRaceDialogBack);
mRaceDialog->open();
break;
@@ -140,7 +140,7 @@ void CharacterCreation::spawnDialog(const char id)
if (mClassChoiceDialog)
mWM->removeDialog(mClassChoiceDialog);
mClassChoiceDialog = new ClassChoiceDialog(*mWM);
- mClassChoiceDialog->eventButtonSelected = MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
+ mClassChoiceDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassChoice);
mClassChoiceDialog->open();
break;
@@ -150,8 +150,8 @@ void CharacterCreation::spawnDialog(const char id)
mPickClassDialog = new PickClassDialog(*mWM);
mPickClassDialog->setNextButtonShow(mCreationStage >= CSE_ClassChosen);
mPickClassDialog->setClassId(mPlayerClass.name);
- mPickClassDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
- mPickClassDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack);
+ mPickClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogDone);
+ mPickClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onPickClassDialogBack);
mPickClassDialog->open();
break;
@@ -161,8 +161,8 @@ void CharacterCreation::spawnDialog(const char id)
mBirthSignDialog = new BirthDialog(*mWM);
mBirthSignDialog->setNextButtonShow(mCreationStage >= CSE_BirthSignChosen);
mBirthSignDialog->setBirthId(mPlayerBirthSignId);
- mBirthSignDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
- mBirthSignDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack);
+ mBirthSignDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogDone);
+ mBirthSignDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onBirthSignDialogBack);
mBirthSignDialog->open();
break;
@@ -170,8 +170,8 @@ void CharacterCreation::spawnDialog(const char id)
if (mCreateClassDialog)
mWM->removeDialog(mCreateClassDialog);
mCreateClassDialog = new CreateClassDialog(*mWM);
- mCreateClassDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
- mCreateClassDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
+ mCreateClassDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogDone);
+ mCreateClassDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onCreateClassDialogBack);
mCreateClassDialog->open();
break;
case GM_ClassGenerate:
@@ -212,9 +212,9 @@ void CharacterCreation::spawnDialog(const char id)
mReviewDialog->configureSkills(mPlayerMajorSkills, mPlayerMinorSkills);
}
- mReviewDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogDone);
- mReviewDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack);
- mReviewDialog->eventActivateDialog = MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog);
+ mReviewDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogDone);
+ mReviewDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onReviewDialogBack);
+ mReviewDialog->eventActivateDialog += MyGUI::newDelegate(this, &CharacterCreation::onReviewActivateDialog);
mReviewDialog->open();
break;
}
@@ -559,8 +559,8 @@ void CharacterCreation::showClassQuestionDialog()
mWM->removeDialog(mGenerateClassResultDialog);
mGenerateClassResultDialog = new GenerateClassResultDialog(*mWM);
mGenerateClassResultDialog->setClassId(mGenerateClass);
- mGenerateClassResultDialog->eventBack = MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassBack);
- mGenerateClassResultDialog->eventDone = MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassDone);
+ mGenerateClassResultDialog->eventBack += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassBack);
+ mGenerateClassResultDialog->eventDone += MyGUI::newDelegate(this, &CharacterCreation::onGenerateClassDone);
mGenerateClassResultDialog->open();
return;
}
@@ -581,7 +581,7 @@ void CharacterCreation::showClassQuestionDialog()
buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[1]);
buttons.push_back(sGenerateClassSteps[mGenerateClassStep].mButtons[2]);
mGenerateClassQuestionDialog->setButtons(buttons);
- mGenerateClassQuestionDialog->eventButtonSelected = MyGUI::newDelegate(this, &CharacterCreation::onClassQuestionChosen);
+ mGenerateClassQuestionDialog->eventButtonSelected += MyGUI::newDelegate(this, &CharacterCreation::onClassQuestionChosen);
mGenerateClassQuestionDialog->open();
}
diff --git a/apps/openmw/mwgui/class.cpp b/apps/openmw/mwgui/class.cpp
index ad94f30b1..75e534b42 100644
--- a/apps/openmw/mwgui/class.cpp
+++ b/apps/openmw/mwgui/class.cpp
@@ -29,11 +29,11 @@ GenerateClassResultDialog::GenerateClassResultDialog(WindowManager& parWindowMan
// TODO: These buttons should be managed by a Dialog class
MyGUI::ButtonPtr backButton;
getWidget(backButton, "BackButton");
- backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &GenerateClassResultDialog::onBackClicked);
+ backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onBackClicked);
MyGUI::ButtonPtr okButton;
getWidget(okButton, "OKButton");
- okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked);
+ okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &GenerateClassResultDialog::onOkClicked);
}
void GenerateClassResultDialog::open()
@@ -96,20 +96,20 @@ PickClassDialog::PickClassDialog(WindowManager& parWindowManager)
getWidget(classList, "ClassList");
classList->setScrollVisible(true);
- classList->eventListSelectAccept = MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
- classList->eventListMouseItemActivate = MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
- classList->eventListChangePosition = MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
+ classList->eventListSelectAccept += MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
+ classList->eventListMouseItemActivate += MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
+ classList->eventListChangePosition += MyGUI::newDelegate(this, &PickClassDialog::onSelectClass);
getWidget(classImage, "ClassImage");
// TODO: These buttons should be managed by a Dialog class
MyGUI::ButtonPtr backButton;
getWidget(backButton, "BackButton");
- backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &PickClassDialog::onBackClicked);
+ backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &PickClassDialog::onBackClicked);
MyGUI::ButtonPtr okButton;
getWidget(okButton, "OKButton");
- okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &PickClassDialog::onOkClicked);
+ okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &PickClassDialog::onOkClicked);
updateClasses();
updateStats();
@@ -177,7 +177,7 @@ void PickClassDialog::onBackClicked(MyGUI::Widget* _sender)
eventBack();
}
-void PickClassDialog::onSelectClass(MyGUI::List* _sender, size_t _index)
+void PickClassDialog::onSelectClass(MyGUI::ListBox* _sender, size_t _index)
{
if (_index == MyGUI::ITEM_NONE)
return;
@@ -248,7 +248,7 @@ void PickClassDialog::updateStats()
/* InfoBoxDialog */
-void InfoBoxDialog::fitToText(MyGUI::StaticTextPtr widget)
+void InfoBoxDialog::fitToText(MyGUI::TextBox* widget)
{
MyGUI::IntCoord inner = widget->getTextRegion();
MyGUI::IntCoord outer = widget->getCoord();
@@ -267,7 +267,7 @@ void InfoBoxDialog::layoutVertically(MyGUI::WidgetPtr widget, int margin)
for (unsigned i = 0; i < count; ++i)
{
MyGUI::WidgetPtr child = widget->getChildAt(i);
- if (!child->isVisible())
+ if (!child->getVisible())
continue;
child->setPosition(child->getLeft(), pos);
@@ -322,7 +322,7 @@ void InfoBoxDialog::setButtons(ButtonList &buttons)
button->getSubWidgetText()->setWordWrap(true);
button->setCaption(text);
fitToText(button);
- button->eventMouseButtonClick = MyGUI::newDelegate(this, &InfoBoxDialog::onButtonClicked);
+ button->eventMouseButtonClick += MyGUI::newDelegate(this, &InfoBoxDialog::onButtonClicked);
coord.top += button->getHeight();
this->buttons.push_back(button);
}
@@ -389,15 +389,15 @@ CreateClassDialog::CreateClassDialog(WindowManager& parWindowManager)
setText("SpecializationT", mWindowManager.getGameSettingString("sChooseClassMenu1", "Specialization"));
getWidget(specializationName, "SpecializationName");
specializationName->setCaption(mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Combat], ""));
- specializationName->eventMouseButtonClick = MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationClicked);
+ specializationName->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationClicked);
setText("FavoriteAttributesT", mWindowManager.getGameSettingString("sChooseClassMenu2", "Favorite Attributes:"));
getWidget(favoriteAttribute0, "FavoriteAttribute0");
getWidget(favoriteAttribute1, "FavoriteAttribute1");
favoriteAttribute0->setWindowManager(&mWindowManager);
favoriteAttribute1->setWindowManager(&mWindowManager);
- favoriteAttribute0->eventClicked = MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
- favoriteAttribute1->eventClicked = MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
+ favoriteAttribute0->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
+ favoriteAttribute1->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeClicked);
setText("MajorSkillT", mWindowManager.getGameSettingString("sSkillClassMajor", ""));
setText("MinorSkillT", mWindowManager.getGameSettingString("sSkillClassMinor", ""));
@@ -414,7 +414,7 @@ CreateClassDialog::CreateClassDialog(WindowManager& parWindowManager)
for (std::vector::const_iterator it = skills.begin(); it != end; ++it)
{
(*it)->setWindowManager(&mWindowManager);
- (*it)->eventClicked = MyGUI::newDelegate(this, &CreateClassDialog::onSkillClicked);
+ (*it)->eventClicked += MyGUI::newDelegate(this, &CreateClassDialog::onSkillClicked);
}
setText("LabelT", mWindowManager.getGameSettingString("sName", ""));
@@ -426,15 +426,15 @@ CreateClassDialog::CreateClassDialog(WindowManager& parWindowManager)
// TODO: These buttons should be managed by a Dialog class
MyGUI::ButtonPtr descriptionButton;
getWidget(descriptionButton, "DescriptionButton");
- descriptionButton->eventMouseButtonClick = MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionClicked);
+ descriptionButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionClicked);
MyGUI::ButtonPtr backButton;
getWidget(backButton, "BackButton");
- backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &CreateClassDialog::onBackClicked);
+ backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onBackClicked);
MyGUI::ButtonPtr okButton;
getWidget(okButton, "OKButton");
- okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &CreateClassDialog::onOkClicked);
+ okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CreateClassDialog::onOkClicked);
// Set default skills, attributes
@@ -560,8 +560,8 @@ void CreateClassDialog::onSpecializationClicked(MyGUI::WidgetPtr _sender)
if (specDialog)
delete specDialog;
specDialog = new SelectSpecializationDialog(mWindowManager);
- specDialog->eventCancel = MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
- specDialog->eventItemSelected = MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationSelected);
+ specDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
+ specDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onSpecializationSelected);
specDialog->setVisible(true);
}
@@ -578,8 +578,8 @@ void CreateClassDialog::onAttributeClicked(Widgets::MWAttributePtr _sender)
delete attribDialog;
attribDialog = new SelectAttributeDialog(mWindowManager);
attribDialog->setAffectedWidget(_sender);
- attribDialog->eventCancel = MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
- attribDialog->eventItemSelected = MyGUI::newDelegate(this, &CreateClassDialog::onAttributeSelected);
+ attribDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
+ attribDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onAttributeSelected);
attribDialog->setVisible(true);
}
@@ -607,8 +607,8 @@ void CreateClassDialog::onSkillClicked(Widgets::MWSkillPtr _sender)
delete skillDialog;
skillDialog = new SelectSkillDialog(mWindowManager);
skillDialog->setAffectedWidget(_sender);
- skillDialog->eventCancel = MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
- skillDialog->eventItemSelected = MyGUI::newDelegate(this, &CreateClassDialog::onSkillSelected);
+ skillDialog->eventCancel += MyGUI::newDelegate(this, &CreateClassDialog::onDialogCancel);
+ skillDialog->eventItemSelected += MyGUI::newDelegate(this, &CreateClassDialog::onSkillSelected);
skillDialog->setVisible(true);
}
@@ -638,7 +638,7 @@ void CreateClassDialog::onDescriptionClicked(MyGUI::Widget* _sender)
{
descDialog = new DescriptionDialog(mWindowManager);
descDialog->setTextInput(description);
- descDialog->eventDone = MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionEntered);
+ descDialog->eventDone += MyGUI::newDelegate(this, &CreateClassDialog::onDescriptionEntered);
descDialog->setVisible(true);
}
@@ -672,18 +672,18 @@ SelectSpecializationDialog::SelectSpecializationDialog(WindowManager& parWindowM
getWidget(specialization1, "Specialization1");
getWidget(specialization2, "Specialization2");
specialization0->setCaption(mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Combat], ""));
- specialization0->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
+ specialization0->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
specialization1->setCaption(mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Magic], ""));
- specialization1->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
+ specialization1->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
specialization2->setCaption(mWindowManager.getGameSettingString(ESM::Class::gmstSpecializationIds[ESM::Class::Stealth], ""));
- specialization2->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
+ specialization2->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onSpecializationClicked);
specializationId = ESM::Class::Combat;
// TODO: These buttons should be managed by a Dialog class
MyGUI::ButtonPtr cancelButton;
getWidget(cancelButton, "CancelButton");
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
- cancelButton->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSpecializationDialog::onCancelClicked);
+ cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onCancelClicked);
}
// widget controls
@@ -725,14 +725,14 @@ SelectAttributeDialog::SelectAttributeDialog(WindowManager& parWindowManager)
getWidget(attribute, std::string("Attribute").append(1, theIndex));
attribute->setWindowManager(&parWindowManager);
attribute->setAttributeId(ESM::Attribute::attributeIds[i]);
- attribute->eventClicked = MyGUI::newDelegate(this, &SelectAttributeDialog::onAttributeClicked);
+ attribute->eventClicked += MyGUI::newDelegate(this, &SelectAttributeDialog::onAttributeClicked);
}
// TODO: These buttons should be managed by a Dialog class
MyGUI::ButtonPtr cancelButton;
getWidget(cancelButton, "CancelButton");
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
- cancelButton->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectAttributeDialog::onCancelClicked);
+ cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectAttributeDialog::onCancelClicked);
}
// widget controls
@@ -813,7 +813,7 @@ SelectSkillDialog::SelectSkillDialog(WindowManager& parWindowManager)
{
skills[spec][i].widget->setWindowManager(&mWindowManager);
skills[spec][i].widget->setSkillId(skills[spec][i].skillId);
- skills[spec][i].widget->eventClicked = MyGUI::newDelegate(this, &SelectSkillDialog::onSkillClicked);
+ skills[spec][i].widget->eventClicked += MyGUI::newDelegate(this, &SelectSkillDialog::onSkillClicked);
}
}
@@ -821,7 +821,7 @@ SelectSkillDialog::SelectSkillDialog(WindowManager& parWindowManager)
MyGUI::ButtonPtr cancelButton;
getWidget(cancelButton, "CancelButton");
cancelButton->setCaption(mWindowManager.getGameSettingString("sCancel", ""));
- cancelButton->eventMouseButtonClick = MyGUI::newDelegate(this, &SelectSkillDialog::onCancelClicked);
+ cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSkillDialog::onCancelClicked);
}
// widget controls
@@ -850,7 +850,7 @@ DescriptionDialog::DescriptionDialog(WindowManager& parWindowManager)
// TODO: These buttons should be managed by a Dialog class
MyGUI::ButtonPtr okButton;
getWidget(okButton, "OKButton");
- okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &DescriptionDialog::onOkClicked);
+ okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &DescriptionDialog::onOkClicked);
okButton->setCaption(mWindowManager.getGameSettingString("sInputMenu1", ""));
// Make sure the edit box has focus
diff --git a/apps/openmw/mwgui/class.hpp b/apps/openmw/mwgui/class.hpp
index 5f1734b19..0e3348086 100644
--- a/apps/openmw/mwgui/class.hpp
+++ b/apps/openmw/mwgui/class.hpp
@@ -31,7 +31,7 @@ namespace MWGui
int getChosenButton() const;
// Events
- typedef delegates::CDelegate1 EventHandle_Int;
+ typedef delegates::CMultiDelegate1 EventHandle_Int;
/** Event : Button was clicked.\n
signature : void method(MyGUI::WidgetPtr widget, int index)\n
@@ -43,11 +43,11 @@ namespace MWGui
private:
- void fitToText(MyGUI::StaticTextPtr widget);
+ void fitToText(MyGUI::TextBox* widget);
void layoutVertically(MyGUI::WidgetPtr widget, int margin);
int currentButton;
MyGUI::WidgetPtr textBox;
- MyGUI::StaticTextPtr text;
+ MyGUI::TextBox* text;
MyGUI::WidgetPtr buttonBar;
std::vector buttons;
};
@@ -78,7 +78,7 @@ namespace MWGui
void open();
// Events
- typedef delegates::CDelegate0 EventHandle_Void;
+ typedef delegates::CMultiDelegate0 EventHandle_Void;
/** Event : Back button clicked.\n
signature : void method()\n
@@ -90,8 +90,8 @@ namespace MWGui
void onBackClicked(MyGUI::Widget* _sender);
private:
- MyGUI::StaticImagePtr classImage;
- MyGUI::StaticTextPtr className;
+ MyGUI::ImageBox* classImage;
+ MyGUI::TextBox* className;
std::string currentClassId;
};
@@ -108,7 +108,7 @@ namespace MWGui
void open();
// Events
- typedef delegates::CDelegate0 EventHandle_Void;
+ typedef delegates::CMultiDelegate0 EventHandle_Void;
/** Event : Back button clicked.\n
signature : void method()\n
@@ -116,7 +116,7 @@ namespace MWGui
EventHandle_Void eventBack;
protected:
- void onSelectClass(MyGUI::List* _sender, size_t _index);
+ void onSelectClass(MyGUI::ListBox* _sender, size_t _index);
void onOkClicked(MyGUI::Widget* _sender);
void onBackClicked(MyGUI::Widget* _sender);
@@ -125,9 +125,9 @@ namespace MWGui
void updateClasses();
void updateStats();
- MyGUI::StaticImagePtr classImage;
- MyGUI::ListPtr classList;
- MyGUI::StaticTextPtr specializationName;
+ MyGUI::ImageBox* classImage;
+ MyGUI::ListBox* classList;
+ MyGUI::TextBox* specializationName;
Widgets::MWAttributePtr favoriteAttribute[2];
Widgets::MWSkillPtr majorSkill[5];
Widgets::MWSkillPtr minorSkill[5];
@@ -143,7 +143,7 @@ namespace MWGui
ESM::Class::Specialization getSpecializationId() const { return specializationId; }
// Events
- typedef delegates::CDelegate0 EventHandle_Void;
+ typedef delegates::CMultiDelegate0 EventHandle_Void;
/** Event : Cancel button clicked.\n
signature : void method()\n
@@ -160,7 +160,7 @@ namespace MWGui
void onCancelClicked(MyGUI::Widget* _sender);
private:
- MyGUI::WidgetPtr specialization0, specialization1, specialization2;
+ MyGUI::TextBox *specialization0, *specialization1, *specialization2;
ESM::Class::Specialization specializationId;
};
@@ -175,7 +175,7 @@ namespace MWGui
void setAffectedWidget(Widgets::MWAttributePtr widget) { affectedWidget = widget; }
// Events
- typedef delegates::CDelegate0 EventHandle_Void;
+ typedef delegates::CMultiDelegate0 EventHandle_Void;
/** Event : Cancel button clicked.\n
signature : void method()\n
@@ -207,7 +207,7 @@ namespace MWGui
void setAffectedWidget(Widgets::MWSkillPtr widget) { affectedWidget = widget; }
// Events
- typedef delegates::CDelegate0 EventHandle_Void;
+ typedef delegates::CMultiDelegate0 EventHandle_Void;
/** Event : Cancel button clicked.\n
signature : void method()\n
@@ -264,7 +264,7 @@ namespace MWGui
void open();
// Events
- typedef delegates::CDelegate0 EventHandle_Void;
+ typedef delegates::CMultiDelegate0 EventHandle_Void;
/** Event : Back button clicked.\n
signature : void method()\n
@@ -287,7 +287,7 @@ namespace MWGui
private:
MyGUI::EditPtr editName;
- MyGUI::WidgetPtr specializationName;
+ MyGUI::TextBox* specializationName;
Widgets::MWAttributePtr favoriteAttribute0, favoriteAttribute1;
Widgets::MWSkillPtr majorSkill[5];
Widgets::MWSkillPtr minorSkill[5];
diff --git a/apps/openmw/mwgui/console.cpp b/apps/openmw/mwgui/console.cpp
index 3fd6e7892..ac4f4a82a 100644
--- a/apps/openmw/mwgui/console.cpp
+++ b/apps/openmw/mwgui/console.cpp
@@ -113,9 +113,9 @@ namespace MWGui
getWidget(history, "list_History");
// Set up the command line box
- command->eventEditSelectAccept =
+ command->eventEditSelectAccept +=
newDelegate(this, &Console::acceptCommand);
- command->eventKeyButtonPressed =
+ command->eventKeyButtonPressed +=
newDelegate(this, &Console::keyPress);
// Set up the log window
@@ -139,6 +139,9 @@ namespace MWGui
void Console::disable()
{
setVisible(false);
+ // Remove keyboard focus from the console input whenever the
+ // console is turned off
+ MyGUI::InputManager::getInstance().setKeyFocusWidget(NULL);
}
void Console::setFont(const std::string &fntName)
diff --git a/apps/openmw/mwgui/dialogue.cpp b/apps/openmw/mwgui/dialogue.cpp
index e48c142aa..d6c4ce4e5 100644
--- a/apps/openmw/mwgui/dialogue.cpp
+++ b/apps/openmw/mwgui/dialogue.cpp
@@ -3,6 +3,8 @@
#include "window_manager.hpp"
#include "widgets.hpp"
#include "components/esm_store/store.hpp"
+#include "../mwworld/environment.hpp"
+#include "../mwdialogue/dialoguemanager.hpp"
#include
#include
@@ -14,107 +16,192 @@
using namespace MWGui;
using namespace Widgets;
-DialogueWindow::DialogueWindow(WindowManager& parWindowManager)
- : WindowBase("openmw_dialogue_window_layout.xml", parWindowManager)
+/**
+*Copied from the internet.
+*/
+
+std::string lower_string(const std::string& str)
+{
+ std::string lowerCase;
+
+ std::transform (str.begin(), str.end(), std::back_inserter (lowerCase),
+ (int(*)(int)) std::tolower);
+
+ return lowerCase;
+}
+
+std::string::size_type find_str_ci(const std::string& str, const std::string& substr,size_t pos)
+{
+ return lower_string(str).find(lower_string(substr),pos);
+}
+
+
+DialogueWindow::DialogueWindow(WindowManager& parWindowManager,MWWorld::Environment& environment)
+ : WindowBase("openmw_dialogue_window_layout.xml", parWindowManager),
+ mEnvironment(environment)
{
// Centre dialog
center();
//WindowManager *wm = environment.mWindowManager;
setText("NpcName", "Name of character");
-
+
//History view
getWidget(history, "History");
history->setOverflowToTheLeft(true);
- history->getClient()->eventMouseButtonClick = MyGUI::newDelegate(this, &DialogueWindow::onHistoryClicked);
-
- //Topics list
+ history->setMaxTextLength(1000000);
+ Widget* eventbox;
+
+ //An EditBox cannot receive mouse click events, so we use an
+ //invisible widget on top of the editbox to receive them
+ /// \todo scrolling the dialogue history with the mouse wheel doesn't work using this solution
+ getWidget(eventbox, "EventBox");
+ eventbox->eventMouseButtonClick += MyGUI::newDelegate(this, &DialogueWindow::onHistoryClicked);
+
+ //Topics list
getWidget(topicsList, "TopicsList");
topicsList->setScrollVisible(true);
- topicsList->eventListSelectAccept = MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
- topicsList->eventListMouseItemActivate = MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
- topicsList->eventListChangePosition = MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
+ //topicsList->eventListSelectAccept += MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
+ topicsList->eventListMouseItemActivate += MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
+ //topicsList->eventListChangePosition += MyGUI::newDelegate(this, &DialogueWindow::onSelectTopic);
MyGUI::ButtonPtr byeButton;
getWidget(byeButton, "ByeButton");
- byeButton->eventMouseButtonClick = MyGUI::newDelegate(this, &DialogueWindow::onByeClicked);
+ byeButton->eventMouseButtonClick += MyGUI::newDelegate(this, &DialogueWindow::onByeClicked);
- updateOptions();
+ getWidget(pDispositionBar, "Disposition");
+ getWidget(pDispositionText,"DispositionText");
}
void DialogueWindow::onHistoryClicked(MyGUI::Widget* _sender)
{
- ISubWidgetText* t = history->getSubWidgetText();
+ ISubWidgetText* t = history->getClient()->getSubWidgetText();
if(t == nullptr)
return;
- const IntPoint& lastPressed = InputManager::getInstance().getLastLeftPressed();
+ const IntPoint& lastPressed = InputManager::getInstance().getLastPressedPosition(MyGUI::MouseButton::Left);
size_t cursorPosition = t->getCursorPosition(lastPressed);
- if(history->getColorAtPos(cursorPosition) != "#FFFFFF")
+ MyGUI::UString color = history->getColorAtPos(cursorPosition);
+ if(color != "#B29154")
{
UString key = history->getColorTextAt(cursorPosition);
- std::cout << "Clicked on key: " << key << std::endl;
- //eventTopicSelected(key);
+ if(color == "#686EBA") mEnvironment.mDialogueManager->keywordSelected(lower_string(key));
+
+ if(color == "#572D21") mEnvironment.mDialogueManager->questionAnswered(key);
}
}
void DialogueWindow::open()
{
+ topicsList->removeAllItems();
+ pTopicsText.clear();
+ history->eraseText(0,history->getTextLength());
updateOptions();
setVisible(true);
}
void DialogueWindow::onByeClicked(MyGUI::Widget* _sender)
{
- eventBye();
+ mEnvironment.mDialogueManager->goodbyeSelected();
}
-void DialogueWindow::onSelectTopic(MyGUI::List* _sender, size_t _index)
+void DialogueWindow::onSelectTopic(MyGUI::ListBox* _sender, size_t _index)
{
if (_index == MyGUI::ITEM_NONE)
return;
+ std::string topic = _sender->getItemNameAt(_index);
+ mEnvironment.mDialogueManager->keywordSelected(lower_string(topic));
+}
- //const std::string* theTopic = topicsList->getItemDataAt(_index);
- //std::cout << "Selected: "<< theTopic << std::endl;
- //eventTopicSelected(key);
+void DialogueWindow::startDialogue(std::string npcName)
+{
+ setText("NpcName", npcName);
}
+void DialogueWindow::setKeywords(std::list keyWords)
+{
+ topicsList->removeAllItems();
+ for(std::list::iterator it = keyWords.begin(); it != keyWords.end(); it++)
+ {
+ topicsList->addItem(*it);
+ }
+}
-void DialogueWindow::updateOptions()
+void DialogueWindow::removeKeyword(std::string keyWord)
+{
+ if(topicsList->findItemIndexWith(keyWord) != MyGUI::ITEM_NONE)
+ {
+ topicsList->removeItemAt(topicsList->findItemIndexWith(keyWord));
+ pTopicsText.erase(keyWord);
+ }
+}
+
+void addColorInString(std::string& str, const std::string& keyword,std::string color1, std::string color2)
+{
+ size_t pos = 0;
+ while((pos = find_str_ci(str,keyword, pos)) != std::string::npos)
+ {
+ if(pos==0)
+ {
+ str.insert(pos,color1);
+ pos += color1.length();
+ pos += keyword.length();
+ str.insert(pos,color2);
+ pos+= color2.length();
+ }
+ else
+ {
+ if(str.substr(pos -1,1) == " ")
+ {
+ str.insert(pos,color1);
+ pos += color1.length();
+ pos += keyword.length();
+ str.insert(pos,color2);
+ pos+= color2.length();
+ }
+ else
+ {
+ pos += keyword.length();
+ }
+ }
+ }
+}
+
+std::string DialogueWindow::parseText(std::string text)
{
- //FIXME Add this properly
- history->addDialogText("Through the translucent surface of the orb, you see shifting images of distant locations...");
- for(int z = 0; z < 10; z++)
+ for(unsigned int i = 0;igetItemCount();i++)
{
- history->addDialogHeading("Fort Frostmoth");
- history->addDialogText("The image in the orb flickers, and you see.... The cold courtyard of #FF0000Fort Frostmoth#FFFFFF, battered bu werewolf attack, but still standing, still projecting Imperial might even to this distant and cold corner of the world.");
+ std::string keyWord = topicsList->getItemNameAt(i);
+ addColorInString(text,keyWord,"#686EBA","#B29154");
}
+ return text;
+}
+void DialogueWindow::addText(std::string text)
+{
+ history->addDialogText("#B29154"+parseText(text)+"#B29154");
+}
+
+void DialogueWindow::addTitle(std::string text)
+{
+ history->addDialogHeading(text);
+}
+
+void DialogueWindow::askQuestion(std::string question)
+{
+ history->addDialogText("#572D21"+question+"#B29154"+" ");
+}
+
+void DialogueWindow::updateOptions()
+{
//Clear the list of topics
topicsList->removeAllItems();
- int i = 0;
- topicsList->addItem("Ald'ruhn", i++);
- topicsList->addItem("Balmora", i++);
- topicsList->addItem("Sadrith Mora", i++);
- topicsList->addItem("Vivec", i++);
- topicsList->addItem("Ald Velothi", i++);
- topicsList->addItem("Caldera", i++);
- topicsList->addItem("Dagon Fel ", i++);
- topicsList->addItem("Gnaar Mok", i++);
- topicsList->addItem("Gnisis", i++);
- topicsList->addItem("Hla Oad", i++);
- topicsList->addItem("Khuul", i++);
- topicsList->addItem("Maar Gan", i++);
- topicsList->addItem("Molag Mar", i++);
- topicsList->addItem("Pelagiad", i++);
- topicsList->addItem("Seyda Neen", i++);
- topicsList->addItem("Suran", i++);
- topicsList->addItem("Tel Aruhn", i++);
- topicsList->addItem("Tel Branora", i++);
- topicsList->addItem("Tel Fyr", i++);
- topicsList->addItem("Tel Mora", i++);
- topicsList->addItem("Tel Vos", i++);
- topicsList->addItem("Vos", i++);
-}
+ pTopicsText.clear();
+ history->eraseText(0,history->getTextLength());
+ pDispositionBar->setProgressRange(100);
+ pDispositionBar->setProgressPosition(40);
+ pDispositionText->eraseText(0,pDispositionText->getTextLength());
+ pDispositionText->addText("#B29154"+std::string("40/100")+"#B29154");
+}
diff --git a/apps/openmw/mwgui/dialogue.hpp b/apps/openmw/mwgui/dialogue.hpp
index ddb6f8a4c..b80a016cb 100644
--- a/apps/openmw/mwgui/dialogue.hpp
+++ b/apps/openmw/mwgui/dialogue.hpp
@@ -9,6 +9,11 @@ namespace MWGui
class WindowManager;
}
+namespace MWWorld
+{
+ class Environment;
+}
+
/*
This file contains the dialouge window
Layout is defined by resources/mygui/openmw_dialogue_window_layout.xml.
@@ -16,35 +21,52 @@ namespace MWGui
namespace MWGui
{
- class DialogeHistory;
+ class DialogueHistory;
using namespace MyGUI;
class DialogueWindow: public WindowBase
{
public:
- DialogueWindow(WindowManager& parWindowManager);
+ DialogueWindow(WindowManager& parWindowManager,MWWorld::Environment& environment);
void open();
// Events
- typedef delegates::CDelegate0 EventHandle_Void;
+ typedef delegates::CMultiDelegate0 EventHandle_Void;
/** Event : Dialog finished, OK button clicked.\n
signature : void method()\n
*/
EventHandle_Void eventBye;
+ void startDialogue(std::string npcName);
+ void stopDialogue();
+ void setKeywords(std::list keyWord);
+ void removeKeyword(std::string keyWord);
+ void addText(std::string text);
+ void addTitle(std::string text);
+ void askQuestion(std::string question);
+
protected:
- void onSelectTopic(MyGUI::List* _sender, size_t _index);
+ void onSelectTopic(MyGUI::ListBox* _sender, size_t _index);
void onByeClicked(MyGUI::Widget* _sender);
void onHistoryClicked(MyGUI::Widget* _sender);
private:
void updateOptions();
+ /**
+ *Helper function that add topic keyword in blue in a text.
+ */
+ std::string parseText(std::string text);
+
+ DialogueHistory* history;
+ MyGUI::ListBox* topicsList;
+ MyGUI::ProgressPtr pDispositionBar;
+ MyGUI::EditPtr pDispositionText;
+ std::map pTopicsText;// this map links keyword and "real" text.
- DialogeHistory* history;
- MyGUI::ListPtr topicsList;
+ MWWorld::Environment& mEnvironment;
};
}
#endif
diff --git a/apps/openmw/mwgui/dialogue_history.cpp b/apps/openmw/mwgui/dialogue_history.cpp
index aaa559d24..cd34ee119 100644
--- a/apps/openmw/mwgui/dialogue_history.cpp
+++ b/apps/openmw/mwgui/dialogue_history.cpp
@@ -13,10 +13,10 @@
using namespace MWGui;
using namespace Widgets;
-UString DialogeHistory::getColorAtPos(size_t _pos)
+UString DialogueHistory::getColorAtPos(size_t _pos)
{
- UString colour = TextIterator::convertTagColour(mText->getTextColour());
- TextIterator iterator(mText->getCaption());
+ UString colour = TextIterator::convertTagColour(getTextColour());
+ TextIterator iterator(getCaption());
while(iterator.moveNext())
{
size_t pos = iterator.getPosition();
@@ -29,12 +29,12 @@ UString DialogeHistory::getColorAtPos(size_t _pos)
return colour;
}
-UString DialogeHistory::getColorTextAt(size_t _pos)
+UString DialogueHistory::getColorTextAt(size_t _pos)
{
bool breakOnNext = false;
- UString colour = TextIterator::convertTagColour(mText->getTextColour());
+ UString colour = TextIterator::convertTagColour(getTextColour());
UString colour2 = colour;
- TextIterator iterator(mText->getCaption());
+ TextIterator iterator(getCaption());
TextIterator col_start = iterator;
while(iterator.moveNext())
{
@@ -59,15 +59,15 @@ UString DialogeHistory::getColorTextAt(size_t _pos)
return "";
}
-void DialogeHistory::addDialogHeading(const UString& parText)
+void DialogueHistory::addDialogHeading(const UString& parText)
{
- UString head("\n#00FF00");
+ UString head("\n#D8C09A");
head.append(parText);
- head.append("#FFFFFF\n");
+ head.append("#B29154\n");
addText(head);
}
-void DialogeHistory::addDialogText(const UString& parText)
+void DialogueHistory::addDialogText(const UString& parText)
{
addText(parText);
addText("\n");
diff --git a/apps/openmw/mwgui/dialogue_history.hpp b/apps/openmw/mwgui/dialogue_history.hpp
index ec41678e6..12a9c53e7 100644
--- a/apps/openmw/mwgui/dialogue_history.hpp
+++ b/apps/openmw/mwgui/dialogue_history.hpp
@@ -5,9 +5,9 @@
namespace MWGui
{
using namespace MyGUI;
- class DialogeHistory : public MyGUI::Edit
+ class DialogueHistory : public MyGUI::EditBox
{
- MYGUI_RTTI_DERIVED( DialogeHistory )
+ MYGUI_RTTI_DERIVED( DialogueHistory )
public:
Widget* getClient() { return mClient; }
UString getColorAtPos(size_t _pos);
diff --git a/apps/openmw/mwgui/journalwindow.cpp b/apps/openmw/mwgui/journalwindow.cpp
index 5c9ef1f9b..644bcbc04 100644
--- a/apps/openmw/mwgui/journalwindow.cpp
+++ b/apps/openmw/mwgui/journalwindow.cpp
@@ -89,9 +89,9 @@ MWGui::JournalWindow::JournalWindow (WindowManager& parWindowManager)
getWidget(mLeftTextWidget, "LeftText");
getWidget(mRightTextWidget, "RightText");
getWidget(mPrevBtn, "PrevPageBTN");
- mPrevBtn->eventMouseButtonClick = MyGUI::newDelegate(this,&MWGui::JournalWindow::notifyPrevPage);
+ mPrevBtn->eventMouseButtonClick += MyGUI::newDelegate(this,&MWGui::JournalWindow::notifyPrevPage);
getWidget(mNextBtn, "NextPageBTN");
- mNextBtn->eventMouseButtonClick = MyGUI::newDelegate(this,&MWGui::JournalWindow::notifyNextPage);
+ mNextBtn->eventMouseButtonClick += MyGUI::newDelegate(this,&MWGui::JournalWindow::notifyNextPage);
//MyGUI::ItemBox* list = new MyGUI::ItemBox();
//list->addItem("qaq","aqzazaz");
//mScrollerWidget->addChildItem(list);
@@ -111,7 +111,7 @@ MWGui::JournalWindow::JournalWindow (WindowManager& parWindowManager)
//displayLeftText(list.front());
MyGUI::WindowPtr t = static_cast(mMainWidget);
- t->eventWindowChangeCoord = MyGUI::newDelegate(this, &JournalWindow::onWindowResize);
+ t->eventWindowChangeCoord += MyGUI::newDelegate(this, &JournalWindow::onWindowResize);
}
void MWGui::JournalWindow::open()
diff --git a/apps/openmw/mwgui/journalwindow.hpp b/apps/openmw/mwgui/journalwindow.hpp
index e66448763..4656c7a48 100644
--- a/apps/openmw/mwgui/journalwindow.hpp
+++ b/apps/openmw/mwgui/journalwindow.hpp
@@ -41,7 +41,7 @@ namespace MWGui
static const int lineHeight;
MyGUI::WidgetPtr skillAreaWidget, skillClientWidget;
- MyGUI::VScrollPtr skillScrollerWidget;
+ MyGUI::ScrollBar* skillScrollerWidget;
int lastPos, clientHeight;
MyGUI::EditPtr mLeftTextWidget;
MyGUI::EditPtr mRightTextWidget;
@@ -54,4 +54,4 @@ namespace MWGui
}
-#endif
\ No newline at end of file
+#endif
diff --git a/apps/openmw/mwgui/layouts.hpp b/apps/openmw/mwgui/layouts.hpp
index 9917dcdcc..71181e48d 100644
--- a/apps/openmw/mwgui/layouts.hpp
+++ b/apps/openmw/mwgui/layouts.hpp
@@ -45,18 +45,18 @@ namespace MWGui
void setBatchCount(size_t count);
MyGUI::ProgressPtr health, magicka, stamina;
- MyGUI::StaticImagePtr weapImage, spellImage;
+ MyGUI::ImageBox *weapImage, *spellImage;
MyGUI::ProgressPtr weapStatus, spellStatus;
MyGUI::WidgetPtr effectBox;
- MyGUI::StaticImagePtr effect1;
- MyGUI::StaticImagePtr minimap;
- MyGUI::StaticImagePtr compass;
- MyGUI::StaticImagePtr crosshair;
+ MyGUI::ImageBox* effect1;
+ MyGUI::ImageBox* minimap;
+ MyGUI::ImageBox* compass;
+ MyGUI::ImageBox* crosshair;
MyGUI::WidgetPtr fpsbox;
- MyGUI::StaticTextPtr fpscounter;
- MyGUI::StaticTextPtr trianglecounter;
- MyGUI::StaticTextPtr batchcounter;
+ MyGUI::TextBox* fpscounter;
+ MyGUI::TextBox* trianglecounter;
+ MyGUI::TextBox* batchcounter;
};
class MapWindow : public OEngine::GUI::Layout
@@ -75,7 +75,7 @@ namespace MWGui
void setCellName(const std::string& cellName)
{
- mMainWidget->setCaption(cellName);
+ static_cast(mMainWidget)->setCaption(cellName);
}
};
@@ -127,7 +127,7 @@ namespace MWGui
getWidget(avatar, "Avatar");
// Adjust armor rating text to bottom of avatar widget
- MyGUI::StaticTextPtr armor_rating;
+ MyGUI::TextBox* armor_rating;
getWidget(armor_rating, "ArmorRating");
armor_rating->setCaption("Armor: 11");
MyGUI::IntCoord coord = armor_rating->getCoord();
@@ -165,7 +165,7 @@ namespace MWGui
last_x += coord.width + margin;
button_pt->setCoord(coord);
- button_pt->eventMouseButtonClick = MyGUI::newDelegate(this, &InventoryWindow::onCategorySelected);
+ button_pt->eventMouseButtonClick += MyGUI::newDelegate(this, &InventoryWindow::onCategorySelected);
}
}
diff --git a/apps/openmw/mwgui/messagebox.cpp b/apps/openmw/mwgui/messagebox.cpp
index f0745bbbe..c103bcb8b 100644
--- a/apps/openmw/mwgui/messagebox.cpp
+++ b/apps/openmw/mwgui/messagebox.cpp
@@ -19,7 +19,7 @@ void MessageBoxManager::onFrame (float frameDuration)
if(it->current >= it->max)
{
it->messageBox->mMarkedToDelete = true;
-
+
if(*mMessageBoxes.begin() == it->messageBox) // if this box is the last one
{
// collect all with mMarkedToDelete and delete them.
@@ -47,7 +47,7 @@ void MessageBoxManager::onFrame (float frameDuration)
it++;
}
}
-
+
if(mInterMessageBoxe != NULL && mInterMessageBoxe->mMarkedToDelete) {
delete mInterMessageBoxe;
mInterMessageBoxe = NULL;
@@ -57,20 +57,18 @@ void MessageBoxManager::onFrame (float frameDuration)
void MessageBoxManager::createMessageBox (const std::string& message)
{
- std::cout << "MessageBox: " << message << std::endl;
-
MessageBox *box = new MessageBox(*this, message);
-
+
removeMessageBox(message.length()*mMessageBoxSpeed, box);
-
+
mMessageBoxes.push_back(box);
std::vector::iterator it;
-
+
if(mMessageBoxes.size() > 3) {
delete *mMessageBoxes.begin();
mMessageBoxes.erase(mMessageBoxes.begin());
}
-
+
int height = 0;
for(it = mMessageBoxes.begin(); it != mMessageBoxes.end(); ++it)
{
@@ -88,9 +86,9 @@ bool MessageBoxManager::createInteractiveMessageBox (const std::string& message,
std::cout << "interactive MessageBox: " << message << " - ";
std::copy (buttons.begin(), buttons.end(), std::ostream_iterator (std::cout, ", "));
std::cout << std::endl;
-
+
mInterMessageBoxe = new InteractiveMessageBox(*this, message, buttons);
-
+
return true;
}
@@ -105,7 +103,7 @@ void MessageBoxManager::removeMessageBox (float time, MessageBox *msgbox)
timer.current = 0;
timer.max = time;
timer.messageBox = msgbox;
-
+
mTimers.insert(mTimers.end(), timer);
}
@@ -152,25 +150,26 @@ MessageBox::MessageBox(MessageBoxManager& parMessageBoxManager, const std::strin
mBottomPadding = 20;
mNextBoxPadding = 20;
mMarkedToDelete = false;
-
+
getWidget(mMessageWidget, "message");
-
+
mMessageWidget->setOverflowToTheLeft(true);
mMessageWidget->addText(cMessage);
-
+
MyGUI::IntSize size;
size.width = mFixedWidth;
size.height = 100; // dummy
-
+
MyGUI::IntCoord coord;
coord.left = 10; // dummy
coord.top = 10; // dummy
mMessageWidget->setSize(size);
-
- MyGUI::IntSize textSize = mMessageWidget->_getTextSize();
+
+ MyGUI::IntSize textSize = mMessageWidget->getTextSize();
+
size.height = mHeight = textSize.height + 20; // this is the padding between the text and the box
-
+
mMainWidget->setSize(size);
size.width -= 15; // this is to center the text (see messagebox_layout.xml, Widget type="Edit" position="-2 -3 0 0")
mMessageWidget->setSize(size);
@@ -178,15 +177,15 @@ MessageBox::MessageBox(MessageBoxManager& parMessageBoxManager, const std::strin
void MessageBox::update (int height)
{
- MyGUI::IntSize gameWindowSize = mMessageBoxManager.mWindowManager->getGui()->getViewSize();
+ MyGUI::IntSize gameWindowSize = MyGUI::RenderManager::getInstance().getViewSize();
MyGUI::IntCoord coord;
coord.left = (gameWindowSize.width - mFixedWidth)/2;
coord.top = (gameWindowSize.height - mHeight - height - mBottomPadding);
-
+
MyGUI::IntSize size;
size.width = mFixedWidth;
size.height = mHeight;
-
+
mMainWidget->setCoord(coord);
mMainWidget->setSize(size);
mMainWidget->setVisible(true);
@@ -211,26 +210,26 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
int buttonTopPadding = 5; // ^-- if vertical
int buttonPadding = 5; // padding between button label and button itself
int buttonMainPadding = 10; // padding between buttons and bottom of the main widget
-
+
mMarkedToDelete = false;
-
-
+
+
getWidget(mMessageWidget, "message");
getWidget(mButtonsWidget, "buttons");
-
+
mMessageWidget->setOverflowToTheLeft(true);
mMessageWidget->addText(message);
-
- MyGUI::IntSize textSize = mMessageWidget->_getTextSize();
-
- MyGUI::IntSize gameWindowSize = mMessageBoxManager.mWindowManager->getGui()->getViewSize();
-
+
+ MyGUI::IntSize textSize = mMessageWidget->getTextSize();
+
+ MyGUI::IntSize gameWindowSize = MyGUI::RenderManager::getInstance().getViewSize();
+
int biggestButtonWidth = 0;
int buttonWidth = 0;
int buttonsWidth = 0;
int buttonHeight = 0;
MyGUI::IntCoord dummyCoord(0, 0, 0, 0);
-
+
std::vector::const_iterator it;
for(it = buttons.begin(); it != buttons.end(); ++it)
{
@@ -240,28 +239,28 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
dummyCoord,
MyGUI::Align::Default);
button->setCaption(*it);
-
- button->eventMouseButtonClick = MyGUI::newDelegate(this, &InteractiveMessageBox::mousePressed);
-
+
+ button->eventMouseButtonClick += MyGUI::newDelegate(this, &InteractiveMessageBox::mousePressed);
+
mButtons.push_back(button);
-
- buttonWidth = button->_getTextSize().width + 2*buttonPadding + buttonLeftPadding;
+
+ buttonWidth = button->getTextSize().width + 2*buttonPadding + buttonLeftPadding;
buttonsWidth += buttonWidth;
- buttonHeight = button->_getTextSize().height + 2*buttonPadding + buttonTopPadding;
-
+ buttonHeight = button->getTextSize().height + 2*buttonPadding + buttonTopPadding;
+
if(buttonWidth > biggestButtonWidth)
{
biggestButtonWidth = buttonWidth;
}
}
buttonsWidth += buttonLeftPadding;
-
+
MyGUI::IntSize mainWidgetSize;
if(buttonsWidth < fixedWidth)
{
// on one line
std::cout << "on one line" << std::endl;
-
+
if(textSize.width + 2*textPadding < buttonsWidth)
{
std::cout << "width = buttonsWidth" << std::endl;
@@ -272,48 +271,48 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
mainWidgetSize.width = textSize.width + 3*textPadding;
}
mainWidgetSize.height = textSize.height + textButtonPadding + buttonHeight + buttonMainPadding;
-
+
MyGUI::IntCoord absCoord;
absCoord.left = (gameWindowSize.width - mainWidgetSize.width)/2;
absCoord.top = (gameWindowSize.height - mainWidgetSize.height)/2;
-
+
std::cout << "width " << mainWidgetSize.width << " height " << mainWidgetSize.height << std::endl;
std::cout << "left " << absCoord.left << " top " << absCoord.top << std::endl;
-
+
mMainWidget->setCoord(absCoord);
mMainWidget->setSize(mainWidgetSize);
-
-
+
+
MyGUI::IntCoord messageWidgetCoord;
messageWidgetCoord.left = (mainWidgetSize.width - textSize.width)/2;
messageWidgetCoord.top = textPadding;
mMessageWidget->setCoord(messageWidgetCoord);
-
+
mMessageWidget->setSize(textSize);
-
+
MyGUI::IntCoord buttonCord;
MyGUI::IntSize buttonSize(0, buttonHeight);
int left = (mainWidgetSize.width - buttonsWidth)/2 + buttonPadding;
-
+
std::vector::const_iterator button;
for(button = mButtons.begin(); button != mButtons.end(); ++button)
{
buttonCord.left = left;
buttonCord.top = textSize.height + textButtonPadding;
-
- buttonSize.width = (*button)->_getTextSize().width + 2*buttonPadding;
- buttonSize.height = (*button)->_getTextSize().height + 2*buttonPadding;
-
+
+ buttonSize.width = (*button)->getTextSize().width + 2*buttonPadding;
+ buttonSize.height = (*button)->getTextSize().height + 2*buttonPadding;
+
(*button)->setCoord(buttonCord);
(*button)->setSize(buttonSize);
-
+
left += buttonSize.width + buttonLeftPadding;
}
}
else
{
// among each other
-
+
if(biggestButtonWidth > textSize.width) {
mainWidgetSize.width = biggestButtonWidth + buttonTopPadding;
}
@@ -321,46 +320,46 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
mainWidgetSize.width = textSize.width + 3*textPadding;
}
mainWidgetSize.height = textSize.height + 2*textPadding + textButtonPadding + buttonHeight * buttons.size() + buttonMainPadding;
-
+
std::cout << "biggestButtonWidth " << biggestButtonWidth << " textSize.width " << textSize.width << std::endl;
std::cout << "width " << mainWidgetSize.width << " height " << mainWidgetSize.height << std::endl;
mMainWidget->setSize(mainWidgetSize);
-
+
MyGUI::IntCoord absCoord;
absCoord.left = (gameWindowSize.width - mainWidgetSize.width)/2;
absCoord.top = (gameWindowSize.height - mainWidgetSize.height)/2;
-
+
mMainWidget->setCoord(absCoord);
mMainWidget->setSize(mainWidgetSize);
-
-
+
+
MyGUI::IntCoord messageWidgetCoord;
messageWidgetCoord.left = (mainWidgetSize.width - textSize.width)/2;
messageWidgetCoord.top = textPadding;
mMessageWidget->setCoord(messageWidgetCoord);
-
+
mMessageWidget->setSize(textSize);
-
+
MyGUI::IntCoord buttonCord;
MyGUI::IntSize buttonSize(0, buttonHeight);
-
+
int top = textButtonPadding + buttonTopPadding + textSize.height;
-
+
std::vector::const_iterator button;
for(button = mButtons.begin(); button != mButtons.end(); ++button)
{
- buttonSize.width = (*button)->_getTextSize().width + buttonPadding*2;
- buttonSize.height = (*button)->_getTextSize().height + buttonPadding*2;
-
+ buttonSize.width = (*button)->getTextSize().width + buttonPadding*2;
+ buttonSize.height = (*button)->getTextSize().height + buttonPadding*2;
+
buttonCord.top = top;
buttonCord.left = (mainWidgetSize.width - buttonSize.width)/2 - 5; // FIXME: -5 is not so nice :/
-
+
(*button)->setCoord(buttonCord);
(*button)->setSize(buttonSize);
-
+
top += buttonSize.height + 2*buttonTopPadding;
}
-
+
}
}
@@ -387,8 +386,3 @@ int InteractiveMessageBox::readPressedButton ()
mButtonPressed = -1;
return pressed;
}
-
-
-
-
-
diff --git a/apps/openmw/mwgui/race.cpp b/apps/openmw/mwgui/race.cpp
index 037f97fc3..880c0bc52 100644
--- a/apps/openmw/mwgui/race.cpp
+++ b/apps/openmw/mwgui/race.cpp
@@ -34,7 +34,7 @@ RaceDialog::RaceDialog(WindowManager& parWindowManager)
headRotate->setScrollRange(50);
headRotate->setScrollPosition(20);
headRotate->setScrollViewPage(10);
- headRotate->eventScrollChangePosition = MyGUI::newDelegate(this, &RaceDialog::onHeadRotate);
+ headRotate->eventScrollChangePosition += MyGUI::newDelegate(this, &RaceDialog::onHeadRotate);
// Set up next/previous buttons
MyGUI::ButtonPtr prevButton, nextButton;
@@ -42,27 +42,27 @@ RaceDialog::RaceDialog(WindowManager& parWindowManager)
setText("GenderChoiceT", mWindowManager.getGameSettingString("sRaceMenu2", "Change Sex"));
getWidget(prevButton, "PrevGenderButton");
getWidget(nextButton, "NextGenderButton");
- prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousGender);
- nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextGender);
+ prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousGender);
+ nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextGender);
setText("FaceChoiceT", mWindowManager.getGameSettingString("sRaceMenu3", "Change Face"));
getWidget(prevButton, "PrevFaceButton");
getWidget(nextButton, "NextFaceButton");
- prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousFace);
- nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextFace);
+ prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousFace);
+ nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextFace);
setText("HairChoiceT", mWindowManager.getGameSettingString("sRaceMenu3", "Change Hair"));
getWidget(prevButton, "PrevHairButton");
getWidget(nextButton, "NextHairButton");
- prevButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousHair);
- nextButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onSelectNextHair);
+ prevButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectPreviousHair);
+ nextButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onSelectNextHair);
setText("RaceT", mWindowManager.getGameSettingString("sRaceMenu4", "Race"));
getWidget(raceList, "RaceList");
raceList->setScrollVisible(true);
- raceList->eventListSelectAccept = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
- raceList->eventListMouseItemActivate = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
- raceList->eventListChangePosition = MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
+ raceList->eventListSelectAccept += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
+ raceList->eventListMouseItemActivate += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
+ raceList->eventListChangePosition += MyGUI::newDelegate(this, &RaceDialog::onSelectRace);
setText("SkillsT", mWindowManager.getGameSettingString("sBonusSkillTitle", "Skill Bonus"));
getWidget(skillList, "SkillList");
@@ -72,11 +72,11 @@ RaceDialog::RaceDialog(WindowManager& parWindowManager)
// TODO: These buttons should be managed by a Dialog class
MyGUI::ButtonPtr backButton;
getWidget(backButton, "BackButton");
- backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onBackClicked);
+ backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onBackClicked);
MyGUI::ButtonPtr okButton;
getWidget(okButton, "OKButton");
- okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &RaceDialog::onOkClicked);
+ okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &RaceDialog::onOkClicked);
updateRaces();
updateSkills();
@@ -157,7 +157,7 @@ void RaceDialog::onBackClicked(MyGUI::Widget* _sender)
eventBack();
}
-void RaceDialog::onHeadRotate(MyGUI::VScroll*, size_t _position)
+void RaceDialog::onHeadRotate(MyGUI::ScrollBar*, size_t _position)
{
// TODO: Rotate head
}
@@ -192,7 +192,7 @@ void RaceDialog::onSelectNextHair(MyGUI::Widget*)
hairIndex = wrap(hairIndex - 1, hairCount);
}
-void RaceDialog::onSelectRace(MyGUI::List* _sender, size_t _index)
+void RaceDialog::onSelectRace(MyGUI::ListBox* _sender, size_t _index)
{
if (_index == MyGUI::ITEM_NONE)
return;
diff --git a/apps/openmw/mwgui/race.hpp b/apps/openmw/mwgui/race.hpp
index f2aac3a18..bcd3b5185 100644
--- a/apps/openmw/mwgui/race.hpp
+++ b/apps/openmw/mwgui/race.hpp
@@ -46,7 +46,7 @@ namespace MWGui
void open();
// Events
- typedef delegates::CDelegate0 EventHandle_Void;
+ typedef delegates::CMultiDelegate0 EventHandle_Void;
/** Event : Back button clicked.\n
signature : void method()\n
@@ -54,7 +54,7 @@ namespace MWGui
EventHandle_Void eventBack;
protected:
- void onHeadRotate(MyGUI::VScroll* _sender, size_t _position);
+ void onHeadRotate(MyGUI::ScrollBar* _sender, size_t _position);
void onSelectPreviousGender(MyGUI::Widget* _sender);
void onSelectNextGender(MyGUI::Widget* _sender);
@@ -65,7 +65,7 @@ namespace MWGui
void onSelectPreviousHair(MyGUI::Widget* _sender);
void onSelectNextHair(MyGUI::Widget* _sender);
- void onSelectRace(MyGUI::List* _sender, size_t _index);
+ void onSelectRace(MyGUI::ListBox* _sender, size_t _index);
void onOkClicked(MyGUI::Widget* _sender);
void onBackClicked(MyGUI::Widget* _sender);
@@ -76,8 +76,8 @@ namespace MWGui
void updateSpellPowers();
MyGUI::CanvasPtr appearanceBox;
- MyGUI::ListPtr raceList;
- MyGUI::HScrollPtr headRotate;
+ MyGUI::ListBox* raceList;
+ MyGUI::ScrollBar* headRotate;
MyGUI::WidgetPtr skillList;
std::vector skillItems;
diff --git a/apps/openmw/mwgui/review.cpp b/apps/openmw/mwgui/review.cpp
index e770ec235..cb0d9969c 100644
--- a/apps/openmw/mwgui/review.cpp
+++ b/apps/openmw/mwgui/review.cpp
@@ -28,22 +28,22 @@ ReviewDialog::ReviewDialog(WindowManager& parWindowManager)
getWidget(nameWidget, "NameText");
getWidget(button, "NameButton");
button->setCaption(mWindowManager.getGameSettingString("sName", ""));
- button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onNameClicked);;
+ button->eventMouseButtonClick += MyGUI::newDelegate(this, &ReviewDialog::onNameClicked);;
getWidget(raceWidget, "RaceText");
getWidget(button, "RaceButton");
button->setCaption(mWindowManager.getGameSettingString("sRace", ""));
- button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onRaceClicked);;
+ button->eventMouseButtonClick += MyGUI::newDelegate(this, &ReviewDialog::onRaceClicked);;
getWidget(classWidget, "ClassText");
getWidget(button, "ClassButton");
button->setCaption(mWindowManager.getGameSettingString("sClass", ""));
- button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onClassClicked);;
+ button->eventMouseButtonClick += MyGUI::newDelegate(this, &ReviewDialog::onClassClicked);;
getWidget(birthSignWidget, "SignText");
getWidget(button, "SignButton");
button->setCaption(mWindowManager.getGameSettingString("sBirthSign", ""));
- button->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onBirthSignClicked);;
+ button->eventMouseButtonClick += MyGUI::newDelegate(this, &ReviewDialog::onBirthSignClicked);;
// Setup dynamic stats
getWidget(health, "Health");
@@ -75,25 +75,25 @@ ReviewDialog::ReviewDialog(WindowManager& parWindowManager)
getWidget(skillClientWidget, "SkillClient");
getWidget(skillScrollerWidget, "SkillScroller");
- skillScrollerWidget->eventScrollChangePosition = MyGUI::newDelegate(this, &ReviewDialog::onScrollChangePosition);
+ skillScrollerWidget->eventScrollChangePosition += MyGUI::newDelegate(this, &ReviewDialog::onScrollChangePosition);
updateScroller();
for (int i = 0; i < ESM::Skill::Length; ++i)
{
skillValues.insert(std::make_pair(i, MWMechanics::Stat()));
- skillWidgetMap.insert(std::make_pair(i, static_cast (0)));
+ skillWidgetMap.insert(std::make_pair(i, static_cast (0)));
}
- static_cast(mMainWidget)->eventWindowChangeCoord = MyGUI::newDelegate(this, &ReviewDialog::onWindowResize);
+ static_cast(mMainWidget)->eventWindowChangeCoord += MyGUI::newDelegate(this, &ReviewDialog::onWindowResize);
// TODO: These buttons should be managed by a Dialog class
MyGUI::ButtonPtr backButton;
getWidget(backButton, "BackButton");
- backButton->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onBackClicked);
+ backButton->eventMouseButtonClick += MyGUI::newDelegate(this, &ReviewDialog::onBackClicked);
MyGUI::ButtonPtr okButton;
getWidget(okButton, "OKButton");
- okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &ReviewDialog::onOkClicked);
+ okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &ReviewDialog::onOkClicked);
}
void ReviewDialog::open()
@@ -102,7 +102,7 @@ void ReviewDialog::open()
setVisible(true);
}
-void ReviewDialog::onScrollChangePosition(MyGUI::VScrollPtr scroller, size_t pos)
+void ReviewDialog::onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos)
{
int diff = lastPos - pos;
// Adjust position of all widget according to difference
@@ -176,7 +176,7 @@ void ReviewDialog::setAttribute(ESM::Attribute::AttributeID attributeId, const M
void ReviewDialog::setSkillValue(ESM::Skill::SkillEnum skillId, const MWMechanics::Stat& value)
{
skillValues[skillId] = value;
- MyGUI::StaticTextPtr widget = skillWidgetMap[skillId];
+ MyGUI::TextBox* widget = skillWidgetMap[skillId];
if (widget)
{
float modified = value.getModified(), base = value.getBase();
@@ -210,7 +210,7 @@ void ReviewDialog::configureSkills(const std::vector& major, const std::vec
}
}
-void ReviewDialog::setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style, const std::string &value)
+void ReviewDialog::setStyledText(MyGUI::TextBox* widget, ColorStyle style, const std::string &value)
{
widget->setCaption(value);
if (style == CS_Super)
@@ -223,7 +223,7 @@ void ReviewDialog::setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style,
void ReviewDialog::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
{
- MyGUI::StaticImagePtr separator = skillClientWidget->createWidget("MW_HLine", MyGUI::IntCoord(10, coord1.top, coord1.width + coord2.width - 4, 18), MyGUI::Align::Default);
+ MyGUI::ImageBox* separator = skillClientWidget->createWidget("MW_HLine", MyGUI::IntCoord(10, coord1.top, coord1.width + coord2.width - 4, 18), MyGUI::Align::Default);
skillWidgets.push_back(separator);
coord1.top += separator->getHeight();
@@ -232,7 +232,7 @@ void ReviewDialog::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2
void ReviewDialog::addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
{
- MyGUI::StaticTextPtr groupWidget = skillClientWidget->createWidget("SandBrightText", MyGUI::IntCoord(0, coord1.top, coord1.width + coord2.width, coord1.height), MyGUI::Align::Default);
+ MyGUI::TextBox* groupWidget = skillClientWidget->createWidget("SandBrightText", MyGUI::IntCoord(0, coord1.top, coord1.width + coord2.width, coord1.height), MyGUI::Align::Default);
groupWidget->setCaption(label);
skillWidgets.push_back(groupWidget);
@@ -240,14 +240,15 @@ void ReviewDialog::addGroup(const std::string &label, MyGUI::IntCoord &coord1, M
coord2.top += lineHeight;
}
-MyGUI::StaticTextPtr ReviewDialog::addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
+MyGUI::TextBox* ReviewDialog::addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
{
- MyGUI::StaticTextPtr skillNameWidget, skillValueWidget;
+ MyGUI::TextBox* skillNameWidget;
+ MyGUI::TextBox* skillValueWidget;
- skillNameWidget = skillClientWidget->createWidget("SandText", coord1, MyGUI::Align::Default);
+ skillNameWidget = skillClientWidget->createWidget("SandText", coord1, MyGUI::Align::Default);
skillNameWidget->setCaption(text);
- skillValueWidget = skillClientWidget->createWidget("SandTextRight", coord2, MyGUI::Align::Default);
+ skillValueWidget = skillClientWidget->createWidget("SandTextRight", coord2, MyGUI::Align::Default);
setStyledText(skillValueWidget, style, value);
skillWidgets.push_back(skillNameWidget);
@@ -261,9 +262,9 @@ MyGUI::StaticTextPtr ReviewDialog::addValueItem(const std::string text, const st
void ReviewDialog::addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
{
- MyGUI::StaticTextPtr skillNameWidget;
+ MyGUI::TextBox* skillNameWidget;
- skillNameWidget = skillClientWidget->createWidget("SandText", coord1 + MyGUI::IntSize(coord2.width, 0), MyGUI::Align::Default);
+ skillNameWidget = skillClientWidget->createWidget("SandText", coord1 + MyGUI::IntSize(coord2.width, 0), MyGUI::Align::Default);
skillNameWidget->setCaption(text);
skillWidgets.push_back(skillNameWidget);
@@ -299,7 +300,7 @@ void ReviewDialog::addSkills(const SkillList &skills, const std::string &titleId
style = CS_Super;
else if (modified < base)
style = CS_Sub;
- MyGUI::StaticTextPtr widget = addValueItem(mWindowManager.getGameSettingString(skillNameId, skillNameId), boost::lexical_cast(static_cast(modified)), style, coord1, coord2);
+ MyGUI::TextBox* widget = addValueItem(mWindowManager.getGameSettingString(skillNameId, skillNameId), boost::lexical_cast(static_cast(modified)), style, coord1, coord2);
skillWidgetMap[skillId] = widget;
}
}
diff --git a/apps/openmw/mwgui/review.hpp b/apps/openmw/mwgui/review.hpp
index 5846804f7..588c1b6b5 100644
--- a/apps/openmw/mwgui/review.hpp
+++ b/apps/openmw/mwgui/review.hpp
@@ -49,8 +49,8 @@ namespace MWGui
void open();
// Events
- typedef delegates::CDelegate0 EventHandle_Void;
- typedef delegates::CDelegate1 EventHandle_Int;
+ typedef delegates::CMultiDelegate0 EventHandle_Void;
+ typedef delegates::CMultiDelegate1 EventHandle_Int;
/** Event : Back button clicked.\n
signature : void method()\n
@@ -75,23 +75,23 @@ namespace MWGui
CS_Normal,
CS_Super
};
- void setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style, const std::string &value);
+ void setStyledText(MyGUI::TextBox* widget, ColorStyle style, const std::string &value);
void addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
void addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
void addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
- MyGUI::StaticTextPtr addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
+ MyGUI::TextBox* addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
void addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
void updateScroller();
void updateSkillArea();
- void onScrollChangePosition(MyGUI::VScrollPtr scroller, size_t pos);
+ void onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos);
void onWindowResize(MyGUI::Window* window);
static const int lineHeight;
- MyGUI::StaticTextPtr nameWidget, raceWidget, classWidget, birthSignWidget;
+ MyGUI::TextBox *nameWidget, *raceWidget, *classWidget, *birthSignWidget;
MyGUI::WidgetPtr skillAreaWidget, skillClientWidget;
- MyGUI::VScrollPtr skillScrollerWidget;
+ MyGUI::ScrollBar* skillScrollerWidget;
int lastPos, clientHeight;
Widgets::MWDynamicStatPtr health, magicka, fatigue;
@@ -100,7 +100,7 @@ namespace MWGui
SkillList majorSkills, minorSkills, miscSkills;
std::map > skillValues;
- std::map skillWidgetMap;
+ std::map skillWidgetMap;
std::string name, raceId, birthSignId;
ESM::Class klass;
std::vector skillWidgets; //< Skills and other information
diff --git a/apps/openmw/mwgui/stats_window.cpp b/apps/openmw/mwgui/stats_window.cpp
index 30a4015e3..243b6272a 100644
--- a/apps/openmw/mwgui/stats_window.cpp
+++ b/apps/openmw/mwgui/stats_window.cpp
@@ -48,20 +48,20 @@ StatsWindow::StatsWindow (WindowManager& parWindowManager)
getWidget(skillClientWidget, "SkillClient");
getWidget(skillScrollerWidget, "SkillScroller");
- skillScrollerWidget->eventScrollChangePosition = MyGUI::newDelegate(this, &StatsWindow::onScrollChangePosition);
+ skillScrollerWidget->eventScrollChangePosition += MyGUI::newDelegate(this, &StatsWindow::onScrollChangePosition);
updateScroller();
for (int i = 0; i < ESM::Skill::Length; ++i)
{
skillValues.insert(std::pair >(i, MWMechanics::Stat()));
- skillWidgetMap.insert(std::pair(i, nullptr));
+ skillWidgetMap.insert(std::pair(i, nullptr));
}
MyGUI::WindowPtr t = static_cast(mMainWidget);
- t->eventWindowChangeCoord = MyGUI::newDelegate(this, &StatsWindow::onWindowResize);
+ t->eventWindowChangeCoord += MyGUI::newDelegate(this, &StatsWindow::onWindowResize);
}
-void StatsWindow::onScrollChangePosition(MyGUI::VScrollPtr scroller, size_t pos)
+void StatsWindow::onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos)
{
int diff = lastPos - pos;
// Adjust position of all widget according to difference
@@ -95,10 +95,10 @@ void StatsWindow::setBar(const std::string& name, const std::string& tname, int
void StatsWindow::setPlayerName(const std::string& playerName)
{
- mMainWidget->setCaption(playerName);
+ static_cast(mMainWidget)->setCaption(playerName);
}
-void StatsWindow::setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style, const std::string &value)
+void StatsWindow::setStyledText(MyGUI::TextBox* widget, ColorStyle style, const std::string &value)
{
widget->setCaption(value);
if (style == CS_Super)
@@ -175,7 +175,7 @@ void StatsWindow::setValue (const std::string& id, int value)
void StatsWindow::setValue(const ESM::Skill::SkillEnum parSkill, const MWMechanics::Stat& value)
{
skillValues[parSkill] = value;
- MyGUI::StaticTextPtr widget = skillWidgetMap[(int)parSkill];
+ MyGUI::TextBox* widget = skillWidgetMap[(int)parSkill];
if (widget)
{
float modified = value.getModified(), base = value.getBase();
@@ -221,7 +221,7 @@ void StatsWindow::setBirthSign (const std::string& signId)
void StatsWindow::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
{
- MyGUI::StaticImagePtr separator = skillClientWidget->createWidget("MW_HLine", MyGUI::IntCoord(10, coord1.top, coord1.width + coord2.width - 4, 18), MyGUI::Align::Default);
+ MyGUI::ImageBox* separator = skillClientWidget->createWidget("MW_HLine", MyGUI::IntCoord(10, coord1.top, coord1.width + coord2.width - 4, 18), MyGUI::Align::Default);
skillWidgets.push_back(separator);
coord1.top += separator->getHeight();
@@ -230,7 +230,7 @@ void StatsWindow::addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
void StatsWindow::addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
{
- MyGUI::StaticTextPtr groupWidget = skillClientWidget->createWidget("SandBrightText", MyGUI::IntCoord(0, coord1.top, coord1.width + coord2.width, coord1.height), MyGUI::Align::Default);
+ MyGUI::TextBox* groupWidget = skillClientWidget->createWidget("SandBrightText", MyGUI::IntCoord(0, coord1.top, coord1.width + coord2.width, coord1.height), MyGUI::Align::Default);
groupWidget->setCaption(label);
skillWidgets.push_back(groupWidget);
@@ -238,14 +238,14 @@ void StatsWindow::addGroup(const std::string &label, MyGUI::IntCoord &coord1, My
coord2.top += lineHeight;
}
-MyGUI::StaticTextPtr StatsWindow::addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
+MyGUI::TextBox* StatsWindow::addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
{
- MyGUI::StaticTextPtr skillNameWidget, skillValueWidget;
+ MyGUI::TextBox *skillNameWidget, *skillValueWidget;
- skillNameWidget = skillClientWidget->createWidget("SandText", coord1, MyGUI::Align::Default);
+ skillNameWidget = skillClientWidget->createWidget("SandText", coord1, MyGUI::Align::Default);
skillNameWidget->setCaption(text);
- skillValueWidget = skillClientWidget->createWidget("SandTextRight", coord2, MyGUI::Align::Default);
+ skillValueWidget = skillClientWidget->createWidget("SandTextRight", coord2, MyGUI::Align::Default);
setStyledText(skillValueWidget, style, value);
skillWidgets.push_back(skillNameWidget);
@@ -259,9 +259,9 @@ MyGUI::StaticTextPtr StatsWindow::addValueItem(const std::string text, const std
void StatsWindow::addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
{
- MyGUI::StaticTextPtr skillNameWidget;
+ MyGUI::TextBox* skillNameWidget;
- skillNameWidget = skillClientWidget->createWidget("SandText", coord1 + MyGUI::IntSize(coord2.width, 0), MyGUI::Align::Default);
+ skillNameWidget = skillClientWidget->createWidget("SandText", coord1 + MyGUI::IntSize(coord2.width, 0), MyGUI::Align::Default);
skillNameWidget->setCaption(text);
skillWidgets.push_back(skillNameWidget);
@@ -297,7 +297,7 @@ void StatsWindow::addSkills(const SkillList &skills, const std::string &titleId,
style = CS_Super;
else if (modified < base)
style = CS_Sub;
- MyGUI::StaticTextPtr widget = addValueItem(mWindowManager.getGameSettingString(skillNameId, skillNameId), boost::lexical_cast(static_cast(modified)), style, coord1, coord2);
+ MyGUI::TextBox* widget = addValueItem(mWindowManager.getGameSettingString(skillNameId, skillNameId), boost::lexical_cast(static_cast(modified)), style, coord1, coord2);
skillWidgetMap[skillId] = widget;
}
}
diff --git a/apps/openmw/mwgui/stats_window.hpp b/apps/openmw/mwgui/stats_window.hpp
index 9db5c240b..2ff170f57 100644
--- a/apps/openmw/mwgui/stats_window.hpp
+++ b/apps/openmw/mwgui/stats_window.hpp
@@ -49,26 +49,26 @@ namespace MWGui
CS_Normal,
CS_Super
};
- void setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style, const std::string &value);
+ void setStyledText(MyGUI::TextBox* widget, ColorStyle style, const std::string &value);
void addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
void addSeparator(MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
void addGroup(const std::string &label, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
- MyGUI::StaticTextPtr addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
+ MyGUI::TextBox* addValueItem(const std::string text, const std::string &value, ColorStyle style, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
void addItem(const std::string text, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
void updateScroller();
- void onScrollChangePosition(MyGUI::VScrollPtr scroller, size_t pos);
+ void onScrollChangePosition(MyGUI::ScrollBar* scroller, size_t pos);
void onWindowResize(MyGUI::Window* window);
static const int lineHeight;
MyGUI::WidgetPtr skillAreaWidget, skillClientWidget;
- MyGUI::VScrollPtr skillScrollerWidget;
+ MyGUI::ScrollBar* skillScrollerWidget;
int lastPos, clientHeight;
SkillList majorSkills, minorSkills, miscSkills;
std::map > skillValues;
- std::map skillWidgetMap;
+ std::map skillWidgetMap;
std::map factionWidgetMap;
FactionList factions; ///< Stores a list of factions and the current rank
std::string birthSignId;
diff --git a/apps/openmw/mwgui/text_input.cpp b/apps/openmw/mwgui/text_input.cpp
index 83ebef657..8ac07e766 100644
--- a/apps/openmw/mwgui/text_input.cpp
+++ b/apps/openmw/mwgui/text_input.cpp
@@ -10,12 +10,12 @@ TextInputDialog::TextInputDialog(WindowManager& parWindowManager)
center();
getWidget(textEdit, "TextEdit");
- textEdit->eventEditSelectAccept = newDelegate(this, &TextInputDialog::onTextAccepted);
+ textEdit->eventEditSelectAccept += newDelegate(this, &TextInputDialog::onTextAccepted);
// TODO: These buttons should be managed by a Dialog class
MyGUI::ButtonPtr okButton;
getWidget(okButton, "OKButton");
- okButton->eventMouseButtonClick = MyGUI::newDelegate(this, &TextInputDialog::onOkClicked);
+ okButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TextInputDialog::onOkClicked);
// Make sure the edit box has focus
MyGUI::InputManager::getInstance().setKeyFocusWidget(textEdit);
diff --git a/apps/openmw/mwgui/widgets.cpp b/apps/openmw/mwgui/widgets.cpp
index f62da2bab..74603aaf1 100644
--- a/apps/openmw/mwgui/widgets.cpp
+++ b/apps/openmw/mwgui/widgets.cpp
@@ -62,24 +62,24 @@ void MWSkill::updateWidgets()
{
if (skillId == ESM::Skill::Length)
{
- skillNameWidget->setCaption("");
+ static_cast(skillNameWidget)->setCaption("");
}
else
{
const std::string &name = manager->getGameSettingString(ESM::Skill::sSkillNameIds[skillId], "");
- skillNameWidget->setCaption(name);
+ static_cast(skillNameWidget)->setCaption(name);
}
}
if (skillValueWidget)
{
SkillValue::Type modified = value.getModified(), base = value.getBase();
- skillValueWidget->setCaption(boost::lexical_cast(modified));
+ static_cast(skillValueWidget)->setCaption(boost::lexical_cast(modified));
if (modified > base)
- skillValueWidget->setState("increased");
+ skillValueWidget->_setWidgetState("increased");
else if (modified < base)
- skillValueWidget->setState("decreased");
+ skillValueWidget->_setWidgetState("decreased");
else
- skillValueWidget->setState("normal");
+ skillValueWidget->_setWidgetState("normal");
}
}
@@ -88,59 +88,32 @@ void MWSkill::onClicked(MyGUI::Widget* _sender)
eventClicked(this);
}
-void MWSkill::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
-{
- Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
-
- initialiseWidgetSkin(_info);
-}
-
MWSkill::~MWSkill()
{
- shutdownWidgetSkin();
}
-void MWSkill::baseChangeWidgetSkin(ResourceSkin* _info)
+void MWSkill::initialiseOverride()
{
- shutdownWidgetSkin();
- Base::baseChangeWidgetSkin(_info);
- initialiseWidgetSkin(_info);
-}
+ Base::initialiseOverride();
-void MWSkill::initialiseWidgetSkin(ResourceSkin* _info)
-{
- for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
+ assignWidget(skillNameWidget, "StatName");
+ assignWidget(skillValueWidget, "StatValue");
+
+ MyGUI::ButtonPtr button;
+ assignWidget(button, "StatNameButton");
+ if (button)
{
- const std::string &name = *(*iter)->_getInternalData();
- if (name == "StatName")
- {
- MYGUI_DEBUG_ASSERT( ! skillNameWidget, "widget already assigned");
- skillNameWidget = (*iter)->castType();
- }
- else if (name == "StatValue")
- {
- MYGUI_DEBUG_ASSERT( ! skillValueWidget, "widget already assigned");
- skillValueWidget = (*iter)->castType();
- }
- else if (name == "StatNameButton")
- {
- MYGUI_DEBUG_ASSERT( ! skillNameWidget, "widget already assigned");
- MyGUI::ButtonPtr button = (*iter)->castType();
- skillNameWidget = button;
- button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWSkill::onClicked);
- }
- else if (name == "StatValueButton")
- {
- MYGUI_DEBUG_ASSERT( ! skillValueWidget, "widget already assigned");
- MyGUI::ButtonPtr button = (*iter)->castType();
- skillNameWidget = button;
- button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWSkill::onClicked);
- }
+ skillNameWidget = button;
+ button->eventMouseButtonClick += MyGUI::newDelegate(this, &MWSkill::onClicked);
}
-}
-void MWSkill::shutdownWidgetSkin()
-{
+ button = 0;
+ assignWidget(button, "StatValueButton");
+ if (button)
+ {
+ skillNameWidget = button;
+ button->eventMouseButtonClick += MyGUI::newDelegate(this, &MWSkill::onClicked);
+ }
}
/* MWAttribute */
@@ -176,7 +149,7 @@ void MWAttribute::updateWidgets()
{
if (id < 0 || id >= 8)
{
- attributeNameWidget->setCaption("");
+ static_cast(attributeNameWidget)->setCaption("");
}
else
{
@@ -191,75 +164,48 @@ void MWAttribute::updateWidgets()
"sAttributeLuck"
};
const std::string &name = manager->getGameSettingString(attributes[id], "");
- attributeNameWidget->setCaption(name);
+ static_cast(attributeNameWidget)->setCaption(name);
}
}
if (attributeValueWidget)
{
AttributeValue::Type modified = value.getModified(), base = value.getBase();
- attributeValueWidget->setCaption(boost::lexical_cast(modified));
+ static_cast(attributeValueWidget)->setCaption(boost::lexical_cast(modified));
if (modified > base)
- attributeValueWidget->setState("increased");
+ attributeValueWidget->_setWidgetState("increased");
else if (modified < base)
- attributeValueWidget->setState("decreased");
+ attributeValueWidget->_setWidgetState("decreased");
else
- attributeValueWidget->setState("normal");
+ attributeValueWidget->_setWidgetState("normal");
}
}
-void MWAttribute::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
-{
- Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
-
- initialiseWidgetSkin(_info);
-}
-
MWAttribute::~MWAttribute()
{
- shutdownWidgetSkin();
}
-void MWAttribute::baseChangeWidgetSkin(ResourceSkin* _info)
+void MWAttribute::initialiseOverride()
{
- shutdownWidgetSkin();
- Base::baseChangeWidgetSkin(_info);
- initialiseWidgetSkin(_info);
-}
+ Base::initialiseOverride();
-void MWAttribute::initialiseWidgetSkin(ResourceSkin* _info)
-{
- for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
+ assignWidget(attributeNameWidget, "StatName");
+ assignWidget(attributeValueWidget, "StatValue");
+
+ MyGUI::ButtonPtr button;
+ assignWidget(button, "StatNameButton");
+ if (button)
{
- const std::string &name = *(*iter)->_getInternalData();
- if (name == "StatName")
- {
- MYGUI_DEBUG_ASSERT( ! attributeNameWidget, "widget already assigned");
- attributeNameWidget = (*iter)->castType();
- }
- else if (name == "StatValue")
- {
- MYGUI_DEBUG_ASSERT( ! attributeValueWidget, "widget already assigned");
- attributeValueWidget = (*iter)->castType();
- }
- else if (name == "StatNameButton")
- {
- MYGUI_DEBUG_ASSERT( ! attributeNameWidget, "widget already assigned");
- MyGUI::ButtonPtr button = (*iter)->castType();
- attributeNameWidget = button;
- button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWAttribute::onClicked);
- }
- else if (name == "StatValue")
- {
- MYGUI_DEBUG_ASSERT( ! attributeValueWidget, "widget already assigned");
- MyGUI::ButtonPtr button = (*iter)->castType();
- attributeNameWidget = button;
- button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWAttribute::onClicked);
- }
+ attributeNameWidget = button;
+ button->eventMouseButtonClick += MyGUI::newDelegate(this, &MWAttribute::onClicked);
}
-}
-void MWAttribute::shutdownWidgetSkin()
-{
+ button = 0;
+ assignWidget(button, "StatValueButton");
+ if (button)
+ {
+ attributeValueWidget = button;
+ button->eventMouseButtonClick += MyGUI::newDelegate(this, &MWAttribute::onClicked);
+ }
}
/* MWSpell */
@@ -301,45 +247,20 @@ void MWSpell::updateWidgets()
const ESMS::ESMStore &store = mWindowManager->getStore();
const ESM::Spell *spell = store.spells.search(id);
if (spell)
- spellNameWidget->setCaption(spell->name);
+ static_cast(spellNameWidget)->setCaption(spell->name);
else
- spellNameWidget->setCaption("");
+ static_cast(spellNameWidget)->setCaption("");
}
}
-void MWSpell::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
+void MWSpell::initialiseOverride()
{
- Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
+ Base::initialiseOverride();
- initialiseWidgetSkin(_info);
+ assignWidget(spellNameWidget, "StatName");
}
MWSpell::~MWSpell()
-{
- shutdownWidgetSkin();
-}
-
-void MWSpell::baseChangeWidgetSkin(ResourceSkin* _info)
-{
- shutdownWidgetSkin();
- Base::baseChangeWidgetSkin(_info);
- initialiseWidgetSkin(_info);
-}
-
-void MWSpell::initialiseWidgetSkin(ResourceSkin* _info)
-{
- for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
- {
- const std::string &name = *(*iter)->_getInternalData();
- if (name == "StatName")
- {
- MYGUI_DEBUG_ASSERT( ! spellNameWidget, "widget already assigned");
- spellNameWidget = (*iter)->castType();
- }
- }
-}
-
-void MWSpell::shutdownWidgetSkin()
{
}
@@ -408,10 +329,10 @@ void MWSpellEffect::updateWidgets()
spellLine += " on Touch";
else if (effect.range == ESM::RT_Target)
spellLine += " on Target";
- textWidget->setCaption(spellLine);
+ static_cast(textWidget)->setCaption(spellLine);
}
else
- textWidget->setCaption("");
+ static_cast(textWidget)->setCaption("");
}
if (imageWidget)
{
@@ -421,45 +342,16 @@ void MWSpellEffect::updateWidgets()
}
}
-void MWSpellEffect::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
-{
- Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
-
- initialiseWidgetSkin(_info);
-}
-
MWSpellEffect::~MWSpellEffect()
{
- shutdownWidgetSkin();
}
-void MWSpellEffect::baseChangeWidgetSkin(ResourceSkin* _info)
+void MWSpellEffect::initialiseOverride()
{
- shutdownWidgetSkin();
- Base::baseChangeWidgetSkin(_info);
- initialiseWidgetSkin(_info);
-}
+ Base::initialiseOverride();
-void MWSpellEffect::initialiseWidgetSkin(ResourceSkin* _info)
-{
- for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
- {
- const std::string &name = *(*iter)->_getInternalData();
- if (name == "Text")
- {
- MYGUI_DEBUG_ASSERT( ! textWidget, "widget already assigned");
- textWidget = (*iter)->castType();
- }
- else if (name == "Image")
- {
- MYGUI_DEBUG_ASSERT( ! imageWidget, "widget already assigned");
- imageWidget = (*iter)->castType();
- }
- }
-}
-
-void MWSpellEffect::shutdownWidgetSkin()
-{
+ assignWidget(textWidget, "Text");
+ assignWidget(imageWidget, "Image");
}
/* MWDynamicStat */
@@ -491,60 +383,27 @@ void MWDynamicStat::setValue(int cur, int max_)
{
std::stringstream out;
out << value << "/" << max;
- barTextWidget->setCaption(out.str().c_str());
+ static_cast(barTextWidget)->setCaption(out.str().c_str());
}
else
- barTextWidget->setCaption("");
+ static_cast(barTextWidget)->setCaption("");
}
}
void MWDynamicStat::setTitle(const std::string text)
{
if (textWidget)
- textWidget->setCaption(text);
-}
-
-void MWDynamicStat::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
-{
- Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
-
- initialiseWidgetSkin(_info);
+ static_cast(textWidget)->setCaption(text);
}
MWDynamicStat::~MWDynamicStat()
{
- shutdownWidgetSkin();
-}
-
-void MWDynamicStat::baseChangeWidgetSkin(ResourceSkin* _info)
-{
- shutdownWidgetSkin();
- Base::baseChangeWidgetSkin(_info);
- initialiseWidgetSkin(_info);
}
-void MWDynamicStat::initialiseWidgetSkin(ResourceSkin* _info)
+void MWDynamicStat::initialiseOverride()
{
- for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
- {
- const std::string &name = *(*iter)->_getInternalData();
- if (name == "Text")
- {
- MYGUI_DEBUG_ASSERT( ! textWidget, "widget already assigned");
- textWidget = (*iter)->castType();
- }
- else if (name == "Bar")
- {
- MYGUI_DEBUG_ASSERT( ! barWidget, "widget already assigned");
- barWidget = (*iter)->castType();
- }
- else if (name == "BarText")
- {
- MYGUI_DEBUG_ASSERT( ! barTextWidget, "widget already assigned");
- barTextWidget = (*iter)->castType();
- }
- }
-}
+ Base::initialiseOverride();
-void MWDynamicStat::shutdownWidgetSkin()
-{
+ assignWidget(textWidget, "Text");
+ assignWidget(barWidget, "Bar");
+ assignWidget(barTextWidget, "BarText");
}
diff --git a/apps/openmw/mwgui/widgets.hpp b/apps/openmw/mwgui/widgets.hpp
index cba8fefd3..4d31ad521 100644
--- a/apps/openmw/mwgui/widgets.hpp
+++ b/apps/openmw/mwgui/widgets.hpp
@@ -38,26 +38,21 @@ namespace MWGui
const SkillValue& getSkillValue() const { return value; }
// Events
- typedef delegates::CDelegate1 EventHandle_SkillVoid;
+ typedef delegates::CMultiDelegate1 EventHandle_SkillVoid;
/** Event : Skill clicked.\n
signature : void method(MWSkill* _sender)\n
*/
EventHandle_SkillVoid eventClicked;
- /*internal:*/
- virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
-
protected:
virtual ~MWSkill();
- void baseChangeWidgetSkin(ResourceSkin* _info);
+ virtual void initialiseOverride();
void onClicked(MyGUI::Widget* _sender);
private:
- void initialiseWidgetSkin(ResourceSkin* _info);
- void shutdownWidgetSkin();
void updateWidgets();
@@ -85,26 +80,21 @@ namespace MWGui
const AttributeValue& getAttributeValue() const { return value; }
// Events
- typedef delegates::CDelegate1 EventHandle_AttributeVoid;
+ typedef delegates::CMultiDelegate1 EventHandle_AttributeVoid;
/** Event : Attribute clicked.\n
signature : void method(MWAttribute* _sender)\n
*/
EventHandle_AttributeVoid eventClicked;
- /*internal:*/
- virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
-
protected:
virtual ~MWAttribute();
- void baseChangeWidgetSkin(ResourceSkin* _info);
+ virtual void initialiseOverride();
void onClicked(MyGUI::Widget* _sender);
private:
- void initialiseWidgetSkin(ResourceSkin* _info);
- void shutdownWidgetSkin();
void updateWidgets();
@@ -130,23 +120,17 @@ namespace MWGui
const std::string &getSpellId() const { return id; }
- /*internal:*/
- virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
-
protected:
virtual ~MWSpell();
- void baseChangeWidgetSkin(ResourceSkin* _info);
+ virtual void initialiseOverride();
private:
- void initialiseWidgetSkin(ResourceSkin* _info);
- void shutdownWidgetSkin();
-
void updateWidgets();
WindowManager* mWindowManager;
std::string id;
- MyGUI::StaticTextPtr spellNameWidget;
+ MyGUI::TextBox* spellNameWidget;
};
typedef MWSpell* MWSpellPtr;
@@ -163,24 +147,19 @@ namespace MWGui
const SpellEffectValue &getSpellEffect() const { return effect; }
- /*internal:*/
- virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
-
protected:
virtual ~MWSpellEffect();
- void baseChangeWidgetSkin(ResourceSkin* _info);
-
+ virtual void initialiseOverride();
+
private:
- void initialiseWidgetSkin(ResourceSkin* _info);
- void shutdownWidgetSkin();
void updateWidgets();
WindowManager* mWindowManager;
SpellEffectValue effect;
- MyGUI::StaticImagePtr imageWidget;
- MyGUI::StaticTextPtr textWidget;
+ MyGUI::ImageBox* imageWidget;
+ MyGUI::TextBox* textWidget;
};
typedef MWSpellEffect* MWSpellEffectPtr;
@@ -196,22 +175,17 @@ namespace MWGui
int getValue() const { return value; }
int getMax() const { return max; }
- /*internal:*/
- virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
-
protected:
virtual ~MWDynamicStat();
- void baseChangeWidgetSkin(ResourceSkin* _info);
+ virtual void initialiseOverride();
private:
- void initialiseWidgetSkin(ResourceSkin* _info);
- void shutdownWidgetSkin();
int value, max;
- MyGUI::StaticTextPtr textWidget;
+ MyGUI::TextBox* textWidget;
MyGUI::ProgressPtr barWidget;
- MyGUI::StaticTextPtr barTextWidget;
+ MyGUI::TextBox* barTextWidget;
};
typedef MWDynamicStat* MWDynamicStatPtr;
diff --git a/apps/openmw/mwgui/window_base.cpp b/apps/openmw/mwgui/window_base.cpp
index 192dcd988..1eb126a74 100644
--- a/apps/openmw/mwgui/window_base.cpp
+++ b/apps/openmw/mwgui/window_base.cpp
@@ -16,7 +16,7 @@ void WindowBase::open()
void WindowBase::center()
{
// Centre dialog
- MyGUI::IntSize gameWindowSize = mWindowManager.getGui()->getViewSize();
+ MyGUI::IntSize gameWindowSize = MyGUI::RenderManager::getInstance().getViewSize();
MyGUI::IntCoord coord = mMainWidget->getCoord();
coord.left = (gameWindowSize.width - coord.width)/2;
coord.top = (gameWindowSize.height - coord.height)/2;
diff --git a/apps/openmw/mwgui/window_base.hpp b/apps/openmw/mwgui/window_base.hpp
index 84fb601e3..99ddbe918 100644
--- a/apps/openmw/mwgui/window_base.hpp
+++ b/apps/openmw/mwgui/window_base.hpp
@@ -13,7 +13,7 @@ namespace MWGui
WindowBase(const std::string& parLayout, WindowManager& parWindowManager);
// Events
- typedef MyGUI::delegates::CDelegate1 EventHandle_WindowBase;
+ typedef MyGUI::delegates::CMultiDelegate1 EventHandle_WindowBase;
virtual void open();
void center();
diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp
index aca9fbd9a..8ac4b11d7 100644
--- a/apps/openmw/mwgui/window_manager.cpp
+++ b/apps/openmw/mwgui/window_manager.cpp
@@ -37,12 +37,12 @@ WindowManager::WindowManager(MWWorld::Environment& environment,
gui = mGuiManager->getGui();
//Register own widgets with MyGUI
- MyGUI::FactoryManager::getInstance().registerFactory("Widget");
+ MyGUI::FactoryManager::getInstance().registerFactory("Widget");
// Get size info from the Gui object
assert(gui);
- int w = gui->getViewSize().width;
- int h = gui->getViewSize().height;
+ int w = MyGUI::RenderManager::getInstance().getViewSize().width;
+ int h = MyGUI::RenderManager::getInstance().getViewSize().height;
hud = new HUD(w,h, showFPSLevel);
menu = new MainMenu(w,h);
@@ -51,6 +51,7 @@ WindowManager::WindowManager(MWWorld::Environment& environment,
console = new Console(w,h, environment, extensions);
mJournal = new JournalWindow(*this);
mMessageBoxManager = new MessageBoxManager(this);
+ dialogueWindow = new DialogueWindow(*this,environment);
// The HUD is always on
hud->setVisible(true);
@@ -149,9 +150,10 @@ void WindowManager::updateVisible()
stats->setVisible(false);
console->disable();
mJournal->setVisible(false);
+ dialogueWindow->setVisible(false);
// Mouse is visible whenever we're not in game mode
- gui->setVisiblePointer(isGuiMode());
+ MyGUI::PointerManager::getInstance().setVisible(isGuiMode());
// If in game mode, don't show anything.
if(mode == GM_Game) //Use a switch/case structure
@@ -195,11 +197,6 @@ void WindowManager::updateVisible()
if (mode == GM_Dialogue)
{
- if (!dialogueWindow)
- {
- dialogueWindow = new DialogueWindow(*this);
- dialogueWindow->eventBye = MyGUI::newDelegate(this, &WindowManager::onDialogueWindowBye);
- }
dialogueWindow->open();
return;
}
@@ -349,6 +346,7 @@ void WindowManager::updateSkillArea()
void WindowManager::removeDialog(OEngine::GUI::Layout*dialog)
{
+ std::cout << "dialogue a la poubelle";
assert(dialog);
if (!dialog)
return;
@@ -387,7 +385,8 @@ void WindowManager::onDialogueWindowBye()
if (dialogueWindow)
{
//FIXME set some state and stuff?
- removeDialog(dialogueWindow);
+ //removeDialog(dialogueWindow);
+ dialogueWindow->setVisible(false);
}
setGuiMode(GM_Game);
}
diff --git a/apps/openmw/mwgui/window_manager.hpp b/apps/openmw/mwgui/window_manager.hpp
index 89ff4b9bb..0124c9239 100644
--- a/apps/openmw/mwgui/window_manager.hpp
+++ b/apps/openmw/mwgui/window_manager.hpp
@@ -124,6 +124,8 @@ namespace MWGui
updateVisible();
}
+ MWGui::DialogueWindow* getDialogueWindow() {return dialogueWindow;}
+
MyGUI::Gui* getGui() const { return gui; }
void wmUpdateFps(float fps, size_t triangleCount, size_t batchCount)
diff --git a/apps/openmw/mwscript/dialogueextensions.cpp b/apps/openmw/mwscript/dialogueextensions.cpp
index c2ff9ed8b..0cca028e2 100644
--- a/apps/openmw/mwscript/dialogueextensions.cpp
+++ b/apps/openmw/mwscript/dialogueextensions.cpp
@@ -8,6 +8,7 @@
#include
#include "../mwdialogue/journal.hpp"
+#include "../mwdialogue/dialoguemanager.hpp"
#include "interpretercontext.hpp"
@@ -72,15 +73,62 @@ namespace MWScript
}
};
+ class OpAddTopic : public Interpreter::Opcode0
+ {
+ public:
+
+ virtual void execute (Interpreter::Runtime& runtime)
+ {
+ MWScript::InterpreterContext& context
+ = static_cast (runtime.getContext());
+
+ std::string topic = runtime.getStringLiteral (runtime[0].mInteger);
+ runtime.pop();
+
+ context.getEnvironment().mDialogueManager->addTopic(topic);
+ }
+ };
+
+ class OpChoice : public Interpreter::Opcode1
+ {
+ public:
+
+ virtual void execute (Interpreter::Runtime& runtime, unsigned int arg0)
+ {
+ MWScript::InterpreterContext& context
+ = static_cast (runtime.getContext());
+ MWDialogue::DialogueManager* dialogue = context.getEnvironment().mDialogueManager;
+ while(arg0>0)
+ {
+ std::string question = runtime.getStringLiteral (runtime[0].mInteger);
+ runtime.pop();
+ arg0 = arg0 -1;
+ Interpreter::Type_Integer choice = 1;
+ if(arg0>0)
+ {
+ choice = runtime[0].mInteger;
+ runtime.pop();
+ arg0 = arg0 -1;
+ }
+ dialogue->askQuestion(question,choice);
+ }
+ }
+ };
+
+
const int opcodeJournal = 0x2000133;
const int opcodeSetJournalIndex = 0x2000134;
const int opcodeGetJournalIndex = 0x2000135;
+ const int opcodeAddTopic = 0x200013a;
+ const int opcodeChoice = 0x2000a;
void registerExtensions (Compiler::Extensions& extensions)
{
extensions.registerInstruction ("journal", "cl", opcodeJournal);
extensions.registerInstruction ("setjournalindex", "cl", opcodeSetJournalIndex);
extensions.registerFunction ("getjournalindex", 'l', "c", opcodeGetJournalIndex);
+ extensions.registerInstruction ("addtopic", "S" , opcodeAddTopic);
+ extensions.registerInstruction ("choice", "/SlSlSlSlSlSlSlSlSlSlSlSlSlSlSlSl", opcodeChoice);
}
void installOpcodes (Interpreter::Interpreter& interpreter)
@@ -88,6 +136,8 @@ namespace MWScript
interpreter.installSegment5 (opcodeJournal, new OpJournal);
interpreter.installSegment5 (opcodeSetJournalIndex, new OpSetJournalIndex);
interpreter.installSegment5 (opcodeGetJournalIndex, new OpGetJournalIndex);
+ interpreter.installSegment5 (opcodeAddTopic, new OpAddTopic);
+ interpreter.installSegment3 (opcodeChoice,new OpChoice);
}
}
diff --git a/apps/openmw/mwscript/docs/vmformat.txt b/apps/openmw/mwscript/docs/vmformat.txt
index 09b0c0482..eab5bf846 100644
--- a/apps/openmw/mwscript/docs/vmformat.txt
+++ b/apps/openmw/mwscript/docs/vmformat.txt
@@ -23,7 +23,8 @@ op 0x20006: PlayAnim
op 0x20007: PlayAnim, explicit reference
op 0x20008: LoopAnim
op 0x20009: LoopAnim, explicit reference
-opcodes 0x2000a-0x3ffff unused
+op 0x2000a: Choice
+opcodes 0x2000b-0x3ffff unused
Segment 4:
(not implemented yet)
@@ -115,6 +116,7 @@ op 0x2000136: GetPCCell
op 0x2000137: GetButtonPressed
op 0x2000138: SkipAnim
op 0x2000139: SkipAnim, expplicit reference
+op 0x200013a: AddTopic
op 0x200013b: twf
op 0x200013c: FadeIn
op 0x200013d: FadeOut
diff --git a/apps/openmw/mwscript/scriptmanager.cpp b/apps/openmw/mwscript/scriptmanager.cpp
index 5fcfcc605..e93f2deec 100644
--- a/apps/openmw/mwscript/scriptmanager.cpp
+++ b/apps/openmw/mwscript/scriptmanager.cpp
@@ -63,7 +63,7 @@ namespace MWScript
{
std::vector code;
mParser.getCode (code);
- mScripts.insert (std::make_pair (name, code));
+ mScripts.insert (std::make_pair (name, std::make_pair (code, mParser.getLocals())));
// TODO sanity check on generated locals
@@ -77,8 +77,7 @@ namespace MWScript
void ScriptManager::run (const std::string& name, Interpreter::Context& interpreterContext)
{
// compile script
- std::map >::iterator iter =
- mScripts.find (name);
+ ScriptCollection::iterator iter = mScripts.find (name);
if (iter==mScripts.end())
{
@@ -86,7 +85,7 @@ namespace MWScript
{
// failed -> ignore script from now on.
std::vector empty;
- mScripts.insert (std::make_pair (name, empty));
+ mScripts.insert (std::make_pair (name, std::make_pair (empty, Compiler::Locals())));
return;
}
@@ -95,7 +94,7 @@ namespace MWScript
}
// execute script
- if (!iter->second.empty())
+ if (!iter->second.first.empty())
try
{
if (!mOpcodesInstalled)
@@ -104,7 +103,7 @@ namespace MWScript
mOpcodesInstalled = true;
}
- mInterpreter.run (&iter->second[0], iter->second.size(), interpreterContext);
+ mInterpreter.run (&iter->second.first[0], iter->second.first.size(), interpreterContext);
}
catch (const std::exception& e)
{
@@ -113,7 +112,7 @@ namespace MWScript
if (mVerbose)
std::cerr << "(" << e.what() << ")" << std::endl;
- iter->second.clear(); // don't execute again.
+ iter->second.first.clear(); // don't execute again.
}
}
@@ -132,4 +131,24 @@ namespace MWScript
return std::make_pair (count, success);
}
+
+ Compiler::Locals& ScriptManager::getLocals (const std::string& name)
+ {
+ ScriptCollection::iterator iter = mScripts.find (name);
+
+ if (iter==mScripts.end())
+ {
+ if (!compile (name))
+ {
+ // failed -> ignore script from now on.
+ std::vector empty;
+ mScripts.insert (std::make_pair (name, std::make_pair (empty, Compiler::Locals())));
+ throw std::runtime_error ("failed to compile script " + name);
+ }
+
+ iter = mScripts.find (name);
+ }
+
+ return iter->second.second;
+ }
}
diff --git a/apps/openmw/mwscript/scriptmanager.hpp b/apps/openmw/mwscript/scriptmanager.hpp
index 74511f456..35cbc0d1e 100644
--- a/apps/openmw/mwscript/scriptmanager.hpp
+++ b/apps/openmw/mwscript/scriptmanager.hpp
@@ -39,7 +39,11 @@ namespace MWScript
Interpreter::Interpreter mInterpreter;
bool mOpcodesInstalled;
- std::map > mScripts;
+ typedef std::pair, Compiler::Locals> CompiledScript;
+ typedef std::map ScriptCollection;
+
+
+ ScriptCollection mScripts;
public:
@@ -56,6 +60,9 @@ namespace MWScript
std::pair compileAll();
///< Compile all scripts
/// \return count, success
+
+ Compiler::Locals& getLocals (const std::string& name);
+ ///< Return locals for script \a name.
};
};
diff --git a/apps/openmw/mwworld/containerstore.cpp b/apps/openmw/mwworld/containerstore.cpp
index c498cabce..2800b6f3c 100644
--- a/apps/openmw/mwworld/containerstore.cpp
+++ b/apps/openmw/mwworld/containerstore.cpp
@@ -8,6 +8,29 @@
#include
#include "manualref.hpp"
+#include "refdata.hpp"
+
+namespace
+{
+ template
+ float getTotalWeight (const ESMS::CellRefList& cellRefList)
+ {
+ float sum = 0;
+
+ for (typename ESMS::CellRefList::List::const_iterator iter (
+ cellRefList.list.begin());
+ iter!=cellRefList.list.end();
+ ++iter)
+ {
+ if (iter->mData.getCount()>0)
+ sum += iter->mData.getCount()*iter->base->data.weight;
+ }
+
+ return sum;
+ }
+}
+
+MWWorld::ContainerStore::ContainerStore() : mStateId (0), mCachedWeight (0), mWeightUpToDate (false) {}
MWWorld::ContainerStore::~ContainerStore() {}
@@ -40,6 +63,8 @@ void MWWorld::ContainerStore::add (const Ptr& ptr)
case Type_Repair: repairs.list.push_back (*ptr.get()); break;
case Type_Weapon: weapons.list.push_back (*ptr.get()); break;
}
+
+ flagAsModified();
}
void MWWorld::ContainerStore::fill (const ESM::InventoryList& items, const ESMS::ESMStore& store)
@@ -58,6 +83,8 @@ void MWWorld::ContainerStore::fill (const ESM::InventoryList& items, const ESMS:
ref.getPtr().getRefData().setCount (iter->count);
add (ref.getPtr());
}
+
+ flagAsModified();
}
void MWWorld::ContainerStore::clear()
@@ -74,6 +101,44 @@ void MWWorld::ContainerStore::clear()
probes.list.clear();
repairs.list.clear();
weapons.list.clear();
+
+ flagAsModified();
+}
+
+void MWWorld::ContainerStore::flagAsModified()
+{
+ ++mStateId;
+ mWeightUpToDate = false;
+}
+
+int MWWorld::ContainerStore::getStateId() const
+{
+ return mStateId;
+}
+
+float MWWorld::ContainerStore::getWeight() const
+{
+ if (!mWeightUpToDate)
+ {
+ mCachedWeight = 0;
+
+ mCachedWeight += getTotalWeight (potions);
+ mCachedWeight += getTotalWeight (appas);
+ mCachedWeight += getTotalWeight (armors);
+ mCachedWeight += getTotalWeight (books);
+ mCachedWeight += getTotalWeight (clothes);
+ mCachedWeight += getTotalWeight (ingreds);
+ mCachedWeight += getTotalWeight (lights);
+ mCachedWeight += getTotalWeight (lockpicks);
+ mCachedWeight += getTotalWeight (miscItems);
+ mCachedWeight += getTotalWeight (probes);
+ mCachedWeight += getTotalWeight (repairs);
+ mCachedWeight += getTotalWeight (weapons);
+
+ mWeightUpToDate = true;
+ }
+
+ return mCachedWeight;
}
int MWWorld::ContainerStore::getType (const Ptr& ptr)
@@ -301,23 +366,30 @@ MWWorld::Ptr *MWWorld::ContainerStoreIterator::operator->() const
MWWorld::Ptr MWWorld::ContainerStoreIterator::operator*() const
{
+ Ptr ptr;
+
switch (mType)
{
- case ContainerStore::Type_Potion: return MWWorld::Ptr (&*mPotion, 0);
- case ContainerStore::Type_Apparatus: return MWWorld::Ptr (&*mApparatus, 0);
- case ContainerStore::Type_Armor: return MWWorld::Ptr (&*mArmor, 0);
- case ContainerStore::Type_Book: return MWWorld::Ptr (&*mBook, 0);
- case ContainerStore::Type_Clothing: return MWWorld::Ptr (&*mClothing, 0);
- case ContainerStore::Type_Ingredient: return MWWorld::Ptr (&*mIngredient, 0);
- case ContainerStore::Type_Light: return MWWorld::Ptr (&*mLight, 0);
- case ContainerStore::Type_Lockpick: return MWWorld::Ptr (&*mLockpick, 0);
- case ContainerStore::Type_Miscellaneous: return MWWorld::Ptr (&*mMiscellaneous, 0);
- case ContainerStore::Type_Probe: return MWWorld::Ptr (&*mProbe, 0);
- case ContainerStore::Type_Repair: return MWWorld::Ptr (&*mRepair, 0);
- case ContainerStore::Type_Weapon: return MWWorld::Ptr (&*mWeapon, 0);
+ case ContainerStore::Type_Potion: ptr = MWWorld::Ptr (&*mPotion, 0); break;
+ case ContainerStore::Type_Apparatus: ptr = MWWorld::Ptr (&*mApparatus, 0); break;
+ case ContainerStore::Type_Armor: ptr = MWWorld::Ptr (&*mArmor, 0); break;
+ case ContainerStore::Type_Book: ptr = MWWorld::Ptr (&*mBook, 0); break;
+ case ContainerStore::Type_Clothing: ptr = MWWorld::Ptr (&*mClothing, 0); break;
+ case ContainerStore::Type_Ingredient: ptr = MWWorld::Ptr (&*mIngredient, 0); break;
+ case ContainerStore::Type_Light: ptr = MWWorld::Ptr (&*mLight, 0); break;
+ case ContainerStore::Type_Lockpick: ptr = MWWorld::Ptr (&*mLockpick, 0); break;
+ case ContainerStore::Type_Miscellaneous: ptr = MWWorld::Ptr (&*mMiscellaneous, 0); break;
+ case ContainerStore::Type_Probe: ptr = MWWorld::Ptr (&*mProbe, 0); break;
+ case ContainerStore::Type_Repair: ptr = MWWorld::Ptr (&*mRepair, 0); break;
+ case ContainerStore::Type_Weapon: ptr = MWWorld::Ptr (&*mWeapon, 0); break;
}
- throw std::runtime_error ("invalid pointer");
+ if (ptr.isEmpty())
+ throw std::runtime_error ("invalid iterator");
+
+ ptr.setContainerStore (mContainer);
+
+ return ptr;
}
MWWorld::ContainerStoreIterator& MWWorld::ContainerStoreIterator::operator++()
diff --git a/apps/openmw/mwworld/containerstore.hpp b/apps/openmw/mwworld/containerstore.hpp
index 69e5ba446..da5424fe0 100644
--- a/apps/openmw/mwworld/containerstore.hpp
+++ b/apps/openmw/mwworld/containerstore.hpp
@@ -52,9 +52,14 @@ namespace MWWorld
ESMS::CellRefList probes;
ESMS::CellRefList repairs;
ESMS::CellRefList weapons;
+ int mStateId;
+ mutable float mCachedWeight;
+ mutable bool mWeightUpToDate;
public:
+ ContainerStore();
+
virtual ~ContainerStore();
ContainerStoreIterator begin (int mask = Type_All);
@@ -75,6 +80,18 @@ namespace MWWorld
void clear();
///< Empty container.
+ void flagAsModified();
+ ///< \attention This function is internal to the world model and should not be called from
+ /// outside.
+
+ int getStateId() const;
+ ///< This ID is changed every time the container is modified or items in the container
+ /// are accessed in a way that may be used to modify the item.
+ /// \note This method of change-tracking will ocasionally yield false positives.
+
+ float getWeight() const;
+ ///< Return total weight of the items contained in *this.
+
static int getType (const Ptr& ptr);
///< This function throws an exception, if ptr does not point to an object, that can be
/// put into a container.
diff --git a/apps/openmw/mwworld/environment.hpp b/apps/openmw/mwworld/environment.hpp
index a403ee165..3a83f886f 100644
--- a/apps/openmw/mwworld/environment.hpp
+++ b/apps/openmw/mwworld/environment.hpp
@@ -9,6 +9,7 @@ namespace MWSound
namespace MWScript
{
class GlobalScripts;
+ class ScriptManager;
}
namespace MWGui
@@ -41,7 +42,7 @@ namespace MWWorld
{
public:
Environment()
- : mWorld (0), mSoundManager (0), mGlobalScripts (0), mWindowManager (0),
+ : mWorld (0), mSoundManager (0), mGlobalScripts (0), mScriptManager (0), mWindowManager (0),
mMechanicsManager (0), mDialogueManager (0), mJournal (0), mFrameDuration (0),
mInputManager (0)
{}
@@ -49,6 +50,7 @@ namespace MWWorld
World *mWorld;
MWSound::SoundManager *mSoundManager;
MWScript::GlobalScripts *mGlobalScripts;
+ MWScript::ScriptManager *mScriptManager;
MWGui::WindowManager *mWindowManager;
MWMechanics::MechanicsManager *mMechanicsManager;
MWDialogue::DialogueManager *mDialogueManager;
diff --git a/apps/openmw/mwworld/inventorystore.cpp b/apps/openmw/mwworld/inventorystore.cpp
index 264be7bb3..e64c9785f 100644
--- a/apps/openmw/mwworld/inventorystore.cpp
+++ b/apps/openmw/mwworld/inventorystore.cpp
@@ -65,6 +65,8 @@ void MWWorld::InventoryStore::equip (int slot, const ContainerStoreIterator& ite
/// \todo unstack item pointed to by iterator if required)
mSlots[slot] = iterator;
+
+ flagAsModified();
}
MWWorld::ContainerStoreIterator MWWorld::InventoryStore::getSlot (int slot)
diff --git a/apps/openmw/mwworld/ptr.cpp b/apps/openmw/mwworld/ptr.cpp
new file mode 100644
index 000000000..7c0010c04
--- /dev/null
+++ b/apps/openmw/mwworld/ptr.cpp
@@ -0,0 +1,39 @@
+
+#include "ptr.hpp"
+
+#include
+
+#include "containerstore.hpp"
+
+ESM::CellRef& MWWorld::Ptr::getCellRef() const
+{
+ assert (mCellRef);
+
+ if (mContainerStore)
+ mContainerStore->flagAsModified();
+
+ return *mCellRef;
+}
+
+MWWorld::RefData& MWWorld::Ptr::getRefData() const
+{
+ assert (mRefData);
+
+ if (mContainerStore)
+ mContainerStore->flagAsModified();
+
+ return *mRefData;
+}
+
+void MWWorld::Ptr::setContainerStore (ContainerStore *store)
+{
+ assert (store);
+ assert (!mCell);
+
+ mContainerStore = store;
+}
+
+MWWorld::ContainerStore *MWWorld::Ptr::getContainerStore() const
+{
+ return mContainerStore;
+}
diff --git a/apps/openmw/mwworld/ptr.hpp b/apps/openmw/mwworld/ptr.hpp
index 389c9349d..c31c53122 100644
--- a/apps/openmw/mwworld/ptr.hpp
+++ b/apps/openmw/mwworld/ptr.hpp
@@ -13,6 +13,8 @@
namespace MWWorld
{
+ class ContainerStore;
+
/// \brief Pointer to a LiveCellRef
class Ptr
@@ -26,10 +28,11 @@ namespace MWWorld
RefData *mRefData;
CellStore *mCell;
std::string mTypeName;
+ ContainerStore *mContainerStore;
public:
- Ptr() : mCellRef (0), mRefData (0), mCell (0) {}
+ Ptr() : mCellRef (0), mRefData (0), mCell (0), mContainerStore (0) {}
bool isEmpty() const
{
@@ -49,6 +52,7 @@ namespace MWWorld
template
Ptr (ESMS::LiveCellRef *liveCellRef, CellStore *cell)
+ : mContainerStore (0)
{
mPtr = liveCellRef;
mCellRef = &liveCellRef->ref;
@@ -63,23 +67,21 @@ namespace MWWorld
return boost::any_cast*> (mPtr);
}
- ESM::CellRef& getCellRef() const
- {
- assert (mCellRef);
- return *mCellRef;
- }
+ ESM::CellRef& getCellRef() const;
- RefData& getRefData() const
- {
- assert (mRefData);
- return *mRefData;
- }
+ RefData& getRefData() const;
Ptr::CellStore *getCell() const
{
assert (mCell);
return mCell;
}
+
+ void setContainerStore (ContainerStore *store);
+ ///< Must not be called on references that are in a cell.
+
+ ContainerStore *getContainerStore() const;
+ ///< May return a 0-pointer, if reference is not in a container.
};
inline bool operator== (const Ptr& left, const Ptr& right)
diff --git a/apps/openmw/mwworld/weather.cpp b/apps/openmw/mwworld/weather.cpp
index ccbca52db..9a918c2fb 100644
--- a/apps/openmw/mwworld/weather.cpp
+++ b/apps/openmw/mwworld/weather.cpp
@@ -21,9 +21,13 @@ const std::string WeatherGlobals::mThunderSoundID0 = "Thunder0";
const std::string WeatherGlobals::mThunderSoundID1 = "Thunder1";
const std::string WeatherGlobals::mThunderSoundID2 = "Thunder2";
const std::string WeatherGlobals::mThunderSoundID3 = "Thunder3";
-
+const float WeatherGlobals::mSunriseTime = 8;
+const float WeatherGlobals::mSunsetTime = 18;
+const float WeatherGlobals::mSunriseDuration = 2;
+const float WeatherGlobals::mSunsetDuration = 2;
const float WeatherGlobals::mWeatherUpdateTime = 20.f;
+
// morrowind sets these per-weather, but since they are only used by 'thunderstorm'
// weather setting anyway, we can just as well set them globally
const float WeatherGlobals::mThunderFrequency = .4;
@@ -267,7 +271,8 @@ WeatherManager::WeatherManager(MWRender::RenderingManager* rendering, Environmen
blight.mGlareView = 0;
blight.mAmbientLoopSoundID = "blight";
mWeatherSettings["blight"] = blight;
-
+
+ /*
Weather snow;
snow.mCloudTexture = "tx_bm_sky_snow.dds";
snow.mCloudsMaximumPercent = 1.0;
@@ -324,6 +329,7 @@ WeatherManager::WeatherManager(MWRender::RenderingManager* rendering, Environmen
blizzard.mGlareView = 0;
blizzard.mAmbientLoopSoundID = "BM Blizzard";
mWeatherSettings["blizzard"] = blizzard;
+ */
}
void WeatherManager::setWeather(const String& weather, bool instant)
@@ -505,32 +511,32 @@ void WeatherManager::update(float duration)
float thunder = region->data.thunder/255.f;
float ash = region->data.ash/255.f;
float blight = region->data.blight/255.f;
- float snow = region->data.a/255.f;
- float blizzard = region->data.b/255.f;
+ //float snow = region->data.a/255.f;
+ //float blizzard = region->data.b/255.f;
// re-scale to 100 percent
- const float total = clear+cloudy+foggy+overcast+rain+thunder+ash+blight+snow+blizzard;
+ const float total = clear+cloudy+foggy+overcast+rain+thunder+ash+blight;//+snow+blizzard;
srand(time(NULL));
float random = ((rand()%100)/100.f) * total;
- if (random >= snow+blight+ash+thunder+rain+overcast+foggy+cloudy+clear)
- weather = "blizzard";
- else if (random >= blight+ash+thunder+rain+overcast+foggy+cloudy+clear)
- weather = "snow";
- else if (random >= ash+thunder+rain+overcast+foggy+cloudy+clear)
+ //if (random > snow+blight+ash+thunder+rain+overcast+foggy+cloudy+clear)
+ // weather = "blizzard";
+ //else if (random > blight+ash+thunder+rain+overcast+foggy+cloudy+clear)
+ // weather = "snow";
+ /*else*/ if (random > ash+thunder+rain+overcast+foggy+cloudy+clear)
weather = "blight";
- else if (random >= thunder+rain+overcast+foggy+cloudy+clear)
+ else if (random > thunder+rain+overcast+foggy+cloudy+clear)
weather = "ashstorm";
- else if (random >= rain+overcast+foggy+cloudy+clear)
+ else if (random > rain+overcast+foggy+cloudy+clear)
weather = "thunderstorm";
- else if (random >= overcast+foggy+cloudy+clear)
+ else if (random > overcast+foggy+cloudy+clear)
weather = "rain";
- else if (random >= foggy+cloudy+clear)
+ else if (random > foggy+cloudy+clear)
weather = "overcast";
- else if (random >= cloudy+clear)
+ else if (random > cloudy+clear)
weather = "foggy";
- else if (random >= clear)
+ else if (random > clear)
weather = "cloudy";
else
weather = "clear";
diff --git a/cmake/FindMyGUI.cmake b/cmake/FindMyGUI.cmake
new file mode 100644
index 000000000..339f494dd
--- /dev/null
+++ b/cmake/FindMyGUI.cmake
@@ -0,0 +1,125 @@
+# - Find MyGUI includes and library
+#
+# This module defines
+# MYGUI_INCLUDE_DIRS
+# MYGUI_LIBRARIES, the libraries to link against to use MYGUI.
+# MYGUI_LIB_DIR, the location of the libraries
+# MYGUI_FOUND, If false, do not try to use MYGUI
+#
+# Copyright © 2007, Matt Williams
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+CMAKE_POLICY(PUSH)
+include(FindPkgMacros)
+
+# IF (MYGUI_LIBRARIES AND MYGUI_INCLUDE_DIRS)
+ # SET(MYGUI_FIND_QUIETLY TRUE)
+# ENDIF (MYGUI_LIBRARIES AND MYGUI_INCLUDE_DIRS)
+
+IF (WIN32) #Windows
+ MESSAGE(STATUS "Looking for MyGUI")
+ SET(MYGUISDK $ENV{MYGUI_HOME})
+ IF (MYGUISDK)
+ findpkg_begin ( "MYGUI" )
+ MESSAGE(STATUS "Using MyGUI in OGRE SDK")
+ STRING(REGEX REPLACE "[\\]" "/" MYGUISDK "${MYGUISDK}" )
+
+ find_path ( MYGUI_INCLUDE_DIRS
+ MyGUI.h
+ "${MYGUISDK}/MyGUIEngine/include"
+ NO_DEFAULT_PATH )
+
+ find_path ( MYGUI_PLATFORM_INCLUDE_DIRS
+ MyGUI_OgrePlatform.h
+ "${MYGUISDK}/Platforms/Ogre/OgrePlatform/include"
+ NO_DEFAULT_PATH )
+
+ SET ( MYGUI_LIB_DIR ${MYGUISDK}/*/lib )
+
+ find_library ( MYGUI_LIBRARIES_REL NAMES
+ MyGUIEngine.lib
+ MyGUI.OgrePlatform.lib
+ HINTS
+ ${MYGUI_LIB_DIR}
+ PATH_SUFFIXES "" release relwithdebinfo minsizerel )
+
+ find_library ( MYGUI_LIBRARIES_DBG NAMES
+ MyGUIEngine_d.lib
+ MyGUI.OgrePlatform_d.lib
+ HINTS
+ ${MYGUI_LIB_DIR}
+ PATH_SUFFIXES "" debug )
+
+ find_library ( MYGUI_PLATFORM_LIBRARIES_REL NAMES
+ MyGUI.OgrePlatform.lib
+ HINTS
+ ${MYGUI_LIB_DIR}
+ PATH_SUFFIXES "" release relwithdebinfo minsizerel )
+
+ find_library ( MYGUI_PLATFORM_LIBRARIES_DBG NAMES
+ MyGUI.OgrePlatform_d.lib
+ HINTS
+ ${MYGUI_LIB_DIR}
+ PATH_SUFFIXES "" debug )
+
+ make_library_set ( MYGUI_LIBRARIES )
+ make_library_set ( MYGUI_PLATFORM_LIBRARIES )
+
+ MESSAGE ("${MYGUI_LIBRARIES}")
+ MESSAGE ("${MYGUI_PLATFORM_LIBRARIES}")
+
+ findpkg_finish ( "MYGUI" )
+
+ ENDIF (MYGUISDK)
+ IF (OGRESOURCE)
+ MESSAGE(STATUS "Using MyGUI in OGRE dependencies")
+ STRING(REGEX REPLACE "[\\]" "/" OGRESDK "${OGRESOURCE}" )
+ SET(MYGUI_INCLUDE_DIRS ${OGRESOURCE}/OgreMain/include/MYGUI)
+ SET(MYGUI_LIB_DIR ${OGRESOURCE}/lib)
+ SET(MYGUI_LIBRARIES debug Debug/MyGUIEngine_d optimized Release/MyGUIEngine)
+ ENDIF (OGRESOURCE)
+ELSE (WIN32) #Unix
+ CMAKE_MINIMUM_REQUIRED(VERSION 2.4.7 FATAL_ERROR)
+ FIND_PACKAGE(PkgConfig)
+ PKG_SEARCH_MODULE(MYGUI MYGUI MyGUI)
+ IF (MYGUI_INCLUDE_DIRS)
+ SET(MYGUI_INCLUDE_DIRS ${MYGUI_INCLUDE_DIRS})
+ SET(MYGUI_LIB_DIR ${MYGUI_LIBDIR})
+ SET(MYGUI_LIBRARIES ${MYGUI_LIBRARIES} CACHE STRING "")
+ ELSE (MYGUI_INCLUDE_DIRS)
+ FIND_PATH(MYGUI_INCLUDE_DIRS MyGUI.h PATHS /usr/local/include /usr/include PATH_SUFFIXES MyGUI MYGUI)
+ FIND_LIBRARY(MYGUI_LIBRARIES mygui PATHS /usr/lib /usr/local/lib)
+ SET(MYGUI_LIB_DIR ${MYGUI_LIBRARIES})
+ STRING(REGEX REPLACE "(.*)/.*" "\\1" MYGUI_LIB_DIR "${MYGUI_LIB_DIR}")
+ STRING(REGEX REPLACE ".*/" "" MYGUI_LIBRARIES "${MYGUI_LIBRARIES}")
+ ENDIF (MYGUI_INCLUDE_DIRS)
+ENDIF (WIN32)
+
+#Do some preparation
+SEPARATE_ARGUMENTS(MYGUI_INCLUDE_DIRS)
+SEPARATE_ARGUMENTS(MYGUI_LIBRARIES)
+SEPARATE_ARGUMENTS(MYGUI_PLATFORM_LIBRARIES)
+
+SET(MYGUI_INCLUDE_DIRS ${MYGUI_INCLUDE_DIRS} CACHE PATH "")
+SET(MYGUI_LIBRARIES ${MYGUI_LIBRARIES} CACHE STRING "")
+SET(MYGUI_LIBRARIES ${MYGUI_PLATFORM_LIBRARIES} CACHE STRING "")
+SET(MYGUI_LIB_DIR ${MYGUI_LIB_DIR} CACHE PATH "")
+
+IF (MYGUI_INCLUDE_DIRS AND MYGUI_LIBRARIES)
+ SET(MYGUI_FOUND TRUE)
+ENDIF (MYGUI_INCLUDE_DIRS AND MYGUI_LIBRARIES)
+
+IF (MYGUI_FOUND)
+ MARK_AS_ADVANCED(MYGUI_LIB_DIR)
+ IF (NOT MYGUI_FIND_QUIETLY)
+ MESSAGE(STATUS " libraries : ${MYGUI_LIBRARIES} from ${MYGUI_LIB_DIR}")
+ MESSAGE(STATUS " includes : ${MYGUI_INCLUDE_DIRS}")
+ ENDIF (NOT MYGUI_FIND_QUIETLY)
+ELSE (MYGUI_FOUND)
+ IF (MYGUI_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find MYGUI")
+ ENDIF (MYGUI_FIND_REQUIRED)
+ENDIF (MYGUI_FOUND)
+
+CMAKE_POLICY(POP)
\ No newline at end of file
diff --git a/components/compiler/exprparser.cpp b/components/compiler/exprparser.cpp
index 06c3207e2..95480c023 100644
--- a/components/compiler/exprparser.cpp
+++ b/components/compiler/exprparser.cpp
@@ -639,7 +639,7 @@ namespace Compiler
std::vector& code, bool invert)
{
bool optional = false;
- bool optionalCount = 0;
+ int optionalCount = 0;
ExprParser parser (getErrorHandler(), getContext(), mLocals, mLiterals, true);
StringParser stringParser (getErrorHandler(), getContext(), mLiterals);
diff --git a/components/compiler/scriptparser.cpp b/components/compiler/scriptparser.cpp
index ce142847f..ac0ee63f1 100644
--- a/components/compiler/scriptparser.cpp
+++ b/components/compiler/scriptparser.cpp
@@ -24,7 +24,7 @@ namespace Compiler
mLineParser.reset();
if (mLineParser.parseName (name, loc, scanner))
scanner.scan (mLineParser);
-
+
return true;
}
@@ -34,22 +34,22 @@ namespace Compiler
{
mControlParser.reset();
if (mControlParser.parseKeyword (keyword, loc, scanner))
- scanner.scan (mControlParser);
-
+ scanner.scan (mControlParser);
+
mControlParser.appendCode (mOutput.getCode());
-
+
return true;
}
-
+
if (keyword==Scanner::K_end && mEnd)
{
return false;
}
-
+
mLineParser.reset();
if (mLineParser.parseKeyword (keyword, loc, scanner))
scanner.scan (mLineParser);
-
+
return true;
}
@@ -57,11 +57,11 @@ namespace Compiler
{
if (code==Scanner::S_newline) // empty line
return true;
-
+
mLineParser.reset();
if (mLineParser.parseSpecial (code, loc, scanner))
scanner.scan (mLineParser);
-
+
return true;
}
@@ -77,4 +77,3 @@ namespace Compiler
mOutput.clear();
}
}
-
diff --git a/components/compiler/stringparser.cpp b/components/compiler/stringparser.cpp
index 396a88c78..fe7bd30b9 100644
--- a/components/compiler/stringparser.cpp
+++ b/components/compiler/stringparser.cpp
@@ -39,6 +39,11 @@ namespace Compiler
mState = CommaState;
return true;
}
+ else if (code==Scanner::S_newline && mState==StartState)
+ {
+ scanner.putbackSpecial (code, loc);
+ return false;
+ }
return Parser::parseSpecial (code, loc, scanner);
}
diff --git a/extern/mygui_3.0.1/COPYING.LESSER b/extern/mygui_3.0.1/COPYING.LESSER
deleted file mode 100644
index fc8a5de7e..000000000
--- a/extern/mygui_3.0.1/COPYING.LESSER
+++ /dev/null
@@ -1,165 +0,0 @@
- GNU LESSER GENERAL PUBLIC LICENSE
- Version 3, 29 June 2007
-
- Copyright (C) 2007 Free Software Foundation, Inc.
- Everyone is permitted to copy and distribute verbatim copies
- of this license document, but changing it is not allowed.
-
-
- This version of the GNU Lesser General Public License incorporates
-the terms and conditions of version 3 of the GNU General Public
-License, supplemented by the additional permissions listed below.
-
- 0. Additional Definitions.
-
- As used herein, "this License" refers to version 3 of the GNU Lesser
-General Public License, and the "GNU GPL" refers to version 3 of the GNU
-General Public License.
-
- "The Library" refers to a covered work governed by this License,
-other than an Application or a Combined Work as defined below.
-
- An "Application" is any work that makes use of an interface provided
-by the Library, but which is not otherwise based on the Library.
-Defining a subclass of a class defined by the Library is deemed a mode
-of using an interface provided by the Library.
-
- A "Combined Work" is a work produced by combining or linking an
-Application with the Library. The particular version of the Library
-with which the Combined Work was made is also called the "Linked
-Version".
-
- The "Minimal Corresponding Source" for a Combined Work means the
-Corresponding Source for the Combined Work, excluding any source code
-for portions of the Combined Work that, considered in isolation, are
-based on the Application, and not on the Linked Version.
-
- The "Corresponding Application Code" for a Combined Work means the
-object code and/or source code for the Application, including any data
-and utility programs needed for reproducing the Combined Work from the
-Application, but excluding the System Libraries of the Combined Work.
-
- 1. Exception to Section 3 of the GNU GPL.
-
- You may convey a covered work under sections 3 and 4 of this License
-without being bound by section 3 of the GNU GPL.
-
- 2. Conveying Modified Versions.
-
- If you modify a copy of the Library, and, in your modifications, a
-facility refers to a function or data to be supplied by an Application
-that uses the facility (other than as an argument passed when the
-facility is invoked), then you may convey a copy of the modified
-version:
-
- a) under this License, provided that you make a good faith effort to
- ensure that, in the event an Application does not supply the
- function or data, the facility still operates, and performs
- whatever part of its purpose remains meaningful, or
-
- b) under the GNU GPL, with none of the additional permissions of
- this License applicable to that copy.
-
- 3. Object Code Incorporating Material from Library Header Files.
-
- The object code form of an Application may incorporate material from
-a header file that is part of the Library. You may convey such object
-code under terms of your choice, provided that, if the incorporated
-material is not limited to numerical parameters, data structure
-layouts and accessors, or small macros, inline functions and templates
-(ten or fewer lines in length), you do both of the following:
-
- a) Give prominent notice with each copy of the object code that the
- Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the object code with a copy of the GNU GPL and this license
- document.
-
- 4. Combined Works.
-
- You may convey a Combined Work under terms of your choice that,
-taken together, effectively do not restrict modification of the
-portions of the Library contained in the Combined Work and reverse
-engineering for debugging such modifications, if you also do each of
-the following:
-
- a) Give prominent notice with each copy of the Combined Work that
- the Library is used in it and that the Library and its use are
- covered by this License.
-
- b) Accompany the Combined Work with a copy of the GNU GPL and this license
- document.
-
- c) For a Combined Work that displays copyright notices during
- execution, include the copyright notice for the Library among
- these notices, as well as a reference directing the user to the
- copies of the GNU GPL and this license document.
-
- d) Do one of the following:
-
- 0) Convey the Minimal Corresponding Source under the terms of this
- License, and the Corresponding Application Code in a form
- suitable for, and under terms that permit, the user to
- recombine or relink the Application with a modified version of
- the Linked Version to produce a modified Combined Work, in the
- manner specified by section 6 of the GNU GPL for conveying
- Corresponding Source.
-
- 1) Use a suitable shared library mechanism for linking with the
- Library. A suitable mechanism is one that (a) uses at run time
- a copy of the Library already present on the user's computer
- system, and (b) will operate properly with a modified version
- of the Library that is interface-compatible with the Linked
- Version.
-
- e) Provide Installation Information, but only if you would otherwise
- be required to provide such information under section 6 of the
- GNU GPL, and only to the extent that such information is
- necessary to install and execute a modified version of the
- Combined Work produced by recombining or relinking the
- Application with a modified version of the Linked Version. (If
- you use option 4d0, the Installation Information must accompany
- the Minimal Corresponding Source and Corresponding Application
- Code. If you use option 4d1, you must provide the Installation
- Information in the manner specified by section 6 of the GNU GPL
- for conveying Corresponding Source.)
-
- 5. Combined Libraries.
-
- You may place library facilities that are a work based on the
-Library side by side in a single library together with other library
-facilities that are not Applications and are not covered by this
-License, and convey such a combined library under terms of your
-choice, if you do both of the following:
-
- a) Accompany the combined library with a copy of the same work based
- on the Library, uncombined with any other library facilities,
- conveyed under the terms of this License.
-
- b) Give prominent notice with the combined library that part of it
- is a work based on the Library, and explaining where to find the
- accompanying uncombined form of the same work.
-
- 6. Revised Versions of the GNU Lesser General Public License.
-
- The Free Software Foundation may publish revised and/or new versions
-of the GNU Lesser General Public License from time to time. Such new
-versions will be similar in spirit to the present version, but may
-differ in detail to address new problems or concerns.
-
- Each version is given a distinguishing version number. If the
-Library as you received it specifies that a certain numbered version
-of the GNU Lesser General Public License "or any later version"
-applies to it, you have the option of following the terms and
-conditions either of that published version or of any later version
-published by the Free Software Foundation. If the Library as you
-received it does not specify a version number of the GNU Lesser
-General Public License, you may choose any version of the GNU Lesser
-General Public License ever published by the Free Software Foundation.
-
- If the Library as you received it specifies that a proxy can decide
-whether future versions of the GNU Lesser General Public License shall
-apply, that proxy's public statement of acceptance of any version is
-permanent authorization for you to choose that version for the
-Library.
diff --git a/extern/mygui_3.0.1/MyGUIEngine/CMakeLists.txt b/extern/mygui_3.0.1/MyGUIEngine/CMakeLists.txt
deleted file mode 100644
index 27362e027..000000000
--- a/extern/mygui_3.0.1/MyGUIEngine/CMakeLists.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-set (PROJECT_NAME MyGUIEngine)
-
-project( ${PROJECT_NAME} )
-
-include(${PROJECT_NAME}.list)
-
-include_directories(include)
-if (MYGUI_USE_FREETYPE)
- include_directories(
- ${FREETYPE_INCLUDE_DIRS}
- )
- add_definitions(-DMYGUI_USE_FREETYPE)
-endif ()
-
-add_definitions(-DMYGUI_BUILD)
-
-if (WIN32)
- add_definitions(-DNOMINMAX)
-endif ()
-
-add_library(${PROJECT_NAME} ${MYGUI_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES})
-if (MYGUI_USE_FREETYPE)
- target_link_libraries(${PROJECT_NAME}
- ${FREETYPE_LIBRARIES}
- )
-endif()
-
-# We don't need this lib in OS X. uuid functions is in libc here.
-if (NOT APPLE)
- target_link_libraries(${PROJECT_NAME} ${CMAKE_DL_LIBS} uuid)
-endif(NOT APPLE)
-
-if (MINGW)
- target_link_libraries(${PROJECT_NAME} libwinmm.a)
-endif (MINGW)
diff --git a/extern/mygui_3.0.1/MyGUIEngine/MyGUIEngine.list b/extern/mygui_3.0.1/MyGUIEngine/MyGUIEngine.list
deleted file mode 100644
index 42fa44718..000000000
--- a/extern/mygui_3.0.1/MyGUIEngine/MyGUIEngine.list
+++ /dev/null
@@ -1,561 +0,0 @@
-set (HEADER_FILES
- include/MyGUI_Allocator.h
- include/MyGUI_CustomAllocator.h
- include/MyGUI_DDItemInfo.h
- include/MyGUI_IBItemInfo.h
- include/MyGUI_MenuItemType.h
- include/MyGUI_MessageStyle.h
- include/MyGUI_WidgetToolTip.h
- include/MyGUI_Button.h
- include/MyGUI_Canvas.h
- include/MyGUI_ComboBox.h
- include/MyGUI_DDContainer.h
- include/MyGUI_Edit.h
- include/MyGUI_HScroll.h
- include/MyGUI_ItemBox.h
- include/MyGUI_List.h
- include/MyGUI_ListBox.h
- include/MyGUI_ListCtrl.h
- include/MyGUI_MenuBar.h
- include/MyGUI_MenuCtrl.h
- include/MyGUI_MenuItem.h
- include/MyGUI_Message.h
- include/MyGUI_MultiList.h
- include/MyGUI_PopupMenu.h
- include/MyGUI_Progress.h
- include/MyGUI_ScrollView.h
- include/MyGUI_StaticImage.h
- include/MyGUI_StaticText.h
- include/MyGUI_Tab.h
- include/MyGUI_TabItem.h
- include/MyGUI_VScroll.h
- include/MyGUI_Widget.h
- include/MyGUI_Window.h
- include/MyGUI_IWidgetFactory.h
- include/MyGUI_Bitwise.h
- include/MyGUI_CoordConverter.h
- include/MyGUI_DataFileStream.h
- include/MyGUI_DataStream.h
- include/MyGUI_Delegate.h
- include/MyGUI_DelegateImplement.h
- include/MyGUI_DynLib.h
- include/MyGUI_Enumerator.h
- include/MyGUI_EventPair.h
- include/MyGUI_Guid.h
- include/MyGUI_RenderOut.h
- include/MyGUI_TextChangeHistory.h
- include/MyGUI_TextIterator.h
- include/MyGUI_TextureUtility.h
- include/MyGUI_TextView.h
- include/MyGUI_Timer.h
- include/MyGUI_UString.h
- include/MyGUI_Utility.h
- include/MyGUI_WidgetTranslate.h
- include/MyGUI_XmlDocument.h
- include/MyGUI_LogManager.h
- include/MyGUI_LogStream.h
- include/MyGUI.h
- include/MyGUI_CastWidget.h
- include/MyGUI_Common.h
- include/MyGUI_Diagnostic.h
- include/MyGUI_Exception.h
- include/MyGUI_GenericFactory.h
- include/MyGUI_Macros.h
- include/MyGUI_Platform.h
- include/MyGUI_Precompiled.h
- include/MyGUI_Prerequest.h
- include/MyGUI_RenderFormat.h
- include/MyGUI_ResourceHolder.h
- include/MyGUI_WidgetDefines.h
- include/MyGUI_ICroppedRectangle.h
- include/MyGUI_IDataStream.h
- include/MyGUI_Instance.h
- include/MyGUI_IObject.h
- include/MyGUI_ISerializable.h
- include/MyGUI_ITexture.h
- include/MyGUI_IUnlinkWidget.h
- include/MyGUI_IVertexBuffer.h
- include/MyGUI_IWidgetCreator.h
- include/MyGUI_Plugin.h
- include/MyGUI_RTTI.h
- include/MyGUI_BiIndexBase.h
- include/MyGUI_ScrollViewBase.h
- include/MyGUI_WidgetEvent.h
- include/MyGUI_WidgetUserData.h
- include/MyGUI_EditText.h
- include/MyGUI_MainSkin.h
- include/MyGUI_RawRect.h
- include/MyGUI_RotatingSkin.h
- include/MyGUI_SimpleText.h
- include/MyGUI_SubSkin.h
- include/MyGUI_TileRect.h
- include/MyGUI_IStateInfo.h
- include/MyGUI_ISubWidget.h
- include/MyGUI_ISubWidgetRect.h
- include/MyGUI_ISubWidgetText.h
- include/MyGUI_LayerItem.h
- include/MyGUI_LayerNode.h
- include/MyGUI_OverlappedLayer.h
- include/MyGUI_RenderItem.h
- include/MyGUI_SharedLayer.h
- include/MyGUI_SharedLayerNode.h
- include/MyGUI_ILayer.h
- include/MyGUI_ILayerItem.h
- include/MyGUI_ILayerNode.h
- include/MyGUI_IRenderTarget.h
- include/MyGUI_ActionController.h
- include/MyGUI_ControllerEdgeHide.h
- include/MyGUI_ControllerFadeAlpha.h
- include/MyGUI_ControllerItem.h
- include/MyGUI_ControllerPosition.h
- include/MyGUI_ResourceImageSet.h
- include/MyGUI_ResourceImageSetPointer.h
- include/MyGUI_ResourceManualFont.h
- include/MyGUI_ResourceManualPointer.h
- include/MyGUI_ResourceSkin.h
- include/MyGUI_ResourceTrueTypeFont.h
- include/MyGUI_IFont.h
- include/MyGUI_IPointer.h
- include/MyGUI_IResource.h
- include/MyGUI_ChildSkinInfo.h
- include/MyGUI_FontData.h
- include/MyGUI_MaskPickInfo.h
- include/MyGUI_SubWidgetBinding.h
- include/MyGUI_SubWidgetInfo.h
- include/MyGUI_Align.h
- include/MyGUI_Any.h
- include/MyGUI_Colour.h
- include/MyGUI_CommonStateInfo.h
- include/MyGUI_ImageInfo.h
- include/MyGUI_InputDefine.h
- include/MyGUI_RenderTargetInfo.h
- include/MyGUI_TCoord.h
- include/MyGUI_TPoint.h
- include/MyGUI_TRect.h
- include/MyGUI_TSize.h
- include/MyGUI_Types.h
- include/MyGUI_Version.h
- include/MyGUI_VertexData.h
- include/MyGUI_WidgetStyle.h
- include/MyGUI_ClipboardManager.h
- include/MyGUI_ControllerManager.h
- include/MyGUI_DataManager.h
- include/MyGUI_DynLibManager.h
- include/MyGUI_FactoryManager.h
- include/MyGUI_FontManager.h
- include/MyGUI_Gui.h
- include/MyGUI_InputManager.h
- include/MyGUI_LanguageManager.h
- include/MyGUI_LayerManager.h
- include/MyGUI_LayoutManager.h
- include/MyGUI_PluginManager.h
- include/MyGUI_PointerManager.h
- include/MyGUI_RenderManager.h
- include/MyGUI_ResourceManager.h
- include/MyGUI_SkinManager.h
- include/MyGUI_SubWidgetManager.h
- include/MyGUI_WidgetManager.h
-)
-set (SOURCE_FILES
- src/MyGUI_Button.cpp
- src/MyGUI_Canvas.cpp
- src/MyGUI_ComboBox.cpp
- src/MyGUI_DDContainer.cpp
- src/MyGUI_Edit.cpp
- src/MyGUI_HScroll.cpp
- src/MyGUI_ItemBox.cpp
- src/MyGUI_List.cpp
- src/MyGUI_ListBox.cpp
- src/MyGUI_ListCtrl.cpp
- src/MyGUI_MenuBar.cpp
- src/MyGUI_MenuCtrl.cpp
- src/MyGUI_MenuItem.cpp
- src/MyGUI_Message.cpp
- src/MyGUI_MultiList.cpp
- src/MyGUI_PopupMenu.cpp
- src/MyGUI_Progress.cpp
- src/MyGUI_ScrollView.cpp
- src/MyGUI_StaticImage.cpp
- src/MyGUI_StaticText.cpp
- src/MyGUI_Tab.cpp
- src/MyGUI_TabItem.cpp
- src/MyGUI_VScroll.cpp
- src/MyGUI_Widget.cpp
- src/MyGUI_Window.cpp
- src/MyGUI_EditText.cpp
- src/MyGUI_MainSkin.cpp
- src/MyGUI_RawRect.cpp
- src/MyGUI_RotatingSkin.cpp
- src/MyGUI_SimpleText.cpp
- src/MyGUI_SubSkin.cpp
- src/MyGUI_TileRect.cpp
- src/MyGUI_LayerItem.cpp
- src/MyGUI_LayerNode.cpp
- src/MyGUI_OverlappedLayer.cpp
- src/MyGUI_RenderItem.cpp
- src/MyGUI_SharedLayer.cpp
- src/MyGUI_SharedLayerNode.cpp
- src/MyGUI_ActionController.cpp
- src/MyGUI_ControllerEdgeHide.cpp
- src/MyGUI_ControllerFadeAlpha.cpp
- src/MyGUI_ControllerPosition.cpp
- src/MyGUI_Exception.cpp
- src/MyGUI_Precompiled.cpp
- src/MyGUI_IWidgetCreator.cpp
- src/MyGUI_ScrollViewBase.cpp
- src/MyGUI_ResourceImageSet.cpp
- src/MyGUI_ResourceImageSetPointer.cpp
- src/MyGUI_ResourceManualFont.cpp
- src/MyGUI_ResourceManualPointer.cpp
- src/MyGUI_ResourceSkin.cpp
- src/MyGUI_ResourceTrueTypeFont.cpp
- src/MyGUI_MaskPickInfo.cpp
- src/MyGUI_Any.cpp
- src/MyGUI_Colour.cpp
- src/MyGUI_ClipboardManager.cpp
- src/MyGUI_ControllerManager.cpp
- src/MyGUI_DataManager.cpp
- src/MyGUI_DynLibManager.cpp
- src/MyGUI_FactoryManager.cpp
- src/MyGUI_FontManager.cpp
- src/MyGUI_Gui.cpp
- src/MyGUI_InputManager.cpp
- src/MyGUI_LanguageManager.cpp
- src/MyGUI_LayerManager.cpp
- src/MyGUI_LayoutManager.cpp
- src/MyGUI_PluginManager.cpp
- src/MyGUI_PointerManager.cpp
- src/MyGUI_RenderManager.cpp
- src/MyGUI_ResourceManager.cpp
- src/MyGUI_SkinManager.cpp
- src/MyGUI_SubWidgetManager.cpp
- src/MyGUI_WidgetManager.cpp
- src/MyGUI_DataFileStream.cpp
- src/MyGUI_DataStream.cpp
- src/MyGUI_DynLib.cpp
- src/MyGUI_Guid.cpp
- src/MyGUI_RenderOut.cpp
- src/MyGUI_TextIterator.cpp
- src/MyGUI_TextureUtility.cpp
- src/MyGUI_Timer.cpp
- src/MyGUI_XmlDocument.cpp
- src/MyGUI_LogManager.cpp
- src/MyGUI_LogStream.cpp
-)
-SOURCE_GROUP("Source Files\\Widget\\Widget" FILES
- src/MyGUI_Button.cpp
- src/MyGUI_Canvas.cpp
- src/MyGUI_ComboBox.cpp
- src/MyGUI_DDContainer.cpp
- src/MyGUI_Edit.cpp
- src/MyGUI_HScroll.cpp
- src/MyGUI_ItemBox.cpp
- src/MyGUI_List.cpp
- src/MyGUI_ListBox.cpp
- src/MyGUI_ListCtrl.cpp
- src/MyGUI_MenuBar.cpp
- src/MyGUI_MenuCtrl.cpp
- src/MyGUI_MenuItem.cpp
- src/MyGUI_Message.cpp
- src/MyGUI_MultiList.cpp
- src/MyGUI_PopupMenu.cpp
- src/MyGUI_Progress.cpp
- src/MyGUI_ScrollView.cpp
- src/MyGUI_StaticImage.cpp
- src/MyGUI_StaticText.cpp
- src/MyGUI_Tab.cpp
- src/MyGUI_TabItem.cpp
- src/MyGUI_VScroll.cpp
- src/MyGUI_Widget.cpp
- src/MyGUI_Window.cpp
-)
-SOURCE_GROUP("Source Files\\Widget" FILES
-)
-SOURCE_GROUP("Source Files\\Core\\SubWidget" FILES
- src/MyGUI_EditText.cpp
- src/MyGUI_MainSkin.cpp
- src/MyGUI_RawRect.cpp
- src/MyGUI_RotatingSkin.cpp
- src/MyGUI_SimpleText.cpp
- src/MyGUI_SubSkin.cpp
- src/MyGUI_TileRect.cpp
-)
-SOURCE_GROUP("Source Files\\Core\\LayerItem" FILES
- src/MyGUI_LayerItem.cpp
- src/MyGUI_LayerNode.cpp
- src/MyGUI_OverlappedLayer.cpp
- src/MyGUI_RenderItem.cpp
- src/MyGUI_SharedLayer.cpp
- src/MyGUI_SharedLayerNode.cpp
-)
-SOURCE_GROUP("Source Files\\Core\\Controller" FILES
- src/MyGUI_ActionController.cpp
- src/MyGUI_ControllerEdgeHide.cpp
- src/MyGUI_ControllerFadeAlpha.cpp
- src/MyGUI_ControllerPosition.cpp
-)
-SOURCE_GROUP("Source Files\\Core\\Common\\Interfaces" FILES
- src/MyGUI_IWidgetCreator.cpp
-)
-SOURCE_GROUP("Source Files\\Core\\Common\\Base" FILES
- src/MyGUI_ScrollViewBase.cpp
-)
-SOURCE_GROUP("Source Files\\Core\\Common" FILES
- src/MyGUI_Exception.cpp
- src/MyGUI_Precompiled.cpp
-)
-SOURCE_GROUP("Source Files\\Core\\Resource\\Data" FILES
- src/MyGUI_MaskPickInfo.cpp
-)
-SOURCE_GROUP("Source Files\\Core\\Resource" FILES
- src/MyGUI_ResourceImageSet.cpp
- src/MyGUI_ResourceImageSetPointer.cpp
- src/MyGUI_ResourceManualFont.cpp
- src/MyGUI_ResourceManualPointer.cpp
- src/MyGUI_ResourceSkin.cpp
- src/MyGUI_ResourceTrueTypeFont.cpp
-)
-SOURCE_GROUP("Source Files\\Core\\Types" FILES
- src/MyGUI_Any.cpp
- src/MyGUI_Colour.cpp
-)
-SOURCE_GROUP("Source Files\\Core\\Manager" FILES
- src/MyGUI_ClipboardManager.cpp
- src/MyGUI_ControllerManager.cpp
- src/MyGUI_DataManager.cpp
- src/MyGUI_DynLibManager.cpp
- src/MyGUI_FactoryManager.cpp
- src/MyGUI_FontManager.cpp
- src/MyGUI_Gui.cpp
- src/MyGUI_InputManager.cpp
- src/MyGUI_LanguageManager.cpp
- src/MyGUI_LayerManager.cpp
- src/MyGUI_LayoutManager.cpp
- src/MyGUI_PluginManager.cpp
- src/MyGUI_PointerManager.cpp
- src/MyGUI_RenderManager.cpp
- src/MyGUI_ResourceManager.cpp
- src/MyGUI_SkinManager.cpp
- src/MyGUI_SubWidgetManager.cpp
- src/MyGUI_WidgetManager.cpp
-)
-SOURCE_GROUP("Source Files\\Core" FILES
-)
-SOURCE_GROUP("Source Files\\Utility\\Logging" FILES
- src/MyGUI_LogManager.cpp
- src/MyGUI_LogStream.cpp
-)
-SOURCE_GROUP("Source Files\\Utility" FILES
- src/MyGUI_DataFileStream.cpp
- src/MyGUI_DataStream.cpp
- src/MyGUI_DynLib.cpp
- src/MyGUI_Guid.cpp
- src/MyGUI_RenderOut.cpp
- src/MyGUI_TextIterator.cpp
- src/MyGUI_TextureUtility.cpp
- src/MyGUI_Timer.cpp
- src/MyGUI_XmlDocument.cpp
-)
-SOURCE_GROUP("Source Files" FILES
-)
-SOURCE_GROUP("Header Files\\Widget\\Types" FILES
- include/MyGUI_DDItemInfo.h
- include/MyGUI_IBItemInfo.h
- include/MyGUI_MenuItemType.h
- include/MyGUI_MessageStyle.h
- include/MyGUI_WidgetToolTip.h
-)
-SOURCE_GROUP("Header Files\\Widget\\Widget" FILES
- include/MyGUI_Button.h
- include/MyGUI_Canvas.h
- include/MyGUI_ComboBox.h
- include/MyGUI_DDContainer.h
- include/MyGUI_Edit.h
- include/MyGUI_HScroll.h
- include/MyGUI_ItemBox.h
- include/MyGUI_List.h
- include/MyGUI_ListBox.h
- include/MyGUI_ListCtrl.h
- include/MyGUI_MenuBar.h
- include/MyGUI_MenuCtrl.h
- include/MyGUI_MenuItem.h
- include/MyGUI_Message.h
- include/MyGUI_MultiList.h
- include/MyGUI_PopupMenu.h
- include/MyGUI_Progress.h
- include/MyGUI_ScrollView.h
- include/MyGUI_StaticImage.h
- include/MyGUI_StaticText.h
- include/MyGUI_Tab.h
- include/MyGUI_TabItem.h
- include/MyGUI_VScroll.h
- include/MyGUI_Widget.h
- include/MyGUI_Window.h
-)
-SOURCE_GROUP("Header Files\\Widget\\Interfaces" FILES
- include/MyGUI_IWidgetFactory.h
-)
-SOURCE_GROUP("Header Files\\Widget" FILES
-)
-SOURCE_GROUP("Header Files\\Utility\\Logging" FILES
- include/MyGUI_LogManager.h
- include/MyGUI_LogStream.h
-)
-SOURCE_GROUP("Header Files\\Utility" FILES
- include/MyGUI_Bitwise.h
- include/MyGUI_CoordConverter.h
- include/MyGUI_DataFileStream.h
- include/MyGUI_DataStream.h
- include/MyGUI_Delegate.h
- include/MyGUI_DelegateImplement.h
- include/MyGUI_DynLib.h
- include/MyGUI_Enumerator.h
- include/MyGUI_EventPair.h
- include/MyGUI_Guid.h
- include/MyGUI_RenderOut.h
- include/MyGUI_TextChangeHistory.h
- include/MyGUI_TextIterator.h
- include/MyGUI_TextureUtility.h
- include/MyGUI_TextView.h
- include/MyGUI_Timer.h
- include/MyGUI_UString.h
- include/MyGUI_Utility.h
- include/MyGUI_WidgetTranslate.h
- include/MyGUI_XmlDocument.h
-)
-SOURCE_GROUP("Header Files\\Core\\Common\\Interfaces" FILES
- include/MyGUI_ICroppedRectangle.h
- include/MyGUI_IDataStream.h
- include/MyGUI_Instance.h
- include/MyGUI_IObject.h
- include/MyGUI_ISerializable.h
- include/MyGUI_ITexture.h
- include/MyGUI_IUnlinkWidget.h
- include/MyGUI_IVertexBuffer.h
- include/MyGUI_IWidgetCreator.h
- include/MyGUI_Plugin.h
- include/MyGUI_RTTI.h
-)
-SOURCE_GROUP("Header Files\\Core\\Common\\Base" FILES
- include/MyGUI_BiIndexBase.h
- include/MyGUI_ScrollViewBase.h
- include/MyGUI_WidgetEvent.h
- include/MyGUI_WidgetUserData.h
-)
-SOURCE_GROUP("Header Files\\Core\\Common" FILES
- include/MyGUI.h
- include/MyGUI_CastWidget.h
- include/MyGUI_Common.h
- include/MyGUI_Diagnostic.h
- include/MyGUI_Exception.h
- include/MyGUI_GenericFactory.h
- include/MyGUI_Macros.h
- include/MyGUI_Platform.h
- include/MyGUI_Precompiled.h
- include/MyGUI_Prerequest.h
- include/MyGUI_RenderFormat.h
- include/MyGUI_ResourceHolder.h
- include/MyGUI_WidgetDefines.h
-)
-SOURCE_GROUP("Header Files\\Core\\SubWidget\\Interfaces" FILES
- include/MyGUI_IStateInfo.h
- include/MyGUI_ISubWidget.h
- include/MyGUI_ISubWidgetRect.h
- include/MyGUI_ISubWidgetText.h
-)
-SOURCE_GROUP("Header Files\\Core\\SubWidget" FILES
- include/MyGUI_EditText.h
- include/MyGUI_MainSkin.h
- include/MyGUI_RawRect.h
- include/MyGUI_RotatingSkin.h
- include/MyGUI_SimpleText.h
- include/MyGUI_SubSkin.h
- include/MyGUI_TileRect.h
-)
-SOURCE_GROUP("Header Files\\Core\\LayerItem\\Interfaces" FILES
- include/MyGUI_ILayer.h
- include/MyGUI_ILayerItem.h
- include/MyGUI_ILayerNode.h
- include/MyGUI_IRenderTarget.h
-)
-SOURCE_GROUP("Header Files\\Core\\LayerItem" FILES
- include/MyGUI_LayerItem.h
- include/MyGUI_LayerNode.h
- include/MyGUI_OverlappedLayer.h
- include/MyGUI_RenderItem.h
- include/MyGUI_SharedLayer.h
- include/MyGUI_SharedLayerNode.h
-)
-SOURCE_GROUP("Header Files\\Core\\Controller" FILES
- include/MyGUI_ActionController.h
- include/MyGUI_ControllerEdgeHide.h
- include/MyGUI_ControllerFadeAlpha.h
- include/MyGUI_ControllerItem.h
- include/MyGUI_ControllerPosition.h
-)
-SOURCE_GROUP("Header Files\\Core\\Resource\\Interface" FILES
- include/MyGUI_IFont.h
- include/MyGUI_IPointer.h
- include/MyGUI_IResource.h
-)
-SOURCE_GROUP("Header Files\\Core\\Resource\\Data" FILES
- include/MyGUI_ChildSkinInfo.h
- include/MyGUI_FontData.h
- include/MyGUI_MaskPickInfo.h
- include/MyGUI_SubWidgetBinding.h
- include/MyGUI_SubWidgetInfo.h
-)
-SOURCE_GROUP("Header Files\\Core\\Resource" FILES
- include/MyGUI_ResourceImageSet.h
- include/MyGUI_ResourceImageSetPointer.h
- include/MyGUI_ResourceManualFont.h
- include/MyGUI_ResourceManualPointer.h
- include/MyGUI_ResourceSkin.h
- include/MyGUI_ResourceTrueTypeFont.h
-)
-SOURCE_GROUP("Header Files\\Core\\Types" FILES
- include/MyGUI_Align.h
- include/MyGUI_Any.h
- include/MyGUI_Colour.h
- include/MyGUI_CommonStateInfo.h
- include/MyGUI_ImageInfo.h
- include/MyGUI_InputDefine.h
- include/MyGUI_RenderTargetInfo.h
- include/MyGUI_TCoord.h
- include/MyGUI_TPoint.h
- include/MyGUI_TRect.h
- include/MyGUI_TSize.h
- include/MyGUI_Types.h
- include/MyGUI_Version.h
- include/MyGUI_VertexData.h
- include/MyGUI_WidgetStyle.h
-)
-SOURCE_GROUP("Header Files\\Core\\Manager" FILES
- include/MyGUI_ClipboardManager.h
- include/MyGUI_ControllerManager.h
- include/MyGUI_DataManager.h
- include/MyGUI_DynLibManager.h
- include/MyGUI_FactoryManager.h
- include/MyGUI_FontManager.h
- include/MyGUI_Gui.h
- include/MyGUI_InputManager.h
- include/MyGUI_LanguageManager.h
- include/MyGUI_LayerManager.h
- include/MyGUI_LayoutManager.h
- include/MyGUI_PluginManager.h
- include/MyGUI_PointerManager.h
- include/MyGUI_RenderManager.h
- include/MyGUI_ResourceManager.h
- include/MyGUI_SkinManager.h
- include/MyGUI_SubWidgetManager.h
- include/MyGUI_WidgetManager.h
-)
-SOURCE_GROUP("Header Files\\Core" FILES
-)
-SOURCE_GROUP("Header Files" FILES
- include/MyGUI_Allocator.h
- include/MyGUI_CustomAllocator.h
-)
-SOURCE_GROUP("" FILES
- CMakeLists.txt
-)
diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI.h
deleted file mode 100644
index db960fc8b..000000000
--- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI.h
+++ /dev/null
@@ -1,92 +0,0 @@
-/*!
- @file
- @author Georgiy Evmenov
- @date 01/2008
- @module
-*/
-/*
- This file is part of MyGUI.
-
- MyGUI is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- MyGUI 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with MyGUI. If not, see .
-*/
-#ifndef __MYGUI_H__
-#define __MYGUI_H__
-
-#include "MyGUI_Gui.h"
-
-#include "MyGUI_Button.h"
-#include "MyGUI_ComboBox.h"
-#include "MyGUI_Edit.h"
-#include "MyGUI_HScroll.h"
-#include "MyGUI_List.h"
-#include "MyGUI_StaticText.h"
-#include "MyGUI_StaticImage.h"
-#include "MyGUI_Tab.h"
-#include "MyGUI_TabItem.h"
-#include "MyGUI_VScroll.h"
-#include "MyGUI_Window.h"
-#include "MyGUI_Progress.h"
-#include "MyGUI_Message.h"
-#include "MyGUI_ItemBox.h"
-#include "MyGUI_MultiList.h"
-#include "MyGUI_MenuCtrl.h"
-#include "MyGUI_MenuItem.h"
-#include "MyGUI_PopupMenu.h"
-#include "MyGUI_MenuBar.h"
-#include "MyGUI_ScrollView.h"
-#include "MyGUI_DDContainer.h"
-#include "MyGUI_Canvas.h"
-#include "MyGUI_ListCtrl.h"
-#include "MyGUI_ListBox.h"
-
-#include "MyGUI_InputManager.h"
-#include "MyGUI_SubWidgetManager.h"
-#include "MyGUI_ClipboardManager.h"
-#include "MyGUI_LayerManager.h"
-#include "MyGUI_LogManager.h"
-#include "MyGUI_SkinManager.h"
-#include "MyGUI_WidgetManager.h"
-#include "MyGUI_LayoutManager.h"
-#include "MyGUI_FontManager.h"
-#include "MyGUI_PointerManager.h"
-#include "MyGUI_PluginManager.h"
-#include "MyGUI_DynLibManager.h"
-#include "MyGUI_ControllerManager.h"
-#include "MyGUI_LanguageManager.h"
-#include "MyGUI_ResourceManager.h"
-#include "MyGUI_RenderManager.h"
-#include "MyGUI_DataManager.h"
-#include "MyGUI_FactoryManager.h"
-
-#include "MyGUI_ActionController.h"
-#include "MyGUI_ControllerEdgeHide.h"
-#include "MyGUI_ControllerFadeAlpha.h"
-#include "MyGUI_ControllerPosition.h"
-#include "MyGUI_CoordConverter.h"
-#include "MyGUI_IResource.h"
-#include "MyGUI_CastWidget.h"
-#include "MyGUI_Any.h"
-#include "MyGUI_MenuItemType.h"
-#include "MyGUI_Version.h"
-#include "MyGUI_XmlDocument.h"
-#include "MyGUI_WidgetStyle.h"
-#include "MyGUI_IObject.h"
-#include "MyGUI_ISerializable.h"
-#include "MyGUI_RenderOut.h"
-
-#include "MyGUI_RawRect.h"
-#include "MyGUI_RotatingSkin.h"
-#include "MyGUI_TextureUtility.h"
-
-#endif // __MYGUI_H__
diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ActionController.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ActionController.h
deleted file mode 100644
index 7f89b4fd3..000000000
--- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_ActionController.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/*!
- @file
- @author Albert Semenov
- @date 01/2008
- @module
-*/
-/*
- This file is part of MyGUI.
-
- MyGUI is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- MyGUI 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with MyGUI. If not, see .
-*/
-#ifndef __MYGUI_ACTION_CONTROLLER_H__
-#define __MYGUI_ACTION_CONTROLLER_H__
-
-#include "MyGUI_Prerequest.h"
-#include "MyGUI_Types.h"
-#include
-
-namespace MyGUI
-{
-
- namespace action
- {
-
- /** Function used for hiding widget with one of controller event */
- void MYGUI_EXPORT actionWidgetHide(Widget* _widget);
-
- /** Function used for showing widget with one of controller event */
- void MYGUI_EXPORT actionWidgetShow(Widget* _widget);
-
- /** Function used for destroying widget with one of controller event */
- void MYGUI_EXPORT actionWidgetDestroy(Widget* _widget);
-
- /** Function for ControllerPosition per frame action : Move with constant speed */
- void MYGUI_EXPORT linearMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _k);
-
- /** Function for ControllerPosition per frame action : Move with accelerated speed
- if N == 10 then this function is same as linearMoveFunction
- if N > 10 speed will be increasing
- if N < 10 speed will be decreasing
- */
- template
- inline void acceleratedMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time)
- {
- float k = (float)pow (_current_time, N/10.f /*3 by default as Accelerated and 0.4 by default as Slowed*/);
- linearMoveFunction(_startRect, _destRect, _result, k);
- }
-
- /** Function for ControllerPosition per frame action : Move with accelerated speed a bit farther than necessary and then return it back */
- template
- inline void jumpMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time)
- {
- float k = pow (_current_time, 2) * (-2 - N/10.f) + _current_time * (3 + N/10.f);
- linearMoveFunction(_startRect, _destRect, _result, k);
- }
-
- /** Function for ControllerPosition per frame action : Start with zero speed increasing half time and then decreasing to zero */
- void MYGUI_EXPORT inertionalMoveFunction(const IntCoord& _startRect, const IntCoord& _destRect, IntCoord& _result, float _current_time);
-
- } // namespace action
-
-} // namespace MyGUI
-
-#endif // __MYGUI_ACTION_CONTROLLER_H__
diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Align.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Align.h
deleted file mode 100644
index ca1e6c64a..000000000
--- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Align.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/*!
- @file
- @author Albert Semenov
- @date 08/2008
- @module
-*/
-/*
- This file is part of MyGUI.
-
- MyGUI is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- MyGUI 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with MyGUI. If not, see .
-*/
-#ifndef __MYGUI_ALIGN_H__
-#define __MYGUI_ALIGN_H__
-
-#include "MyGUI_Prerequest.h"
-#include "MyGUI_Macros.h"
-#include "MyGUI_Diagnostic.h"
-#include
-
-namespace MyGUI
-{
-
- struct MYGUI_EXPORT Align
- {
- enum Enum
- {
- HCenter = MYGUI_FLAG_NONE, /**< center horizontally */
- VCenter = MYGUI_FLAG_NONE, /**< center vertically */
- Center = HCenter | VCenter, /**< center in the dead center */
-
- Left = MYGUI_FLAG(1), /**< value from the left (and center vertically) */
- Right = MYGUI_FLAG(2), /**< value from the right (and center vertically) */
- HStretch = Left | Right, /**< stretch horizontally proportionate to parent window (and center vertically) */
-
- Top = MYGUI_FLAG(3), /**< value from the top (and center horizontally) */
- Bottom = MYGUI_FLAG(4), /**< value from the bottom (and center horizontally) */
- VStretch = Top | Bottom, /**< stretch vertically proportionate to parent window (and center horizontally) */
-
- Stretch = HStretch | VStretch, /**< stretch proportionate to parent window */
- Default = Left | Top, /**< default value (value from left and top) */
-
- HRelative = MYGUI_FLAG(5),
- VRelative = MYGUI_FLAG(6),
- Relative = HRelative | VRelative
- };
-
- Align(Enum _value = Default) : value(_value) { }
-
- bool isHCenter() const { return HCenter == (value & ((int)HStretch | (int)HRelative)); }
- bool isVCenter() const { return VCenter == (value & ((int)VStretch | (int)VRelative)); }
- bool isCenter() const { return Center == (value & ((int)Stretch | (int)Relative)); }
-
- bool isLeft() const { return Left == (value & ((int)HStretch | (int)HRelative)); }
- bool isRight() const { return Right == (value & ((int)HStretch | (int)HRelative)); }
- bool isHStretch() const { return HStretch == (value & ((int)HStretch | (int)HRelative)); }
-
- bool isTop() const { return Top == (value & ((int)VStretch | (int)VRelative)); }
- bool isBottom() const { return (Bottom == (value & ((int)VStretch | (int)VRelative))); }
- bool isVStretch() const { return (VStretch == (value & ((int)VStretch | (int)VRelative))); }
-
- bool isStretch() const { return (Stretch == (value & ((int)Stretch | (int)Relative))); }
- bool isDefault() const { return (Default == (value & ((int)Stretch | (int)Relative))); }
-
- bool isHRelative() const { return HRelative == (value & (int)HRelative); }
- bool isVRelative() const { return VRelative == (value & (int)VRelative); }
- bool isRelative() const { return Relative == (value & (int)Relative); }
-
- Align& operator |= (Align const& _other) { value = Enum(int(value) | int(_other.value)); return *this; }
- friend Align operator | (Enum const& a, Enum const& b) { return Align(Enum(int(a) | int(b))); }
- friend Align operator | (Align const& a, Align const& b) { return Align(Enum(int(a.value) | int(b.value))); }
-
- friend bool operator == (Align const& a, Align const& b) { return a.value == b.value; }
- friend bool operator != (Align const& a, Align const& b) { return a.value != b.value; }
-
- typedef std::map MapAlign;
-
- static Align parse(const std::string& _value)
- {
- Align result(Enum(0));
- const MapAlign& map_names = result.getValueNames();
- const std::vector& vec = utility::split(_value);
- for (size_t pos=0; possecond));
- }
- }
- return result;
- }
-
- std::string print() const
- {
- std::string result;
-
- if (value & Left)
- {
- if (value & Right) result = "HStretch";
- else result = "Left";
- }
- else if (value & Right) result = "Right";
- else result = "HCenter";
-
- if (value & Top)
- {
- if (value & Bottom) result += " VStretch";
- else result += " Top";
- }
- else if (value & Bottom) result += " Bottom";
- else result += " VCenter";
-
- return result;
- }
-
- friend std::ostream& operator << ( std::ostream& _stream, const Align& _value )
- {
- _stream << _value.print();
- return _stream;
- }
-
- friend std::istream& operator >> ( std::istream& _stream, Align& _value )
- {
- _value.value = Enum(0);
- std::string value;
- _stream >> value;
-
- const MapAlign& map_names = _value.getValueNames();
- MapAlign::const_iterator iter = map_names.find(value);
- if (iter != map_names.end())
- _value.value = Enum(int(_value.value) | int(iter->second));
-
-
- if (!_stream.eof())
- {
- std::string value2;
- _stream >> value2;
- iter = map_names.find(value2);
- if (iter != map_names.end())
- _value.value = Enum(int(_value.value) | int(iter->second));
- }
-
- return _stream;
- }
-
- private:
- const MapAlign& getValueNames() const
- {
- static MapAlign map_names;
-
- if (map_names.empty())
- {
- // OBSOLETE
- map_names["ALIGN_HCENTER"] = HCenter;
- map_names["ALIGN_VCENTER"] = VCenter;
- map_names["ALIGN_CENTER"] = Center;
- map_names["ALIGN_LEFT"] = Left;
- map_names["ALIGN_RIGHT"] = Right;
- map_names["ALIGN_HSTRETCH"] = HStretch;
- map_names["ALIGN_TOP"] = Top;
- map_names["ALIGN_BOTTOM"] = Bottom;
- map_names["ALIGN_VSTRETCH"] = VStretch;
- map_names["ALIGN_STRETCH"] = Stretch;
- map_names["ALIGN_DEFAULT"] = Default;
-
- MYGUI_REGISTER_VALUE(map_names, HCenter);
- MYGUI_REGISTER_VALUE(map_names, VCenter);
- MYGUI_REGISTER_VALUE(map_names, Center);
- MYGUI_REGISTER_VALUE(map_names, Left);
- MYGUI_REGISTER_VALUE(map_names, Right);
- MYGUI_REGISTER_VALUE(map_names, HStretch);
- MYGUI_REGISTER_VALUE(map_names, Top);
- MYGUI_REGISTER_VALUE(map_names, Bottom);
- MYGUI_REGISTER_VALUE(map_names, VStretch);
- MYGUI_REGISTER_VALUE(map_names, Stretch);
- MYGUI_REGISTER_VALUE(map_names, Default);
- MYGUI_REGISTER_VALUE(map_names, HRelative);
- MYGUI_REGISTER_VALUE(map_names, VRelative);
- MYGUI_REGISTER_VALUE(map_names, Relative);
- }
-
- return map_names;
- }
-
- private:
- Enum value;
- };
-
-} // namespace MyGUI
-
-#endif // __MYGUI_ALIGN_H__
diff --git a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Allocator.h b/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Allocator.h
deleted file mode 100644
index ca107dcbd..000000000
--- a/extern/mygui_3.0.1/MyGUIEngine/include/MyGUI_Allocator.h
+++ /dev/null
@@ -1,89 +0,0 @@
-/*!
- @file
- @author Albert Semenov
- @date 05/2009
- @module
-*/
-/*
- This file is part of MyGUI.
-
- MyGUI is free software: you can redistribute it and/or modify
- it under the terms of the GNU Lesser General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- MyGUI 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 Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License
- along with MyGUI. If not, see .
-*/
-#ifndef __MYGUI_ALLOCATOR_H__
-#define __MYGUI_ALLOCATOR_H__
-
-#include
-#include
-
-namespace MyGUI
-{
-
- template
- class Allocator
- {
- public:
- // typedefs
- typedef T value_type;
- typedef value_type* pointer;
- typedef const value_type* const_pointer;
- typedef value_type& reference;
- typedef const value_type& const_reference;
- typedef std::size_t size_type;
- typedef std::ptrdiff_t difference_type;
-
- public:
- // convert an allocator to allocator
- template
- struct rebind
- {
- typedef Allocator other;
- };
-
- public:
- inline explicit Allocator() { }
- inline ~Allocator() { }
- template
- inline explicit Allocator(Allocator const&) { }
-
- // address
- inline pointer address(reference r) { return &r; }
- inline const_pointer address(const_reference r) { return &r; }
-
- // memory allocation
- inline pointer allocate(size_type cnt, typename std::allocator