1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-05 09:45:35 +00:00

Merge remote-tracking branch 'upstream/master' into launchernext

This commit is contained in:
Pieter van der Kloet 2013-02-25 00:56:23 +01:00
commit 6eaaf20c94
51 changed files with 642 additions and 323 deletions

View file

@ -529,6 +529,8 @@ if (WIN32)
set(WARNINGS "${WARNINGS} /wd${d}") set(WARNINGS "${WARNINGS} /wd${d}")
endforeach(d) endforeach(d)
set_target_properties(shiny PROPERTIES COMPILE_FLAGS ${WARNINGS})
set_target_properties(shiny.OgrePlatform PROPERTIES COMPILE_FLAGS ${WARNINGS})
set_target_properties(components PROPERTIES COMPILE_FLAGS ${WARNINGS}) set_target_properties(components PROPERTIES COMPILE_FLAGS ${WARNINGS})
if (BUILD_LAUNCHER) if (BUILD_LAUNCHER)
set_target_properties(omwlauncher PROPERTIES COMPILE_FLAGS ${WARNINGS}) set_target_properties(omwlauncher PROPERTIES COMPILE_FLAGS ${WARNINGS})
@ -660,6 +662,7 @@ if (NOT WIN32 AND NOT DPKG_PROGRAM AND NOT APPLE)
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/omwlauncher" DESTINATION "${BINDIR}" ) INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/omwlauncher" DESTINATION "${BINDIR}" )
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/esmtool" DESTINATION "${BINDIR}" ) INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/esmtool" DESTINATION "${BINDIR}" )
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/mwiniimport" DESTINATION "${BINDIR}" ) INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/mwiniimport" DESTINATION "${BINDIR}" )
INSTALL(PROGRAMS "${OpenMW_BINARY_DIR}/opencs" DESTINATION "${BINDIR}" )
# Install icon and .desktop # Install icon and .desktop
INSTALL(FILES "${OpenMW_SOURCE_DIR}/apps/launcher/resources/images/openmw.png" DESTINATION "${ICONDIR}") INSTALL(FILES "${OpenMW_SOURCE_DIR}/apps/launcher/resources/images/openmw.png" DESTINATION "${ICONDIR}")

View file

@ -20,6 +20,7 @@ void CSMDoc::Document::load (const std::vector<boost::filesystem::path>::const_i
getData().loadFile (*end2, false); getData().loadFile (*end2, false);
addOptionalGmsts(); addOptionalGmsts();
addOptionalGlobals();
} }
void CSMDoc::Document::addOptionalGmsts() void CSMDoc::Document::addOptionalGmsts()
@ -139,6 +140,26 @@ void CSMDoc::Document::addOptionalGmsts()
} }
} }
void CSMDoc::Document::addOptionalGlobals()
{
static const char *sGlobals[] =
{
"dayspassed",
"pcwerewolf",
"pcyear",
0
};
for (int i=0; sGlobals[i]; ++i)
{
ESM::Global global;
global.mId = sGlobals[i];
global.mType = ESM::VT_Int;
global.mValue = 0;
addOptionalGlobal (global);
}
}
void CSMDoc::Document::addOptionalGmst (const ESM::GameSetting& gmst) void CSMDoc::Document::addOptionalGmst (const ESM::GameSetting& gmst)
{ {
if (getData().getGmsts().searchId (gmst.mId)==-1) if (getData().getGmsts().searchId (gmst.mId)==-1)
@ -150,6 +171,17 @@ void CSMDoc::Document::addOptionalGmst (const ESM::GameSetting& gmst)
} }
} }
void CSMDoc::Document::addOptionalGlobal (const ESM::Global& global)
{
if (getData().getGlobals().searchId (global.mId)==-1)
{
CSMWorld::Record<ESM::Global> record;
record.mBase = global;
record.mState = CSMWorld::RecordBase::State_BaseOnly;
getData().getGlobals().appendRecord (record);
}
}
void CSMDoc::Document::createBase() void CSMDoc::Document::createBase()
{ {
static const char *sGlobals[] = static const char *sGlobals[] =
@ -249,6 +281,7 @@ void CSMDoc::Document::abortOperation (int type)
if (type==State_Saving) if (type==State_Saving)
{ {
mSaveCount=0;
mSaveTimer.stop(); mSaveTimer.stop();
emit stateChanged (getState(), this); emit stateChanged (getState(), this);
} }
@ -297,4 +330,4 @@ CSMTools::ReportModel *CSMDoc::Document::getReport (const CSMWorld::UniversalId&
void CSMDoc::Document::progress (int current, int max, int type) void CSMDoc::Document::progress (int current, int max, int type)
{ {
emit progress (current, max, type, 1, this); emit progress (current, max, type, 1, this);
} }

View file

@ -20,6 +20,7 @@ class QAbstractItemModel;
namespace ESM namespace ESM
{ {
struct GameSetting; struct GameSetting;
struct Global;
} }
namespace CSMDoc namespace CSMDoc
@ -53,8 +54,12 @@ namespace CSMDoc
void addOptionalGmsts(); void addOptionalGmsts();
void addOptionalGlobals();
void addOptionalGmst (const ESM::GameSetting& gmst); void addOptionalGmst (const ESM::GameSetting& gmst);
void addOptionalGlobal (const ESM::Global& global);
public: public:
Document (const std::vector<boost::filesystem::path>& files, bool new_); Document (const std::vector<boost::filesystem::path>& files, bool new_);

View file

@ -171,7 +171,7 @@ namespace CSMWorld
record2.mModified = record; record2.mModified = record;
mRecords.push_back (record2); mRecords.push_back (record2);
mIndex.insert (std::make_pair (id, mRecords.size()-1)); mIndex.insert (std::make_pair (Misc::StringUtils::lowerCase (id), mRecords.size()-1));
} }
else else
{ {
@ -306,7 +306,7 @@ namespace CSMWorld
void IdCollection<ESXRecordT>::appendRecord (const RecordBase& record) void IdCollection<ESXRecordT>::appendRecord (const RecordBase& record)
{ {
mRecords.push_back (dynamic_cast<const Record<ESXRecordT>&> (record)); mRecords.push_back (dynamic_cast<const Record<ESXRecordT>&> (record));
mIndex.insert (std::make_pair (getId (record), mRecords.size()-1)); mIndex.insert (std::make_pair (Misc::StringUtils::lowerCase (getId (record)), mRecords.size()-1));
} }
template<typename ESXRecordT> template<typename ESXRecordT>

View file

@ -1,8 +1,11 @@
#include "operation.hpp" #include "operation.hpp"
#include <sstream> #include <sstream>
#include <QProgressBar>
#include <QPushButton>
#include <QVBoxLayout>
#include "../../model/doc/document.hpp" #include "../../model/doc/document.hpp"
void CSVDoc::Operation::updateLabel (int threads) void CSVDoc::Operation::updateLabel (int threads)
@ -28,24 +31,44 @@ void CSVDoc::Operation::updateLabel (int threads)
stream << name << " (%p%)"; stream << name << " (%p%)";
} }
setFormat (stream.str().c_str()); mProgressBar->setFormat (stream.str().c_str());
} }
} }
CSVDoc::Operation::Operation (int type) : mType (type), mStalling (false) CSVDoc::Operation::Operation (int type, QWidget* parent) : mType (type), mStalling (false)
{ {
/// \todo Add a cancel button or a pop up menu with a cancel item /// \todo Add a cancel button or a pop up menu with a cancel item
initWidgets();
setBarColor( type); setBarColor( type);
updateLabel(); updateLabel();
/// \todo assign different progress bar colours to allow the user to distinguish easily between operation types /// \todo assign different progress bar colours to allow the user to distinguish easily between operation types
} }
CSVDoc::Operation::~Operation()
{
delete mLayout;
delete mProgressBar;
delete mAbortButton;
}
void CSVDoc::Operation::initWidgets()
{
mProgressBar = new QProgressBar ();
mAbortButton = new QPushButton("Abort");
mLayout = new QHBoxLayout();
mLayout->addWidget (mProgressBar);
mLayout->addWidget (mAbortButton);
connect (mAbortButton, SIGNAL (clicked()), this, SLOT (abortOperation()));
}
void CSVDoc::Operation::setProgress (int current, int max, int threads) void CSVDoc::Operation::setProgress (int current, int max, int threads)
{ {
updateLabel (threads); updateLabel (threads);
setRange (0, max); mProgressBar->setRange (0, max);
setValue (current); mProgressBar->setValue (current);
} }
int CSVDoc::Operation::getType() const int CSVDoc::Operation::getType() const
@ -64,8 +87,6 @@ void CSVDoc::Operation::setBarColor (int type)
"margin: 2px 1px 1p 2px;" "margin: 2px 1px 1p 2px;"
"}"; "}";
// "QProgressBar::chunk {background-color: %1;}";
QString topColor = "#F2F6F8"; QString topColor = "#F2F6F8";
QString bottomColor = "#E0EFF9"; QString bottomColor = "#E0EFF9";
QString midTopColor = "#D8E1E7"; QString midTopColor = "#D8E1E7";
@ -82,7 +103,7 @@ void CSVDoc::Operation::setBarColor (int type)
midTopColor = "#F17432"; midTopColor = "#F17432";
midBottomColor = "#EA5507"; midBottomColor = "#EA5507";
bottomColor = "#FB955E"; // red gloss #2 bottomColor = "#FB955E"; // red gloss #2
//break; break;
case CSMDoc::State_Searching: case CSMDoc::State_Searching:
@ -90,7 +111,7 @@ void CSVDoc::Operation::setBarColor (int type)
midTopColor = "#ABD3EE"; midTopColor = "#ABD3EE";
midBottomColor = "#89C3EB"; midBottomColor = "#89C3EB";
bottomColor = "#D5EBFB"; //blue gloss #4 bottomColor = "#D5EBFB"; //blue gloss #4
//break; break;
case CSMDoc::State_Verifying: case CSMDoc::State_Verifying:
@ -98,7 +119,7 @@ void CSVDoc::Operation::setBarColor (int type)
midTopColor = "#8EB92A"; midTopColor = "#8EB92A";
midBottomColor = "#72AA00"; midBottomColor = "#72AA00";
bottomColor = "#9ECB2D"; //green gloss bottomColor = "#9ECB2D"; //green gloss
//break; break;
case CSMDoc::State_Compiling: case CSMDoc::State_Compiling:
@ -106,7 +127,7 @@ void CSVDoc::Operation::setBarColor (int type)
midTopColor = "#C19E67"; midTopColor = "#C19E67";
midBottomColor = "#B68D4C"; midBottomColor = "#B68D4C";
bottomColor = "#E9D4B3"; //l Brown 3D bottomColor = "#E9D4B3"; //l Brown 3D
//break; break;
default: default:
@ -116,5 +137,15 @@ void CSVDoc::Operation::setBarColor (int type)
midBottomColor = "#B5C6D0"; // gray gloss for undefined ops midBottomColor = "#B5C6D0"; // gray gloss for undefined ops
} }
setStyleSheet(style.arg(topColor).arg(midTopColor).arg(midBottomColor).arg(bottomColor)); mProgressBar->setStyleSheet(style.arg(topColor).arg(midTopColor).arg(midBottomColor).arg(bottomColor));
}
QHBoxLayout *CSVDoc::Operation::getLayout() const
{
return mLayout;
}
void CSVDoc::Operation::abortOperation()
{
emit abortOperation (mType);
} }

View file

