Merge branch 'master' of https://github.com/zinnschlag/openmw into tgm

actorid
mckibbenta 12 years ago
commit f65172bdca

1
.gitignore vendored

@ -21,3 +21,4 @@ CMakeLists.txt.user
.cproject
.project
.settings/
.directory

@ -8,6 +8,8 @@
#include <components/misc/stringops.hpp>
#include "../world/columns.hpp"
#include "../world/data.hpp"
#include "../world/idcollection.hpp"
#include "booleannode.hpp"
#include "ornode.hpp"
@ -31,6 +33,7 @@ namespace CSMFilter
Type_OpenSquare,
Type_CloseSquare,
Type_Comma,
Type_OneShot,
Type_Keyword_True, ///< \attention Keyword enums must be arranged continuously.
Type_Keyword_False,
Type_Keyword_And,
@ -44,7 +47,7 @@ namespace CSMFilter
std::string mString;
double mNumber;
Token (Type type);
Token (Type type = Type_None);
Token (const std::string& string);
@ -89,7 +92,7 @@ CSMFilter::Token CSMFilter::Parser::getStringToken()
{
char c = mInput[mIndex];
if (std::isalpha (c) || c=='_' || (!string.empty() && std::isdigit (c)) || c=='"' ||
if (std::isalpha (c) || c==':' || c=='_' || (!string.empty() && std::isdigit (c)) || c=='"' ||
(!string.empty() && string[0]=='"'))
string += c;
else
@ -171,14 +174,14 @@ CSMFilter::Token CSMFilter::Parser::checkKeywords (const Token& token)
{
"true", "false",
"and", "or", "not",
"text", "value",
"string", "value",
0
};
std::string string = Misc::StringUtils::lowerCase (token.mString);
for (int i=0; sKeywords[i]; ++i)
if (sKeywords[i]==string)
if (sKeywords[i]==string || (string.size()==1 && sKeywords[i][0]==string[0]))
return Token (static_cast<Token::Type> (i+Token::Type_Keyword_True));
return token;
@ -208,9 +211,10 @@ CSMFilter::Token CSMFilter::Parser::getNextToken()
case '[': ++mIndex; return Token (Token::Type_OpenSquare);
case ']': ++mIndex; return Token (Token::Type_CloseSquare);
case ',': ++mIndex; return Token (Token::Type_Comma);
case '!': ++mIndex; return Token (Token::Type_OneShot);
}
if (c=='"' || c=='_' || std::isalpha (c))
if (c=='"' || c=='_' || std::isalpha (c) || c==':')
return getStringToken();
if (c=='-' || c=='.' || std::isdigit (c))
@ -220,54 +224,58 @@ CSMFilter::Token CSMFilter::Parser::getNextToken()
return Token (Token::Type_None);
}
boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseImp (bool allowEmpty)
boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::parseImp (bool allowEmpty, bool ignoreOneShot)
{
if (Token token = getNextToken())
{
switch (token.mType)
{
case Token::Type_Keyword_True:
if (token==Token (Token::Type_OneShot))
token = getNextToken();
return boost::shared_ptr<CSMFilter::Node> (new BooleanNode (true));
if (token)
switch (token.mType)
{
case Token::Type_Keyword_True:
case Token::Type_Keyword_False:
return boost::shared_ptr<CSMFilter::Node> (new BooleanNode (true));
return boost::shared_ptr<CSMFilter::Node> (new BooleanNode (false));
case Token::Type_Keyword_False:
case Token::Type_Keyword_And:
case Token::Type_Keyword_Or:
return boost::shared_ptr<CSMFilter::Node> (new BooleanNode (false));
return parseNAry (token);
case Token::Type_Keyword_And:
case Token::Type_Keyword_Or:
case Token::Type_Keyword_Not:
{
boost::shared_ptr<CSMFilter::Node> node = parseImp();
return parseNAry (token);
if (mError)
return boost::shared_ptr<Node>();
case Token::Type_Keyword_Not:
{
boost::shared_ptr<CSMFilter::Node> node = parseImp();
return boost::shared_ptr<CSMFilter::Node> (new NotNode (node));
}
if (mError)
return boost::shared_ptr<Node>();
case Token::Type_Keyword_Text:
return boost::shared_ptr<CSMFilter::Node> (new NotNode (node));
}
return parseText();
case Token::Type_Keyword_Text:
case Token::Type_Keyword_Value:
return parseText();
return parseValue();
case Token::Type_Keyword_Value:
case Token::Type_EOS:
return parseValue();
if (!allowEmpty)
error();
case Token::Type_EOS:
return boost::shared_ptr<Node>();
if (!allowEmpty)
error();
default:
return boost::shared_ptr<Node>();
error();
}
default:
error();
}
}
return boost::shared_ptr<Node>();
@ -506,9 +514,10 @@ void CSMFilter::Parser::error()
mError = true;
}
CSMFilter::Parser::Parser() : mIndex (0), mError (false) {}
CSMFilter::Parser::Parser (const CSMWorld::Data& data)
: mIndex (0), mError (false), mData (data) {}
bool CSMFilter::Parser::parse (const std::string& filter)
bool CSMFilter::Parser::parse (const std::string& filter, bool allowPredefined)
{
// reset
mFilter.reset();
@ -516,23 +525,65 @@ bool CSMFilter::Parser::parse (const std::string& filter)
mInput = filter;
mIndex = 0;
boost::shared_ptr<Node> node = parseImp (true);
Token token;
if (mError)
return false;
if (allowPredefined)
token = getNextToken();
if (getNextToken()!=Token (Token::Type_EOS))
return false;
if (!allowPredefined || token==Token (Token::Type_OneShot))
{
boost::shared_ptr<Node> node = parseImp (true, token!=Token (Token::Type_OneShot));
if (node)
mFilter = node;
if (mError)
return false;
if (getNextToken()!=Token (Token::Type_EOS))
{
error();
return false;
}
if (node)
mFilter = node;
else
{
// Empty filter string equals to filter "true".
mFilter.reset (new BooleanNode (true));
}
return true;
}
else if (token.mType==Token::Type_String && allowPredefined)
{
if (getNextToken()!=Token (Token::Type_EOS))
{
error();
return false;
}
int index = mData.getFilters().searchId (token.mString);
if (index==-1)
{
error();
return false;
}
const CSMWorld::Record<CSMFilter::Filter>& record = mData.getFilters().getRecord (index);
if (record.isDeleted())
{
error();
return false;
}
return parse (record.get().mFilter, false);
}
else
{
// Empty filter string equals to filter "true".
mFilter.reset (new BooleanNode (true));
error();
return false;
}
return true;
}
boost::shared_ptr<CSMFilter::Node> CSMFilter::Parser::getFilter() const

@ -5,6 +5,11 @@
#include "node.hpp"
namespace CSMWorld
{
class Data;
}
namespace CSMFilter
{
struct Token;
@ -15,6 +20,7 @@ namespace CSMFilter
std::string mInput;
int mIndex;
bool mError;
const CSMWorld::Data& mData;
Token getStringToken();
@ -25,7 +31,7 @@ namespace CSMFilter
Token checkKeywords (const Token& token);
///< Turn string token into keyword token, if possible.
boost::shared_ptr<Node> parseImp (bool allowEmpty = false);
boost::shared_ptr<Node> parseImp (bool allowEmpty = false, bool ignoreOneShot = false);
///< Will return a null-pointer, if there is nothing more to parse.
boost::shared_ptr<Node> parseNAry (const Token& keyword);
@ -38,9 +44,9 @@ namespace CSMFilter
public:
Parser();
Parser (const CSMWorld::Data& data);
bool parse (const std::string& filter);
bool parse (const std::string& filter, bool allowPredefined = true);
///< Discards any previous calls to parse
///
/// \return Success?

@ -7,7 +7,7 @@ void CSMWorld::Cell::load (ESM::ESMReader &esm)
{
mName = mId;
ESM::Cell::load (esm, true); /// \todo set this to false, once the bug in ESM::Cell::load is fixed
ESM::Cell::load (esm, false);
if (!(mData.mFlags & Interior))
{

@ -236,14 +236,15 @@ namespace CSMWorld
if (iter->second>=index+count)
{
iter->second -= count;
++iter;
}
else
{
mIndex.erase (iter++);
}
}
++iter;
else
++iter;
}
}

@ -1191,6 +1191,31 @@ namespace CSMWorld
return true;
}
};
template<typename ESXRecordT>
struct FilterColumn : public Column<ESXRecordT>
{
FilterColumn() : Column<ESXRecordT> (Columns::ColumnId_Filter, ColumnBase::Display_String) {}
virtual QVariant get (const Record<ESXRecordT>& record) const
{
return QString::fromUtf8 (record.get().mFilter.c_str());
}
virtual void set (Record<ESXRecordT>& record, const QVariant& data)
{
ESXRecordT record2 = record.get();
record2.mFilter = data.toString().toUtf8().constData();
record.setModified (record2);
}
virtual bool isEditable() const
{
return true;
}
};
}
#endif

@ -144,6 +144,7 @@ namespace CSMWorld
{ ColumnId_MaxThrust, "Max Thrust" },
{ ColumnId_Magical, "Magical" },
{ ColumnId_Silver, "Silver" },
{ ColumnId_Filter, "Filter" },
{ ColumnId_UseValue1, "Use value 1" },
{ ColumnId_UseValue2, "Use value 2" },

@ -138,6 +138,7 @@ namespace CSMWorld
ColumnId_MaxThrust = 106,
ColumnId_Magical = 107,
ColumnId_Silver = 108,
ColumnId_Filter = 109,
// Allocated to a separate value range, so we don't get a collision should we ever need
// to extend the number of use values.

@ -69,7 +69,9 @@ CSMWorld::RevertCommand::~RevertCommand()
void CSMWorld::RevertCommand::redo()
{
QModelIndex index = mModel.getModelIndex (mId, 1);
int column = mModel.findColumnIndex (Columns::ColumnId_Modification);
QModelIndex index = mModel.getModelIndex (mId, column);
RecordBase::State state = static_cast<RecordBase::State> (mModel.data (index).toInt());
if (state==RecordBase::State_ModifiedOnly)
@ -102,7 +104,9 @@ CSMWorld::DeleteCommand::~DeleteCommand()
void CSMWorld::DeleteCommand::redo()
{
QModelIndex index = mModel.getModelIndex (mId, 1);
int column = mModel.findColumnIndex (Columns::ColumnId_Modification);
QModelIndex index = mModel.getModelIndex (mId, column);
RecordBase::State state = static_cast<RecordBase::State> (mModel.data (index).toInt());
if (state==RecordBase::State_ModifiedOnly)

@ -150,6 +150,7 @@ CSMWorld::Data::Data() : mRefs (mCells)
mFilters.addColumn (new StringIdColumn<CSMFilter::Filter>);
mFilters.addColumn (new RecordStateColumn<CSMFilter::Filter>);
mFilters.addColumn (new FilterColumn<CSMFilter::Filter>);
mFilters.addColumn (new DescriptionColumn<CSMFilter::Filter>);
addModel (new IdTable (&mGlobals), UniversalId::Type_Globals, UniversalId::Type_Global);
@ -316,6 +317,16 @@ CSMWorld::RefCollection& CSMWorld::Data::getReferences()
return mRefs;
}
const CSMWorld::IdCollection<CSMFilter::Filter>& CSMWorld::Data::getFilters() const
{
return mFilters;
}
CSMWorld::IdCollection<CSMFilter::Filter>& CSMWorld::Data::getFilters()
{
return mFilters;
}
QAbstractItemModel *CSMWorld::Data::getTableModel (const UniversalId& id)
{
std::map<UniversalId::Type, QAbstractItemModel *>::iterator iter = mModelIndex.find (id.getType());

@ -119,6 +119,10 @@ namespace CSMWorld
RefCollection& getReferences();
const IdCollection<CSMFilter::Filter>& getFilters() const;
IdCollection<CSMFilter::Filter>& getFilters();
QAbstractItemModel *getTableModel (const UniversalId& id);
///< If no table model is available for \a id, an exception is thrown.
///

@ -8,8 +8,6 @@ void CSMWorld::CellRef::load (ESM::ESMReader &esm, Cell& cell, const std::string
mId = id;
mCellId = cell.mId;
cell.getNextRef (esm, *this);
if (!mDeleted)
cell.addRef (mId);
}

@ -1,11 +1,27 @@
#include "editwidget.hpp"
CSVFilter::EditWidget::EditWidget (QWidget *parent)
: QLineEdit (parent)
#include <QAbstractItemModel>
#include "../../model/world/data.hpp"
CSVFilter::EditWidget::EditWidget (CSMWorld::Data& data, QWidget *parent)
: QLineEdit (parent), mParser (data)
{
mPalette = palette();
connect (this, SIGNAL (textChanged (const QString&)), this, SLOT (textChanged (const QString&)));
QAbstractItemModel *model = data.getTableModel (CSMWorld::UniversalId::Type_Filters);
connect (model, SIGNAL (dataChanged (const QModelIndex &, const QModelIndex&)),
this, SLOT (filterDataChanged (const QModelIndex &, const QModelIndex&)),
Qt::QueuedConnection);
connect (model, SIGNAL (rowsRemoved (const QModelIndex&, int, int)),
this, SLOT (filterRowsRemoved (const QModelIndex&, int, int)),
Qt::QueuedConnection);
connect (model, SIGNAL (rowsInserted (const QModelIndex&, int, int)),
this, SLOT (filterRowsInserted (const QModelIndex&, int, int)),
Qt::QueuedConnection);
}
void CSVFilter::EditWidget::textChanged (const QString& text)
@ -23,4 +39,20 @@ void CSVFilter::EditWidget::textChanged (const QString& text)
/// \todo improve error reporting; mark only the faulty part
}
}
}
void CSVFilter::EditWidget::filterDataChanged (const QModelIndex& topLeft,
const QModelIndex& bottomRight)
{
textChanged (text());
}
void CSVFilter::EditWidget::filterRowsRemoved (const QModelIndex& parent, int start, int end)
{
textChanged (text());
}
void CSVFilter::EditWidget::filterRowsInserted (const QModelIndex& parent, int start, int end)
{
textChanged (text());
}

@ -9,6 +9,13 @@
#include "../../model/filter/parser.hpp"
#include "../../model/filter/node.hpp"
class QModelIndex;
namespace CSMWorld
{
class Data;
}
namespace CSVFilter
{
class EditWidget : public QLineEdit
@ -20,7 +27,7 @@ namespace CSVFilter
public:
EditWidget (QWidget *parent = 0);
EditWidget (CSMWorld::Data& data, QWidget *parent = 0);
signals:
@ -29,6 +36,12 @@ namespace CSVFilter
private slots:
void textChanged (const QString& text);
void filterDataChanged (const QModelIndex& topLeft, const QModelIndex& bottomRight);
void filterRowsRemoved (const QModelIndex& parent, int start, int end);
void filterRowsInserted (const QModelIndex& parent, int start, int end);
};
}

