Merge remote-tracking branch 'scrawl/master'

deque
Marc Zinnschlag 10 years ago
commit 39b6659045

@ -32,7 +32,7 @@ add_openmw_dir (mwinput
add_openmw_dir (mwgui
textinput widgets race class birth review windowmanagerimp console dialogue
windowbase statswindow messagebox journalwindow charactercreation
mapwindow windowpinnablebase tooltips scrollwindow bookwindow list
mapwindow windowpinnablebase tooltips scrollwindow bookwindow
formatting inventorywindow container hud countdialog tradewindow settingswindow
confirmationdialog alchemywindow referenceinterface spellwindow mainmenu quickkeysmenu
itemselection spellbuyingwindow loadingscreen levelupdialog waitdialog spellcreationdialog

@ -1123,10 +1123,13 @@ namespace MWClass
return cast.cast(id);
}
void Npc::skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType) const
void Npc::skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType, float extraFactor) const
{
MWMechanics::NpcStats& stats = getNpcStats (ptr);
if (stats.isWerewolf())
return;
MWWorld::LiveCellRef<ESM::NPC> *ref = ptr.get<ESM::NPC>();
const ESM::Class *class_ =
@ -1134,7 +1137,7 @@ namespace MWClass
ref->mBase->mClass
);
stats.useSkill (skill, *class_, usageType);
stats.useSkill (skill, *class_, usageType, extraFactor);
}
float Npc::getArmorRating (const MWWorld::Ptr& ptr) const

@ -136,7 +136,7 @@ namespace MWClass
virtual void adjustScale (const MWWorld::Ptr &ptr, float &scale) const;
virtual void skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType) const;
virtual void skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType, float extraFactor=1.f) const;
///< Inform actor \a ptr that a skill use has succeeded.
virtual void adjustRotation(const MWWorld::Ptr& ptr,float& x,float& y,float& z) const;

@ -671,8 +671,6 @@ namespace MWGui
// Centre dialog
center();
setText("LabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSpecializationMenu1", ""));
getWidget(mSpecialization0, "Specialization0");
getWidget(mSpecialization1, "Specialization1");
getWidget(mSpecialization2, "Specialization2");
@ -694,7 +692,6 @@ namespace MWGui
MyGUI::Button* cancelButton;
getWidget(cancelButton, "CancelButton");
cancelButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sCancel", ""));
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSpecializationDialog::onCancelClicked);
}
@ -737,8 +734,6 @@ namespace MWGui
// Centre dialog
center();
setText("LabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sAttributesMenu1", ""));
for (int i = 0; i < 8; ++i)
{
Widgets::MWAttributePtr attribute;
@ -752,7 +747,6 @@ namespace MWGui
MyGUI::Button* cancelButton;
getWidget(cancelButton, "CancelButton");
cancelButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sCancel", ""));
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectAttributeDialog::onCancelClicked);
}
@ -788,11 +782,6 @@ namespace MWGui
// Centre dialog
center();
setText("LabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSkillsMenu1", ""));
setText("CombatLabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSpecializationCombat", ""));
setText("MagicLabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSpecializationMagic", ""));
setText("StealthLabelT", MWBase::Environment::get().getWindowManager()->getGameSettingString("sSpecializationStealth", ""));
for(int i = 0; i < 9; i++)
{
char theIndex = '0'+i;
@ -849,7 +838,6 @@ namespace MWGui
MyGUI::Button* cancelButton;
getWidget(cancelButton, "CancelButton");
cancelButton->setCaption(MWBase::Environment::get().getWindowManager()->getGameSettingString("sCancel", ""));
cancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &SelectSkillDialog::onCancelClicked);
}

@ -2,6 +2,8 @@
#include <boost/lexical_cast.hpp>
#include <components/widgets/numericeditbox.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
@ -19,7 +21,7 @@ namespace MWGui
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CountDialog::onCancelButtonClicked);
mOkButton->eventMouseButtonClick += MyGUI::newDelegate(this, &CountDialog::onOkButtonClicked);
mItemEdit->eventEditTextChange += MyGUI::newDelegate(this, &CountDialog::onEditTextChange);
mItemEdit->eventValueChanged += MyGUI::newDelegate(this, &CountDialog::onEditValueChanged);
mSlider->eventScrollChangePosition += MyGUI::newDelegate(this, &CountDialog::onSliderMoved);
// make sure we read the enter key being pressed to accept multiple items
mItemEdit->eventEditSelectAccept += MyGUI::newDelegate(this, &CountDialog::onEnterKeyPressed);
@ -46,7 +48,10 @@ namespace MWGui
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mItemEdit);
mSlider->setScrollPosition(maxCount-1);
mItemEdit->setCaption(boost::lexical_cast<std::string>(maxCount));
mItemEdit->setMinValue(1);
mItemEdit->setMaxValue(maxCount);
mItemEdit->setValue(maxCount);
}
void CountDialog::cancel() //Keeping this here as I don't know if anything else relies on it.
@ -80,30 +85,13 @@ namespace MWGui
setVisible(false);
}
void CountDialog::onEditTextChange(MyGUI::EditBox* _sender)
void CountDialog::onEditValueChanged(int value)
{
if (_sender->getCaption() == "")
return;
unsigned int count;
try
{
count = boost::lexical_cast<unsigned int>(_sender->getCaption());
}
catch (std::bad_cast&)
{
count = 1;
}
if (count > mSlider->getScrollRange())
{
count = mSlider->getScrollRange();
}
mSlider->setScrollPosition(count-1);
onSliderMoved(mSlider, count-1);
mSlider->setScrollPosition(value-1);
}
void CountDialog::onSliderMoved(MyGUI::ScrollBar* _sender, size_t _position)
{
mItemEdit->setCaption(boost::lexical_cast<std::string>(_position+1));
mItemEdit->setValue(_position+1);
}
}

@ -3,6 +3,11 @@
#include "windowbase.hpp"
namespace Gui
{
class NumericEditBox;
}
namespace MWGui
{
class CountDialog : public WindowModal
@ -22,7 +27,7 @@ namespace MWGui
private:
MyGUI::ScrollBar* mSlider;
MyGUI::EditBox* mItemEdit;
Gui::NumericEditBox* mItemEdit;
MyGUI::TextBox* mItemText;
MyGUI::TextBox* mLabelText;
MyGUI::Button* mOkButton;
@ -30,7 +35,7 @@ namespace MWGui
void onCancelButtonClicked(MyGUI::Widget* _sender);
void onOkButtonClicked(MyGUI::Widget* _sender);
void onEditTextChange(MyGUI::EditBox* _sender);
void onEditValueChanged(int value);
void onSliderMoved(MyGUI::ScrollBar* _sender, size_t _position);
void onEnterKeyPressed(MyGUI::EditBox* _sender);
};

@ -3,6 +3,8 @@
#include <boost/bind.hpp>
#include <boost/lexical_cast.hpp>
#include <components/widgets/list.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/mechanicsmanager.hpp"
@ -17,7 +19,6 @@
#include "../mwdialogue/dialoguemanagerimp.hpp"
#include "widgets.hpp"
#include "list.hpp"
#include "tradewindow.hpp"
#include "spellbuyingwindow.hpp"
#include "travelwindow.hpp"

@ -8,14 +8,14 @@
#include "keywordsearch.hpp"
namespace Gui
{
class MWList;
}
namespace MWGui
{
class WindowManager;
namespace Widgets
{
class MWList;
}
}
/*
@ -169,7 +169,7 @@ namespace MWGui
KeywordSearchT mKeywordSearch;
BookPage* mHistory;
Widgets::MWList* mTopicsList;
Gui::MWList* mTopicsList;
MyGUI::ScrollBar* mScrollBar;
MyGUI::Progress* mDispositionBar;
MyGUI::EditBox* mDispositionText;

@ -4,7 +4,6 @@
#include "../mwbase/soundmanager.hpp"
#include "../mwbase/windowmanager.hpp"
#include "../mwbase/journal.hpp"
#include "list.hpp"
#include <sstream>
#include <set>
@ -16,12 +15,12 @@
#include "boost/lexical_cast.hpp"
#include <components/widgets/imagebutton.hpp>
#include <components/widgets/list.hpp>
#include "bookpage.hpp"
#include "windowbase.hpp"
#include "journalviewmodel.hpp"
#include "journalbooks.hpp"
#include "list.hpp"
namespace
{
@ -111,10 +110,10 @@ namespace
adviseButtonClick (ShowAllBTN, &JournalWindowImpl::notifyShowAll );
adviseButtonClick (ShowActiveBTN, &JournalWindowImpl::notifyShowActive);
MWGui::Widgets::MWList* list = getWidget<MWGui::Widgets::MWList>(QuestsList);
Gui::MWList* list = getWidget<Gui::MWList>(QuestsList);
list->eventItemSelected += MyGUI::newDelegate(this, &JournalWindowImpl::notifyQuestClicked);
MWGui::Widgets::MWList* topicsList = getWidget<MWGui::Widgets::MWList>(TopicsList);
Gui::MWList* topicsList = getWidget<Gui::MWList>(TopicsList);
topicsList->eventItemSelected += MyGUI::newDelegate(this, &JournalWindowImpl::notifyTopicSelected);
{
@ -412,7 +411,7 @@ namespace
setVisible (RightTopicIndex, false);
setVisible (TopicsList, true);
MWGui::Widgets::MWList* list = getWidget<MWGui::Widgets::MWList>(TopicsList);
Gui::MWList* list = getWidget<Gui::MWList>(TopicsList);
list->clear();
AddNamesToList add(list);
@ -435,9 +434,9 @@ namespace
struct AddNamesToList
{
AddNamesToList(MWGui::Widgets::MWList* list) : mList(list) {}
AddNamesToList(Gui::MWList* list) : mList(list) {}
MWGui::Widgets::MWList* mList;
Gui::MWList* mList;
void operator () (const std::string& name)
{
mList->addItem(name);
@ -455,7 +454,7 @@ namespace
setVisible (ShowAllBTN, !mAllQuests);
setVisible (ShowActiveBTN, mAllQuests);
MWGui::Widgets::MWList* list = getWidget<MWGui::Widgets::MWList>(QuestsList);
Gui::MWList* list = getWidget<Gui::MWList>(QuestsList);
list->clear();
AddNamesToList add(list);

@ -1,169 +0,0 @@
#include "list.hpp"
#include <MyGUI_Gui.h>
#include <MyGUI_Button.h>
#include <MyGUI_ImageBox.h>
#include <MyGUI_ScrollBar.h>
namespace MWGui
{
namespace Widgets
{
MWList::MWList() :
mClient(0)
, mScrollView(0)
, mItemHeight(0)
{
}
void MWList::initialiseOverride()
{
Base::initialiseOverride();
assignWidget(mClient, "Client");
if (mClient == 0)
mClient = this;
mScrollView = mClient->createWidgetReal<MyGUI::ScrollView>(
"MW_ScrollView", MyGUI::FloatCoord(0.0, 0.0, 1.0, 1.0),
MyGUI::Align::Top | MyGUI::Align::Left | MyGUI::Align::Stretch, getName() + "_ScrollView");
}
void MWList::addItem(const std::string& name)
{
mItems.push_back(name);
}
void MWList::addSeparator()
{
mItems.push_back("");
}
void MWList::adjustSize()
{
redraw();
}
void MWList::redraw(bool scrollbarShown)
{
const int _scrollBarWidth = 20; // fetch this from skin?
const int scrollBarWidth = scrollbarShown ? _scrollBarWidth : 0;
const int spacing = 3;
size_t viewPosition = -mScrollView->getViewOffset().top;
while (mScrollView->getChildCount())
{
MyGUI::Gui::getInstance().destroyWidget(mScrollView->getChildAt(0));
}
mItemHeight = 0;
int i=0;
for (std::vector<std::string>::const_iterator it=mItems.begin();
it!=mItems.end(); ++it)
{
if (*it != "")
{
if (mListItemSkin.empty())
throw std::runtime_error("MWList needs a ListItemSkin property");
MyGUI::Button* button = mScrollView->createWidget<MyGUI::Button>(
mListItemSkin, MyGUI::IntCoord(0, mItemHeight, mScrollView->getSize().width - scrollBarWidth - 2, 24),
MyGUI::Align::Left | MyGUI::Align::Top, getName() + "_item_" + (*it));
button->setCaption((*it));
button->getSubWidgetText()->setWordWrap(true);
button->getSubWidgetText()->setTextAlign(MyGUI::Align::Left);
button->eventMouseWheel += MyGUI::newDelegate(this, &MWList::onMouseWheel);
button->eventMouseButtonClick += MyGUI::newDelegate(this, &MWList::onItemSelected);
int height = button->getTextSize().height;
button->setSize(MyGUI::IntSize(button->getSize().width, height));
button->setUserData(i);
mItemHeight += height + spacing;
}
else
{
MyGUI::ImageBox* separator = mScrollView->createWidget<MyGUI::ImageBox>("MW_HLine",
MyGUI::IntCoord(2, mItemHeight, mScrollView->getWidth() - scrollBarWidth - 4, 18),
MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch);
separator->setNeedMouseFocus(false);
mItemHeight += 18 + spacing;
}
++i;
}
// Canvas size must be expressed with VScroll disabled, otherwise MyGUI would expand the scroll area when the scrollbar is hidden
mScrollView->setVisibleVScroll(false);
mScrollView->setCanvasSize(mClient->getSize().width, std::max(mItemHeight, mClient->getSize().height));
mScrollView->setVisibleVScroll(true);
if (!scrollbarShown && mItemHeight > mClient->getSize().height)
redraw(true);
size_t viewRange = mScrollView->getCanvasSize().height;
if(viewPosition > viewRange)
viewPosition = viewRange;
mScrollView->setViewOffset(MyGUI::IntPoint(0, viewPosition * -1));
}
void MWList::setPropertyOverride(const std::string &_key, const std::string &_value)
{
if (_key == "ListItemSkin")
mListItemSkin = _value;
else
Base::setPropertyOverride(_key, _value);
}
bool MWList::hasItem(const std::string& name)
{
return (std::find(mItems.begin(), mItems.end(), name) != mItems.end());
}
unsigned int MWList::getItemCount()
{
return mItems.size();
}
std::string MWList::getItemNameAt(unsigned int at)
{
assert(at < mItems.size() && "List item out of bounds");
return mItems[at];
}
void MWList::removeItem(const std::string& name)
{
assert( std::find(mItems.begin(), mItems.end(), name) != mItems.end() );
mItems.erase( std::find(mItems.begin(), mItems.end(), name) );
}
void MWList::clear()
{
mItems.clear();
}
void MWList::onMouseWheel(MyGUI::Widget* _sender, int _rel)
{
//NB view offset is negative
if (mScrollView->getViewOffset().top + _rel*0.3 > 0)
mScrollView->setViewOffset(MyGUI::IntPoint(0, 0));
else
mScrollView->setViewOffset(MyGUI::IntPoint(0, mScrollView->getViewOffset().top + _rel*0.3));
}
void MWList::onItemSelected(MyGUI::Widget* _sender)
{
std::string name = _sender->castType<MyGUI::Button>()->getCaption();
int id = *_sender->getUserData<int>();
eventItemSelected(name, id);
eventWidgetSelected(_sender);
}
MyGUI::Widget* MWList::getItemWidget(const std::string& name)
{
return mScrollView->findWidget (getName() + "_item_" + name);
}
}
}

@ -1,74 +0,0 @@
#ifndef MWGUI_LIST_HPP
#define MWGUI_LIST_HPP
#include <MyGUI_ScrollView.h>
namespace MWGui
{
namespace Widgets
{
/**
* \brief a very simple list widget that supports word-wrapping entries
* \note if the width or height of the list changes, you must call adjustSize() method
*/
class MWList : public MyGUI::Widget
{
MYGUI_RTTI_DERIVED(MWList)
public:
MWList();
typedef MyGUI::delegates::CMultiDelegate2<const std::string&, int> EventHandle_StringInt;
typedef MyGUI::delegates::CMultiDelegate1<MyGUI::Widget*> EventHandle_Widget;
/**
* Event: Item selected with the mouse.
* signature: void method(std::string itemName, int index)
*/
EventHandle_StringInt eventItemSelected;
/**
* Event: Item selected with the mouse.
* signature: void method(MyGUI::Widget* sender)
*/
EventHandle_Widget eventWidgetSelected;
/**
* Call after the size of the list changed, or items were inserted/removed
*/
void adjustSize();
void addItem(const std::string& name);
void addSeparator(); ///< add a seperator between the current and the next item.
void removeItem(const std::string& name);
bool hasItem(const std::string& name);
unsigned int getItemCount();
std::string getItemNameAt(unsigned int at); ///< \attention if there are separators, this method will return "" at the place where the separator is
void clear();
MyGUI::Widget* getItemWidget(const std::string& name);
///< get widget for an item name, useful to set up tooltip
virtual void setPropertyOverride(const std::string& _key, const std::string& _value);
protected:
void initialiseOverride();
void redraw(bool scrollbarShown = false);
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
void onItemSelected(MyGUI::Widget* _sender);
private:
MyGUI::ScrollView* mScrollView;
MyGUI::Widget* mClient;
std::string mListItemSkin;
std::vector<std::string> mItems;
int mItemHeight; // height of all items
};
}
}
#endif