@ -1,16 +1,23 @@
#ifndef CSV_DOC_OPERATION_H #ifndef CSV_DOC_OPERATION_H
#define CSV_DOC_OPERATION_H #define CSV_DOC_OPERATION_H
#include <QProgressBar> #include <QObject>
class QHBoxLayout;
class QPushButton;
class QProgressBar;
namespace CSVDoc namespace CSVDoc
{ {
class Operation : public QProgressBar class Operation : public QObject
{ {
Q_OBJECT Q_OBJECT
int mType; int mType;
bool mStalling; bool mStalling;
QProgressBar *mProgressBar;
QPushButton *mAbortButton;
QHBoxLayout *mLayout;
// not implemented // not implemented
Operation (const Operation&); Operation (const Operation&);
@ -20,15 +27,26 @@ namespace CSVDoc
public: public:
Operation (int type); Operation (int type, QWidget *parent);
~Operation();
void setProgress (int current, int max, int threads); void setProgress (int current, int max, int threads);
int getType() const; int getType() const;
QHBoxLayout *getLayout() const;
private: private:
void setBarColor (int type); void setBarColor (int type);
void initWidgets();
signals:
void abortOperation (int type);
private slots:
void abortOperation();
}; };
} }

View file

@ -1,7 +1,7 @@
#include "operations.hpp" #include "operations.hpp"
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QHBoxLayout>
#include "operation.hpp" #include "operation.hpp"
@ -11,12 +11,14 @@ CSVDoc::Operations::Operations()
setFeatures (QDockWidget::NoDockWidgetFeatures); setFeatures (QDockWidget::NoDockWidgetFeatures);
QWidget *widget = new QWidget; QWidget *widgetContainer = new QWidget (this);
setWidget (widget);
mLayout = new QVBoxLayout; mLayout = new QVBoxLayout;
widget->setLayout (mLayout); widgetContainer->setLayout (mLayout);
setWidget (widgetContainer);
setVisible (false);
setFixedHeight (widgetContainer->height());
setTitleBarWidget (new QWidget (this));
} }
void CSVDoc::Operations::setProgress (int current, int max, int type, int threads) void CSVDoc::Operations::setProgress (int current, int max, int type, int threads)
@ -28,11 +30,20 @@ void CSVDoc::Operations::setProgress (int current, int max, int type, int thread
return; return;
} }
Operation *operation = new Operation (type); int oldCount = mOperations.size();
int newCount = oldCount + 1;
mLayout->addWidget (operation); Operation *operation = new Operation (type, this);
connect (operation, SIGNAL (abortOperation (int)), this, SIGNAL (abortOperation (int)));
mLayout->addLayout (operation->getLayout());
mOperations.push_back (operation); mOperations.push_back (operation);
operation->setProgress (current, max, threads); operation->setProgress (current, max, threads);
if ( oldCount > 0)
setFixedHeight (height()/oldCount * newCount);
setVisible (true);
} }
void CSVDoc::Operations::quitOperation (int type) void CSVDoc::Operations::quitOperation (int type)
@ -40,8 +51,19 @@ void CSVDoc::Operations::quitOperation (int type)
for (std::vector<Operation *>::iterator iter (mOperations.begin()); iter!=mOperations.end(); ++iter) for (std::vector<Operation *>::iterator iter (mOperations.begin()); iter!=mOperations.end(); ++iter)
if ((*iter)->getType()==type) if ((*iter)->getType()==type)
{ {
int oldCount = mOperations.size();
int newCount = oldCount - 1;
mLayout->removeItem ((*iter)->getLayout());
delete *iter; delete *iter;
mOperations.erase (iter); mOperations.erase (iter);
if (oldCount > 1)
setFixedHeight (height() / oldCount * newCount);
else
setVisible (false);
break; break;
} }
} }

View file

@ -31,7 +31,11 @@ namespace CSVDoc
void quitOperation (int type); void quitOperation (int type);
///< Calling this function for an operation that is not running is a no-op. ///< Calling this function for an operation that is not running is a no-op.
signals:
void abortOperation (int type);
}; };
} }
#endif #endif

View file

@ -1,4 +1,3 @@
#include "subview.hpp" #include "subview.hpp"
CSVDoc::SubView::SubView (const CSMWorld::UniversalId& id) : mUniversalId (id) CSVDoc::SubView::SubView (const CSMWorld::UniversalId& id) : mUniversalId (id)

View file

@ -1,4 +1,3 @@
#include "view.hpp" #include "view.hpp"
#include <sstream> #include <sstream>
@ -7,6 +6,7 @@
#include <QCloseEvent> #include <QCloseEvent>
#include <QMenuBar> #include <QMenuBar>
#include <QMdiArea> #include <QMdiArea>
#include <QDockWidget>
#include "../../model/doc/document.hpp" #include "../../model/doc/document.hpp"
@ -117,13 +117,16 @@ void CSVDoc::View::updateActions()
mVerify->setEnabled (!(mDocument->getState() & CSMDoc::State_Verifying)); mVerify->setEnabled (!(mDocument->getState() & CSMDoc::State_Verifying));
} }
CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews) CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews, QMainWindow *viewParent)
: mViewManager (viewManager), mDocument (document), mViewIndex (totalViews-1), mViewTotal (totalViews) : mViewManager (viewManager), mDocument (document), mViewIndex (totalViews-1), mViewTotal (totalViews), QMainWindow (viewParent)
{ {
setDockOptions (QMainWindow::AllowNestedDocks); setDockOptions (QMainWindow::AllowNestedDocks);
resize (300, 300); /// \todo get default size from settings and set reasonable minimal size resize (300, 300); /// \todo get default size from settings and set reasonable minimal size
mSubViewWindow = new QMainWindow();
setCentralWidget (mSubViewWindow);
mOperations = new Operations; mOperations = new Operations;
addDockWidget (Qt::BottomDockWidgetArea, mOperations); addDockWidget (Qt::BottomDockWidgetArea, mOperations);
@ -133,6 +136,8 @@ CSVDoc::View::View (ViewManager& viewManager, CSMDoc::Document *document, int to
CSVWorld::addSubViewFactories (mSubViewFactory); CSVWorld::addSubViewFactories (mSubViewFactory);
CSVTools::addSubViewFactories (mSubViewFactory); CSVTools::addSubViewFactories (mSubViewFactory);
connect (mOperations, SIGNAL (abortOperation (int)), this, SLOT (abortOperation (int)));
} }
CSVDoc::View::~View() CSVDoc::View::~View()
@ -171,7 +176,7 @@ void CSVDoc::View::updateDocumentState()
for (int i=0; operations[i]!=-1; ++i) for (int i=0; operations[i]!=-1; ++i)
if (!(state & operations[i])) if (!(state & operations[i]))
mOperations->quitOperation (operations[i]); mOperations->quitOperation (operations[i]);
QList<CSVDoc::SubView *> subViews = findChildren<CSVDoc::SubView *>(); QList<CSVDoc::SubView *> subViews = findChildren<CSVDoc::SubView *>();
@ -195,7 +200,7 @@ void CSVDoc::View::addSubView (const CSMWorld::UniversalId& id)
/// \todo add an user setting to reuse sub views (on a per document basis or on a per top level view basis) /// \todo add an user setting to reuse sub views (on a per document basis or on a per top level view basis)
SubView *view = mSubViewFactory.makeSubView (id, *mDocument); SubView *view = mSubViewFactory.makeSubView (id, *mDocument);
addDockWidget (Qt::TopDockWidgetArea, view); mSubViewWindow->addDockWidget (Qt::TopDockWidgetArea, view);
connect (view, SIGNAL (focusId (const CSMWorld::UniversalId&)), this, connect (view, SIGNAL (focusId (const CSMWorld::UniversalId&)), this,
SLOT (addSubView (const CSMWorld::UniversalId&))); SLOT (addSubView (const CSMWorld::UniversalId&)));
@ -226,4 +231,15 @@ void CSVDoc::View::addGlobalsSubView()
void CSVDoc::View::addGmstsSubView() void CSVDoc::View::addGmstsSubView()
{ {
addSubView (CSMWorld::UniversalId::Type_Gmsts); addSubView (CSMWorld::UniversalId::Type_Gmsts);
} }
void CSVDoc::View::abortOperation (int type)
{
mDocument->abortOperation (type);
updateActions();
}
QDockWidget *CSVDoc::View::getOperations() const
{
return mOperations;
}

View file

@ -9,6 +9,7 @@
#include "subviewfactory.hpp" #include "subviewfactory.hpp"
class QAction; class QAction;
class QDockWidget;
namespace CSMDoc namespace CSMDoc
{ {
@ -40,6 +41,7 @@ namespace CSVDoc
std::vector<QAction *> mEditingActions; std::vector<QAction *> mEditingActions;
Operations *mOperations; Operations *mOperations;
SubViewFactoryManager mSubViewFactory; SubViewFactoryManager mSubViewFactory;
QMainWindow* mSubViewWindow;
// not implemented // not implemented
View (const View&); View (const View&);
@ -65,7 +67,7 @@ namespace CSVDoc
public: public:
View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews); View (ViewManager& viewManager, CSMDoc::Document *document, int totalViews, QMainWindow *viewParent);
///< The ownership of \a document is not transferred to *this. ///< The ownership of \a document is not transferred to *this.
virtual ~View(); virtual ~View();
@ -80,6 +82,8 @@ namespace CSVDoc
void updateProgress (int current, int max, int type, int threads); void updateProgress (int current, int max, int type, int threads);
QDockWidget *getOperations() const;
signals: signals:
void newDocumentRequest(); void newDocumentRequest();
@ -101,7 +105,9 @@ namespace CSVDoc
void addGlobalsSubView(); void addGlobalsSubView();
void addGmstsSubView(); void addGmstsSubView();
void abortOperation (int type);
}; };
} }
#endif #endif

View file

@ -59,7 +59,9 @@ CSVDoc::View *CSVDoc::ViewManager::addView (CSMDoc::Document *document)
this, SLOT (progress (int, int, int, int, CSMDoc::Document *))); this, SLOT (progress (int, int, int, int, CSMDoc::Document *)));
} }
View *view = new View (*this, document, countViews (document)+1); QMainWindow *mainWindow = new QMainWindow;
View *view = new View (*this, document, countViews (document)+1, mainWindow);
mViews.push_back (view); mViews.push_back (view);
@ -119,4 +121,4 @@ void CSVDoc::ViewManager::progress (int current, int max, int type, int threads,
for (std::vector<View *>::const_iterator iter (mViews.begin()); iter!=mViews.end(); ++iter) for (std::vector<View *>::const_iterator iter (mViews.begin()); iter!=mViews.end(); ++iter)
if ((*iter)->getDocument()==document) if ((*iter)->getDocument()==document)
(*iter)->updateProgress (current, max, type, threads); (*iter)->updateProgress (current, max, type, threads);
} }

View file