@ -5,14 +5,14 @@
#include "recordfilterbox.hpp"
CSVFilter::FilterBox::FilterBox (QWidget *parent)
CSVFilter::FilterBox::FilterBox (CSMWorld::Data& data, QWidget *parent)
: QWidget (parent)
{
QHBoxLayout *layout = new QHBoxLayout (this);
layout->setContentsMargins (0, 0, 0, 0);
RecordFilterBox *recordFilterBox = new RecordFilterBox (this);
RecordFilterBox *recordFilterBox = new RecordFilterBox (data, this);
layout->addWidget (recordFilterBox);

@ -5,6 +5,11 @@
#include "../../model/filter/node.hpp"
namespace CSMWorld
{
class Data;
}
namespace CSVFilter
{
class FilterBox : public QWidget
@ -13,7 +18,7 @@ namespace CSVFilter
public:
FilterBox (QWidget *parent = 0);
FilterBox (CSMWorld::Data& data, QWidget *parent = 0);
signals:

@ -6,7 +6,7 @@
#include "editwidget.hpp"
CSVFilter::RecordFilterBox::RecordFilterBox (QWidget *parent)
CSVFilter::RecordFilterBox::RecordFilterBox (CSMWorld::Data& data, QWidget *parent)
: QWidget (parent)
{
QHBoxLayout *layout = new QHBoxLayout (this);
@ -15,7 +15,7 @@ CSVFilter::RecordFilterBox::RecordFilterBox (QWidget *parent)
layout->addWidget (new QLabel ("Record Filter", this));
EditWidget *editWidget = new EditWidget (this);
EditWidget *editWidget = new EditWidget (data, this);
layout->addWidget (editWidget);

@ -9,6 +9,11 @@
#include "../../model/filter/node.hpp"
namespace CSMWorld
{
class Data;
}
namespace CSVFilter
{
class RecordFilterBox : public QWidget
@ -17,7 +22,7 @@ namespace CSVFilter
public:
RecordFilterBox (QWidget *parent = 0);
RecordFilterBox (CSMWorld::Data& data, QWidget *parent = 0);
signals:

@ -25,7 +25,7 @@ CSVWorld::TableSubView::TableSubView (const CSMWorld::UniversalId& id, CSMDoc::D
layout->insertWidget (0, mTable =
new Table (id, document.getData(), document.getUndoStack(), mBottom->canCreateAndDelete()), 2);
CSVFilter::FilterBox *filterBox = new CSVFilter::FilterBox (this);
CSVFilter::FilterBox *filterBox = new CSVFilter::FilterBox (document.getData(), this);
layout->insertWidget (0, filterBox);

@ -123,6 +123,7 @@ bool OMW::Engine::frameRenderingQueued (const Ogre::FrameEvent& evt)
MWBase::Environment::get().getWindowManager()->wmUpdateFps(window->getLastFPS(), tri, batch);
MWBase::Environment::get().getWindowManager()->onFrame(frametime);
MWBase::Environment::get().getWindowManager()->update();
}
catch (const std::exception& e)
{
@ -385,26 +386,39 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
loadBSA();
// Create input and UI first to set up a bootstrapping environment for
// showing a loading screen and keeping the window responsive while doing so
std::string keybinderUser = (mCfgMgr.getUserPath() / "input.xml").string();
bool keybinderUserExists = boost::filesystem::exists(keybinderUser);
MWInput::InputManager* input = new MWInput::InputManager (*mOgre, *this, keybinderUser, keybinderUserExists);
mEnvironment.setInputManager (input);
MWGui::WindowManager* window = new MWGui::WindowManager(
mExtensions, mFpsLevel, mOgre, mCfgMgr.getLogPath().string() + std::string("/"),
mCfgMgr.getCachePath ().string(), mScriptConsoleMode, mTranslationDataStorage, mEncoding);
mEnvironment.setWindowManager (window);
if (mNewGame)
mEnvironment.getWindowManager()->setNewGame(true);
// Create the world
mEnvironment.setWorld( new MWWorld::World (*mOgre, mFileCollections, mMaster, mPlugins,
mResDir, mCfgMgr.getCachePath(), mEncoder, mFallbackMap,
mActivationDistanceOverride));
MWBase::Environment::get().getWorld()->setupPlayer();
input->setPlayer(&mEnvironment.getWorld()->getPlayer());
window->initUI();
window->renderWorldMap();
//Load translation data
mTranslationDataStorage.setEncoder(mEncoder);
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
Compiler::registerExtensions (mExtensions);
mEnvironment.setWindowManager (new MWGui::WindowManager(
mExtensions, mFpsLevel, mOgre, mCfgMgr.getLogPath().string() + std::string("/"),
mCfgMgr.getCachePath ().string(), mScriptConsoleMode, mTranslationDataStorage, mEncoding));
if (mNewGame)
mEnvironment.getWindowManager()->setNewGame(true);
// Create sound system
mEnvironment.setSoundManager (new MWSound::SoundManager(mUseSound));
@ -422,16 +436,6 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
mEnvironment.setJournal (new MWDialogue::Journal);
mEnvironment.setDialogueManager (new MWDialogue::DialogueManager (mExtensions, mVerboseScripts, mTranslationDataStorage));
// Sets up the input system
// Get the path for the keybinder xml file
std::string keybinderUser = (mCfgMgr.getUserPath() / "input.xml").string();
bool keybinderUserExists = boost::filesystem::exists(keybinderUser);
mEnvironment.setInputManager (new MWInput::InputManager (*mOgre,
MWBase::Environment::get().getWorld()->getPlayer(),
*MWBase::Environment::get().getWindowManager(), *this, keybinderUser, keybinderUserExists));
mEnvironment.getWorld()->renderPlayer();
if (!mNewGame)

@ -39,9 +39,11 @@ namespace MWBase
Play_Normal = 0, /* tracked, non-looping, multi-instance, environment */
Play_Loop = 1<<0, /* Sound will continually loop until explicitly stopped */
Play_NoEnv = 1<<1, /* Do not apply environment effects (eg, underwater filters) */
Play_NoTrack = 1<<2 /* (3D only) Play the sound at the given object's position
Play_NoTrack = 1<<2, /* (3D only) Play the sound at the given object's position
* but do not keep it updated (the sound will not move with
* the object and will not stop when the object is deleted. */
Play_LoopNoEnv = Play_Loop | Play_NoEnv
};
enum PlayType {
Play_TypeSfx = 1<<3, /* Normal SFX sound */

@ -9,6 +9,8 @@
#include <components/translation/translation.hpp>
#include <components/loadinglistener/loadinglistener.hpp>
#include "../mwmechanics/stat.hpp"
#include "../mwgui/mode.hpp"
@ -253,9 +255,6 @@ namespace MWBase
virtual void executeInConsole (const std::string& path) = 0;
virtual void setLoadingProgress (const std::string& stage, int depth, int current, int total) = 0;
virtual void loadingDone() = 0;
virtual void enableRest() = 0;
virtual bool getRestEnabled() = 0;
virtual bool getJournalAllowed() = 0;
@ -282,6 +281,8 @@ namespace MWBase
virtual const Translation::Storage& getTranslationDataStorage() const = 0;
virtual void setKeyFocusWidget (MyGUI::Widget* widget) = 0;
virtual Loading::Listener* getLoadingScreen() = 0;
};
}

@ -6,19 +6,26 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/mechanicsmanager.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld//cellstore.hpp"
#include "../mwworld/ptr.hpp"
#include "../mwworld/physicssystem.hpp"
#include "../mwworld/action.hpp"
#include "../mwworld/failedaction.hpp"
#include "../mwworld/nullaction.hpp"
#include "../mwrender/actors.hpp"
#include "../mwrender/renderinginterface.hpp"
#include "../mwgui/tooltips.hpp"
#include "../mwmechanics/npcstats.hpp"
namespace MWClass
{
void Activator::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
void Activator::insertObjectRendering (const MWWorld::Ptr& ptr, MWRender::RenderingInterface& renderingInterface) const
{
const std::string model = getModel(ptr);
if (!model.empty()) {
@ -94,7 +101,23 @@ namespace MWClass
return info;
}
boost::shared_ptr<MWWorld::Action> Activator::activate(const MWWorld::Ptr &ptr, const MWWorld::Ptr &actor) const
{
if(get(actor).isNpc() && get(actor).getNpcStats(actor).isWerewolf())
{
const MWWorld::ESMStore &store = MWBase::Environment::get().getWorld()->getStore();
const ESM::Sound *sound = store.get<ESM::Sound>().searchRandom("WolfActivator");
boost::shared_ptr<MWWorld::Action> action(new MWWorld::FailedAction("#{sWerewolfRefusal}"));
if(sound) action->setSound(sound->mId);
return action;
}
return boost::shared_ptr<MWWorld::Action>(new MWWorld::NullAction);
}
MWWorld::Ptr
Activator::copyToCellImpl(const MWWorld::Ptr &ptr, MWWorld::CellStore &cell) const
{

@ -31,6 +31,9 @@ namespace MWClass
virtual std::string getScript (const MWWorld::Ptr& ptr) const;
///< Return name of the script attached to ptr
virtual boost::shared_ptr<MWWorld::Action> activate (const MWWorld::Ptr& ptr, const MWWorld::Ptr& actor) const;
///< Generate action for activation
static void registerSelf();
virtual std::string getModel(const MWWorld::Ptr &ptr) const;

@ -88,8 +88,13 @@ namespace MWGui
mDragAndDropWidget->setVisible(false);
targetModel->copyItem(mItem, mDraggedCount);
mSourceModel->removeItem(mItem, mDraggedCount);
// If item is dropped where it was taken from, we don't need to do anything -
// otherwise, do the transfer
if (targetModel != mSourceModel)
{
targetModel->copyItem(mItem, mDraggedCount);
mSourceModel->removeItem(mItem, mDraggedCount);
}
mSourceModel->update();

@ -74,13 +74,12 @@ ItemModel::ModelIndex ContainerItemModel::getIndex (ItemStack item)
void ContainerItemModel::copyItem (const ItemStack& item, size_t count)
{
const MWWorld::Ptr& source = mItemSources[mItemSources.size()-1];
if (item.mBase.getContainerStore() == &source.getClass().getContainerStore(source))
throw std::runtime_error("Item to copy needs to be from a different container!");
int origCount = item.mBase.getRefData().getCount();
item.mBase.getRefData().setCount(count);
MWWorld::ContainerStoreIterator it = MWWorld::Class::get(source).getContainerStore(source).add(item.mBase, source);
if (*it != item.mBase)
item.mBase.getRefData().setCount(origCount);
else
item.mBase.getRefData().setCount(origCount + count); // item copied onto itself
source.getClass().getContainerStore(source).add(item.mBase, source);
item.mBase.getRefData().setCount(origCount);
}
void ContainerItemModel::removeItem (const ItemStack& item, size_t count)

@ -40,13 +40,12 @@ ItemModel::ModelIndex InventoryItemModel::getIndex (ItemStack item)
void InventoryItemModel::copyItem (const ItemStack& item, size_t count)
{
if (item.mBase.getContainerStore() == &mActor.getClass().getContainerStore(mActor))
throw std::runtime_error("Item to copy needs to be from a different container!");
int origCount = item.mBase.getRefData().getCount();
item.mBase.getRefData().setCount(count);
MWWorld::ContainerStoreIterator it = MWWorld::Class::get(mActor).getContainerStore(mActor).add(item.mBase, mActor);
if (*it != item.mBase)
item.mBase.getRefData().setCount(origCount);
else
item.mBase.getRefData().setCount(origCount + count); // item copied onto itself
mActor.getClass().getContainerStore(mActor).add(item.mBase, mActor);
item.mBase.getRefData().setCount(origCount);
}

@ -19,20 +19,16 @@ namespace MWGui
: mSceneMgr(sceneMgr)
, mWindow(rw)
, WindowBase("openmw_loading_screen.layout")
, mLoadingOn(false)
, mLastRenderTime(0.f)
, mLastWallpaperChangeTime(0.f)
, mFirstLoad(true)
, mTotalRefsLoading(0)
, mCurrentCellLoading(0)
, mTotalCellsLoading(0)
, mCurrentRefLoading(0)
, mCurrentRefList(0)
, mProgress(0)
{
getWidget(mLoadingText, "LoadingText");
getWidget(mProgressBar, "ProgressBar");
getWidget(mBackgroundImage, "BackgroundImage");
mProgressBar->setScrollViewPage(1);
mBackgroundMaterial = Ogre::MaterialManager::getSingleton().create("BackgroundMaterial", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);
mBackgroundMaterial->getTechnique(0)->getPass(0)->setLightingEnabled(false);
@ -54,6 +50,11 @@ namespace MWGui
mRectangle->setVisible(false);
}
void LoadingScreen::setLabel(const std::string &label)
{
mLoadingText->setCaptionWithReplacing(label);
}
LoadingScreen::~LoadingScreen()
{
delete mRectangle;
@ -64,56 +65,108 @@ namespace MWGui
setCoord(0,0,w,h);
}
void LoadingScreen::setLoadingProgress (const std::string& stage, int depth, int current, int total)
void LoadingScreen::loadingOn()
{
if (!mLoadingOn)
loadingOn();
const int numRefLists = 20;
setVisible(true);
if (depth == 0)
if (mFirstLoad)
{
mCurrentCellLoading = current;
mTotalCellsLoading = total;
mCurrentRefLoading = 0;
mCurrentRefList = 0;
changeWallpaper();
}
else if (depth == 1)
else
{
mCurrentRefLoading = current;
mTotalRefsLoading = total;
mBackgroundImage->setImageTexture("");
}
assert (mTotalCellsLoading != 0);
MWBase::Environment::get().getWindowManager()->pushGuiMode(mFirstLoad ? GM_LoadingWallpaper : GM_Loading);
}
void LoadingScreen::loadingOff()
{
setVisible(false);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Loading);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_LoadingWallpaper);
}
float refProgress;
if (mTotalRefsLoading <= 1)
refProgress = 1;
void LoadingScreen::changeWallpaper ()
{
if (mResources.empty())
{
Ogre::StringVector groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups ();
for (Ogre::StringVector::iterator it = groups.begin(); it != groups.end(); ++it)
{
Ogre::StringVectorPtr resourcesInThisGroup = Ogre::ResourceGroupManager::getSingleton ().findResourceNames (*it, "Splash_*.tga");
mResources.insert(mResources.end(), resourcesInThisGroup->begin(), resourcesInThisGroup->end());
}
}
if (!mResources.empty())
{
std::string const & randomSplash = mResources.at (rand() % mResources.size());
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton ().load (randomSplash, Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
mBackgroundImage->setImageTexture (randomSplash);
}
else
refProgress = float(mCurrentRefLoading) / float(mTotalRefsLoading-1);
refProgress += mCurrentRefList;
refProgress /= numRefLists;
std::cerr << "No loading screens found!" << std::endl;
}
assert(refProgress <= 1 && refProgress >= 0);
void LoadingScreen::setProgressRange (size_t range)
{
mProgressBar->setScrollRange(range+1);
mProgressBar->setScrollPosition(0);
mProgressBar->setTrackSize(0);
mProgress = 0;
}
if (depth == 1 && mCurrentRefLoading == mTotalRefsLoading-1)
++mCurrentRefList;
void LoadingScreen::setProgress (size_t value)
{
assert(value < mProgressBar->getScrollRange());
if (value - mProgress < mProgressBar->getScrollRange()/100.f)
return;
mProgress = value;
mProgressBar->setScrollPosition(0);
mProgressBar->setTrackSize(value / (float)(mProgressBar->getScrollRange()) * mProgressBar->getLineSize());
draw();
}
float progress = (float(mCurrentCellLoading)+refProgress) / float(mTotalCellsLoading);
assert(progress <= 1 && progress >= 0);
void LoadingScreen::increaseProgress (size_t increase)
{
mProgressBar->setScrollPosition(0);
size_t value = mProgress + increase;
mProgress = value;
assert(mProgress < mProgressBar->getScrollRange());
mProgressBar->setTrackSize(value / (float)(mProgressBar->getScrollRange()) * mProgressBar->getLineSize());
draw();
}
mLoadingText->setCaption(stage);
mProgressBar->setProgressPosition (static_cast<size_t>(progress * 1000));
void LoadingScreen::indicateProgress()
{
float time = (mTimer.getMilliseconds() % 2001) / 1000.f;
if (time > 1)
time = (time-2)*-1;
static float loadingScreenFps = 30.f;
mProgressBar->setTrackSize(50);
mProgressBar->setScrollPosition(time * (mProgressBar->getScrollRange()-1));
draw();
}
void LoadingScreen::removeWallpaper()
{
mFirstLoad = false;
}
void LoadingScreen::draw()
{
const float loadingScreenFps = 20.f;
if (mTimer.getMilliseconds () > mLastRenderTime + (1.f/loadingScreenFps) * 1000.f)
{
float dt = mTimer.getMilliseconds () - mLastRenderTime;
mLastRenderTime = mTimer.getMilliseconds ();
if (mFirstLoad && mTimer.getMilliseconds () > mLastWallpaperChangeTime + 3000*1)
if (mFirstLoad && mTimer.getMilliseconds () > mLastWallpaperChangeTime + 5000*1)
{
mLastWallpaperChangeTime = mTimer.getMilliseconds ();
changeWallpaper();
@ -129,8 +182,6 @@ namespace MWGui
}
mSceneMgr->setSpecialCaseRenderQueueMode(Ogre::SceneManager::SCRQM_EXCLUDE);
// always update input before rendering something, otherwise mygui goes crazy when something was entered in the frame before
// (e.g. when using "coc" console command, it would enter an infinite loop and crash due to overflow)
MWBase::Environment::get().getInputManager()->update(0, true);
Ogre::CompositorChain* chain = Ogre::CompositorManager::getSingleton().getCompositorChain(mWindow->getViewport(0));
@ -156,9 +207,13 @@ namespace MWGui
}
}
MWBase::Environment::get().getWorld ()->getFader ()->update (dt);
mWindow->update();
// First, swap buffers from last draw, then, queue an update of the
// window contents, but don't swap buffers (which would have
// caused a sync / flush and would be expensive).
// We're doing this so we can do some actual loading while the GPU is busy with the render.
// This means the render is lagging a frame behind, but this is hardly noticable.
mWindow->swapBuffers(false); // never Vsync, makes no sense here
mWindow->update(false);
if (!hasCompositor)
mWindow->getViewport(0)->setClearEveryFrame(true);
@ -177,62 +232,4 @@ namespace MWGui
mSceneMgr->setSpecialCaseRenderQueueMode(Ogre::SceneManager::SCRQM_EXCLUDE);
}
}
void LoadingScreen::loadingDone()
{
loadingOff();
}
void LoadingScreen::loadingOn()
{
setVisible(true);
mLoadingOn = true;
if (mFirstLoad)
{
changeWallpaper();
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_LoadingWallpaper);
}
else
{
mBackgroundImage->setImageTexture("");
MWBase::Environment::get().getWindowManager()->pushGuiMode(GM_Loading);
}
}
void LoadingScreen::loadingOff()
{
setVisible(false);
mLoadingOn = false;
mFirstLoad = false;
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_Loading);
MWBase::Environment::get().getWindowManager()->removeGuiMode(GM_LoadingWallpaper);
}
void LoadingScreen::changeWallpaper ()
{
if (mResources.empty())
{
Ogre::StringVector groups = Ogre::ResourceGroupManager::getSingleton().getResourceGroups ();
for (Ogre::StringVector::iterator it = groups.begin(); it != groups.end(); ++it)
{
Ogre::StringVectorPtr resourcesInThisGroup = Ogre::ResourceGroupManager::getSingleton ().findResourceNames (*it, "Splash_*.tga");
mResources.insert(mResources.end(), resourcesInThisGroup->begin(), resourcesInThisGroup->end());
}
}
if (!mResources.empty())
{
std::string const & randomSplash = mResources.at (rand() % mResources.size());
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton ().load (randomSplash, Ogre::ResourceGroupManager::AUTODETECT_RESOURCE_GROUP_NAME);
mBackgroundImage->setImageTexture (randomSplash);
}
else
std::cerr << "No loading screens found!" << std::endl;
}
}

@ -5,11 +5,27 @@
#include "windowbase.hpp"
#include <components/loadinglistener/loadinglistener.hpp>
namespace MWGui
{
class LoadingScreen : public WindowBase
class LoadingScreen : public WindowBase, public Loading::Listener
{
public:
virtual void setLabel (const std::string& label);
/// Indicate that some progress has been made, without specifying how much
virtual void indicateProgress ();
virtual void loadingOn();
virtual void loadingOff();
virtual void setProgressRange (size_t range);
virtual void setProgress (size_t value);
virtual void increaseProgress (size_t increase);
virtual void removeWallpaper();
LoadingScreen(Ogre::SceneManager* sceneMgr, Ogre::RenderWindow* rw);
virtual ~LoadingScreen();
@ -30,27 +46,20 @@ namespace MWGui
unsigned long mLastRenderTime;
Ogre::Timer mTimer;
size_t mProgress;
MyGUI::TextBox* mLoadingText;
MyGUI::ProgressBar* mProgressBar;
MyGUI::ScrollBar* mProgressBar;
MyGUI::ImageBox* mBackgroundImage;
int mCurrentCellLoading;
int mTotalCellsLoading;
int mCurrentRefLoading;
int mTotalRefsLoading;
int mCurrentRefList;
Ogre::Rectangle2D* mRectangle;
Ogre::MaterialPtr mBackgroundMaterial;
Ogre::StringVector mResources;
bool mLoadingOn;
void loadingOn();
void loadingOff();
void changeWallpaper();
void draw();
};
}

@ -260,12 +260,10 @@ namespace MWGui
MapWindow::MapWindow(const std::string& cacheDir)
: MWGui::WindowPinnableBase("openmw_map_window.layout")
, mGlobal(false)
, mGlobalMap(0)
{
setCoord(500,0,320,300);
mGlobalMapRender = new MWRender::GlobalMap(cacheDir);
mGlobalMapRender->render();
getWidget(mLocalMap, "LocalMap");
getWidget(mGlobalMap, "GlobalMap");
getWidget(mGlobalMapImage, "GlobalMapImage");
@ -273,9 +271,6 @@ namespace MWGui
getWidget(mPlayerArrowLocal, "CompassLocal");
getWidget(mPlayerArrowGlobal, "CompassGlobal");
mGlobalMapImage->setImageTexture("GlobalMap.png");
mGlobalMapOverlay->setImageTexture("GlobalMapOverlay");
mGlobalMap->setVisible (false);
getWidget(mButton, "WorldButton");
@ -292,6 +287,14 @@ namespace MWGui
LocalMapBase::init(mLocalMap, mPlayerArrowLocal, this);
}
void MapWindow::renderGlobalMap(Loading::Listener* loadingListener)
{
mGlobalMapRender = new MWRender::GlobalMap("");
mGlobalMapRender->render(loadingListener);
mGlobalMapImage->setImageTexture("GlobalMap.png");
mGlobalMapOverlay->setImageTexture("GlobalMapOverlay");
}
MapWindow::~MapWindow()
{
delete mGlobalMapRender;

@ -8,6 +8,11 @@ namespace MWRender
class GlobalMap;
}
namespace Loading
{
class Listener;
}
namespace MWGui
{
class LocalMapBase
@ -71,6 +76,8 @@ namespace MWGui
void setCellName(const std::string& cellName);
void renderGlobalMap(Loading::Listener* loadingListener);
void addVisitedLocation(const std::string& name, int x, int y); // adds the marker to the global map
void cellExplored(int x, int y);

@ -62,6 +62,7 @@ namespace MWGui
const std::string& logpath, const std::string& cacheDir, bool consoleOnlyScripts,
Translation::Storage& translationDataStorage, ToUTF8::FromType encoding)
: mGuiManager(NULL)
, mConsoleOnlyScripts(consoleOnlyScripts)
, mRendering(ogre)
, mHud(NULL)
, mMap(NULL)
@ -156,7 +157,28 @@ namespace MWGui
MyGUI::LanguageManager::getInstance().eventRequestTag = MyGUI::newDelegate(this, &WindowManager::onRetrieveTag);
// Get size info from the Gui object
assert(mGui);
int w = MyGUI::RenderManager::getInstance().getViewSize().width;
int h = MyGUI::RenderManager::getInstance().getViewSize().height;
mLoadingScreen = new LoadingScreen(mRendering->getScene (), mRendering->getWindow ());
mLoadingScreen->onResChange (w,h);
//set up the hardware cursor manager
mSoftwareCursor = new Cursor();
mCursorManager = new SFO::SDLCursorManager();
MyGUI::PointerManager::getInstance().eventChangeMousePointer += MyGUI::newDelegate(this, &WindowManager::onCursorChange);
MyGUI::InputManager::getInstance().eventChangeKeyFocus += MyGUI::newDelegate(this, &WindowManager::onKeyFocusChanged);
setUseHardwareCursors(mUseHardwareCursors);
onCursorChange(MyGUI::PointerManager::getInstance().getDefaultPointer());
mCursorManager->cursorVisibilityChange(false);
}
void WindowManager::initUI()
{
// Get size info from the Gui object
int w = MyGUI::RenderManager::getInstance().getViewSize().width;
int h = MyGUI::RenderManager::getInstance().getViewSize().height;
@ -169,9 +191,9 @@ namespace MWGui
mDragAndDrop->mDragAndDropWidget = dragAndDropWidget;
mMenu = new MainMenu(w,h);
mMap = new MapWindow(cacheDir);
mMap = new MapWindow("");
mStatsWindow = new StatsWindow();
mConsole = new Console(w,h, consoleOnlyScripts);
mConsole = new Console(w,h, mConsoleOnlyScripts);
mJournal = JournalWindow::create(JournalViewModel::create ());
mMessageBoxManager = new MessageBoxManager();
mInventoryWindow = new InventoryWindow(mDragAndDrop);
@ -200,13 +222,8 @@ namespace MWGui
mSoulgemDialog = new SoulgemDialog(mMessageBoxManager);
mCompanionWindow = new CompanionWindow(mDragAndDrop, mMessageBoxManager);
mLoadingScreen = new LoadingScreen(mRendering->getScene (), mRendering->getWindow ());
mLoadingScreen->onResChange (w,h);
mInputBlocker = mGui->createWidget<MyGUI::Widget>("",0,0,w,h,MyGUI::Align::Default,"Windows","");
mSoftwareCursor = new Cursor();
mHud->setVisible(mHudEnabled);
mCharGen = new CharacterCreation();
@ -225,19 +242,15 @@ namespace MWGui
unsetSelectedSpell();
unsetSelectedWeapon();
//set up the hardware cursor manager
mCursorManager = new SFO::SDLCursorManager();
MyGUI::PointerManager::getInstance().eventChangeMousePointer += MyGUI::newDelegate(this, &WindowManager::onCursorChange);
MyGUI::InputManager::getInstance().eventChangeKeyFocus += MyGUI::newDelegate(this, &WindowManager::onKeyFocusChanged);
setUseHardwareCursors(mUseHardwareCursors);
onCursorChange(MyGUI::PointerManager::getInstance().getDefaultPointer());
mCursorManager->cursorVisibilityChange(false);
// Set up visibility
updateVisible();
MWBase::Environment::get().getInputManager()->changeInputMode(false);
}
void WindowManager::renderWorldMap()
{
mMap->renderGlobalMap(mLoadingScreen);
}
void WindowManager::setNewGame(bool newgame)
@ -329,6 +342,8 @@ namespace MWGui
void WindowManager::updateVisible()
{
if (!mMap)
return; // UI not created yet
// Start out by hiding everything except the HUD
mMap->setVisible(false);
mMenu->setVisible(false);
@ -914,6 +929,10 @@ namespace MWGui
void WindowManager::windowResized(int x, int y)
{
mGuiManager->windowResized();
mLoadingScreen->onResChange (x,y);
if (!mHud)
return; // UI not initialized yet
mHud->onResChange(x, y);
mConsole->onResChange(x, y);
mMenu->onResChange(x, y);
@ -923,10 +942,8 @@ namespace MWGui
mBookWindow->center();
mQuickKeysMenu->center();
mSpellBuyingWindow->center();
mLoadingScreen->onResChange (x,y);
mDragAndDrop->mDragAndDropWidget->setSize(MyGUI::IntSize(x, y));
mInputBlocker->setSize(MyGUI::IntSize(x,y));
mGuiManager->windowResized();
}
void WindowManager::pushGuiMode(GuiMode mode)
@ -1148,7 +1165,7 @@ namespace MWGui
bool WindowManager::isGuiMode() const
{
return !mGuiModes.empty() || mMessageBoxManager->isInteractiveMessageBox();
return !mGuiModes.empty() || (mMessageBoxManager && mMessageBoxManager->isInteractiveMessageBox());
}
bool WindowManager::isConsoleMode() const
@ -1211,7 +1228,8 @@ namespace MWGui
void WindowManager::showCrosshair (bool show)
{
mHud->setCrosshairVisible (show && mCrosshairEnabled);
if (mHud)
mHud->setCrosshairVisible (show && mCrosshairEnabled);
}
void WindowManager::activateQuickKey (int index)
@ -1230,15 +1248,6 @@ namespace MWGui
mHud->setVisible (mHudEnabled);
}
void WindowManager::setLoadingProgress (const std::string& stage, int depth, int current, int total)
{
mLoadingScreen->setLoadingProgress (stage, depth, current, total);
}
void WindowManager::loadingDone ()
{
mLoadingScreen->loadingDone ();
}
bool WindowManager::getRestEnabled()
{
//Enable rest dialogue if character creation finished
@ -1345,4 +1354,9 @@ namespace MWGui
mHud->setEnemy(enemy);
}
Loading::Listener* WindowManager::getLoadingScreen()
{
return mLoadingScreen;
}
}