@ -522,7 +522,7 @@ namespace MWGui
updateEffectsView ();
}
void EffectEditorBase::setWidgets (Widgets::MWList *availableEffectsList, MyGUI::ScrollView *usedEffectsView)
void EffectEditorBase::setWidgets (Gui::MWList *availableEffectsList, MyGUI::ScrollView *usedEffectsView)
{
mAvailableEffectsList = availableEffectsList;
mUsedEffectsView = usedEffectsView;

@ -1,9 +1,10 @@
#ifndef MWGUI_SPELLCREATION_H
#define MWGUI_SPELLCREATION_H
#include <components/widgets/list.hpp>
#include "windowbase.hpp"
#include "referenceinterface.hpp"
#include "list.hpp"
#include "widgets.hpp"
namespace MWGui
@ -97,7 +98,7 @@ namespace MWGui
protected:
std::map<int, short> mButtonMapping; // maps button ID to effect ID
Widgets::MWList* mAvailableEffectsList;
Gui::MWList* mAvailableEffectsList;
MyGUI::ScrollView* mUsedEffectsView;
EditEffectDialog mAddEffectDialog;
@ -124,7 +125,7 @@ namespace MWGui
void updateEffectsView();
void startEditing();
void setWidgets (Widgets::MWList* availableEffectsList, MyGUI::ScrollView* usedEffectsView);
void setWidgets (Gui::MWList* availableEffectsList, MyGUI::ScrollView* usedEffectsView);
virtual void notifyEffectsChanged () {}

@ -2,6 +2,8 @@
#include <boost/lexical_cast.hpp>
#include <components/widgets/numericeditbox.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp"
#include "../mwbase/soundmanager.hpp"
@ -86,7 +88,7 @@ namespace MWGui
mDecreaseButton->eventMouseButtonPressed += MyGUI::newDelegate(this, &TradeWindow::onDecreaseButtonPressed);
mDecreaseButton->eventMouseButtonReleased += MyGUI::newDelegate(this, &TradeWindow::onBalanceButtonReleased);
mTotalBalance->eventEditTextChange += MyGUI::newDelegate(this, &TradeWindow::onBalanceEdited);
mTotalBalance->eventValueChanged += MyGUI::newDelegate(this, &TradeWindow::onBalanceValueChanged);
setCoord(400, 0, 400, 300);
}
@ -324,12 +326,12 @@ namespace MWGui
const MWMechanics::CreatureStats &sellerStats = mPtr.getClass().getCreatureStats(mPtr);
const MWMechanics::CreatureStats &playerStats = player.getClass().getCreatureStats(player);
float a1 = std::min(player.getClass().getSkill(player, ESM::Skill::Mercantile), 100);
float b1 = std::min(0.1f * playerStats.getAttribute(ESM::Attribute::Luck).getModified(), 10.f);
float c1 = std::min(0.2f * playerStats.getAttribute(ESM::Attribute::Personality).getModified(), 10.f);
float d1 = std::min(mPtr.getClass().getSkill(mPtr, ESM::Skill::Mercantile), 100);
float e1 = std::min(0.1f * sellerStats.getAttribute(ESM::Attribute::Luck).getModified(), 10.f);
float f1 = std::min(0.2f * sellerStats.getAttribute(ESM::Attribute::Personality).getModified(), 10.f);
float a1 = player.getClass().getSkill(player, ESM::Skill::Mercantile);
float b1 = 0.1f * playerStats.getAttribute(ESM::Attribute::Luck).getModified();
float c1 = 0.2f * playerStats.getAttribute(ESM::Attribute::Personality).getModified();
float d1 = mPtr.getClass().getSkill(mPtr, ESM::Skill::Mercantile);
float e1 = 0.1f * sellerStats.getAttribute(ESM::Attribute::Luck).getModified();
float f1 = 0.2f * sellerStats.getAttribute(ESM::Attribute::Personality).getModified();
float pcTerm = (clampedDisposition - 50 + a1 + b1 + c1) * playerStats.getFatigueTerm();
float npcTerm = (d1 + e1 + f1) * sellerStats.getFatigueTerm();
@ -352,7 +354,15 @@ namespace MWGui
}
//skill use!
player.getClass().skillUsageSucceeded(player, ESM::Skill::Mercantile, 0);
float skillGain = 0.f;
int finalPrice = std::abs(mCurrentBalance);
int initialMerchantOffer = std::abs(mCurrentMerchantOffer);
if (!buying && (finalPrice > initialMerchantOffer) && finalPrice > 0)
skillGain = int(100 * (finalPrice - initialMerchantOffer) / float(finalPrice));
else if (buying && (finalPrice < initialMerchantOffer) && initialMerchantOffer > 0)
skillGain = int(100 * (initialMerchantOffer - finalPrice) / float(initialMerchantOffer));
player.getClass().skillUsageSucceeded(player, ESM::Skill::Mercantile, 0, skillGain);
}
int iBarterSuccessDisposition = gmst.find("iBarterSuccessDisposition")->getInt();
@ -425,21 +435,14 @@ namespace MWGui
MyGUI::ControllerManager::getInstance().removeItem(_sender);
}
void TradeWindow::onBalanceEdited(MyGUI::EditBox *_sender)
void TradeWindow::onBalanceValueChanged(int value)
{
try
{
unsigned int count = boost::lexical_cast<unsigned int>(_sender->getCaption());
mCurrentBalance = count * (mCurrentBalance >= 0 ? 1 : -1);
updateLabels();
}
catch (std::bad_cast&)
{
if (_sender->getCaption().empty())
mTotalBalance->setCaption("0");
else
mTotalBalance->setCaption(boost::lexical_cast<std::string>(std::abs(mCurrentBalance)));
}
// Entering a "-" sign inverts the buying/selling state
mCurrentBalance = (mCurrentBalance >= 0 ? 1 : -1) * value;
updateLabels();
if (value != std::abs(value))
mTotalBalance->setValue(std::abs(value));
}
void TradeWindow::onIncreaseButtonTriggered()
@ -463,19 +466,16 @@ namespace MWGui
mPlayerGold->setCaptionWithReplacing("#{sYourGold} " + boost::lexical_cast<std::string>(playerGold));
std::string balanceCaption;
if (mCurrentBalance > 0)
{
mTotalBalanceLabel->setCaptionWithReplacing("#{sTotalSold}");
balanceCaption = boost::lexical_cast<std::string>(mCurrentBalance);
}
else
{
mTotalBalanceLabel->setCaptionWithReplacing("#{sTotalCost}");
balanceCaption = boost::lexical_cast<std::string>(-mCurrentBalance);
}
if (balanceCaption != mTotalBalance->getCaption().asUTF8()) // Don't reset text cursor if text doesn't need to be changed
mTotalBalance->setCaption(balanceCaption);
mTotalBalance->setValue(std::abs(mCurrentBalance));
mMerchantGold->setCaptionWithReplacing("#{sSellerGold} " + boost::lexical_cast<std::string>(getMerchantGold()));
}

@ -3,10 +3,9 @@
#include "container.hpp"
namespace MyGUI
namespace Gui
{
class Gui;
class Widget;
class NumericEditBox;
}
namespace MWGui
@ -54,7 +53,7 @@ namespace MWGui
MyGUI::Button* mIncreaseButton;
MyGUI::Button* mDecreaseButton;
MyGUI::TextBox* mTotalBalanceLabel;
MyGUI::EditBox* mTotalBalance;
Gui::NumericEditBox* mTotalBalance;
MyGUI::Widget* mBottomPane;
@ -84,7 +83,7 @@ namespace MWGui
void onIncreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);
void onDecreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);
void onBalanceButtonReleased(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);
void onBalanceEdited(MyGUI::EditBox* _sender);
void onBalanceValueChanged(int value);
void onRepeatClick(MyGUI::Widget* widget, MyGUI::ControllerItem* controller);
void addRepeatController(MyGUI::Widget* widget);

@ -18,7 +18,8 @@
#include <components/fontloader/fontloader.hpp>
#include <components/widgets/box.hpp>
#include <components/widgets/widgets.hpp>
#include <components/widgets/tags.hpp>
#include "../mwbase/inputmanager.hpp"
#include "../mwbase/statemanager.hpp"
@ -164,13 +165,6 @@ namespace MWGui
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWEffectList>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWSpellEffect>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWDynamicStat>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWList>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::HBox>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::VBox>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::AutoSizedTextBox>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::AutoSizedEditBox>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::AutoSizedButton>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::ImageButton>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::ExposedWindow>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWScrollBar>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<VideoWidget>("Widget");
@ -178,6 +172,7 @@ namespace MWGui
BookPage::registerMyGUIComponents ();
ItemView::registerComponents();
ItemWidget::registerComponents();
Gui::registerAllWidgets();
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Controllers::ControllerRepeatEvent>("Controller");
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Controllers::ControllerFollowMouse>("Controller");
@ -991,50 +986,13 @@ namespace MWGui
std::string tokenToFind = "sCell=";
size_t tokenLength = tokenToFind.length();
std::string fontcolour = "fontcolour=";
size_t fontcolourLength = fontcolour.length();
std::string fontcolourhtml = "fontcolourhtml=";
size_t fontcolourhtmlLength = fontcolourhtml.length();
if (tag.compare(0, tokenLength, tokenToFind) == 0)
{
_result = mTranslationDataStorage.translateCellName(tag.substr(tokenLength));
}
else if (tag.compare(0, fontcolourLength, fontcolour) == 0)
else if (Gui::replaceTag(tag, _result, mFallbackMap))
{
std::string fallbackName = "FontColor_color_" + tag.substr(fontcolourLength);
std::map<std::string, std::string>::const_iterator it = mFallbackMap.find(fallbackName);
if (it == mFallbackMap.end())
throw std::runtime_error("Unknown fallback name: " + fallbackName);
std::string str = it->second;
std::string ret[3];
unsigned int j=0;
for(unsigned int i=0;i<str.length();++i){
if(str[i]==',') j++;
else if (str[i] != ' ') ret[j]+=str[i];
}
MyGUI::Colour col (MyGUI::utility::parseInt(ret[0])/255.f,MyGUI::utility::parseInt(ret[1])/255.f,MyGUI::utility::parseInt(ret[2])/255.f);
_result = col.print();
}
else if (tag.compare(0, fontcolourhtmlLength, fontcolourhtml) == 0)
{
std::string fallbackName = "FontColor_color_" + tag.substr(fontcolourhtmlLength);
std::map<std::string, std::string>::const_iterator it = mFallbackMap.find(fallbackName);
if (it == mFallbackMap.end())
throw std::runtime_error("Unknown fallback name: " + fallbackName);
std::string str = it->second;
std::string ret[3];
unsigned int j=0;
for(unsigned int i=0;i<str.length();++i){
if(str[i]==',') j++;
else if (str[i] != ' ') ret[j]+=str[i];
}
std::stringstream html;
html << "#" << std::hex << MyGUI::utility::parseInt(ret[0]) << MyGUI::utility::parseInt(ret[1]) << MyGUI::utility::parseInt(ret[2]);
_result = html.str();
return;
}
else
{

@ -1175,14 +1175,26 @@ namespace MWMechanics
iter->second->updateContinuousVfx();
// Animation/movement update
CharacterController* playerCharacter = NULL;
for(PtrControllerMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter)
{
if (iter->first.getClass().getCreatureStats(iter->first).getMagicEffects().get(
ESM::MagicEffect::Paralyze).getMagnitude() > 0)
iter->second->skipAnim();
// Handle player last, in case a cell transition occurs by casting a teleportation spell
// (would invalidate the iterator)
if (iter->first.getCellRef().getRefId() == "player")
{
playerCharacter = iter->second;
continue;
}
iter->second->update(duration);
}
if (playerCharacter)
playerCharacter->update(duration);
for(PtrControllerMap::iterator iter(mActors.begin()); iter != mActors.end(); ++iter)
{
const MWWorld::Class &cls = iter->first.getClass();

@ -50,11 +50,6 @@ bool MWMechanics::AiFollow::execute (const MWWorld::Ptr& actor,float duration)
)
return true; //Target doesn't exist
// Only the player can be actively followed. AiFollow packages with targets other than the player
// are only used for defining combat alliances, since NPCs will defend whoever they are following or being followed by.
if (target != MWBase::Environment::get().getWorld()->getPlayerPtr())
return false;
actor.getClass().getCreatureStats(actor).setDrawState(DrawState_Nothing);
ESM::Position pos = actor.getRefData().getPosition(); //position of the actor

@ -1128,9 +1128,21 @@ namespace MWMechanics
}
}
// Attacking peaceful NPCs is a crime
// Attacking an NPC that is already in combat with any other NPC is not a crime
AiSequence& seq = ptr.getClass().getCreatureStats(ptr).getAiSequence();
bool isFightingNpc = false;
for (std::list<AiPackage*>::const_iterator it = seq.begin(); it != seq.end(); ++it)
{
if ((*it)->getTypeId() == AiPackage::TypeIdCombat)
{
MWWorld::Ptr target = static_cast<AiCombat*>(*it)->getTarget();
if (!target.isEmpty() && target.getClass().isNpc())
isFightingNpc = true;
}
}
if (ptr.getClass().isNpc() && !attacker.isEmpty() && !ptr.getClass().getCreatureStats(ptr).getAiSequence().isInCombat(attacker)
&& !isAggressive(ptr, attacker))
&& !isAggressive(ptr, attacker) && !isFightingNpc)
commitCrime(attacker, ptr, MWBase::MechanicsManager::OT_Assault);
if (!attacker.isEmpty() && (attacker.getClass().getCreatureStats(attacker).getAiSequence().isInCombat(ptr)

@ -107,7 +107,7 @@ bool MWMechanics::NpcStats::isSameFaction (const NpcStats& npcStats) const
}
float MWMechanics::NpcStats::getSkillGain (int skillIndex, const ESM::Class& class_, int usageType,
int level) const
int level, float extraFactor) const
{
if (level<0)
level = static_cast<int> (getSkill (skillIndex).getBase());
@ -131,6 +131,8 @@ float MWMechanics::NpcStats::getSkillGain (int skillIndex, const ESM::Class& cla
return 0;
}
skillFactor *= extraFactor;
const MWWorld::Store<ESM::GameSetting> &gmst =
MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>();
@ -167,7 +169,7 @@ float MWMechanics::NpcStats::getSkillGain (int skillIndex, const ESM::Class& cla
return 1.0 / ((level+1) * (1.0/skillFactor) * typeFactor * specialisationFactor);
}
void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_, int usageType)
void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_, int usageType, float extraFactor)
{
// Don't increase skills as a werewolf
if(mIsWerewolf)
@ -175,7 +177,7 @@ void MWMechanics::NpcStats::useSkill (int skillIndex, const ESM::Class& class_,
MWMechanics::SkillValue& value = getSkill (skillIndex);
value.setProgress(value.getProgress() + getSkillGain (skillIndex, class_, usageType));
value.setProgress(value.getProgress() + getSkillGain (skillIndex, class_, usageType, -1, extraFactor));
if (value.getProgress()>=1)
{

@ -81,12 +81,12 @@ namespace MWMechanics
///< Do *this and \a npcStats share a faction?
float getSkillGain (int skillIndex, const ESM::Class& class_, int usageType = -1,
int level = -1) const;
int level = -1, float extraFactor=1.f) const;
///< \param usageType: Usage specific factor, specified in the respective skill record;
/// -1: use a factor of 1.0 instead.
/// \param level Level to base calculation on; -1: use current level.
void useSkill (int skillIndex, const ESM::Class& class_, int usageType = -1);
void useSkill (int skillIndex, const ESM::Class& class_, int usageType = -1, float extraFactor=1.f);
///< Increase skill by usage.
void increaseSkill (int skillIndex, const ESM::Class& class_, bool preserveProgress);

@ -326,7 +326,8 @@ namespace MWRender
mOverlayTexture->getBuffer()->blit(tex->getBuffer(), srcBox, destBox);
if (srcBox.left == destBox.left && srcBox.right == destBox.right
&& srcBox.top == destBox.top && srcBox.bottom == destBox.bottom)
&& srcBox.top == destBox.top && srcBox.bottom == destBox.bottom
&& int(image.getWidth()) == mWidth && int(image.getHeight()) == mHeight)
mOverlayImage = image;
else
mOverlayTexture->convertToImage(mOverlayImage);

@ -52,7 +52,7 @@ namespace MWWorld
return false;
}
void Class::skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType) const
void Class::skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType, float extraFactor) const
{
throw std::runtime_error ("class does not represent an actor");
}

