Merge remote-tracking branch 'zini/next' into animation2

actorid
Chris Robinson 12 years ago
commit e2d7cc49e3

@ -16,7 +16,7 @@
#include <iostream>
#include <boost/format.hpp>
std::string bodyPartLabel(char idx)
std::string bodyPartLabel(int idx)
{
const char *bodyPartLabels[] = {
"Head",
@ -47,14 +47,14 @@ std::string bodyPartLabel(char idx)
"Weapon",
"Tail"
};
if ((int)idx >= 0 && (int)(idx) <= 26)
return bodyPartLabels[(int)(idx)];
if (idx >= 0 && idx <= 26)
return bodyPartLabels[idx];
else
return "Invalid";
}
std::string meshPartLabel(char idx)
std::string meshPartLabel(int idx)
{
const char *meshPartLabels[] = {
"Head",
@ -73,25 +73,25 @@ std::string meshPartLabel(char idx)
"Clavicle",
"Tail"
};
if ((int)(idx) >= 0 && (int)(idx) <= ESM::BodyPart::MP_Tail)
return meshPartLabels[(int)(idx)];
if (idx >= 0 && idx <= ESM::BodyPart::MP_Tail)
return meshPartLabels[idx];
else
return "Invalid";
}
std::string meshTypeLabel(char idx)
std::string meshTypeLabel(int idx)
{
const char *meshTypeLabels[] = {
"Skin",
"Clothing",
"Armor"
};
if ((int)(idx) >= 0 && (int)(idx) <= ESM::BodyPart::MT_Armor)
return meshTypeLabels[(int)(idx)];
if (idx >= 0 && idx <= ESM::BodyPart::MT_Armor)
return meshTypeLabels[idx];
else
return "Invalid";
return "Invalid";
}
std::string clothingTypeLabel(int idx)
@ -108,7 +108,7 @@ std::string clothingTypeLabel(int idx)
"Ring",
"Amulet"
};
if (idx >= 0 && idx <= 9)
return clothingTypeLabels[idx];
else

@ -3,9 +3,9 @@
#include <string>
std::string bodyPartLabel(char idx);
std::string meshPartLabel(char idx);
std::string meshTypeLabel(char idx);
std::string bodyPartLabel(int idx);
std::string meshPartLabel(int idx);
std::string meshTypeLabel(int idx);
std::string clothingTypeLabel(int idx);
std::string armorTypeLabel(int idx);
std::string dialogTypeLabel(int idx);

@ -210,6 +210,7 @@ namespace MWClass
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
newRef.getPtr().get<ESM::Miscellaneous>();
newPtr = MWWorld::Ptr(&cell.mMiscItems.insert(*ref), &cell);
newPtr.getRefData ().setCount(goldAmount);
} else {
MWWorld::LiveCellRef<ESM::Miscellaneous> *ref =
ptr.get<ESM::Miscellaneous>();

@ -133,8 +133,6 @@ void BirthDialog::updateBirths()
const MWWorld::Store<ESM::BirthSign> &signs =
MWBase::Environment::get().getWorld()->getStore().get<ESM::BirthSign>();
int index = 0;
// sort by name
std::vector < std::pair<std::string, const ESM::BirthSign*> > birthSigns;
@ -145,12 +143,20 @@ void BirthDialog::updateBirths()
}
std::sort(birthSigns.begin(), birthSigns.end(), sortBirthSigns);
for (std::vector < std::pair<std::string, const ESM::BirthSign*> >::const_iterator it2 = birthSigns.begin(); it2 != birthSigns.end(); ++it2)
int index = 0;
for (std::vector<std::pair<std::string, const ESM::BirthSign*> >::const_iterator it2 = birthSigns.begin();
it2 != birthSigns.end(); ++it2, ++index)
{
mBirthList->addItem(it2->second->mName, it2->first);
if (boost::iequals(it2->first, mCurrentBirthId))
if (mCurrentBirthId.empty())
{
mBirthList->setIndexSelected(index);
++index;
mCurrentBirthId = it2->first;
}
else if (boost::iequals(it2->first, mCurrentBirthId))
{
mBirthList->setIndexSelected(index);
}
}
}