@ -91,6 +91,11 @@ namespace MWGui
Translation::Storage& translationDataStorage, ToUTF8::FromType encoding);
virtual ~WindowManager();
void initUI();
void renderWorldMap();
virtual Loading::Listener* getLoadingScreen();
/**
* Should be called each frame to update windows/gui elements.
* This could mean updating sizes of gui elements or opening
@ -241,9 +246,6 @@ namespace MWGui
virtual void executeInConsole (const std::string& path);
virtual void setLoadingProgress (const std::string& stage, int depth, int current, int total);
virtual void loadingDone();
virtual void enableRest() { mRestAllowed = true; }
virtual bool getRestEnabled();
@ -275,6 +277,8 @@ namespace MWGui
void onSoulgemDialogButtonPressed (int button);
private:
bool mConsoleOnlyScripts;
OEngine::GUI::MyGUIManager *mGuiManager;
OEngine::Render::OgreRenderer *mRendering;
HUD *mHud;

@ -86,13 +86,10 @@ namespace
namespace MWInput
{
InputManager::InputManager(OEngine::Render::OgreRenderer &ogre,
MWWorld::Player& player,
MWBase::WindowManager &windows,
OMW::Engine& engine,
const std::string& userFile, bool userFileExists)
: mOgre(ogre)
, mPlayer(player)
, mWindows(windows)
, mPlayer(NULL)
, mEngine(engine)
, mMouseLookEnabled(true)
, mMouseX(ogre.getWindow()->getWidth ()/2.f)
@ -124,8 +121,6 @@ namespace MWInput
adjustMouseRegion (window->getWidth(), window->getHeight());
MyGUI::InputManager::getInstance().injectMouseMove(mMouseX, mMouseY, 0);
loadKeyDefaults();
for (int i = 0; i < A_Last; ++i)
@ -140,8 +135,6 @@ namespace MWInput
mControlSwitch["playermagic"] = true;
mControlSwitch["playerviewswitch"] = true;
mControlSwitch["vanitymode"] = true;
changeInputMode(false);
}
InputManager::~InputManager()
@ -164,7 +157,7 @@ namespace MWInput
if (action == A_Use)
{
MWWorld::Class::get(mPlayer.getPlayer()).getCreatureStats(mPlayer.getPlayer()).setAttackingOrSpell(currentValue);
MWWorld::Class::get(mPlayer->getPlayer()).getCreatureStats(mPlayer->getPlayer()).setAttackingOrSpell(currentValue);
if (currentValue == 1)
{
int type = MWMechanics::CreatureStats::AT_Chop;
@ -177,7 +170,7 @@ namespace MWInput
if (forward && !side)
type = MWMechanics::CreatureStats::AT_Thrust;
MWWorld::Class::get(mPlayer.getPlayer()).getCreatureStats(mPlayer.getPlayer()).setAttackType(type);
MWWorld::Class::get(mPlayer->getPlayer()).getCreatureStats(mPlayer->getPlayer()).setAttackType(type);
}
}
@ -204,9 +197,9 @@ namespace MWInput
case A_Activate:
resetIdleTime();
if (mWindows.isGuiMode())
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
{
if (mWindows.getMode() == MWGui::GM_Container)
if (MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Container)
toggleContainer ();
else
MWBase::Environment::get().getWindowManager()->activateKeyPressed();
@ -266,7 +259,7 @@ namespace MWInput
showQuickKeysMenu();
break;
case A_ToggleHUD:
mWindows.toggleHud();
MWBase::Environment::get().getWindowManager()->toggleHud();
break;
}
}
@ -274,8 +267,7 @@ namespace MWInput
void InputManager::update(float dt, bool loading)
{
// Tell OIS to handle all input events
mInputManager->capture();
mInputManager->capture(loading);
// inject some fake mouse movement to force updating MyGUI's widget states
// this shouldn't do any harm since we're moving back to the original position afterwards
MyGUI::InputManager::getInstance().injectMouseMove( int(mMouseX+1), int(mMouseY+1), mMouseWheel);
@ -285,18 +277,10 @@ namespace MWInput
if (!loading)
mInputBinder->update(dt);
// Update windows/gui as a result of input events
// For instance this could mean opening a new window/dialog,
// by doing this after the input events are handled we
// ensure that window/gui changes appear quickly while
// avoiding that window/gui changes does not happen in
// event callbacks (which may crash)
mWindows.update();
bool main_menu = mWindows.containsMode(MWGui::GM_MainMenu);
bool main_menu = MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_MainMenu);
bool was_relative = mInputManager->getMouseRelative();
bool is_relative = !mWindows.isGuiMode();
bool is_relative = !MWBase::Environment::get().getWindowManager()->isGuiMode();
// don't keep the pointer away from the window edge in gui mode
// stop using raw mouse motions and switch to system cursor movements
@ -312,8 +296,11 @@ namespace MWInput
mInputManager->warpMouse(mMouseX, mMouseY);
}
if (loading)
return;
// Disable movement in Gui mode
if (mWindows.isGuiMode()) return;
if (MWBase::Environment::get().getWindowManager()->isGuiMode()) return;
// Configure player movement according to keyboard input. Actual movement will
@ -324,45 +311,45 @@ namespace MWInput
if (actionIsActive(A_MoveLeft))
{
triedToMove = true;
mPlayer.setLeftRight (-1);
mPlayer->setLeftRight (-1);
}
else if (actionIsActive(A_MoveRight))
{
triedToMove = true;
mPlayer.setLeftRight (1);
mPlayer->setLeftRight (1);
}
if (actionIsActive(A_MoveForward))
{
triedToMove = true;
mPlayer.setAutoMove (false);
mPlayer.setForwardBackward (1);
mPlayer->setAutoMove (false);
mPlayer->setForwardBackward (1);
}
else if (actionIsActive(A_MoveBackward))
{
triedToMove = true;
mPlayer.setAutoMove (false);
mPlayer.setForwardBackward (-1);
mPlayer->setAutoMove (false);
mPlayer->setForwardBackward (-1);
}
else if(mPlayer.getAutoMove())
else if(mPlayer->getAutoMove())
{
triedToMove = true;
mPlayer.setForwardBackward (1);
mPlayer->setForwardBackward (1);
}
mPlayer.setSneak(actionIsActive(A_Sneak));
mPlayer->setSneak(actionIsActive(A_Sneak));
if (actionIsActive(A_Jump) && mControlSwitch["playerjumping"])
{
mPlayer.setUpDown (1);
mPlayer->setUpDown (1);
triedToMove = true;
}
if (mAlwaysRunActive)
mPlayer.setRunState(!actionIsActive(A_Run));
mPlayer->setRunState(!actionIsActive(A_Run));
else
mPlayer.setRunState(actionIsActive(A_Run));
mPlayer->setRunState(actionIsActive(A_Run));
// if player tried to start moving, but can't (due to being overencumbered), display a notification.
if (triedToMove)
@ -371,7 +358,7 @@ namespace MWInput
mOverencumberedMessageDelay -= dt;
if (MWWorld::Class::get(player).getEncumbrance(player) >= MWWorld::Class::get(player).getCapacity(player))
{
mPlayer.setAutoMove (false);
mPlayer->setAutoMove (false);
if (mOverencumberedMessageDelay <= 0)
{
MWBase::Environment::get().getWindowManager ()->messageBox("#{sNotifyMessage59}");
@ -425,8 +412,8 @@ namespace MWInput
mGuiCursorEnabled = guiMode;
mMouseLookEnabled = !guiMode;
if (guiMode)
mWindows.showCrosshair(false);
mWindows.setCursorVisible(guiMode);
MWBase::Environment::get().getWindowManager()->showCrosshair(false);
MWBase::Environment::get().getWindowManager()->setCursorVisible(guiMode);
// if not in gui mode, the camera decides whether to show crosshair or not.
}
@ -459,13 +446,13 @@ namespace MWInput
}
/// \note 7 switches at all, if-else is relevant
if (sw == "playercontrols" && !value) {
mPlayer.setLeftRight(0);
mPlayer.setForwardBackward(0);
mPlayer.setAutoMove(false);
mPlayer.setUpDown(0);
mPlayer->setLeftRight(0);
mPlayer->setForwardBackward(0);
mPlayer->setAutoMove(false);
mPlayer->setUpDown(0);
} else if (sw == "playerjumping" && !value) {
/// \fixme maybe crouching at this time
mPlayer.setUpDown(0);
mPlayer->setUpDown(0);
} else if (sw == "vanitymode") {
MWBase::Environment::get().getWorld()->allowVanityMode(value);
} else if (sw == "playerlooking") {
@ -594,8 +581,8 @@ namespace MWInput
// Only actually turn player when we're not in vanity mode
if(!MWBase::Environment::get().getWorld()->vanityRotateCamera(rot))
{
mPlayer.yaw(x/scale);
mPlayer.pitch(-y/scale);
mPlayer->yaw(x/scale);
mPlayer->pitch(-y/scale);
}
if (arg.zrel)
@ -627,51 +614,51 @@ namespace MWInput
if (MyGUI::InputManager::getInstance ().isModalAny())
return;
if (mWindows.isGuiMode () && mWindows.getMode () == MWGui::GM_Video)
if (MWBase::Environment::get().getWindowManager()->isGuiMode () && MWBase::Environment::get().getWindowManager()->getMode () == MWGui::GM_Video)
MWBase::Environment::get().getWorld ()->stopVideo ();
else if (mWindows.containsMode(MWGui::GM_MainMenu))
mWindows.popGuiMode();
else if (MWBase::Environment::get().getWindowManager()->containsMode(MWGui::GM_MainMenu))
MWBase::Environment::get().getWindowManager()->popGuiMode();
else
mWindows.pushGuiMode (MWGui::GM_MainMenu);
MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_MainMenu);
}
void InputManager::toggleSpell()
{
if (mWindows.isGuiMode()) return;
if (MWBase::Environment::get().getWindowManager()->isGuiMode()) return;
// Not allowed before the magic window is accessible
if (!mWindows.isAllowed(MWGui::GW_Magic))
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Magic))
return;
MWMechanics::DrawState_ state = mPlayer.getDrawState();
MWMechanics::DrawState_ state = mPlayer->getDrawState();
if (state == MWMechanics::DrawState_Weapon || state == MWMechanics::DrawState_Nothing)
mPlayer.setDrawState(MWMechanics::DrawState_Spell);
mPlayer->setDrawState(MWMechanics::DrawState_Spell);
else
mPlayer.setDrawState(MWMechanics::DrawState_Nothing);
mPlayer->setDrawState(MWMechanics::DrawState_Nothing);
}
void InputManager::toggleWeapon()
{
if (mWindows.isGuiMode()) return;
if (MWBase::Environment::get().getWindowManager()->isGuiMode()) return;
// Not allowed before the inventory window is accessible
if (!mWindows.isAllowed(MWGui::GW_Inventory))
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
return;
MWMechanics::DrawState_ state = mPlayer.getDrawState();
MWMechanics::DrawState_ state = mPlayer->getDrawState();
if (state == MWMechanics::DrawState_Spell || state == MWMechanics::DrawState_Nothing)
mPlayer.setDrawState(MWMechanics::DrawState_Weapon);
mPlayer->setDrawState(MWMechanics::DrawState_Weapon);
else
mPlayer.setDrawState(MWMechanics::DrawState_Nothing);
mPlayer->setDrawState(MWMechanics::DrawState_Nothing);
}
void InputManager::rest()
{
if (!mWindows.getRestEnabled () || mWindows.isGuiMode ())
if (!MWBase::Environment::get().getWindowManager()->getRestEnabled () || MWBase::Environment::get().getWindowManager()->isGuiMode ())
return;
/// \todo check if resting is currently allowed (enemies nearby?)
mWindows.pushGuiMode (MWGui::GM_Rest);
MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_Rest);
}
void InputManager::screenshot()
@ -679,7 +666,7 @@ namespace MWInput
mEngine.screenshot();
std::vector<std::string> empty;
mWindows.messageBox ("Screenshot saved", empty);
MWBase::Environment::get().getWindowManager()->messageBox ("Screenshot saved", empty);
}
void InputManager::toggleInventory()
@ -688,13 +675,13 @@ namespace MWInput
return;
// Toggle between game mode and inventory mode
if(!mWindows.isGuiMode())
mWindows.pushGuiMode(MWGui::GM_Inventory);
if(!MWBase::Environment::get().getWindowManager()->isGuiMode())
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Inventory);
else
{
MWGui::GuiMode mode = mWindows.getMode();
MWGui::GuiMode mode = MWBase::Environment::get().getWindowManager()->getMode();
if(mode == MWGui::GM_Inventory || mode == MWGui::GM_Container)
mWindows.popGuiMode();
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
// .. but don't touch any other mode, except container.
@ -705,12 +692,12 @@ namespace MWInput
if (MyGUI::InputManager::getInstance ().isModalAny())
return;
if(mWindows.isGuiMode())
if(MWBase::Environment::get().getWindowManager()->isGuiMode())
{
if (mWindows.getMode() == MWGui::GM_Container)
mWindows.popGuiMode();
if (MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Container)
MWBase::Environment::get().getWindowManager()->popGuiMode();
else
mWindows.pushGuiMode(MWGui::GM_Container);
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Container);
}
}
@ -722,15 +709,15 @@ namespace MWInput
// Switch to console mode no matter what mode we are currently
// in, except of course if we are already in console mode
if (mWindows.isGuiMode())
if (MWBase::Environment::get().getWindowManager()->isGuiMode())
{
if (mWindows.getMode() == MWGui::GM_Console)
mWindows.popGuiMode();
if (MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Console)
MWBase::Environment::get().getWindowManager()->popGuiMode();
else
mWindows.pushGuiMode(MWGui::GM_Console);
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Console);
}
else
mWindows.pushGuiMode(MWGui::GM_Console);
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Console);
}
void InputManager::toggleJournal()
@ -739,31 +726,31 @@ namespace MWInput
return;
// Toggle between game mode and journal mode
if(!mWindows.isGuiMode() && MWBase::Environment::get().getWindowManager ()->getJournalAllowed())
if(!MWBase::Environment::get().getWindowManager()->isGuiMode() && MWBase::Environment::get().getWindowManager ()->getJournalAllowed())
{
MWBase::Environment::get().getSoundManager()->playSound ("book open", 1.0, 1.0);
mWindows.pushGuiMode(MWGui::GM_Journal);
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Journal);
}
else if(mWindows.getMode() == MWGui::GM_Journal)
else if(MWBase::Environment::get().getWindowManager()->getMode() == MWGui::GM_Journal)
{
MWBase::Environment::get().getSoundManager()->playSound ("book close", 1.0, 1.0);
mWindows.popGuiMode();
MWBase::Environment::get().getWindowManager()->popGuiMode();
}
// .. but don't touch any other mode.
}
void InputManager::quickKey (int index)
{
if (!mWindows.isGuiMode())
mWindows.activateQuickKey (index);
if (!MWBase::Environment::get().getWindowManager()->isGuiMode())
MWBase::Environment::get().getWindowManager()->activateQuickKey (index);
}
void InputManager::showQuickKeysMenu()
{
if (!mWindows.isGuiMode ())
mWindows.pushGuiMode (MWGui::GM_QuickKeysMenu);
else if (mWindows.getMode () == MWGui::GM_QuickKeysMenu)
mWindows.removeGuiMode (MWGui::GM_QuickKeysMenu);
if (!MWBase::Environment::get().getWindowManager()->isGuiMode ())
MWBase::Environment::get().getWindowManager()->pushGuiMode (MWGui::GM_QuickKeysMenu);
else if (MWBase::Environment::get().getWindowManager()->getMode () == MWGui::GM_QuickKeysMenu)
MWBase::Environment::get().getWindowManager()->removeGuiMode (MWGui::GM_QuickKeysMenu);
}
void InputManager::activate()
@ -774,22 +761,22 @@ namespace MWInput
void InputManager::toggleAutoMove()
{
if (mWindows.isGuiMode()) return;
if (MWBase::Environment::get().getWindowManager()->isGuiMode()) return;
if (mControlSwitch["playercontrols"])
mPlayer.setAutoMove (!mPlayer.getAutoMove());
mPlayer->setAutoMove (!mPlayer->getAutoMove());
}
void InputManager::toggleWalking()
{
if (mWindows.isGuiMode()) return;
if (MWBase::Environment::get().getWindowManager()->isGuiMode()) return;
mAlwaysRunActive = !mAlwaysRunActive;
}
// Exit program now button (which is disabled in GUI mode)
void InputManager::exitNow()
{
if(!mWindows.isGuiMode())
if(!MWBase::Environment::get().getWindowManager()->isGuiMode())
Ogre::Root::getSingleton().queueEndRendering ();
}

@ -60,8 +60,6 @@ namespace MWInput
{
public:
InputManager(OEngine::Render::OgreRenderer &_ogre,
MWWorld::Player&_player,
MWBase::WindowManager &_windows,
OMW::Engine& engine,
const std::string& userFile, bool userFileExists);
@ -69,6 +67,8 @@ namespace MWInput
virtual void update(float dt, bool loading);
void setPlayer (MWWorld::Player* player) { mPlayer = player; }
virtual void changeInputMode(bool guiMode);
virtual void processChangedSettings(const Settings::CategorySettingVector& changed);
@ -125,8 +125,7 @@ namespace MWInput
private:
OEngine::Render::OgreRenderer &mOgre;
MWWorld::Player& mPlayer;
MWBase::WindowManager &mWindows;
MWWorld::Player* mPlayer;
OMW::Engine& mEngine;
ICS::InputControlSystem* mInputBinder;

@ -11,10 +11,12 @@
#include "../mwworld/class.hpp"
#include "../mwworld/inventorystore.hpp"
#include "../mwworld/player.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/soundmanager.hpp"
#include "npcstats.hpp"
#include "creaturestats.hpp"
@ -68,22 +70,24 @@ namespace MWMechanics
{
CreatureStats& creatureStats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
int strength = creatureStats.getAttribute(0).getBase();
int intelligence = creatureStats.getAttribute(1).getBase();
int willpower = creatureStats.getAttribute(2).getBase();
int agility = creatureStats.getAttribute(3).getBase();
int endurance = creatureStats.getAttribute(5).getBase();
int strength = creatureStats.getAttribute(ESM::Attribute::Strength).getBase();
int intelligence = creatureStats.getAttribute(ESM::Attribute::Intelligence).getBase();
int willpower = creatureStats.getAttribute(ESM::Attribute::Willpower).getBase();
int agility = creatureStats.getAttribute(ESM::Attribute::Agility).getBase();
int endurance = creatureStats.getAttribute(ESM::Attribute::Endurance).getBase();
double magickaFactor =
creatureStats.getMagicEffects().get (EffectKey (ESM::MagicEffect::FortifyMaximumMagicka)).mMagnitude * 0.1 + 0.5;
DynamicStat<float> magicka = creatureStats.getMagicka();
magicka.setBase (static_cast<int> (intelligence + magickaFactor * intelligence));
creatureStats.setMagicka (magicka);
float diff = (static_cast<int>(intelligence + magickaFactor*intelligence)) - magicka.getBase();
magicka.modify(diff);
creatureStats.setMagicka(magicka);
DynamicStat<float> fatigue = creatureStats.getFatigue();
fatigue.setBase (strength+willpower+agility+endurance);
creatureStats.setFatigue (fatigue);
diff = (strength+willpower+agility+endurance) - fatigue.getBase();
fatigue.modify(diff);
creatureStats.setFatigue(fatigue);
}
void Actors::calculateRestoration (const MWWorld::Ptr& ptr, float duration)
@ -133,62 +137,63 @@ namespace MWMechanics
void Actors::calculateCreatureStatModifiers (const MWWorld::Ptr& ptr)
{
CreatureStats& creatureStats = MWWorld::Class::get (ptr).getCreatureStats (ptr);
CreatureStats &creatureStats = MWWorld::Class::get(ptr).getCreatureStats(ptr);
const MagicEffects &effects = creatureStats.getMagicEffects();
// attributes
for (int i=0; i<8; ++i)
for(int i = 0;i < ESM::Attribute::Length;++i)
{
int modifier =
creatureStats.getMagicEffects().get (EffectKey (ESM::MagicEffect::FortifyAttribute, i)).mMagnitude;
modifier -= creatureStats.getMagicEffects().get (EffectKey (ESM::MagicEffect::DrainAttribute, i)).mMagnitude;
Stat<int> stat = creatureStats.getAttribute(i);
stat.setModifier(effects.get(EffectKey(ESM::MagicEffect::FortifyAttribute, i)).mMagnitude -
effects.get(EffectKey(ESM::MagicEffect::DrainAttribute, i)).mMagnitude);
creatureStats.getAttribute(i).setModifier (modifier);
creatureStats.setAttribute(i, stat);
}
// dynamic stats
MagicEffects effects = creatureStats.getMagicEffects();
for (int i=0; i<3; ++i)
for(int i = 0;i < 3;++i)
{
DynamicStat<float> stat = creatureStats.getDynamic (i);
DynamicStat<float> stat = creatureStats.getDynamic(i);
stat.setModifier(effects.get(EffectKey(80+i)).mMagnitude -
effects.get(EffectKey(18+i)).mMagnitude);
stat.setModifier (
effects.get (EffectKey(80+i)).mMagnitude - effects.get (EffectKey(18+i)).mMagnitude);
creatureStats.setDynamic (i, stat);
creatureStats.setDynamic(i, stat);
}
}
void Actors::updateDrowning(const MWWorld::Ptr& ptr, float duration)
{
NpcStats &stats = MWWorld::Class::get(ptr).getNpcStats(ptr);
if(MWBase::Environment::get().getWorld()->isSubmerged(ptr) &&
MWBase::World *world = MWBase::Environment::get().getWorld();
NpcStats &stats = ptr.getClass().getNpcStats(ptr);
if(world->isSubmerged(ptr) &&
stats.getMagicEffects().get(ESM::MagicEffect::WaterBreathing).mMagnitude == 0)
{
float timeLeft = 0.0f;
if(stats.getFatigue().getCurrent() == 0)
stats.setTimeToStartDrowning(0);
float timeLeft = stats.getTimeToStartDrowning()-duration;
if(timeLeft < 0.0f)
timeLeft = 0.0f;
stats.setTimeToStartDrowning(timeLeft);
else
{
timeLeft = stats.getTimeToStartDrowning() - duration;
if(timeLeft < 0.0f)
timeLeft = 0.0f;
stats.setTimeToStartDrowning(timeLeft);
}
if(timeLeft == 0.0f)
stats.setLastDrowningHitTime(stats.getLastDrowningHitTime()+duration);
{
// If drowning, apply 3 points of damage per second
ptr.getClass().setActorHealth(ptr, stats.getHealth().getCurrent() - 3.0f*duration);
// Play a drowning sound as necessary for the player
if(ptr == world->getPlayer().getPlayer())
{
MWBase::SoundManager *sndmgr = MWBase::Environment::get().getSoundManager();
if(!sndmgr->getSoundPlaying(MWWorld::Ptr(), "drown"))
sndmgr->playSound("drown", 1.0f, 1.0f);
}
}
}
else
{
stats.setTimeToStartDrowning(20);
stats.setLastDrowningHitTime(0);
}
//if npc is drowning and it's time to hit, then hit
while(stats.getTimeToStartDrowning() == 0.0f && stats.getLastDrowningHitTime() > 0.33f)
{
stats.setLastDrowningHitTime(stats.getLastDrowningHitTime()-0.33f);
//fixme: replace it with something different once screen hit effects are implemented (blood on screen)
MWWorld::Class::get(ptr).setActorHealth(ptr, stats.getHealth().getCurrent()-1.0f);
}
}
Actors::Actors() : mDuration (0) {}

@ -8,7 +8,6 @@
#include "../mwbase/world.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/dialoguemanager.hpp"
#include "../mwbase/soundmanager.hpp"
#include "../mwworld/class.hpp"
#include "../mwworld/player.hpp"
@ -189,6 +188,9 @@ namespace MWMechanics
void MechanicsManager::updateCell(const MWWorld::Ptr &old, const MWWorld::Ptr &ptr)
{
if(old == mWatched)
mWatched = ptr;
if(MWWorld::Class::get(ptr).isActor())
mActors.updateActor(old, ptr);
else
@ -213,98 +215,76 @@ namespace MWMechanics
void MechanicsManager::update(float duration, bool paused)
{
if (!mWatched.isEmpty())
if(!mWatched.isEmpty())
{
MWMechanics::CreatureStats& stats =
MWWorld::Class::get (mWatched).getCreatureStats (mWatched);
MWMechanics::NpcStats& npcStats =
MWWorld::Class::get (mWatched).getNpcStats (mWatched);
static const char *attributeNames[8] =
{
"AttribVal1", "AttribVal2", "AttribVal3", "AttribVal4", "AttribVal5",
"AttribVal6", "AttribVal7", "AttribVal8"
};
static const char *dynamicNames[3] =
MWBase::WindowManager *winMgr = MWBase::Environment::get().getWindowManager();
const MWMechanics::NpcStats &stats = mWatched.getClass().getNpcStats(mWatched);
for(int i = 0;i < ESM::Attribute::Length;++i)
{
"HBar", "MBar", "FBar"
};
for (int i=0; i<8; ++i)
{
if (stats.getAttribute(i)!=mWatchedCreature.getAttribute(i))
if(stats.getAttribute(i) != mWatchedStats.getAttribute(i))
{
mWatchedCreature.setAttribute(i, stats.getAttribute(i));
std::stringstream attrname;
attrname << "AttribVal"<<(i+1);
MWBase::Environment::get().getWindowManager()->setValue (attributeNames[i], stats.getAttribute(i));
mWatchedStats.setAttribute(i, stats.getAttribute(i));
winMgr->setValue(attrname.str(), stats.getAttribute(i));
}
}
if (stats.getHealth() != mWatchedCreature.getHealth()) {
mWatchedCreature.setHealth(stats.getHealth());
MWBase::Environment::get().getWindowManager()->setValue(dynamicNames[0], stats.getHealth());
if(stats.getHealth() != mWatchedStats.getHealth())
{
static const std::string hbar("HBar");
mWatchedStats.setHealth(stats.getHealth());
winMgr->setValue(hbar, stats.getHealth());
}
if (stats.getMagicka() != mWatchedCreature.getMagicka()) {
mWatchedCreature.setMagicka(stats.getMagicka());
MWBase::Environment::get().getWindowManager()->setValue(dynamicNames[1], stats.getMagicka());
if(stats.getMagicka() != mWatchedStats.getMagicka())
{
static const std::string mbar("MBar");
mWatchedStats.setMagicka(stats.getMagicka());
winMgr->setValue(mbar, stats.getMagicka());
}
if (stats.getFatigue() != mWatchedCreature.getFatigue()) {
mWatchedCreature.setFatigue(stats.getFatigue());
MWBase::Environment::get().getWindowManager()->setValue(dynamicNames[2], stats.getFatigue());
if(stats.getFatigue() != mWatchedStats.getFatigue())
{
static const std::string fbar("FBar");
mWatchedStats.setFatigue(stats.getFatigue());
winMgr->setValue(fbar, stats.getFatigue());
}
if(npcStats.getTimeToStartDrowning() != mWatchedNpc.getTimeToStartDrowning())
if(stats.getTimeToStartDrowning() != mWatchedStats.getTimeToStartDrowning())
{
mWatchedNpc.setTimeToStartDrowning(npcStats.getTimeToStartDrowning());
if(npcStats.getTimeToStartDrowning()>=20.0)
{
MWBase::Environment::get().getWindowManager()->setDrowningBarVisibility(false);
}
mWatchedStats.setTimeToStartDrowning(stats.getTimeToStartDrowning());
if(stats.getTimeToStartDrowning() >= 20.0f)
winMgr->setDrowningBarVisibility(false);
else
{
MWBase::Environment::get().getWindowManager()->setDrowningBarVisibility(true);
MWBase::Environment::get().getWindowManager()->setDrowningTimeLeft(npcStats.getTimeToStartDrowning());
winMgr->setDrowningBarVisibility(true);
winMgr->setDrowningTimeLeft(stats.getTimeToStartDrowning());
}
}
bool update = false;
//Loop over ESM::Skill::SkillEnum
for(int i = 0; i < 27; ++i)
for(int i = 0; i < ESM::Skill::Length; ++i)
{
if(npcStats.getSkill (i) != mWatchedNpc.getSkill (i))
if(stats.getSkill(i) != mWatchedStats.getSkill(i))
{
update = true;
mWatchedNpc.getSkill (i) = npcStats.getSkill (i);
MWBase::Environment::get().getWindowManager()->setValue((ESM::Skill::SkillEnum)i, npcStats.getSkill (i));
mWatchedStats.getSkill(i) = stats.getSkill(i);
winMgr->setValue((ESM::Skill::SkillEnum)i, stats.getSkill(i));
}
}
if (update)
MWBase::Environment::get().getWindowManager()->updateSkillArea();
MWBase::Environment::get().getWindowManager()->setValue ("level", stats.getLevel());
}
if(update)
winMgr->updateSkillArea();
//update drowning sound
MWBase::World *world = MWBase::Environment::get().getWorld();
MWBase::SoundManager * sndmgr = MWBase::Environment::get().getSoundManager();
MWWorld::Ptr playerPtr = world->getPlayer().getPlayer();
NpcStats& playerStats = MWWorld::Class::get(playerPtr).getNpcStats(playerPtr);
if(!sndmgr->getSoundPlaying(MWWorld::Ptr(), "drown") && playerStats.getTimeToStartDrowning()==0.0)
{
sndmgr->playSound("drown",1.0,1.0,MWBase::SoundManager::Play_TypeSfx,MWBase::SoundManager::Play_Loop);
}
if(playerStats.getTimeToStartDrowning()>0.0)
{
//no need to check if it's playing, stop sound does nothing in that case
sndmgr->stopSound("drown");
winMgr->setValue("level", stats.getLevel());
}
if (mUpdatePlayer)
{
MWBase::World *world = MWBase::Environment::get().getWorld();
// basic player profile; should not change anymore after the creation phase is finished.
MWBase::WindowManager *winMgr =
MWBase::Environment::get().getWindowManager();

@ -25,8 +25,7 @@ namespace MWMechanics
class MechanicsManager : public MWBase::MechanicsManager
{
MWWorld::Ptr mWatched;
CreatureStats mWatchedCreature;
NpcStats mWatchedNpc;
NpcStats mWatchedStats;
bool mUpdatePlayer;
bool mClassSelected;
bool mRaceSelected;

@ -422,7 +422,7 @@ void MWMechanics::NpcStats::modifyProfit(int diff)
mProfit += diff;
}
float MWMechanics::NpcStats::getTimeToStartDrowning()
float MWMechanics::NpcStats::getTimeToStartDrowning() const
{
return mTimeToStartDrowning;
}
@ -431,13 +431,3 @@ void MWMechanics::NpcStats::setTimeToStartDrowning(float time)
assert(time>=0 && time<=20);
mTimeToStartDrowning=time;
}
float MWMechanics::NpcStats::getLastDrowningHitTime()
{
return mLastDrowningHit;
}
void MWMechanics::NpcStats::setLastDrowningHitTime(float time)
{
mLastDrowningHit=time;
}

@ -147,15 +147,10 @@ namespace MWMechanics
int getWerewolfKills() const;
float getTimeToStartDrowning();
float getTimeToStartDrowning() const;
/// Sets time left for the creature to drown if it stays underwater.
/// @param time value from [0,20]
void setTimeToStartDrowning(float time);
float getLastDrowningHitTime();
/// Sets time since last hit caused by drowning.
/// @param time value from [0,0.33]
void setLastDrowningHitTime(float time);
};
}

@ -42,6 +42,18 @@ namespace MWMechanics
mBase = mModified = value;
}
void modify(const T& diff)
{
mBase += diff;
if(mBase >= static_cast<T>(0))
mModified += diff;
else
{
mModified += diff - mBase;
mBase = static_cast<T>(0);
}
}
/// Set base and adjust modified accordingly.
void setBase (const T& value)
{

@ -64,7 +64,7 @@ void Animation::destroyObjectList(Ogre::SceneManager *sceneMgr, NifOgre::ObjectL
Animation::Animation(const MWWorld::Ptr &ptr, Ogre::SceneNode *node)
: mPtr(ptr)
, mCamera(NULL)
, mInsert(NULL)
, mInsert(node)
, mSkelBase(NULL)
, mAccumRoot(NULL)
, mNonAccumRoot(NULL)
@ -74,20 +74,14 @@ Animation::Animation(const MWWorld::Ptr &ptr, Ogre::SceneNode *node)
{
for(size_t i = 0;i < sNumGroups;i++)
mAnimationValuePtr[i].bind(OGRE_NEW AnimationValue(this));
mInsert = node->createChildSceneNode();
}
Animation::~Animation()
{
if(mInsert)
{
mAnimSources.clear();
Ogre::SceneManager *sceneMgr = mInsert->getCreator();
destroyObjectList(sceneMgr, mObjectRoot);
mAnimSources.clear();
sceneMgr->destroySceneNode(mInsert);
}
Ogre::SceneManager *sceneMgr = mInsert->getCreator();
destroyObjectList(sceneMgr, mObjectRoot);
}
@ -268,8 +262,13 @@ void Animation::addAnimSource(const std::string &model)
if(!mAccumRoot && grp == 0)
{
mAccumRoot = mInsert;
mNonAccumRoot = dstval->getNode();
mAccumRoot = mNonAccumRoot->getParent();
if(!mAccumRoot)
{
std::cerr<< "Non-Accum root for "<<mPtr.getCellRef().mRefID<<" is skeleton root??" <<std::endl;
mNonAccumRoot = NULL;
}
}
ctrls[i].setSource(mAnimationValuePtr[grp]);
@ -984,10 +983,7 @@ ObjectAnimation::ObjectAnimation(const MWWorld::Ptr& ptr, const std::string &mod
{
setObjectRoot(model, false);
Ogre::AxisAlignedBox bounds = getWorldBounds();
Ogre::Vector3 extents = bounds.getSize();
extents *= mInsert->getParentSceneNode()->getScale();
Ogre::Vector3 extents = getWorldBounds().getSize();
float size = std::max(std::max(extents.x, extents.y), extents.z);
bool small = (size < Settings::Manager::getInt("small object size", "Viewing distance")) &&

@ -10,6 +10,8 @@
#include <OgreRoot.h>
#include <OgreHardwarePixelBuffer.h>
#include <components/loadinglistener/loadinglistener.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
@ -28,7 +30,7 @@ namespace MWRender
}
void GlobalMap::render ()
void GlobalMap::render (Loading::Listener* loadingListener)
{
Ogre::TexturePtr tex;
@ -53,6 +55,11 @@ namespace MWRender
mWidth = cellSize*(mMaxX-mMinX+1);
mHeight = cellSize*(mMaxY-mMinY+1);
loadingListener->loadingOn();
loadingListener->setLabel("Creating map");
loadingListener->setProgressRange((mMaxX-mMinX+1) * (mMaxY-mMinY+1));
loadingListener->setProgress(0);
mExploredBuffer.resize((mMaxX-mMinX+1) * (mMaxY-mMinY+1) * 4);
//if (!boost::filesystem::exists(mCacheDir + "/GlobalMap.png"))
@ -147,6 +154,7 @@ namespace MWRender
data[texelY * mWidth * 3 + texelX * 3+2] = b;
}
}
loadingListener->increaseProgress(1);
}
}
@ -177,6 +185,8 @@ namespace MWRender
memcpy(mOverlayTexture->getBuffer()->lock(Ogre::HardwareBuffer::HBL_DISCARD), &buffer[0], mWidth*mHeight*4);
mOverlayTexture->getBuffer()->unlock();
loadingListener->loadingOff();
}
void GlobalMap::worldPosToImageSpace(float x, float z, float& imageX, float& imageY)

@ -5,6 +5,11 @@
#include <OgreTexture.h>
namespace Loading
{
class Listener;
}
namespace MWRender
{
@ -13,7 +18,7 @@ namespace MWRender
public:
GlobalMap(const std::string& cacheDir);
void render();
void render(Loading::Listener* loadingListener);
int getWidth() { return mWidth; }
int getHeight() { return mHeight; }

@ -130,7 +130,10 @@ void Objects::insertModel(const MWWorld::Ptr &ptr, const std::string &mesh)
// - the culling will be more inefficient
// If it is set too low:
// - there will be too many batches.
sg->setRegionDimensions(Ogre::Vector3(2500,2500,2500));
if(ptr.getCell()->isExterior())
sg->setRegionDimensions(Ogre::Vector3(2048,2048,2048));
else
sg->setRegionDimensions(Ogre::Vector3(1024,1024,1024));
sg->setVisibilityFlags(small ? RV_StaticsSmall : RV_Statics);

@ -25,7 +25,7 @@
#include <components/esm/loadstat.hpp>
#include <components/settings/settings.hpp>
#include <components/terrain/terrain.hpp>
#include <components/terrain/world.hpp>
#include "../mwworld/esmstore.hpp"
#include "../mwworld/class.hpp"
@ -82,7 +82,7 @@ RenderingManager::RenderingManager(OEngine::Render::OgreRenderer& _rend, const b
Settings::Manager::setString("shader mode", "General", openGL ? (glES ? "glsles" : "glsl") : "hlsl");
}
mRendering.createScene("PlayerCam", Settings::Manager::getFloat("field of view", "General"), 5);
mRendering.adjustCamera(Settings::Manager::getFloat("field of view", "General"), 5);
mRendering.getWindow()->addListener(this);
mRendering.setWindowListener(this);
@ -652,7 +652,8 @@ void RenderingManager::requestMap(MWWorld::Ptr::CellStore* cell)
Ogre::Vector2 center(cell->mCell->getGridX() + 0.5, cell->mCell->getGridY() + 0.5);
dims.merge(mTerrain->getWorldBoundingBox(center));
mTerrain->update(dims.getCenter());
if (dims.isFinite())
mTerrain->update(dims.getCenter());
mLocalMap->requestMap(cell, dims.getMinimum().z, dims.getMaximum().z);
}
@ -1017,12 +1018,15 @@ void RenderingManager::enableTerrain(bool enable)
{
if (!mTerrain)
{
mTerrain = new Terrain::Terrain(mRendering.getScene(), new MWRender::TerrainStorage(), RV_Terrain,
Loading::Listener* listener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
Loading::ScopedLoad load(listener);
mTerrain = new Terrain::World(listener, mRendering.getScene(), new MWRender::TerrainStorage(), RV_Terrain,
Settings::Manager::getBool("distant land", "Terrain"),
Settings::Manager::getBool("shader", "Terrain"));
mTerrain->applyMaterials(Settings::Manager::getBool("enabled", "Shadows"),
Settings::Manager::getBool("split", "Shadows"));
mTerrain->update(mRendering.getCamera()->getRealPosition());
mTerrain->setLoadingListener(NULL);
}
mTerrain->setVisible(true);
}

@ -40,7 +40,7 @@ namespace sh
namespace Terrain
{
class Terrain;
class World;
}
namespace MWRender
@ -234,7 +234,7 @@ private:
OcclusionQuery* mOcclusionQuery;
Terrain::Terrain* mTerrain;
Terrain::World* mTerrain;
MWRender::Water *mWater;

@ -4,11 +4,10 @@
#include <algorithm>
#include <map>
#include "../mwworld/esmstore.hpp"
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwworld/esmstore.hpp"
#include "../mwworld/player.hpp"
#include "sound_output.hpp"
@ -103,6 +102,7 @@ namespace MWSound
SoundManager::~SoundManager()
{
mUnderwaterSound.reset();
mActiveSounds.clear();
mMusic.reset();
mOutput.reset();
@ -474,27 +474,32 @@ namespace MWSound
void SoundManager::updateRegionSound(float duration)
{
MWWorld::Ptr::CellStore *current = MWBase::Environment::get().getWorld()->getPlayer().getPlayer().getCell();
static float sTimeToNextEnvSound = 0.0f;
static int total = 0;
static std::string regionName = "";
static float timePassed = 0.0;
static float sTimePassed = 0.0;
MWBase::World *world = MWBase::Environment::get().getWorld();
const MWWorld::Ptr player = world->getPlayer().getPlayer();
const ESM::Cell *cell = player.getCell()->mCell;
//If the region has changed
timePassed += duration;
if(!current->mCell->isExterior() || timePassed < 10)
sTimePassed += duration;
if(!cell->isExterior() || sTimePassed < sTimeToNextEnvSound)
return;
timePassed = 0;
if(regionName != current->mCell->mRegion)
float a = std::rand() / (double)RAND_MAX;
// NOTE: We should use the "Minimum Time Between Environmental Sounds" and
// "Maximum Time Between Environmental Sounds" fallback settings here.
sTimeToNextEnvSound = 5.0f*a + 15.0f*(1.0f-a);
sTimePassed = 0;
if(regionName != cell->mRegion)
{
regionName = current->mCell->mRegion;
regionName = cell->mRegion;
total = 0;
}
const ESM::Region *regn =
MWBase::Environment::get().getWorld()->getStore().get<ESM::Region>().search(regionName);
if (regn == NULL)
const ESM::Region *regn = world->getStore().get<ESM::Region>().search(regionName);
if(regn == NULL)
return;
std::vector<ESM::Region::SoundRef>::const_iterator soundIter;
@ -550,15 +555,13 @@ namespace MWSound
{
env = Env_Underwater;
//play underwater sound
//HACK: this sound is always played underwater, so set volume and pitch higher (it's then lowered)
//Currently not possible to play looping sound with no environment
if(!getSoundPlaying(MWWorld::Ptr(), "Underwater"))
playSound("Underwater", 1.11, 1.42 ,Play_TypeSfx, Play_Loop );
if(!(mUnderwaterSound && mUnderwaterSound->isPlaying()))
mUnderwaterSound = playSound("Underwater", 1.0f, 1.0f, Play_TypeSfx, Play_LoopNoEnv);
}
else
else if(mUnderwaterSound)
{
//no need to check if it's playing, stop sound does nothing in that case
stopSound("Underwater");
mUnderwaterSound->stop();
mUnderwaterSound.reset();
}
mOutput->updateListener(

@ -44,6 +44,8 @@ namespace MWSound
typedef std::map<MWBase::SoundPtr,PtrIDPair> SoundMap;
SoundMap mActiveSounds;
MWBase::SoundPtr mUnderwaterSound;
Ogre::Vector3 mListenerPos;
Ogre::Vector3 mListenerDir;
Ogre::Vector3 mListenerUp;

@ -43,7 +43,8 @@ namespace MWWorld
// Skip this when reference was deleted.
// TODO: Support respawning references, in this case, we need to track it somehow.
if (ref.mDeleted) {
mList.erase(iter);
if (iter != mList.end())
mList.erase(iter);
return;
}

@ -5,6 +5,8 @@
#include <boost/filesystem/operations.hpp>
#include <components/loadinglistener/loadinglistener.hpp>
namespace MWWorld
{
@ -21,8 +23,10 @@ static bool isCacheableRecord(int id)
return false;
}
void ESMStore::load(ESM::ESMReader &esm)
void ESMStore::load(ESM::ESMReader &esm, Loading::Listener* listener)
{
listener->setProgressRange(1000);
std::set<std::string> missing;
ESM::Dialogue *dialogue = 0;
@ -109,6 +113,7 @@ void ESMStore::load(ESM::ESMReader &esm)
mIds[id] = n.val;
}
}
listener->setProgress(esm.getFileOffset() / (float)esm.getFileSize() * 1000);
}
/* This information isn't needed on screen. But keep the code around

@ -6,6 +6,11 @@
#include <components/esm/records.hpp>
#include "store.hpp"
namespace Loading
{
class Listener;
}
namespace MWWorld
{
class ESMStore
@ -158,7 +163,7 @@ namespace MWWorld
mNpcs.insert(mPlayerTemplate);
}
void load(ESM::ESMReader &esm);
void load(ESM::ESMReader &esm, Loading::Listener* listener);
template <class T>
const Store<T> &get() const {

@ -29,7 +29,7 @@ namespace MWWorld
{
static const float sMaxSlope = 60.0f;
static const float sStepSize = 30.0f;
static const float sStepSize = 32.0f;
// Arbitrary number. To prevent infinite loops. They shouldn't happen but it's good to be prepared.
static const int sMaxIterations = 8;
@ -48,16 +48,15 @@ namespace MWWorld
OEngine::Physic::ActorTracer tracer, stepper;
stepper.doTrace(colobj, position, position+Ogre::Vector3(0.0f,0.0f,sStepSize), engine);
if(stepper.mFraction == 0.0f)
if(stepper.mFraction < std::numeric_limits<float>::epsilon())
return false;
tracer.doTrace(colobj, stepper.mEndPos, stepper.mEndPos + velocity*remainingTime, engine);
if(tracer.mFraction < std::numeric_limits<float>::epsilon() ||
(tracer.mFraction < 1.0f && getSlope(tracer.mPlaneNormal) > sMaxSlope))
if(tracer.mFraction < std::numeric_limits<float>::epsilon())
return false;
stepper.doTrace(colobj, tracer.mEndPos, tracer.mEndPos-Ogre::Vector3(0.0f,0.0f,sStepSize), engine);
if(getSlope(stepper.mPlaneNormal) <= sMaxSlope)
if(stepper.mFraction < 1.0f && getSlope(stepper.mPlaneNormal) <= sMaxSlope)
{
// only step down onto semi-horizontal surfaces. don't step down onto the side of a house or a wall.
position = stepper.mEndPos;
@ -257,7 +256,7 @@ namespace MWWorld
return mEngine;
}
std::pair<float, std::string> PhysicsSystem::getFacedHandle (MWWorld::World& world, float queryDistance)
std::pair<float, std::string> PhysicsSystem::getFacedHandle(float queryDistance)
{
Ray ray = mRender.getCamera()->getCameraToViewportRay(0.5, 0.5);
@ -267,8 +266,7 @@ namespace MWWorld
btVector3 dir(dir_.x, dir_.y, dir_.z);
btVector3 dest = origin + dir * queryDistance;
std::pair <std::string, float> result;
/*auto*/ result = mEngine->rayTest(origin, dest);
std::pair <std::string, float> result = mEngine->rayTest(origin, dest);
result.second *= queryDistance;
return std::make_pair (result.second, result.first);
@ -339,24 +337,6 @@ namespace MWWorld
}
btVector3 PhysicsSystem::getRayPoint(float extent)
{
//get a ray pointing to the center of the viewport
Ray centerRay = mRender.getCamera()->getCameraToViewportRay(
mRender.getViewport()->getWidth()/2,
mRender.getViewport()->getHeight()/2);
btVector3 result(centerRay.getPoint(extent).x,centerRay.getPoint(extent).y,centerRay.getPoint(extent).z);
return result;
}
btVector3 PhysicsSystem::getRayPoint(float extent, float mouseX, float mouseY)
{
//get a ray pointing to the center of the viewport
Ray centerRay = mRender.getCamera()->getCameraToViewportRay(mouseX, mouseY);
btVector3 result(centerRay.getPoint(extent).x,centerRay.getPoint(extent).y,centerRay.getPoint(extent).z);
return result;
}
bool PhysicsSystem::castRay(const Vector3& from, const Vector3& to, bool raycastingObjectOnly,bool ignoreHeightMap)
{
btVector3 _from, _to;

@ -56,7 +56,7 @@ namespace MWWorld
std::vector<std::string> getCollisions(const MWWorld::Ptr &ptr); ///< get handles this object collides with
Ogre::Vector3 traceDown(const MWWorld::Ptr &ptr);
std::pair<float, std::string> getFacedHandle (MWWorld::World& world, float queryDistance);
std::pair<float, std::string> getFacedHandle(float queryDistance);
std::pair<std::string,Ogre::Vector3> getHitContact(const std::string &name,
const Ogre::Vector3 &origin,
const Ogre::Quaternion &orientation,
@ -64,10 +64,6 @@ namespace MWWorld
std::vector < std::pair <float, std::string> > getFacedHandles (float queryDistance);
std::vector < std::pair <float, std::string> > getFacedHandles (float mouseX, float mouseY, float queryDistance);
btVector3 getRayPoint(float extent);
btVector3 getRayPoint(float extent, float mouseX, float mouseY);
// cast ray, return true if it hit something. if raycasringObjectOnlt is set to false, it ignores NPCs and objects with no collisions.
bool castRay(const Ogre::Vector3& from, const Ogre::Vector3& to, bool raycastingObjectOnly = true,bool ignoreHeightMap = false);

@ -25,13 +25,12 @@ namespace
template<typename T>
void insertCellRefList(MWRender::RenderingManager& rendering,
T& cellRefList, MWWorld::CellStore &cell, MWWorld::PhysicsSystem& physics, bool rescale)
T& cellRefList, MWWorld::CellStore &cell, MWWorld::PhysicsSystem& physics, bool rescale, Loading::Listener* loadingListener)
{
if (!cellRefList.mList.empty())
{
const MWWorld::Class& class_ =
MWWorld::Class::get (MWWorld::Ptr (&*cellRefList.mList.begin(), &cell));
int current = 0;
for (typename T::List::iterator it = cellRefList.mList.begin();
it != cellRefList.mList.end(); it++)
{
@ -43,8 +42,6 @@ namespace
it->mRef.mScale = 2;
}
++current;
if (it->mData.getCount() && it->mData.isEnabled())
{
MWWorld::Ptr ptr (&*it, &cell);
@ -68,6 +65,8 @@ namespace
std::cerr << error + e.what() << std::endl;
}
}
loadingListener->increaseProgress(1);
}
}
}
@ -117,7 +116,7 @@ namespace MWWorld
mActiveCells.erase(*iter);
}
void Scene::loadCell (Ptr::CellStore *cell)
void Scene::loadCell (Ptr::CellStore *cell, Loading::Listener* loadingListener)
{
// register local scripts
MWBase::Environment::get().getWorld()->getLocalScripts().addCell (cell);
@ -150,7 +149,7 @@ namespace MWWorld
// ... then references. This is important for adjustPosition to work correctly.
/// \todo rescale depending on the state of a new GMST
insertCell (*cell, true);
insertCell (*cell, true, loadingListener);
mRendering.cellAdded (cell);
@ -200,17 +199,15 @@ namespace MWWorld
void Scene::changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos)
{
Nif::NIFFile::CacheLock cachelock;
const MWWorld::Store<ESM::GameSetting> &gmst =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
mRendering.preCellChange(mCurrentCell);
Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
Loading::ScopedLoad load(loadingListener);
// remove active
MWBase::Environment::get().getMechanicsManager()->remove(MWBase::Environment::get().getWorld()->getPlayer().getPlayer());
std::string loadingExteriorText;
loadingExteriorText = gmst.find ("sLoadingMessage3")->getString();
std::string loadingExteriorText = "#{sLoadingMessage3}";
loadingListener->setLabel(loadingExteriorText);
CellStoreCollection::iterator active = mActiveCells.begin();
@ -232,7 +229,6 @@ namespace MWWorld
++numUnload;
}
int current = 0;
active = mActiveCells.begin();
while (active!=mActiveCells.end())
{
@ -247,11 +243,10 @@ namespace MWWorld
}
}
unloadCell (active++);
++current;
}
int numLoad = 0;
// get the number of cells to load
int refsToLoad = 0;
// get the number of refs to load
for (int x=X-1; x<=X+1; ++x)
for (int y=Y-1; y<=Y+1; ++y)
{
@ -269,11 +264,12 @@ namespace MWWorld
}
if (iter==mActiveCells.end())
++numLoad;
refsToLoad += countRefs(*MWBase::Environment::get().getWorld()->getExterior(x, y));
}
loadingListener->setProgressRange(refsToLoad);
// Load cells
current = 0;
for (int x=X-1; x<=X+1; ++x)
for (int y=Y-1; y<=Y+1; ++y)
{
@ -294,11 +290,7 @@ namespace MWWorld
{
CellStore *cell = MWBase::Environment::get().getWorld()->getExterior(x, y);
//Loading Exterior loading text
MWBase::Environment::get().getWindowManager ()->setLoadingProgress (loadingExteriorText, 0, current, numLoad);
loadCell (cell);
++current;
loadCell (cell, loadingListener);
}
}
@ -330,7 +322,7 @@ namespace MWWorld
mCellChanged = true;
MWBase::Environment::get().getWindowManager ()->loadingDone ();
loadingListener->removeWallpaper();
}
//We need the ogre renderer and a scene node.
@ -356,13 +348,14 @@ namespace MWWorld
void Scene::changeToInteriorCell (const std::string& cellName, const ESM::Position& position)
{
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(0.5);
const MWWorld::Store<ESM::GameSetting> &gmst =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
mRendering.enableTerrain(false);
std::string loadingInteriorText;
loadingInteriorText = gmst.find ("sLoadingMessage2")->getString();
Loading::Listener* loadingListener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
Loading::ScopedLoad load(loadingListener);
std::string loadingInteriorText = "#{sLoadingMessage2}";
loadingListener->setLabel(loadingInteriorText);
CellStore *cell = MWBase::Environment::get().getWorld()->getInterior(cellName);
bool loadcell = (mCurrentCell == NULL);
@ -406,13 +399,15 @@ namespace MWWorld
++current;
}
int refsToLoad = countRefs(*cell);
loadingListener->setProgressRange(refsToLoad);
// Load cell.
std::cout << "cellName: " << cell->mCell->mName << std::endl;
//Loading Interior loading text
MWBase::Environment::get().getWindowManager ()->setLoadingProgress (loadingInteriorText, 0, 0, 1);
loadCell (cell);
loadCell (cell, loadingListener);
mCurrentCell = cell;
@ -429,7 +424,7 @@ namespace MWWorld
mCellChanged = true;
MWBase::Environment::get().getWorld ()->getFader ()->fadeIn(0.5);
MWBase::Environment::get().getWindowManager ()->loadingDone ();
loadingListener->removeWallpaper();
}
void Scene::changeToExteriorCell (const ESM::Position& position)
@ -454,30 +449,54 @@ namespace MWWorld
mCellChanged = false;
}
void Scene::insertCell (Ptr::CellStore &cell, bool rescale)
int Scene::countRefs (const Ptr::CellStore& cell)
{
return cell.mActivators.mList.size()
+ cell.mPotions.mList.size()
+ cell.mAppas.mList.size()
+ cell.mArmors.mList.size()
+ cell.mBooks.mList.size()
+ cell.mClothes.mList.size()
+ cell.mContainers.mList.size()
+ cell.mDoors.mList.size()
+ cell.mIngreds.mList.size()
+ cell.mCreatureLists.mList.size()
+ cell.mItemLists.mList.size()
+ cell.mLights.mList.size()
+ cell.mLockpicks.mList.size()
+ cell.mMiscItems.mList.size()
+ cell.mProbes.mList.size()
+ cell.mRepairs.mList.size()
+ cell.mStatics.mList.size()
+ cell.mWeapons.mList.size()
+ cell.mCreatures.mList.size()
+ cell.mNpcs.mList.size();
}
void Scene::insertCell (Ptr::CellStore &cell, bool rescale, Loading::Listener* loadingListener)
{
// Loop through all references in the cell
insertCellRefList(mRendering, cell.mActivators, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mPotions, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mAppas, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mArmors, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mBooks, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mClothes, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mContainers, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mDoors, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mIngreds, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mCreatureLists, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mItemLists, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mLights, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mLockpicks, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mMiscItems, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mProbes, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mRepairs, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mStatics, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mWeapons, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mActivators, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mPotions, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mAppas, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mArmors, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mBooks, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mClothes, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mContainers, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mDoors, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mIngreds, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mCreatureLists, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mItemLists, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mLights, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mLockpicks, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mMiscItems, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mProbes, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mRepairs, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mStatics, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mWeapons, cell, *mPhysics, rescale, loadingListener);
// Load NPCs and creatures _after_ everything else (important for adjustPosition to work correctly)
insertCellRefList(mRendering, cell.mCreatures, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mNpcs, cell, *mPhysics, rescale);
insertCellRefList(mRendering, cell.mCreatures, cell, *mPhysics, rescale, loadingListener);
insertCellRefList(mRendering, cell.mNpcs, cell, *mPhysics, rescale, loadingListener);
}
void Scene::addObjectToScene (const Ptr& ptr)