@ -30,7 +30,7 @@ add_openmw_dir (mwgui
formatting inventorywindow container hud countdialog tradewindow settingswindow formatting inventorywindow container hud countdialog tradewindow settingswindow
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog spellcreationdialog itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog spellcreationdialog
enchantingdialog trainingwindow travelwindow imagebutton enchantingdialog trainingwindow travelwindow imagebutton exposedwindow
) )
add_openmw_dir (mwdialogue add_openmw_dir (mwdialogue

View file

@ -215,7 +215,7 @@ void OMW::Engine::addMaster (const std::string& master)
{ {
mMaster.push_back(master); mMaster.push_back(master);
std::string &str = mMaster.back(); std::string &str = mMaster.back();
// Append .esm if not already there // Append .esm if not already there
std::string::size_type sep = str.find_last_of ("."); std::string::size_type sep = str.find_last_of (".");
if (sep == std::string::npos) if (sep == std::string::npos)
@ -303,7 +303,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
} }
mOgre = new OEngine::Render::OgreRenderer; mOgre = new OEngine::Render::OgreRenderer;
mOgre->configure( mOgre->configure(
mCfgMgr.getLogPath().string(), mCfgMgr.getLogPath().string(),
renderSystem, renderSystem,
@ -345,7 +345,8 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
//Load translation data //Load translation data
mTranslationDataStorage.setEncoder(mEncoder); mTranslationDataStorage.setEncoder(mEncoder);
mTranslationDataStorage.loadTranslationData(mFileCollections, mMaster[0]); for (size_t i = 0; i < mMaster.size(); i++)
mTranslationDataStorage.loadTranslationData(mFileCollections, mMaster[i]);
// Create window manager - this manages all the MW-specific GUI windows // Create window manager - this manages all the MW-specific GUI windows
MWScript::registerExtensions (mExtensions); MWScript::registerExtensions (mExtensions);

View file

@ -0,0 +1,26 @@
#include "exposedwindow.hpp"
#include "MyGUI_Window.h"
namespace MWGui
{
MyGUI::VectorWidgetPtr ExposedWindow::getSkinWidgetsByName (const std::string &name)
{
return MyGUI::Widget::getSkinWidgetsByName (name);
}
MyGUI::Widget* ExposedWindow::getSkinWidget(const std::string & _name, bool _throw)
{
MyGUI::VectorWidgetPtr widgets = getSkinWidgetsByName (_name);
if (widgets.empty())
{
MYGUI_ASSERT( ! _throw, "widget name '" << _name << "' not found in skin of layout '" << getName() << "'");
return nullptr;
}
else
{
return widgets[0];
}
}
}

View file

@ -0,0 +1,26 @@
#ifndef MWGUI_EXPOSEDWINDOW_H
#define MWGUI_EXPOSEDWINDOW_H
#include "MyGUI_Window.h"
namespace MWGui
{
/**
* @brief subclass to provide access to some Widget internals.
*/
class ExposedWindow : public MyGUI::Window
{
MYGUI_RTTI_DERIVED(ExposedWindow)
public:
MyGUI::VectorWidgetPtr getSkinWidgetsByName (const std::string &name);
MyGUI::Widget* getSkinWidget(const std::string & _name, bool _throw = true);
///< Get a widget defined in the inner skin of this window.
};
}
#endif

View file

@ -19,11 +19,11 @@
#include "inventorywindow.hpp" #include "inventorywindow.hpp"
static const float BALANCE_CHANGE_INITIAL_PAUSE = 0.5; // in seconds
static const float BALANCE_CHANGE_INTERVAL = 0.1; // in seconds
namespace MWGui namespace MWGui
{ {
const float TradeWindow::sBalanceChangeInitialPause = 0.5;
const float TradeWindow::sBalanceChangeInterval = 0.1;
TradeWindow::TradeWindow(MWBase::WindowManager& parWindowManager) : TradeWindow::TradeWindow(MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_trade_window.layout", parWindowManager) WindowBase("openmw_trade_window.layout", parWindowManager)
, ContainerBase(NULL) // no drag&drop , ContainerBase(NULL) // no drag&drop
@ -157,7 +157,7 @@ namespace MWGui
mBalanceChangePause -= frameDuration; mBalanceChangePause -= frameDuration;
if (mBalanceChangePause < 0.0) { if (mBalanceChangePause < 0.0) {
mBalanceChangePause += BALANCE_CHANGE_INTERVAL; mBalanceChangePause += sBalanceChangeInterval;
if (mBalanceButtonsState == BBS_Increase) if (mBalanceButtonsState == BBS_Increase)
onIncreaseButtonTriggered(); onIncreaseButtonTriggered();
else if (mBalanceButtonsState == BBS_Decrease) else if (mBalanceButtonsState == BBS_Decrease)
@ -296,14 +296,14 @@ namespace MWGui
void TradeWindow::onIncreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id) void TradeWindow::onIncreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)
{ {
mBalanceButtonsState = BBS_Increase; mBalanceButtonsState = BBS_Increase;
mBalanceChangePause = BALANCE_CHANGE_INITIAL_PAUSE; mBalanceChangePause = sBalanceChangeInitialPause;
onIncreaseButtonTriggered(); onIncreaseButtonTriggered();
} }
void TradeWindow::onDecreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id) void TradeWindow::onDecreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)
{ {
mBalanceButtonsState = BBS_Decrease; mBalanceButtonsState = BBS_Decrease;
mBalanceChangePause = BALANCE_CHANGE_INITIAL_PAUSE; mBalanceChangePause = sBalanceChangeInitialPause;
onDecreaseButtonTriggered(); onDecreaseButtonTriggered();
} }

View file

@ -37,6 +37,9 @@ namespace MWGui
void onFrame(float frameDuration); void onFrame(float frameDuration);
protected: protected:
static const float sBalanceChangeInitialPause; // in seconds
static const float sBalanceChangeInterval; // in seconds
MyGUI::Button* mFilterAll; MyGUI::Button* mFilterAll;
MyGUI::Button* mFilterWeapon; MyGUI::Button* mFilterWeapon;
MyGUI::Button* mFilterApparel; MyGUI::Button* mFilterApparel;

View file

@ -2,32 +2,27 @@
#include "../mwbase/windowmanager.hpp" #include "../mwbase/windowmanager.hpp"
#include "exposedwindow.hpp"
using namespace MWGui; using namespace MWGui;
WindowPinnableBase::WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager) WindowPinnableBase::WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager)
: WindowBase(parLayout, parWindowManager), mPinned(false), mVisible(false) : WindowBase(parLayout, parWindowManager), mPinned(false), mVisible(false)
{ {
MyGUI::WindowPtr t = static_cast<MyGUI::WindowPtr>(mMainWidget); ExposedWindow* window = static_cast<ExposedWindow*>(mMainWidget);
t->eventWindowButtonPressed += MyGUI::newDelegate(this, &WindowPinnableBase::onWindowButtonPressed); mPinButton = window->getSkinWidget ("Button");
mPinButton->eventMouseButtonClick += MyGUI::newDelegate(this, &WindowPinnableBase::onPinButtonClicked);
} }
void WindowPinnableBase::setVisible(bool b) void WindowPinnableBase::onPinButtonClicked(MyGUI::Widget* _sender)
{ {
// Pinned windows can not be hidden mPinned = !mPinned;
if (mPinned && !b)
return;
WindowBase::setVisible(b); if (mPinned)
mVisible = b; mPinButton->changeWidgetSkin ("PinDown");
} else
mPinButton->changeWidgetSkin ("PinUp");
void WindowPinnableBase::onWindowButtonPressed(MyGUI::Window* sender, const std::string& eventName)
{ onPinToggled();
if ("PinToggle" == eventName)
{
mPinned = !mPinned;
onPinToggled();
}
eventDone(this);
} }

View file

@ -11,15 +11,15 @@ namespace MWGui
{ {
public: public:
WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager); WindowPinnableBase(const std::string& parLayout, MWBase::WindowManager& parWindowManager);
void setVisible(bool b);
bool pinned() { return mPinned; } bool pinned() { return mPinned; }
private: private:
void onWindowButtonPressed(MyGUI::Window* sender, const std::string& eventName); void onPinButtonClicked(MyGUI::Widget* _sender);
protected: protected:
virtual void onPinToggled() = 0; virtual void onPinToggled() = 0;
MyGUI::Widget* mPinButton;
bool mPinned; bool mPinned;
bool mVisible; bool mVisible;
}; };

View file

@ -52,6 +52,7 @@
#include "enchantingdialog.hpp" #include "enchantingdialog.hpp"
#include "trainingwindow.hpp" #include "trainingwindow.hpp"
#include "imagebutton.hpp" #include "imagebutton.hpp"
#include "exposedwindow.hpp"
using namespace MWGui; using namespace MWGui;
@ -127,6 +128,7 @@ WindowManager::WindowManager(
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::AutoSizedTextBox>("Widget"); MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::AutoSizedTextBox>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::AutoSizedButton>("Widget"); MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::AutoSizedButton>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::ImageButton>("Widget"); MyGUI::FactoryManager::getInstance().registerFactory<MWGui::ImageButton>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::ExposedWindow>("Widget");
MyGUI::LanguageManager::getInstance().eventRequestTag = MyGUI::newDelegate(this, &WindowManager::onRetrieveTag); MyGUI::LanguageManager::getInstance().eventRequestTag = MyGUI::newDelegate(this, &WindowManager::onRetrieveTag);
@ -310,9 +312,16 @@ void WindowManager::updateVisible()
setSpellVisibility((mAllowed & GW_Magic) && !mSpellWindow->pinned()); setSpellVisibility((mAllowed & GW_Magic) && !mSpellWindow->pinned());
setHMSVisibility((mAllowed & GW_Stats) && !mStatsWindow->pinned()); setHMSVisibility((mAllowed & GW_Stats) && !mStatsWindow->pinned());
// If in game mode, don't show anything. // If in game mode, show only the pinned windows
if (gameMode) if (gameMode)
{
mMap->setVisible(mMap->pinned());
mStatsWindow->setVisible(mStatsWindow->pinned());
mInventoryWindow->setVisible(mInventoryWindow->pinned());
mSpellWindow->setVisible(mSpellWindow->pinned());
return; return;
}
GuiMode mode = mGuiModes.back(); GuiMode mode = mGuiModes.back();
@ -327,6 +336,12 @@ void WindowManager::updateVisible()
mSettingsWindow->setVisible(true); mSettingsWindow->setVisible(true);
break; break;
case GM_Console: case GM_Console:
// Show the pinned windows
mMap->setVisible(mMap->pinned());
mStatsWindow->setVisible(mStatsWindow->pinned());
mInventoryWindow->setVisible(mInventoryWindow->pinned());
mSpellWindow->setVisible(mSpellWindow->pinned());
mConsole->enable(); mConsole->enable();
break; break;
case GM_Scroll: case GM_Scroll:

View file

@ -163,7 +163,9 @@ void Actors::updateObjectCell(const MWWorld::Ptr &ptr)
{ {
/// \note Update key (Ptr's are compared only with refdata so mCell /// \note Update key (Ptr's are compared only with refdata so mCell
/// on key is outdated), maybe redundant /// on key is outdated), maybe redundant
Animation *anim = iter->second; NpcAnimation *anim = static_cast<NpcAnimation *>(iter->second);
anim->updateParts(MWWorld::Class::get(ptr).getInventoryStore(ptr));
mAllActors.erase(iter); mAllActors.erase(iter);
mAllActors[ptr] = anim; mAllActors[ptr] = anim;
} }

View file

@ -48,21 +48,21 @@ NpcAnimation::~NpcAnimation()
NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, MWWorld::InventoryStore& inv, int visibilityFlags) NpcAnimation::NpcAnimation(const MWWorld::Ptr& ptr, Ogre::SceneNode* node, MWWorld::InventoryStore& inv, int visibilityFlags)
: Animation(), : Animation(),
mStateID(-1), mStateID(-1),
mInv(inv), mInv(&inv),
mTimeToChange(0), mTimeToChange(0),
mVisibilityFlags(visibilityFlags), mVisibilityFlags(visibilityFlags),
mRobe(mInv.end()), mRobe(mInv->end()),
mHelmet(mInv.end()), mHelmet(mInv->end()),
mShirt(mInv.end()), mShirt(mInv->end()),
mCuirass(mInv.end()), mCuirass(mInv->end()),
mGreaves(mInv.end()), mGreaves(mInv->end()),
mPauldronL(mInv.end()), mPauldronL(mInv->end()),
mPauldronR(mInv.end()), mPauldronR(mInv->end()),
mBoots(mInv.end()), mBoots(mInv->end()),
mPants(mInv.end()), mPants(mInv->end()),
mGloveL(mInv.end()), mGloveL(mInv->end()),
mGloveR(mInv.end()), mGloveR(mInv->end()),
mSkirtIter(mInv.end()) mSkirtIter(mInv->end())
{ {
mNpc = ptr.get<ESM::NPC>()->mBase; mNpc = ptr.get<ESM::NPC>()->mBase;
@ -160,7 +160,7 @@ void NpcAnimation::updateParts()
}; };
for(size_t i = 0;i < sizeof(slotlist)/sizeof(slotlist[0]);i++) for(size_t i = 0;i < sizeof(slotlist)/sizeof(slotlist[0]);i++)
{ {
MWWorld::ContainerStoreIterator iter = mInv.getSlot(slotlist[i].slot); MWWorld::ContainerStoreIterator iter = mInv->getSlot(slotlist[i].slot);
if(*slotlist[i].iter != iter) if(*slotlist[i].iter != iter)
{ {
*slotlist[i].iter = iter; *slotlist[i].iter = iter;
@ -171,7 +171,7 @@ void NpcAnimation::updateParts()
if(apparelChanged) if(apparelChanged)
{ {
if(mRobe != mInv.end()) if(mRobe != mInv->end())
{ {
MWWorld::Ptr ptr = *mRobe; MWWorld::Ptr ptr = *mRobe;
@ -191,7 +191,7 @@ void NpcAnimation::updateParts()
reserveIndividualPart(ESM::PRT_RPauldron, MWWorld::InventoryStore::Slot_Robe, 5); reserveIndividualPart(ESM::PRT_RPauldron, MWWorld::InventoryStore::Slot_Robe, 5);
reserveIndividualPart(ESM::PRT_LPauldron, MWWorld::InventoryStore::Slot_Robe, 5); reserveIndividualPart(ESM::PRT_LPauldron, MWWorld::InventoryStore::Slot_Robe, 5);
} }
if(mSkirtIter != mInv.end()) if(mSkirtIter != mInv->end())
{ {
MWWorld::Ptr ptr = *mSkirtIter; MWWorld::Ptr ptr = *mSkirtIter;
@ -203,39 +203,39 @@ void NpcAnimation::updateParts()
reserveIndividualPart(ESM::PRT_LLeg, MWWorld::InventoryStore::Slot_Skirt, 4); reserveIndividualPart(ESM::PRT_LLeg, MWWorld::InventoryStore::Slot_Skirt, 4);
} }
if(mHelmet != mInv.end()) if(mHelmet != mInv->end())
{ {
removeIndividualPart(ESM::PRT_Hair); removeIndividualPart(ESM::PRT_Hair);
const ESM::Armor *armor = (mHelmet->get<ESM::Armor>())->mBase; const ESM::Armor *armor = (mHelmet->get<ESM::Armor>())->mBase;
std::vector<ESM::PartReference> parts = armor->mParts.mParts; std::vector<ESM::PartReference> parts = armor->mParts.mParts;
addPartGroup(MWWorld::InventoryStore::Slot_Helmet, 3, parts); addPartGroup(MWWorld::InventoryStore::Slot_Helmet, 3, parts);
} }
if(mCuirass != mInv.end()) if(mCuirass != mInv->end())
{ {
const ESM::Armor *armor = (mCuirass->get<ESM::Armor>())->mBase; const ESM::Armor *armor = (mCuirass->get<ESM::Armor>())->mBase;
std::vector<ESM::PartReference> parts = armor->mParts.mParts; std::vector<ESM::PartReference> parts = armor->mParts.mParts;
addPartGroup(MWWorld::InventoryStore::Slot_Cuirass, 3, parts); addPartGroup(MWWorld::InventoryStore::Slot_Cuirass, 3, parts);
} }
if(mGreaves != mInv.end()) if(mGreaves != mInv->end())
{ {
const ESM::Armor *armor = (mGreaves->get<ESM::Armor>())->mBase; const ESM::Armor *armor = (mGreaves->get<ESM::Armor>())->mBase;
std::vector<ESM::PartReference> parts = armor->mParts.mParts; std::vector<ESM::PartReference> parts = armor->mParts.mParts;
addPartGroup(MWWorld::InventoryStore::Slot_Greaves, 3, parts); addPartGroup(MWWorld::InventoryStore::Slot_Greaves, 3, parts);
} }
if(mPauldronL != mInv.end()) if(mPauldronL != mInv->end())
{ {
const ESM::Armor *armor = (mPauldronL->get<ESM::Armor>())->mBase; const ESM::Armor *armor = (mPauldronL->get<ESM::Armor>())->mBase;
std::vector<ESM::PartReference> parts = armor->mParts.mParts; std::vector<ESM::PartReference> parts = armor->mParts.mParts;
addPartGroup(MWWorld::InventoryStore::Slot_LeftPauldron, 3, parts); addPartGroup(MWWorld::InventoryStore::Slot_LeftPauldron, 3, parts);
} }
if(mPauldronR != mInv.end()) if(mPauldronR != mInv->end())
{ {
const ESM::Armor *armor = (mPauldronR->get<ESM::Armor>())->mBase; const ESM::Armor *armor = (mPauldronR->get<ESM::Armor>())->mBase;
std::vector<ESM::PartReference> parts = armor->mParts.mParts; std::vector<ESM::PartReference> parts = armor->mParts.mParts;
addPartGroup(MWWorld::InventoryStore::Slot_RightPauldron, 3, parts); addPartGroup(MWWorld::InventoryStore::Slot_RightPauldron, 3, parts);
} }
if(mBoots != mInv.end()) if(mBoots != mInv->end())
{ {
if(mBoots->getTypeName() == typeid(ESM::Clothing).name()) if(mBoots->getTypeName() == typeid(ESM::Clothing).name())
{ {
@ -250,7 +250,7 @@ void NpcAnimation::updateParts()
addPartGroup(MWWorld::InventoryStore::Slot_Boots, 3, parts); addPartGroup(MWWorld::InventoryStore::Slot_Boots, 3, parts);
} }
} }
if(mGloveL != mInv.end()) if(mGloveL != mInv->end())
{ {
if(mGloveL->getTypeName() == typeid(ESM::Clothing).name()) if(mGloveL->getTypeName() == typeid(ESM::Clothing).name())
{ {
@ -265,7 +265,7 @@ void NpcAnimation::updateParts()
addPartGroup(MWWorld::InventoryStore::Slot_LeftGauntlet, 3, parts); addPartGroup(MWWorld::InventoryStore::Slot_LeftGauntlet, 3, parts);
} }
} }
if(mGloveR != mInv.end()) if(mGloveR != mInv->end())
{ {
if(mGloveR->getTypeName() == typeid(ESM::Clothing).name()) if(mGloveR->getTypeName() == typeid(ESM::Clothing).name())
{ {
@ -282,13 +282,13 @@ void NpcAnimation::updateParts()
} }
if(mShirt != mInv.end()) if(mShirt != mInv->end())
{ {
const ESM::Clothing *clothes = (mShirt->get<ESM::Clothing>())->mBase; const ESM::Clothing *clothes = (mShirt->get<ESM::Clothing>())->mBase;
std::vector<ESM::PartReference> parts = clothes->mParts.mParts; std::vector<ESM::PartReference> parts = clothes->mParts.mParts;
addPartGroup(MWWorld::InventoryStore::Slot_Shirt, 2, parts); addPartGroup(MWWorld::InventoryStore::Slot_Shirt, 2, parts);
} }
if(mPants != mInv.end()) if(mPants != mInv->end())
{ {
const ESM::Clothing *clothes = (mPants->get<ESM::Clothing>())->mBase; const ESM::Clothing *clothes = (mPants->get<ESM::Clothing>())->mBase;
std::vector<ESM::PartReference> parts = clothes->mParts.mParts; std::vector<ESM::PartReference> parts = clothes->mParts.mParts;

View file

@ -17,7 +17,7 @@ namespace MWRender{
class NpcAnimation: public Animation{ class NpcAnimation: public Animation{
private: private:
MWWorld::InventoryStore& mInv; MWWorld::InventoryStore *mInv;
int mStateID; int mStateID;
int mPartslots[27]; //Each part slot is taken by clothing, armor, or is empty int mPartslots[27]; //Each part slot is taken by clothing, armor, or is empty
@ -78,7 +78,13 @@ public:
virtual ~NpcAnimation(); virtual ~NpcAnimation();
NifOgre::EntityList insertBoundedPart(const std::string &mesh, int group, const std::string &bonename); NifOgre::EntityList insertBoundedPart(const std::string &mesh, int group, const std::string &bonename);
virtual void runAnimation(float timepassed); virtual void runAnimation(float timepassed);
void updateParts(); void updateParts();
void updateParts(MWWorld::InventoryStore &inventory) {
mInv = &inventory;
updateParts();
}
void removeEntities(NifOgre::EntityList &entities); void removeEntities(NifOgre::EntityList &entities);
void removeIndividualPart(int type); void removeIndividualPart(int type);
void reserveIndividualPart(int type, int group, int priority); void reserveIndividualPart(int type, int group, int priority);

View file

@ -514,9 +514,5 @@ void Objects::updateObjectCell(const MWWorld::Ptr &ptr)
node = mCellSceneNodes[newCell]; node = mCellSceneNodes[newCell];
} }
node->addChild(ptr.getRefData().getBaseNode()); node->addChild(ptr.getRefData().getBaseNode());
/// \note Still unaware how to move aabb and static w/o full rebuild,
/// moving static objects may cause problems
insertMesh(ptr, MWWorld::Class::get(ptr).getModel(ptr));
} }

View file

@ -140,25 +140,42 @@ namespace MWScript
Compiler::Locals& ScriptManager::getLocals (const std::string& name) Compiler::Locals& ScriptManager::getLocals (const std::string& name)
{ {
ScriptCollection::iterator iter = mScripts.find (name);
if (iter==mScripts.end())
{ {
if (!compile (name)) ScriptCollection::iterator iter = mScripts.find (name);
{
/// \todo Handle case of cyclic member variable access. Currently this could look up
/// the whole application in an endless recursion.
// failed -> ignore script from now on. if (iter!=mScripts.end())
std::vector<Interpreter::Type_Code> empty; return iter->second.second;
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; {
std::map<std::string, Compiler::Locals>::iterator iter = mOtherLocals.find (name);
if (iter!=mOtherLocals.end())
return iter->second;
}
Compiler::Locals locals;
if (const ESM::Script *script = mStore.get<ESM::Script>().find (name))
{
int index = 0;
for (int i=0; i<script->mData.mNumShorts; ++i)
locals.declare ('s', script->mVarNames[index++]);
for (int i=0; i<script->mData.mNumLongs; ++i)
locals.declare ('l', script->mVarNames[index++]);
for (int i=0; i<script->mData.mNumFloats; ++i)
locals.declare ('f', script->mVarNames[index++]);
std::map<std::string, Compiler::Locals>::iterator iter =
mOtherLocals.insert (std::make_pair (name, locals)).first;
return iter->second;
}
throw std::logic_error ("script " + name + " does not exist");
} }
GlobalScripts& ScriptManager::getGlobalScripts() GlobalScripts& ScriptManager::getGlobalScripts()

View file

@ -47,6 +47,7 @@ namespace MWScript
ScriptCollection mScripts; ScriptCollection mScripts;
GlobalScripts mGlobalScripts; GlobalScripts mGlobalScripts;
std::map<std::string, Compiler::Locals> mOtherLocals;
public: public:

View file

@ -153,6 +153,10 @@ void FFmpeg_Decoder::open(const std::string &fname)
try try
{ {
for(size_t j = 0;j < mFormatCtx->nb_streams;j++)
if(mFormatCtx->streams[j]->codec->codec_type == AVMEDIA_TYPE_AUDIO)
mFormatCtx->streams[j]->codec->request_sample_fmt = AV_SAMPLE_FMT_S16;
if(avformat_find_stream_info(mFormatCtx, NULL) < 0) if(avformat_find_stream_info(mFormatCtx, NULL) < 0)
fail("Failed to find stream info in "+fname); fail("Failed to find stream info in "+fname);

View file

@ -25,7 +25,7 @@ namespace
const MWWorld::Class& class_ = const MWWorld::Class& class_ =
MWWorld::Class::get (MWWorld::Ptr (&*cellRefList.mList.begin(), &cell)); MWWorld::Class::get (MWWorld::Ptr (&*cellRefList.mList.begin(), &cell));
int numRefs = cellRefList.mList.size(); size_t numRefs = cellRefList.mList.size();
int current = 0; int current = 0;
for (typename T::List::iterator it = cellRefList.mList.begin(); for (typename T::List::iterator it = cellRefList.mList.begin();
it != cellRefList.mList.end(); it++) it != cellRefList.mList.end(); it++)

View file

@ -17,9 +17,9 @@ namespace MWWorld
virtual void setUp() {} virtual void setUp() {}
virtual void listIdentifier(std::vector<std::string> &list) const {} virtual void listIdentifier(std::vector<std::string> &list) const {}
virtual int getSize() const = 0; virtual size_t getSize() const = 0;
virtual void load(ESM::ESMReader &esm, const std::string &id) = 0; virtual void load(ESM::ESMReader &esm, const std::string &id) = 0;
virtual bool eraseStatic(const std::string &id) {return false;} virtual bool eraseStatic(const std::string &id) {return false;}
}; };
@ -110,7 +110,7 @@ namespace MWWorld
item.mId = Misc::StringUtils::lowerCase(id); item.mId = Misc::StringUtils::lowerCase(id);
typename std::map<std::string, T>::const_iterator it = mStatic.find(item.mId); typename std::map<std::string, T>::const_iterator it = mStatic.find(item.mId);
if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) { if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) {
return &(it->second); return &(it->second);
} }
@ -158,7 +158,7 @@ namespace MWWorld
return mShared.end(); return mShared.end();
} }
int getSize() const { size_t getSize() const {
return mShared.size(); return mShared.size();
} }
@ -188,14 +188,14 @@ namespace MWWorld
item.mId = Misc::StringUtils::lowerCase(id); item.mId = Misc::StringUtils::lowerCase(id);
typename std::map<std::string, T>::iterator it = mStatic.find(item.mId); typename std::map<std::string, T>::iterator it = mStatic.find(item.mId);
if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) { if (it != mStatic.end() && Misc::StringUtils::ciEqual(it->second.mId, id)) {
mStatic.erase(it); mStatic.erase(it);
} }
return true; return true;
} }
bool erase(const std::string &id) { bool erase(const std::string &id) {
std::string key = Misc::StringUtils::lowerCase(id); std::string key = Misc::StringUtils::lowerCase(id);
typename Dynamic::iterator it = mDynamic.find(key); typename Dynamic::iterator it = mDynamic.find(key);
@ -220,9 +220,15 @@ namespace MWWorld
template <> template <>
inline void Store<ESM::Dialogue>::load(ESM::ESMReader &esm, const std::string &id) { inline void Store<ESM::Dialogue>::load(ESM::ESMReader &esm, const std::string &id) {
std::string idLower = Misc::StringUtils::lowerCase(id); std::string idLower = Misc::StringUtils::lowerCase(id);
mStatic[idLower] = ESM::Dialogue();
mStatic[idLower].mId = id; // don't smash case here, as this line is printed... I think std::map<std::string, ESM::Dialogue>::iterator it = mStatic.find(idLower);
mStatic[idLower].load(esm); if (it == mStatic.end()) {
it = mStatic.insert( std::make_pair( idLower, ESM::Dialogue() ) ).first;
it->second.mId = id; // don't smash case here, as this line is printed... I think
}
//I am not sure is it need to load the dialog from a plugin if it was already loaded from prevois plugins
it->second.load(esm);
} }
template <> template <>
@ -269,11 +275,11 @@ namespace MWWorld
return ptr; return ptr;
} }
int getSize() const { size_t getSize() const {
return mStatic.size(); return mStatic.size();
} }
int getSize(size_t plugin) const { size_t getSize(size_t plugin) const {
assert(plugin < mStatic.size()); assert(plugin < mStatic.size());
return mStatic[plugin].size(); return mStatic[plugin].size();
} }
@ -338,7 +344,7 @@ namespace MWWorld
} }
int getSize() const { size_t getSize() const {
return mStatic.size(); return mStatic.size();
} }
@ -409,7 +415,7 @@ namespace MWWorld
DynamicInt mDynamicInt; DynamicInt mDynamicInt;
DynamicExt mDynamicExt; DynamicExt mDynamicExt;
const ESM::Cell *search(const ESM::Cell &cell) const { const ESM::Cell *search(const ESM::Cell &cell) const {
if (cell.isExterior()) { if (cell.isExterior()) {
return search(cell.getGridX(), cell.getGridY()); return search(cell.getGridX(), cell.getGridY());
@ -481,7 +487,7 @@ namespace MWWorld
newCell->mData.mY = y; newCell->mData.mY = y;
mExt[std::make_pair(x, y)] = *newCell; mExt[std::make_pair(x, y)] = *newCell;
delete newCell; delete newCell;
return &mExt[std::make_pair(x, y)]; return &mExt[std::make_pair(x, y)];
} }
@ -528,7 +534,7 @@ namespace MWWorld
// There some nasty three-way cyclic header dependency involved, which I could only fix by moving // There some nasty three-way cyclic header dependency involved, which I could only fix by moving
// this method. // this method.
void load(ESM::ESMReader &esm, const std::string &id); void load(ESM::ESMReader &esm, const std::string &id);
iterator intBegin() const { iterator intBegin() const {
return iterator(mSharedInt.begin()); return iterator(mSharedInt.begin());
} }
@ -567,7 +573,7 @@ namespace MWWorld
return 0; return 0;
} }
int getSize() const { size_t getSize() const {
return mSharedInt.size() + mSharedExt.size(); return mSharedInt.size() + mSharedExt.size();
} }
@ -701,7 +707,7 @@ namespace MWWorld
mStatic.back().load(esm); mStatic.back().load(esm);
} }
int getSize() const { size_t getSize() const {
return mStatic.size(); return mStatic.size();
} }
@ -930,7 +936,7 @@ namespace MWWorld
} }
} }
int getSize() const { size_t getSize() const {
return mStatic.size(); return mStatic.size();
} }

