mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 04:39:43 +00:00
tooltip now contains info about item enchantment
This commit is contained in:
parent
397a978145
commit
f733382f74
12 changed files with 153 additions and 42 deletions
|
@ -242,6 +242,8 @@ namespace MWClass
|
||||||
text += MWGui::ToolTips::getMiscString(ref->base->script, "Script");
|
text += MWGui::ToolTips::getMiscString(ref->base->script, "Script");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info.enchant = ref->base->enchant;
|
||||||
|
|
||||||
info.text = text;
|
info.text = text;
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
|
|
|
@ -130,6 +130,8 @@ namespace MWClass
|
||||||
text += MWGui::ToolTips::getMiscString(ref->base->script, "Script");
|
text += MWGui::ToolTips::getMiscString(ref->base->script, "Script");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info.enchant = ref->base->enchant;
|
||||||
|
|
||||||
info.text = text;
|
info.text = text;
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
|
|
|
@ -195,6 +195,8 @@ namespace MWClass
|
||||||
text += MWGui::ToolTips::getMiscString(ref->base->script, "Script");
|
text += MWGui::ToolTips::getMiscString(ref->base->script, "Script");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
info.enchant = ref->base->enchant;
|
||||||
|
|
||||||
info.text = text;
|
info.text = text;
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
|
|
|
@ -328,35 +328,7 @@ namespace MWClass
|
||||||
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight);
|
text += "\n" + store.gameSettings.search("sWeight")->str + ": " + MWGui::ToolTips::toString(ref->base->data.weight);
|
||||||
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
|
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
|
||||||
|
|
||||||
// this should be going into a custom mygui widget MWEnchantment
|
info.enchant = ref->base->enchant;
|
||||||
/*
|
|
||||||
// enchantments
|
|
||||||
if (ref->base->enchant != "")
|
|
||||||
{
|
|
||||||
const ESM::Enchantment* enchant = environment.mWorld->getStore().enchants.search(ref->base->enchant);
|
|
||||||
if (enchant->data.type == ESM::Enchantment::CastOnce)
|
|
||||||
text += "\n" + environment.mWorld->getStore().gameSettings.search("sItemCastOnce")->str;
|
|
||||||
else if (enchant->data.type == ESM::Enchantment::WhenStrikes)
|
|
||||||
text += "\n" + environment.mWorld->getStore().gameSettings.search("sItemCastWhenStrikes")->str;
|
|
||||||
else if (enchant->data.type == ESM::Enchantment::WhenUsed)
|
|
||||||
text += "\n" + environment.mWorld->getStore().gameSettings.search("sItemCastWhenUsed")->str;
|
|
||||||
else if (enchant->data.type == ESM::Enchantment::ConstantEffect)
|
|
||||||
text += "\n" + environment.mWorld->getStore().gameSettings.search("sItemCastConstant")->str;
|
|
||||||
|
|
||||||
if (enchant->data.type == ESM::Enchantment::WhenStrikes
|
|
||||||
|| enchant->data.type == ESM::Enchantment::WhenUsed)
|
|
||||||
{
|
|
||||||
/// \todo store the current enchantment charge somewhere
|
|
||||||
// info.currentCharge = enchant->data.charge;
|
|
||||||
//info.totalCharge = enchant->data.charge;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
if (ref->base->enchant != "")
|
|
||||||
{
|
|
||||||
const ESM::Enchantment* enchant = store.enchants.search(ref->base->enchant);
|
|
||||||
info.enchant = enchant;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||||
text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner");
|
text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner");
|
||||||
|
|
|
@ -50,9 +50,9 @@ DialogueWindow::DialogueWindow(WindowManager& parWindowManager)
|
||||||
|
|
||||||
//An EditBox cannot receive mouse click events, so we use an
|
//An EditBox cannot receive mouse click events, so we use an
|
||||||
//invisible widget on top of the editbox to receive them
|
//invisible widget on top of the editbox to receive them
|
||||||
/// \todo scrolling the dialogue history with the mouse wheel doesn't work using this solution
|
|
||||||
getWidget(eventbox, "EventBox");
|
getWidget(eventbox, "EventBox");
|
||||||
eventbox->eventMouseButtonClick += MyGUI::newDelegate(this, &DialogueWindow::onHistoryClicked);
|
eventbox->eventMouseButtonClick += MyGUI::newDelegate(this, &DialogueWindow::onHistoryClicked);
|
||||||
|
eventbox->eventMouseWheel += MyGUI::newDelegate(this, &DialogueWindow::onMouseWheel);
|
||||||
|
|
||||||
//Topics list
|
//Topics list
|
||||||
getWidget(topicsList, "TopicsList");
|
getWidget(topicsList, "TopicsList");
|
||||||
|
@ -88,6 +88,14 @@ void DialogueWindow::onHistoryClicked(MyGUI::Widget* _sender)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DialogueWindow::onMouseWheel(MyGUI::Widget* _sender, int _rel)
|
||||||
|
{
|
||||||
|
if (history->getVScrollPosition() - _rel*0.3 < 0)
|
||||||
|
history->setVScrollPosition(0);
|
||||||
|
else
|
||||||
|
history->setVScrollPosition(history->getVScrollPosition() - _rel*0.3);
|
||||||
|
}
|
||||||
|
|
||||||
void DialogueWindow::open()
|
void DialogueWindow::open()
|
||||||
{
|
{
|
||||||
topicsList->removeAllItems();
|
topicsList->removeAllItems();
|
||||||
|
|
|
@ -45,6 +45,7 @@ namespace MWGui
|
||||||
void onSelectTopic(MyGUI::ListBox* _sender, size_t _index);
|
void onSelectTopic(MyGUI::ListBox* _sender, size_t _index);
|
||||||
void onByeClicked(MyGUI::Widget* _sender);
|
void onByeClicked(MyGUI::Widget* _sender);
|
||||||
void onHistoryClicked(MyGUI::Widget* _sender);
|
void onHistoryClicked(MyGUI::Widget* _sender);
|
||||||
|
void onMouseWheel(MyGUI::Widget* _sender, int _rel);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void updateOptions();
|
void updateOptions();
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
#include "tooltips.hpp"
|
#include "tooltips.hpp"
|
||||||
#include "window_manager.hpp"
|
|
||||||
|
|
||||||
|
#include "window_manager.hpp"
|
||||||
|
#include "widgets.hpp"
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
|
#include "../mwworld/world.hpp"
|
||||||
|
#include "../mwbase/environment.hpp"
|
||||||
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
|
@ -177,6 +180,21 @@ IntSize ToolTips::createToolTip(const ToolTipInfo& info)
|
||||||
if (text.size() > 0 && text[0] == '\n')
|
if (text.size() > 0 && text[0] == '\n')
|
||||||
text.erase(0, 1);
|
text.erase(0, 1);
|
||||||
|
|
||||||
|
const ESM::Enchantment* enchant;
|
||||||
|
const ESMS::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
if (info.enchant != "")
|
||||||
|
{
|
||||||
|
enchant = store.enchants.search(info.enchant);
|
||||||
|
if (enchant->data.type == ESM::Enchantment::CastOnce)
|
||||||
|
text += "\n" + store.gameSettings.search("sItemCastOnce")->str;
|
||||||
|
else if (enchant->data.type == ESM::Enchantment::WhenStrikes)
|
||||||
|
text += "\n" + store.gameSettings.search("sItemCastWhenStrikes")->str;
|
||||||
|
else if (enchant->data.type == ESM::Enchantment::WhenUsed)
|
||||||
|
text += "\n" + store.gameSettings.search("sItemCastWhenUsed")->str;
|
||||||
|
else if (enchant->data.type == ESM::Enchantment::ConstantEffect)
|
||||||
|
text += "\n" + store.gameSettings.search("sItemCastConstant")->str;
|
||||||
|
}
|
||||||
|
|
||||||
// this the maximum width of the tooltip before it starts word-wrapping
|
// this the maximum width of the tooltip before it starts word-wrapping
|
||||||
setCoord(0, 0, 300, 300);
|
setCoord(0, 0, 300, 300);
|
||||||
|
|
||||||
|
@ -207,13 +225,55 @@ IntSize ToolTips::createToolTip(const ToolTipInfo& info)
|
||||||
IntSize totalSize = IntSize( std::max(textSize.width, captionSize.width + ((image != "") ? imageCaptionHPadding : 0)),
|
IntSize totalSize = IntSize( std::max(textSize.width, captionSize.width + ((image != "") ? imageCaptionHPadding : 0)),
|
||||||
((text != "") ? textSize.height + imageCaptionVPadding : 0) + captionHeight );
|
((text != "") ? textSize.height + imageCaptionVPadding : 0) + captionHeight );
|
||||||
|
|
||||||
if (image != "")
|
if (info.enchant != "")
|
||||||
{
|
{
|
||||||
ImageBox* imageWidget = mDynamicToolTipBox->createWidget<ImageBox>("ImageBox",
|
Widget* enchantArea = mDynamicToolTipBox->createWidget<Widget>("",
|
||||||
IntCoord((totalSize.width - captionSize.width - imageCaptionHPadding)/2, 0, imageSize, imageSize),
|
IntCoord(0, totalSize.height, 300, 300-totalSize.height),
|
||||||
Align::Left | Align::Top, "ToolTipImage");
|
Align::Stretch, "ToolTipEnchantArea");
|
||||||
imageWidget->setImageTexture(realImage);
|
|
||||||
imageWidget->setPosition (imageWidget->getPosition() + padding);
|
IntCoord coord(0, 6, totalSize.width, 24);
|
||||||
|
|
||||||
|
Widgets::MWEnchantmentPtr enchantWidget = enchantArea->createWidget<Widgets::MWEnchantment>
|
||||||
|
("MW_StatName", coord, Align::Default, "ToolTipEnchantWidget");
|
||||||
|
enchantWidget->setWindowManager(mWindowManager);
|
||||||
|
enchantWidget->setEnchantmentId(info.enchant);
|
||||||
|
|
||||||
|
std::vector<MyGUI::WidgetPtr> enchantEffectItems;
|
||||||
|
enchantWidget->createEffectWidgets(enchantEffectItems, enchantArea, coord, true, (enchant->data.type == ESM::Enchantment::ConstantEffect));
|
||||||
|
totalSize.height += coord.top-6;
|
||||||
|
totalSize.width = std::max(totalSize.width, coord.width);
|
||||||
|
|
||||||
|
if (enchant->data.type == ESM::Enchantment::WhenStrikes
|
||||||
|
|| enchant->data.type == ESM::Enchantment::WhenUsed)
|
||||||
|
{
|
||||||
|
/// \todo store the current enchantment charge somewhere
|
||||||
|
int charge = enchant->data.charge;
|
||||||
|
|
||||||
|
const int chargeWidth = 204;
|
||||||
|
|
||||||
|
TextBox* chargeText = enchantArea->createWidget<TextBox>("SandText", IntCoord(0, 0, 10, 18), Align::Default, "ToolTipEnchantChargeText");
|
||||||
|
chargeText->setCaption(store.gameSettings.search("sCharges")->str);
|
||||||
|
chargeText->setProperty("Static", "true");
|
||||||
|
const int chargeTextWidth = chargeText->getTextSize().width + 5;
|
||||||
|
|
||||||
|
const int chargeAndTextWidth = chargeWidth + chargeTextWidth;
|
||||||
|
chargeText->setCoord((totalSize.width - chargeAndTextWidth)/2, coord.top+6, chargeTextWidth, 18);
|
||||||
|
|
||||||
|
IntCoord chargeCoord;
|
||||||
|
if (totalSize.width < chargeWidth)
|
||||||
|
{
|
||||||
|
totalSize.width = chargeWidth;
|
||||||
|
chargeCoord = IntCoord(0, coord.top+6, chargeWidth, 18);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
chargeCoord = IntCoord((totalSize.width - chargeAndTextWidth)/2 + chargeTextWidth, coord.top+6, chargeWidth, 18);
|
||||||
|
}
|
||||||
|
Widgets::MWDynamicStatPtr chargeWidget = enchantArea->createWidget<Widgets::MWDynamicStat>
|
||||||
|
("MW_ChargeBar", chargeCoord, Align::Default, "ToolTipEnchantCharge");
|
||||||
|
chargeWidget->setValue(charge, charge);
|
||||||
|
totalSize.height += 24;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
captionWidget->setCoord( (totalSize.width - captionSize.width)/2 + imageSize,
|
captionWidget->setCoord( (totalSize.width - captionSize.width)/2 + imageSize,
|
||||||
|
@ -224,6 +284,15 @@ IntSize ToolTips::createToolTip(const ToolTipInfo& info)
|
||||||
captionWidget->setPosition (captionWidget->getPosition() + padding);
|
captionWidget->setPosition (captionWidget->getPosition() + padding);
|
||||||
textWidget->setPosition (textWidget->getPosition() + IntPoint(0, padding.top)); // only apply vertical padding, the horizontal works automatically due to Align::HCenter
|
textWidget->setPosition (textWidget->getPosition() + IntPoint(0, padding.top)); // only apply vertical padding, the horizontal works automatically due to Align::HCenter
|
||||||
|
|
||||||
|
if (image != "")
|
||||||
|
{
|
||||||
|
ImageBox* imageWidget = mDynamicToolTipBox->createWidget<ImageBox>("ImageBox",
|
||||||
|
IntCoord((totalSize.width - captionSize.width - imageCaptionHPadding)/2, 0, imageSize, imageSize),
|
||||||
|
Align::Left | Align::Top, "ToolTipImage");
|
||||||
|
imageWidget->setImageTexture(realImage);
|
||||||
|
imageWidget->setPosition (imageWidget->getPosition() + padding);
|
||||||
|
}
|
||||||
|
|
||||||
totalSize += IntSize(padding.left*2, padding.top*2);
|
totalSize += IntSize(padding.left*2, padding.top*2);
|
||||||
|
|
||||||
return totalSize;
|
return totalSize;
|
||||||
|
|
|
@ -14,7 +14,6 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ToolTipInfo() :
|
ToolTipInfo() :
|
||||||
enchant(0),
|
|
||||||
effects(0)
|
effects(0)
|
||||||
{
|
{
|
||||||
};
|
};
|
||||||
|
@ -24,7 +23,7 @@ namespace MWGui
|
||||||
std::string icon;
|
std::string icon;
|
||||||
|
|
||||||
// enchantment (for cloth, armor, weapons)
|
// enchantment (for cloth, armor, weapons)
|
||||||
const ESM::Enchantment* enchant;
|
std::string enchant;
|
||||||
|
|
||||||
// effects (for potions, ingredients)
|
// effects (for potions, ingredients)
|
||||||
const ESM::EffectList* effects;
|
const ESM::EffectList* effects;
|
||||||
|
|
|
@ -238,6 +238,7 @@ void MWSpell::createEffectWidgets(std::vector<MyGUI::WidgetPtr> &effects, MyGUI:
|
||||||
effect->setSpellEffect(*it);
|
effect->setSpellEffect(*it);
|
||||||
effects.push_back(effect);
|
effects.push_back(effect);
|
||||||
coord.top += effect->getHeight();
|
coord.top += effect->getHeight();
|
||||||
|
coord.width = std::max(coord.width, effect->getRequestedWidth());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,22 +279,49 @@ void MWEnchantment::setEnchantmentId(const std::string &enchantId)
|
||||||
updateWidgets();
|
updateWidgets();
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWEnchantment::createEffectWidgets(std::vector<MyGUI::WidgetPtr> &effects, MyGUI::WidgetPtr creator, MyGUI::IntCoord &coord)
|
void MWEnchantment::createEffectWidgets(std::vector<MyGUI::WidgetPtr> &effects, MyGUI::WidgetPtr creator, MyGUI::IntCoord &coord, bool center, bool constant)
|
||||||
{
|
{
|
||||||
const ESMS::ESMStore &store = mWindowManager->getStore();
|
const ESMS::ESMStore &store = mWindowManager->getStore();
|
||||||
const ESM::Enchantment *enchant = store.enchants.search(id);
|
const ESM::Enchantment *enchant = store.enchants.search(id);
|
||||||
MYGUI_ASSERT(enchant, "enchantment with id '" << id << "' not found");
|
MYGUI_ASSERT(enchant, "enchantment with id '" << id << "' not found");
|
||||||
|
|
||||||
|
// We don't know the width of all the elements beforehand, so we do it in
|
||||||
|
// 2 steps: first, create all widgets and check their width
|
||||||
MWSpellEffectPtr effect = nullptr;
|
MWSpellEffectPtr effect = nullptr;
|
||||||
std::vector<ESM::ENAMstruct>::const_iterator end = enchant->effects.list.end();
|
std::vector<ESM::ENAMstruct>::const_iterator end = enchant->effects.list.end();
|
||||||
|
int maxwidth = coord.width;
|
||||||
for (std::vector<ESM::ENAMstruct>::const_iterator it = enchant->effects.list.begin(); it != end; ++it)
|
for (std::vector<ESM::ENAMstruct>::const_iterator it = enchant->effects.list.begin(); it != end; ++it)
|
||||||
{
|
{
|
||||||
effect = creator->createWidget<MWSpellEffect>("MW_EffectImage", coord, MyGUI::Align::Default);
|
effect = creator->createWidget<MWSpellEffect>("MW_EffectImage", coord, MyGUI::Align::Default);
|
||||||
effect->setWindowManager(mWindowManager);
|
effect->setWindowManager(mWindowManager);
|
||||||
effect->setSpellEffect(*it);
|
effect->setSpellEffect(*it);
|
||||||
|
effect->setConstant(constant);
|
||||||
effects.push_back(effect);
|
effects.push_back(effect);
|
||||||
|
|
||||||
|
if (effect->getRequestedWidth() > maxwidth)
|
||||||
|
maxwidth = effect->getRequestedWidth();
|
||||||
|
|
||||||
coord.top += effect->getHeight();
|
coord.top += effect->getHeight();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// then adjust the size for all widgets
|
||||||
|
for (std::vector<MyGUI::WidgetPtr>::iterator it = effects.begin(); it != effects.end(); ++it)
|
||||||
|
{
|
||||||
|
effect = static_cast<MWSpellEffectPtr>(*it);
|
||||||
|
bool needcenter = center && (maxwidth > effect->getRequestedWidth());
|
||||||
|
int diff = maxwidth - effect->getRequestedWidth();
|
||||||
|
if (needcenter)
|
||||||
|
{
|
||||||
|
effect->setCoord(diff/2, effect->getCoord().top, effect->getRequestedWidth(), effect->getCoord().height);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
effect->setCoord(0, effect->getCoord().top, effect->getRequestedWidth(), effect->getCoord().height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// inform the parent about width
|
||||||
|
coord.width = maxwidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
void MWEnchantment::updateWidgets()
|
void MWEnchantment::updateWidgets()
|
||||||
|
@ -315,6 +343,8 @@ MWSpellEffect::MWSpellEffect()
|
||||||
: mWindowManager(nullptr)
|
: mWindowManager(nullptr)
|
||||||
, imageWidget(nullptr)
|
, imageWidget(nullptr)
|
||||||
, textWidget(nullptr)
|
, textWidget(nullptr)
|
||||||
|
, mRequestedWidth(0)
|
||||||
|
, mIsConstant(0)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -366,7 +396,7 @@ void MWSpellEffect::updateWidgets()
|
||||||
spellLine += " " + boost::lexical_cast<std::string>(effect.magnMin) + " " + ((effect.magnMin == 1) ? pt : pts);
|
spellLine += " " + boost::lexical_cast<std::string>(effect.magnMin) + " " + ((effect.magnMin == 1) ? pt : pts);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
spellLine += " " + boost::lexical_cast<std::string>(effect.magnMin) + to + boost::lexical_cast<std::string>(effect.magnMin) + " " + pts;
|
spellLine += " " + boost::lexical_cast<std::string>(effect.magnMin) + to + boost::lexical_cast<std::string>(effect.magnMax) + " " + pts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -388,6 +418,7 @@ void MWSpellEffect::updateWidgets()
|
||||||
}
|
}
|
||||||
|
|
||||||
static_cast<MyGUI::TextBox*>(textWidget)->setCaption(spellLine);
|
static_cast<MyGUI::TextBox*>(textWidget)->setCaption(spellLine);
|
||||||
|
mRequestedWidth = textWidget->getTextSize().width + 24;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
static_cast<MyGUI::TextBox*>(textWidget)->setCaption("");
|
static_cast<MyGUI::TextBox*>(textWidget)->setCaption("");
|
||||||
|
|
|
@ -119,6 +119,14 @@ namespace MWGui
|
||||||
|
|
||||||
void setWindowManager(WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
|
void setWindowManager(WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
|
||||||
void setSpellId(const std::string &id);
|
void setSpellId(const std::string &id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param vector to store the created effect widgets
|
||||||
|
* @param parent widget
|
||||||
|
* @param coordinates to use, will be expanded if more space is needed
|
||||||
|
* @param spell category, if this is 0, this means the spell effects are permanent and won't display e.g. duration
|
||||||
|
* @param center the effect widgets horizontally
|
||||||
|
*/
|
||||||
void createEffectWidgets(std::vector<MyGUI::WidgetPtr> &effects, MyGUI::WidgetPtr creator, MyGUI::IntCoord &coord, const int category);
|
void createEffectWidgets(std::vector<MyGUI::WidgetPtr> &effects, MyGUI::WidgetPtr creator, MyGUI::IntCoord &coord, const int category);
|
||||||
|
|
||||||
const std::string &getSpellId() const { return id; }
|
const std::string &getSpellId() const { return id; }
|
||||||
|
@ -147,7 +155,15 @@ namespace MWGui
|
||||||
|
|
||||||
void setWindowManager(WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
|
void setWindowManager(WindowManager* parWindowManager) { mWindowManager = parWindowManager; }
|
||||||
void setEnchantmentId(const std::string &enchantId);
|
void setEnchantmentId(const std::string &enchantId);
|
||||||
void createEffectWidgets(std::vector<MyGUI::WidgetPtr> &effects, MyGUI::WidgetPtr creator, MyGUI::IntCoord &coord);
|
|
||||||
|
/**
|
||||||
|
* @param vector to store the created effect widgets
|
||||||
|
* @param parent widget
|
||||||
|
* @param coordinates to use, will be expanded if more space is needed
|
||||||
|
* @param center the effect widgets horizontally
|
||||||
|
* @param are the effects of this enchantment constant?
|
||||||
|
*/
|
||||||
|
void createEffectWidgets(std::vector<MyGUI::WidgetPtr> &effects, MyGUI::WidgetPtr creator, MyGUI::IntCoord &coord, bool center, bool constant);
|
||||||
|
|
||||||
const std::string &getSpellId() const { return id; }
|
const std::string &getSpellId() const { return id; }
|
||||||
|
|
||||||
|
@ -180,6 +196,8 @@ namespace MWGui
|
||||||
|
|
||||||
const SpellEffectValue &getSpellEffect() const { return effect; }
|
const SpellEffectValue &getSpellEffect() const { return effect; }
|
||||||
|
|
||||||
|
int getRequestedWidth() const { return mRequestedWidth; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~MWSpellEffect();
|
virtual ~MWSpellEffect();
|
||||||
|
|
||||||
|
@ -194,6 +212,7 @@ namespace MWGui
|
||||||
bool mIsConstant; // constant effect
|
bool mIsConstant; // constant effect
|
||||||
MyGUI::ImageBox* imageWidget;
|
MyGUI::ImageBox* imageWidget;
|
||||||
MyGUI::TextBox* textWidget;
|
MyGUI::TextBox* textWidget;
|
||||||
|
int mRequestedWidth;
|
||||||
};
|
};
|
||||||
typedef MWSpellEffect* MWSpellEffectPtr;
|
typedef MWSpellEffect* MWSpellEffectPtr;
|
||||||
|
|
||||||
|
|
|
@ -104,6 +104,7 @@ WindowManager::WindowManager(
|
||||||
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWSkill>("Widget");
|
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWSkill>("Widget");
|
||||||
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWAttribute>("Widget");
|
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWAttribute>("Widget");
|
||||||
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWSpell>("Widget");
|
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWSpell>("Widget");
|
||||||
|
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWEnchantment>("Widget");
|
||||||
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWSpellEffect>("Widget");
|
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWSpellEffect>("Widget");
|
||||||
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWDynamicStat>("Widget");
|
MyGUI::FactoryManager::getInstance().registerFactory<MWGui::Widgets::MWDynamicStat>("Widget");
|
||||||
|
|
||||||
|
|
|
@ -93,6 +93,11 @@
|
||||||
<Child type="TextBox" skin="SandText" offset = "24 0 176 20" align = "ALIGN_VCENTRE ALIGN_HSTRETCH" name = "Text" />
|
<Child type="TextBox" skin="SandText" offset = "24 0 176 20" align = "ALIGN_VCENTRE ALIGN_HSTRETCH" name = "Text" />
|
||||||
</Skin>
|
</Skin>
|
||||||
|
|
||||||
|
<Skin name = "MW_ChargeBar" size = "204 18">
|
||||||
|
<Child type="ProgressBar" skin="MW_Progress_Red" offset = "0 0 204 18" align = "ALIGN_RIGHT ALIGN_TOP" name = "Bar" />
|
||||||
|
<Child type="TextBox" skin="SandTextC" offset = "0 0 204 18" align = "ALIGN_RIGHT ALIGN_TOP" name = "BarText" />
|
||||||
|
</Skin>
|
||||||
|
|
||||||
<Skin name = "MW_DynamicStat_Red" size = "204 18">
|
<Skin name = "MW_DynamicStat_Red" size = "204 18">
|
||||||
<Child type="TextBox" skin="SandText" offset = "0 0 100 18" align = "ALIGN_LEFT ALIGN_TOP" name = "Text" />
|
<Child type="TextBox" skin="SandText" offset = "0 0 100 18" align = "ALIGN_LEFT ALIGN_TOP" name = "Text" />
|
||||||
<Child type="ProgressBar" skin="MW_Progress_Red" offset = "74 0 130 18" align = "ALIGN_RIGHT ALIGN_TOP" name = "Bar" />
|
<Child type="ProgressBar" skin="MW_Progress_Red" offset = "74 0 130 18" align = "ALIGN_RIGHT ALIGN_TOP" name = "Bar" />
|
||||||
|
|
Loading…
Reference in a new issue