@ -56,7 +56,9 @@ namespace MWWorld
void playerCellChange (CellStore *cell, const ESM::Position& position,
bool adjustPlayerPos = true);
void insertCell (Ptr::CellStore &cell, bool rescale);
void insertCell (Ptr::CellStore &cell, bool rescale, Loading::Listener* loadingListener);
int countRefs (const Ptr::CellStore& cell);
public:
@ -66,7 +68,7 @@ namespace MWWorld
void unloadCell (CellStoreCollection::iterator iter);
void loadCell (CellStore *cell);
void loadCell (CellStore *cell, Loading::Listener* loadingListener);
void changeCell (int X, int Y, const ESM::Position& position, bool adjustPlayerPos);
///< Move from exterior to interior or from interior cell to a different

@ -167,6 +167,11 @@ WeatherManager::WeatherManager(MWRender::RenderingManager* rendering,MWWorld::Fa
setFallbackWeather(blizzard,"blizzard");
}
WeatherManager::~WeatherManager()
{
stopSounds(true);
}
void WeatherManager::setWeather(const String& weather, bool instant)
{
if (weather == mCurrentWeather && mNextWeather == "")

@ -120,6 +120,7 @@ namespace MWWorld
{
public:
WeatherManager(MWRender::RenderingManager*,MWWorld::Fallback* fallback);
~WeatherManager();
/**
* Change the weather in the specified region

@ -184,11 +184,14 @@ namespace MWWorld
int idx = 0;
// NOTE: We might need to reserve one more for the running game / save.
mEsm.resize(master.size() + plugins.size());
Loading::Listener* listener = MWBase::Environment::get().getWindowManager()->getLoadingScreen();
listener->loadingOn();
for (std::vector<std::string>::size_type i = 0; i < master.size(); i++, idx++)
{
boost::filesystem::path masterPath (fileCollections.getCollection (".esm").getPath (master[i]));
std::cout << "Loading ESM " << masterPath.string() << "\n";
listener->setLabel(masterPath.filename().string());
// This parses the ESM file
ESM::ESMReader lEsm;
@ -197,7 +200,7 @@ namespace MWWorld
lEsm.setGlobalReaderList(&mEsm);
lEsm.open (masterPath.string());
mEsm[idx] = lEsm;
mStore.load (mEsm[idx]);
mStore.load (mEsm[idx], listener);
}
for (std::vector<std::string>::size_type i = 0; i < plugins.size(); i++, idx++)
@ -205,6 +208,7 @@ namespace MWWorld
boost::filesystem::path pluginPath (fileCollections.getCollection (".esp").getPath (plugins[i]));
std::cout << "Loading ESP " << pluginPath.string() << "\n";
listener->setLabel(pluginPath.filename().string());
// This parses the ESP file
ESM::ESMReader lEsm;
@ -213,8 +217,9 @@ namespace MWWorld
lEsm.setGlobalReaderList(&mEsm);
lEsm.open (pluginPath.string());
mEsm[idx] = lEsm;
mStore.load (mEsm[idx]);
mStore.load (mEsm[idx], listener);
}
listener->loadingOff();
// insert records that may not be present in all versions of MW
if (mEsm[0].getFormat() == 0)
@ -761,7 +766,7 @@ namespace MWWorld
std::pair<float, std::string> result;
if (!mRendering->occlusionQuerySupported())
result = mPhysics->getFacedHandle (*this, getMaxActivationDistance ());
result = mPhysics->getFacedHandle (getMaxActivationDistance ());
else
result = std::make_pair (mFacedDistance, mFacedHandle);

@ -67,7 +67,11 @@ add_component_dir (translation
)
add_component_dir (terrain
quadtreenode chunk terrain storage material
quadtreenode chunk world storage material
)
add_component_dir (loadinglistener
loadinglistener
)
find_package(Qt4 COMPONENTS QtCore QtGui)

@ -70,6 +70,11 @@ public:
void openRaw(const std::string &file);
/// Get the file size. Make sure that the file has been opened!
size_t getFileSize() { return mEsm->size(); }
/// Get the current position in the file. Make sure that the file has been opened!
size_t getFileOffset() { return mEsm->tell(); }
// This is a quick hack for multiple esm/esp files. Each plugin introduces its own
// terrain palette, but ESMReader does not pass a reference to the correct plugin
// to the individual load() methods. This hack allows to pass this reference

@ -0,0 +1,35 @@
#ifndef COMPONENTS_LOADINGLISTENER_H
#define COMPONENTS_LOADINGLISTENER_H
namespace Loading
{
class Listener
{
public:
virtual void setLabel (const std::string& label) = 0;
// Use ScopedLoad instead of using these directly
virtual void loadingOn() = 0;
virtual void loadingOff() = 0;
/// Indicate that some progress has been made, without specifying how much
virtual void indicateProgress () = 0;
virtual void setProgressRange (size_t range) = 0;
virtual void setProgress (size_t value) = 0;
virtual void increaseProgress (size_t increase) = 0;
/// Indicate the scene is now ready to be shown
virtual void removeWallpaper() = 0;
};
// Used for stopping a loading sequence when the object goes out of scope
struct ScopedLoad
{
ScopedLoad(Listener* l) : mListener(l) { mListener->loadingOn(); }
~ScopedLoad() { mListener->loadingOff(); }
Listener* mListener;
};
}
#endif

@ -4,7 +4,7 @@
#include <OgreHardwareBufferManager.h>
#include "quadtreenode.hpp"
#include "terrain.hpp"
#include "world.hpp"
#include "storage.hpp"
namespace Terrain

@ -3,7 +3,7 @@
#include <OgreSceneManager.h>
#include <OgreManualObject.h>
#include "terrain.hpp"
#include "world.hpp"
#include "chunk.hpp"
#include "storage.hpp"
@ -13,6 +13,13 @@ using namespace Terrain;
namespace
{
int Log2( int n )
{
assert(n > 0);
int targetlevel = 0;
while (n >>= 1) ++targetlevel;
return targetlevel;
}
// Utility functions for neighbour finding algorithm
ChildDirection reflect(ChildDirection dir, Direction dir2)
@ -132,7 +139,7 @@ namespace
}
}
QuadTreeNode::QuadTreeNode(Terrain* terrain, ChildDirection dir, float size, const Ogre::Vector2 &center, QuadTreeNode* parent)
QuadTreeNode::QuadTreeNode(World* terrain, ChildDirection dir, float size, const Ogre::Vector2 &center, QuadTreeNode* parent)
: mSize(size)
, mCenter(center)
, mParent(parent)
@ -161,7 +168,7 @@ QuadTreeNode::QuadTreeNode(Terrain* terrain, ChildDirection dir, float size, con
pos = mCenter - pos;
mSceneNode->setPosition(Ogre::Vector3(pos.x*8192, pos.y*8192, 0));
mLodLevel = log2(mSize);
mLodLevel = Log2(mSize);
mMaterialGenerator = new MaterialGenerator(mTerrain->getShadersEnabled());
}
@ -220,7 +227,7 @@ const Ogre::AxisAlignedBox& QuadTreeNode::getBoundingBox()
return mBounds;
}
void QuadTreeNode::update(const Ogre::Vector3 &cameraPos)
void QuadTreeNode::update(const Ogre::Vector3 &cameraPos, Loading::Listener* loadingListener)
{
const Ogre::AxisAlignedBox& bounds = getBoundingBox();
if (bounds.isNull())
@ -254,6 +261,9 @@ void QuadTreeNode::update(const Ogre::Vector3 &cameraPos)
bool hadChunk = hasChunk();
if (loadingListener)
loadingListener->indicateProgress();
if (!distantLand && dist > 8192*2)
{
if (mIsActive)
@ -341,7 +351,7 @@ void QuadTreeNode::update(const Ogre::Vector3 &cameraPos)
}
assert(hasChildren() && "Leaf node's LOD needs to be 0");
for (int i=0; i<4; ++i)
mChildren[i]->update(cameraPos);
mChildren[i]->update(cameraPos, loadingListener);
}
}

@ -5,6 +5,8 @@
#include <OgreVector2.h>
#include <OgreTexture.h>
#include <components/loadinglistener/loadinglistener.hpp>
namespace Ogre
{
class Rectangle2D;
@ -12,7 +14,7 @@ namespace Ogre
namespace Terrain
{
class Terrain;
class World;
class Chunk;
class MaterialGenerator;
@ -46,7 +48,7 @@ namespace Terrain
/// @param size size (in *cell* units!)
/// @param center center (in *cell* units!)
/// @param parent parent node
QuadTreeNode (Terrain* terrain, ChildDirection dir, float size, const Ogre::Vector2& center, QuadTreeNode* parent);
QuadTreeNode (World* terrain, ChildDirection dir, float size, const Ogre::Vector2& center, QuadTreeNode* parent);
~QuadTreeNode();
void setVisible(bool visible);
@ -93,10 +95,10 @@ namespace Terrain
/// Get bounding box in local coordinates
const Ogre::AxisAlignedBox& getBoundingBox();
Terrain* getTerrain() { return mTerrain; }
World* getTerrain() { return mTerrain; }
/// Adjust LODs for the given camera position, possibly splitting up chunks or merging them.
void update (const Ogre::Vector3& cameraPos);
void update (const Ogre::Vector3& cameraPos, Loading::Listener* loadingListener);
/// Adjust index buffers of chunks to stitch together chunks of different LOD, so that cracks are avoided.
/// Call after QuadTreeNode::update!
@ -146,7 +148,7 @@ namespace Terrain
Chunk* mChunk;
Terrain* mTerrain;
World* mTerrain;
Ogre::TexturePtr mCompositeMap;

@ -1,4 +1,4 @@
#include "terrain.hpp"
#include "world.hpp"
#include <OgreAxisAlignedBox.h>
#include <OgreCamera.h>
@ -7,6 +7,7 @@
#include <OgreRoot.h>
#include <components/esm/loadland.hpp>
#include <components/loadinglistener/loadinglistener.hpp>
#include "storage.hpp"
#include "quadtreenode.hpp"
@ -51,7 +52,8 @@ namespace
namespace Terrain
{
Terrain::Terrain(Ogre::SceneManager* sceneMgr, Storage* storage, int visibilityFlags, bool distantLand, bool shaders)
World::World(Loading::Listener* loadingListener, Ogre::SceneManager* sceneMgr,
Storage* storage, int visibilityFlags, bool distantLand, bool shaders)
: mStorage(storage)
, mMinBatchSize(1)
, mMaxBatchSize(64)
@ -60,7 +62,11 @@ namespace Terrain
, mDistantLand(distantLand)
, mShaders(shaders)
, mVisible(true)
, mLoadingListener(loadingListener)
{
loadingListener->setLabel("Creating terrain");
loadingListener->indicateProgress();
mCompositeMapSceneMgr = Ogre::Root::getSingleton().createSceneManager(Ogre::ST_GENERIC);
Ogre::Camera* compositeMapCam = mCompositeMapSceneMgr->createCamera("a");
@ -86,17 +92,20 @@ namespace Terrain
mRootNode = new QuadTreeNode(this, Root, size, Ogre::Vector2(center.x, center.y), NULL);
buildQuadTree(mRootNode);
loadingListener->indicateProgress();
mRootNode->initAabb();
loadingListener->indicateProgress();
mRootNode->initNeighbours();
loadingListener->indicateProgress();
}
Terrain::~Terrain()
World::~World()
{
delete mRootNode;
delete mStorage;
}
void Terrain::buildQuadTree(QuadTreeNode *node)
void World::buildQuadTree(QuadTreeNode *node)
{
float halfSize = node->getSize()/2.f;
@ -143,15 +152,15 @@ namespace Terrain
node->markAsDummy();
}
void Terrain::update(const Ogre::Vector3& cameraPos)
void World::update(const Ogre::Vector3& cameraPos)
{
if (!mVisible)
return;
mRootNode->update(cameraPos);
mRootNode->update(cameraPos, mLoadingListener);
mRootNode->updateIndexBuffers();
}
Ogre::AxisAlignedBox Terrain::getWorldBoundingBox (const Ogre::Vector2& center)
Ogre::AxisAlignedBox World::getWorldBoundingBox (const Ogre::Vector2& center)
{
if (center.x > mBounds.getMaximum().x
|| center.x < mBounds.getMinimum().x
@ -165,7 +174,7 @@ namespace Terrain
return box;
}
Ogre::HardwareVertexBufferSharedPtr Terrain::getVertexBuffer(int numVertsOneSide)
Ogre::HardwareVertexBufferSharedPtr World::getVertexBuffer(int numVertsOneSide)
{
if (mUvBufferMap.find(numVertsOneSide) != mUvBufferMap.end())
{
@ -197,7 +206,7 @@ namespace Terrain
return buffer;
}
Ogre::HardwareIndexBufferSharedPtr Terrain::getIndexBuffer(int flags, size_t& numIndices)
Ogre::HardwareIndexBufferSharedPtr World::getIndexBuffer(int flags, size_t& numIndices)
{
if (mIndexBufferMap.find(flags) != mIndexBufferMap.end())
{
@ -358,31 +367,31 @@ namespace Terrain
return buffer;
}
void Terrain::renderCompositeMap(Ogre::TexturePtr target)
void World::renderCompositeMap(Ogre::TexturePtr target)
{
mCompositeMapRenderTarget->update();
target->getBuffer()->blit(mCompositeMapRenderTexture->getBuffer());
}
void Terrain::clearCompositeMapSceneManager()
void World::clearCompositeMapSceneManager()
{
mCompositeMapSceneMgr->destroyAllManualObjects();
mCompositeMapSceneMgr->clearScene();
}
float Terrain::getHeightAt(const Ogre::Vector3 &worldPos)
float World::getHeightAt(const Ogre::Vector3 &worldPos)
{
return mStorage->getHeightAt(worldPos);
}
void Terrain::applyMaterials(bool shadows, bool splitShadows)
void World::applyMaterials(bool shadows, bool splitShadows)
{
mShadows = shadows;
mSplitShadows = splitShadows;
mRootNode->applyMaterials();
}
void Terrain::setVisible(bool visible)
void World::setVisible(bool visible)
{
if (visible && !mVisible)
mSceneMgr->getRootSceneNode()->addChild(mRootSceneNode);
@ -392,7 +401,7 @@ namespace Terrain
mVisible = visible;
}
bool Terrain::getVisible()
bool World::getVisible()
{
return mVisible;
}

@ -6,6 +6,11 @@
#include <OgreAxisAlignedBox.h>
#include <OgreTexture.h>
namespace Loading
{
class Listener;
}
namespace Ogre
{
class Camera;
@ -24,10 +29,11 @@ namespace Terrain
* Cracks at LOD transitions are avoided using stitching.
* @note Multiple cameras are not supported yet
*/
class Terrain
class World
{
public:
/// @note takes ownership of \a storage
/// @param loadingListener Listener to update with progress
/// @param sceneMgr scene manager to use
/// @param storage Storage instance to get terrain data from (heights, normals, colors, textures..)
/// @param visbilityFlags visibility flags for the created meshes
@ -35,8 +41,11 @@ namespace Terrain
/// This is a temporary option until it can be streamlined.
/// @param shaders Whether to use splatting shader, or multi-pass fixed function splatting. Shader is usually
/// faster so this is just here for compatibility.
Terrain(Ogre::SceneManager* sceneMgr, Storage* storage, int visiblityFlags, bool distantLand, bool shaders);
~Terrain();
World(Loading::Listener* loadingListener, Ogre::SceneManager* sceneMgr,
Storage* storage, int visiblityFlags, bool distantLand, bool shaders);
~World();
void setLoadingListener(Loading::Listener* loadingListener) { mLoadingListener = loadingListener; }
bool getDistantLandEnabled() { return mDistantLand; }
bool getShadersEnabled() { return mShaders; }
@ -84,6 +93,8 @@ namespace Terrain
bool mSplitShadows;
bool mVisible;
Loading::Listener* mLoadingListener;
QuadTreeNode* mRootNode;
Ogre::SceneNode* mRootSceneNode;
Storage* mStorage;

@ -35,9 +35,20 @@ namespace SFO
mSDLWindow = NULL;
}
void InputWrapper::capture()
void InputWrapper::capture(bool windowEventsOnly)
{
SDL_PumpEvents();
SDL_Event evt;
if (windowEventsOnly)
{
// During loading, just handle window events, and keep others for later
while (SDL_PeepEvents(&evt, 1, SDL_GETEVENT, SDL_WINDOWEVENT, SDL_WINDOWEVENT))
handleWindowEvent(evt);
return;
}
while(SDL_PollEvent(&evt))
{
switch(evt.type)

@ -24,7 +24,7 @@ namespace SFO
void setWindowEventCallback(WindowListener* listen) { mWindowListener = listen; }
void setJoyEventCallback(JoyListener* listen) { mJoyListener = listen; }
void capture();
void capture(bool windowEventsOnly);
bool isModifierHeld(SDL_Keymod mod);
bool isKeyDown(SDL_Scancode key);

@ -3,23 +3,28 @@
#define SIMPLE_WATER @shGlobalSettingBool(simple_water)
#if SIMPLE_WATER
// --------------------------------------- SIMPLE WATER ---------------------------------------------------
#define FOG @shGlobalSettingBool(fog)
#ifdef SH_VERTEX_SHADER
SH_BEGIN_PROGRAM
shUniform(float4x4, wvp) @shAutoConstant(wvp, worldviewproj_matrix)
shVertexInput(float2, uv0)
shOutput(float2, UV)
shOutput(float, depth)
#if FOG
shOutput(float, depth)
#endif
SH_START_PROGRAM
{
shOutputPosition = shMatrixMult(wvp, shInputPosition);
UV = uv0;
#if FOG
depth = shOutputPosition.z;
#endif
}
#else
@ -38,8 +43,10 @@
shOutputColour(0).xyz = shSample(animatedTexture, UV * 15).xyz * float3(1.0, 1.0, 1.0);
shOutputColour(0).w = 0.7;
#if FOG
float fogValue = shSaturate((depth - fogParams.y) * fogParams.w);
shOutputColour(0).xyz = shLerp (shOutputColour(0).xyz, fogColor, fogValue);
#endif
}
#endif

@ -1,25 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI>
<MyGUI type="List">
<List file="core.skin" />
<List file="openmw_resources.xml" />
<List file="core.skin"/>
<List file="openmw_resources.xml"/>
<List file="openmw_font.xml"/>
<List file="openmw_text.skin.xml" />
<List file="openmw_windows.skin.xml" />
<List file="openmw_button.skin.xml" />
<List file="openmw_list.skin.xml" />
<List file="openmw_edit.skin.xml" />
<List file="openmw_box.skin.xml" />
<List file="openmw_progress.skin.xml" />
<List file="openmw_hud_energybar.skin.xml" />
<List file="openmw_hud_box.skin.xml" />
<List file="openmw_mainmenu_skin.xml" />
<List file="openmw_console.skin.xml" />
<List file="openmw_journal_skin.xml" />
<List file="openmw_map_window_skin.xml" />
<List file="openmw_dialogue_window_skin.xml" />
<List file="openmw_scroll_skin.xml" />
<List file="openmw_settings.xml" />
<List file="openmw_text.skin.xml"/>
<List file="openmw_windows.skin.xml"/>
<List file="openmw_button.skin.xml"/>
<List file="openmw_list.skin.xml"/>
<List file="openmw_edit.skin.xml"/>
<List file="openmw_box.skin.xml"/>
<List file="openmw_progress.skin.xml"/>
<List file="openmw_hud_energybar.skin.xml"/>
<List file="openmw_hud_box.skin.xml"/>
<List file="openmw_mainmenu_skin.xml"/>
<List file="openmw_console.skin.xml"/>
<List file="openmw_journal_skin.xml"/>
<List file="openmw_map_window_skin.xml"/>
<List file="openmw_dialogue_window_skin.xml"/>
<List file="openmw_scroll_skin.xml"/>
<List file="openmw_settings.xml"/>
</MyGUI>
</MyGUI>

@ -2,7 +2,7 @@
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Window_NoCaption" layer="Windows" position="0 0 588 444" name="_Main">
<Property key="MinSize" value="420 360"/>
<Property key="MinSize" value="425 360"/>
<!-- Name -->

@ -62,7 +62,7 @@
<!-- Button widget -->
<Skin name="MW_Button" size="136 24">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center" />
<Property key="TextAlign" value="Center"/>
<Child type="Widget" skin="BTN_Left" offset="0 4 4 16" align="VStretch Left"/>
<Child type="Widget" skin="BTN_Right" offset="132 4 4 16" align="VStretch Right"/>

@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 485 375" name="_Main">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 491 378" name="_Main">
<!-- Birthsign list -->
<Widget type="ListBox" skin="MW_List" position="8 13 196 137" name="BirthsignList" />
<Widget type="ListBox" skin="MW_List" position="8 8 196 137" name="BirthsignList"/>
<!-- Birthsign image -->
<Widget type="Widget" skin="MW_Box" position="206 13 263 137" align="Left Top">
<Widget type="ImageBox" skin="ImageBox" position="2 2 259 133" name="BirthsignImage" align="Left Top" />
<Widget type="Widget" skin="MW_Box" position="212 8 263 137" align="Left Top">
<Widget type="ImageBox" skin="ImageBox" position="2 2 259 133" name="BirthsignImage" align="Left Top"/>
</Widget>
<!-- Spell list -->
<Widget type="Widget" skin="" position="8 160 465 178" align="Left Top" name="SpellArea">
</Widget>
<Widget type="Widget" skin="" position="8 160 465 178" align="Left Top" name="SpellArea"/>
<!-- Dialog buttons -->
<Widget type="HBox" position="0 340 473 24">
<Widget type="HBox" position="0 338 475 24">
<Widget type="Widget">
<UserString key="HStretch" value="true"/>
</Widget>
@ -25,5 +25,6 @@
<Property key="Caption" value="OK"/>
</Widget>
</Widget>
</Widget>
</MyGUI>

@ -1,66 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 491 302" name="_Main">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 478 316" name="_Main">
<!-- Class list -->
<Widget type="ListBox" skin="MW_List" position="14 13 181 131" name="ClassList" />
<Widget type="ListBox" skin="MW_List" position="8 8 181 138" name="ClassList"/>
<!-- Class image -->
<Widget type="Widget" skin="MW_Box" position="212 9 265 138" align="Left Top">
<Widget type="ImageBox" skin="ImageBox" position="2 2 261 134" name="ClassImage" align="Left Top" />
<Widget type="Widget" skin="MW_Box" position="197 8 265 138" align="Left Top">
<Widget type="ImageBox" skin="ImageBox" position="2 2 261 134" name="ClassImage" align="Left Top"/>
</Widget>
<!-- Specialization -->
<Widget type="Widget" skin="" position="15 152 484 178" align="Left Top">
<Widget type="Widget" skin="" position="15 156 484 178" align="Left Top">
<Widget type="TextBox" skin="HeaderText" position="0 0 162 18" name="SpecializationT" align="Left Top">
<Property key="Caption" value="#{sChooseClassMenu1}"/>
<Property key="TextAlign" value="Left Top"/>
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="TextToolTip"/>
<UserString key="Caption_Text" value="#{sCreateClassMenuHelp1}"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="0 18 162 18" name="SpecializationName" align="Left Top">
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="TextBox" skin="HeaderText" position="0 0 162 18" name="SpecializationT" align="Left Top">
<Property key="Caption" value="#{sChooseClassMenu1}"/>
<Property key="TextAlign" value="Left Top"/>
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="TextToolTip"/>
<UserString key="Caption_Text" value="#{sCreateClassMenuHelp1}"/>
</Widget>
<!-- Favorite Attributes -->
<Widget type="TextBox" skin="HeaderText" position="0 41 162 18" name="FavoriteAttributesT" align="Left Top">
<Property key="Caption" value="#{sChooseClassMenu2}"/>
<Property key="TextAlign" value="Left Top"/>
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="TextToolTip"/>
<UserString key="Caption_Text" value="#{sCreateClassMenuHelp2}"/>
</Widget>
<Widget type="MWAttribute" skin="MW_StatName" position="0 59 162 18" name="FavoriteAttribute0" align="Left Top" />
<Widget type="MWAttribute" skin="MW_StatName" position="0 77 162 18" name="FavoriteAttribute1" align="Left Top" />
<Widget type="TextBox" skin="SandText" position="0 18 162 18" name="SpecializationName" align="Left Top">
<Property key="TextAlign" value="Left Top"/>
</Widget>
<!-- Major Skills -->
<Widget type="TextBox" skin="HeaderText" position="162 0 162 18" name="MajorSkillT" align="Left Top">
<Property key="TextAlign" value="Left Top"/>
<Property key="Caption" value="#{sChooseClassMenu3}"/>
</Widget>
<Widget type="MWSkill" skin="MW_StatName" position="162 18 162 18" name="MajorSkill0" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatName" position="162 36 162 18" name="MajorSkill1" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatName" position="162 54 162 18" name="MajorSkill2" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatName" position="162 72 162 18" name="MajorSkill3" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatName" position="162 90 162 18" name="MajorSkill4" align="Left Top" />
<!-- Favorite Attributes -->
<Widget type="TextBox" skin="HeaderText" position="0 41 162 18" name="FavoriteAttributesT" align="Left Top">
<Property key="Caption" value="#{sChooseClassMenu2}"/>
<Property key="TextAlign" value="Left Top"/>
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="TextToolTip"/>
<UserString key="Caption_Text" value="#{sCreateClassMenuHelp2}"/>
</Widget>
<!-- Minor Skills -->
<Widget type="TextBox" skin="HeaderText" position="325 0 162 18" name="MinorSkillT" align="Left Top">
<Property key="Caption" value="#{sChooseClassMenu4}"/>
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="MWSkill" skin="MW_StatName" position="325 18 162 18" name="MinorSkill0" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatName" position="325 36 162 18" name="MinorSkill1" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatName" position="325 54 162 18" name="MinorSkill2" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatName" position="325 72 162 18" name="MinorSkill3" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatName" position="325 90 162 18" name="MinorSkill4" align="Left Top" />
<Widget type="MWAttribute" skin="MW_StatName" position="0 59 162 18" name="FavoriteAttribute0" align="Left Top"/>
<Widget type="MWAttribute" skin="MW_StatName" position="0 77 162 18" name="FavoriteAttribute1" align="Left Top"/>
<!-- Major Skills -->
<Widget type="TextBox" skin="HeaderText" position="162 0 162 18" name="MajorSkillT" align="Left Top">
<Property key="TextAlign" value="Left Top"/>
<Property key="Caption" value="#{sChooseClassMenu3}"/>
</Widget>
<Widget type="MWSkill" skin="MW_StatName" position="162 18 162 18" name="MajorSkill0" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatName" position="162 36 162 18" name="MajorSkill1" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatName" position="162 54 162 18" name="MajorSkill2" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatName" position="162 72 162 18" name="MajorSkill3" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatName" position="162 90 162 18" name="MajorSkill4" align="Left Top"/>
<!-- Minor Skills -->
<Widget type="TextBox" skin="HeaderText" position="325 0 162 18" name="MinorSkillT" align="Left Top">
<Property key="Caption" value="#{sChooseClassMenu4}"/>
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="MWSkill" skin="MW_StatName" position="325 18 162 18" name="MinorSkill0" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatName" position="325 36 162 18" name="MinorSkill1" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatName" position="325 54 162 18" name="MinorSkill2" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatName" position="325 72 162 18" name="MinorSkill3" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatName" position="325 90 162 18" name="MinorSkill4" align="Left Top"/>
</Widget>
<!-- Dialog buttons -->
<Widget type="HBox" position="0 265 476 24">
<Widget type="HBox" position="0 276 462 24">
<Widget type="Widget">
<UserString key="HStretch" value="true"/>
</Widget>
@ -71,5 +76,6 @@
<Property key="Caption" value="#{sOK}"/>
</Widget>
</Widget>
</Widget>
</MyGUI>

@ -1,22 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 249 249" name="_Main">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 244 248" name="_Main">
<!-- Edit box -->
<Widget type="Widget" skin="MW_Box" position="8 8 220 192" align="Stretch" name="Client"/>
<Widget type="Widget" skin="MW_Box" position="14 14 220 192" align="Stretch" name="Client"/>
<Widget type="EditBox" skin="MW_TextBoxEdit" position="14 14 220 192" name="TextEdit" align="Left Top Stretch">
<Property key="MultiLine" value="1" />
<Property key="VisibleVScroll" value="1" />
<Property key="WordWrap" value="1" />
<Widget type="EditBox" skin="MW_TextBoxEdit" position="10 10 218 190" name="TextEdit" align="Left Top Stretch">
<Property key="MultiLine" value="true"/>
<Property key="VisibleVScroll" value="true"/>
<Property key="WordWrap" value="true"/>
</Widget>
<!-- Dialog buttons -->
<Widget type="AutoSizedButton" skin="MW_Button" position="177 214 57 24" name="OKButton">
<Widget type="AutoSizedButton" skin="MW_Button" position="171 208 57 24" name="OKButton">
<Property key="ExpandDirection" value="Left"/>
<Property key="Caption" value="Enter"/>
</Widget>
</Widget>
</MyGUI>

@ -1,14 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 474 192" name="_Main">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 450 198" name="_Main">
<!-- Class name -->
<Widget type="TextBox" skin="ProgressText" position="12 12 48 30" name="LabelT" align="Left Top">
<Property key="Caption" value="Name"/>
<Widget type="TextBox" skin="ProgressText" position="8 8 48 23" name="LabelT" align="Left Top">
<Property key="Caption" value="#{sName}"/>
<Property key="TextAlign" value="Left VCenter"/>
</Widget>
<Widget type="EditBox" skin="MW_TextEdit" position="62 12 250 30" name="EditName" align="HStretch Top"/>
<Widget type="EditBox" skin="MW_TextEdit" position="72 8 362 23" name="EditName" align="HStretch Top">
<Property key="Caption" value="#{sCustomClassName}"/>
</Widget>
<Widget type="Widget" skin="" position="12 46 480 110" align="Stretch">
<Widget type="Widget" skin="" position="8 38 480 110" align="Stretch">
<!-- Specialization -->
<Widget type="TextBox" skin="HeaderText" position="0 0 156 18" name="SpecializationT" align="Left Top">
@ -18,6 +21,7 @@
<UserString key="ToolTipLayout" value="TextToolTip"/>
<UserString key="Caption_Text" value="#{sCreateClassMenuHelp1}"/>
</Widget>
<Widget type="Button" skin="SandTextButton" position="0 18 156 18" name="SpecializationName" align="Left Top">
<Property key="TextAlign" value="Left Top"/>
</Widget>
@ -30,35 +34,38 @@
<UserString key="ToolTipLayout" value="TextToolTip"/>
<UserString key="Caption_Text" value="#{sCreateClassMenuHelp2}"/>
</Widget>
<Widget type="MWAttribute" skin="MW_StatNameButton" position="0 59 156 18" name="FavoriteAttribute0" align="Left Top" />
<Widget type="MWAttribute" skin="MW_StatNameButton" position="0 77 156 18" name="FavoriteAttribute1" align="Left Top" />
<Widget type="MWAttribute" skin="MW_StatNameButton" position="0 59 156 18" name="FavoriteAttribute0" align="Left Top"/>
<Widget type="MWAttribute" skin="MW_StatNameButton" position="0 77 156 18" name="FavoriteAttribute1" align="Left Top"/>
<!-- Major Skills -->
<Widget type="TextBox" skin="HeaderText" position="156 0 158 18" name="MajorSkillT" align="Left Top">
<Property key="Caption" value="Major Skills:"/>
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 18 158 18" name="MajorSkill0" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 36 158 18" name="MajorSkill1" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 54 158 18" name="MajorSkill2" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 72 158 18" name="MajorSkill3" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 90 158 18" name="MajorSkill4" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 18 158 18" name="MajorSkill0" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 36 158 18" name="MajorSkill1" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 54 158 18" name="MajorSkill2" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 72 158 18" name="MajorSkill3" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="156 90 158 18" name="MajorSkill4" align="Left Top"/>
<!-- Minor Skills -->
<Widget type="TextBox" skin="HeaderText" position="314 0 140 18" name="MinorSkillT" align="Left Top">
<Property key="Caption" value="Minor Skills:"/>
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 18 140 18" name="MinorSkill0" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 36 140 18" name="MinorSkill1" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 54 140 18" name="MinorSkill2" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 72 140 18" name="MinorSkill3" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 90 140 18" name="MinorSkill4" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 18 140 18" name="MinorSkill0" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 36 140 18" name="MinorSkill1" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 54 140 18" name="MinorSkill2" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 72 140 18" name="MinorSkill3" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="314 90 140 18" name="MinorSkill4" align="Left Top"/>
</Widget>
<!-- Dialog buttons -->
<Widget type="HBox" position="0 158 459 24">
<Widget type="HBox" position="0 158 434 24">
<Widget type="Widget">
<UserString key="HStretch" value="true"/>
</Widget>
@ -72,5 +79,6 @@
<Property key="Caption" value="#{sOK}"/>
</Widget>
</Widget>
</Widget>
</MyGUI>

@ -1,26 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 330 256" name="_Main">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 289 256" name="_Main">
<!-- Class image -->
<Widget type="Widget" skin="MW_Box" position="32 10 265 138" align="Left Top">
<Widget type="ImageBox" skin="ImageBox" position="2 2 261 134" name="ClassImage" align="Left Top" />
<Widget type="Widget" skin="MW_Box" position="8 8 265 138" align="Left Top">
<Widget type="ImageBox" skin="ImageBox" position="2 2 261 134" name="ClassImage" align="Left Top"/>
</Widget>
<!-- Class text -->
<Widget type="EditBox" skin="SandText" position="32 152 265 40" name="ReflectT" align="Left Top">
<Widget type="EditBox" skin="SandText" position="8 152 265 40" name="ReflectT" align="Left Top">
<Property key="TextAlign" value="Top HCenter"/>
<Property key="MultiLine" value="true"/>
<Property key="WordWrap" value="true"/>
<Property key="Static" value="true"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="32 192 265 23" name="ClassName" align="Left Top">
<Widget type="TextBox" skin="SandText" position="8 183 265 23" name="ClassName" align="Left Top">
<Property key="Caption" value="[Class]"/>
<Property key="TextAlign" value="Top HCenter"/>
</Widget>
<!-- Dialog buttons -->
<Widget type="HBox" position="0 219 319 24">
<Widget type="HBox" position="0 216 273 24">
<Widget type="Widget">
<UserString key="HStretch" value="true"/>
</Widget>

@ -9,7 +9,7 @@
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="Widget" skin="MW_Box" position="8 39 241 220">
<Widget type="ImageBox" skin="ImageBox" position_real="0 0 1 1" align="Stretch" name="PreviewImage"/>
<Widget type="ImageBox" skin="ImageBox" position="2 2 237 216" align="Stretch" name="PreviewImage"/>
</Widget>
<!-- Sliders -->
@ -22,7 +22,7 @@
<Widget type="Button" skin="MW_ArrowLeft" position="3 2 10 10" align="Left VStretch" name="PrevGenderButton"/>
</Widget>
<Widget type="TextBox" skin="HeaderText" position="25 294 205 18" name="GenderChoiceT" />
<Widget type="TextBox" skin="HeaderText" position="25 294 205 18" name="GenderChoiceT"/>
<Widget type="Widget" skin="MW_Box" position="234 298 15 14">
<Widget type="Button" skin="MW_ArrowRight" position="1 2 10 10" align="Right VStretch" name="NextGenderButton"/>
@ -34,7 +34,7 @@
<Widget type="Button" skin="MW_ArrowLeft" position="3 2 10 10" align="Left VStretch" name="PrevFaceButton"/>
</Widget>
<Widget type="TextBox" skin="HeaderText" position="25 316 205 18" name="FaceChoiceT" />
<Widget type="TextBox" skin="HeaderText" position="25 316 205 18" name="FaceChoiceT"/>
<Widget type="Widget" skin="MW_Box" position="234 320 15 14">
<Widget type="Button" skin="MW_ArrowRight" position="1 2 10 10" align="Right VStretch" name="NextFaceButton"/>
@ -46,7 +46,7 @@
<Widget type="Button" skin="MW_ArrowLeft" position="3 2 10 10" align="Left VStretch" name="PrevHairButton"/>
</Widget>
<Widget type="TextBox" skin="HeaderText" position="25 338 205 18" name="HairChoiceT" />
<Widget type="TextBox" skin="HeaderText" position="25 338 205 18" name="HairChoiceT"/>
<Widget type="Widget" skin="MW_Box" position="234 342 15 14">
<Widget type="Button" skin="MW_ArrowRight" position="1 2 10 10" align="Right VStretch" name="NextHairButton"/>
@ -65,17 +65,17 @@
<Property key="TextAlign" value="Left Top"/>
</Widget>
<!-- Spell power sub-widgets will be placed here, no skin to make it invisible -->
<Widget type="Widget" skin="" position="261 230 250 140" name="SpellPowerList" />
<Widget type="Widget" skin="" position="261 230 250 140" name="SpellPowerList"/>
<!-- Skill bonus -->
<Widget type="TextBox" skin="HeaderText" position="403 39 159 18" name="SkillsT" align="Left Top">
<Property key="TextAlign" value="Left Top"/>
</Widget>
<!-- Skill bonus sub-widgets will be placed here, no skin to make it invisible -->
<Widget type="Widget" skin="" position="403 59 159 360" name="SkillList" />
<Widget type="Widget" skin="" position="403 59 159 360" name="SkillList"/>
<!-- Dialog buttons -->
<Widget type="HBox" position="0 397 574 24">
<Widget type="HBox" position="0 393 572 24">
<Widget type="Widget">
<UserString key="HStretch" value="true"/>
</Widget>

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 520 409" name="_Main">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 520 428" name="_Main">
<!-- Player name, race, class and birth sign-->
<Widget type="Widget" skin="MW_Box" position="8 12 244 126">
<!-- Player Name, Race, Class and Birthsign -->
<Widget type="Widget" skin="MW_Box" position="8 8 244 126">
<Widget type="Button" skin="MW_Button" position="8 8 64 23" name="NameButton">
<Property key="Caption" value="#{sName}"/>
</Widget>
@ -17,27 +17,27 @@
<Widget type="Button" skin="MW_Button" position="8 95 54 23" name="SignButton">
<Property key="Caption" value="#{sBirthSign}"/>
</Widget>
<Widget type="TextBox" skin="SandTextRight" position="100 10 140 18" name="NameText"/>
<Widget type="TextBox" skin="SandTextRight" position="100 39 140 18" name="RaceText"/>
<Widget type="TextBox" skin="SandTextRight" position="100 68 140 18" name="ClassText"/>
<Widget type="TextBox" skin="SandTextRight" position="100 97 140 18" name="SignText"/>
<Widget type="TextBox" skin="SandTextRight" position="97 10 140 18" name="NameText"/>
<Widget type="TextBox" skin="SandTextRight" position="97 39 140 18" name="RaceText"/>
<Widget type="TextBox" skin="SandTextRight" position="97 68 140 18" name="ClassText"/>
<Widget type="TextBox" skin="SandTextRight" position="97 97 140 18" name="SignText"/>
</Widget>
<!-- Player health, magicka and fatigue -->
<Widget type="Widget" skin="MW_Box" position="8 144 244 64">
<Widget type="MWDynamicStat" skin="MW_DynamicStat_Red" position="4 4 236 18" name="Health">
<!-- Player Health, Magicka and Fatigue -->
<Widget type="Widget" skin="MW_Box" position="8 144 244 72">
<Widget type="MWDynamicStat" skin="MW_DynamicStat_Red" position="8 8 228 18" name="Health">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="HealthToolTip"/>
<UserString key="ImageTexture_HealthImage" value="icons\k\health.dds"/>
<Property key="Caption" value="#{sHealth}"/>
</Widget>
<Widget type="MWDynamicStat" skin="MW_DynamicStat_Blue" position="4 22 236 18" name="Magicka">
<Widget type="MWDynamicStat" skin="MW_DynamicStat_Blue" position="8 27 228 18" name="Magicka">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="HealthToolTip"/>
<UserString key="ImageTexture_HealthImage" value="icons\k\magicka.dds"/>
<Property key="Caption" value="#{sMagic}"/>
</Widget>
<Widget type="MWDynamicStat" skin="MW_DynamicStat_Green" position="4 40 236 18" name="Fatigue">
<Widget type="MWDynamicStat" skin="MW_DynamicStat_Green" position="8 46 228 18" name="Fatigue">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="HealthToolTip"/>
<UserString key="ImageTexture_HealthImage" value="icons\k\fatigue.dds"/>
@ -46,57 +46,57 @@
</Widget>
<!-- Player attributes -->
<Widget type="Widget" skin="MW_Box" position="8 214 244 154">
<Widget type="MWAttribute" skin="MW_StatNameValue" position="4 4 236 18" name="Attribute0">
<Widget type="Widget" skin="MW_Box" position="8 224 244 156">
<Widget type="MWAttribute" skin="MW_StatNameValue" position="8 4 229 18" name="Attribute0">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeStrength}"/>
<UserString key="Caption_AttributeDescription" value="#{sStrDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_strength.dds"/>
</Widget>
<Widget type="MWAttribute" skin="MW_StatNameValue" position="4 22 236 18" name="Attribute1">
<Widget type="MWAttribute" skin="MW_StatNameValue" position="8 22 229 18" name="Attribute1">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeIntelligence}"/>
<UserString key="Caption_AttributeDescription" value="#{sIntDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_int.dds"/>
</Widget>
<Widget type="MWAttribute" skin="MW_StatNameValue" position="4 40 236 18" name="Attribute2">
<Widget type="MWAttribute" skin="MW_StatNameValue" position="8 40 229 18" name="Attribute2">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeWillpower}"/>
<UserString key="Caption_AttributeDescription" value="#{sWilDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_wilpower.dds"/>
</Widget>
<Widget type="MWAttribute" skin="MW_StatNameValue" position="4 58 236 18" name="Attribute3">
<Widget type="MWAttribute" skin="MW_StatNameValue" position="8 58 229 18" name="Attribute3">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeAgility}"/>
<UserString key="Caption_AttributeDescription" value="#{sAgiDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_agility.dds"/>
</Widget>
<Widget type="MWAttribute" skin="MW_StatNameValue" position="4 76 236 18" name="Attribute4">
<Widget type="MWAttribute" skin="MW_StatNameValue" position="8 76 229 18" name="Attribute4">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeSpeed}"/>
<UserString key="Caption_AttributeDescription" value="#{sSpdDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_speed.dds"/>
</Widget>
<Widget type="MWAttribute" skin="MW_StatNameValue" position="4 94 236 18" name="Attribute5">
<Widget type="MWAttribute" skin="MW_StatNameValue" position="8 94 229 18" name="Attribute5">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeEndurance}"/>
<UserString key="Caption_AttributeDescription" value="#{sEndDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_endurance.dds"/>
</Widget>
<Widget type="MWAttribute" skin="MW_StatNameValue" position="4 112 236 18" name="Attribute6">
<Widget type="MWAttribute" skin="MW_StatNameValue" position="8 112 229 18" name="Attribute6">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributePersonality}"/>
<UserString key="Caption_AttributeDescription" value="#{sPerDesc}"/>
<UserString key="ImageTexture_AttributeImage" value="icons\k\attribute_personality.dds"/>
</Widget>
<Widget type="MWAttribute" skin="MW_StatNameValue" position="4 130 236 18" name="Attribute7">
<Widget type="MWAttribute" skin="MW_StatNameValue" position="8 130 229 18" name="Attribute7">
<UserString key="ToolTipType" value="Layout"/>
<UserString key="ToolTipLayout" value="AttributeToolTip"/>
<UserString key="Caption_AttributeName" value="#{sAttributeLuck}"/>
@ -105,13 +105,13 @@
</Widget>
</Widget>
<!-- Player skills, factions, birthsign and reputation -->
<Widget type="Widget" skin="MW_Box" position="258 12 244 356" align="Left VStretch" name="Skills">
<Widget type="ScrollView" skin="MW_ScrollView" position="4 4 236 346" align="Stretch" name="SkillView" />
<!-- Player Skills -->
<Widget type="Widget" skin="MW_Box" position="260 7 244 372" align="Left VStretch" name="Skills">
<Widget type="ScrollView" skin="MW_ScrollView" position="8 6 232 362" align="Stretch" name="SkillView"/>
</Widget>
<!-- Dialog buttons -->
<Widget type="HBox" position="0 372 502 24">
<!-- Dialogue Buttons -->
<Widget type="HBox" position="0 388 504 24">
<Widget type="Widget">
<UserString key="HStretch" value="true"/>
</Widget>

