forked from teamnwah/openmw-tes3coop
		
	compile fixes for mygui 3.2
This commit is contained in:
		
							parent
							
								
									66baf9ec81
								
							
						
					
					
						commit
						d451d7bb67
					
				
					 9 changed files with 83 additions and 261 deletions
				
			
		|  | @ -160,7 +160,7 @@ namespace MWGui | |||
|         void onCancelClicked(MyGUI::Widget* _sender); | ||||
| 
 | ||||
|     private: | ||||
|         MyGUI::WidgetPtr      specialization0, specialization1, specialization2; | ||||
|         MyGUI::StaticTextPtr      specialization0, specialization1, specialization2; | ||||
| 
 | ||||
|         ESM::Class::Specialization specializationId; | ||||
|     }; | ||||
|  | @ -287,7 +287,7 @@ namespace MWGui | |||
| 
 | ||||
|     private: | ||||
|         MyGUI::EditPtr          editName; | ||||
|         MyGUI::WidgetPtr        specializationName; | ||||
|         MyGUI::StaticTextPtr    specializationName; | ||||
|         Widgets::MWAttributePtr favoriteAttribute0, favoriteAttribute1; | ||||
|         Widgets::MWSkillPtr     majorSkill[5]; | ||||
|         Widgets::MWSkillPtr     minorSkill[5]; | ||||
|  |  | |||
|  | @ -15,8 +15,8 @@ using namespace Widgets; | |||
| 
 | ||||