@ -231,7 +231,7 @@ namespace MWWorld
///
/// (default implementation: ignore and return false)
virtual void skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType) const;
virtual void skillUsageSucceeded (const MWWorld::Ptr& ptr, int skill, int usageType, float extraFactor=1.f) const;
///< Inform actor \a ptr that a skill use has succeeded.
///
/// (default implementations: throws an exception)

@ -96,7 +96,7 @@ add_component_dir (ogreinit
)
add_component_dir (widgets
box imagebutton
box imagebutton tags list numericeditbox widgets
)
add_component_dir (fontloader

@ -8,7 +8,7 @@ namespace Gui
MyGUI::Widget * parent = w->getParent();
if (parent != 0)
{
if (mExpandDirection == MyGUI::Align::Left)
if (mExpandDirection.isLeft())
{
int hdiff = getRequestedSize ().width - w->getSize().width;
w->setPosition(w->getPosition() - MyGUI::IntPoint(hdiff, 0));

@ -12,6 +12,8 @@ namespace Gui
class AutoSizedWidget
{
public:
AutoSizedWidget() : mExpandDirection(MyGUI::Align::Right) {}
virtual MyGUI::IntSize getRequestedSize() = 0;
protected:

@ -0,0 +1,165 @@
#include "list.hpp"
#include <MyGUI_Gui.h>
#include <MyGUI_Button.h>
#include <MyGUI_ImageBox.h>
#include <MyGUI_ScrollBar.h>
namespace Gui
{
MWList::MWList() :
mClient(0)
, mScrollView(0)
, mItemHeight(0)
{
}
void MWList::initialiseOverride()
{
Base::initialiseOverride();
assignWidget(mClient, "Client");
if (mClient == 0)
mClient = this;
mScrollView = mClient->createWidgetReal<MyGUI::ScrollView>(
"MW_ScrollView", MyGUI::FloatCoord(0.0, 0.0, 1.0, 1.0),
MyGUI::Align::Top | MyGUI::Align::Left | MyGUI::Align::Stretch, getName() + "_ScrollView");
}
void MWList::addItem(const std::string& name)
{
mItems.push_back(name);
}
void MWList::addSeparator()
{
mItems.push_back("");
}
void MWList::adjustSize()
{
redraw();
}
void MWList::redraw(bool scrollbarShown)
{
const int _scrollBarWidth = 20; // fetch this from skin?
const int scrollBarWidth = scrollbarShown ? _scrollBarWidth : 0;
const int spacing = 3;
size_t viewPosition = -mScrollView->getViewOffset().top;
while (mScrollView->getChildCount())
{
MyGUI::Gui::getInstance().destroyWidget(mScrollView->getChildAt(0));
}
mItemHeight = 0;
int i=0;
for (std::vector<std::string>::const_iterator it=mItems.begin();
it!=mItems.end(); ++it)
{
if (*it != "")
{
if (mListItemSkin.empty())
return;
MyGUI::Button* button = mScrollView->createWidget<MyGUI::Button>(
mListItemSkin, MyGUI::IntCoord(0, mItemHeight, mScrollView->getSize().width - scrollBarWidth - 2, 24),
MyGUI::Align::Left | MyGUI::Align::Top, getName() + "_item_" + (*it));
button->setCaption((*it));
button->getSubWidgetText()->setWordWrap(true);
button->getSubWidgetText()->setTextAlign(MyGUI::Align::Left);
button->eventMouseWheel += MyGUI::newDelegate(this, &MWList::onMouseWheel);
button->eventMouseButtonClick += MyGUI::newDelegate(this, &MWList::onItemSelected);
int height = button->getTextSize().height;
button->setSize(MyGUI::IntSize(button->getSize().width, height));
button->setUserData(i);
mItemHeight += height + spacing;
}
else
{
MyGUI::ImageBox* separator = mScrollView->createWidget<MyGUI::ImageBox>("MW_HLine",
MyGUI::IntCoord(2, mItemHeight, mScrollView->getWidth() - scrollBarWidth - 4, 18),
MyGUI::Align::Left | MyGUI::Align::Top | MyGUI::Align::HStretch);
separator->setNeedMouseFocus(false);
mItemHeight += 18 + spacing;
}
++i;
}
// Canvas size must be expressed with VScroll disabled, otherwise MyGUI would expand the scroll area when the scrollbar is hidden
mScrollView->setVisibleVScroll(false);
mScrollView->setCanvasSize(mClient->getSize().width, std::max(mItemHeight, mClient->getSize().height));
mScrollView->setVisibleVScroll(true);
if (!scrollbarShown && mItemHeight > mClient->getSize().height)
redraw(true);
size_t viewRange = mScrollView->getCanvasSize().height;
if(viewPosition > viewRange)
viewPosition = viewRange;
mScrollView->setViewOffset(MyGUI::IntPoint(0, viewPosition * -1));
}
void MWList::setPropertyOverride(const std::string &_key, const std::string &_value)
{
if (_key == "ListItemSkin")
mListItemSkin = _value;
else
Base::setPropertyOverride(_key, _value);
}
bool MWList::hasItem(const std::string& name)
{
return (std::find(mItems.begin(), mItems.end(), name) != mItems.end());
}
unsigned int MWList::getItemCount()
{
return mItems.size();
}
std::string MWList::getItemNameAt(unsigned int at)
{
assert(at < mItems.size() && "List item out of bounds");
return mItems[at];
}
void MWList::removeItem(const std::string& name)
{
assert( std::find(mItems.begin(), mItems.end(), name) != mItems.end() );
mItems.erase( std::find(mItems.begin(), mItems.end(), name) );
}
void MWList::clear()
{
mItems.clear();
}
void MWList::onMouseWheel(MyGUI::Widget* _sender, int _rel)
{
//NB view offset is negative
if (mScrollView->getViewOffset().top + _rel*0.3 > 0)
mScrollView->setViewOffset(MyGUI::IntPoint(0, 0));
else
mScrollView->setViewOffset(MyGUI::IntPoint(0, mScrollView->getViewOffset().top + _rel*0.3));
}
void MWList::onItemSelected(MyGUI::Widget* _sender)
{
std::string name = _sender->castType<MyGUI::Button>()->getCaption();
int id = *_sender->getUserData<int>();
eventItemSelected(name, id);
eventWidgetSelected(_sender);
}
MyGUI::Widget* MWList::getItemWidget(const std::string& name)
{
return mScrollView->findWidget (getName() + "_item_" + name);
}
}

@ -0,0 +1,71 @@
#ifndef MWGUI_LIST_HPP
#define MWGUI_LIST_HPP
#include <MyGUI_ScrollView.h>
namespace Gui
{
/**
* \brief a very simple list widget that supports word-wrapping entries
* \note if the width or height of the list changes, you must call adjustSize() method
*/
class MWList : public MyGUI::Widget
{
MYGUI_RTTI_DERIVED(MWList)
public:
MWList();
typedef MyGUI::delegates::CMultiDelegate2<const std::string&, int> EventHandle_StringInt;
typedef MyGUI::delegates::CMultiDelegate1<MyGUI::Widget*> EventHandle_Widget;
/**
* Event: Item selected with the mouse.
* signature: void method(std::string itemName, int index)
*/
EventHandle_StringInt eventItemSelected;
/**
* Event: Item selected with the mouse.
* signature: void method(MyGUI::Widget* sender)
*/
EventHandle_Widget eventWidgetSelected;
/**
* Call after the size of the list changed, or items were inserted/removed
*/
void adjustSize();
void addItem(const std::string& name);
void addSeparator(); ///< add a seperator between the current and the next item.
void removeItem(const std::string& name);
bool hasItem(const std::string& name);
unsigned int getItemCount();
std::string getItemNameAt(unsigned int at); ///< \attention if there are separators, this method will return "" at the place where the separator is
void clear();
MyGUI::Widget* getItemWidget(const std::string& name);
///< get widget for an item name, useful to set up tooltip
virtual void setPropertyOverride(const std::string& _key, const std::string& _value);
protected:
void initialiseOverride();
void redraw(bool scrollbarShown = false);
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
void onItemSelected(MyGUI::Widget* _sender);
private:
MyGUI::ScrollView* mScrollView;
MyGUI::Widget* mClient;
std::string mListItemSkin;
std::vector<std::string> mItems;
int mItemHeight; // height of all items
};
}
#endif

@ -0,0 +1,74 @@
#include "numericeditbox.hpp"
#include <boost/lexical_cast.hpp>
namespace Gui
{
void NumericEditBox::initialiseOverride()
{
Base::initialiseOverride();
eventEditTextChange += MyGUI::newDelegate(this, &NumericEditBox::onEditTextChange);
mValue = 0;
setCaption("0");
}
void NumericEditBox::shutdownOverride()
{
Base::shutdownOverride();
eventEditTextChange -= MyGUI::newDelegate(this, &NumericEditBox::onEditTextChange);
}
void NumericEditBox::onEditTextChange(MyGUI::EditBox *sender)
{
std::string newCaption = sender->getCaption();
if (newCaption.empty())
{
return;
}
try
{
mValue = boost::lexical_cast<int>(newCaption);
int capped = std::min(mMaxValue, std::max(mValue, mMinValue));
if (capped != mValue)
{
mValue = capped;
setCaption(MyGUI::utility::toString(mValue));
}
}
catch (boost::bad_lexical_cast&)
{
setCaption(MyGUI::utility::toString(mValue));
}
eventValueChanged(mValue);
}
void NumericEditBox::setValue(int value)
{
if (value != mValue)
{
setCaption(MyGUI::utility::toString(value));
mValue = value;
}
}
void NumericEditBox::setMinValue(int minValue)
{
mMinValue = minValue;
}
void NumericEditBox::setMaxValue(int maxValue)
{
mMaxValue = maxValue;
}
void NumericEditBox::onKeyLostFocus(MyGUI::Widget* _new)
{
Base::onKeyLostFocus(_new);
setCaption(MyGUI::utility::toString(mValue));
}
}

@ -0,0 +1,45 @@
#ifndef OPENMW_NUMERIC_EDIT_BOX_H
#define OPENMW_NUMERIC_EDIT_BOX_H
#include <MyGUI_EditBox.h>
namespace Gui
{
/**
* @brief A variant of the EditBox that only allows integer inputs
*/
class NumericEditBox : public MyGUI::EditBox
{
MYGUI_RTTI_DERIVED(NumericEditBox)
public:
NumericEditBox()
: mValue(0), mMinValue(std::numeric_limits<int>().min()),
mMaxValue(std::numeric_limits<int>().max())
{}
void initialiseOverride();
void shutdownOverride();
typedef MyGUI::delegates::CMultiDelegate1<int> EventHandle_ValueChanged;
EventHandle_ValueChanged eventValueChanged;
/// @note Does not trigger eventValueChanged
void setValue (int value);
void setMinValue(int minValue);
void setMaxValue(int maxValue);
private:
void onEditTextChange(MyGUI::EditBox* sender);
void onKeyLostFocus(MyGUI::Widget* _new);
int mValue;
int mMinValue;
int mMaxValue;
};
}
#endif

@ -0,0 +1,57 @@
#include "tags.hpp"
#include <MyGUI_Colour.h>
namespace Gui
{
bool replaceTag(const MyGUI::UString& tag, MyGUI::UString& out, const std::map<std::string,std::string>& fallbackSettings)
{
std::string fontcolour = "fontcolour=";
size_t fontcolourLength = fontcolour.length();
std::string fontcolourhtml = "fontcolourhtml=";
size_t fontcolourhtmlLength = fontcolourhtml.length();
if (tag.compare(0, fontcolourLength, fontcolour) == 0)
{
std::string fallbackName = "FontColor_color_" + tag.substr(fontcolourLength);
std::map<std::string, std::string>::const_iterator it = fallbackSettings.find(fallbackName);
if (it == fallbackSettings.end())
throw std::runtime_error("Unknown fallback name: " + fallbackName);
std::string str = it->second;
std::string ret[3];
unsigned int j=0;
for(unsigned int i=0;i<str.length();++i){
if(str[i]==',') j++;
else if (str[i] != ' ') ret[j]+=str[i];
}
MyGUI::Colour col (MyGUI::utility::parseInt(ret[0])/255.f,MyGUI::utility::parseInt(ret[1])/255.f,MyGUI::utility::parseInt(ret[2])/255.f);
out = col.print();
return true;
}
else if (tag.compare(0, fontcolourhtmlLength, fontcolourhtml) == 0)
{
std::string fallbackName = "FontColor_color_" + tag.substr(fontcolourhtmlLength);
std::map<std::string, std::string>::const_iterator it = fallbackSettings.find(fallbackName);
if (it == fallbackSettings.end())
throw std::runtime_error("Unknown fallback name: " + fallbackName);
std::string str = it->second;
std::string ret[3];
unsigned int j=0;
for(unsigned int i=0;i<str.length();++i){
if(str[i]==',') j++;
else if (str[i] != ' ') ret[j]+=str[i];
}
std::stringstream html;
html << "#" << std::hex << MyGUI::utility::parseInt(ret[0]) << MyGUI::utility::parseInt(ret[1]) << MyGUI::utility::parseInt(ret[2]);
out = html.str();
return true;
}
return false;
}
}

@ -0,0 +1,16 @@
#ifndef OPENMW_WIDGETS_TAGS_H
#define OPENMW_WIDGETS_TAGS_H
#include <MyGUI_UString.h>
#include <string>
#include <map>
namespace Gui
{
/// Try to replace a tag. Returns true on success and writes the result to \a out.
bool replaceTag (const MyGUI::UString& tag, MyGUI::UString& out, const std::map<std::string,std::string>& fallbackSettings);
}
#endif

@ -0,0 +1,25 @@
#include "widgets.hpp"
#include <MyGUI_FactoryManager.h>
#include "list.hpp"
#include "numericeditbox.hpp"
#include "box.hpp"
#include "imagebutton.hpp"
namespace Gui
{
void registerAllWidgets()
{
MyGUI::FactoryManager::getInstance().registerFactory<Gui::MWList>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::HBox>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::VBox>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::AutoSizedTextBox>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::AutoSizedEditBox>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::AutoSizedButton>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::ImageButton>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::NumericEditBox>("Widget");
}
}

@ -0,0 +1,12 @@
#ifndef OPENMW_COMPONENTS_WIDGETS_H
#define OPENMW_COMPONENTS_WIDGETS_H
namespace Gui
{
/// Register all widgets from this component with MyGUI's factory manager.
void registerAllWidgets();
}
#endif

@ -86,6 +86,7 @@ set(MYGUI_FILES
DejaVuLGCSansMono.ttf
markers.png
../launcher/images/openmw.png
OpenMWResourcePlugin.xml
)

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI>
<MyGUI type="Widgets">
<!-- New widget class definitions -->
<Widget name="ImageButton">
<Property key="DefaultSkin" value="ImageBox"/>
<Property key="Skin" value="ImageBox" group="Plugin" name="ImageButton"/>
<Property key="Parent" value="true"/>
<Property key="Child" value="true"/>
<Parameter key="ImageHighlighted" value="String"/>
<Parameter key="ImagePushed" value="String"/>
<Parameter key="ImageNormal" value="String"/>
</Widget>
<Widget name="VBox">
<Property key="DefaultSkin" value=""/>
<Property key="Skin" value="" group="Plugin" name="VBox"/>
<Property key="Parent" value="true"/>
<Property key="Child" value="true"/>
<Parameter key="Spacing" value="1 int"/>
<Parameter key="Padding" value="1 int"/>
<Parameter key="AutoResize" value="Bool"/>
</Widget>
<Widget name="HBox">
<Property key="DefaultSkin" value=""/>
<Property key="Skin" value="" group="Plugin" name="HBox"/>
<Property key="Parent" value="true"/>
<Property key="Child" value="true"/>
<Parameter key="Spacing" value="1 int"/>
<Parameter key="Padding" value="1 int"/>
<Parameter key="AutoResize" value="Bool"/>
</Widget>
<Widget name="AutoSizedButton">
<Property key="Base" value="Button"/>
<Property key="DefaultSkin" value="MW_Button"/>
<Property key="Skin" value="MW_Button" group="Plugin" name="AutoSizedButton"/>
<Property key="Parent" value="true"/>
<Property key="Child" value="true"/>
<Parameter key="ExpandDirection" value="Align"/>
</Widget>
<Widget name="AutoSizedTextBox">
<Property key="Base" value="TextBox"/>
<Property key="DefaultSkin" value="SandText"/>
<Property key="Skin" value="SandText" group="Plugin" name="AutoSizedTextBox"/>
<Property key="Parent" value="true"/>
<Property key="Child" value="true"/>
<Parameter key="ExpandDirection" value="Align"/>
</Widget>
<Widget name="AutoSizedEditBox">
<Property key="Base" value="EditBox"/>
<Property key="DefaultSkin" value="SandText"/>
<Property key="Skin" value="SandText" group="Plugin" name="AutoSizedEditBox"/>
<Property key="Parent" value="true"/>
<Property key="Child" value="true"/>
<Parameter key="ExpandDirection" value="Align"/>
</Widget>
<Widget name="MWList">
<Property key="DefaultSkin" value="MW_SimpleList"/>
<Property key="Skin" value="MW_SimpleList" group="Plugin" name="MWList"/>
<Property key="Parent" value="true"/>
<Property key="Child" value="true"/>
<Parameter key="ListItemSkin" value="Skin"/>
</Widget>
</MyGUI>
<MyGUI type="Plugin">
<Plugin>
<Source>./Plugin_MyGUI_OpenMW_Resources</Source>
<Source build="Debug">./Plugin_MyGUI_OpenMW_Resources_d</Source>
</Plugin>
</MyGUI>
</MyGUI>

@ -1,19 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<Skin name = "TextBox" size = "16 16">
<MyGUI type="Resource" version="1.1">
<Resource type="ResourceSkin" name="TextBox" size="16 16">
<Property key="FontHeight" value = "16" />
<Property key="TextAlign" value = "ALIGN_DEFAULT" />
<Property key="TextColour" value = "0.7 0.7 0.7" />
<BasisSkin type="SimpleText" offset = "0 0 16 16" align = "ALIGN_STRETCH"/>
</Skin>
</Resource>
<Skin name = "ImageBox" size = "16 16">
<BasisSkin type="MainSkin" offset = "0 0 16 16"/>
</Skin>
<Skin name = "RotatingSkin" size = "16 16">
<Resource type="ResourceSkin" name="RotatingSkin" size="16 16">
<BasisSkin type="RotatingSkin" offset="0 0 16 16" align="Stretch"/>
</Skin>
</Resource>
<Resource type="ResourceSkin" name="ImageBox" size="16 16">
<BasisSkin type="MainSkin" offset="0 0 16 16"/>
</Resource>
</MyGUI>

@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI>
<MyGUI type="List">
<List file="OpenMWResourcePlugin.xml"/> <!-- Must be first -->
<List file="core.skin"/>
<List file="openmw_resources.xml"/>
<List file="openmw_font.xml"/>

@ -3,9 +3,9 @@
<!-- This file defines the box you see around many GUI elements, such
as around the sections of the stats window, or around popup info windows -->
<MyGUI type="Skin" version="3.2.1">
<MyGUI type="Resource" version="1.1">
<!-- Box borders -->
<Skin name="IB_T" size="512 2" texture="textures\menu_thin_border_top.dds">
<Resource type="ResourceSkin" name="IB_T" size="512 2" texture="textures\menu_thin_border_top.dds">
<BasisSkin type="TileRect" offset="0 0 512 2" align="HStretch">
<State name="normal" offset="0 0 512 2">
<Property key="TileSize" value="512 2"/>
@ -13,8 +13,8 @@ as around the sections of the stats window, or around popup info windows -->
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
<Skin name="IB_B" size="512 2" texture="textures\menu_thin_border_bottom.dds">
</Resource>
<Resource type="ResourceSkin" name="IB_B" size="512 2" texture="textures\menu_thin_border_bottom.dds">
<BasisSkin type="TileRect" offset="0 0 512 2" align="HStretch">
<State name="normal" offset="0 0 512 2">
<Property key="TileSize" value="512 2"/>
@ -22,8 +22,8 @@ as around the sections of the stats window, or around popup info windows -->
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
<Skin name="IB_L" size="2 512" texture="textures\menu_thin_border_left.dds">
</Resource>
<Resource type="ResourceSkin" name="IB_L" size="2 512" texture="textures\menu_thin_border_left.dds">
<BasisSkin type="TileRect" offset="0 0 2 512" align="VStretch">
<State name="normal" offset="0 0 2 512">
<Property key="TileSize" value="2 512"/>
@ -31,8 +31,8 @@ as around the sections of the stats window, or around popup info windows -->
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
<Skin name="IB_R" size="2 512" texture="textures\menu_thin_border_right.dds">
</Resource>
<Resource type="ResourceSkin" name="IB_R" size="2 512" texture="textures\menu_thin_border_right.dds">
<BasisSkin type="TileRect" offset="0 0 2 512" align="VStretch">
<State name="normal" offset="0 0 2 512">
<Property key="TileSize" value="2 512"/>
@ -40,30 +40,30 @@ as around the sections of the stats window, or around popup info windows -->
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
<Skin name="IB_TL" size="2 2" texture="textures\menu_thin_border_top_left_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="IB_TL" size="2 2" texture="textures\menu_thin_border_top_left_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="IB_TR" size="2 2" texture="textures\menu_thin_border_top_right_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="IB_TR" size="2 2" texture="textures\menu_thin_border_top_right_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="IB_BL" size="2 2" texture="textures\menu_thin_border_bottom_left_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="IB_BL" size="2 2" texture="textures\menu_thin_border_bottom_left_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="IB_BR" size="2 2" texture="textures\menu_thin_border_bottom_right_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="IB_BR" size="2 2" texture="textures\menu_thin_border_bottom_right_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
</Resource>
<!-- Main box definition -->
<Skin name="MW_Box" size="516 516">
<Resource type="ResourceSkin" name="MW_Box" size="516 516">
<Child type="Widget" skin="IB_T" offset="2 0 512 2" align="Top HStretch"/>
<Child type="Widget" skin="IB_B" offset="2 514 512 2" align="Bottom HStretch"/>
<Child type="Widget" skin="IB_L" offset="0 2 2 512" align="Left VStretch"/>
@ -72,10 +72,10 @@ as around the sections of the stats window, or around popup info windows -->
<Child type="Widget" skin="IB_TR" offset="514 0 2 2" align="Top Right"/>
<Child type="Widget" skin="IB_BL" offset="0 514 2 2" align="Bottom Left"/>
<Child type="Widget" skin="IB_BR" offset="514 514 2 2" align="Bottom Right"/>
</Skin>
</Resource>
<Skin name="MW_Box_Overlay" size="516 516">
<Resource type="ResourceSkin" name="MW_Box_Overlay" size="516 516">
<Property key="NeedMouse" value="false"/>
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="Stretch"/>
</Skin>
</Resource>
</MyGUI>

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<MyGUI type="Resource" version="1.1">
<!-- Button graphics -->
<Skin name="BTN_Top" size="128 4" texture="textures\menu_button_frame_top.dds">
<Resource type="ResourceSkin" name="BTN_Top" size="128 4" texture="textures\menu_button_frame_top.dds">
<BasisSkin type="TileRect" offset="0 0 128 4" align="HStretch">
<State name="normal" offset="0 0 128 4">
<Property key="TileSize" value="128 4"/>
@ -10,8 +10,8 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
<Skin name="BTN_Bottom" size="128 4" texture="textures\menu_button_frame_bottom.dds">
</Resource>
<Resource type="ResourceSkin" name="BTN_Bottom" size="128 4" texture="textures\menu_button_frame_bottom.dds">
<BasisSkin type="TileRect" offset="0 0 128 4" align="HStretch">
<State name="normal" offset="0 0 128 4">
<Property key="TileSize" value="128 4"/>
@ -19,8 +19,8 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
<Skin name="BTN_Left" size="4 16" texture="textures\menu_button_frame_left.dds">
</Resource>
<Resource type="ResourceSkin" name="BTN_Left" size="4 16" texture="textures\menu_button_frame_left.dds">
<BasisSkin type="TileRect" offset="0 0 4 16" align="VStretch">
<State name="normal" offset="0 0 4 16">
<Property key="TileSize" value="4 16"/>
@ -28,8 +28,8 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
<Skin name="BTN_Right" size="4 16" texture="textures\menu_button_frame_right.dds">
</Resource>
<Resource type="ResourceSkin" name="BTN_Right" size="4 16" texture="textures\menu_button_frame_right.dds">
<BasisSkin type="TileRect" offset="0 0 4 16" align="VStretch">
<State name="normal" offset="0 0 4 16">
<Property key="TileSize" value="4 16"/>
@ -37,30 +37,30 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
<Skin name="BTN_TopLeft" size="4 4" texture="textures\menu_button_frame_top_left_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="BTN_TopLeft" size="4 4" texture="textures\menu_button_frame_top_left_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 4 4">
<State name="normal" offset="0 0 4 4"/>
</BasisSkin>
</Skin>
<Skin name="BTN_TopRight" size="4 4" texture="textures\menu_button_frame_top_right_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="BTN_TopRight" size="4 4" texture="textures\menu_button_frame_top_right_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 4 4">
<State name="normal" offset="0 0 4 4"/>
</BasisSkin>
</Skin>
<Skin name="BTN_BottomLeft" size="4 4" texture="textures\menu_button_frame_bottom_left_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="BTN_BottomLeft" size="4 4" texture="textures\menu_button_frame_bottom_left_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 4 4">
<State name="normal" offset="0 0 4 4"/>
</BasisSkin>
</Skin>
<Skin name="BTN_BottomRight" size="4 4" texture="textures\menu_button_frame_bottom_right_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="BTN_BottomRight" size="4 4" texture="textures\menu_button_frame_bottom_right_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 4 4">
<State name="normal" offset="0 0 4 4"/>
</BasisSkin>
</Skin>
</Resource>
<!-- Button widget -->
<Skin name="MW_Button" size="136 24" version="3.2.1">
<Resource type="ResourceSkin" name="MW_Button" size="136 24" version="3.2.1">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
@ -83,5 +83,5 @@
<State name="highlighted_checked" colour="#{fontcolour=active_over}" shift="0"/>
<State name="pushed_checked" colour="#{fontcolour=active_pressed}" shift="0"/>
</BasisSkin>
</Skin>
</Resource>
</MyGUI>

@ -5,7 +5,7 @@
<!-- Label -->
<Widget type="TextBox" skin="HeaderText" position="0 0 186 18" name="LabelT" align="Left Top">
<Property key="Caption" value="Choose a Specialization"/>
<Property key="Caption" value="#{sAttributesMenu1}"/>
<Property key="TextAlign" value="HCenter Top"/>
</Widget>
@ -22,7 +22,7 @@
<!-- Dialog buttons -->
<Widget type="AutoSizedButton" skin="MW_Button" position="120 180 66 21" name="CancelButton">
<Property key="ExpandDirection" value="Left"/>
<Property key="Caption" value="Cancel"/>
<Property key="Caption" value="#{sCancel}"/>
</Widget>
</Widget>

@ -5,13 +5,13 @@
<!-- Label -->
<Widget type="TextBox" skin="HeaderText" position="0 0 447 18" name="LabelT" align="HCenter Top">
<Property key="Caption" value="Choose a Skill"/>
<Property key="Caption" value="#{sSkillsMenu1}"/>
<Property key="TextAlign" value="HCenter Top"/>
</Widget>
<!-- Combat list -->
<Widget type="TextBox" skin="HeaderText" position="0 32 154 18" name="CombatLabelT" align="Left Top">
<Property key="Caption" value="Combat"/>
<Property key="Caption" value="#{sSpecializationCombat}"/>
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="MWSkill" skin="MW_StatNameButton" position="0 50 154 18" name="CombatSkill0" align="Left Top"/>
@ -26,7 +26,7 @@
<!-- Magic list -->
<Widget type="TextBox" skin="HeaderText" position="158 32 154 18" name="MagicLabelT" align="Left Top">
<Property key="Caption" value="Magic"/>
<Property key="Caption" value="#{sSpecializationMagic}"/>
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="MWSkill" skin="MW_StatNameButton" position="158 50 154 18" name="MagicSkill0" align="Left Top"/>
@ -41,7 +41,7 @@
<!-- Stealth list -->
<Widget type="TextBox" skin="HeaderText" position="316 32 131 18" name="StealthLabelT" align="Left Top">
<Property key="Caption" value="Stealth"/>
<Property key="Caption" value="#{sSpecializationStealth}"/>
<Property key="TextAlign" value="Left Top"/>
</Widget>
<Widget type="MWSkill" skin="MW_StatNameButton" position="316 50 131 18" name="StealthSkill0" align="Left Top"/>
@ -57,7 +57,7 @@
<!-- Dialog buttons -->
<Widget type="AutoSizedButton" skin="MW_Button" position="381 218 66 21" name="CancelButton">
<Property key="ExpandDirection" value="Left"/>
<Property key="Caption" value="Cancel"/>
<Property key="Caption" value="#{sCancel}"/>
</Widget>
</Widget>

@ -6,7 +6,7 @@
<!-- Label -->
<Widget type="TextBox" skin="HeaderText" position="0 0 216 18" name="LabelT" align="Left Top">
<Property key="Caption" value="Choose a Specialization"/>
<Property key="Caption" value="#{sSpecializationMenu1}"/>
<Property key="TextAlign" value="Left Top"/>
</Widget>
@ -24,7 +24,7 @@
<!-- Dialog buttons -->
<Widget type="AutoSizedButton" skin="MW_Button" position="150 90 66 21" name="CancelButton">
<Property key="ExpandDirection" value="Left"/>
<Property key="Caption" value="Cancel"/>
<Property key="Caption" value="#{sCancel}"/>
</Widget>
</Widget>

@ -1,20 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<MyGUI type="Resource" version="1.1">
<!-- Console Input -->
<Skin name="MW_EditClient" size="10 10">
<Resource type="ResourceSkin" name="MW_EditClient" size="10 10">
<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>
</Resource>
<Skin name="MW_ConsoleCommand" size="29 28">
<Resource type="ResourceSkin" name="MW_ConsoleCommand" size="29 28">
<Child type="Widget" skin="MW_Box" offset="0 0 29 26" align="Bottom Stretch"/>
<Child type="TextBox" skin="MW_EditClient" offset="4 2 19 22" align="Bottom Stretch" name="Client"/>
</Skin>
</Resource>
</MyGUI>

@ -1,37 +1,30 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Dialog" layer="Windows" position="0 0 600 128" name="_Main">
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout" version="3.2.0">
<Widget type="Window" skin="MW_Dialog" position="0 0 600 128" layer="Windows" name="_Main">
<Property key="Visible" value="false"/>
<Widget type="TextBox" skin="SandText" position="4 4 592 24" name="LabelText" align="Left Top HStretch">
<Widget type="TextBox" skin="SandText" position="4 4 592 24" align="Left Top HStretch" name="LabelText">
<Property key="TextAlign" value="Center"/>
</Widget>
<Widget type="TextBox" skin="SandText" position="4 30 507 24" name="ItemText" align="Left Top HStretch">
<Widget type="TextBox" skin="SandText" position="4 30 521 24" align="Left Top HStretch" name="ItemText">
<Property key="TextAlign" value="Right"/>
</Widget>
<Widget type="EditBox" skin="MW_TextEdit" position="520 30 52 24" name="ItemEdit" align="Right Top">
<Widget type="NumericEditBox" skin="MW_TextEdit" position="535 30 50 24" align="Right Top" name="ItemEdit">
<Property key="TextAlign" value="Center"/>
</Widget>
<Widget type="MWScrollBar" skin="MW_HScroll" position="28 60 544 18" name="CountSlider" align="Left Top HStretch">
<Widget type="MWScrollBar" skin="MW_HScroll" position="7 61 578 18" align="Left Top HStretch" name="CountSlider">
<Property key="MoveToClick" value="true"/>
</Widget>
<Widget type="HBox" position="0 86 572 24" align="Right Bottom">
<Widget type="Widget">
<Widget type="HBox" skin="" position="0 88 585 24" align="Right Bottom">
<Widget type="Widget" skin="" position="0 12 0 0">
<UserString key="HStretch" value="true"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" position="417 90 60 24" name="CancelButton" align="Right Top">
<Property key="Caption" value="#{sCancel}"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" position="512 90 60 24" name="OkButton" align="Right Top">
<Widget type="AutoSizedButton" skin="MW_Button" position="4 0 53 24" align="Right Top" name="OkButton">
<Property key="Caption" value="#{sOk}"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" position="61 0 78 24" align="Right Top" name="CancelButton">
<Property key="Caption" value="#{sCancel}"/>
</Widget>
</Widget>
</Widget>
<CodeGeneratorSettings/>
</MyGUI>

@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<MyGUI type="Resource" version="1.1">
<Skin name="MW_DispositionEdit" size="0 0 50 50">
<Resource type="ResourceSkin" name="MW_DispositionEdit" size="0 0 50 50">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
<Property key="Static" value="1"/>
<Property key="WordWrap" value="true"/>
<Property key="TextShadow" value="true"/>
<Child type="TextBox" skin="SandText" offset="0 0 0 -4" align="Stretch" name="Client"/>
</Skin>
</Resource>
</MyGUI>

@ -1,17 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<MyGUI type="Resource" version="1.1">
<!-- Text edit widget -->
<Skin name="MW_TextEditClient" size="10 10">
<Resource type="ResourceSkin" name="MW_TextEditClient" size="10 10">
<Property key="TextColour" value="#{fontcolour=normal}"/>
<BasisSkin type="EditText" offset="0 0 10 10" align="Stretch"/>
</Skin>
</Resource>
<Skin name="MW_TextEdit" size="512 20">
<Resource type="ResourceSkin" name="MW_TextEdit" size="512 20">
<!-- Borders -->
@ -25,9 +25,9 @@
<Child type="TextBox" skin="MW_TextEditClient" offset="4 1 502 18" align="Stretch" name="Client"/>
</Skin>
</Resource>
<Skin name="MW_TextBoxEdit" size="512 20">
<Resource type="ResourceSkin" name="MW_TextBoxEdit" size="512 20">
<Property key="FontName" value="Default"/>
@ -39,9 +39,9 @@
<Child type="MWScrollBar" skin="MW_VScroll" offset="494 3 14 14" align="Right VStretch" name="VScroll"/>
</Skin>
</Resource>
<Skin name="MW_TextBoxEditWithBorder" size="512 20">
<Resource type="ResourceSkin" name="MW_TextBoxEditWithBorder" size="512 20">
<!-- Borders -->
<Child type="Widget" skin="MW_Box" offset="0 0 512 20" align="Stretch"/>
@ -56,6 +56,6 @@
<Child type="MWScrollBar" skin="MW_VScroll" offset="494 3 14 14" align="Right VStretch" name="VScroll"/>
</Skin>
</Resource>
</MyGUI>

@ -22,12 +22,12 @@
<Widget type="AutoSizedButton" skin="MW_Button" name="DeleteButton">
<Property key="Caption" value="#{sDelete}"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" name="CancelButton">
<Property key="Caption" value="#{sCancel}"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" name="OkButton">
<Property key="Caption" value="#{sOk}"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" name="CancelButton">
<Property key="Caption" value="#{sCancel}"/>
</Widget>
</Widget>
</Widget>

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<MyGUI type="Resource" version="1.1">
<!-- The 'box' frame that surrounds various HUD items and other elements -->
<Skin name="HUD_Box" size="40 40">
<Resource type="ResourceSkin" name="HUD_Box" size="40 40">
<!-- Borders -->
@ -14,13 +14,13 @@
<Child type="Widget" skin="BlackBG" offset="2 2 36 36" align="Stretch" name="Client"/>
</Skin>
</Resource>
<Skin name="HUD_Box_Transparent" size="40 40">
<Resource type="ResourceSkin" name="HUD_Box_Transparent" size="40 40">
<Child type="Widget" skin="MW_Box" offset="0 0 40 40" align="Left Stretch" name="Client"/>
</Skin>
</Resource>
<Skin name="HUD_Box_NoTransp" size="40 40">
<Resource type="ResourceSkin" name="HUD_Box_NoTransp" size="40 40">
<!-- Borders -->
@ -30,6 +30,6 @@
<Child type="Widget" skin="DialogBG" offset="2 2 36 36" align="Stretch" name="Client"/>
</Skin>
</Resource>
</MyGUI>

@ -1,109 +1,109 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<MyGUI type="Resource" version="1.1">
<!-- Energy bar frame graphics -->
<Skin name="HUD_Bar_Top" size="64 2" texture="textures\menu_small_energy_bar_top.dds">
<Resource type="ResourceSkin" name="HUD_Bar_Top" size="64 2" texture="textures\menu_small_energy_bar_top.dds">
<BasisSkin type="MainSkin" offset="0 0 64 2">
<State name="normal" offset="0 0 64 2"/>
</BasisSkin>
</Skin>
<Skin name="HUD_Bar_Bottom" size="64 2" texture="textures\menu_small_energy_bar_bottom.dds">
</Resource>
<Resource type="ResourceSkin" name="HUD_Bar_Bottom" size="64 2" texture="textures\menu_small_energy_bar_bottom.dds">
<BasisSkin type="MainSkin" offset="0 0 64 2">
<State name="normal" offset="0 0 64 2"/>
</BasisSkin>
</Skin>
<Skin name="HUD_Bar_Side" size="2 8" texture="textures\menu_small_energy_bar_vert.dds">
</Resource>
<Resource type="ResourceSkin" name="HUD_Bar_Side" size="2 8" texture="textures\menu_small_energy_bar_vert.dds">
<BasisSkin type="MainSkin" offset="0 0 2 8">
<State name="normal" offset="0 0 2 8"/>
</BasisSkin>
</Skin>
</Resource>
<!-- Progress bar track, various colors -->
<Skin name="MW_BarTrack_Red" size="4 8" texture="textures\menu_bar_gray.dds" >
<Resource type="ResourceSkin" name="MW_BarTrack_Red" size="4 8" texture="textures\menu_bar_gray.dds" >
<Property key="Colour" value="#{fontcolour=health}"/>
<BasisSkin type="MainSkin" offset="0 0 16 8" align="Stretch">
<State name="normal" offset="0 0 16 8"/>
</BasisSkin>
</Skin>
<Skin name="MW_BarTrack_Green" size="4 8" texture="textures\menu_bar_gray.dds" >
</Resource>
<Resource type="ResourceSkin" name="MW_BarTrack_Green" size="4 8" texture="textures\menu_bar_gray.dds" >
<Property key="Colour" value="#{fontcolour=fatigue}"/>
<BasisSkin type="MainSkin" offset="0 0 16 8" align="Stretch">
<State name="normal" offset="0 0 16 8"/>
</BasisSkin>
</Skin>
<Skin name="MW_BarTrack_Blue" size="4 8" texture="textures\menu_bar_gray.dds" >
</Resource>
<Resource type="ResourceSkin" name="MW_BarTrack_Blue" size="4 8" texture="textures\menu_bar_gray.dds" >
<Property key="Colour" value="#{fontcolour=magic}"/>
<BasisSkin type="MainSkin" offset="0 0 16 8" align="Stretch">
<State name="normal" offset="0 0 16 8"/>
</BasisSkin>
</Skin>
<Skin name="MW_BarTrack_Yellow" size="4 8" texture="textures\menu_bar_gray.dds" >
</Resource>
<Resource type="ResourceSkin" name="MW_BarTrack_Yellow" size="4 8" texture="textures\menu_bar_gray.dds" >
<Property key="Colour" value="1 1 0"/>
<BasisSkin type="MainSkin" offset="0 0 16 8" align="Stretch">
<State name="normal" offset="0 0 16 8"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="MW_BarTrack_Magic" size="4 8" texture="textures\menu_bar_gray.dds" >
<Resource type="ResourceSkin" name="MW_BarTrack_Magic" size="4 8" texture="textures\menu_bar_gray.dds" >
<Property key="Colour" value="#{fontcolour=magic_fill}"/>
<BasisSkin type="MainSkin" offset="0 0 16 8" align="Stretch">
<State name="normal" offset="0 0 16 8"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="MW_BarTrack_Weapon" size="4 8" texture="textures\menu_bar_gray.dds" >
<Resource type="ResourceSkin" name="MW_BarTrack_Weapon" size="4 8" texture="textures\menu_bar_gray.dds" >
<Property key="Colour" value="#{fontcolour=weapon_fill}"/>
<BasisSkin type="MainSkin" offset="0 0 16 8" align="Stretch">
<State name="normal" offset="0 0 16 8"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="MW_EnergyBar_Magic" size="64 12">
<Resource type="ResourceSkin" name="MW_EnergyBar_Magic" size="64 12">
<Property key="TrackSkin" value="MW_BarTrack_Magic"/>
<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_Weapon" size="64 12">
</Resource>
<Resource type="ResourceSkin" name="MW_EnergyBar_Weapon" size="64 12">
<Property key="TrackSkin" value="MW_BarTrack_Weapon"/>
<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>
</Resource>
<Skin name="MW_EnergyBar_Red" size="64 12">
<Resource type="ResourceSkin" name="MW_EnergyBar_Red" size="64 12">
<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>
</Resource>
<Skin name="MW_EnergyBar_Green" size="64 12">
<Resource type="ResourceSkin" name="MW_EnergyBar_Green" size="64 12">
<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>
</Resource>
<Skin name="MW_EnergyBar_Blue" size="64 12">
<Resource type="ResourceSkin" name="MW_EnergyBar_Blue" size="64 12">
<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>
</Resource>
<Skin name="MW_EnergyBar_Yellow" size="64 12">
<Resource type="ResourceSkin" name="MW_EnergyBar_Yellow" size="64 12">
<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"/>
</Skin>
</Resource>
</MyGUI>

@ -1,26 +1,26 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<Skin name="MW_BookClient" size="10 10">
<MyGUI type="Resource" version="1.1">
<Resource type="ResourceSkin" name="MW_BookClient" size="10 10">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Top"/>
<Property key="TextColour" value="0 0 0"/>
<BasisSkin type="EditText" offset="0 0 10 10" align="Stretch"/>
</Skin>
</Resource>
<Skin name="MW_BookPage" size="0 0 50 50">
<Resource type="ResourceSkin" name="MW_BookPage" size="0 0 50 50">
<BasisSkin type="PageDisplay"/>
</Skin>
</Resource>
<Skin name="MW_QuestList" size="516 516" align="Left Top">
<Resource type="ResourceSkin" name="MW_QuestList" size="516 516" align="Left Top">
<Property key="ListItemSkin" value="MW_QuestLink"/>
<Child type="Widget" skin="" offset="3 3 510 510" align="Top Left Stretch" name="Client"/>
</Skin>
</Resource>
<Skin name="MW_QuestLink" size="5 5">
<Resource type="ResourceSkin" name="MW_QuestLink" size="5 5">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left VCenter"/>
@ -32,5 +32,5 @@
<State name="highlighted_checked" colour="#{fontcolour=journal_topic_pressed}" shift="0"/>
<State name="pushed_checked" colour="#{fontcolour=journal_topic_pressed}" shift="0"/>
</BasisSkin>
</Skin>
</Resource>
</MyGUI>

@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<MyGUI type="Resource" version="1.1">
<!-- Horizontal Scrollbar -->
<Skin name="MW_HScroll" size="90 14">
<Resource type="ResourceSkin" name="MW_HScroll" size="90 14">
<Property key="TrackRangeMargins" value="20 19"/>
<Property key="MinTrackSize" value="14"/>
<Property key="VerticalAlignment" value="false"/>
@ -32,9 +32,9 @@
<Child type="Button" skin="MW_ScrollEmptyPart" offset="52 0 24 14" align="Top HStretch" name="SecondPart"/>
<Child type="Button" skin="MW_ScrollTrackH" offset="38 2 30 9" align="Left VStretch" name="Track"/>
</Skin>
</Resource>
<Skin name="MW_ScrollTrackH" size="16 16" texture="textures\tx_menubook_bookmark.dds">
<Resource type="ResourceSkin" name="MW_ScrollTrackH" size="16 16" texture="textures\tx_menubook_bookmark.dds">
<BasisSkin type="TileRect" offset="0 0 16 16" align="Stretch">
<State name="normal" offset="70 22 16 16">
<Property key="TileSize" value="16 16"/>
@ -42,11 +42,11 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
</Resource>
<!-- Vertical Scrollbar -->
<Skin name="MW_VScroll" size="14 90">
<Resource type="ResourceSkin" name="MW_VScroll" size="14 90">
<Property key="TrackRangeMargins" value="20 19"/>
<Property key="MinTrackSize" value="14"/>
<Property key="MoveToClick" value="true"/>
@ -76,9 +76,9 @@
<Child type="Button" skin="MW_ScrollTrackV" offset="2 40 9 30" align="Top HStretch" name="Track"/>
</Skin>
</Resource>
<Skin name="MW_ScrollTrackV" size="16 16" texture="textures\tx_menubook_bookmark.dds">
<Resource type="ResourceSkin" name="MW_ScrollTrackV" size="16 16" texture="textures\tx_menubook_bookmark.dds">
<Property key="MinTrackSize" value="14"/>
<BasisSkin type="TileRect" offset="0 0 16 16" align="Stretch">
<State name="normal" offset="68 19 16 16">
@ -87,26 +87,26 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
</Resource>
<!-- Empty space in scrollbar -->
<Skin name="MW_ScrollEmptyPart" size="16 16" >
</Skin>
<Resource type="ResourceSkin" name="MW_ScrollEmptyPart" size="16 16" >
</Resource>
<!-- Header text -->
<Skin name="HeaderText" size="16 16">
<Resource type="ResourceSkin" name="HeaderText" size="16 16">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
<Property key="TextColour" value="#{fontcolour=header}"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
</Resource>
<!-- list skin -->
<Skin name="MW_ListLine" size="5 5">
<Resource type="ResourceSkin" name="MW_ListLine" size="5 5">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left VCenter"/>
@ -120,9 +120,9 @@
<State name="highlighted_checked" colour="#{fontcolour=active_over}" shift="0"/>
<State name="pushed_checked" colour="#{fontcolour=active_pressed}" shift="0"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="MW_List" size="516 516" align="Left Top">
<Resource type="ResourceSkin" 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"/>
@ -133,9 +133,9 @@
<Child type="Widget" skin="" offset="3 3 493 509" align="Stretch" name="Client"/>
</Skin>
</Resource>
<Skin name="MW_PopupList" size="516 516" align="Left Top">
<Resource type="ResourceSkin" name="MW_PopupList" size="516 516" align="Left Top">
<Property key="NeedKey" value="true"/>
<Property key="SkinLine" value="MW_ListLine"/>
<Property key="HeightLine" value="20"/>
@ -146,58 +146,58 @@
<Child type="MWScrollBar" skin="MW_VScroll" offset="498 3 14 509" align="Right VStretch" name="VScroll"/>
<Child type="Widget" skin="" offset="3 3 493 509" align="Stretch" name="Client"/>
</Skin>
</Resource>
<Skin name="MW_ItemView" size="516 516" align="Left Top">
<Resource type="ResourceSkin" name="MW_ItemView" size="516 516" align="Left Top">
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="Stretch"/>
<Child type="ScrollView" skin="MW_ScrollViewH" offset="3 3 509 509" align="Stretch" name="ScrollView">
<Property key="CanvasAlign" value="Left Top"/>
<Property key="NeedMouse" value="true"/>
</Child>
</Skin>
</Resource>
<Skin name="MW_SimpleList" size="516 516" align="Left Top">
<Resource type="ResourceSkin" name="MW_SimpleList" size="516 516" align="Left Top">
<Property key="ListItemSkin" value="MW_ListLine"/>
<Child type="Widget" skin="MW_Box" offset="0 0 516 516" align="Stretch"/>
<Child type="Widget" skin="" offset="3 3 510 510" align="Top Left Stretch" name="Client"/>
</Skin>
</Resource>
<!-- Horizontal line -->
<Skin name="MW_HLine" size="512 10" texture="textures\menu_thin_border_top.dds">
<Resource type="ResourceSkin" 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>
</Skin>
</Resource>
<!-- Arrows -->
<Skin name="MW_ArrowLeft" size="20 20" texture="textures\menu_scroll_left.dds">
<Resource type="ResourceSkin" name="MW_ArrowLeft" size="20 20" texture="textures\menu_scroll_left.dds">
<BasisSkin type="SubSkin" offset="0 0 19 20" align="Stretch">
<State name="normal" offset="0 0 19 20"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="MW_ArrowRight" size="20 20" texture="textures\menu_scroll_right.dds">
<Resource type="ResourceSkin" name="MW_ArrowRight" size="20 20" texture="textures\menu_scroll_right.dds">
<BasisSkin type="SubSkin" offset="1 0 19 20" align="Stretch">
<State name="normal" offset="1 0 19 20"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="MW_ArrowUp" size="20 20" texture="textures\menu_scroll_up.dds">
<Resource type="ResourceSkin" name="MW_ArrowUp" size="20 20" texture="textures\menu_scroll_up.dds">
<BasisSkin type="SubSkin" offset="0 0 20 19" align="Stretch">
<State name="normal" offset="0 0 20 19"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="MW_ArrowDown" size="20 20" texture="textures\menu_scroll_down.dds">
<Resource type="ResourceSkin" name="MW_ArrowDown" size="20 20" texture="textures\menu_scroll_down.dds">
<BasisSkin type="SubSkin" offset="0 1 20 20" align="Stretch">
<State name="normal" offset="0 1 20 20"/>
</BasisSkin>
</Skin>
</Resource>
</MyGUI>

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<MyGUI type="Resource" version="1.1">
</MyGUI>

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<Skin name="MW_MapView" size="516 516">
<MyGUI type="Resource" version="1.1">
<Resource type="ResourceSkin" name="MW_MapView" size="516 516">
<Child type="Widget" skin="" offset="0 0 516 516" align="Stretch" name="Client"/>
<!-- invisible scroll bars, needed for setting the view offset -->
<Child type="MWScrollBar" skin="" offset="0 0 0 0" align="Default" name="VScroll"/>
<Child type="MWScrollBar" skin="" offset="0 0 0 0" align="Default" name="HScroll"/>
</Skin>
</Resource>
</MyGUI>

@ -1,94 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<MyGUI type="Resource" version="1.1">
<!-- Progress bar track, various colors -->
<Skin name="MW_Track_Red" size="16 16" texture="textures\menu_bar_gray.dds" >
<Resource type="ResourceSkin" name="MW_Track_Red" size="16 16" texture="textures\menu_bar_gray.dds" >
<Property key="Colour" value="#{fontcolour=health}"/>
<BasisSkin type="MainSkin" offset="0 0 16 16" align="Stretch">
<State name="normal" offset="0 0 16 16"/>
</BasisSkin>
</Skin>
<Skin name="MW_Track_Blue" size="2 14" texture="textures\menu_bar_gray.dds" >
</Resource>
<Resource type="ResourceSkin" name="MW_Track_Blue" size="2 14" texture="textures\menu_bar_gray.dds" >
<Property key="Colour" value="#{fontcolour=magic}"/>
<BasisSkin type="MainSkin" offset="0 0 16 16" align="Stretch">
<State name="normal" offset="0 0 16 16"/>
</BasisSkin>
</Skin>
<Skin name="MW_Track_Green" size="2 14" texture="textures\menu_bar_gray.dds" >
</Resource>
<Resource type="ResourceSkin" name="MW_Track_Green" size="2 14" texture="textures\menu_bar_gray.dds" >
<Property key="Colour" value="#{fontcolour=fatigue}"/>
<BasisSkin type="MainSkin" offset="0 0 16 16" align="Stretch">
<State name="normal" offset="0 0 16 16"/>
</BasisSkin>
</Skin>
</Resource>
<!-- Lighter variants (only uses top half of the gradient) -->
<Skin name="MW_BigTrack_Progress_Red_Small" size="16 8" texture="textures\menu_bar_gray.dds" >
<Resource type="ResourceSkin" name="MW_BigTrack_Progress_Red_Small" size="16 8" texture="textures\menu_bar_gray.dds" >
<Property key="Colour" value="1 0 0"/>
<BasisSkin type="MainSkin" offset="0 0 16 8" align="Stretch">
<State name="normal" offset="0 0 16 8"/>
</BasisSkin>
</Skin>
<Skin name="MW_BigTrack_Progress_Blue_Small" size="16 8" texture="textures\menu_bar_gray.dds" >
</Resource>
<Resource type="ResourceSkin" name="MW_BigTrack_Progress_Blue_Small" size="16 8" texture="textures\menu_bar_gray.dds" >
<Property key="Colour" value="0.3 0.3 1"/>
<BasisSkin type="MainSkin" offset="0 0 16 8" align="Stretch">
<State name="normal" offset="0 0 16 8"/>
</BasisSkin>
</Skin>
<Skin name="MW_BigTrack_Progress_Green_Small" size="16 8" texture="textures\menu_bar_gray.dds" >
</Resource>
<Resource type="ResourceSkin" name="MW_BigTrack_Progress_Green_Small" size="16 8" texture="textures\menu_bar_gray.dds" >
<Property key="Colour" value="0.298 0.784 0.780"/>
<BasisSkin type="MainSkin" offset="0 0 16 8" align="Stretch">
<State name="normal" offset="0 0 16 8"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="ProgressText" size="16 16">
<Resource type="ResourceSkin" name="ProgressText" size="16 16">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Top HCenter"/>
<Property key="TextColour" value="#{fontcolour=normal}"/>
<Property key="TextShadow" value="true"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch"/>
</Skin>
</Resource>
<!-- Main energy bar widget definitions. There's one for each color.-->
<Skin name="MW_Progress_Red" size="64 12">
<Resource type="ResourceSkin" name="MW_Progress_Red" size="64 12">
<Property key="TrackSkin" value="MW_Track_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>
</Resource>
<Skin name="MW_Progress_Green" size="64 12">
<Resource type="ResourceSkin" name="MW_Progress_Green" size="64 12">
<Property key="TrackSkin" value="MW_Track_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>
</Resource>
<Skin name="MW_Progress_Blue" size="64 12">
<Resource type="ResourceSkin" name="MW_Progress_Blue" size="64 12">
<Property key="TrackSkin" value="MW_Track_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>
</Resource>
<Skin name="MW_Progress_LightBlue" size="64 6">
<Resource type="ResourceSkin" name="MW_Progress_LightBlue" 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>
</Resource>
<Skin name="MW_Progress_Drowning" size="64 6">
<Resource type="ResourceSkin" name="MW_Progress_Drowning" size="64 6">
<Child type="Widget" skin="MW_BigTrack_Progress_Red_Small" offset="0 0 64 6" align="Stretch"/>
</Skin>
</Resource>
<Skin name="MW_ProgressScroll_Loading" size="64 6">
<Resource type="ResourceSkin" name="MW_ProgressScroll_Loading" size="64 6">
<Property key="TrackWidth" value="1"/>
<Property key="TrackRangeMargins" value="0 0"/>
<Property key="MinTrackSize" value="1"/>
@ -99,5 +99,5 @@
<Child type="Button" skin="MW_BigTrack_Progress_Green_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>
</Resource>
</MyGUI>

@ -65,13 +65,12 @@
<UserString key="VStretch" value="true"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" name="CancelButton">
<Property key="Caption" value="#{sCancel}"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" name="OkButton">
<Property key="Caption" value="#{sOk}"/>
</Widget>
<Widget type="AutoSizedButton" skin="MW_Button" name="CancelButton">
<Property key="Caption" value="#{sCancel}"/>
</Widget>
</Widget>

@ -1,15 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<MyGUI type="Resource" version="1.1">
<Skin name="MW_ScrollView" size="516 516">
<Resource type="ResourceSkin" name="MW_ScrollView" size="516 516">
<Child type="Widget" skin="" offset="0 0 502 516" align="Stretch" name="Client"/>
<Child type="MWScrollBar" skin="MW_VScroll" offset="498 3 14 509" align="Right Top VStretch" name="VScroll"/>
</Skin>
</Resource>
<Skin name="MW_ScrollViewH" size="516 516">
<Resource type="ResourceSkin" name="MW_ScrollViewH" size="516 516">
<Child type="Widget" skin="" offset="0 0 516 502" align="Stretch" name="Client"/>
<Child type="MWScrollBar" skin="MW_HScroll" offset="3 498 509 14" align="Left Bottom HStretch" name="HScroll"/>
</Skin>
</Resource>
</MyGUI>

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<MyGUI type="Resource" version="1.1">
<!--
@ -10,38 +10,38 @@ color_misc=0,205,205 # ????
-->
<Skin name="NormalText" size="16 16">
<Resource type="ResourceSkin" name="NormalText" size="16 16">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Bottom"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<State name="normal" colour="#{fontcolour=header}" shift="0"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="NumFPS" size="16 16">
<Resource type="ResourceSkin" name="NumFPS" size="16 16">
<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>
</Resource>
<Skin name="SandText" size="16 16">
<Resource type="ResourceSkin" name="SandText" size="16 16">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Bottom"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<State name="normal" colour="#{fontcolour=normal}" shift="0"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="SandTextVCenter" size="16 16">
<Resource type="ResourceSkin" name="SandTextVCenter" size="16 16">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left VCenter"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<State name="normal" colour="#{fontcolour=normal}" shift="0"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="SandTextRight" size="16 16">
<Resource type="ResourceSkin" 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">
@ -49,28 +49,28 @@ color_misc=0,205,205 # ????
<State name="increased" colour="#{fontcolour=positive}"/>
<State name="decreased" colour="#{fontcolour=negative}"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="SandBrightText" size="16 16">
<Resource type="ResourceSkin" name="SandBrightText" size="16 16">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Left Bottom"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<State name="normal" colour="#{fontcolour=header}" shift="0"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="CountText" size="16 16">
<Resource type="ResourceSkin" name="CountText" size="16 16">
<Property key="FontName" value="Default"/>
<BasisSkin type="SimpleText" offset="0 0 16 16" align="Stretch">
<State name="normal" colour="#{fontcolour=count}" shift="0"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="MW_StatNameC" size="200 18">
<Resource type="ResourceSkin" name="MW_StatNameC" size="200 18">
<Child type="TextBoxC" skin="SandText" offset="0 0 200 18" align="Left HStretch" name="StatName"/>
</Skin>
</Resource>
<Skin name="SandTextButtonC" size="16 16">
<Resource type="ResourceSkin" 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">
@ -83,9 +83,9 @@ color_misc=0,205,205 # ????
<State name="highlighted_checked" colour="#{fontcolour=active_over}" shift="0"/>
<State name="pushed_checked" colour="#{fontcolour=active_pressed}" shift="0"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="SandTextButton" size="16 16">
<Resource type="ResourceSkin" 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">
@ -98,9 +98,9 @@ color_misc=0,205,205 # ????
<State name="highlighted_checked" colour="#{fontcolour=active_over}" shift="0"/>
<State name="pushed_checked" colour="#{fontcolour=active_pressed}" shift="0"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="SpellTextUnequipped" size="16 16">
<Resource type="ResourceSkin" 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">
@ -113,49 +113,49 @@ color_misc=0,205,205 # ????
<State name="highlighted_checked" colour="#{fontcolour=active_over}" shift="0"/>
<State name="pushed_checked" colour="#{fontcolour=active_pressed}" shift="0"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="MW_StatNameButtonC" size="200 18">
<Resource type="ResourceSkin" name="MW_StatNameButtonC" size="200 18">
<Child type="Button" skin="SandTextButtonC" offset="0 0 200 18" align="Left HStretch" name="StatNameButton"/>
</Skin>
</Resource>
<Skin name="MW_StatNameValueButton" size="200 18">
<Resource type="ResourceSkin" 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"/>
</Skin>
</Resource>
<Skin name="MW_EffectImage" size="200 24">
<Resource type="ResourceSkin" 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"/>
</Skin>
</Resource>
<Skin name="MW_ChargeBar" size="204 18">
<Resource type="ResourceSkin" 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="ProgressText" offset="0 0 204 18" align="Right Top Stretch" name="BarText"/>
</Skin>
</Resource>
<Skin name="MW_ChargeBar_Blue" size="204 18">
<Resource type="ResourceSkin" 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="ProgressText" offset="0 2 204 18" align="Right Top Stretch" name="BarText"/>
</Skin>
</Resource>
<Skin name="MW_DynamicStat_Red" size="204 18">
<Resource type="ResourceSkin" 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="ProgressText" offset="74 0 130 18" align="Right Top" name="BarText"/>
</Skin>
</Resource>
<Skin name="MW_DynamicStat_Blue" size="204 18">
<Resource type="ResourceSkin" 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="ProgressText" offset="74 0 130 18" align="Right Top" name="BarText"/>
</Skin>
</Resource>
<Skin name="MW_DynamicStat_Green" size="204 18">
<Resource type="ResourceSkin" 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="ProgressText" offset="74 0 130 18" align="Right Top" name="BarText"/>
</Skin>
</Resource>
</MyGUI>

@ -44,7 +44,7 @@
</Widget>
<Widget type="TextBox" skin="SandText" position="48 0 140 24" name="TotalBalanceLabel" align="Left Top "/>
<Widget type="EditBox" skin="MW_TextEdit" position="48 28 140 24" name="TotalBalance" align="Left Top">
<Widget type="NumericEditBox" skin="MW_TextEdit" position="48 28 140 24" name="TotalBalance" align="Left Top">
<Property key="TextAlign" value="Center"/>
</Widget>

@ -1,100 +1,100 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Skin" version="3.2.1">
<MyGUI type="Resource" version="1.1">
<!-- Defines a transparent background -->
<Skin name="BlackBG" size="8 8" texture="transparent.png">
<Resource type="ResourceSkin" name="BlackBG" size="8 8" texture="transparent.png">
<Property key="Colour" value="#{fontcolour=background}"/>
<BasisSkin type="MainSkin" offset="0 0 8 8">
<State name="normal" offset="0 0 8 8"/>
</BasisSkin>
</Skin>
</Resource>
<!-- Define the borders for pin button (up) -->
<Skin name="PU_B" size="12 2" texture="textures\menu_rightbuttonup_bottom.dds">
<Resource type="ResourceSkin" name="PU_B" size="12 2" texture="textures\menu_rightbuttonup_bottom.dds">
<BasisSkin type="MainSkin" offset="0 0 12 2">
<State name="normal" offset="0 0 12 2"/>
</BasisSkin>
</Skin>
<Skin name="PU_BR" size="2 2" texture="textures\menu_rightbuttonup_bottom_right.dds">
</Resource>
<Resource type="ResourceSkin" name="PU_BR" size="2 2" texture="textures\menu_rightbuttonup_bottom_right.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="PU_R" size="2 12" texture="textures\menu_rightbuttonup_right.dds">
</Resource>
<Resource type="ResourceSkin" name="PU_R" size="2 12" texture="textures\menu_rightbuttonup_right.dds">
<BasisSkin type="MainSkin" offset="0 0 2 12">
<State name="normal" offset="0 0 2 12"/>
</BasisSkin>
</Skin>
<Skin name="PU_TR" size="2 2" texture="textures\menu_rightbuttonup_top_right.dds">
</Resource>
<Resource type="ResourceSkin" name="PU_TR" size="2 2" texture="textures\menu_rightbuttonup_top_right.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="PU_T" size="12 2" texture="textures\menu_rightbuttonup_top.dds">
</Resource>
<Resource type="ResourceSkin" name="PU_T" size="12 2" texture="textures\menu_rightbuttonup_top.dds">
<BasisSkin type="MainSkin" offset="0 0 12 2">
<State name="normal" offset="0 0 12 2"/>
</BasisSkin>
</Skin>
<Skin name="PU_TL" size="2 2" texture="textures\menu_rightbuttonup_top_left.dds">
</Resource>
<Resource type="ResourceSkin" name="PU_TL" size="2 2" texture="textures\menu_rightbuttonup_top_left.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="PU_L" size="2 12" texture="textures\menu_rightbuttonup_left.dds">
</Resource>
<Resource type="ResourceSkin" name="PU_L" size="2 12" texture="textures\menu_rightbuttonup_left.dds">
<BasisSkin type="MainSkin" offset="0 0 2 12">
<State name="normal" offset="0 0 2 12"/>
</BasisSkin>
</Skin>
<Skin name="PU_BL" size="2 2" texture="textures\menu_rightbuttonup_bottom_left.dds">
</Resource>
<Resource type="ResourceSkin" name="PU_BL" size="2 2" texture="textures\menu_rightbuttonup_bottom_left.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
</Resource>
<!-- Define the borders for pin button (down) -->
<Skin name="PD_B" size="12 2" texture="textures\menu_rightbuttondown_bottom.dds">
<Resource type="ResourceSkin" name="PD_B" size="12 2" texture="textures\menu_rightbuttondown_bottom.dds">
<BasisSkin type="MainSkin" offset="0 0 12 2">
<State name="normal" offset="0 0 12 2"/>
</BasisSkin>
</Skin>
<Skin name="PD_BR" size="2 2" texture="textures\menu_rightbuttondown_bottom_right.dds">
</Resource>
<Resource type="ResourceSkin" name="PD_BR" size="2 2" texture="textures\menu_rightbuttondown_bottom_right.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="PD_R" size="2 12" texture="textures\menu_rightbuttondown_right.dds">
</Resource>
<Resource type="ResourceSkin" name="PD_R" size="2 12" texture="textures\menu_rightbuttondown_right.dds">
<BasisSkin type="MainSkin" offset="0 0 2 12">
<State name="normal" offset="0 0 2 12"/>
</BasisSkin>
</Skin>
<Skin name="PD_TR" size="2 2" texture="textures\menu_rightbuttondown_top_right.dds">
</Resource>
<Resource type="ResourceSkin" name="PD_TR" size="2 2" texture="textures\menu_rightbuttondown_top_right.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="PD_T" size="12 2" texture="textures\menu_rightbuttondown_top.dds">
</Resource>
<Resource type="ResourceSkin" name="PD_T" size="12 2" texture="textures\menu_rightbuttondown_top.dds">
<BasisSkin type="MainSkin" offset="0 0 12 2">
<State name="normal" offset="0 0 12 2"/>
</BasisSkin>
</Skin>
<Skin name="PD_TL" size="2 2" texture="textures\menu_rightbuttondown_top_left.dds">
</Resource>
<Resource type="ResourceSkin" name="PD_TL" size="2 2" texture="textures\menu_rightbuttondown_top_left.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="PD_L" size="2 12" texture="textures\menu_rightbuttondown_left.dds">
</Resource>
<Resource type="ResourceSkin" name="PD_L" size="2 12" texture="textures\menu_rightbuttondown_left.dds">
<BasisSkin type="MainSkin" offset="0 0 2 12">
<State name="normal" offset="0 0 2 12"/>
</BasisSkin>
</Skin>
<Skin name="PD_BL" size="2 2" texture="textures\menu_rightbuttondown_bottom_left.dds">
</Resource>
<Resource type="ResourceSkin" name="PD_BL" size="2 2" texture="textures\menu_rightbuttondown_bottom_left.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
</Resource>
<!-- Define the pin button skin -->
<Skin name="PinUp" size="19 19" texture="textures\menu_rightbuttonup_center.dds">
<Resource type="ResourceSkin" name="PinUp" size="19 19" texture="textures\menu_rightbuttonup_center.dds">
<BasisSkin type="MainSkin" offset="0 0 19 19">
<State name="normal" offset="0 0 19 19"/>
</BasisSkin>
@ -106,8 +106,8 @@
<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_BL" offset="0 17 2 2" align="Stretch"/>
</Skin>
<Skin name="PinDown" size="19 19" texture="textures\menu_rightbuttondown_center.dds">
</Resource>
<Resource type="ResourceSkin" 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>
@ -119,18 +119,18 @@
<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_BL" offset="0 17 2 2" align="Stretch"/>
</Skin>
</Resource>
<!-- Defines a pure black background -->
<Skin name="DialogBG" size="8 8" texture="white.png">
<Resource type="ResourceSkin" name="DialogBG" size="8 8" texture="white.png">
<Property key="Colour" value="#{fontcolour=background}"/>
<BasisSkin type="MainSkin" offset="0 0 8 8">
<State name="normal" offset="0 0 8 8"/>
</BasisSkin>
</Skin>
</Resource>
<!-- These define the dialog borders -->
<Skin name="DB_B" size="512 4" texture="textures\menu_thick_border_bottom.dds">
<Resource type="ResourceSkin" name="DB_B" size="512 4" texture="textures\menu_thick_border_bottom.dds">
<BasisSkin type="TileRect" offset="0 0 512 4" align="Stretch">
<State name="normal" offset="0 0 512 4">
<Property key="TileSize" value="512 4"/>
@ -138,9 +138,9 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
</Resource>
<Skin name="DB_R" size="4 512" texture="textures\menu_thick_border_right.dds">
<Resource type="ResourceSkin" name="DB_R" size="4 512" texture="textures\menu_thick_border_right.dds">
<BasisSkin type="TileRect" offset="0 0 4 512" align="Stretch">
<State name="normal" offset="0 0 4 512">
<Property key="TileSize" value="4 512"/>
@ -148,45 +148,45 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
</Resource>
<Skin name="DB_T" size="512 4" texture="textures\menu_thick_border_top.dds">
<Resource type="ResourceSkin" name="DB_T" size="512 4" texture="textures\menu_thick_border_top.dds">
<BasisSkin type="MainSkin" offset="0 0 512 4">
<State name="normal" offset="0 0 512 4"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="DB_L" size="4 512" texture="textures\menu_thick_border_left.dds">
<Resource type="ResourceSkin" name="DB_L" size="4 512" texture="textures\menu_thick_border_left.dds">
<BasisSkin type="MainSkin" offset="0 0 4 512">
<State name="normal" offset="0 0 4 512"/>
</BasisSkin>
</Skin>
</Resource>
<!-- Dialog border corners -->
<Skin name="DB_BR" size="4 4" texture="textures\menu_thick_border_bottom_right_corner.dds">
<Resource type="ResourceSkin" name="DB_BR" size="4 4" texture="textures\menu_thick_border_bottom_right_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 4 4">
<State name="normal" offset="0 0 4 4"/>
</BasisSkin>
</Skin>
<Skin name="DB_BL" size="4 4" texture="textures\menu_thick_border_bottom_left_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="DB_BL" size="4 4" texture="textures\menu_thick_border_bottom_left_corner.dds">
<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="DB_TR" size="4 4" texture="textures\menu_thick_border_top_right_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="DB_TR" size="4 4" texture="textures\menu_thick_border_top_right_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 4 4">
<State name="normal" offset="0 0 4 4"/>
</BasisSkin>
</Skin>
<Skin name="DB_TL" size="4 4" texture="textures\menu_thick_border_top_left_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="DB_TL" size="4 4" texture="textures\menu_thick_border_top_left_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 4 4">
<State name="normal" offset="0 0 4 4"/>
</BasisSkin>
</Skin>
</Resource>
<!-- These define the window borders -->
<Skin name="TB_B" size="512 4" texture="textures\menu_thick_border_bottom.dds">
<Resource type="ResourceSkin" name="TB_B" size="512 4" texture="textures\menu_thick_border_bottom.dds">
<Property key="Pointer" value="vresize"/>
<BasisSkin type="TileRect" offset="0 0 512 4" align="Stretch">
<State name="normal" offset="0 0 512 4">
@ -195,9 +195,9 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
</Resource>
<Skin name="TB_R" size="4 512" texture="textures\menu_thick_border_right.dds">
<Resource type="ResourceSkin" name="TB_R" size="4 512" texture="textures\menu_thick_border_right.dds">
<Property key="Pointer" value="hresize"/>
<BasisSkin type="TileRect" offset="0 0 4 512" align="Stretch">
<State name="normal" offset="0 0 4 512">
@ -206,9 +206,9 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
</Resource>
<Skin name="TB_T" size="512 4" texture="textures\menu_thick_border_top.dds">
<Resource type="ResourceSkin" name="TB_T" size="512 4" texture="textures\menu_thick_border_top.dds">
<Property key="Pointer" value="vresize"/>
<BasisSkin type="TileRect" offset="0 0 512 4" align="Stretch">
<State name="normal" offset="0 0 512 4">
@ -217,9 +217,9 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
</Resource>
<Skin name="TB_L" size="4 512" texture="textures\menu_thick_border_left.dds">
<Resource type="ResourceSkin" name="TB_L" size="4 512" texture="textures\menu_thick_border_left.dds">
<Property key="Pointer" value="hresize"/>
<BasisSkin type="TileRect" offset="0 0 4 512" align="Stretch">
<State name="normal" offset="0 0 4 512">
@ -228,93 +228,93 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
</Resource>
<!-- Window border corners -->
<Skin name="TB_BR" size="4 4" texture="textures\menu_thick_border_bottom_right_corner.dds">
<Resource type="ResourceSkin" name="TB_BR" size="4 4" texture="textures\menu_thick_border_bottom_right_corner.dds">
<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">
</Resource>
<Resource type="ResourceSkin" name="TB_BL" size="4 4" texture="textures\menu_thick_border_bottom_left_corner.dds">
<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">
</Resource>
<Resource type="ResourceSkin" name="TB_TR" size="4 4" texture="textures\menu_thick_border_top_right_corner.dds">
<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">
</Resource>
<Resource type="ResourceSkin" name="TB_TL" size="4 4" texture="textures\menu_thick_border_top_left_corner.dds">
<Property key="Pointer" value="dresize"/>
<BasisSkin type="MainSkin" offset="0 0 4 4">
<State name="normal" offset="0 0 4 4"/>
</BasisSkin>
</Skin>
</Resource>
<!-- 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">
<Resource type="ResourceSkin" name="TB_TL_T" size="10 4" texture="textures\menu_thick_border_top.dds">
<Property key="Pointer" value="dresize"/>
<BasisSkin type="MainSkin" offset="0 0 10 4">
<State name="normal" offset="0 0 10 4"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="TB_TL_B" size="4 10" texture="textures\menu_thick_border_left.dds">
<Resource type="ResourceSkin" name="TB_TL_B" size="4 10" texture="textures\menu_thick_border_left.dds">
<Property key="Pointer" value="dresize"/>
<BasisSkin type="MainSkin" offset="0 0 4 10">
<State name="normal" offset="0 0 4 10"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="TB_TR_T" size="10 4" texture="textures\menu_thick_border_top.dds">
<Resource type="ResourceSkin" name="TB_TR_T" size="10 4" texture="textures\menu_thick_border_top.dds">
<Property key="Pointer" value="dresize2"/>
<BasisSkin type="MainSkin" offset="0 0 10 4">
<State name="normal" offset="0 0 10 4"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="TB_TR_B" size="4 10" texture="textures\menu_thick_border_right.dds">
<Resource type="ResourceSkin" name="TB_TR_B" size="4 10" texture="textures\menu_thick_border_right.dds">
<Property key="Pointer" value="dresize2"/>
<BasisSkin type="MainSkin" offset="0 0 4 10">
<State name="normal" offset="0 0 4 10"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="TB_BL_T" size="4 10" texture="textures\menu_thick_border_left.dds">
<Resource type="ResourceSkin" name="TB_BL_T" size="4 10" texture="textures\menu_thick_border_left.dds">
<Property key="Pointer" value="dresize2"/>
<BasisSkin type="MainSkin" offset="0 0 4 10">
<State name="normal" offset="0 0 4 10"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="TB_BL_B" size="10 4" texture="textures\menu_thick_border_bottom.dds">
<Resource type="ResourceSkin" name="TB_BL_B" size="10 4" texture="textures\menu_thick_border_bottom.dds">
<Property key="Pointer" value="dresize2"/>
<BasisSkin type="MainSkin" offset="0 0 10 4">
<State name="normal" offset="0 0 10 4"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="TB_BR_T" size="4 10" texture="textures\menu_thick_border_right.dds">
<Resource type="ResourceSkin" name="TB_BR_T" size="4 10" texture="textures\menu_thick_border_right.dds">
<Property key="Pointer" value="dresize"/>
<BasisSkin type="MainSkin" offset="0 0 4 10">
<State name="normal" offset="0 0 4 10"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="TB_BR_B" size="10 4" texture="textures\menu_thick_border_bottom.dds">
<Resource type="ResourceSkin" name="TB_BR_B" size="10 4" texture="textures\menu_thick_border_bottom.dds">
<Property key="Pointer" value="dresize"/>
<BasisSkin type="MainSkin" offset="0 0 10 4">
<State name="normal" offset="0 0 10 4"/>
</BasisSkin>
</Skin>
</Resource>
<!-- These parts defines the 'blocks' to the left and right of the caption -->
<Skin name="HB_MID" size="256 16" texture="textures\menu_head_block_middle.dds">
<Resource type="ResourceSkin" name="HB_MID" size="256 16" texture="textures\menu_head_block_middle.dds">
<BasisSkin type="TileRect" offset="0 0 256 16" align="Stretch">
<State name="normal" offset="0 0 256 16">
<Property key="TileSize" value="256 16"/>
@ -322,9 +322,9 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
</Resource>
<Skin name="HB_TOP" size="256 2" texture="textures\menu_head_block_top.dds">
<Resource type="ResourceSkin" name="HB_TOP" size="256 2" texture="textures\menu_head_block_top.dds">
<BasisSkin type="TileRect" offset="0 0 256 2" align="Stretch">
<State name="normal" offset="0 0 256 2">
<Property key="TileSize" value="256 2"/>
@ -332,9 +332,9 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
</Resource>
<Skin name="HB_BOTTOM" size="256 2" texture="textures\menu_head_block_bottom.dds">
<Resource type="ResourceSkin" name="HB_BOTTOM" size="256 2" texture="textures\menu_head_block_bottom.dds">
<BasisSkin type="TileRect" offset="0 0 256 2" align="Stretch">
<State name="normal" offset="0 0 256 2">
<Property key="TileSize" value="256 2"/>
@ -342,42 +342,42 @@
<Property key="TileV" value="true"/>
</State>
</BasisSkin>
</Skin>
</Resource>
<Skin name="HB_LEFT" size="2 16" texture="textures\menu_head_block_left.dds">
<Resource type="ResourceSkin" name="HB_LEFT" size="2 16" texture="textures\menu_head_block_left.dds">
<BasisSkin type="MainSkin" offset="0 0 2 16">
<State name="normal" offset="0 0 2 16"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="HB_RIGHT" size="2 16" texture="textures\menu_head_block_right.dds">
<Resource type="ResourceSkin" name="HB_RIGHT" size="2 16" texture="textures\menu_head_block_right.dds">
<BasisSkin type="MainSkin" offset="0 0 2 16">
<State name="normal" offset="0 0 2 16"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="HB_TR" size="2 2" texture="textures\menu_head_block_top_right_corner.dds">
<Resource type="ResourceSkin" name="HB_TR" size="2 2" texture="textures\menu_head_block_top_right_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="HB_TL" size="2 2" texture="textures\menu_head_block_top_left_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="HB_TL" size="2 2" texture="textures\menu_head_block_top_left_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="HB_BR" size="2 2" texture="textures\menu_head_block_bottom_right_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="HB_BR" size="2 2" texture="textures\menu_head_block_bottom_right_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
<Skin name="HB_BL" size="2 2" texture="textures\menu_head_block_bottom_left_corner.dds">
</Resource>
<Resource type="ResourceSkin" name="HB_BL" size="2 2" texture="textures\menu_head_block_bottom_left_corner.dds">
<BasisSkin type="MainSkin" offset="0 0 2 2">
<State name="normal" offset="0 0 2 2"/>
</BasisSkin>
</Skin>
</Resource>
<Skin name="HB_ALL" size="260 20">
<Resource type="ResourceSkin" name="HB_ALL" size="260 20">
<Child type="Widget" skin="HB_MID" offset="2 2 256 16" align="Top Left HStretch"/>
<Child type="Widget" skin="HB_TOP" offset="2 0 256 2" align="Top HStretch HStretch"/>
<Child type="Widget" skin="HB_BOTTOM" offset="2 18 256 2" align="Bottom HStretch"/>
@ -387,11 +387,11 @@
<Child type="Widget" skin="HB_TL" offset="0 0 2 2" align="Top Left"/>
<Child type="Widget" skin="HB_BR" offset="258 18 2 2" align="Bottom Right"/>
<Child type="Widget" skin="HB_BL" offset="0 18 2 2" align="Bottom Left"/>
</Skin>
</Resource>
<!-- The actual caption. It contains the edges of the blocks on
its sides as well -->
<Skin name="MW_Caption" size="88 20">
<Resource type="ResourceSkin" name="MW_Caption" size="88 20">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
@ -406,7 +406,7 @@
<Child type="Widget" skin="HB_TL" offset="86 0 2 2" align="Top Right"/>
<Child type="Widget" skin="HB_BR" offset="0 18 2 2" align="Bottom Left"/>
<Child type="Widget" skin="HB_BL" offset="86 18 2 2" align="Bottom Right"/>
</Skin>
</Resource>
<!-- ----------------------------------------------------
@ -414,7 +414,7 @@
------------------------------------------------------ -->
<Skin name="MW_Window" size="256 256">
<Resource type="ResourceSkin" name="MW_Window" size="256 256">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
<Property key="Snap" value="true"/>
@ -551,9 +551,9 @@
<Child type="Button" offset="4 4 248 20" align="HStretch Top" name="Action">
<Property key="Scale" value="1 1 0 0"/>
</Child>
</Skin>
</Resource>
<Skin name="MW_Window_NoCaption" size="256 256">
<Resource type="ResourceSkin" name="MW_Window_NoCaption" size="256 256">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
<Property key="Snap" value="true"/>
@ -687,9 +687,9 @@
<Child type="Button" offset="4 4 248 20" align="HStretch Top" name="Action">
<Property key="Scale" value="1 1 0 0"/>
</Child>
</Skin>
</Resource>
<Skin name="MW_Window_Pinnable" size="256 256">
<Resource type="ResourceSkin" name="MW_Window_Pinnable" size="256 256">
<Property key="FontName" value="Default"/>
<Property key="TextAlign" value="Center"/>
<Property key="Snap" value="true"/>
@ -830,9 +830,9 @@
</Child>
<Child type="Button" skin="PinUp" offset="232 4 19 19" align="Right Top" name="Button"/>
</Skin>
</Resource>
<Skin name="MW_Dialog" size="256 54">
<Resource type="ResourceSkin" name="MW_Dialog" size="256 54">
<Child type="Widget" skin="BlackBG" offset="4 4 248 46" align="Stretch" name="Client"/>
<!-- Outer borders -->
@ -861,5 +861,5 @@
<Child type="Widget" skin="DB_TL" offset="0 0 4 4" align="Left Top" name="Border">
<Property key="Scale" value="1 1 -1 -1"/>
</Child>
</Skin>
</Resource>
</MyGUI>

@ -5,17 +5,56 @@
#include <MyGUI_ScrollBar.h>
#include <MyGUI_Gui.h>
#include <MyGUI_Window.h>
#include <MyGUI_LanguageManager.h>
#include <components/bsa/resources.hpp>
#include <components/files/configurationmanager.hpp>
#include <components/fontloader/fontloader.hpp>
#include <components/widgets/imagebutton.hpp>
#include <components/widgets/box.hpp>
#include <components/widgets/tags.hpp>
#include <components/widgets/widgets.hpp>
#include <OgreTextureManager.h>
#include <OgreHardwarePixelBuffer.h>
//FIXME: code duplication
namespace boost
{
struct FallbackMap {
std::map<std::string,std::string> mMap;
};
void validate(boost::any &v, std::vector<std::string> const &tokens, FallbackMap*, int)
{
if(v.empty())
{
v = boost::any(FallbackMap());
}
FallbackMap *map = boost::any_cast<FallbackMap>(&v);
std::map<std::string,std::string>::iterator mapIt;
for(std::vector<std::string>::const_iterator it=tokens.begin(); it != tokens.end(); ++it)
{
int sep = it->find(",");
if(sep < 1 || sep == (int)it->length()-1)
#if (BOOST_VERSION < 104200)
throw boost::program_options::validation_error("invalid value");
#else
throw boost::program_options::validation_error(boost::program_options::validation_error::invalid_option_value);
#endif
std::string key(it->substr(0,sep));
std::string value(it->substr(sep+1));
if((mapIt = map->mMap.find(key)) == map->mMap.end())
{
map->mMap.insert(std::make_pair (key,value));
}
}
}
}
namespace MyGUIPlugin
{
@ -51,7 +90,9 @@ namespace MyGUIPlugin
("fs-strict", boost::program_options::value<bool>()->implicit_value(true)->default_value(false))
("fallback-archive", boost::program_options::value<std::vector<std::string> >()->
default_value(std::vector<std::string>(), "fallback-archive")->multitoken())
("encoding", boost::program_options::value<std::string>()->default_value("win1252"));
("encoding", boost::program_options::value<std::string>()->default_value("win1252"))
("fallback", boost::program_options::value<boost::FallbackMap>()->default_value(boost::FallbackMap(), "")
->multitoken()->composing(), "fallback values");
boost::program_options::notify(variables);
@ -86,18 +127,15 @@ namespace MyGUIPlugin
Gui::FontLoader loader(ToUTF8::calculateEncoding(encoding));
loader.loadAllFonts(false);
mFallbackMap = variables["fallback"].as<boost::FallbackMap>().mMap;
}
void ResourcePlugin::registerWidgets()
{
MyGUI::FactoryManager::getInstance().registerFactory<MWScrollBar>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::ImageButton>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::HBox>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::VBox>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::AutoSizedTextBox>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::AutoSizedEditBox>("Widget");
MyGUI::FactoryManager::getInstance().registerFactory<Gui::AutoSizedButton>("Widget");
Gui::registerAllWidgets();
}
void ResourcePlugin::createTransparentBGTexture()
@ -126,6 +164,8 @@ namespace MyGUIPlugin
registerResources();
registerWidgets();
createTransparentBGTexture();
MyGUI::LanguageManager::getInstance().eventRequestTag = MyGUI::newDelegate(this, &ResourcePlugin::onRetrieveTag);
}
void ResourcePlugin::shutdown()
@ -135,4 +175,10 @@ namespace MyGUIPlugin
MYGUI_LOGGING("OpenMW_Resource_Plugin", Info, "shutdown");
}
void ResourcePlugin::onRetrieveTag(const MyGUI::UString& tag, MyGUI::UString& out)
{
if (!Gui::replaceTag(tag, out, mFallbackMap))
out = tag;
}
}

@ -2,6 +2,7 @@
#define OPENMW_MYGUI_RESOURCE_PLUGIN_H
#include <MyGUI_Plugin.h>
#include <MyGUI_UString.h>
namespace MyGUIPlugin
{
@ -40,6 +41,10 @@ namespace MyGUIPlugin
void registerResources();
void registerWidgets();
void createTransparentBGTexture();
void onRetrieveTag(const MyGUI::UString& tag, MyGUI::UString& out);
std::map<std::string, std::string> mFallbackMap;
};
}

Loading…
Cancel
Save