@ -197,8 +197,15 @@ void PickClassDialog::updateClasses()
const std::string &id = it->mId;
mClassList->addItem(it->mName, id);
if (boost::iequals(id, mCurrentClassId))
if (mCurrentClassId.empty())
{
mCurrentClassId = id;
mClassList->setIndexSelected(index);
}
else if (boost::iequals(id, mCurrentClassId))
{
mClassList->setIndexSelected(index);
}
++index;
}
}

@ -19,12 +19,17 @@
#include "inventorywindow.hpp"
static const float BALANCE_CHANGE_INITIAL_PAUSE = 0.5; // in seconds
static const float BALANCE_CHANGE_INTERVAL = 0.1; // in seconds
namespace MWGui
{
TradeWindow::TradeWindow(MWBase::WindowManager& parWindowManager) :
WindowBase("openmw_trade_window.layout", parWindowManager)
, ContainerBase(NULL) // no drag&drop
, mCurrentBalance(0)
, mBalanceButtonsState(BBS_None)
, mBalanceChangePause(0.0)
{
MyGUI::ScrollView* itemView;
MyGUI::Widget* containerWidget;
@ -59,8 +64,10 @@ namespace MWGui
mCancelButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TradeWindow::onCancelButtonClicked);
mOfferButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TradeWindow::onOfferButtonClicked);
mIncreaseButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TradeWindow::onIncreaseButtonClicked);
mDecreaseButton->eventMouseButtonClick += MyGUI::newDelegate(this, &TradeWindow::onDecreaseButtonClicked);
mIncreaseButton->eventMouseButtonPressed += MyGUI::newDelegate(this, &TradeWindow::onIncreaseButtonPressed);
mIncreaseButton->eventMouseButtonReleased += MyGUI::newDelegate(this, &TradeWindow::onBalanceButtonReleased);
mDecreaseButton->eventMouseButtonPressed += MyGUI::newDelegate(this, &TradeWindow::onDecreaseButtonPressed);
mDecreaseButton->eventMouseButtonReleased += MyGUI::newDelegate(this, &TradeWindow::onBalanceButtonReleased);
setCoord(400, 0, 400, 300);
@ -143,6 +150,21 @@ namespace MWGui
}
}
void TradeWindow::onFrame(float frameDuration)
{
if (!mMainWidget->getVisible() || mBalanceButtonsState == BBS_None)
return;
mBalanceChangePause -= frameDuration;
if (mBalanceChangePause < 0.0) {
mBalanceChangePause += BALANCE_CHANGE_INTERVAL;
if (mBalanceButtonsState == BBS_Increase)
onIncreaseButtonTriggered();
else if (mBalanceButtonsState == BBS_Decrease)
onDecreaseButtonTriggered();
}
}
void TradeWindow::onOfferButtonClicked(MyGUI::Widget* _sender)
{
const MWWorld::Store<ESM::GameSetting> &gmst =
@ -242,7 +264,7 @@ namespace MWGui
//skill use!
MWWorld::Class::get(playerPtr).skillUsageSucceeded(playerPtr, ESM::Skill::Mercantile, 0);
}
}
int iBarterSuccessDisposition = gmst.find("iBarterSuccessDisposition")->getInt();
MWBase::Environment::get().getDialogueManager()->applyTemporaryDispositionChange(iBarterSuccessDisposition);
@ -271,14 +293,33 @@ namespace MWGui
mWindowManager.removeGuiMode(GM_Barter);
}
void TradeWindow::onIncreaseButtonClicked(MyGUI::Widget* _sender)
void TradeWindow::onIncreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)
{
mBalanceButtonsState = BBS_Increase;
mBalanceChangePause = BALANCE_CHANGE_INITIAL_PAUSE;
onIncreaseButtonTriggered();
}
void TradeWindow::onDecreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id)
{
mBalanceButtonsState = BBS_Decrease;
mBalanceChangePause = BALANCE_CHANGE_INITIAL_PAUSE;
onDecreaseButtonTriggered();
}
void TradeWindow::onBalanceButtonReleased(MyGUI::Widget *_sender, int _left, int _top, MyGUI::MouseButton _id)
{
mBalanceButtonsState = BBS_None;
}
void TradeWindow::onIncreaseButtonTriggered()
{
if(mCurrentBalance<=-1) mCurrentBalance -= 1;
if(mCurrentBalance>=1) mCurrentBalance += 1;
updateLabels();
}
void TradeWindow::onDecreaseButtonClicked(MyGUI::Widget* _sender)
void TradeWindow::onDecreaseButtonTriggered()
{
if(mCurrentBalance<-1) mCurrentBalance += 1;
if(mCurrentBalance>1) mCurrentBalance -= 1;

@ -34,6 +34,8 @@ namespace MWGui
void addOrRemoveGold(int gold);
void onFrame(float frameDuration);
protected:
MyGUI::Button* mFilterAll;
MyGUI::Button* mFilterWeapon;
@ -57,12 +59,24 @@ namespace MWGui
int mCurrentBalance;
int mCurrentMerchantOffer;
enum BalanceButtonsState {
BBS_None,
BBS_Increase,
BBS_Decrease
} mBalanceButtonsState;
/// pause before next balance change will trigger while user holds +/- button pressed
float mBalanceChangePause;
void onWindowResize(MyGUI::Window* _sender);
void onFilterChanged(MyGUI::Widget* _sender);
void onOfferButtonClicked(MyGUI::Widget* _sender);
void onCancelButtonClicked(MyGUI::Widget* _sender);
void onIncreaseButtonClicked(MyGUI::Widget* _sender);
void onDecreaseButtonClicked(MyGUI::Widget* _sender);
void onIncreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);
void onDecreaseButtonPressed(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);
void onBalanceButtonReleased(MyGUI::Widget* _sender, int _left, int _top, MyGUI::MouseButton _id);
void onIncreaseButtonTriggered();
void onDecreaseButtonTriggered();
// don't show items that the NPC has equipped in his trade-window.
virtual bool ignoreEquippedItems() { return true; }