@ -10,14 +10,14 @@
</Widget>
<!-- Attribute list -->
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 28 186 18" name="Attribute0" align="Left Top" />
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 46 186 18" name="Attribute1" align="Left Top" />
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 64 186 18" name="Attribute2" align="Left Top" />
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 82 186 18" name="Attribute3" align="Left Top" />
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 100 186 18" name="Attribute4" align="Left Top" />
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 118 186 18" name="Attribute5" align="Left Top" />
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 136 186 18" name="Attribute6" align="Left Top" />
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 154 186 18" name="Attribute7" align="Left Top" />
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 28 186 18" name="Attribute0" align="Left Top"/>
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 46 186 18" name="Attribute1" align="Left Top"/>
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 64 186 18" name="Attribute2" align="Left Top"/>
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 82 186 18" name="Attribute3" align="Left Top"/>
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 100 186 18" name="Attribute4" align="Left Top"/>
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 118 186 18" name="Attribute5" align="Left Top"/>
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 136 186 18" name="Attribute6" align="Left Top"/>
<Widget type="MWAttribute" skin="MW_StatNameButtonC" position="0 154 186 18" name="Attribute7" align="Left Top"/>
<!-- Dialog buttons -->
<Widget type="AutoSizedButton" skin="MW_Button" position="120 180 66 21" name="CancelButton">