| UString DialogeHistory::getColorAtPos(size_t _pos) | ||||
| { | ||||
|     UString colour = TextIterator::convertTagColour(mText->getTextColour()); | ||||
|     TextIterator iterator(mText->getCaption()); | ||||
|     UString colour = TextIterator::convertTagColour(getTextColour()); | ||||
|     TextIterator iterator(getCaption()); | ||||
|     while(iterator.moveNext()) | ||||
|     { | ||||
|         size_t pos = iterator.getPosition(); | ||||
|  | @ -32,9 +32,9 @@ UString DialogeHistory::getColorAtPos(size_t _pos) | |||
| UString DialogeHistory::getColorTextAt(size_t _pos) | ||||
| { | ||||
|     bool breakOnNext = false; | ||||
|     UString colour = TextIterator::convertTagColour(mText->getTextColour()); | ||||
|     UString colour = TextIterator::convertTagColour(getTextColour()); | ||||
|     UString colour2 = colour; | ||||
|     TextIterator iterator(mText->getCaption()); | ||||
|     TextIterator iterator(getCaption()); | ||||
|     TextIterator col_start = iterator; | ||||
|     while(iterator.moveNext()) | ||||
|     { | ||||
|  |  | |||
|  | @ -75,7 +75,7 @@ namespace MWGui | |||
| 
 | ||||
|     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); | ||||
| 
 | ||||
|     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
 | ||||
| 
 | ||||
|     mMainWidget->setSize(size); | ||||
|  | @ -219,7 +220,7 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan | |||
|     mMessageWidget->setOverflowToTheLeft(true); | ||||
|     mMessageWidget->addText(message); | ||||
| 
 | ||||
|     MyGUI::IntSize textSize = mMessageWidget->_getTextSize(); | ||||
|     MyGUI::IntSize textSize = mMessageWidget->getTextSize(); | ||||
| 
 | ||||
|     MyGUI::IntSize gameWindowSize = mMessageBoxManager.mWindowManager->getGui()->getViewSize(); | ||||
| 
 | ||||
|  | @ -243,9 +244,9 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan | |||
| 
 | ||||
|         mButtons.push_back(button); | ||||
| 
 | ||||
|         buttonWidth = button->_getTextSize().width + 2*buttonPadding + buttonLeftPadding; | ||||
|         buttonWidth = button->getTextSize().width + 2*buttonPadding + buttonLeftPadding; | ||||
|         buttonsWidth += buttonWidth; | ||||
|         buttonHeight = button->_getTextSize().height + 2*buttonPadding + buttonTopPadding; | ||||
|         buttonHeight = button->getTextSize().height + 2*buttonPadding + buttonTopPadding; | ||||
| 
 | ||||
|         if(buttonWidth > biggestButtonWidth) | ||||
|         { | ||||
|  | @ -299,8 +300,8 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan | |||
|             buttonCord.left = left; | ||||
|             buttonCord.top = textSize.height + textButtonPadding; | ||||
| 
 | ||||
|             buttonSize.width = (*button)->_getTextSize().width + 2*buttonPadding; | ||||
|             buttonSize.height = (*button)->_getTextSize().height + 2*buttonPadding; | ||||
|             buttonSize.width = (*button)->getTextSize().width + 2*buttonPadding; | ||||
|             buttonSize.height = (*button)->getTextSize().height + 2*buttonPadding; | ||||
| 
 | ||||
|             (*button)->setCoord(buttonCord); | ||||
|             (*button)->setSize(buttonSize); | ||||
|  | @ -347,8 +348,8 @@ InteractiveMessageBox::InteractiveMessageBox(MessageBoxManager& parMessageBoxMan | |||
|         std::vector<MyGUI::ButtonPtr>::const_iterator button; | ||||
|         for(button = mButtons.begin(); button != mButtons.end(); ++button) | ||||
|         { | ||||
|             buttonSize.width = (*button)->_getTextSize().width + buttonPadding*2; | ||||
|             buttonSize.height = (*button)->_getTextSize().height + buttonPadding*2; | ||||
|             buttonSize.width = (*button)->getTextSize().width + buttonPadding*2; | ||||
|             buttonSize.height = (*button)->getTextSize().height + buttonPadding*2; | ||||
| 
 | ||||
|             buttonCord.top = top; | ||||
|             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) | ||||
| { | ||||
|     mMainWidget->setCaption(playerName); | ||||
|     static_cast<MyGUI::Window*>(mMainWidget)->setCaption(playerName); | ||||
| } | ||||
| 
 | ||||
| void StatsWindow::setStyledText(MyGUI::StaticTextPtr widget, ColorStyle style, const std::string &value) | ||||
|  |  | |||
|  | @ -62,24 +62,24 @@ void MWSkill::updateWidgets() | |||
|     { | ||||
|         if (skillId == ESM::Skill::Length) | ||||
|         { | ||||
|             skillNameWidget->setCaption(""); | ||||
|             static_cast<MyGUI::TextBox*>(skillNameWidget)->setCaption(""); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|             const std::string &name = manager->getGameSettingString(ESM::Skill::sSkillNameIds[skillId], ""); | ||||
|             skillNameWidget->setCaption(name); | ||||
|             static_cast<MyGUI::TextBox*>(skillNameWidget)->setCaption(name); | ||||
|         } | ||||
|     } | ||||
|     if (skillValueWidget) | ||||
|     { | ||||
|         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) | ||||
|             skillValueWidget->setState("increased"); | ||||
|             skillValueWidget->_setWidgetState("increased"); | ||||
|         else if (modified < base) | ||||
|             skillValueWidget->setState("decreased"); | ||||
|             skillValueWidget->_setWidgetState("decreased"); | ||||
|         else | ||||
|             skillValueWidget->setState("normal"); | ||||
|             skillValueWidget->_setWidgetState("normal"); | ||||
|     } | ||||
| } | ||||
| 
 | ||||
|  | @ -88,59 +88,25 @@ void MWSkill::onClicked(MyGUI::Widget* _sender) | |||
|     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() | ||||
| { | ||||
|     shutdownWidgetSkin(); | ||||
| } | ||||
| 
 | ||||
| void MWSkill::baseChangeWidgetSkin(ResourceSkin* _info) | ||||
| void MWSkill::initialiseOverride() | ||||
| { | ||||
|     shutdownWidgetSkin(); | ||||
|     Base::baseChangeWidgetSkin(_info); | ||||
|     initialiseWidgetSkin(_info); | ||||
| } | ||||
|     Base::initialiseOverride(); | ||||
| 
 | ||||
| void MWSkill::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( ! 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); | ||||
|         } | ||||
|         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); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|     assignWidget(skillNameWidget, "StatName"); | ||||
|     assignWidget(skillValueWidget, "StatValue"); | ||||
| 
 | ||||
| void MWSkill::shutdownWidgetSkin() | ||||
| { | ||||
|     MyGUI::ButtonPtr button; | ||||
|     assignWidget(button, "StatNameButton"); | ||||
|     //skillNameWidget = button; // ???
 | ||||
|     button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWSkill::onClicked); | ||||
| 
 | ||||
|     assignWidget(button, "StatValue"); | ||||
|     //skillNameWidget = button; // ???
 | ||||
|     button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWSkill::onClicked); | ||||
| } | ||||
| 
 | ||||
