forked from teamnwah/openmw-tes3coop
Merge branch 'master' of https://github.com/OpenMW/openmw into guifixes
This commit is contained in:
commit
39682d616c
14 changed files with 62 additions and 37 deletions
|
@ -13,6 +13,7 @@
|
||||||
|
|
||||||
#include "../mwworld/class.hpp"
|
#include "../mwworld/class.hpp"
|
||||||
#include "../mwworld/esmstore.hpp"
|
#include "../mwworld/esmstore.hpp"
|
||||||
|
#include "../mwworld/player.hpp"
|
||||||
|
|
||||||
#include "textinput.hpp"
|
#include "textinput.hpp"
|
||||||
#include "race.hpp"
|
#include "race.hpp"
|
||||||
|
@ -230,10 +231,19 @@ namespace MWGui
|
||||||
MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog);
|
MWBase::Environment::get().getWindowManager()->removeDialog(mReviewDialog);
|
||||||
mReviewDialog = 0;
|
mReviewDialog = 0;
|
||||||
mReviewDialog = new ReviewDialog();
|
mReviewDialog = new ReviewDialog();
|
||||||
mReviewDialog->setPlayerName(mPlayerName);
|
|
||||||
mReviewDialog->setRace(mPlayerRaceId);
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
mReviewDialog->setClass(mPlayerClass);
|
|
||||||
mReviewDialog->setBirthSign(mPlayerBirthSignId);
|
const ESM::NPC *playerNpc = world->getPlayerPtr().get<ESM::NPC>()->mBase;
|
||||||
|
|
||||||
|
const MWWorld::Player player = world->getPlayer();
|
||||||
|
|
||||||
|
const ESM::Class *playerClass = world->getStore().get<ESM::Class>().find(playerNpc->mClass);
|
||||||
|
|
||||||
|
mReviewDialog->setPlayerName(playerNpc->mName);
|
||||||
|
mReviewDialog->setRace(playerNpc->mRace);
|
||||||
|
mReviewDialog->setClass(*playerClass);
|
||||||
|
mReviewDialog->setBirthSign(player.getBirthSign());
|
||||||
|
|
||||||
{
|
{
|
||||||
MWWorld::Ptr player = MWMechanics::getPlayer();
|
MWWorld::Ptr player = MWMechanics::getPlayer();
|
||||||
|
|
|
@ -136,6 +136,18 @@ namespace MWGui
|
||||||
dirtyPreview();
|
dirtyPreview();
|
||||||
|
|
||||||
updatePreviewSize();
|
updatePreviewSize();
|
||||||
|
|
||||||
|
updateEncumbranceBar();
|
||||||
|
mItemView->update();
|
||||||
|
notifyContentChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
void InventoryWindow::clear()
|
||||||
|
{
|
||||||
|
mPtr = MWWorld::Ptr();
|
||||||
|
mTradeModel = NULL;
|
||||||
|
mSortModel = NULL;
|
||||||
|
mItemView->setModel(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InventoryWindow::setGuiMode(GuiMode mode)
|
void InventoryWindow::setGuiMode(GuiMode mode)
|
||||||
|
@ -340,13 +352,12 @@ namespace MWGui
|
||||||
|
|
||||||
void InventoryWindow::open()
|
void InventoryWindow::open()
|
||||||
{
|
{
|
||||||
mPtr = MWMechanics::getPlayer();
|
if (!mPtr.isEmpty())
|
||||||
|
{
|
||||||
updateEncumbranceBar();
|
updateEncumbranceBar();
|
||||||
|
|
||||||
mItemView->update();
|
mItemView->update();
|
||||||
|
|
||||||
notifyContentChanged();
|
notifyContentChanged();
|
||||||
|
}
|
||||||
adjustPanes();
|
adjustPanes();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,6 +60,8 @@ namespace MWGui
|
||||||
|
|
||||||
void updatePlayer();
|
void updatePlayer();
|
||||||
|
|
||||||
|
void clear();
|
||||||
|
|
||||||
void useItem(const MWWorld::Ptr& ptr);
|
void useItem(const MWWorld::Ptr& ptr);
|
||||||
|
|
||||||
void setGuiMode(GuiMode mode);
|
void setGuiMode(GuiMode mode);
|
||||||
|
|
|
@ -146,6 +146,7 @@ namespace MWGui
|
||||||
|
|
||||||
const ESM::NPC& proto = mPreview->getPrototype();
|
const ESM::NPC& proto = mPreview->getPrototype();
|
||||||
setRaceId(proto.mRace);
|
setRaceId(proto.mRace);
|
||||||
|
setGender(proto.isMale() ? GM_Male : GM_Female);
|
||||||
recountParts();
|
recountParts();
|
||||||
|
|
||||||
for (unsigned int i=0; i<mAvailableHeads.size(); ++i)
|
for (unsigned int i=0; i<mAvailableHeads.size(); ++i)
|
||||||
|
|
|
@ -1696,6 +1696,8 @@ namespace MWGui
|
||||||
mCompanionWindow->resetReference();
|
mCompanionWindow->resetReference();
|
||||||
mConsole->resetReference();
|
mConsole->resetReference();
|
||||||
|
|
||||||
|
mInventoryWindow->clear();
|
||||||
|
|
||||||
mSelectedSpell.clear();
|
mSelectedSpell.clear();
|
||||||
|
|
||||||
mCustomMarkers.clear();
|
mCustomMarkers.clear();
|
||||||
|
|
|
@ -803,6 +803,12 @@ namespace MWMechanics
|
||||||
CharacterController* ctrl = it->second->getCharacterController();
|
CharacterController* ctrl = it->second->getCharacterController();
|
||||||
|
|
||||||
NpcStats &stats = ptr.getClass().getNpcStats(ptr);
|
NpcStats &stats = ptr.getClass().getNpcStats(ptr);
|
||||||
|
|
||||||
|
// When npc stats are just initialized, mTimeToStartDrowning == -1 and we should get value from GMST
|
||||||
|
static const int fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find("fHoldBreathTime")->getFloat();
|
||||||
|
if (stats.getTimeToStartDrowning() == -1.f)
|
||||||
|
stats.setTimeToStartDrowning(fHoldBreathTime);
|
||||||
|
|
||||||
MWBase::World *world = MWBase::Environment::get().getWorld();
|
MWBase::World *world = MWBase::Environment::get().getWorld();
|
||||||
bool knockedOutUnderwater = (ctrl->isKnockedOut() && world->isUnderwater(ptr.getCell(), osg::Vec3f(ptr.getRefData().getPosition().asVec3())));
|
bool knockedOutUnderwater = (ctrl->isKnockedOut() && world->isUnderwater(ptr.getCell(), osg::Vec3f(ptr.getRefData().getPosition().asVec3())));
|
||||||
if((world->isSubmerged(ptr) || knockedOutUnderwater)
|
if((world->isSubmerged(ptr) || knockedOutUnderwater)
|
||||||
|
|
|
@ -500,7 +500,6 @@ namespace MWMechanics
|
||||||
{
|
{
|
||||||
// get the range of the target's weapon
|
// get the range of the target's weapon
|
||||||
float rangeAttackOfTarget = 0.f;
|
float rangeAttackOfTarget = 0.f;
|
||||||
bool isRangedCombat = false;
|
|
||||||
MWWorld::Ptr targetWeapon = MWWorld::Ptr();
|
MWWorld::Ptr targetWeapon = MWWorld::Ptr();
|
||||||
const MWWorld::Class& targetClass = target.getClass();
|
const MWWorld::Class& targetClass = target.getClass();
|
||||||
|
|
||||||
|
@ -516,7 +515,10 @@ namespace MWMechanics
|
||||||
boost::shared_ptr<Action> targetWeaponAction (new ActionWeapon(targetWeapon));
|
boost::shared_ptr<Action> targetWeaponAction (new ActionWeapon(targetWeapon));
|
||||||
|
|
||||||
if (targetWeaponAction.get())
|
if (targetWeaponAction.get())
|
||||||
|
{
|
||||||
|
bool isRangedCombat = false;
|
||||||
rangeAttackOfTarget = targetWeaponAction->getCombatRange(isRangedCombat);
|
rangeAttackOfTarget = targetWeaponAction->getCombatRange(isRangedCombat);
|
||||||
|
}
|
||||||
|
|
||||||
// apply sideway movement (kind of dodging) with some probability
|
// apply sideway movement (kind of dodging) with some probability
|
||||||
// if actor is within range of target's weapon
|
// if actor is within range of target's weapon
|
||||||
|
|
|
@ -171,10 +171,10 @@ void MWMechanics::Alchemy::updateEffects()
|
||||||
if (fPotionT1DurMult<=0)
|
if (fPotionT1DurMult<=0)
|
||||||
throw std::runtime_error ("invalid gmst: fPotionT1DurMult");
|
throw std::runtime_error ("invalid gmst: fPotionT1DurMult");
|
||||||
|
|
||||||
float magnitude = magicEffect->mData.mFlags & ESM::MagicEffect::NoMagnitude ?
|
float magnitude = (magicEffect->mData.mFlags & ESM::MagicEffect::NoMagnitude) ?
|
||||||
1 : (x / fPotionT1MagMul) / magicEffect->mData.mBaseCost;
|
1.0f : (x / fPotionT1MagMul) / magicEffect->mData.mBaseCost;
|
||||||
float duration = magicEffect->mData.mFlags & ESM::MagicEffect::NoDuration ?
|
float duration = (magicEffect->mData.mFlags & ESM::MagicEffect::NoDuration) ?
|
||||||
1 : (x / fPotionT1DurMult) / magicEffect->mData.mBaseCost;
|
1.0f : (x / fPotionT1DurMult) / magicEffect->mData.mBaseCost;
|
||||||
|
|
||||||
if (!(magicEffect->mData.mFlags & ESM::MagicEffect::NoMagnitude))
|
if (!(magicEffect->mData.mFlags & ESM::MagicEffect::NoMagnitude))
|
||||||
applyTools (magicEffect->mData.mFlags, magnitude);
|
applyTools (magicEffect->mData.mFlags, magnitude);
|
||||||
|
|
|
@ -328,12 +328,16 @@ namespace MWMechanics
|
||||||
winMgr->setValue(fbar, stats.getFatigue());
|
winMgr->setValue(fbar, stats.getFatigue());
|
||||||
}
|
}
|
||||||
|
|
||||||
if(stats.getTimeToStartDrowning() != mWatchedTimeToStartDrowning)
|
float timeToDrown = stats.getTimeToStartDrowning();
|
||||||
|
|
||||||
|
if(timeToDrown != mWatchedTimeToStartDrowning)
|
||||||
{
|
{
|
||||||
const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
|
static const float fHoldBreathTime = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>()
|
||||||
.find("fHoldBreathTime")->getFloat();
|
.find("fHoldBreathTime")->getFloat();
|
||||||
mWatchedTimeToStartDrowning = stats.getTimeToStartDrowning();
|
|
||||||
if(stats.getTimeToStartDrowning() >= fHoldBreathTime)
|
mWatchedTimeToStartDrowning = timeToDrown;
|
||||||
|
|
||||||
|
if(timeToDrown >= fHoldBreathTime || timeToDrown == -1.0) // -1.0 is a special value during initialization
|
||||||
winMgr->setDrowningBarVisibility(false);
|
winMgr->setDrowningBarVisibility(false);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -30,7 +30,7 @@ MWMechanics::NpcStats::NpcStats()
|
||||||
, mBounty(0)
|
, mBounty(0)
|
||||||
, mWerewolfKills (0)
|
, mWerewolfKills (0)
|
||||||
, mLevelProgress(0)
|
, mLevelProgress(0)
|
||||||
, mTimeToStartDrowning(20.0)
|
, mTimeToStartDrowning(-1.0) // set breath to special value, it will be replaced during actor update
|
||||||
, mIsWerewolf(false)
|
, mIsWerewolf(false)
|
||||||
{
|
{
|
||||||
mSkillIncreases.resize (ESM::Attribute::Length, 0);
|
mSkillIncreases.resize (ESM::Attribute::Length, 0);
|
||||||
|
|
|
@ -230,13 +230,6 @@ namespace MWPhysics
|
||||||
return direction - project(direction, planeNormal);
|
return direction - project(direction, planeNormal);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline osg::Vec3f reflect(const osg::Vec3& velocity, const osg::Vec3f& normal)
|
|
||||||
{
|
|
||||||
return velocity - (normal * (normal * velocity)) * 2;
|
|
||||||
// ^ dot product
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static osg::Vec3f traceDown(const MWWorld::Ptr &ptr, const osg::Vec3f& position, Actor* actor, btCollisionWorld* collisionWorld, float maxHeight)
|
static osg::Vec3f traceDown(const MWWorld::Ptr &ptr, const osg::Vec3f& position, Actor* actor, btCollisionWorld* collisionWorld, float maxHeight)
|
||||||
{
|
{
|
||||||
|
|
|
@ -211,7 +211,7 @@ namespace MWPhysics
|
||||||
float mTimeAccum;
|
float mTimeAccum;
|
||||||
|
|
||||||
float mWaterHeight;
|
float mWaterHeight;
|
||||||
float mWaterEnabled;
|
bool mWaterEnabled;
|
||||||
|
|
||||||
std::auto_ptr<btCollisionObject> mWaterCollisionObject;
|
std::auto_ptr<btCollisionObject> mWaterCollisionObject;
|
||||||
std::auto_ptr<btCollisionShape> mWaterCollisionShape;
|
std::auto_ptr<btCollisionShape> mWaterCollisionShape;
|
||||||
|
|
|
@ -1058,11 +1058,9 @@ namespace MWRender
|
||||||
float timepassed = duration * state.mSpeedMult;
|
float timepassed = duration * state.mSpeedMult;
|
||||||
while(state.mPlaying)
|
while(state.mPlaying)
|
||||||
{
|
{
|
||||||
float targetTime;
|
|
||||||
|
|
||||||
if (!state.shouldLoop())
|
if (!state.shouldLoop())
|
||||||
{
|
{
|
||||||
targetTime = state.getTime() + timepassed;
|
float targetTime = state.getTime() + timepassed;
|
||||||
if(textkey == textkeys.end() || textkey->first > targetTime)
|
if(textkey == textkeys.end() || textkey->first > targetTime)
|
||||||
{
|
{
|
||||||
if(mAccumCtrl && state.mTime == mAnimationTimePtr[0]->getTimePtr())
|
if(mAccumCtrl && state.mTime == mAnimationTimePtr[0]->getTimePtr())
|
||||||
|
|
|
@ -538,13 +538,9 @@ namespace MWWorld
|
||||||
std::cout << "Changing to interior\n";
|
std::cout << "Changing to interior\n";
|
||||||
|
|
||||||
// unload
|
// unload
|
||||||
int current = 0;
|
|
||||||
CellStoreCollection::iterator active = mActiveCells.begin();
|
CellStoreCollection::iterator active = mActiveCells.begin();
|
||||||
while (active!=mActiveCells.end())
|
while (active!=mActiveCells.end())
|
||||||
{
|
|
||||||
unloadCell (active++);
|
unloadCell (active++);
|
||||||
++current;
|
|
||||||
}
|
|
||||||
|
|
||||||
int refsToLoad = cell->count();
|
int refsToLoad = cell->count();
|
||||||
loadingListener->setProgressRange(refsToLoad);
|
loadingListener->setProgressRange(refsToLoad);
|
||||||
|
|
Loading…
Reference in a new issue