@ -1,5 +1,7 @@
#include "waitdialog.hpp"
#include <cmath>
#include <boost/lexical_cast.hpp>
#include <libs/openengine/ogre/fader.hpp>
@ -14,6 +16,7 @@
#include "../mwworld/ptr.hpp"
#include "../mwworld/class.hpp"
#include "../mwmechanics/creaturestats.hpp"
#include "../mwmechanics/npcstats.hpp"
#include "widgets.hpp"
@ -132,21 +135,62 @@ namespace MWGui
void WaitDialog::onUntilHealedButtonClicked(MyGUI::Widget* sender)
{
startWaiting();
// we need to sleep for a specific time, and since that isn't calculated yet, we'll do it here
// I'm making the assumption here that the # of hours rested is calculated when rest is started
// TODO: the rougher logic here (calculating the hourly deltas) should really go into helper funcs elsewhere
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
MWMechanics::CreatureStats stats = MWWorld::Class::get(player).getCreatureStats(player);
const MWWorld::ESMStore& store = MWBase::Environment::get().getWorld()->getStore();
float hourlyHealthDelta = stats.getAttribute(ESM::Attribute::Endurance).getModified() * 0.1;
bool stunted = (stats.getMagicEffects().get(MWMechanics::EffectKey(136)).mMagnitude > 0);
float fRestMagicMult = store.get<ESM::GameSetting>().find("fRestMagicMult")->getFloat();
float hourlyMagickaDelta = fRestMagicMult * stats.getAttribute(ESM::Attribute::Intelligence).getModified();
// this massive duplication is why it has to be put into helper functions instead
float fFatigueReturnBase = store.get<ESM::GameSetting>().find("fFatigueReturnBase")->getFloat();
float fFatigueReturnMult = store.get<ESM::GameSetting>().find("fFatigueReturnMult")->getFloat();
float fEndFatigueMult = store.get<ESM::GameSetting>().find("fEndFatigueMult")->getFloat();
float capacity = MWWorld::Class::get(player).getCapacity(player);
float encumbrance = MWWorld::Class::get(player).getEncumbrance(player);
float normalizedEncumbrance = (capacity == 0 ? 1 : encumbrance/capacity);
if (normalizedEncumbrance > 1)
normalizedEncumbrance = 1;
float hourlyFatigueDelta = fFatigueReturnBase + fFatigueReturnMult * (1 - normalizedEncumbrance);
hourlyFatigueDelta *= 3600 * fEndFatigueMult * stats.getAttribute(ESM::Attribute::Endurance).getModified();
float healthHours = hourlyHealthDelta >= 0.0
? (stats.getHealth().getBase() - stats.getHealth().getCurrent()) / hourlyHealthDelta
: 1.0f;
float magickaHours = stunted ? 0.0 :
hourlyMagickaDelta >= 0.0
? (stats.getMagicka().getBase() - stats.getMagicka().getCurrent()) / hourlyMagickaDelta
: 1.0f;
float fatigueHours = hourlyFatigueDelta >= 0.0
? (stats.getFatigue().getBase() - stats.getFatigue().getCurrent()) / hourlyFatigueDelta
: 1.0f;
int autoHours = int(std::ceil( std::max(std::max(healthHours, magickaHours), std::max(fatigueHours, 1.0f)) )); // this should use a variadic max if possible
startWaiting(autoHours);
}
void WaitDialog::onWaitButtonClicked(MyGUI::Widget* sender)
{
startWaiting();
startWaiting(mManualHours);
}
void WaitDialog::startWaiting ()
void WaitDialog::startWaiting(int hoursToWait)
{
MWBase::Environment::get().getWorld ()->getFader ()->fadeOut(0.2);
setVisible(false);
mProgressBar.setVisible (true);
mWaiting = true;
mCurHour = 0;
mHours = hoursToWait;
mRemainingTime = 0.05;
mProgressBar.setProgress (0, mHours);
}
@ -159,7 +203,7 @@ namespace MWGui
void WaitDialog::onHourSliderChangedPosition(MyGUI::ScrollBar* sender, size_t position)
{
mHourText->setCaptionWithReplacing (boost::lexical_cast<std::string>(position+1) + " #{sRestMenu2}");
mHours = position+1;
mManualHours = position+1;
}
void WaitDialog::setCanRest (bool canRest)
@ -181,9 +225,9 @@ namespace MWGui
mRemainingTime -= dt;
if (mRemainingTime < 0)
while (mRemainingTime < 0)
{
mRemainingTime = 0.05;
mRemainingTime += 0.05;
++mCurHour;
mProgressBar.setProgress (mCurHour, mHours);
@ -197,6 +241,7 @@ namespace MWGui
if (mCurHour > mHours)
stopWaiting();
}
void WaitDialog::stopWaiting ()