@ -14,45 +14,45 @@
<Property key="Caption" value="Combat"/>
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 50 154 18" name="CombatSkill0" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 68 154 18" name="CombatSkill1" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 86 154 18" name="CombatSkill2" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 104 154 18" name="CombatSkill3" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 122 154 18" name="CombatSkill4" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 140 154 18" name="CombatSkill5" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 158 154 18" name="CombatSkill6" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 176 154 18" name="CombatSkill7" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 194 154 18" name="CombatSkill8" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 50 154 18" name="CombatSkill0" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 68 154 18" name="CombatSkill1" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 86 154 18" name="CombatSkill2" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 104 154 18" name="CombatSkill3" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 122 154 18" name="CombatSkill4" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 140 154 18" name="CombatSkill5" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 158 154 18" name="CombatSkill6" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 176 154 18" name="CombatSkill7" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 194 154 18" name="CombatSkill8" align="Left Top"/>
<!-- Magic list -->
<Widget type="TextBox" skin="HeaderText" position="158 32 154 18" name="MagicLabelT" align="Left Top">
<Property key="Caption" value="Magic"/>
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 50 154 18" name="MagicSkill0" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 68 154 18" name="MagicSkill1" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 86 154 18" name="MagicSkill2" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 104 154 18" name="MagicSkill3" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 122 154 18" name="MagicSkill4" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 140 154 18" name="MagicSkill5" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 158 154 18" name="MagicSkill6" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 176 154 18" name="MagicSkill7" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 194 154 18" name="MagicSkill8" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 50 154 18" name="MagicSkill0" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 68 154 18" name="MagicSkill1" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 86 154 18" name="MagicSkill2" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 104 154 18" name="MagicSkill3" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 122 154 18" name="MagicSkill4" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 140 154 18" name="MagicSkill5" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 158 154 18" name="MagicSkill6" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 176 154 18" name="MagicSkill7" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 194 154 18" name="MagicSkill8" align="Left Top"/>
<!-- Stealth list -->
<Widget type="TextBox" skin="HeaderText" position="316 32 131 18" name="StealthLabelT" align="Left Top">
<Property key="Caption" value="Stealth"/>
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 50 131 18" name="StealthSkill0" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 68 131 18" name="StealthSkill1" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 86 131 18" name="StealthSkill2" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 104 131 18" name="StealthSkill3" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 122 131 18" name="StealthSkill4" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 140 131 18" name="StealthSkill5" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 158 131 18" name="StealthSkill6" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 176 131 18" name="StealthSkill7" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 194 131 18" name="StealthSkill8" align="Left Top" />
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 50 131 18" name="StealthSkill0" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 68 131 18" name="StealthSkill1" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 86 131 18" name="StealthSkill2" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 104 131 18" name="StealthSkill3" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 122 131 18" name="StealthSkill4" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 140 131 18" name="StealthSkill5" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 158 131 18" name="StealthSkill6" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 176 131 18" name="StealthSkill7" align="Left Top"/>
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 194 131 18" name="StealthSkill8" align="Left Top"/>
<!-- Dialog buttons -->
<Widget type="AutoSizedButton" skin="MW_Button" position="381 218 66 21" name="CancelButton">

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 300 125" name="_Main">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 300 130" name="_Main">
<Property key="Visible" value="false"/>
<Widget type="EditBox" skin="MW_TextEditClient" position="8 8 284 400" name="Message" align="Left Top Stretch">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Top HCenter" />
<Property key="TextColour" value="0.75 0.6 0.35" />
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Top HCenter"/>
<Property key="TextColour" value="0.75 0.6 0.35"/>
<Property key="Static" value="true"/>
<Property key="WordWrap" value="true"/>
<Property key="MultiLine" value="true" />
<Property key="MultiLine" value="true"/>
</Widget>
<Widget type="HBox" position="0 84 272 24" align="Right Bottom">
<Widget type="HBox" position="0 89 272 24" align="Right Bottom">
<Widget type="Widget">
<UserString key="HStretch" value="true"/>
</Widget>