View file

@ -746,7 +746,11 @@ namespace MWWorld
copyObjectToCell(ptr, newCell, pos); copyObjectToCell(ptr, newCell, pos);
else if (!mWorldScene->isCellActive(newCell)) else if (!mWorldScene->isCellActive(newCell))
{ {
MWWorld::Class::get(ptr).copyToCell(ptr, newCell); MWWorld::Class::get(ptr)
.copyToCell(ptr, newCell)
.getRefData()
.setBaseNode(0);
mWorldScene->removeObjectFromScene(ptr); mWorldScene->removeObjectFromScene(ptr);
mLocalScripts.remove(ptr); mLocalScripts.remove(ptr);
removeContainerScripts (ptr); removeContainerScripts (ptr);

View file

@ -68,6 +68,7 @@ macro(find_component _component _pkgconfig _library _header)
find_path(${_component}_INCLUDE_DIRS ${_header} find_path(${_component}_INCLUDE_DIRS ${_header}
HINTS HINTS
${FFMPEGSDK_INC}
${PC_LIB${_component}_INCLUDEDIR} ${PC_LIB${_component}_INCLUDEDIR}
${PC_LIB${_component}_INCLUDE_DIRS} ${PC_LIB${_component}_INCLUDE_DIRS}
PATH_SUFFIXES PATH_SUFFIXES
@ -76,6 +77,7 @@ macro(find_component _component _pkgconfig _library _header)
find_library(${_component}_LIBRARIES NAMES ${_library} find_library(${_component}_LIBRARIES NAMES ${_library}
HINTS HINTS
${FFMPEGSDK_LIB}
${PC_LIB${_component}_LIBDIR} ${PC_LIB${_component}_LIBDIR}
${PC_LIB${_component}_LIBRARY_DIRS} ${PC_LIB${_component}_LIBRARY_DIRS}
) )
@ -97,6 +99,12 @@ endmacro()
# Check for cached results. If there are skip the costly part. # Check for cached results. If there are skip the costly part.
if (NOT FFMPEG_LIBRARIES) if (NOT FFMPEG_LIBRARIES)
set (FFMPEGSDK ENV${FFMPEG_HOME})
if (FFMPEGSDK)
set (FFMPEGSDK_INC "${FFMPEGSDK}/include")
set (FFMPEGSDK_LIB "${FFMPEGSDK}/lib")
endif ()
# Check for all possible component. # Check for all possible component.
find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h) find_component(AVCODEC libavcodec avcodec libavcodec/avcodec.h)
find_component(AVFORMAT libavformat avformat libavformat/avformat.h) find_component(AVFORMAT libavformat avformat libavformat/avformat.h)

View file

@ -23,9 +23,7 @@
#include "bsa_file.hpp" #include "bsa_file.hpp"
//#include <stdexcept> #include <stdexcept>
//#include <cstdlib>
//#include <cassert>
#include "../files/constrainedfiledatastream.hpp" #include "../files/constrainedfiledatastream.hpp"

View file

@ -136,15 +136,15 @@ void ESMWriter::writeHNString(const std::string& name, const std::string& data)
endRecord(name); endRecord(name);
} }
void ESMWriter::writeHNString(const std::string& name, const std::string& data, int size) void ESMWriter::writeHNString(const std::string& name, const std::string& data, size_t size)
{ {
assert(static_cast<int> (data.size()) <= size); assert(data.size() <= size);
startSubRecord(name); startSubRecord(name);
writeHString(data); writeHString(data);
if (static_cast<int> (data.size()) < size) if (data.size() < size)
{ {
for (int i = data.size(); i < size; ++i) for (size_t i = data.size(); i < size; ++i)
write("\0",1); write("\0",1);
} }
@ -177,7 +177,7 @@ void ESMWriter::writeName(const std::string& name)
write(name.c_str(), name.size()); write(name.c_str(), name.size());
} }
void ESMWriter::write(const char* data, int size) void ESMWriter::write(const char* data, size_t size)
{ {
if (count && !m_records.empty()) if (count && !m_records.empty())
{ {

View file

@ -16,7 +16,7 @@ class ESMWriter
{ {
std::string name; std::string name;
std::streampos position; std::streampos position;
int size; size_t size;
}; };
public: public:
@ -35,7 +35,7 @@ public:
void close(); void close();
void writeHNString(const std::string& name, const std::string& data); void writeHNString(const std::string& name, const std::string& data);
void writeHNString(const std::string& name, const std::string& data, int size); void writeHNString(const std::string& name, const std::string& data, size_t size);
void writeHNCString(const std::string& name, const std::string& data) void writeHNCString(const std::string& name, const std::string& data)
{ {
startSubRecord(name); startSubRecord(name);
@ -76,7 +76,7 @@ public:
} }
template<typename T> template<typename T>
void writeT(const T& data, int size) void writeT(const T& data, size_t size)
{ {
write((char*)&data, size); write((char*)&data, size);
} }
@ -87,7 +87,7 @@ public:
void writeHString(const std::string& data); void writeHString(const std::string& data);
void writeHCString(const std::string& data); void writeHCString(const std::string& data);
void writeName(const std::string& data); void writeName(const std::string& data);
void write(const char* data, int size); void write(const char* data, size_t size);
private: private:
std::list<MasterData> m_masters; std::list<MasterData> m_masters;

View file

@ -37,7 +37,7 @@
//TODO: when threading is needed, enable these //TODO: when threading is needed, enable these
//#include <boost/mutex.hpp> //#include <boost/mutex.hpp>
//#include <boost/thread/locks.hpp> #include <boost/thread/locks.hpp>
namespace Nif namespace Nif
{ {

View file

@ -43,25 +43,14 @@ http://www.gnu.org/licenses/ .
typedef unsigned char ubyte; typedef unsigned char ubyte;
using namespace NifBullet; namespace NifBullet
{
ManualBulletShapeLoader::~ManualBulletShapeLoader() ManualBulletShapeLoader::~ManualBulletShapeLoader()
{ {
} }
btQuaternion ManualBulletShapeLoader::getbtQuat(Ogre::Matrix3 const &m)
{
Ogre::Quaternion oquat(m);
btQuaternion quat;
quat.setW(oquat.w);
quat.setX(oquat.x);
quat.setY(oquat.y);
quat.setZ(oquat.z);
return quat;
}
btVector3 ManualBulletShapeLoader::getbtVector(Ogre::Vector3 const &v) btVector3 ManualBulletShapeLoader::getbtVector(Ogre::Vector3 const &v)
{ {
return btVector3(v[0], v[1], v[2]); return btVector3(v[0], v[1], v[2]);
@ -90,7 +79,6 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource)
return; return;
} }
// The first record is assumed to be the root node // The first record is assumed to be the root node
Nif::Record *r = nif.getRecord(0); Nif::Record *r = nif.getRecord(0);
assert(r != NULL); assert(r != NULL);
@ -106,13 +94,11 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource)
bool hasCollisionNode = hasRootCollisionNode(node); bool hasCollisionNode = hasRootCollisionNode(node);
//do a first pass //do a first pass
handleNode(node,0,NULL,hasCollisionNode,false,false); handleNode(node,0,hasCollisionNode,false,false);
//if collide = false, then it does a second pass which create a shape for raycasting. //if collide = false, then it does a second pass which create a shape for raycasting.
if(cShape->mCollide == false) if(cShape->mCollide == false)
{ handleNode(node,0,hasCollisionNode,false,true);
handleNode(node,0,NULL,hasCollisionNode,false,true);
}
//cShape->collide = hasCollisionNode&&cShape->collide; //cShape->collide = hasCollisionNode&&cShape->collide;
@ -129,9 +115,9 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource)
delete m_meshInterface; delete m_meshInterface;
} }
}; };
if(mBoundingBox != NULL) if(mBoundingBox != NULL)
cShape->Shape = mBoundingBox; cShape->Shape = mBoundingBox;
else else
{ {
currentShape = new TriangleMeshShape(mTriMesh,true); currentShape = new TriangleMeshShape(mTriMesh,true);
@ -141,34 +127,30 @@ void ManualBulletShapeLoader::loadResource(Ogre::Resource *resource)
bool ManualBulletShapeLoader::hasRootCollisionNode(Nif::Node const * node) bool ManualBulletShapeLoader::hasRootCollisionNode(Nif::Node const * node)
{ {
if (node->recType == Nif::RC_NiNode) if(node->recType == Nif::RC_RootCollisionNode)
return true;
const Nif::NiNode *ninode = dynamic_cast<const Nif::NiNode*>(node);
if(ninode)
{ {
Nif::NodeList &list = ((Nif::NiNode*)node)->children; const Nif::NodeList &list = ninode->children;
int n = list.length(); for(size_t i = 0;i < list.length();i++)
for (int i=0; i<n; i++)
{ {
if (!list[i].empty()) if(!list[i].empty())
{ {
if(hasRootCollisionNode(list[i].getPtr())) return true;; if(hasRootCollisionNode(list[i].getPtr()))
return true;
} }
} }
} }
else if (node->recType == Nif::RC_NiTriShape)
{
return false;
}
else if(node->recType == Nif::RC_RootCollisionNode)
{
return true;
}
return false; return false;
} }
void ManualBulletShapeLoader::handleNode(Nif::Node const *node, int flags, void ManualBulletShapeLoader::handleNode(const Nif::Node *node, int flags,
const Nif::Transformation *parentTrafo,bool hasCollisionNode,bool isCollisionNode,bool raycastingOnly) bool hasCollisionNode, bool isCollisionNode,
bool raycastingOnly)
{ {
// Accumulate the flags from all the child nodes. This works for all // Accumulate the flags from all the child nodes. This works for all
// the flags we currently use, at least. // the flags we currently use, at least.
flags |= node->flags; flags |= node->flags;
@ -209,70 +191,36 @@ void ManualBulletShapeLoader::handleNode(Nif::Node const *node, int flags,
} }
} }
Nif::Transformation childTrafo = node->trafo;
if (parentTrafo)
{
// Get a non-const reference to the node's data, since we're
// overwriting it. TODO: Is this necessary?
// For both position and rotation we have that:
// final_vector = old_vector + old_rotation*new_vector*old_scale
childTrafo.pos = parentTrafo->pos + parentTrafo->rotation*childTrafo.pos*parentTrafo->scale;
// Merge the rotations together
childTrafo.rotation = parentTrafo->rotation * childTrafo.rotation;
// Scale
childTrafo.scale *= parentTrafo->scale;
}
if(node->hasBounds) if(node->hasBounds)
{ {
btVector3 boxsize = getbtVector(node->boundXYZ);
cShape->boxTranslation = node->boundPos; cShape->boxTranslation = node->boundPos;
cShape->boxRotation = node->boundRot; cShape->boxRotation = node->boundRot;
mBoundingBox = new btBoxShape(getbtVector(node->boundXYZ));
mBoundingBox = new btBoxShape(boxsize);
} }
if(node->recType == Nif::RC_NiTriShape && (isCollisionNode || !hasCollisionNode))
// For NiNodes, loop through children
if (node->recType == Nif::RC_NiNode)
{
Nif::NodeList const &list = ((Nif::NiNode const *)node)->children;
int n = list.length();
for (int i=0; i<n; i++)
{
if (!list[i].empty())
{
handleNode(list[i].getPtr(), flags,&childTrafo,hasCollisionNode,isCollisionNode,raycastingOnly);
}
}
}
else if (node->recType == Nif::RC_NiTriShape && (isCollisionNode || !hasCollisionNode))
{ {
cShape->mCollide = !(flags&0x800); cShape->mCollide = !(flags&0x800);
handleNiTriShape(dynamic_cast<Nif::NiTriShape const *>(node), flags,childTrafo.rotation,childTrafo.pos,childTrafo.scale,raycastingOnly); handleNiTriShape(static_cast<const Nif::NiTriShape*>(node), flags, node->getWorldTransform(), raycastingOnly);
} }
else if(node->recType == Nif::RC_RootCollisionNode)
// For NiNodes, loop through children
const Nif::NiNode *ninode = dynamic_cast<const Nif::NiNode*>(node);
if(ninode)
{ {
Nif::NodeList &list = ((Nif::NiNode*)node)->children; isCollisionNode = isCollisionNode || (node->recType == Nif::RC_RootCollisionNode);
int n = list.length();
for (int i=0; i<n; i++) const Nif::NodeList &list = ninode->children;
for(size_t i = 0;i < list.length();i++)
{ {
if (!list[i].empty()) if(!list[i].empty())
handleNode(list[i].getPtr(), flags,&childTrafo, hasCollisionNode,true,raycastingOnly); handleNode(list[i].getPtr(), flags, hasCollisionNode, isCollisionNode, raycastingOnly);
} }
} }
} }
void ManualBulletShapeLoader::handleNiTriShape(Nif::NiTriShape const *shape, int flags,Ogre::Matrix3 parentRot,Ogre::Vector3 parentPos,float parentScale, void ManualBulletShapeLoader::handleNiTriShape(const Nif::NiTriShape *shape, int flags, const Ogre::Matrix4 &transform,
bool raycastingOnly) bool raycastingOnly)
{ {
assert(shape != NULL); assert(shape != NULL);
@ -296,18 +244,14 @@ void ManualBulletShapeLoader::handleNiTriShape(Nif::NiTriShape const *shape, int
return; return;
Nif::NiTriShapeData *data = shape->data.getPtr(); const Nif::NiTriShapeData *data = shape->data.getPtr();
const std::vector<Ogre::Vector3> &vertices = data->vertices; const std::vector<Ogre::Vector3> &vertices = data->vertices;
const Ogre::Matrix3 &rot = shape->trafo.rotation; const short *triangles = &data->triangles[0];
const Ogre::Vector3 &pos = shape->trafo.pos;
float scale = shape->trafo.scale * parentScale;
short* triangles = &data->triangles[0];
for(size_t i = 0;i < data->triangles.size();i+=3) for(size_t i = 0;i < data->triangles.size();i+=3)
{ {
Ogre::Vector3 b1 = pos + rot*vertices[triangles[i+0]]*scale; Ogre::Vector3 b1 = transform*vertices[triangles[i+0]];
Ogre::Vector3 b2 = pos + rot*vertices[triangles[i+1]]*scale; Ogre::Vector3 b2 = transform*vertices[triangles[i+1]];
Ogre::Vector3 b3 = pos + rot*vertices[triangles[i+2]]*scale; Ogre::Vector3 b3 = transform*vertices[triangles[i+2]];
mTriMesh->addTriangle(btVector3(b1.x,b1.y,b1.z),btVector3(b2.x,b2.y,b2.z),btVector3(b3.x,b3.y,b3.z)); mTriMesh->addTriangle(btVector3(b1.x,b1.y,b1.z),btVector3(b2.x,b2.y,b2.z),btVector3(b3.x,b3.y,b3.z));
} }
} }
@ -320,3 +264,5 @@ void ManualBulletShapeLoader::load(const std::string &name,const std::string &gr
return; return;
OEngine::Physic::BulletShapeManager::getSingleton().create(name,group,true,this); OEngine::Physic::BulletShapeManager::getSingleton().create(name,group,true,this);
} }
} // namespace NifBullet

