mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-21 12:53:51 +00:00
Do not show magnitude for ingredients
This commit is contained in:
parent
310e19d47f
commit
6619150b23
6 changed files with 15 additions and 3 deletions
|
@ -156,6 +156,7 @@ namespace MWClass
|
|||
info.effects = list;
|
||||
|
||||
info.text = text;
|
||||
info.isIngredient = true;
|
||||
|
||||
return info;
|
||||
}
|
||||
|
|
|
@ -249,6 +249,7 @@ namespace MWGui
|
|||
params.mAttribute = effectKey.mArg;
|
||||
params.mIsConstant = true;
|
||||
params.mNoTarget = true;
|
||||
params.mNoMagnitude = true;
|
||||
|
||||
params.mKnown = mAlchemy->knownEffect(effectIndex, MWBase::Environment::get().getWorld()->getPlayerPtr());
|
||||
|
||||
|
|
|
@ -486,7 +486,9 @@ namespace MWGui
|
|||
effectsWidget->setEffectList(info.effects);
|
||||
|
||||
std::vector<MyGUI::Widget*> effectItems;
|
||||
effectsWidget->createEffectWidgets(effectItems, effectArea, coord, true, info.isPotion ? Widgets::MWEffectList::EF_NoTarget : 0);
|
||||
int flag = info.isPotion ? Widgets::MWEffectList::EF_NoTarget : 0;
|
||||
flag |= info.isIngredient ? Widgets::MWEffectList::EF_NoMagnitude : 0;
|
||||
effectsWidget->createEffectWidgets(effectItems, effectArea, coord, true, flag);
|
||||
totalSize.height += coord.top-6;
|
||||
totalSize.width = std::max(totalSize.width, coord.width);
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ namespace MWGui
|
|||
: imageSize(32)
|
||||
, remainingEnchantCharge(-1)
|
||||
, isPotion(false)
|
||||
, isIngredient(false)
|
||||
, wordWrap(true)
|
||||
{}
|
||||
|
||||
|
@ -41,6 +42,7 @@ namespace MWGui
|
|||
std::vector<std::string> notes;
|
||||
|
||||
bool isPotion; // potions do not show target in the tooltip
|
||||
bool isIngredient; // ingredients have no effect magnitude
|
||||
bool wordWrap;
|
||||
};
|
||||
|
||||
|
|
|
@ -235,6 +235,7 @@ namespace MWGui
|
|||
params.mRange = effectInfo.mRange;
|
||||
params.mIsConstant = (flags & MWEffectList::EF_Constant) != 0;
|
||||
params.mNoTarget = (flags & MWEffectList::EF_NoTarget);
|
||||
params.mNoMagnitude = (flags & MWEffectList::EF_NoMagnitude);
|
||||
effect->setSpellEffect(params);
|
||||
effects.push_back(effect);
|
||||
coord.top += effect->getHeight();
|
||||
|
@ -293,6 +294,7 @@ namespace MWGui
|
|||
effect = creator->createWidget<MWSpellEffect>("MW_EffectImage", coord, MyGUI::Align::Default);
|
||||
effectInfo.mIsConstant = (flags & EF_Constant) || effectInfo.mIsConstant;
|
||||
effectInfo.mNoTarget = (flags & EF_NoTarget) || effectInfo.mNoTarget;
|
||||
effectInfo.mNoMagnitude = (flags & EF_NoMagnitude) || effectInfo.mNoMagnitude;
|
||||
effect->setSpellEffect(effectInfo);
|
||||
effects.push_back(effect);
|
||||
if (effect->getRequestedWidth() > maxwidth)
|
||||
|
@ -421,7 +423,7 @@ namespace MWGui
|
|||
|
||||
spellLine += formatter.str();
|
||||
}
|
||||
else if ( displayType != ESM::MagicEffect::MDT_None ) {
|
||||
else if ( displayType != ESM::MagicEffect::MDT_None && !mEffectParams.mNoMagnitude) {
|
||||
spellLine += " " + MyGUI::utility::toString(mEffectParams.mMagnMin);
|
||||
if (mEffectParams.mMagnMin != mEffectParams.mMagnMax)
|
||||
spellLine += to + MyGUI::utility::toString(mEffectParams.mMagnMax);
|
||||
|
|
|
@ -38,6 +38,7 @@ namespace MWGui
|
|||
SpellEffectParams()
|
||||
: mNoTarget(false)
|
||||
, mIsConstant(false)
|
||||
, mNoMagnitude(false)
|
||||
, mKnown(true)
|
||||
, mEffectID(-1)
|
||||
, mSkill(-1)
|
||||
|
@ -52,6 +53,7 @@ namespace MWGui
|
|||
|
||||
bool mNoTarget; // potion effects for example have no target (target is always the player)
|
||||
bool mIsConstant; // constant effect means that duration will not be displayed
|
||||
bool mNoMagnitude; // effect magnitude will not be displayed (e.g ingredients)
|
||||
|
||||
bool mKnown; // is this effect known to the player? (If not, will display as a question mark instead)
|
||||
|
||||
|
@ -218,7 +220,9 @@ namespace MWGui
|
|||
enum EffectFlags
|
||||
{
|
||||
EF_NoTarget = 0x01, // potions have no target (target is always the player)
|
||||
EF_Constant = 0x02 // constant effect means that duration will not be displayed
|
||||
EF_Constant = 0x02, // constant effect means that duration will not be displayed
|
||||
EF_NoMagnitude = 0x04 // ingredients have no magnitude
|
||||
|
||||
};
|
||||
|
||||
void setEffectList(const SpellEffectList& list);
|
||||
|
|
Loading…
Reference in a new issue