| /* MWAttribute */ | ||||
|  | @ -176,7 +142,7 @@ void MWAttribute::updateWidgets() | |||
|     { | ||||
|         if (id < 0 || id >= 8) | ||||
|         { | ||||
|             attributeNameWidget->setCaption(""); | ||||
|             static_cast<MyGUI::TextBox*>(attributeNameWidget)->setCaption(""); | ||||
|         } | ||||
|         else | ||||
|         { | ||||
|  | @ -191,75 +157,42 @@ void MWAttribute::updateWidgets() | |||
|                 "sAttributeLuck" | ||||
|             }; | ||||
|             const std::string &name = manager->getGameSettingString(attributes[id], ""); | ||||
|             attributeNameWidget->setCaption(name); | ||||
|             static_cast<MyGUI::TextBox*>(attributeNameWidget)->setCaption(name); | ||||
|         } | ||||
|     } | ||||
|     if (attributeValueWidget) | ||||
|     { | ||||
|         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) | ||||
|             attributeValueWidget->setState("increased"); | ||||
|             attributeValueWidget->_setWidgetState("increased"); | ||||
|         else if (modified < base) | ||||
|             attributeValueWidget->setState("decreased"); | ||||
|             attributeValueWidget->_setWidgetState("decreased"); | ||||
|         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() | ||||
| { | ||||
|     shutdownWidgetSkin(); | ||||
| } | ||||
| 
 | ||||
| void MWAttribute::baseChangeWidgetSkin(ResourceSkin* _info) | ||||
| void MWAttribute::initialiseOverride() | ||||
| { | ||||
|     shutdownWidgetSkin(); | ||||
|     Base::baseChangeWidgetSkin(_info); | ||||
|     initialiseWidgetSkin(_info); | ||||
| } | ||||
|     Base::initialiseOverride(); | ||||
| 
 | ||||
| void MWAttribute::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( ! attributeNameWidget, "widget already assigned"); | ||||
|             attributeNameWidget = (*iter)->castType<StaticText>(); | ||||
|         } | ||||
|         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); | ||||
|         } | ||||
|         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); | ||||
|         } | ||||
|     } | ||||
| } | ||||
|     assignWidget(attributeNameWidget, "StatName"); | ||||
|     assignWidget(attributeValueWidget, "StatValue"); | ||||
| 
 | ||||
|     MyGUI::ButtonPtr button; | ||||
|     assignWidget(button, "StatNameButton"); | ||||
|     //attributeNameWidget = button; // ???
 | ||||
|     button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWAttribute::onClicked); | ||||
| 
 | ||||
|     assignWidget(button, "StatValue"); | ||||
|     //attributeNameWidget = button; // ???
 | ||||
|     button->eventMouseButtonClick = MyGUI::newDelegate(this, &MWAttribute::onClicked); | ||||
| 
 | ||||
| void MWAttribute::shutdownWidgetSkin() | ||||
| { | ||||
| } | ||||
| 
 | ||||
