Commit 06b2a23e authored by Marc Zinnschlag's avatar Marc Zinnschlag

Merged pull request #1768

parents d7636791 e300a16b
Pipeline #30368821 passed with stage
......@@ -20,6 +20,7 @@
Bug #3059: Unable to hit with marksman weapons when too close to an enemy
Bug #3072: Fatal error on AddItem <item> that has a script containing Equip <item>
Bug #3249: Fixed revert function not updating views properly
Bug #3288: TrueType fonts are handled incorrectly
Bug #3374: Touch spells not hitting kwama foragers
Bug #3486: [Mod] NPC Commands does not work
Bug #3533: GetSpellEffects should detect effects with zero duration
......
......@@ -516,7 +516,7 @@ void OMW::Engine::prepareEngine (Settings::Manager & settings)
MWGui::WindowManager* window = new MWGui::WindowManager(mViewer, guiRoot, mResourceSystem.get(), mWorkQueue.get(),
mCfgMgr.getLogPath().string() + std::string("/"), myguiResources,
mScriptConsoleMode, mTranslationDataStorage, mEncoding, mExportFonts, mFallbackMap,
Version::getOpenmwVersionDescription(mResDir.string()));
Version::getOpenmwVersionDescription(mResDir.string()), mCfgMgr.getUserConfigPath().string());
mEnvironment.setWindowManager (window);
// Create sound system
......
......@@ -219,6 +219,7 @@ namespace MWBase
virtual const MWWorld::Ptr& getSelectedEnchantItem() const = 0;
virtual void setSelectedWeapon(const MWWorld::Ptr& item) = 0;
virtual const MWWorld::Ptr& getSelectedWeapon() const = 0;
virtual int getFontHeight() const = 0;
virtual void unsetSelectedSpell() = 0;
virtual void unsetSelectedWeapon() = 0;
......@@ -289,6 +290,8 @@ namespace MWBase
/// Warning: do not use MyGUI::InputManager::setKeyFocusWidget directly. Instead use this.
virtual void setKeyFocusWidget (MyGUI::Widget* widget) = 0;
virtual void loadUserFonts() = 0;
virtual Loading::Listener* getLoadingScreen() = 0;
/// Should the cursor be visible?
......
#include "bookpage.hpp"
#include "MyGUI_FontManager.h"
#include "MyGUI_RenderItem.h"
#include "MyGUI_RenderManager.h"
#include "MyGUI_TextureUtility.h"
......@@ -8,6 +7,9 @@
#include <components/misc/utf8stream.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
namespace MWGui
{
struct TypesetBookImpl;
......@@ -262,18 +264,29 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
{
}
Style * createStyle (char const * fontName, const Colour& fontColour)
Style * createStyle (const std::string& fontName, const Colour& fontColour)
{
if (strcmp(fontName, "") == 0)
return createStyle(MyGUI::FontManager::getInstance().getDefaultFont().c_str(), fontColour);
const std::string templateName = "Journalbook ";
std::string bookFont;
if (fontName.empty())
{
bookFont = MyGUI::FontManager::getInstance().getDefaultFont();
bookFont = templateName + bookFont;
return createStyle(bookFont, fontColour);
}
if (fontName.compare(0, templateName.size(), templateName) == 0)
bookFont = fontName;
else
bookFont = templateName + bookFont;
for (Styles::iterator i = mBook->mStyles.begin (); i != mBook->mStyles.end (); ++i)
if (i->match (fontName, fontColour, fontColour, fontColour, 0))
if (i->match (bookFont.c_str(), fontColour, fontColour, fontColour, 0))
return &*i;
MyGUI::IFont* font = MyGUI::FontManager::getInstance().getByName(fontName);
MyGUI::IFont* font = MyGUI::FontManager::getInstance().getByName(bookFont);
if (!font)
throw std::runtime_error(std::string("can't find font ") + fontName);
throw std::runtime_error(std::string("can't find font ") + bookFont);
StyleImpl & style = *mBook->mStyles.insert (mBook->mStyles.end (), StyleImpl ());
style.mFont = font;
......@@ -497,9 +510,9 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
while (!stream.eof () && !ucsLineBreak (stream.peek ()) && ucsBreakingSpace (stream.peek ()))
{
MyGUI::GlyphInfo* gi = style->mFont->getGlyphInfo (stream.peek ());
if (gi)
space_width += static_cast<int>(gi->advance + gi->bearingX);
MWGui::GlyphInfo info = GlyphInfo(style->mFont, stream.peek());
if (info.codePoint >= 0)
space_width += static_cast<int>(info.advance + info.bearingX);
stream.consume ();
}
......@@ -507,9 +520,9 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
while (!stream.eof () && !ucsLineBreak (stream.peek ()) && !ucsBreakingSpace (stream.peek ()))
{
MyGUI::GlyphInfo* gi = style->mFont->getGlyphInfo (stream.peek ());
if (gi)
word_width += static_cast<int>(gi->advance + gi->bearingX);
MWGui::GlyphInfo info = GlyphInfo(style->mFont, stream.peek());
if (info.codePoint >= 0)
word_width += static_cast<int>(info.advance + info.bearingX);
stream.consume ();
}
......@@ -530,6 +543,7 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
if (mPartialWhitespace.empty() && mPartialWord.empty())
return;
int fontHeight = MWBase::Environment::get().getWindowManager()->getFontHeight();
int space_width = 0;
int word_width = 0;
......@@ -549,9 +563,8 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
for (PartialTextConstIterator i = mPartialWhitespace.begin (); i != mPartialWhitespace.end (); ++i)
{
int top = mLine ? mLine->mRect.top : mBook->mRect.bottom;
int line_height = i->mStyle->mFont->getDefaultHeight ();
append_run ( i->mStyle, i->mBegin, i->mEnd, 0, left + i->mWidth, top + line_height);
append_run ( i->mStyle, i->mBegin, i->mEnd, 0, left + i->mWidth, top + fontHeight);
left = mLine->mRect.right;
}
......@@ -560,9 +573,8 @@ struct TypesetBookImpl::Typesetter : BookTypesetter
for (PartialTextConstIterator i = mPartialWord.begin (); i != mPartialWord.end (); ++i)
{
int top = mLine ? mLine->mRect.top : mBook->mRect.bottom;
int line_height = i->mStyle->mFont->getDefaultHeight ();
append_run (i->mStyle, i->mBegin, i->mEnd, i->mEnd - i->mBegin, left + i->mWidth, top + line_height);
append_run (i->mStyle, i->mBegin, i->mEnd, i->mEnd - i->mBegin, left + i->mWidth, top + fontHeight);
left = mLine->mRect.right;
}
......@@ -756,32 +768,32 @@ namespace
void emitGlyph (wchar_t ch)
{
MyGUI::GlyphInfo* gi = mFont->getGlyphInfo (ch);
MWGui::GlyphInfo info = GlyphInfo(mFont, ch);
if (!gi)
if (info.codePoint < 0)
return;
MyGUI::FloatRect vr;
vr.left = mCursor.left + gi->bearingX;
vr.top = mCursor.top + gi->bearingY;
vr.right = vr.left + gi->width;
vr.bottom = vr.top + gi->height;
vr.left = mCursor.left + info.bearingX;
vr.top = mCursor.top + info.bearingY;
vr.right = vr.left + info.width;
vr.bottom = vr.top + info.height;
MyGUI::FloatRect tr = gi->uvRect;
MyGUI::FloatRect tr = info.uvRect;
if (mRenderXform.clip (vr, tr))
quad (vr, tr);
mCursor.left += gi->bearingX + gi->advance;
mCursor.left += static_cast<int>(info.bearingX + info.advance);
}
void emitSpace (wchar_t ch)
{
MyGUI::GlyphInfo* gi = mFont->getGlyphInfo (ch);
MWGui::GlyphInfo info = GlyphInfo(mFont, ch);
if (gi)
mCursor.left += gi->bearingX + gi->advance;
if (info.codePoint >= 0)
mCursor.left += static_cast<int>(info.bearingX + info.advance);
}
private:
......
......@@ -3,10 +3,17 @@
#include "MyGUI_Colour.h"
#include "MyGUI_Widget.h"
#include "MyGUI_FontManager.h"
#include <functional>
#include <stdint.h>
#include <components/settings/settings.hpp>
#include <components/widgets/widgets.hpp>
#include "../mwbase/environment.hpp"
#include "../mwbase/windowmanager.hpp"
namespace MWGui
{
/// A formatted and paginated document to be used with
......@@ -28,6 +35,45 @@ namespace MWGui
virtual std::pair <unsigned int, unsigned int> getSize () const = 0;
};
struct GlyphInfo
{
char codePoint;
float width;
float height;
float advance;
float bearingX;
float bearingY;
MyGUI::FloatRect uvRect;
GlyphInfo(MyGUI::IFont* font, MyGUI::Char ch)
{
static const int fontHeight = MWBase::Environment::get().getWindowManager()->getFontHeight();
MyGUI::GlyphInfo* gi = font->getGlyphInfo(ch);
if (gi)
{
const float scale = font->getDefaultHeight() / (float) fontHeight;
codePoint = gi->codePoint;
bearingX = (int) gi->bearingX / scale;
bearingY = (int) gi->bearingY / scale;
width = (int) gi->width / scale;
height = (int) gi->height / scale;
advance = (int) gi->advance / scale;
uvRect = gi->uvRect;
}
else
{
codePoint = -1;
bearingX = 0;
bearingY = 0;
width = 0;
height = 0;
advance = 0;
}
}
};
/// A factory class for creating a typeset book instance.
struct BookTypesetter
{
......@@ -56,7 +102,7 @@ namespace MWGui
static Ptr create (int pageWidth, int pageHeight);
/// Create a simple text style consisting of a font and a text color.
virtual Style* createStyle (char const * Font, const Colour& Colour) = 0;
virtual Style* createStyle (const std::string& fontName, const Colour& colour) = 0;
/// Create a hyper-link style with a user-defined identifier based on an
/// existing style. The unique flag forces a new instance of this style
......
......@@ -152,12 +152,6 @@ namespace MWGui
MWBase::Environment::get().getWindowManager()->setKeyFocusWidget(mCommandLine);
}
void Console::setFont(const std::string &fntName)
{
mHistory->setFontName(fntName);
mCommandLine->setFontName(fntName);
}
void Console::print(const std::string &msg, const std::string& color)
{
mHistory->addText(color + MyGUI::TextIterator::toTagsString(msg));
......
......@@ -41,8 +41,6 @@ namespace MWGui
virtual void onOpen();
void setFont(const std::string &fntName);
void onResChange(int width, int height);
// Print a message to the console, in specified color.
......
......@@ -377,7 +377,7 @@ namespace MWGui
if (attr.find("face") != attr.end())
{
std::string face = attr.at("face");
mTextStyle.mFont = face;
mTextStyle.mFont = "Journalbook "+face;
}
if (attr.find("size") != attr.end())
{
......@@ -415,7 +415,7 @@ namespace MWGui
: GraphicElement(parent, pag, blockStyle),
mTextStyle(textStyle)
{
MyGUI::EditBox* box = parent->createWidget<MyGUI::EditBox>("NormalText",
Gui::EditBox* box = parent->createWidget<Gui::EditBox>("NormalText",
MyGUI::IntCoord(0, pag.getCurrentTop(), pag.getPageWidth(), 0), MyGUI::Align::Left | MyGUI::Align::Top,
parent->getName() + MyGUI::utility::toString(parent->getChildCount()));
box->setEditStatic(true);
......@@ -432,15 +432,6 @@ namespace MWGui
mEditBox = box;
}
int TextElement::currentFontHeight() const
{
std::string fontName(mTextStyle.mFont == "Default" ? MyGUI::FontManager::getInstance().getDefaultFont() : mTextStyle.mFont);
MyGUI::IFont* font = MyGUI::FontManager::getInstance().getByName(fontName);
if (!font)
return 0;
return font->getDefaultHeight();
}
int TextElement::getHeight()
{
return mEditBox->getTextSize().height;
......@@ -449,7 +440,7 @@ namespace MWGui
int TextElement::pageSplit()
{
// split lines
const int lineHeight = currentFontHeight();
const int lineHeight = MWBase::Environment::get().getWindowManager()->getFontHeight();
unsigned int lastLine = (mPaginator.getStartTop() + mPaginator.getPageHeight() - mPaginator.getCurrentTop());
if (lineHeight > 0)
lastLine /= lineHeight;
......
......@@ -4,6 +4,8 @@
#include <MyGUI_Colour.h>
#include <map>
#include <components/widgets/box.hpp>
namespace MWGui
{
namespace Formatting
......@@ -12,7 +14,7 @@ namespace MWGui
{
TextStyle() :
mColour(0,0,0)
, mFont("Default")
, mFont("")
, mTextSize(16)
{
}
......@@ -152,7 +154,7 @@ namespace MWGui
private:
int currentFontHeight() const;
TextStyle mTextStyle;
MyGUI::EditBox * mEditBox;
Gui::EditBox * mEditBox;
};
class ImageElement : public GraphicElement
......
......@@ -157,7 +157,7 @@ MWGui::BookTypesetter::Utf8Span to_utf8_span (char const * text)
typedef TypesetBook::Ptr book;
JournalBooks::JournalBooks (JournalViewModel::Ptr model, ToUTF8::FromType encoding) :
mModel (model), mEncoding(encoding)
mModel (model), mEncoding(encoding), mIndexPagesCount(0)
{
}
......@@ -229,10 +229,13 @@ book JournalBooks::createTopicIndexBook ()
BookTypesetter::Ptr JournalBooks::createLatinJournalIndex ()
{
BookTypesetter::Ptr typesetter = BookTypesetter::create (92, 250);
BookTypesetter::Ptr typesetter = BookTypesetter::create (92, 260);
typesetter->setSectionAlignment (BookTypesetter::AlignCenter);
// Latin journal index always has two columns for now.
mIndexPagesCount = 2;
char ch = 'A';
BookTypesetter::Style* body = typesetter->createStyle ("", MyGUI::Colour::Black);
......@@ -260,12 +263,23 @@ BookTypesetter::Ptr JournalBooks::createLatinJournalIndex ()
BookTypesetter::Ptr JournalBooks::createCyrillicJournalIndex ()
{
BookTypesetter::Ptr typesetter = BookTypesetter::create (92, 250);
BookTypesetter::Ptr typesetter = BookTypesetter::create (92, 260);
typesetter->setSectionAlignment (BookTypesetter::AlignCenter);
BookTypesetter::Style* body = typesetter->createStyle ("", MyGUI::Colour::Black);
int fontHeight = MWBase::Environment::get().getWindowManager()->getFontHeight();
// for small font size split alphabet to two columns (2x15 characers), for big font size split it to three colums (3x10 characters).
int sectionBreak = 10;
mIndexPagesCount = 3;
if (fontHeight < 18)
{
sectionBreak = 15;
mIndexPagesCount = 2;
}
unsigned char ch[2] = {0xd0, 0x90}; // CYRILLIC CAPITAL A is a 0xd090 in UTF-8
for (int i = 0; i < 32; ++i)
......@@ -287,7 +301,7 @@ BookTypesetter::Ptr JournalBooks::createCyrillicJournalIndex ()
if (i == 26 || i == 28)
continue;
if (i == 15)
if (i % sectionBreak == 0)
typesetter->sectionBreak ();
typesetter->write (style, to_utf8_span (buffer));
......
......@@ -25,6 +25,7 @@ namespace MWGui
Book createTopicIndexBook ();
ToUTF8::FromType mEncoding;
int mIndexPagesCount;
private:
BookTypesetter::Ptr createTypesetter ();
......
......@@ -43,6 +43,7 @@ namespace
static char const LeftBookPage [] = "LeftBookPage";
static char const RightBookPage [] = "RightBookPage";
static char const LeftTopicIndex [] = "LeftTopicIndex";
static char const CenterTopicIndex [] = "CenterTopicIndex";
static char const RightTopicIndex [] = "RightTopicIndex";
struct JournalWindowImpl : MWGui::JournalBooks, MWGui::JournalWindow
......@@ -148,6 +149,7 @@ namespace
callback = std::bind(&JournalWindowImpl::notifyIndexLinkClicked, this, std::placeholders::_1);
getPage (LeftTopicIndex)->adviseLinkClicked (callback);
getPage (CenterTopicIndex)->adviseLinkClicked (callback);
getPage (RightTopicIndex)->adviseLinkClicked (callback);
}
......@@ -312,6 +314,7 @@ namespace
setVisible (TopicsList, false);
setVisible (QuestsList, mQuestMode);
setVisible (LeftTopicIndex, !mQuestMode);
setVisible (CenterTopicIndex, !mQuestMode);
setVisible (RightTopicIndex, !mQuestMode);
setVisible (ShowAllBTN, mQuestMode && !mAllQuests);
setVisible (ShowActiveBTN, mQuestMode && mAllQuests);
......@@ -465,8 +468,17 @@ namespace
if (!mTopicIndexBook)
mTopicIndexBook = createTopicIndexBook ();
getPage (LeftTopicIndex)->showPage (mTopicIndexBook, 0);
getPage (RightTopicIndex)->showPage (mTopicIndexBook, 1);
if (mIndexPagesCount == 3)
{
getPage (LeftTopicIndex)->showPage (mTopicIndexBook, 0);
getPage (CenterTopicIndex)->showPage (mTopicIndexBook, 1);
getPage (RightTopicIndex)->showPage (mTopicIndexBook, 2);
}
else
{
getPage (LeftTopicIndex)->showPage (mTopicIndexBook, 0);
getPage (RightTopicIndex)->showPage (mTopicIndexBook, 1);
}
}
void notifyJournal(MyGUI::Widget* _sender)
......@@ -480,6 +492,7 @@ namespace
void notifyIndexLinkClicked (MWGui::TypesetBook::InteractiveId index)
{
setVisible (LeftTopicIndex, false);
setVisible (CenterTopicIndex, false);
setVisible (RightTopicIndex, false);
setVisible (TopicsList, true);
......@@ -502,6 +515,7 @@ namespace
mQuestMode = false;
mTopicsMode = false;
setVisible (LeftTopicIndex, true);
setVisible (CenterTopicIndex, true);
setVisible (RightTopicIndex, true);
setVisible (TopicsList, false);
setVisible (QuestsList, false);
......@@ -540,6 +554,7 @@ namespace
mQuestMode = true;
setVisible (LeftTopicIndex, false);
setVisible (CenterTopicIndex, true);
setVisible (RightTopicIndex, false);
setVisible (TopicsList, false);
setVisible (QuestsList, true);
......
......@@ -20,8 +20,6 @@
namespace MWGui
{
const int MerchantRepair::sLineHeight = 18;
MerchantRepair::MerchantRepair()
: WindowBase("openmw_merchantrepair.layout")
{
......@@ -39,6 +37,7 @@ void MerchantRepair::setPtr(const MWWorld::Ptr &actor)
while (mList->getChildCount())
MyGUI::Gui::getInstance().destroyWidget(mList->getChildAt(0));
int lineHeight = MWBase::Environment::get().getWindowManager()->getFontHeight() + 2;
int currentY = 0;
MWWorld::Ptr player = MWMechanics::getPlayer();
......@@ -67,28 +66,26 @@ void MerchantRepair::setPtr(const MWWorld::Ptr &actor)
int price = MWBase::Environment::get().getMechanicsManager()->getBarterOffer(mActor, x, true);
std::string name = iter->getClass().getName(*iter)
+ " - " + MyGUI::utility::toString(price)
+ MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
.find("sgp")->mValue.getString();
MyGUI::Button* button =
mList->createWidget<MyGUI::Button>(price <= playerGold ? "SandTextButton" : "SandTextButtonDisabled", // can't use setEnabled since that removes tooltip
0,
currentY,
0,
sLineHeight,
lineHeight,
MyGUI::Align::Default
);
currentY += sLineHeight;
currentY += lineHeight;
button->setUserString("Price", MyGUI::utility::toString(price));
button->setUserData(MWWorld::Ptr(*iter));
button->setCaptionWithReplacing(name);
button->setSize(mList->getWidth(),sLineHeight);
button->setSize(mList->getWidth(), lineHeight);
button->eventMouseWheel += MyGUI::newDelegate(this, &MerchantRepair::onMouseWheel);
button->setUserString("ToolTipType", "ItemPtr");
button->eventMouseButtonClick += MyGUI::newDelegate(this, &MerchantRepair::onRepairButtonClick);
......
......@@ -27,8 +27,6 @@ protected:
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
void onRepairButtonClick(MyGUI::Widget* sender);
void onOkButtonClick(MyGUI::Widget* sender);
static const int sLineHeight;
};
}
......
......@@ -26,9 +26,6 @@ namespace
namespace MWGui
{
const int ReviewDialog::sLineHeight = 18;
ReviewDialog::ReviewDialog()
: WindowModal("openmw_chargen_review.layout"),
mUpdateSkillArea(false)
......@@ -261,8 +258,9 @@ namespace MWGui
groupWidget->setCaption(label);
mSkillWidgets.push_back(groupWidget);
coord1.top += sLineHeight;
coord2.top += sLineHeight;
int lineHeight = MWBase::Environment::get().getWindowManager()->getFontHeight() + 2;
coord1.top += lineHeight;
coord2.top += lineHeight;
}
MyGUI::TextBox* ReviewDialog::addValueItem(const std::string& text, const std::string &value, const std::string& state, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
......@@ -282,8 +280,9 @@ namespace MWGui
mSkillWidgets.push_back(skillNameWidget);
mSkillWidgets.push_back(skillValueWidget);
coord1.top += sLineHeight;
coord2.top += sLineHeight;
int lineHeight = MWBase::Environment::get().getWindowManager()->getFontHeight() + 2;
coord1.top += lineHeight;
coord2.top += lineHeight;
return skillValueWidget;
}
......@@ -298,8 +297,9 @@ namespace MWGui
mSkillWidgets.push_back(skillNameWidget);
coord1.top += sLineHeight;
coord2.top += sLineHeight;
int lineHeight = MWBase::Environment::get().getWindowManager()->getFontHeight() + 2;
coord1.top += lineHeight;
coord2.top += lineHeight;
}
void ReviewDialog::addItem(const ESM::Spell* spell, MyGUI::IntCoord& coord1, MyGUI::IntCoord& coord2)
......@@ -312,8 +312,9 @@ namespace MWGui
mSkillWidgets.push_back(widget);
coord1.top += sLineHeight;
coord2.top += sLineHeight;
int lineHeight = MWBase::Environment::get().getWindowManager()->getFontHeight() + 2;
coord1.top += lineHeight;
coord2.top += lineHeight;
}
void ReviewDialog::addSkills(const SkillList &skills, const std::string &titleId, const std::string &titleDefault, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2)
......
......@@ -87,8 +87,6 @@ namespace MWGui
void addItem(const ESM::Spell* spell, MyGUI::IntCoord &coord1, MyGUI::IntCoord &coord2);
void updateSkillArea();
static const int sLineHeight;
MyGUI::TextBox *mNameWidget, *mRaceWidget, *mClassWidget, *mBirthSignWidget;
MyGUI::ScrollView* mSkillView;
......
......@@ -18,8 +18,6 @@
namespace MWGui
{
const int SpellBuyingWindow::sLineHeight = 18;
SpellBuyingWindow::SpellBuyingWindow() :
WindowBase("openmw_spell_buying_window.layout")
, mCurrentY(0)
......@@ -52,21 +50,23 @@ namespace MWGui
// TODO: refactor to use MyGUI::ListBox
int lineHeight = MWBase::Environment::get().getWindowManager()->getFontHeight() + 2;
MyGUI::Button* toAdd =
mSpellsView->createWidget<MyGUI::Button>(
price <= playerGold ? "SandTextButton" : "SandTextButtonDisabled", // can't use setEnabled since that removes tooltip
0,
mCurrentY,
200,
sLineHeight,
lineHeight,
MyGUI::Align::Default
);
mCurrentY += sLineHeight;
mCurrentY += lineHeight;
toAdd->setUserData(price);
toAdd->setCaptionWithReplacing(spell.mName+" - "+MyGUI::utility::toString(price)+"#{sgp}");
toAdd->setSize(mSpellsView->getWidth(),sLineHeight);
toAdd->setSize(mSpellsView->getWidth(), lineHeight);
toAdd->eventMouseWheel += MyGUI::newDelegate(this, &SpellBuyingWindow::onMouseWheel);
toAdd->setUserString("ToolTipType", "Spell");
toAdd->setUserString("Spell", spell.mId);
......
......@@ -48,8 +48,6 @@ namespace MWGui
void clearSpells();
int mCurrentY;
static const int sLineHeight;
void updateLabels();
virtual void onReferenceUnavailable();
......
......@@ -6,6 +6,7 @@
#include <MyGUI_Gui.h>
#include <components/widgets/sharedstatebutton.hpp>
#include <components/widgets/box.hpp>
#include "tooltips.hpp"
......@@ -240,7 +241,7 @@ namespace MWGui
mLines.push_back(LineInfo(separator, (MyGUI::Widget*)NULL, NoSpellIndex));
}
MyGUI::TextBox* groupWidget = mScrollView->createWidget<MyGUI::TextBox>("SandBrightText",
MyGUI::TextBox* groupWidget = mScrollView->createWidget<Gui::TextBox>("SandBrightText",
MyGUI::IntCoord(0, 0, mScrollView->getWidth(), 24),
MyGUI::Align::Left | MyGUI::Align::Top);
groupWidget->setCaptionWithReplacing(label);
......@@ -249,7 +250,7 @@ namespace MWGui
if (label2 != "")
{
MyGUI::TextBox* groupWidget2 = mScrollView->createWidget<MyGUI::TextBox>("SandBrightText",
MyGUI::TextBox* groupWidget2 = mScrollView->createWidget<Gui::TextBox>("SandBrightText",
MyGUI::IntCoord(0, 0, mScrollView->getWidth(), 24),
MyGUI::Align::Left | MyGUI::Align::Top);
groupWidget2->setCaptionWithReplacing(label2);
......