@ -47,6 +47,7 @@ namespace MWGui
bool mSleeping;
int mCurHour;
int mHours;
int mManualHours; // stores the hours to rest selected via slider
float mRemainingTime;
WaitDialogProgressBar mProgressBar;
@ -58,7 +59,7 @@ namespace MWGui
void setCanRest(bool canRest);
void startWaiting();
void startWaiting(int hoursToWait);
void stopWaiting();
};

@ -613,6 +613,7 @@ void WindowManager::onFrame (float frameDuration)
mHud->onFrame(frameDuration);
mTrainingWindow->onFrame (frameDuration);
mTradeWindow->onFrame(frameDuration);
mTrainingWindow->checkReferenceAvailable();
mDialogueWindow->checkReferenceAvailable();

@ -595,10 +595,14 @@ namespace MWInput
// Toggle between game mode and inventory mode
if(gameMode)
mWindows.pushGuiMode(MWGui::GM_Inventory);
else if(mWindows.getMode() == MWGui::GM_Inventory)
mWindows.popGuiMode();
else
{
MWGui::GuiMode mode = mWindows.getMode();
if(mode == MWGui::GM_Inventory || mode == MWGui::GM_Container)
mWindows.popGuiMode();
}
// .. but don't touch any other mode.
// .. but don't touch any other mode, except container.
}
void InputManager::toggleConsole()
@ -643,7 +647,8 @@ namespace MWInput
void InputManager::activate()
{
mEngine.activate();
if (mControlSwitch["playercontrols"])
mEngine.activate();
}
void InputManager::toggleAutoMove()