| /* MWSpell */ | ||||
|  | @ -301,45 +234,20 @@ void MWSpell::updateWidgets() | |||
|         const ESMS::ESMStore &store = mWindowManager->getStore(); | ||||
|         const ESM::Spell *spell = store.spells.search(id); | ||||
|         if (spell) | ||||
|             spellNameWidget->setCaption(spell->name); | ||||
|             static_cast<MyGUI::TextBox*>(spellNameWidget)->setCaption(spell->name); | ||||
|         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() | ||||
| { | ||||
|     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"; | ||||
|             else if (effect.range == ESM::RT_Target) | ||||
|                 spellLine += " on Target"; | ||||
|             textWidget->setCaption(spellLine); | ||||
|             static_cast<MyGUI::TextBox*>(textWidget)->setCaption(spellLine); | ||||
|         } | ||||
|         else | ||||
|             textWidget->setCaption(""); | ||||
|             static_cast<MyGUI::TextBox*>(textWidget)->setCaption(""); | ||||
|     } | ||||
|     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() | ||||
| { | ||||
|     shutdownWidgetSkin(); | ||||
| } | ||||
| 
 | ||||
| void MWSpellEffect::baseChangeWidgetSkin(ResourceSkin* _info) | ||||
| void MWSpellEffect::initialiseOverride() | ||||
| { | ||||
|     shutdownWidgetSkin(); | ||||
|     Base::baseChangeWidgetSkin(_info); | ||||
|     initialiseWidgetSkin(_info); | ||||
| } | ||||
|     Base::initialiseOverride(); | ||||
| 
 | ||||
| void MWSpellEffect::initialiseWidgetSkin(ResourceSkin* _info) | ||||
| { | ||||
|     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() | ||||
| { | ||||
|     assignWidget(textWidget, "Text"); | ||||
|     assignWidget(imageWidget, "Image"); | ||||
| } | ||||
| 
 | ||||
| /* MWDynamicStat */ | ||||
|  | @ -491,60 +370,27 @@ void MWDynamicStat::setValue(int cur, int max_) | |||
|         { | ||||
|             std::stringstream out; | ||||
|             out << value << "/" << max; | ||||
|             barTextWidget->setCaption(out.str().c_str()); | ||||
|             static_cast<MyGUI::TextBox*>(barTextWidget)->setCaption(out.str().c_str()); | ||||
|         } | ||||
|         else | ||||
|             barTextWidget->setCaption(""); | ||||
|             static_cast<MyGUI::TextBox*>(barTextWidget)->setCaption(""); | ||||
|     } | ||||
| } | ||||
| void MWDynamicStat::setTitle(const std::string text) | ||||
| { | ||||
|     if (textWidget) | ||||
|         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); | ||||
|         static_cast<MyGUI::TextBox*>(textWidget)->setCaption(text); | ||||
| } | ||||
| 
 | ||||
| MWDynamicStat::~MWDynamicStat() | ||||
| { | ||||
|     shutdownWidgetSkin(); | ||||
| } | ||||
| 
 | ||||
| void MWDynamicStat::baseChangeWidgetSkin(ResourceSkin* _info) | ||||
| void MWDynamicStat::initialiseOverride() | ||||
| { | ||||
|     shutdownWidgetSkin(); | ||||
|     Base::baseChangeWidgetSkin(_info); | ||||
|     initialiseWidgetSkin(_info); | ||||
| } | ||||
|     Base::initialiseOverride(); | ||||
| 
 | ||||
