mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-20 01:21:15 +00:00
compile fixes for mygui 3.2
This commit is contained in:
parent
66baf9ec81
commit
d451d7bb67
@ -160,7 +160,7 @@ namespace MWGui
|
|||||||
void onCancelClicked(MyGUI::Widget* _sender);
|
void onCancelClicked(MyGUI::Widget* _sender);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MyGUI::WidgetPtr specialization0, specialization1, specialization2;
|
MyGUI::StaticTextPtr specialization0, specialization1, specialization2;
|
||||||
|
|
||||||
ESM::Class::Specialization specializationId;
|
ESM::Class::Specialization specializationId;
|
||||||
};
|
};
|
||||||
@ -287,7 +287,7 @@ namespace MWGui
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
MyGUI::EditPtr editName;
|
MyGUI::EditPtr editName;
|
||||||
MyGUI::WidgetPtr specializationName;
|
MyGUI::StaticTextPtr specializationName;
|
||||||
Widgets::MWAttributePtr favoriteAttribute0, favoriteAttribute1;
|
Widgets::MWAttributePtr favoriteAttribute0, favoriteAttribute1;
|
||||||
Widgets::MWSkillPtr majorSkill[5];
|
Widgets::MWSkillPtr majorSkill[5];
|
||||||
Widgets::MWSkillPtr minorSkill[5];
|
Widgets::MWSkillPtr minorSkill[5];
|
||||||
|
@ -15,8 +15,8 @@ using namespace Widgets;
|
|||||||
|
|
||||||
UString DialogeHistory::getColorAtPos(size_t _pos)
|
UString DialogeHistory::getColorAtPos(size_t _pos)
|
||||||
{
|
{
|
||||||
UString colour = TextIterator::convertTagColour(mText->getTextColour());
|
UString colour = TextIterator::convertTagColour(getTextColour());
|
||||||
TextIterator iterator(mText->getCaption());
|
TextIterator iterator(getCaption());
|
||||||
while(iterator.moveNext())
|
while(iterator.moveNext())
|
||||||
{
|
{
|
||||||
size_t pos = iterator.getPosition();
|
size_t pos = iterator.getPosition();
|
||||||
@ -32,9 +32,9 @@ UString DialogeHistory::getColorAtPos(size_t _pos)
|
|||||||
UString DialogeHistory::getColorTextAt(size_t _pos)
|
UString DialogeHistory::getColorTextAt(size_t _pos)
|
||||||
{
|
{
|
||||||
bool breakOnNext = false;
|
bool breakOnNext = false;
|
||||||
UString colour = TextIterator::convertTagColour(mText->getTextColour());
|
UString colour = TextIterator::convertTagColour(getTextColour());
|
||||||
UString colour2 = colour;
|
UString colour2 = colour;
|
||||||
TextIterator iterator(mText->getCaption());
|
TextIterator iterator(getCaption());
|
||||||
TextIterator col_start = iterator;
|
TextIterator col_start = iterator;
|
||||||
while(iterator.moveNext())
|
while(iterator.moveNext())
|
||||||
{
|
{
|
||||||
|
@ -75,7 +75,7 @@ namespace MWGui
|
|||||||
|
|
||||||
void setCellName(const std::string& cellName)
|
void setCellName(const std::string& cellName)
|
||||||
{
|
{
|
||||||
mMainWidget->setCaption(cellName);
|
static_cast<MyGUI::Window*>(mMainWidget)->setCaption(cellName);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -166,7 +166,8 @@ MessageBox::MessageBox(MessageBoxManager& parMessageBoxManager, const std::strin
|
|||||||
|
|
||||||
mMessageWidget->setSize(size);
|
mMessageWidget->setSize(size);
|
||||||
|
|
||||||
MyGUI::IntSize textSize = mMessageWidget->_getTextSize();
|
MyGUI::IntSize textSize = mMessageWidget->getTextSize();
|
||||||
|
|
||||||
size.height = mHeight = textSize.height + 20; // this is the padding between the text and the box
|
size.height = mHeight = textSize.height + 20; // this is the padding between the text and the box
|
||||||
|
|
||||||
mMainWidget->setSize(size);
|
mMainWidget->setSize(size);
|
||||||
@ -219,7 +220,7 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
|
|||||||
mMessageWidget->setOverflowToTheLeft(true);
|
mMessageWidget->setOverflowToTheLeft(true);
|
||||||
mMessageWidget->addText(message);
|
mMessageWidget->addText(message);
|
||||||
|
|
||||||
MyGUI::IntSize textSize = mMessageWidget->_getTextSize();
|
MyGUI::IntSize textSize = mMessageWidget->getTextSize();
|
||||||
|
|
||||||
MyGUI::IntSize gameWindowSize = mMessageBoxManager.mWindowManager->getGui()->getViewSize();
|
MyGUI::IntSize gameWindowSize = mMessageBoxManager.mWindowManager->getGui()->getViewSize();
|
||||||
|
|
||||||
@ -243,9 +244,9 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
|
|||||||
|
|
||||||
mButtons.push_back(button);
|
mButtons.push_back(button);
|
||||||
|
|
||||||
buttonWidth = button->_getTextSize().width + 2*buttonPadding + buttonLeftPadding;
|
buttonWidth = button->getTextSize().width + 2*buttonPadding + buttonLeftPadding;
|
||||||
buttonsWidth += buttonWidth;
|
buttonsWidth += buttonWidth;
|
||||||
buttonHeight = button->_getTextSize().height + 2*buttonPadding + buttonTopPadding;
|
buttonHeight = button->getTextSize().height + 2*buttonPadding + buttonTopPadding;
|
||||||
|
|
||||||
if(buttonWidth > biggestButtonWidth)
|
if(buttonWidth > biggestButtonWidth)
|
||||||
{
|
{
|
||||||
@ -299,8 +300,8 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
|
|||||||
buttonCord.left = left;
|
buttonCord.left = left;
|
||||||
buttonCord.top = textSize.height + textButtonPadding;
|
buttonCord.top = textSize.height + textButtonPadding;
|
||||||
|
|
||||||
buttonSize.width = (*button)->_getTextSize().width + 2*buttonPadding;
|
buttonSize.width = (*button)->getTextSize().width + 2*buttonPadding;
|
||||||
buttonSize.height = (*button)->_getTextSize().height + 2*buttonPadding;
|
buttonSize.height = (*button)->getTextSize().height + 2*buttonPadding;
|
||||||
|
|
||||||
(*button)->setCoord(buttonCord);
|
(*button)->setCoord(buttonCord);
|
||||||
(*button)->setSize(buttonSize);
|
(*button)->setSize(buttonSize);
|
||||||
@ -347,8 +348,8 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan
|
|||||||
std::vector<MyGUI::ButtonPtr>::const_iterator button;
|
std::vector<MyGUI::ButtonPtr>::const_iterator button;
|
||||||
for(button = mButtons.begin(); button != mButtons.end(); ++button)
|
for(button = mButtons.begin(); button != mButtons.end(); ++button)
|
||||||
{
|
{
|
||||||
buttonSize.width = (*button)->_getTextSize().width + buttonPadding*2;
|
buttonSize.width = (*button)->getTextSize().width + buttonPadding*2;
|
||||||
buttonSize.height = (*button)->_getTextSize().height + buttonPadding*2;
|
buttonSize.height = (*button)->getTextSize().height + buttonPadding*2;
|
||||||
|
|
||||||
buttonCord.top = top;
|
buttonCord.top = top;
|
||||||
buttonCord.left = (mainWidgetSize.width - buttonSize.width)/2 - 5; // FIXME: -5 is not so nice :/
|
buttonCord.left = (mainWidgetSize.width - buttonSize.width)/2 - 5; // FIXME: -5 is not so nice :/
|
||||||
|
@ -95,7 +95,7 @@ void StatsWindow::setBar(const std::string& name, const std::string& tname, int
|
|||||||
|
|
||||||
void StatsWindow::setPlayerName(const std::string& playerName)
|
void StatsWindow::setPlayerName(const std::string& playerName)
|
||||||
{
|
{
|
||||||
mMainWidget->setCaption(playerName);
|
static_cast<MyGUI::Window*>(mMainWidget)->setCaption(playerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StatsWindow::setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style, const std::string &value)
|
void StatsWindow::setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style, const std::string &value)
|
||||||
|
@ -62,24 +62,24 @@ void MWSkill::updateWidgets()
|
|||||||
{
|
{
|
||||||
if (skillId == ESM::Skill::Length)
|
if (skillId == ESM::Skill::Length)
|
||||||
{
|
{
|
||||||
skillNameWidget->setCaption("");
|
static_cast<MyGUI::TextBox*>(skillNameWidget)->setCaption("");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const std::string &name = manager->getGameSettingString(ESM::Skill::sSkillNameIds[skillId], "");
|
const std::string &name = manager->getGameSettingString(ESM::Skill::sSkillNameIds[skillId], "");
|
||||||
skillNameWidget->setCaption(name);
|
static_cast<MyGUI::TextBox*>(skillNameWidget)->setCaption(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (skillValueWidget)
|
if (skillValueWidget)
|
||||||
{
|
{
|
||||||
SkillValue::Type modified = value.getModified(), base = value.getBase();
|
SkillValue::Type modified = value.getModified(), base = value.getBase();
|
||||||
skillValueWidget->setCaption(boost::lexical_cast<std::string>(modified));
|
static_cast<MyGUI::TextBox*>(skillValueWidget)->setCaption(boost::lexical_cast<std::string>(modified));
|
||||||
if (modified > base)
|
if (modified > base)
|
||||||
skillValueWidget->setState("increased");
|
skillValueWidget->_setWidgetState("increased");
|
||||||
else if (modified < base)
|
else if (modified < base)
|
||||||
skillValueWidget->setState("decreased");
|
skillValueWidget->_setWidgetState("decreased");
|
||||||
else
|
else
|
||||||
skillValueWidget->setState("normal");
|
skillValueWidget->_setWidgetState("normal");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,59 +88,25 @@ void MWSkill::onClicked(MyGUI::Widget* _sender)
|
|||||||
eventClicked(this);
|
eventClicked(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWSkill::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
|
|
||||||
{
|
|
||||||
Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
|
|
||||||
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
MWSkill::~MWSkill()
|
MWSkill::~MWSkill()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWSkill::baseChangeWidgetSkin(ResourceSkin* _info)
|
void MWSkill::initialiseOverride()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
Base::initialiseOverride();
|
||||||
Base::baseChangeWidgetSkin(_info);
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWSkill::initialiseWidgetSkin(ResourceSkin* _info)
|
assignWidget(skillNameWidget, "StatName");
|
||||||
{
|
assignWidget(skillValueWidget, "StatValue");
|
||||||
for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
|
|
||||||
{
|
MyGUI::ButtonPtr button;
|
||||||
const std::string &name = *(*iter)->_getInternalData<std::string>();
|
assignWidget(button, "StatNameButton");
|
||||||
if (name == "StatName")
|
//skillNameWidget = button; // ???
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! skillNameWidget, "widget already assigned");
|
|
||||||
skillNameWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
else if (name == "StatValue")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! skillValueWidget, "widget already assigned");
|
|
||||||
skillValueWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
else if (name == "StatNameButton")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! skillNameWidget, "widget already assigned");
|
|
||||||
MyGUI::ButtonPtr button = (*iter)->castType<Button>();
|
|
||||||
skillNameWidget = button;
|
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWSkill::onClicked);
|
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWSkill::onClicked);
|
||||||
}
|
|
||||||
else if (name == "StatValueButton")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! skillValueWidget, "widget already assigned");
|
|
||||||
MyGUI::ButtonPtr button = (*iter)->castType<Button>();
|
|
||||||
skillNameWidget = button;
|
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWSkill::onClicked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWSkill::shutdownWidgetSkin()
|
assignWidget(button, "StatValue");
|
||||||
{
|
//skillNameWidget = button; // ???
|
||||||
|
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWSkill::onClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MWAttribute */
|
/* MWAttribute */
|
||||||
@ -176,7 +142,7 @@ void MWAttribute::updateWidgets()
|
|||||||
{
|
{
|
||||||
if (id < 0 || id >= 8)
|
if (id < 0 || id >= 8)
|
||||||
{
|
{
|
||||||
attributeNameWidget->setCaption("");
|
static_cast<MyGUI::TextBox*>(attributeNameWidget)->setCaption("");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -191,75 +157,42 @@ void MWAttribute::updateWidgets()
|
|||||||
"sAttributeLuck"
|
"sAttributeLuck"
|
||||||
};
|
};
|
||||||
const std::string &name = manager->getGameSettingString(attributes[id], "");
|
const std::string &name = manager->getGameSettingString(attributes[id], "");
|
||||||
attributeNameWidget->setCaption(name);
|
static_cast<MyGUI::TextBox*>(attributeNameWidget)->setCaption(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (attributeValueWidget)
|
if (attributeValueWidget)
|
||||||
{
|
{
|
||||||
AttributeValue::Type modified = value.getModified(), base = value.getBase();
|
AttributeValue::Type modified = value.getModified(), base = value.getBase();
|
||||||
attributeValueWidget->setCaption(boost::lexical_cast<std::string>(modified));
|
static_cast<MyGUI::TextBox*>(attributeValueWidget)->setCaption(boost::lexical_cast<std::string>(modified));
|
||||||
if (modified > base)
|
if (modified > base)
|
||||||
attributeValueWidget->setState("increased");
|
attributeValueWidget->_setWidgetState("increased");
|
||||||
else if (modified < base)
|
else if (modified < base)
|
||||||
attributeValueWidget->setState("decreased");
|
attributeValueWidget->_setWidgetState("decreased");
|
||||||
else
|
else
|
||||||
attributeValueWidget->setState("normal");
|
attributeValueWidget->_setWidgetState("normal");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWAttribute::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
|
|
||||||
{
|
|
||||||
Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
|
|
||||||
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
MWAttribute::~MWAttribute()
|
MWAttribute::~MWAttribute()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWAttribute::baseChangeWidgetSkin(ResourceSkin* _info)
|
void MWAttribute::initialiseOverride()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
Base::initialiseOverride();
|
||||||
Base::baseChangeWidgetSkin(_info);
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWAttribute::initialiseWidgetSkin(ResourceSkin* _info)
|
assignWidget(attributeNameWidget, "StatName");
|
||||||
{
|
assignWidget(attributeValueWidget, "StatValue");
|
||||||
for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
|
|
||||||
{
|
MyGUI::ButtonPtr button;
|
||||||
const std::string &name = *(*iter)->_getInternalData<std::string>();
|
assignWidget(button, "StatNameButton");
|
||||||
if (name == "StatName")
|
//attributeNameWidget = button; // ???
|
||||||
{
|
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWAttribute::onClicked);
|
||||||
MYGUI_DEBUG_ASSERT( ! attributeNameWidget, "widget already assigned");
|
|
||||||
attributeNameWidget = (*iter)->castType<StaticText>();
|
assignWidget(button, "StatValue");
|
||||||
}
|
//attributeNameWidget = button; // ???
|
||||||
else if (name == "StatValue")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! attributeValueWidget, "widget already assigned");
|
|
||||||
attributeValueWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
else if (name == "StatNameButton")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! attributeNameWidget, "widget already assigned");
|
|
||||||
MyGUI::ButtonPtr button = (*iter)->castType<Button>();
|
|
||||||
attributeNameWidget = button;
|
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWAttribute::onClicked);
|
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWAttribute::onClicked);
|
||||||
}
|
|
||||||
else if (name == "StatValue")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! attributeValueWidget, "widget already assigned");
|
|
||||||
MyGUI::ButtonPtr button = (*iter)->castType<Button>();
|
|
||||||
attributeNameWidget = button;
|
|
||||||
button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWAttribute::onClicked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWAttribute::shutdownWidgetSkin()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MWSpell */
|
/* MWSpell */
|
||||||
@ -301,45 +234,20 @@ void MWSpell::updateWidgets()
|
|||||||
const ESMS::ESMStore &store = mWindowManager->getStore();
|
const ESMS::ESMStore &store = mWindowManager->getStore();
|
||||||
const ESM::Spell *spell = store.spells.search(id);
|
const ESM::Spell *spell = store.spells.search(id);
|
||||||
if (spell)
|
if (spell)
|
||||||
spellNameWidget->setCaption(spell->name);
|
static_cast<MyGUI::TextBox*>(spellNameWidget)->setCaption(spell->name);
|
||||||
else
|
else
|
||||||
spellNameWidget->setCaption("");
|
static_cast<MyGUI::TextBox*>(spellNameWidget)->setCaption("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWSpell::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
|
void MWSpell::initialiseOverride()
|
||||||
{
|
{
|
||||||
Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
|
Base::initialiseOverride();
|
||||||
|
|
||||||
initialiseWidgetSkin(_info);
|
assignWidget(spellNameWidget, "StatName");
|
||||||
}
|
}
|
||||||
|
|
||||||
MWSpell::~MWSpell()
|
MWSpell::~MWSpell()
|
||||||
{
|
|
||||||
shutdownWidgetSkin();
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWSpell::baseChangeWidgetSkin(ResourceSkin* _info)
|
|
||||||
{
|
|
||||||
shutdownWidgetSkin();
|
|
||||||
Base::baseChangeWidgetSkin(_info);
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWSpell::initialiseWidgetSkin(ResourceSkin* _info)
|
|
||||||
{
|
|
||||||
for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
|
|
||||||
{
|
|
||||||
const std::string &name = *(*iter)->_getInternalData<std::string>();
|
|
||||||
if (name == "StatName")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! spellNameWidget, "widget already assigned");
|
|
||||||
spellNameWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWSpell::shutdownWidgetSkin()
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -408,10 +316,10 @@ void MWSpellEffect::updateWidgets()
|
|||||||
spellLine += " on Touch";
|
spellLine += " on Touch";
|
||||||
else if (effect.range == ESM::RT_Target)
|
else if (effect.range == ESM::RT_Target)
|
||||||
spellLine += " on Target";
|
spellLine += " on Target";
|
||||||
textWidget->setCaption(spellLine);
|
static_cast<MyGUI::TextBox*>(textWidget)->setCaption(spellLine);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
textWidget->setCaption("");
|
static_cast<MyGUI::TextBox*>(textWidget)->setCaption("");
|
||||||
}
|
}
|
||||||
if (imageWidget)
|
if (imageWidget)
|
||||||
{
|
{
|
||||||
@ -421,45 +329,16 @@ void MWSpellEffect::updateWidgets()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWSpellEffect::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
|
|
||||||
{
|
|
||||||
Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
|
|
||||||
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
MWSpellEffect::~MWSpellEffect()
|
MWSpellEffect::~MWSpellEffect()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWSpellEffect::baseChangeWidgetSkin(ResourceSkin* _info)
|
void MWSpellEffect::initialiseOverride()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
Base::initialiseOverride();
|
||||||
Base::baseChangeWidgetSkin(_info);
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWSpellEffect::initialiseWidgetSkin(ResourceSkin* _info)
|
assignWidget(textWidget, "Text");
|
||||||
{
|
assignWidget(imageWidget, "Image");
|
||||||
for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
|
|
||||||
{
|
|
||||||
const std::string &name = *(*iter)->_getInternalData<std::string>();
|
|
||||||
if (name == "Text")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! textWidget, "widget already assigned");
|
|
||||||
textWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
else if (name == "Image")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! imageWidget, "widget already assigned");
|
|
||||||
imageWidget = (*iter)->castType<StaticImage>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWSpellEffect::shutdownWidgetSkin()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* MWDynamicStat */
|
/* MWDynamicStat */
|
||||||
@ -491,60 +370,27 @@ void MWDynamicStat::setValue(int cur, int max_)
|
|||||||
{
|
{
|
||||||
std::stringstream out;
|
std::stringstream out;
|
||||||
out << value << "/" << max;
|
out << value << "/" << max;
|
||||||
barTextWidget->setCaption(out.str().c_str());
|
static_cast<MyGUI::TextBox*>(barTextWidget)->setCaption(out.str().c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
barTextWidget->setCaption("");
|
static_cast<MyGUI::TextBox*>(barTextWidget)->setCaption("");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void MWDynamicStat::setTitle(const std::string text)
|
void MWDynamicStat::setTitle(const std::string text)
|
||||||
{
|
{
|
||||||
if (textWidget)
|
if (textWidget)
|
||||||
textWidget->setCaption(text);
|
static_cast<MyGUI::TextBox*>(textWidget)->setCaption(text);
|
||||||
}
|
|
||||||
|
|
||||||
void MWDynamicStat::_initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name)
|
|
||||||
{
|
|
||||||
Base::_initialise(_style, _coord, _align, _info, _parent, _croppedParent, _creator, _name);
|
|
||||||
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MWDynamicStat::~MWDynamicStat()
|
MWDynamicStat::~MWDynamicStat()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWDynamicStat::baseChangeWidgetSkin(ResourceSkin* _info)
|
void MWDynamicStat::initialiseOverride()
|
||||||
{
|
{
|
||||||
shutdownWidgetSkin();
|
Base::initialiseOverride();
|
||||||
Base::baseChangeWidgetSkin(_info);
|
|
||||||
initialiseWidgetSkin(_info);
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWDynamicStat::initialiseWidgetSkin(ResourceSkin* _info)
|
assignWidget(textWidget, "Text");
|
||||||
{
|
assignWidget(barWidget, "Bar");
|
||||||
for (VectorWidgetPtr::iterator iter=mWidgetChildSkin.begin(); iter!=mWidgetChildSkin.end(); ++iter)
|
assignWidget(barTextWidget, "BarText");
|
||||||
{
|
|
||||||
const std::string &name = *(*iter)->_getInternalData<std::string>();
|
|
||||||
if (name == "Text")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! textWidget, "widget already assigned");
|
|
||||||
textWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
else if (name == "Bar")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! barWidget, "widget already assigned");
|
|
||||||
barWidget = (*iter)->castType<Progress>();
|
|
||||||
}
|
|
||||||
else if (name == "BarText")
|
|
||||||
{
|
|
||||||
MYGUI_DEBUG_ASSERT( ! barTextWidget, "widget already assigned");
|
|
||||||
barTextWidget = (*iter)->castType<StaticText>();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MWDynamicStat::shutdownWidgetSkin()
|
|
||||||
{
|
|
||||||
}
|
}
|
||||||
|
@ -45,19 +45,14 @@ namespace MWGui
|
|||||||
*/
|
*/
|
||||||
EventHandle_SkillVoid eventClicked;
|
EventHandle_SkillVoid eventClicked;
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~MWSkill();
|
virtual ~MWSkill();
|
||||||
|
|
||||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
virtual void initialiseOverride();
|
||||||
|
|
||||||
void onClicked(MyGUI::Widget* _sender);
|
void onClicked(MyGUI::Widget* _sender);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
void updateWidgets();
|
void updateWidgets();
|
||||||
|
|
||||||
@ -92,19 +87,14 @@ namespace MWGui
|
|||||||
*/
|
*/
|
||||||
EventHandle_AttributeVoid eventClicked;
|
EventHandle_AttributeVoid eventClicked;
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~MWAttribute();
|
virtual ~MWAttribute();
|
||||||
|
|
||||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
virtual void initialiseOverride();
|
||||||
|
|
||||||
void onClicked(MyGUI::Widget* _sender);
|
void onClicked(MyGUI::Widget* _sender);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
void updateWidgets();
|
void updateWidgets();
|
||||||
|
|
||||||
@ -130,18 +120,12 @@ namespace MWGui
|
|||||||
|
|
||||||
const std::string &getSpellId() const { return id; }
|
const std::string &getSpellId() const { return id; }
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~MWSpell();
|
virtual ~MWSpell();
|
||||||
|
|
||||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
virtual void initialiseOverride();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
void updateWidgets();
|
void updateWidgets();
|
||||||
|
|
||||||
WindowManager* mWindowManager;
|
WindowManager* mWindowManager;
|
||||||
@ -163,17 +147,12 @@ namespace MWGui
|
|||||||
|
|
||||||
const SpellEffectValue &getSpellEffect() const { return effect; }
|
const SpellEffectValue &getSpellEffect() const { return effect; }
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~MWSpellEffect();
|
virtual ~MWSpellEffect();
|
||||||
|
|
||||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
virtual void initialiseOverride();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
void updateWidgets();
|
void updateWidgets();
|
||||||
|
|
||||||
@ -196,17 +175,12 @@ namespace MWGui
|
|||||||
int getValue() const { return value; }
|
int getValue() const { return value; }
|
||||||
int getMax() const { return max; }
|
int getMax() const { return max; }
|
||||||
|
|
||||||
/*internal:*/
|
|
||||||
virtual void _initialise(WidgetStyle _style, const IntCoord& _coord, Align _align, ResourceSkin* _info, Widget* _parent, ICroppedRectangle * _croppedParent, IWidgetCreator * _creator, const std::string& _name);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~MWDynamicStat();
|
virtual ~MWDynamicStat();
|
||||||
|
|
||||||
void baseChangeWidgetSkin(ResourceSkin* _info);
|
virtual void initialiseOverride();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initialiseWidgetSkin(ResourceSkin* _info);
|
|
||||||
void shutdownWidgetSkin();
|
|
||||||
|
|
||||||
int value, max;
|
int value, max;
|
||||||
MyGUI::StaticTextPtr textWidget;
|
MyGUI::StaticTextPtr textWidget;
|
||||||
|
@ -89,7 +89,7 @@ namespace GUI
|
|||||||
{
|
{
|
||||||
MyGUI::WidgetPtr pt;
|
MyGUI::WidgetPtr pt;
|
||||||
getWidget(pt, name);
|
getWidget(pt, name);
|
||||||
pt->setCaption(caption);
|
static_cast<MyGUI::TextBox*>(pt)->setCaption(caption);
|
||||||
}
|
}
|
||||||
|
|
||||||
void setTextColor(const std::string& name, float r, float g, float b)
|
void setTextColor(const std::string& name, float r, float g, float b)
|
||||||
|
@ -18,8 +18,7 @@ void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool
|
|||||||
// manager before the main gui system itself, otherwise the main
|
// manager before the main gui system itself, otherwise the main
|
||||||
// object will get the chance to spit out a few messages before we
|
// object will get the chance to spit out a few messages before we
|
||||||
// can able to disable it.
|
// can able to disable it.
|
||||||
LogManager::initialise();
|
/// \todo - can't avoid this with MyGUI 3.2?
|
||||||
LogManager::setSTDOutputEnabled(logging);
|
|
||||||
|
|
||||||
std::string theLogFile = std::string(MYGUI_PLATFORM_LOG_FILENAME);
|
std::string theLogFile = std::string(MYGUI_PLATFORM_LOG_FILENAME);
|
||||||
if(!logDir.empty())
|
if(!logDir.empty())
|
||||||
@ -29,6 +28,8 @@ void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool
|
|||||||
mPlatform = new OgrePlatform();
|
mPlatform = new OgrePlatform();
|
||||||
mPlatform->initialise(wnd, mgr, "General", theLogFile);
|
mPlatform->initialise(wnd, mgr, "General", theLogFile);
|
||||||
|
|
||||||
|
LogManager::getInstance().setSTDOutputEnabled(logging);
|
||||||
|
|
||||||
// Create GUI
|
// Create GUI
|
||||||
mGui = new Gui();
|
mGui = new Gui();
|
||||||
mGui->initialise("core.xml", theLogFile);
|
mGui->initialise("core.xml", theLogFile);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user