mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 22:39:39 +00:00
Merge remote-tracking branch 'scrawl/ingredients'
This commit is contained in:
commit
101810d1e8
3 changed files with 22 additions and 2 deletions
|
@ -12,6 +12,9 @@
|
||||||
#include "../mwworld/cellstore.hpp"
|
#include "../mwworld/cellstore.hpp"
|
||||||
#include "../mwworld/physicssystem.hpp"
|
#include "../mwworld/physicssystem.hpp"
|
||||||
#include "../mwworld/actioneat.hpp"
|
#include "../mwworld/actioneat.hpp"
|
||||||
|
#include "../mwworld/player.hpp"
|
||||||
|
|
||||||
|
#include "../mwmechanics/npcstats.hpp"
|
||||||
|
|
||||||
#include "../mwgui/tooltips.hpp"
|
#include "../mwgui/tooltips.hpp"
|
||||||
|
|
||||||
|
@ -154,6 +157,10 @@ namespace MWClass
|
||||||
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
text += MWGui::ToolTips::getMiscString(ref->mBase->mScript, "Script");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld ()->getPlayer ().getPlayer();
|
||||||
|
MWMechanics::NpcStats& npcStats = MWWorld::Class::get(player).getNpcStats (player);
|
||||||
|
int alchemySkill = npcStats.getSkill (ESM::Skill::Alchemy).getBase();
|
||||||
|
|
||||||
MWGui::Widgets::SpellEffectList list;
|
MWGui::Widgets::SpellEffectList list;
|
||||||
for (int i=0; i<4; ++i)
|
for (int i=0; i<4; ++i)
|
||||||
{
|
{
|
||||||
|
@ -163,6 +170,12 @@ namespace MWClass
|
||||||
params.mEffectID = ref->mBase->mData.mEffectID[i];
|
params.mEffectID = ref->mBase->mData.mEffectID[i];
|
||||||
params.mAttribute = ref->mBase->mData.mAttributes[i];
|
params.mAttribute = ref->mBase->mData.mAttributes[i];
|
||||||
params.mSkill = ref->mBase->mData.mSkills[i];
|
params.mSkill = ref->mBase->mData.mSkills[i];
|
||||||
|
|
||||||
|
params.mKnown = ( (i == 0 && alchemySkill >= 15)
|
||||||
|
|| (i == 1 && alchemySkill >= 30)
|
||||||
|
|| (i == 2 && alchemySkill >= 45)
|
||||||
|
|| (i == 3 && alchemySkill >= 60));
|
||||||
|
|
||||||
list.push_back(params);
|
list.push_back(params);
|
||||||
}
|
}
|
||||||
info.effects = list;
|
info.effects = list;
|
||||||
|
|
|
@ -390,8 +390,13 @@ void MWSpellEffect::setSpellEffect(const SpellEffectParams& params)
|
||||||
|
|
||||||
void MWSpellEffect::updateWidgets()
|
void MWSpellEffect::updateWidgets()
|
||||||
{
|
{
|
||||||
if (!mWindowManager)
|
if (!mEffectParams.mKnown)
|
||||||
|
{
|
||||||
|
mTextWidget->setCaption ("?");
|
||||||
|
mRequestedWidth = mTextWidget->getTextSize().width + 24;
|
||||||
|
mImageWidget->setImageTexture ("");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const MWWorld::ESMStore &store =
|
const MWWorld::ESMStore &store =
|
||||||
MWBase::Environment::get().getWorld()->getStore();
|
MWBase::Environment::get().getWorld()->getStore();
|
||||||
|
@ -400,7 +405,6 @@ void MWSpellEffect::updateWidgets()
|
||||||
store.get<ESM::MagicEffect>().search(mEffectParams.mEffectID);
|
store.get<ESM::MagicEffect>().search(mEffectParams.mEffectID);
|
||||||
|
|
||||||
assert(magicEffect);
|
assert(magicEffect);
|
||||||
assert(mWindowManager);
|
|
||||||
|
|
||||||
std::string pt = mWindowManager->getGameSettingString("spoint", "");
|
std::string pt = mWindowManager->getGameSettingString("spoint", "");
|
||||||
std::string pts = mWindowManager->getGameSettingString("spoints", "");
|
std::string pts = mWindowManager->getGameSettingString("spoints", "");
|
||||||
|
|
|
@ -37,12 +37,15 @@ namespace MWGui
|
||||||
, mEffectID(-1)
|
, mEffectID(-1)
|
||||||
, mNoTarget(false)
|
, mNoTarget(false)
|
||||||
, mIsConstant(false)
|
, mIsConstant(false)
|
||||||
|
, mKnown(true)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
bool mNoTarget; // potion effects for example have no target (target is always the player)
|
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 mIsConstant; // constant effect means that duration will not be displayed
|
||||||
|
|
||||||
|
bool mKnown; // is this effect known to the player? (If not, will display as a question mark instead)
|
||||||
|
|
||||||
// value of -1 here means the effect is unknown to the player
|
// value of -1 here means the effect is unknown to the player
|
||||||
short mEffectID;
|
short mEffectID;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue