mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-17 10:10:23 +00:00
Merge remote-tracking branch 'scrawl/master'
This commit is contained in:
commit
9ff4f5e6b7
@ -137,6 +137,7 @@ namespace MWClass
|
||||
text += MWGui::ToolTips::getValueString(ref->base->data.value, store.gameSettings.search("sValue")->str);
|
||||
|
||||
info.effects = MWGui::Widgets::MWEffectList::effectListFromESM(&ref->base->effects);
|
||||
info.isPotion = true;
|
||||
|
||||
if (MWBase::Environment::get().getWindowManager()->getFullHelp()) {
|
||||
text += MWGui::ToolTips::getMiscString(ref->ref.owner, "Owner");
|
||||
|
@ -186,6 +186,7 @@ void ToolTips::onFrame(float frameDuration)
|
||||
params.mMagnMax = it->magnMax;
|
||||
params.mRange = it->range;
|
||||
params.mIsConstant = (spell->data.type == ESM::Spell::ST_Ability);
|
||||
params.mNoTarget = false;
|
||||
effects.push_back(params);
|
||||
}
|
||||
info.effects = effects;
|
||||
@ -420,7 +421,7 @@ IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
||||
effectsWidget->setEffectList(info.effects);
|
||||
|
||||
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.width = std::max(totalSize.width, coord.width);
|
||||
}
|
||||
|
@ -13,6 +13,10 @@ namespace MWGui
|
||||
struct ToolTipInfo
|
||||
{
|
||||
public:
|
||||
ToolTipInfo()
|
||||
: isPotion(false)
|
||||
{}
|
||||
|
||||
std::string caption;
|
||||
std::string text;
|
||||
std::string icon;
|
||||
@ -22,6 +26,8 @@ namespace MWGui
|
||||
|
||||
// effects (for potions, ingredients)
|
||||
Widgets::SpellEffectList effects;
|
||||
|
||||
bool isPotion; // potions do not show target in the tooltip
|
||||
};
|
||||
|
||||
class ToolTips : public OEngine::GUI::Layout
|
||||
|
Loading…
Reference in New Issue
Block a user