@ -18,7 +18,7 @@ MWWorld::Action::~Action() {}
void MWWorld::Action::execute (const Ptr& actor)
{
if (!mSoundId.empty())
if (!mSoundId.empty() & executeImp (actor))
{
if (mKeepSound && actor.getRefData().getHandle()=="player")
{
@ -35,8 +35,6 @@ void MWWorld::Action::execute (const Ptr& actor)
mKeepSound ? MWBase::SoundManager::Play_NoTrack : MWBase::SoundManager::Play_Normal);
}
}
executeImp (actor);
}
void MWWorld::Action::setSound (const std::string& id)

@ -18,7 +18,8 @@ namespace MWWorld
Action (const Action& action);
Action& operator= (const Action& action);
virtual void executeImp (const Ptr& actor) = 0;
/// @return true if the sound should be played, false if not (e.g. if the action is not allowed)
virtual bool executeImp (const Ptr& actor) = 0;
protected:

@ -5,8 +5,9 @@
namespace MWWorld
{
void ActionAlchemy::executeImp (const Ptr& actor)
bool ActionAlchemy::executeImp (const Ptr& actor)
{
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Alchemy);
return true;
}
}

@ -7,7 +7,7 @@ namespace MWWorld
{
class ActionAlchemy : public Action
{
virtual void executeImp (const Ptr& actor);
virtual bool executeImp (const Ptr& actor);
};
}

@ -9,9 +9,10 @@ namespace MWWorld
: Action (false, target), mId (id)
{}
void ActionApply::executeImp (const Ptr& actor)
bool ActionApply::executeImp (const Ptr& actor)
{
MWWorld::Class::get (getTarget()).apply (getTarget(), mId, actor);
return true;
}
@ -20,9 +21,10 @@ namespace MWWorld
: Action (false, target), mId (id), mSkillIndex (skillIndex), mUsageType (usageType)
{}
void ActionApplyWithSkill::executeImp (const Ptr& actor)
bool ActionApplyWithSkill::executeImp (const Ptr& actor)
{
if (MWWorld::Class::get (getTarget()).apply (getTarget(), mId, actor) && mUsageType!=-1)
MWWorld::Class::get (getTarget()).skillUsageSucceeded (actor, mSkillIndex, mUsageType);
return true;
}
}