| void MWDynamicStat::initialiseWidgetSkin(ResourceSkin* _info) | ||||
| { | ||||
|     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 == "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() | ||||
| { | ||||
|     assignWidget(textWidget, "Text"); | ||||
|     assignWidget(barWidget, "Bar"); | ||||
|     assignWidget(barTextWidget, "BarText"); | ||||
| } | ||||
|  |  | |||
|  | @ -45,19 +45,14 @@ namespace MWGui | |||
|             */ | ||||
|             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: | ||||
|             virtual ~MWSkill(); | ||||
| 
 | ||||
|             void baseChangeWidgetSkin(ResourceSkin* _info); | ||||
|             virtual void initialiseOverride(); | ||||
| 
 | ||||
|             void onClicked(MyGUI::Widget* _sender); | ||||
| 
 | ||||
|         private: | ||||
|             void initialiseWidgetSkin(ResourceSkin* _info); | ||||
|             void shutdownWidgetSkin(); | ||||
| 
 | ||||
|             void updateWidgets(); | ||||
| 
 | ||||
|  | @ -92,19 +87,14 @@ namespace MWGui | |||
|             */ | ||||
|             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: | ||||
|             virtual ~MWAttribute(); | ||||
| 
 | ||||
|             void baseChangeWidgetSkin(ResourceSkin* _info); | ||||
|             virtual void initialiseOverride(); | ||||
| 
 | ||||
|             void onClicked(MyGUI::Widget* _sender); | ||||
| 
 | ||||
|         private: | ||||
|             void initialiseWidgetSkin(ResourceSkin* _info); | ||||
|             void shutdownWidgetSkin(); | ||||
| 
 | ||||
|             void updateWidgets(); | ||||
| 
 | ||||
|  | @ -130,18 +120,12 @@ namespace MWGui | |||
| 
 | ||||
|             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: | ||||
|             virtual ~MWSpell(); | ||||
| 
 | ||||
|             void baseChangeWidgetSkin(ResourceSkin* _info); | ||||
| 		virtual void initialiseOverride(); | ||||
| 
 | ||||
|         private: | ||||
|             void initialiseWidgetSkin(ResourceSkin* _info); | ||||
|             void shutdownWidgetSkin(); | ||||
| 
 | ||||
|             void updateWidgets(); | ||||
| 
 | ||||
|             WindowManager* mWindowManager; | ||||
|  | @ -163,17 +147,12 @@ namespace MWGui | |||
| 
 | ||||
|             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: | ||||
|             virtual ~MWSpellEffect(); | ||||
| 
 | ||||
|             void baseChangeWidgetSkin(ResourceSkin* _info); | ||||
| 
 | ||||
|             virtual void initialiseOverride(); | ||||
|              | ||||
|         private: | ||||
|             void initialiseWidgetSkin(ResourceSkin* _info); | ||||
|             void shutdownWidgetSkin(); | ||||
| 
 | ||||
|             void updateWidgets(); | ||||
| 
 | ||||
|  | @ -196,17 +175,12 @@ namespace MWGui | |||
|             int getValue() const { return value; } | ||||
|             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: | ||||
|             virtual ~MWDynamicStat(); | ||||
| 
 | ||||
|             void baseChangeWidgetSkin(ResourceSkin* _info); | ||||
|             virtual void initialiseOverride(); | ||||
| 
 | ||||
|         private: | ||||
|             void initialiseWidgetSkin(ResourceSkin* _info); | ||||
|             void shutdownWidgetSkin(); | ||||
| 
 | ||||
|             int value, max; | ||||
|             MyGUI::StaticTextPtr textWidget; | ||||
|  |  | |||
|  | @ -89,7 +89,7 @@ namespace GUI | |||
|     { | ||||
|       MyGUI::WidgetPtr pt; | ||||
|       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) | ||||
|  |  | |||
|  | @ -18,8 +18,7 @@ void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool | |||
|   // manager before the main gui system itself, otherwise the main
 | ||||
|   // object will get the chance to spit out a few messages before we
 | ||||
|   // can able to disable it.
 | ||||
|   LogManager::initialise(); | ||||
|   LogManager::setSTDOutputEnabled(logging); | ||||
|   /// \todo - can't avoid this with MyGUI 3.2?
 | ||||
| 
 | ||||
|   std::string theLogFile = std::string(MYGUI_PLATFORM_LOG_FILENAME); | ||||
|   if(!logDir.empty()) | ||||
|  | @ -29,6 +28,8 @@ void MyGUIManager::setup(Ogre::RenderWindow *wnd, Ogre::SceneManager *mgr, bool | |||
|   mPlatform = new OgrePlatform(); | ||||
|   mPlatform->initialise(wnd, mgr, "General", theLogFile); | ||||
| 
 | ||||
|   LogManager::getInstance().setSTDOutputEnabled(logging); | ||||
| 
 | ||||
|   // Create GUI
 | ||||
|   mGui = new Gui(); | ||||
|   mGui->initialise("core.xml", theLogFile); | ||||
|  |  | |||
		Loading…
	
		Reference in a new issue