@ -2,7 +2,7 @@
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Window" position="0 0 400 400" layer="Console" name="_Main">
<Property key="Caption" value="#{sConsoleTitle}"/>
<Property key="MinSize" value="405 245"/>
<Property key="MinSize" value="400 245"/>
<Property key="MaxSize" value="2000 2000"/>
<Property key="Visible" value="false"/>
@ -12,7 +12,7 @@
</Widget>
<!-- Command line -->
<Widget type="EditBox" skin="MW_ConsoleCommand" position="2 335 380 28" align="HStretch Bottom" name="edit_Command"/>
<Widget type="EditBox" skin="MW_ConsoleCommand" position="0 338 384 28" align="HStretch Bottom" name="edit_Command"/>
</Widget>
</MyGUI>

@ -1,30 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin">
<Skin name="MW_LogClient" size="10 10">
<Property key="FontName" value="MonoFont" />
<Property key="TextAlign" value="Left Top" />
<Property key="TextColour" value="1 1 1" />
<BasisSkin type="EditText" offset="0 0 10 10" align="Stretch"/>
</Skin>
<!-- The edit control used for entering commands -->
<Skin name="MW_ConsoleCommand" size="29 28">
<Child type="TextBox" skin="MW_EditClient" offset="2 1 23 22" align="Bottom Stretch" name="Client"/>
<!-- Console Output -->
<Child type="Widget" skin="MW_Box" offset="0 0 29 26" align="Bottom Stretch"/>
<Skin name="MW_LogClient" size="10 10">
<Property key="FontName" value="MonoFont"/>
<Property key="TextAlign" value="Left Top"/>
<Property key="TextColour" value="1 1 1"/>
<BasisSkin type="EditText" offset="0 0 10 10" align="Stretch"/>
</Skin>
<Skin name="MW_ConsoleLog" size="0 0 50 50">
<Property key="WordWrap" value="true" />
<Property key="WordWrap" value="true"/>
<Child type="TextBox" skin="MW_LogClient" offset="0 0 35 10" align="Stretch" name="Client"/>
</Skin>
<!-- Console Input -->
<Skin name="MW_EditClient" size="10 10">
<Property key="FontName" value="MonoFont" />
<Property key="TextAlign" value="Left VCenter" />
<Property key="TextColour" value="1 1 1" />
<!--Property key="Pointer" value="beam" /-->
<Property key="FontName" value="MonoFont"/>
<Property key="TextAlign" value="Left VCenter"/>
<Property key="TextColour" value="1 1 1"/>
<BasisSkin type="EditText" offset="0 0 10 10" align="Stretch"/>
</Skin>
<Skin name="MW_ConsoleCommand" size="29 28">
<Child type="TextBox" skin="MW_EditClient" offset="4 2 19 22" align="Bottom Stretch" name="Client"/>
<Child type="Widget" skin="MW_Box" offset="0 0 29 26" align="Bottom Stretch"/>
</Skin>
</MyGUI>

@ -15,11 +15,11 @@
<Property key="Visible" value="false"/>
</Widget>
<!-- The disposition bar-->
<!-- The disposition bar-->
<Widget type="ProgressBar" skin="MW_EnergyBar_Blue" position="432 8 132 18"
align="Right Top" name="Disposition">
<Widget type="EditBox" skin="MW_DispositionEdit" position_real="0 0 1 1" align="Stretch" name="DispositionText"/>
</Widget>
<Widget type="EditBox" skin="MW_DispositionEdit" position_real="0 0 1 1" align="Stretch" name="DispositionText"/>
</Widget>
<!-- The list of topics -->
<Widget type="MWList" skin="MW_SimpleList" position="432 31 132 328" name="TopicsList" align="Right VStretch">
</Widget>

@ -8,11 +8,11 @@
</Skin>
<Skin name="MW_DispositionEdit" size="0 0 50 50">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Center" />
<Property key="Colour" value="0000FF" />
<Property key="Static" value="1" />
<Property key="WordWrap" value="true" />
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
<Property key="Colour" value="0000FF"/>
<Property key="Static" value="1"/>
<Property key="WordWrap" value="true"/>
<Child type="TextBox" skin="MW_DispEdit" offset="0 0 0 -4" align="Stretch" name="Client"/>
</Skin>

@ -21,12 +21,10 @@
<!-- Input -->
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left VCenter"/>
<Property key="TextColour" value="0.75 0.6 0.35"/>
<Property key="TextAlign" value="Left VCenter" />
<Property key="TextColour" value="0.75 0.6 0.35" />
<Child type="TextBox" skin="MW_TextEditClient" offset="2 2 508 18" align="Stretch" name="Client"/>
<Child type="TextBox" skin="MW_TextEditClient" offset="4 1 502 18" align="Stretch" name="Client"/>
<!-- Borders -->
@ -39,9 +37,9 @@
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Top" />
<Property key="TextAlign" value="Left Top"/>
<Property key="TextColour" value="0.75 0.6 0.35" />
<Property key="TextColour" value="0.75 0.6 0.35"/>
<Child type="TextBox" skin="MW_TextBoxEditClient" offset="2 2 490 18" align="Stretch" name="Client"/>

@ -43,32 +43,32 @@
<!-- Main energy bar widget definitions. There's one for each color.-->
<Skin name="MW_EnergyBar_Red" size="64 12">
<Property key="TrackSkin" value="MW_BarTrack_Red" />
<Property key="TrackWidth" value="1" />
<Property key="TrackSkin" value="MW_BarTrack_Red"/>
<Property key="TrackWidth" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 8" align="Stretch" name="Client"/>
</Skin>
<Skin name="MW_EnergyBar_Green" size="64 12">
<Property key="TrackSkin" value="MW_BarTrack_Green" />
<Property key="TrackWidth" value="1" />
<Property key="TrackSkin" value="MW_BarTrack_Green"/>
<Property key="TrackWidth" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 8" align="Stretch" name="Client"/>
</Skin>
<Skin name="MW_EnergyBar_Blue" size="64 12">
<Property key="TrackSkin" value="MW_BarTrack_Blue" />
<Property key="TrackWidth" value="1" />
<Property key="TrackSkin" value="MW_BarTrack_Blue"/>
<Property key="TrackWidth" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 8" align="Stretch" name="Client"/>
</Skin>
<Skin name="MW_EnergyBar_Yellow" size="64 12">
<Property key="TrackSkin" value="MW_BarTrack_Yellow" />
<Property key="TrackWidth" value="1" />
<Property key="TrackSkin" value="MW_BarTrack_Yellow"/>
<Property key="TrackWidth" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 8" align="Stretch" name="Client"/>

@ -3,16 +3,16 @@
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 500 400" name="_Main">
<Widget type="EditBox" skin="MW_TextEditClient" position="10 10 490 20" align="Left Top Stretch" name="message">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Center" />
<Property key="TextColour" value="0.75 0.6 0.35" />
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
<Property key="TextColour" value="0.75 0.6 0.35"/>
<Property key="Static" value="true"/>
<Property key="WordWrap" value="true"/>
<Property key="MultiLine" value="1" />
<Property key="VisibleVScroll" value="1" />
<Property key="MultiLine" value="1"/>
<Property key="VisibleVScroll" value="1"/>
</Widget>
<Widget type="Widget" skin="" position="0 0 500 400" align="Stretch" name="buttons">
<!-- Widget type="Button" skin="MW_Button" position="0 0 30 18" name="somefunnybutton"/ -->
<!-- Widget type="Button" skin="MW_Button" position="0 0 30 18" name="somefunnybutton" / -->
</Widget>
</Widget>
</MyGUI>

@ -2,9 +2,9 @@
<MyGUI type="Skin">
<Skin name="MW_BookClient" size="10 10">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Left Top" />
<Property key="TextColour" value="0 0 0" />
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Top"/>
<Property key="TextColour" value="0 0 0"/>
<!--Property key="Pointer" value="beam" /-->
<BasisSkin type="EditText" offset="0 0 10 10" align="Stretch"/>
</Skin>

@ -5,8 +5,8 @@
<!-- Horizontal Scrollbar -->
<Skin name="MW_HScroll" size="90 14">
<Property key="TrackRangeMargins" value="14 14" />
<Property key="MinTrackSize" value="14" />
<Property key="TrackRangeMargins" value="14 14"/>
<Property key="MinTrackSize" value="14"/>
<Property key="VerticalAlignment" value="false"/>
<Property key="MoveToClick" value="true"/>
@ -43,8 +43,8 @@
<!-- Vertical Scrollbar -->
<Skin name="MW_VScroll" size="14 90">
<Property key="TrackRangeMargins" value="14 14" />
<Property key="MinTrackSize" value="14" />
<Property key="TrackRangeMargins" value="14 14"/>
<Property key="MinTrackSize" value="14"/>
<Property key="MoveToClick" value="true"/>
<!-- Background widget trick that must go first to be placed behind Track and FirstPart/SecondPart widgets, provides the bar texture -->
@ -89,17 +89,17 @@
<Skin name="HeaderText" size="16 16">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center" />
<Property key="TextColour" value="0.82 0.74 0.58" />
<Property key="TextAlign" value="Center"/>
<Property key="TextColour" value="0.82 0.74 0.58"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
<!-- list and multilist skins -->
<Skin name="MW_ListLine" size="5 5">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Left VCenter" />
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left VCenter"/>
<BasisSkin type="SimpleText" offset="2 0 1 5" align="Stretch">
<State name="disabled" colour="0.70 0.57 0.33" shift="0"/>
@ -114,9 +114,9 @@
</Skin>
<Skin name="MW_List" size="516 516" align="Left Top">
<Property key="NeedKey" value="true" />
<Property key="SkinLine" value="MW_ListLine" />
<Property key="HeightLine" value="20" />
<Property key="NeedKey" value="true"/>
<Property key="SkinLine" value="MW_ListLine"/>
<Property key="HeightLine" value="20"/>
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="Stretch"/>
@ -144,9 +144,9 @@
</Skin>
<Skin name="MW_MultiSubList" size="516 516" align="Left Top">
<Property key="NeedKey" value="true" />
<Property key="SkinLine" value="MW_ListLine" />
<Property key="HeightLine" value="20" />
<Property key="NeedKey" value="true"/>
<Property key="SkinLine" value="MW_ListLine"/>
<Property key="HeightLine" value="20"/>
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="Stretch"/>
@ -157,12 +157,12 @@
</Skin>
<Skin name="MW_MultiList" size="516 516" align="Left Top">
<Property key="NeedKey" value="true" />
<Property key="SkinButton" value="ButtonSmall" />
<Property key="_SkinButtonEmpty" value="EditBox" />
<Property key="HeightButton" value="20" />
<Property key="NeedKey" value="true"/>
<Property key="SkinButton" value="ButtonSmall"/>
<Property key="_SkinButtonEmpty" value="EditBox"/>
<Property key="HeightButton" value="20"/>
<Property key="SkinList" value="MW_MultiSubList" />
<Property key="SkinList" value="MW_MultiSubList"/>
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="Stretch"/>
@ -171,7 +171,7 @@
<!-- Horizontal line -->
<Skin name="MW_HLine" size="512 10" texture="textures\menu_thin_border_top.dds">
<Skin name="MW_HLine" size="512 10" texture="textures\menu_thin_border_top.dds">
<BasisSkin type="SubSkin" offset="0 0 512 2" align="Bottom HStretch">
<State name="normal" offset="0 0 512 2"/>
</BasisSkin>

@ -12,8 +12,7 @@
<Property key="TextAlign" value="Center"/>
</Widget>
<Widget type="ProgressBar" skin="MW_Progress_Loading" position="20 36 260 8" name="ProgressBar">
<Property key="Range" value="1000"/>
<Widget type="ScrollBar" skin="MW_ProgressScroll_Loading" position="20 36 260 8" name="ProgressBar">
</Widget>
</Widget>

@ -2,17 +2,17 @@
<MyGUI type="Layout">
<!--Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 0 0" name="_Main">
<Widget type="TextBox" skin="TextBox" position="4 4 4 4" name="message" />
<Widget type="TextBox" skin="TextBox" position="4 4 4 4" name="message"/>
</Widget-->
<Widget type="Window" skin="MW_Dialog" layer="Notification" position="0 0 0 0" name="_Main">
<Widget type="EditBox" skin="MW_TextEditClient" position="5 -5 0 0" name="message" align="Left Top Stretch">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Center" />
<Property key="TextColour" value="0.75 0.6 0.35" />
<Widget type="EditBox" skin="MW_TextEditClient" position="5 -5 0 0" name="message" align="Left Top Stretch">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
<Property key="TextColour" value="0.75 0.6 0.35"/>
<Property key="Static" value="true"/>
<Property key="WordWrap" value="true"/>
<Property key="MultiLine" value="1" />
<Property key="VisibleVScroll" value="1" />
<Property key="MultiLine" value="1"/>
<Property key="VisibleVScroll" value="1"/>
</Widget>
</Widget>
</MyGUI>

@ -1,39 +1,39 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Resource">
<Resource type="ResourceImageSetPointer" name="arrow">
<Property key="Point" value="7 0"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="ArrowPointerImage"/>
<Property key="Rotation" value="0"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="hresize">
<Property key="Point" value="16 14"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="HResizePointerImage"/>
<Property key="Rotation" value="0"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="vresize">
<Property key="Point" value="17 16"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="HResizePointerImage"/>
<Property key="Rotation" value="90"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="dresize">
<Property key="Point" value="17 15"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="HResizePointerImage"/>
<Property key="Rotation" value="45"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="dresize2">
<Property key="Point" value="15 15"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="HResizePointerImage"/>
<Property key="Rotation" value="-45"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="drop_ground">
<Property key="Point" value="0 24"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="DropGroundPointerImage"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="arrow">
<Property key="Point" value="7 0"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="ArrowPointerImage"/>
<Property key="Rotation" value="0"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="hresize">
<Property key="Point" value="16 14"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="HResizePointerImage"/>
<Property key="Rotation" value="0"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="vresize">
<Property key="Point" value="17 16"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="HResizePointerImage"/>
<Property key="Rotation" value="90"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="dresize">
<Property key="Point" value="17 15"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="HResizePointerImage"/>
<Property key="Rotation" value="45"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="dresize2">
<Property key="Point" value="15 15"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="HResizePointerImage"/>
<Property key="Rotation" value="-45"/>
</Resource>
<Resource type="ResourceImageSetPointer" name="drop_ground">
<Property key="Point" value="0 24"/>
<Property key="Size" value="32 32"/>
<Property key="Resource" value="DropGroundPointerImage"/>
</Resource>
</MyGUI>