View file

@ -51,19 +51,18 @@ namespace NifBullet
class ManualBulletShapeLoader : public OEngine::Physic::BulletShapeLoader class ManualBulletShapeLoader : public OEngine::Physic::BulletShapeLoader
{ {
public: public:
ManualBulletShapeLoader():resourceGroup("General"){} ManualBulletShapeLoader():resourceGroup("General"){}
virtual ~ManualBulletShapeLoader(); virtual ~ManualBulletShapeLoader();
void warn(std::string msg) void warn(const std::string &msg)
{ {
std::cerr << "NIFLoader: Warn:" << msg << "\n"; std::cerr << "NIFLoader: Warn:" << msg << "\n";
} }
void fail(std::string msg) void fail(const std::string &msg)
{ {
std::cerr << "NIFLoader: Fail: "<< msg << std::endl; std::cerr << "NIFLoader: Fail: "<< msg << std::endl;
assert(1); abort();
} }
/** /**
@ -79,31 +78,26 @@ public:
void load(const std::string &name,const std::string &group); void load(const std::string &name,const std::string &group);
private: private:
btQuaternion getbtQuat(Ogre::Matrix3 const &m);
btVector3 getbtVector(Ogre::Vector3 const &v); btVector3 getbtVector(Ogre::Vector3 const &v);
/** /**
*Parse a node. *Parse a node.
*/ */
void handleNode(Nif::Node const *node, int flags, void handleNode(Nif::Node const *node, int flags, bool hasCollisionNode, bool isCollisionNode, bool raycastingOnly);
const Nif::Transformation *trafo, bool hasCollisionNode,bool isCollisionNode,bool raycastingOnly);
/** /**
*Helper function *Helper function
*/ */
bool hasRootCollisionNode(Nif::Node const * node); bool hasRootCollisionNode(const Nif::Node *node);
/** /**
*convert a NiTriShape to a bullet trishape. *convert a NiTriShape to a bullet trishape.
*/ */
void handleNiTriShape(Nif::NiTriShape const *shape, int flags,Ogre::Matrix3 parentRot,Ogre::Vector3 parentPos,float parentScales,bool raycastingOnly); void handleNiTriShape(const Nif::NiTriShape *shape, int flags, const Ogre::Matrix4 &transform, bool raycastingOnly);
std::string resourceName; std::string resourceName;
std::string resourceGroup; std::string resourceGroup;
OEngine::Physic::BulletShape* cShape;//current shape OEngine::Physic::BulletShape* cShape;//current shape
btTriangleMesh *mTriMesh; btTriangleMesh *mTriMesh;
btBoxShape *mBoundingBox; btBoxShape *mBoundingBox;

View file

@ -70,7 +70,7 @@ Utf8Encoder::Utf8Encoder(const FromType sourceEncoding):
} }
} }
std::string Utf8Encoder::getUtf8(const char* input, int size) std::string Utf8Encoder::getUtf8(const char* input, size_t size)
{ {
// Double check that the input string stops at some point (it might // Double check that the input string stops at some point (it might
// contain zero terminators before this, inside its own data, which // contain zero terminators before this, inside its own data, which
@ -111,7 +111,7 @@ std::string Utf8Encoder::getUtf8(const char* input, int size)
return std::string(&mOutput[0], outlen); return std::string(&mOutput[0], outlen);
} }
std::string Utf8Encoder::getLegacyEnc(const char *input, int size) std::string Utf8Encoder::getLegacyEnc(const char *input, size_t size)
{ {
// Double check that the input string stops at some point (it might // Double check that the input string stops at some point (it might
// contain zero terminators before this, inside its own data, which // contain zero terminators before this, inside its own data, which

View file

@ -27,13 +27,13 @@ namespace ToUTF8
Utf8Encoder(FromType sourceEncoding); Utf8Encoder(FromType sourceEncoding);
// Convert to UTF8 from the previously given code page. // Convert to UTF8 from the previously given code page.
std::string getUtf8(const char *input, int size); std::string getUtf8(const char *input, size_t size);
inline std::string getUtf8(const std::string &str) inline std::string getUtf8(const std::string &str)
{ {
return getUtf8(str.c_str(), str.size()); return getUtf8(str.c_str(), str.size());
} }
std::string getLegacyEnc(const char *input, int size); std::string getLegacyEnc(const char *input, size_t size);
inline std::string getLegacyEnc(const std::string &str) inline std::string getLegacyEnc(const std::string &str)
{ {
return getLegacyEnc(str.c_str(), str.size()); return getLegacyEnc(str.c_str(), str.size());

View file

@ -16,6 +16,7 @@ Alexander Olofsson (Ace)
Artem Kotsynyak (greye) Artem Kotsynyak (greye)
athile athile
BrotherBrick BrotherBrick
Chris Robinson
Cory F. Cohen (cfcohen) Cory F. Cohen (cfcohen)
Cris Mihalache (Mirceam) Cris Mihalache (Mirceam)
Douglas Diniz (Dgdiniz) Douglas Diniz (Dgdiniz)
@ -28,6 +29,7 @@ Jannik Heller (scrawl)
Jason Hooks (jhooks) Jason Hooks (jhooks)
Joel Graff (graffy) Joel Graff (graffy)
Karl-Felix Glatzer (k1ll) Karl-Felix Glatzer (k1ll)
Lars Söderberg (Lazaroth)
lazydev lazydev
Leon Saunders (emoose) Leon Saunders (emoose)
Lukasz Gromanowski (lgro) Lukasz Gromanowski (lgro)
@ -39,6 +41,7 @@ Nikolay Kasyanov (corristo)
Pieter van der Kloet (pvdk) Pieter van der Kloet (pvdk)
Roman Melnik (Kromgart) Roman Melnik (Kromgart)
Sebastian Wick (swick) Sebastian Wick (swick)
Sergey Shambir
Sylvain T. (Garvek) Sylvain T. (Garvek)
Tom Mason (wheybags) Tom Mason (wheybags)

View file

@ -2,41 +2,45 @@
<MyGUI type="Layout"> <MyGUI type="Layout">
<Widget type="Window" skin="" layer="Windows" align="Left|Top" position="0 0 512 256" name="_Main"> <Widget type="Window" skin="" layer="Windows" align="Left|Top" position="0 0 565 390" name="_Main">
<Widget type="ImageBox" skin="ImageBox" position_real="0 0 1 1" align="Top|Right" name="BookImage"> <Widget type="ImageBox" skin="ImageBox" position="0 0 565 390" align="Top|Right" name="JImage">
<Property key="ImageTexture" value="textures\tx_menubook.dds"/> <Property key="ImageTexture" value="textures\tx_menubook.dds"/>
<Property key="ImageCoord" value="50 0 412 256"/>
<Widget type="ImageButton" skin="ImageBox" position="251 220 128 32" name="NextPageBTN"> <Widget type="ImageButton" skin="ImageBox" position="300 350 48 32" name="NextPageBTN">
<Property key="ImageCoord" value="0 0 48 32"/>
<Property key="ImageHighlighted" value="textures\tx_menubook_next_over.dds"/> <Property key="ImageHighlighted" value="textures\tx_menubook_next_over.dds"/>
<Property key="ImageNormal" value="textures\tx_menubook_next_idle.dds"/> <Property key="ImageNormal" value="textures\tx_menubook_next_idle.dds"/>
<Property key="ImagePushed" value="textures\tx_menubook_next_pressed.dds"/> <Property key="ImagePushed" value="textures\tx_menubook_next_pressed.dds"/>
</Widget> </Widget>
<Widget type="ImageButton" skin="ImageBox" position="165 220 128 32" name="PrevPageBTN"> <Widget type="ImageButton" skin="ImageBox" position="220 350 48 32" name="PrevPageBTN">
<Property key="ImageCoord" value="0 0 48 32"/>
<Property key="ImageHighlighted" value="textures\tx_menubook_prev_over.dds"/> <Property key="ImageHighlighted" value="textures\tx_menubook_prev_over.dds"/>
<Property key="ImageNormal" value="textures\tx_menubook_prev_idle.dds"/> <Property key="ImageNormal" value="textures\tx_menubook_prev_idle.dds"/>
<Property key="ImagePushed" value="textures\tx_menubook_prev_pressed.dds"/> <Property key="ImagePushed" value="textures\tx_menubook_prev_pressed.dds"/>
</Widget> </Widget>
<Widget type="ImageButton" skin="ImageBox" position="75 220 128 32" name="TakeButton"> <Widget type="ImageButton" skin="ImageBox" position="40 350 64 32" name="TakeButton">
<Property key="ImageHighlighted" value="textures\tx_menubook_take_over.dds"/> <Property key="ImageHighlighted" value="textures\tx_menubook_take_over.dds"/>
<Property key="ImageNormal" value="textures\tx_menubook_take_idle.dds"/> <Property key="ImageNormal" value="textures\tx_menubook_take_idle.dds"/>
<Property key="ImagePushed" value="textures\tx_menubook_take_pressed.dds"/> <Property key="ImagePushed" value="textures\tx_menubook_take_pressed.dds"/>
</Widget> </Widget>
<Widget type="ImageButton" skin="ImageBox" position="360 220 128 32" name="CloseButton"> <Widget type="ImageButton" skin="ImageBox" position="475 350 48 32" name="CloseButton">
<Property key="ImageCoord" value="0 0 48 32"/>
<Property key="ImageHighlighted" value="textures\tx_menubook_close_over.dds"/> <Property key="ImageHighlighted" value="textures\tx_menubook_close_over.dds"/>
<Property key="ImageNormal" value="textures\tx_menubook_close_idle.dds"/> <Property key="ImageNormal" value="textures\tx_menubook_close_idle.dds"/>
<Property key="ImagePushed" value="textures\tx_menubook_close_pressed.dds"/> <Property key="ImagePushed" value="textures\tx_menubook_close_pressed.dds"/>
</Widget> </Widget>
<Widget type="TextBox" skin="NormalText" position="155 215 24 24" name="LeftPageNumber"> <Widget type="TextBox" skin="NormalText" position="150 350 32 16" name="LeftPageNumber">
<Property key="TextColour" value="0 0 0"/> <Property key="TextColour" value="0 0 0"/>
</Widget> </Widget>
<Widget type="TextBox" skin="NormalText" position="325 215 24 24" name="RightPageNumber"> <Widget type="TextBox" skin="NormalText" position="410 350 32 16" name="RightPageNumber">
<Property key="TextColour" value="0 0 0"/> <Property key="TextColour" value="0 0 0"/>
</Widget> </Widget>
<Widget type="Widget" skin="" position_real="0.15 0.1 0.3 0.75" name = "LeftPage"/> <Widget type="Widget" skin="" position="30 22 240 300" name = "LeftPage"/>
<Widget type="Widget" skin="" position_real="0.55 0.1 0.3 0.75" name = "RightPage"/> <Widget type="Widget" skin="" position="300 22 240 300" name = "RightPage"/>
</Widget> </Widget>
</Widget> </Widget>

View file

@ -2,76 +2,78 @@
<MyGUI type="Skin"> <MyGUI type="Skin">
<!-- The 'box' frame that surrounds various HUD items and other elements --> <!-- The 'box' frame that surrounds various HUD items and other elements -->
<Skin name="HUD_Box" size="40 40" texture="textures\menu_icon_equip.dds"> <Skin name="HUD_Box" size="40 40" texture="mwgui.png">
<BasisSkin type="TileRect" offset="0 0 40 2" align="ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset="2 2 40 2"> <BasisSkin type="TileRect" offset="0 0 39 2" align="ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset="4 2 38 2">
<Property key="TileSize" value="40 2"/> <Property key="TileSize" value="40 2"/>
<Property key="TileH" value="true"/> <Property key="TileH" value="true"/>
<Property key="TileV" value="true"/> <Property key="TileV" value="true"/>
</State> </State>
</BasisSkin> </BasisSkin>
<BasisSkin type="TileRect" offset="0 38 40 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH"> <BasisSkin type="TileRect" offset="0 1 2 37" align="ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset="2 40 40 2"> <State name="normal" offset="2 26 2 36">
<Property key="TileSize" value="2 40"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<BasisSkin type="TileRect" offset="38 0 2 40" align="ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset="16 26 2 38">
<Property key="TileSize" value="2 40"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<BasisSkin type="TileRect" offset="0 38 39 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset="4 20 40 2">
<Property key="TileSize" value="40 2"/> <Property key="TileSize" value="40 2"/>
<Property key="TileH" value="true"/> <Property key="TileH" value="true"/>
<Property key="TileV" value="true"/> <Property key="TileV" value="true"/>
</State> </State>
</BasisSkin> </BasisSkin>
<BasisSkin type="TileRect" offset="0 2 2 36" align="ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset="2 4 2 36">
<Property key="TileSize" value="2 36"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<BasisSkin type="TileRect" offset="38 2 2 36" align="ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset="40 4 2 36">
<Property key="TileSize" value="2 36"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<!-- The interior of the box --> <!-- The interior of the box -->
<Child type="Widget" skin="BlackBG" offset="2 2 36 36" align="ALIGN_STRETCH" name="Client"/> <Child type="Widget" skin="BlackBG" offset="2 2 36 36" align="ALIGN_STRETCH" name="Client"/>
</Skin> </Skin>
<Skin name="HUD_Box_NoTransp" size="40 40" texture="textures\menu_icon_equip.dds"> <Skin name="HUD_Box_NoTransp" size="40 40" texture="mwgui.png">
<BasisSkin type="TileRect" offset="0 0 40 2" align="ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset="2 2 40 2"> <BasisSkin type="TileRect" offset="0 0 39 2" align="ALIGN_TOP ALIGN_HSTRETCH">
<State name="normal" offset="4 2 38 2">
<Property key="TileSize" value="40 2"/> <Property key="TileSize" value="40 2"/>
<Property key="TileH" value="true"/> <Property key="TileH" value="true"/>
<Property key="TileV" value="true"/> <Property key="TileV" value="true"/>
</State> </State>
</BasisSkin> </BasisSkin>
<BasisSkin type="TileRect" offset="0 38 40 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH"> <BasisSkin type="TileRect" offset="0 1 2 37" align="ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset="2 40 40 2"> <State name="normal" offset="2 26 2 36">
<Property key="TileSize" value="2 40"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<BasisSkin type="TileRect" offset="38 0 2 40" align="ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset="16 26 2 38">
<Property key="TileSize" value="2 40"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<BasisSkin type="TileRect" offset="0 38 39 2" align="ALIGN_BOTTOM ALIGN_HSTRETCH">
<State name="normal" offset="4 20 40 2">
<Property key="TileSize" value="40 2"/> <Property key="TileSize" value="40 2"/>
<Property key="TileH" value="true"/> <Property key="TileH" value="true"/>
<Property key="TileV" value="true"/> <Property key="TileV" value="true"/>
</State> </State>
</BasisSkin> </BasisSkin>
<BasisSkin type="TileRect" offset="0 2 2 36" align="ALIGN_LEFT ALIGN_VSTRETCH">
<State name="normal" offset="2 4 2 36">
<Property key="TileSize" value="2 36"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<BasisSkin type="TileRect" offset="38 2 2 36" align="ALIGN_RIGHT ALIGN_VSTRETCH">
<State name="normal" offset="40 4 2 36">
<Property key="TileSize" value="2 36"/>
<Property key="TileH" value="true"/>
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
<!-- The interior of the box --> <!-- The interior of the box -->
<Child type="Widget" skin="DialogBG" offset="2 2 36 36" align="ALIGN_STRETCH" name="Client"/> <Child type="Widget" skin="DialogBG" offset="2 2 36 36" align="ALIGN_STRETCH" name="Client"/>
</Skin> </Skin>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout"> <MyGUI type="Layout">
<Widget type="Window" skin="MW_Window_Pinnable" layer="Windows" position="0 0 600 300" name="_Main"> <Widget type="ExposedWindow" skin="MW_Window_Pinnable" layer="Windows" position="0 0 600 300" name="_Main">
<Widget type="Widget" skin="" position="0 0 224 223" align="Left Top" name="LeftPane"> <Widget type="Widget" skin="" position="0 0 224 223" align="Left Top" name="LeftPane">

View file

@ -6,12 +6,12 @@
<Widget type="ImageBox" skin="ImageBox" position="0 0 300 300" align="Stretch" name="BackgroundImage"> <Widget type="ImageBox" skin="ImageBox" position="0 0 300 300" align="Stretch" name="BackgroundImage">
<Widget type="Widget" skin="HUD_Box" position="0 200 300 70" align="Bottom HCenter"> <Widget type="Widget" skin="HUD_Box" position="0 200 300 60" align="Bottom HCenter">
<Widget type="AutoSizedTextBox" skin="SandText" position="20 12 260 24" name="LoadingText"> <Widget type="AutoSizedTextBox" skin="SandText" position="20 12 260 24" name="LoadingText">
</Widget> </Widget>
<Widget type="ProgressBar" skin="MW_Progress_Blue" position="20 38 260 24" name="ProgressBar"> <Widget type="ProgressBar" skin="MW_Progress_Loading" position="20 36 260 8" name="ProgressBar">
<Property key="Range" value="1000"/> <Property key="Range" value="1000"/>
</Widget> </Widget>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout"> <MyGUI type="Layout">
<Widget type="Window" skin="MW_Window_Pinnable" layer="Windows" position="0 0 300 300" name="_Main"> <Widget type="ExposedWindow" skin="MW_Window_Pinnable" layer="Windows" position="0 0 300 300" name="_Main">
<!-- Local map --> <!-- Local map -->
<Widget type="ScrollView" skin="MW_MapView" position="0 0 284 264" align="ALIGN_STRETCH" name="LocalMap"> <Widget type="ScrollView" skin="MW_MapView" position="0 0 284 264" align="ALIGN_STRETCH" name="LocalMap">

View file

@ -17,6 +17,11 @@
<State name="normal" offset = "0 28 2 14"/> <State name="normal" offset = "0 28 2 14"/>
</BasisSkin> </BasisSkin>
</Skin> </Skin>
<Skin name = "MW_BigTrack_Progress_Blue_Small" size = "2 6" texture = "smallbars.png" >
<BasisSkin type="MainSkin" offset = "0 0 2 6" align = "ALIGN_STRETCH">
<State name="normal" offset = "0 26 2 6"/>
</BasisSkin>
</Skin>
<Skin name = "ProgressText" size = "16 16"> <Skin name = "ProgressText" size = "16 16">
<Property key="FontName" value = "Default"/> <Property key="FontName" value = "Default"/>
@ -51,4 +56,12 @@
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="ALIGN_STRETCH"/> <Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="ALIGN_STRETCH"/>
<Child type="Widget" skin="BlackBG" offset = "2 2 60 8" align = "ALIGN_STRETCH" name="Client"/> <Child type="Widget" skin="BlackBG" offset = "2 2 60 8" align = "ALIGN_STRETCH" name="Client"/>
</Skin> </Skin>
<Skin name="MW_Progress_Loading" size="64 6">
<Property key="TrackSkin" value = "MW_BigTrack_Progress_Blue_Small" />
<Property key="TrackWidth" value = "1" />
<Child type="Widget" skin="MW_Box" offset="0 0 64 6" align="ALIGN_STRETCH"/>
<Child type="Widget" skin="BlackBG" offset = "2 2 60 2" align = "ALIGN_STRETCH" name="Client"/>
</Skin>
</MyGUI> </MyGUI>

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout"> <MyGUI type="Layout">
<Widget type="Window" skin="MW_Window_Pinnable" layer="Windows" position="0 0 300 600" name="_Main"> <Widget type="ExposedWindow" skin="MW_Window_Pinnable" layer="Windows" position="0 0 300 600" name="_Main">
<!-- Effect box--> <!-- Effect box-->
<Widget type="Widget" skin="MW_Box" position="8 8 268 24" align="Left Top HStretch"> <Widget type="Widget" skin="MW_Box" position="8 8 268 24" align="Left Top HStretch">

View file

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout"> <MyGUI type="Layout">
<Widget type="Window" skin="MW_Window_Pinnable" layer="Windows" position="0 0 500 342" name="_Main"> <Widget type="ExposedWindow" skin="MW_Window_Pinnable" layer="Windows" position="0 0 500 342" name="_Main">
<Widget type="Widget" skin="" name="LeftPane" position="0 0 220 342"> <Widget type="Widget" skin="" name="LeftPane" position="0 0 220 342">

View file

@ -8,6 +8,118 @@
</BasisSkin> </BasisSkin>
</Skin> </Skin>
<!-- Define the borders for pin button (up) -->
<Skin name="PU_B" size="12 2" texture="textures\menu_rightbuttonup_bottom.dds">
<BasisSkin type="MainSkin" offset = "0 0 12 2">
<State name="normal" offset = "0 0 12 2"/>
</BasisSkin>
</Skin>
<Skin name="PU_BR" size="2 2" texture="textures\menu_rightbuttonup_bottom_right.dds">
<BasisSkin type="MainSkin" offset = "0 0 2 2">
<State name="normal" offset = "0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="PU_R" size="2 12" texture="textures\menu_rightbuttonup_right.dds">
<BasisSkin type="MainSkin" offset = "0 0 2 12">
<State name="normal" offset = "0 0 2 12"/>
</BasisSkin>
</Skin>
<Skin name="PU_TR" size="2 2" texture="textures\menu_rightbuttonup_top_right.dds">
<BasisSkin type="MainSkin" offset = "0 0 2 2">
<State name="normal" offset = "0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="PU_T" size="12 2" texture="textures\menu_rightbuttonup_top.dds">
<BasisSkin type="MainSkin" offset = "0 0 12 2">
<State name="normal" offset = "0 0 12 2"/>
</BasisSkin>
</Skin>
<Skin name="PU_TL" size="2 2" texture="textures\menu_rightbuttonup_top_left.dds">
<BasisSkin type="MainSkin" offset = "0 0 2 2">
<State name="normal" offset = "0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="PU_L" size="2 12" texture="textures\menu_rightbuttonup_left.dds">
<BasisSkin type="MainSkin" offset = "0 0 2 12">
<State name="normal" offset = "0 0 2 12"/>
</BasisSkin>
</Skin>
<Skin name="PU_BL" size="2 2" texture="textures\menu_rightbuttonup_bottom_left.dds">
<BasisSkin type="MainSkin" offset = "0 0 2 2">
<State name="normal" offset = "0 0 2 2"/>
</BasisSkin>
</Skin>
<!-- Define the borders for pin button (down) -->
<Skin name="PD_B" size="12 2" texture="textures\menu_rightbuttondown_bottom.dds">
<BasisSkin type="MainSkin" offset = "0 0 12 2">
<State name="normal" offset = "0 0 12 2"/>
</BasisSkin>
</Skin>
<Skin name="PD_BR" size="2 2" texture="textures\menu_rightbuttondown_bottom_right.dds">
<BasisSkin type="MainSkin" offset = "0 0 2 2">
<State name="normal" offset = "0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="PD_R" size="2 12" texture="textures\menu_rightbuttondown_right.dds">
<BasisSkin type="MainSkin" offset = "0 0 2 12">
<State name="normal" offset = "0 0 2 12"/>
</BasisSkin>
</Skin>
<Skin name="PD_TR" size="2 2" texture="textures\menu_rightbuttondown_top_right.dds">
<BasisSkin type="MainSkin" offset = "0 0 2 2">
<State name="normal" offset = "0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="PD_T" size="12 2" texture="textures\menu_rightbuttondown_top.dds">
<BasisSkin type="MainSkin" offset = "0 0 12 2">
<State name="normal" offset = "0 0 12 2"/>
</BasisSkin>
</Skin>
<Skin name="PD_TL" size="2 2" texture="textures\menu_rightbuttondown_top_left.dds">
<BasisSkin type="MainSkin" offset = "0 0 2 2">
<State name="normal" offset = "0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="PD_L" size="2 12" texture="textures\menu_rightbuttondown_left.dds">
<BasisSkin type="MainSkin" offset = "0 0 2 12">
<State name="normal" offset = "0 0 2 12"/>
</BasisSkin>
</Skin>
<Skin name="PD_BL" size="2 2" texture="textures\menu_rightbuttondown_bottom_left.dds">
<BasisSkin type="MainSkin" offset = "0 0 2 2">
<State name="normal" offset = "0 0 2 2"/>
</BasisSkin>
</Skin>
<!-- Define the pin button skin -->
<Skin name = "PinUp" size = "19 19" texture="textures\menu_rightbuttonup_center.dds">
<BasisSkin type="MainSkin" offset = "0 0 19 19">
<State name="normal" offset = "0 0 19 19"/>
</BasisSkin>
<Child type="Widget" skin="PU_B" offset="2 17 15 2" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PU_BR" offset="17 17 2 2" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PU_R" offset="17 2 2 15" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PU_TR" offset="17 0 2 2" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PU_T" offset="2 0 15 2" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PU_TL" offset="0 0 2 2" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PU_L" offset="0 2 2 15" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PU_BL" offset="0 17 2 2" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
</Skin>
<Skin name = "PinDown" size = "19 19" texture="textures\menu_rightbuttondown_center.dds">
<BasisSkin type="MainSkin" offset = "0 0 19 19">
<State name="normal" offset = "0 0 19 19"/>
</BasisSkin>
<Child type="Widget" skin="PD_B" offset="2 17 15 2" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PD_BR" offset="17 17 2 2" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PD_R" offset="17 2 2 15" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PD_TR" offset="17 0 2 2" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PD_T" offset="2 0 15 2" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PD_TL" offset="0 0 2 2" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PD_L" offset="0 2 2 15" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
<Child type="Widget" skin="PD_BL" offset="0 17 2 2" align="ALIGN_HSTRETCH ALIGN_VSTRETCH"/>
</Skin>
<!-- Defines a pure black background --> <!-- Defines a pure black background -->
<Skin name = "DialogBG" size = "8 8" texture = "black.png"> <Skin name = "DialogBG" size = "8 8" texture = "black.png">
<BasisSkin type="MainSkin" offset = "0 0 8 8"> <BasisSkin type="MainSkin" offset = "0 0 8 8">
@ -473,9 +585,7 @@
<Property key="Scale" value = "1 1 0 0"/> <Property key="Scale" value = "1 1 0 0"/>
</Child> </Child>
<Child type="Button" skin="BlackBG" offset="230 4 21 19" align="ALIGN_RIGHT ALIGN_TOP" name="Button"> <Child type="Button" skin="PinUp" offset="232 4 19 19" align="ALIGN_RIGHT ALIGN_TOP" name="Button"/>
<Property key="Event" value="PinToggle"/>
</Child>
</Skin> </Skin>
<Skin name = "MW_Dialog" size = "256 54"> <Skin name = "MW_Dialog" size = "256 54">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 246 B

After

Width:  |  Height:  |  Size: 3.1 KiB