@ -13,7 +13,7 @@ namespace MWWorld
{
std::string mId;
virtual void executeImp (const Ptr& actor);
virtual bool executeImp (const Ptr& actor);
public:
@ -26,7 +26,7 @@ namespace MWWorld
int mSkillIndex;
int mUsageType;
virtual void executeImp (const Ptr& actor);
virtual bool executeImp (const Ptr& actor);
public:

@ -16,7 +16,7 @@
namespace MWWorld
{
void ActionEat::executeImp (const Ptr& actor)
bool ActionEat::executeImp (const Ptr& actor)
{
// remove used item
getTarget().getRefData().setCount (getTarget().getRefData().getCount()-1);
@ -42,6 +42,8 @@ namespace MWWorld
// increase skill
Class::get (actor).skillUsageSucceeded (actor, ESM::Skill::Alchemy, 1);
}
return true;
}
ActionEat::ActionEat (const MWWorld::Ptr& object) : Action (false, object) {}

@ -8,7 +8,7 @@ namespace MWWorld
{
class ActionEat : public Action
{
virtual void executeImp (const Ptr& actor);
virtual bool executeImp (const Ptr& actor);
public:

@ -16,7 +16,7 @@ namespace MWWorld
{
}
void ActionEquip::executeImp (const Ptr& actor)
bool ActionEquip::executeImp (const Ptr& actor)
{
MWWorld::InventoryStore& invStore = MWWorld::Class::get(actor).getInventoryStore(actor);
@ -113,5 +113,7 @@ namespace MWWorld
/* Set OnPCEquip Variable on item's script, if the player is equipping it, and it has a script with that variable declared */
if(equipped && actor == MWBase::Environment::get().getWorld()->getPlayer().getPlayer() && script != "")
(*it).mRefData->getLocals().setVarByInt(script, "onpcequip", 1);
return true;
}
}

@ -8,7 +8,7 @@ namespace MWWorld
{
class ActionEquip : public Action
{
virtual void executeImp (const Ptr& actor);
virtual bool executeImp (const Ptr& actor);
public:
/// @param item to equip

@ -14,12 +14,13 @@ namespace MWWorld
{
}
void ActionOpen::executeImp (const MWWorld::Ptr& actor)
bool ActionOpen::executeImp (const MWWorld::Ptr& actor)
{
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
return;
return false;
MWBase::Environment::get().getWindowManager()->pushGuiMode(MWGui::GM_Container);
MWBase::Environment::get().getWindowManager()->getContainerWindow()->open(getTarget());
return true;
}
}

@ -10,7 +10,7 @@ namespace MWWorld
{
class ActionOpen : public Action
{
virtual void executeImp (const MWWorld::Ptr& actor);
virtual bool executeImp (const MWWorld::Ptr& actor);
public:
ActionOpen (const Ptr& container);

@ -19,7 +19,7 @@ namespace MWWorld
{
}
void ActionRead::executeImp (const MWWorld::Ptr& actor)
bool ActionRead::executeImp (const MWWorld::Ptr& actor)
{
LiveCellRef<ESM::Book> *ref = getTarget().get<ESM::Book>();
@ -53,5 +53,6 @@ namespace MWWorld
npcStats.flagAsUsed (ref->mBase->mId);
}
return true;
}
}

@ -8,7 +8,7 @@ namespace MWWorld
{
class ActionRead : public Action
{
virtual void executeImp (const MWWorld::Ptr& actor);
virtual bool executeImp (const MWWorld::Ptr& actor);
public:
/// @param book or scroll to read

@ -12,10 +12,10 @@ namespace MWWorld
{
ActionTake::ActionTake (const MWWorld::Ptr& object) : Action (true, object) {}
void ActionTake::executeImp (const Ptr& actor)
bool ActionTake::executeImp (const Ptr& actor)
{
if (!MWBase::Environment::get().getWindowManager()->isAllowed(MWGui::GW_Inventory))
return;
return false;
// insert into player's inventory
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPtr ("player", true);
@ -23,5 +23,7 @@ namespace MWWorld
MWWorld::Class::get (player).getContainerStore (player).add (getTarget());
MWBase::Environment::get().getWorld()->deleteObject (getTarget());
return true;
}
}

@ -8,7 +8,7 @@ namespace MWWorld
{
class ActionTake : public Action
{
virtual void executeImp (const Ptr& actor);
virtual bool executeImp (const Ptr& actor);
public:

@ -3,13 +3,15 @@
#include "../mwbase/environment.hpp"
#include "../mwbase/dialoguemanager.hpp"
#include "../mwbase/inputmanager.hpp"
namespace MWWorld
{
ActionTalk::ActionTalk (const Ptr& actor) : Action (false, actor) {}
void ActionTalk::executeImp (const Ptr& actor)
bool ActionTalk::executeImp (const Ptr& actor)
{
MWBase::Environment::get().getDialogueManager()->startDialogue (getTarget());
return true;
}
}

@ -8,7 +8,7 @@ namespace MWWorld
{
class ActionTalk : public Action
{
virtual void executeImp (const Ptr& actor);
virtual bool executeImp (const Ptr& actor);
public:

@ -12,11 +12,12 @@ namespace MWWorld
{
}
void ActionTeleport::executeImp (const Ptr& actor)
bool ActionTeleport::executeImp (const Ptr& actor)
{
if (mCellName.empty())
MWBase::Environment::get().getWorld()->changeToExteriorCell (mPosition);
else
MWBase::Environment::get().getWorld()->changeToInteriorCell (mCellName, mPosition);
return true;
}
}

@ -14,7 +14,7 @@ namespace MWWorld
std::string mCellName;
ESM::Position mPosition;
virtual void executeImp (const Ptr& actor);
virtual bool executeImp (const Ptr& actor);
public:

@ -3,7 +3,7 @@
#include <set>
#include <iostream>
#include <boost/filesystem/v3/operations.hpp>
#include <boost/filesystem/operations.hpp>
namespace MWWorld
{

@ -11,11 +11,12 @@ namespace MWWorld
{ }
void FailedAction::executeImp (const Ptr& actor)
bool FailedAction::executeImp (const Ptr& actor)
{
if ( actor.getRefData().getHandle()=="player" && !(message.empty()))
{
MWBase::Environment::get().getWindowManager() ->messageBox(message, std::vector<std::string>());
}
{
MWBase::Environment::get().getWindowManager() ->messageBox(message, std::vector<std::string>());
}
return true;
}
}

@ -10,11 +10,11 @@ namespace MWWorld
{
std::string message;
virtual void executeImp (const Ptr& actor);
virtual bool executeImp (const Ptr& actor);
public:
FailedAction (const std::string& message = std::string());
};
}
#endif
#endif

@ -8,7 +8,7 @@ namespace MWWorld
/// \brief Action: do nothing
class NullAction : public Action
{
virtual void executeImp (const Ptr& actor) {}
virtual bool executeImp (const Ptr& actor) {return false;}
};
}

@ -77,8 +77,8 @@ public:
std::string mKey, mTrap; // Key and trap ID names, if any
// No idea - occurs ONCE in Morrowind.esm, for an activator
char mUnam;
signed char mUnam;
// Track deleted references. 0 - not deleted, 1 - deleted, but respawns, 2 - deleted and does not respawn.
int mDeleted;
@ -164,14 +164,14 @@ struct Cell
bool mWaterInt;
int mMapColor;
int mNAM0;
// References "leased" from another cell (i.e. a different cell
// introduced this ref, and it has been moved here by a plugin)
CellRefTracker mLeasedRefs;
MovedCellRefTracker mMovedRefs;
void load(ESMReader &esm, MWWorld::ESMStore &store);
// This method is left in for compatibility with esmtool. Parsing moved references currently requires
// passing ESMStore, bit it does not know about this parameter, so we do it this way.
void load(ESMReader &esm) {};
@ -209,7 +209,7 @@ struct Cell
reuse one memory location without blanking it between calls.
*/
static bool getNextRef(ESMReader &esm, CellRef &ref);
/* This fetches an MVRF record, which is used to track moved references.
* Since they are comparably rare, we use a separate method for this.
*/

@ -30,7 +30,7 @@ struct Dialogue
};
std::string mId;
char mType;
signed char mType;
std::vector<DialInfo> mInfo;
void load(ESMReader &esm);

@ -8,7 +8,7 @@ namespace ToUTF8
/// Central European and Eastern European languages that use Latin script,
/// such as Polish, Czech, Slovak, Hungarian, Slovene, Bosnian, Croatian,
/// Serbian (Latin script), Romanian and Albanian.
static char windows_1250[] =
static signed char windows_1250[] =
{
1, 0, 0, 0, 0, 0,
1, 1, 0, 0, 0, 0,
@ -270,7 +270,7 @@ static char windows_1250[] =
/// Cyrillic alphabet such as Russian, Bulgarian, Serbian Cyrillic
/// and other languages
static char windows_1251[] =
static signed char windows_1251[] =
{
1, 0, 0, 0, 0, 0,
1, 1, 0, 0, 0, 0,
@ -531,7 +531,7 @@ static char windows_1251[] =
};
/// Latin alphabet used by English and some other Western languages
static char windows_1252[] =
static signed char windows_1252[] =
{
1, 0, 0, 0, 0, 0,
1, 1, 0, 0, 0, 0,

@ -216,7 +216,7 @@ void Utf8Encoder::copyFromArray(unsigned char ch, char* &out)
return;
}
const char *in = translationArray + ch*6;
const signed char *in = translationArray + ch*6;
int len = *(in++);
for (int i=0; i<len; i++)
*(out++) = *(in++);

@ -47,7 +47,7 @@ namespace ToUTF8
void copyFromArray2(const char*& chp, char* &out);
std::vector<char> mOutput;
char* translationArray;
signed char* translationArray;
};
}

Loading…
Cancel
Save