@ -17,7 +17,7 @@
<State name="normal" offset="0 28 2 14"/>
</BasisSkin>
</Skin>
<Skin name="MW_BigTrack_Progress_Blue_Small" size="2 6" texture="smallbars.png" >
<Skin name="MW_BigTrack_Progress_Blue_Small" size="2 6" texture="smallbars.png" >
<BasisSkin type="MainSkin" offset="0 0 2 6" align="Stretch">
<State name="normal" offset="0 26 2 6"/>
</BasisSkin>
@ -25,43 +25,56 @@
<Skin name="ProgressText" size="16 16">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center" />
<Property key="TextColour" value="0.75 0.6 0.35" />
<Property key="TextAlign" value="Center"/>
<Property key="TextColour" value="0.75 0.6 0.35"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
<!-- Main energy bar widget definitions. There's one for each color.-->
<Skin name="MW_Progress_Red" size="64 12">
<Property key="TrackSkin" value="MW_BigTrack_Red" />
<Property key="TrackWidth" value="1" />
<Property key="TrackSkin" value="MW_BigTrack_Red"/>
<Property key="TrackWidth" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 8" align="Stretch" name="Client"/>
</Skin>
<Skin name="MW_Progress_Green" size="64 12">
<Property key="TrackSkin" value="MW_BigTrack_Green" />
<Property key="TrackWidth" value="1" />
<Property key="TrackSkin" value="MW_BigTrack_Green"/>
<Property key="TrackWidth" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 8" align="Stretch" name="Client"/>
</Skin>
<Skin name="MW_Progress_Blue" size="64 12">
<Property key="TrackSkin" value="MW_BigTrack_Blue" />
<Property key="TrackWidth" value="1" />
<Property key="TrackSkin" value="MW_BigTrack_Blue"/>
<Property key="TrackWidth" value="1"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 12" align="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 8" align="Stretch" name="Client"/>
</Skin>
<Skin name="MW_Progress_Loading" size="64 6">
<Property key="TrackSkin" value="MW_BigTrack_Progress_Blue_Small" />
<Property key="TrackWidth" value="1" />
<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="Stretch"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 2" align="Stretch" name="Client"/>
</Skin>
<Skin name="MW_ProgressScroll_Loading" size="64 6">
<Property key="TrackWidth" value="1"/>
<Property key="TrackRangeMargins" value="0 0"/>
<Property key="MinTrackSize" value="1"/>
<Property key="VerticalAlignment" value="false"/>
<Property key="MoveToClick" value="false"/>
<Child type="Widget" skin="BlackBG" offset="2 2 60 2" align="Stretch" name="Client"/>
<Child type="Button" skin="MW_BigTrack_Progress_Blue_Small" offset="0 0 1 6" align="Left VStretch" name="Track"/>
<Child type="Widget" skin="MW_Box" offset="0 0 64 6" align="Stretch"/>
</Skin>
</MyGUI>

@ -219,7 +219,7 @@
<!-- Player skills, factions, birthsign and reputation -->
<Widget type="Widget" skin="MW_Box" position="8 8 248 292" align="Left Stretch" name="Skills">
<Widget type="ScrollView" skin="MW_ScrollView" position="4 4 240 284" align="Left Top Stretch" name="SkillView" />
<Widget type="ScrollView" skin="MW_ScrollView" position="4 4 240 284" align="Left Top Stretch" name="SkillView"/>
</Widget>
</Widget>

@ -4,46 +4,46 @@
<!-- HTML colour: #DDC79E -->
<Skin name="NormalText" size="16 16">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Left Bottom" />
<Property key="TextColour" value="0.87 0.78 0.62" />
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Bottom"/>
<Property key="TextColour" value="0.87 0.78 0.62"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
<Skin name="NumFPS" size="16 16">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="HCenter Bottom" />
<Property key="TextColour" value="1 1 1" />
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="HCenter Bottom"/>
<Property key="TextColour" value="1 1 1"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
<!-- HTML colour: #9A9074 -->
<Skin name="SandTextGreyedOut" size="16 16">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Left Bottom" />
<Property key="TextColour" value="0.6 0.56 0.45" />
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Bottom"/>
<Property key="TextColour" value="0.6 0.56 0.45"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
<!-- HTML colour: #BF9959 -->
<Skin name="SandText" size="16 16">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Left Bottom" />
<Property key="TextColour" value="0.75 0.6 0.35" />
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Bottom"/>
<Property key="TextColour" value="0.75 0.6 0.35"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
<Skin name="SandTextC" size="16 16">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Top HCenter" />
<Property key="TextColour" value="0.75 0.6 0.35" />
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Top HCenter"/>
<Property key="TextColour" value="0.75 0.6 0.35"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
<Skin name="SandTextRight" size="16 16">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Right Bottom" />
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Right Bottom"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<State name="normal" colour="0.75 0.6 0.35"/>
<State name="increased" colour="0.757 0.679 0.539"/>
<State name="decreased" colour="0.785 0.363 0.308"/>
@ -51,36 +51,36 @@
</Skin>
<Skin name="SandBrightText" size="16 16">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Left Bottom" />
<Property key="TextColour" value="0.85 0.76 0.60" />
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Bottom"/>
<Property key="TextColour" value="0.85 0.76 0.60"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
<Skin name="DaedricText" size="16 16">
<Property key="FontName" value="daedric36" />
<Property key="FontHeight" value="36" />
<Property key="TextAlign" value="Default" />
<Property key="TextColour" value="1 1 1" />
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
<Property key="FontName" value="daedric36"/>
<Property key="FontHeight" value="36"/>
<Property key="TextAlign" value="Default"/>
<Property key="TextColour" value="1 1 1"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
<Skin name="DaedricText_orig" size="16 16">
<Property key="FontName" value="daedric_orig36" />
<Property key="FontHeight" value="36" />
<Property key="TextAlign" value="Default" />
<Property key="TextColour" value="1 1 1" />
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
<Property key="FontName" value="daedric_orig36"/>
<Property key="FontHeight" value="36"/>
<Property key="TextAlign" value="Default"/>
<Property key="TextColour" value="1 1 1"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
<Skin name="MW_StatNameC" size="200 18">
<Child type="TextBoxC" skin="SandText" offset="0 0 200 18" align="Left HStretch" name="StatName" />
<Child type="TextBoxC" skin="SandText" offset="0 0 200 18" align="Left HStretch" name="StatName"/>
</Skin>
<Skin name="SandTextButtonC" size="16 16">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Top HCenter" />
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Top HCenter"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<State name="disabled" colour="0.6 0.56 0.45" shift="0"/>
<State name="normal" colour="0.75 0.6 0.35" shift="0"/>
<State name="highlighted" colour="0.85 0.76 0.60" shift="0"/>
@ -93,9 +93,9 @@
</Skin>
<Skin name="SandTextButton" size="16 16">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Left Bottom" />
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Bottom"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<State name="disabled" colour="0.6 0.56 0.45" shift="0"/>
<State name="normal" colour="0.75 0.6 0.35" shift="0"/>
<State name="highlighted" colour="0.85 0.76 0.60" shift="0"/>
@ -108,9 +108,9 @@
</Skin>
<Skin name="SpellText" size="16 16">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Left Bottom" />
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Bottom"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<State name="disabled" colour="0.6 0.56 0.45" shift="0"/>
<State name="normal" colour="0.75 0.6 0.35" shift="0"/>
<State name="highlighted" colour="0.85 0.76 0.60" shift="0"/>
@ -123,9 +123,9 @@
</Skin>
<Skin name="SpellTextUnequipped" size="16 16">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Left Bottom" />
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Bottom"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<State name="disabled" colour="0.6 0.56 0.45" shift="0"/>
<State name="normal" colour="0.6 0.56 0.45" shift="0"/>
<State name="highlighted" colour="0.85 0.76 0.60" shift="0"/>
@ -138,46 +138,46 @@
</Skin>
<Skin name="MW_StatNameButtonC" size="200 18">
<Child type="Button" skin="SandTextButtonC" offset="0 0 200 18" align="Left HStretch" name="StatNameButton" />
<Child type="Button" skin="SandTextButtonC" offset="0 0 200 18" align="Left HStretch" name="StatNameButton"/>
</Skin>
<Skin name="MW_StatNameValueButton" size="200 18">
<Child type="Button" skin="SandText" offset="0 0 160 18" align="Left HStretch" name="StatNameButton" />
<Child type="Button" skin="SandTextRight" offset="160 0 40 18" align="Right Top" name="StatValueButton" />
<Child type="Button" skin="SandText" offset="0 0 160 18" align="Left HStretch" name="StatNameButton"/>
<Child type="Button" skin="SandTextRight" offset="160 0 40 18" align="Right Top" name="StatValueButton"/>
</Skin>
<Skin name="MW_EffectImage" size="200 24">
<Child type="ImageBox" skin="ImageBox" offset="4 4 16 16" align="Left Top" name="Image" />
<Child type="TextBox" skin="SandText" offset="24 0 176 20" align="VCenter HStretch" name="Text" />
<Child type="ImageBox" skin="ImageBox" offset="4 4 16 16" align="Left Top" name="Image"/>
<Child type="TextBox" skin="SandText" offset="24 0 176 20" align="VCenter HStretch" name="Text"/>
</Skin>
<Skin name="MW_ChargeBar" size="204 18">
<Child type="ProgressBar" skin="MW_Progress_Red" offset="0 0 204 18" align="Right Top Stretch" name="Bar" />
<Child type="TextBox" skin="SandTextC" offset="0 0 204 18" align="Right Top Stretch" name="BarText" />
<Child type="ProgressBar" skin="MW_Progress_Red" offset="0 0 204 18" align="Right Top Stretch" name="Bar"/>
<Child type="TextBox" skin="SandTextC" offset="0 0 204 18" align="Right Top Stretch" name="BarText"/>
</Skin>
<Skin name="MW_ChargeBar_Blue" size="204 18">
<Child type="ProgressBar" skin="MW_Progress_Blue" offset="0 0 204 18" align="Right Top Stretch" name="Bar" />
<Child type="TextBox" skin="SandTextC" offset="0 0 204 18" align="Right Top Stretch" name="BarText" />
<Child type="ProgressBar" skin="MW_Progress_Blue" offset="0 0 204 18" align="Right Top Stretch" name="Bar"/>
<Child type="TextBox" skin="SandTextC" offset="0 0 204 18" align="Right Top Stretch" name="BarText"/>
</Skin>
<Skin name="MW_DynamicStat_Red" size="204 18">
<Child type="TextBox" skin="SandText" offset="0 0 100 18" align="Left Top" name="Text" />
<Child type="ProgressBar" skin="MW_Progress_Red" offset="74 0 130 18" align="Right Top" name="Bar" />
<Child type="TextBox" skin="SandTextC" offset="74 0 130 18" align="Right Top" name="BarText" />
<Child type="TextBox" skin="SandText" offset="0 0 100 18" align="Left Top" name="Text"/>
<Child type="ProgressBar" skin="MW_Progress_Red" offset="74 0 130 18" align="Right Top" name="Bar"/>
<Child type="TextBox" skin="SandTextC" offset="74 0 130 18" align="Right Top" name="BarText"/>
</Skin>
<Skin name="MW_DynamicStat_Blue" size="204 18">
<Child type="TextBox" skin="SandText" offset="0 0 100 18" align="Left Top" name="Text" />
<Child type="ProgressBar" skin="MW_Progress_Blue" offset="74 0 130 18" align="Right Top" name="Bar" />
<Child type="TextBox" skin="SandTextC" offset="74 0 130 18" align="Right Top" name="BarText" />
<Child type="TextBox" skin="SandText" offset="0 0 100 18" align="Left Top" name="Text"/>
<Child type="ProgressBar" skin="MW_Progress_Blue" offset="74 0 130 18" align="Right Top" name="Bar"/>
<Child type="TextBox" skin="SandTextC" offset="74 0 130 18" align="Right Top" name="BarText"/>
</Skin>
<Skin name="MW_DynamicStat_Green" size="204 18">
<Child type="TextBox" skin="SandText" offset="0 0 100 18" align="Left Top" name="Text" />
<Child type="ProgressBar" skin="MW_Progress_Green" offset="74 0 130 18" align="Right Top" name="Bar" />
<Child type="TextBox" skin="SandTextC" offset="74 0 130 18" align="Right Top" name="BarText" />
<Child type="TextBox" skin="SandText" offset="0 0 100 18" align="Left Top" name="Text"/>
<Child type="ProgressBar" skin="MW_Progress_Green" offset="74 0 130 18" align="Right Top" name="Bar"/>
<Child type="TextBox" skin="SandTextC" offset="74 0 130 18" align="Right Top" name="BarText"/>
</Skin>
</MyGUI>

@ -200,7 +200,7 @@
<!-- Birthsign image -->
<Widget type="Widget" skin="MW_Box" position="18 13 263 137" align="Top HCenter">
<Widget type="ImageBox" skin="ImageBox" position="2 2 259 133" name="BirthSignImage" align="Left Top" />
<Widget type="ImageBox" skin="ImageBox" position="2 2 259 133" name="BirthSignImage" align="Left Top"/>
</Widget>
<Widget type="AutoSizedTextBox" skin="NormalText" position="8 154 284 138" align="Top" name="BirthSignText">

@ -97,26 +97,26 @@
<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="Stretch"/>
<Child type="Widget" skin="PU_B" offset="2 17 15 2" align="Stretch"/>
<Child type="Widget" skin="PU_BR" offset="17 17 2 2" align="Stretch"/>
<Child type="Widget" skin="PU_R" offset="17 2 2 15" align="Stretch"/>
<Child type="Widget" skin="PU_R" offset="17 2 2 15" align="Stretch"/>
<Child type="Widget" skin="PU_TR" offset="17 0 2 2" align="Stretch"/>
<Child type="Widget" skin="PU_T" offset="2 0 15 2" align="Stretch"/>
<Child type="Widget" skin="PU_T" offset="2 0 15 2" align="Stretch"/>
<Child type="Widget" skin="PU_TL" offset="0 0 2 2" align="Stretch"/>
<Child type="Widget" skin="PU_L" offset="0 2 2 15" align="Stretch"/>
<Child type="Widget" skin="PU_L" offset="0 2 2 15" align="Stretch"/>
<Child type="Widget" skin="PU_BL" offset="0 17 2 2" align="Stretch"/>
</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="Stretch"/>
<Child type="Widget" skin="PD_B" offset="2 17 15 2" align="Stretch"/>
<Child type="Widget" skin="PD_BR" offset="17 17 2 2" align="Stretch"/>
<Child type="Widget" skin="PD_R" offset="17 2 2 15" align="Stretch"/>
<Child type="Widget" skin="PD_R" offset="17 2 2 15" align="Stretch"/>
<Child type="Widget" skin="PD_TR" offset="17 0 2 2" align="Stretch"/>
<Child type="Widget" skin="PD_T" offset="2 0 15 2" align="Stretch"/>
<Child type="Widget" skin="PD_T" offset="2 0 15 2" align="Stretch"/>
<Child type="Widget" skin="PD_TL" offset="0 0 2 2" align="Stretch"/>
<Child type="Widget" skin="PD_L" offset="0 2 2 15" align="Stretch"/>
<Child type="Widget" skin="PD_L" offset="0 2 2 15" align="Stretch"/>
<Child type="Widget" skin="PD_BL" offset="0 17 2 2" align="Stretch"/>
</Skin>
@ -167,7 +167,7 @@
</BasisSkin>
</Skin>
<Skin name="DB_BL" size="4 4" texture="textures\menu_thick_border_bottom_left_corner.dds">
<Property key="Pointer" value="dresize2" />
<Property key="Pointer" value="dresize2"/>
<BasisSkin type="MainSkin" offset="0 0 4 4">
<State name="normal" offset="0 0 4 4"/>
</BasisSkin>
@ -185,7 +185,7 @@
<!-- These define the window borders -->
<Skin name="TB_B" size="512 4" texture="textures\menu_thick_border_bottom.dds">
<Property key="Pointer" value="vresize" />
<Property key="Pointer" value="vresize"/>
<BasisSkin type="TileRect" offset="0 0 512 4" align="Stretch">
<State name="normal" offset="0 0 512 4">
<Property key="TileSize" value="512 4"/>
@ -196,7 +196,7 @@
</Skin>
<Skin name="TB_R" size="4 512" texture="textures\menu_thick_border_right.dds">
<Property key="Pointer" value="hresize" />
<Property key="Pointer" value="hresize"/>
<BasisSkin type="TileRect" offset="0 0 4 512" align="Stretch">
<State name="normal" offset="0 0 4 512">
<Property key="TileSize" value="4 512"/>
@ -207,7 +207,7 @@
</Skin>
<Skin name="TB_T" size="512 4" texture="textures\menu_thick_border_top.dds">
<Property key="Pointer" value="vresize" />
<Property key="Pointer" value="vresize"/>
<BasisSkin type="TileRect" offset="0 0 512 4" align="Stretch">
<State name="normal" offset="0 0 512 4">
<Property key="TileSize" value="512 4"/>
@ -218,7 +218,7 @@
</Skin>
<Skin name="TB_L" size="4 512" texture="textures\menu_thick_border_left.dds">
<Property key="Pointer" value="hresize" />
<Property key="Pointer" value="hresize"/>
<BasisSkin type="TileRect" offset="0 0 4 512" align="Stretch">
<State name="normal" offset="0 0 4 512">
<Property key="TileSize" value="4 512"/>
@ -230,25 +230,25 @@
<!-- Window border corners -->
<Skin name="TB_BR" size="4 4" texture="textures\menu_thick_border_bottom_right_corner.dds">
<Property key="Pointer" value="dresize" />
<Property key="Pointer" value="dresize"/>
<BasisSkin type="MainSkin" offset="0 0 4 4">
<State name="normal" offset="0 0 4 4"/>
</BasisSkin>
</Skin>
<Skin name="TB_BL" size="4 4" texture="textures\menu_thick_border_bottom_left_corner.dds">
<Property key="Pointer" value="dresize2" />
<Property key="Pointer" value="dresize2"/>
<BasisSkin type="MainSkin" offset="0 0 4 4">
<State name="normal" offset="0 0 4 4"/>
</BasisSkin>
</Skin>
<Skin name="TB_TR" size="4 4" texture="textures\menu_thick_border_top_right_corner.dds">
<Property key="Pointer" value="dresize2" />
<Property key="Pointer" value="dresize2"/>
<BasisSkin type="MainSkin" offset="0 0 4 4">
<State name="normal" offset="0 0 4 4"/>
</BasisSkin>
</Skin>
<Skin name="TB_TL" size="4 4" texture="textures\menu_thick_border_top_left_corner.dds">
<Property key="Pointer" value="dresize" />
<Property key="Pointer" value="dresize"/>
<BasisSkin type="MainSkin" offset="0 0 4 4">
<State name="normal" offset="0 0 4 4"/>
</BasisSkin>
@ -256,56 +256,56 @@
<!-- Expanded border corners, to get larger diagonal corner pointer area -->
<Skin name="TB_TL_T" size="10 4" texture="textures\menu_thick_border_top.dds">
<Property key="Pointer" value="dresize" />
<Property key="Pointer" value="dresize"/>
<BasisSkin type="MainSkin" offset="0 0 10 4">
<State name="normal" offset="0 0 10 4"/>
</BasisSkin>
</Skin>
<Skin name="TB_TL_B" size="4 10" texture="textures\menu_thick_border_left.dds">
<Property key="Pointer" value="dresize" />
<Property key="Pointer" value="dresize"/>
<BasisSkin type="MainSkin" offset="0 0 4 10">
<State name="normal" offset="0 0 4 10"/>
</BasisSkin>
</Skin>
<Skin name="TB_TR_T" size="10 4" texture="textures\menu_thick_border_top.dds">
<Property key="Pointer" value="dresize2" />
<Property key="Pointer" value="dresize2"/>
<BasisSkin type="MainSkin" offset="0 0 10 4">
<State name="normal" offset="0 0 10 4"/>
</BasisSkin>
</Skin>
<Skin name="TB_TR_B" size="4 10" texture="textures\menu_thick_border_right.dds">
<Property key="Pointer" value="dresize2" />
<Property key="Pointer" value="dresize2"/>
<BasisSkin type="MainSkin" offset="0 0 4 10">
<State name="normal" offset="0 0 4 10"/>
</BasisSkin>
</Skin>
<Skin name="TB_BL_T" size="4 10" texture="textures\menu_thick_border_left.dds">
<Property key="Pointer" value="dresize2" />
<Property key="Pointer" value="dresize2"/>
<BasisSkin type="MainSkin" offset="0 0 4 10">
<State name="normal" offset="0 0 4 10"/>
</BasisSkin>
</Skin>
<Skin name="TB_BL_B" size="10 4" texture="textures\menu_thick_border_bottom.dds">
<Property key="Pointer" value="dresize2" />
<Property key="Pointer" value="dresize2"/>
<BasisSkin type="MainSkin" offset="0 0 10 4">
<State name="normal" offset="0 0 10 4"/>
</BasisSkin>
</Skin>
<Skin name="TB_BR_T" size="4 10" texture="textures\menu_thick_border_right.dds">
<Property key="Pointer" value="dresize" />
<Property key="Pointer" value="dresize"/>
<BasisSkin type="MainSkin" offset="0 0 4 10">
<State name="normal" offset="0 0 4 10"/>
</BasisSkin>
</Skin>
<Skin name="TB_BR_B" size="10 4" texture="textures\menu_thick_border_bottom.dds">
<Property key="Pointer" value="dresize" />
<Property key="Pointer" value="dresize"/>
<BasisSkin type="MainSkin" offset="0 0 10 4">
<State name="normal" offset="0 0 10 4"/>
</BasisSkin>
@ -390,9 +390,9 @@
<!-- The actual caption. It contains the edges of the blocks on
its sides as well -->
<Skin name="MW_Caption" size="88 20" texture="black.png" >
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Center" />
<Property key="TextColour" value="0.75 0.62 0.36" />
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
<Property key="TextColour" value="0.75 0.62 0.36"/>
<BasisSkin type="SubSkin" offset="0 0 88 20" align="Stretch">
<State name="normal" offset="0 0 8 8"/>
@ -415,10 +415,10 @@
------------------------------------------------------ -->
<Skin name="MW_Window" size="256 256">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Center" />
<Property key="TextColour" value="0.8 0.8 0.8" />
<Property key="Snap" value="true" />
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
<Property key="TextColour" value="0.8 0.8 0.8"/>
<Property key="Snap" value="true"/>
<Property key="MinSize" value="64 64"/>
<Child type="Widget" skin="BlackBG" offset="8 28 240 220" align="Stretch" name="Client"/>
@ -555,10 +555,10 @@
</Skin>
<Skin name="MW_Window_NoCaption" size="256 256">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Center" />
<Property key="TextColour" value="0.8 0.8 0.8" />
<Property key="Snap" value="true" />
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
<Property key="TextColour" value="0.8 0.8 0.8"/>
<Property key="Snap" value="true"/>
<Property key="MinSize" value="64 64"/>
<Child type="Widget" skin="BlackBG" offset="8 28 240 220" align="Stretch" name="Client"/>
@ -692,10 +692,10 @@
</Skin>
<Skin name="MW_Window_Pinnable" size="256 256">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Center" />
<Property key="TextColour" value="0.8 0.8 0.8" />
<Property key="Snap" value="true" />
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
<Property key="TextColour" value="0.8 0.8 0.8"/>
<Property key="Snap" value="true"/>
<Property key="MinSize" value="64 64"/>
<Child type="Widget" skin="BlackBG" offset="8 28 240 220" align="Stretch" name="Client"/>
@ -835,9 +835,9 @@
</Skin>
<Skin name="MW_Dialog" size="256 54">
<Property key="FontName" value="Default" />
<Property key="TextAlign" value="Center" />
<Property key="TextColour" value="0.8 0.8 0.8" />
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
<Property key="TextColour" value="0.8 0.8 0.8"/>
<Child type="Widget" skin="BlackBG" offset="4 4 248 46" align="Stretch" name="Client"/>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save