forked from mirror/openmw-tes3mp
fix the spell tooltips to show the spell target
This commit is contained in:
parent
058f0b665c
commit
432c089434
3 changed files with 9 additions and 1 deletions
|
@ -137,6 +137,7 @@ namespace MWClass
|
||||||
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);
|
||||||
|
|
||||||
info.effects = MWGui::Widgets::MWEffectList::effectListFromESM(&ref->base->effects);
|
info.effects = MWGui::Widgets::MWEffectList::effectListFromESM(&ref->base->effects);
|
||||||
|
info.isPotion = true;
|
||||||
|
|
||||||
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");
|
||||||
|
|
|
@ -186,6 +186,7 @@ void ToolTips::onFrame(float frameDuration)
|
||||||
params.mMagnMax = it->magnMax;
|
params.mMagnMax = it->magnMax;
|
||||||
params.mRange = it->range;
|
params.mRange = it->range;
|
||||||
params.mIsConstant = (spell->data.type == ESM::Spell::ST_Ability);
|
params.mIsConstant = (spell->data.type == ESM::Spell::ST_Ability);
|
||||||
|
params.mNoTarget = false;
|
||||||
effects.push_back(params);
|
effects.push_back(params);
|
||||||
}
|
}
|
||||||
info.effects = effects;
|
info.effects = effects;
|
||||||
|
@ -420,7 +421,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
||||||
effectsWidget->setEffectList(info.effects);
|
effectsWidget->setEffectList(info.effects);
|
||||||
|
|
||||||
std::vector<MyGUI::WidgetPtr> effectItems;
|
std::vector<MyGUI::WidgetPtr> effectItems;
|
||||||
effectsWidget->createEffectWidgets(effectItems, effectArea, coord, true, Widgets::MWEffectList::EF_NoTarget);
|
effectsWidget->createEffectWidgets(effectItems, effectArea, coord, true, info.isPotion ? Widgets::MWEffectList::EF_NoTarget : 0);
|
||||||
totalSize.height += coord.top-6;
|
totalSize.height += coord.top-6;
|
||||||
totalSize.width = std::max(totalSize.width, coord.width);
|
totalSize.width = std::max(totalSize.width, coord.width);
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,10 @@ namespace MWGui
|
||||||
struct ToolTipInfo
|
struct ToolTipInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
ToolTipInfo()
|
||||||
|
: isPotion(false)
|
||||||
|
{}
|
||||||
|
|
||||||
std::string caption;
|
std::string caption;
|
||||||
std::string text;
|
std::string text;
|
||||||
std::string icon;
|
std::string icon;
|
||||||
|
@ -22,6 +26,8 @@ namespace MWGui
|
||||||
|
|
||||||
// effects (for potions, ingredients)
|
// effects (for potions, ingredients)
|
||||||
Widgets::SpellEffectList effects;
|
Widgets::SpellEffectList effects;
|
||||||
|
|
||||||
|
bool isPotion; // potions do not show target in the tooltip
|
||||||
};
|
};
|
||||||
|
|
||||||
class ToolTips : public OEngine::GUI::Layout
|
class ToolTips : public OEngine::GUI::Layout
|
||||||
|
|
Loading…
Reference in a new issue