./mwbase

namespace MWBase
class DialogueManager
#include <dialoguemanager.hpp>

Interface for dialogue manager (implemented in MWDialogue)

Public Functions

DialogueManager()
virtual void clear() = 0
virtual ~DialogueManager()
virtual bool isInChoice() const = 0
virtual void startDialogue(const MWWorld::Ptr &actor) = 0
virtual void addTopic(const std::string &topic) = 0
virtual void askQuestion(const std::string &question, int choice) = 0
virtual void goodbye() = 0
virtual void say(const MWWorld::Ptr &actor, const std::string &topic) const = 0
virtual void keywordSelected(const std::string &keyword) = 0
virtual void goodbyeSelected() = 0
virtual void questionAnswered(int answer) = 0
virtual bool checkServiceRefused() = 0
virtual void persuade(int type) = 0
virtual int getTemporaryDispositionChange() const = 0
virtual void applyDispositionChange(int delta) = 0

Note
This change is temporary and gets discarded when dialogue ends.

virtual int countSavedGameRecords() const = 0
virtual void write(ESM::ESMWriter &writer, Loading::Listener &progress) const = 0
virtual void readRecord(ESM::ESMReader &reader, uint32_t type) = 0
virtual void modFactionReaction(const std::string &faction1, const std::string &faction2, int diff) = 0

Changes faction1’s opinion of faction2 by diff.

virtual void setFactionReaction(const std::string &faction1, const std::string &faction2, int absolute) = 0
virtual int getFactionReaction(const std::string &faction1, const std::string &faction2) const = 0

Return
faction1’s opinion of faction2

virtual void clearInfoActor(const MWWorld::Ptr &actor) const = 0

Removes the last added topic response for the given actor from the journal.

Private Functions

DialogueManager(const DialogueManager&)

not implemented

DialogueManager &operator=(const DialogueManager&)

not implemented

namespace MWBase
class Environment
#include <environment.hpp>

Central hub for mw-subsystems.

This class allows each mw-subsystem to access any others subsystem’s top-level manager class.

Attention
Environment takes ownership of the manager class instances it is handed over in the set* functions.

Public Functions

Environment()
~Environment()
void setWorld(World *world)
void setSoundManager(SoundManager *soundManager)
void setScriptManager(MWBase::ScriptManager *scriptManager)
void setWindowManager(WindowManager *windowManager)
void setMechanicsManager(MechanicsManager *mechanicsManager)
void setDialogueManager(DialogueManager *dialogueManager)
void setJournal(Journal *journal)
void setInputManager(InputManager *inputManager)
void setStateManager(StateManager *stateManager)
void setFrameDuration(float duration)

Set length of current frame in seconds.

World *getWorld() const
SoundManager *getSoundManager() const
ScriptManager *getScriptManager() const
WindowManager *getWindowManager() const
MechanicsManager *getMechanicsManager() const
DialogueManager *getDialogueManager() const
Journal *getJournal() const
InputManager *getInputManager() const
StateManager *getStateManager() const
float getFrameDuration() const
void cleanup()

Delete all mw*-subsystems.

Public Static Functions

static const Environment &get()

Return instance of this class.

Private Functions

Environment(const Environment&)

not implemented

Environment &operator=(const Environment&)

not implemented

Private Members

World *mWorld
SoundManager *mSoundManager
ScriptManager *mScriptManager
WindowManager *mWindowManager
MechanicsManager *mMechanicsManager
DialogueManager *mDialogueManager
Journal *mJournal
InputManager *mInputManager
StateManager *mStateManager
float mFrameDuration

Private Static Attributes

Environment *sThis
namespace MWBase
class InputManager
#include <inputmanager.hpp>

Interface for input manager (implemented in MWInput)

Public Functions

InputManager()
virtual void clear() = 0

Clear all savegame-specific data.

virtual ~InputManager()
virtual bool isWindowVisible() = 0
virtual void update(float dt, bool disableControls, bool disableEvents = false) = 0
virtual void changeInputMode(bool guiMode) = 0
virtual void processChangedSettings(const std::set<std::pair<std::string, std::string>> &changed) = 0
virtual void setDragDrop(bool dragDrop) = 0
virtual void toggleControlSwitch(const std::string &sw, bool value) = 0
virtual bool getControlSwitch(const std::string &sw) = 0
virtual std::string getActionDescription(int action) = 0
virtual std::string getActionKeyBindingName(int action) = 0
virtual std::string getActionControllerBindingName(int action) = 0
virtual std::string sdlControllerAxisToString(int axis) = 0
virtual std::string sdlControllerButtonToString(int button) = 0
virtual std::vector<int> getActionKeySorting() = 0

Actions available for binding to keyboard buttons.

virtual std::vector<int> getActionControllerSorting() = 0

Actions available for binding to controller buttons.

virtual int getNumActions() = 0
virtual void enableDetectingBindingMode(int action, bool keyboard) = 0

If keyboard is true, only pay attention to keyboard events. If false, only pay attention to controller events (excluding esc)

virtual void resetToDefaultKeyBindings() = 0
virtual void resetToDefaultControllerBindings() = 0
virtual bool joystickLastUsed() = 0

Returns if the last used input device was a joystick or a keyboard

Return
true if joystick, false otherwise

virtual int countSavedGameRecords() const = 0
virtual void write(ESM::ESMWriter &writer, Loading::Listener &progress) = 0
virtual void readRecord(ESM::ESMReader &reader, uint32_t type) = 0

Private Functions

InputManager(const InputManager&)

not implemented

InputManager &operator=(const InputManager&)

not implemented

namespace MWBase
class Journal
#include <journal.hpp>

Interface for the player’s journal (implemented in MWDialogue)

Public Types

typedef std::deque<MWDialogue::StampedJournalEntry> TEntryContainer
typedef TEntryContainer::const_iterator TEntryIter
typedef std::map<std::string, MWDialogue::Quest> TQuestContainer
typedef TQuestContainer::const_iterator TQuestIter
typedef std::map<std::string, MWDialogue::Topic> TTopicContainer
typedef TTopicContainer::const_iterator TTopicIter

Public Functions

Journal()
virtual void clear() = 0
virtual ~Journal()
virtual void addEntry(const std::string &id, int index, const MWWorld::Ptr &actor) = 0

Add a journal entry.

Parameters
  • actor: Used as context for replacing of escape sequences (name, etc).

virtual void setJournalIndex(const std::string &id, int index) = 0

Set the journal index without adding an entry.

virtual int getJournalIndex(const std::string &id) const = 0

Get the journal index.

virtual void addTopic(const std::string &topicId, const std::string &infoId, const MWWorld::Ptr &actor) = 0
virtual void removeLastAddedTopicResponse(const std::string &topicId, const std::string &actorName) = 0

Note

topicId must be lowercase Removes the last topic response added for the given topicId and actor name.

topicId must be lowercase

virtual TEntryIter begin() const = 0

Iterator pointing to the begin of the main journal.

Note
Iterators to main journal entries will never become invalid.

virtual TEntryIter end() const = 0

Iterator pointing past the end of the main journal.

virtual TQuestIter questBegin() const = 0

Iterator pointing to the first quest (sorted by topic ID)

virtual TQuestIter questEnd() const = 0

Iterator pointing past the last quest.

virtual TTopicIter topicBegin() const = 0

Iterator pointing to the first topic (sorted by topic ID)

Note
The topic ID is identical with the user-visible topic string.

virtual TTopicIter topicEnd() const = 0

Iterator pointing past the last topic.

virtual int countSavedGameRecords() const = 0
virtual void write(ESM::ESMWriter &writer, Loading::Listener &progress) const = 0
virtual void readRecord(ESM::ESMReader &reader, uint32_t type) = 0

Private Functions

Journal(const Journal&)

not implemented

Journal &operator=(const Journal&)

not implemented

namespace MWBase
class MechanicsManager
#include <mechanicsmanager.hpp>

Interface for game mechanics manager (implemented in MWMechanics)

Public Types

enum OffenseType

Values:

OT_Theft
OT_Assault
OT_Murder
OT_Trespassing
OT_SleepingInOwnedBed
OT_Pickpocket
enum PersuasionType

Values:

PT_Admire
PT_Intimidate
PT_Taunt
PT_Bribe10
PT_Bribe100
PT_Bribe1000

Public Functions

MechanicsManager()
virtual ~MechanicsManager()
virtual void add(const MWWorld::Ptr &ptr) = 0

Register an object for management.

virtual void remove(const MWWorld::Ptr &ptr) = 0

Deregister an object for management.

virtual void updateCell(const MWWorld::Ptr &old, const MWWorld::Ptr &ptr) = 0

Moves an object to a new cell.

virtual void drop(const MWWorld::CellStore *cellStore) = 0

Deregister all objects in the given cell.

virtual void watchActor(const MWWorld::Ptr &ptr) = 0

On each update look for changes in a previously registered actor and update the GUI accordingly.

virtual void update(float duration, bool paused) = 0

Update objects

Parameters
  • paused: In game type does not currently advance (this usually means some GUI component is up).

virtual void advanceTime(float duration) = 0
virtual void setPlayerName(const std::string &name) = 0

Set player name.

virtual void setPlayerRace(const std::string &id, bool male, const std::string &head, const std::string &hair) = 0

Set player race.

virtual void setPlayerBirthsign(const std::string &id) = 0

Set player birthsign.

virtual void setPlayerClass(const std::string &id) = 0

Set player class to stock class.

virtual void setPlayerClass(const ESM::Class &class_) = 0

Set player class to custom class.

virtual void rest(bool sleep) = 0

If the player is sleeping or waiting, this should be called every hour.

Parameters
  • sleep: is the player sleeping or waiting?

virtual int getHoursToRest() const = 0

Calculate how many hours the player needs to rest in order to be fully healed.

virtual int getBarterOffer(const MWWorld::Ptr &ptr, int basePrice, bool buying) = 0

This is used by every service to determine the price of objects given the trading skills of the player and NPC.

virtual int getDerivedDisposition(const MWWorld::Ptr &ptr, bool addTemporaryDispositionChange = true) = 0

Calculate the diposition of an NPC toward the player.

virtual int countDeaths(const std::string &id) const = 0

Return the number of deaths for actors with the given ID.

virtual bool awarenessCheck(const MWWorld::Ptr &ptr, const MWWorld::Ptr &observer) = 0

Check if observer is potentially aware of ptr. Does not do a line of sight check!

virtual void startCombat(const MWWorld::Ptr &ptr, const MWWorld::Ptr &target) = 0

Makes ptr fight target. Also shouts a combat taunt.

virtual bool commitCrime(const MWWorld::Ptr &ptr, const MWWorld::Ptr &victim, OffenseType type, int arg = 0, bool victimAware = false) = 0

Note
victim may be empty
Return
was the crime seen?
Parameters
  • arg: Depends on type, e.g. for Theft, the value of the item that was stolen.
  • victimAware: Is the victim already aware of the crime? If this parameter is false, it will be determined by a line-of-sight and awareness check.

virtual bool actorAttacked(const MWWorld::Ptr &victim, const MWWorld::Ptr &attacker) = 0

Return
false if the attack was considered a “friendly hit” and forgiven

virtual void actorKilled(const MWWorld::Ptr &victim, const MWWorld::Ptr &attacker) = 0

Notify that actor was killed, add a murder bounty if applicable

Note
No-op for non-player attackers

virtual void itemTaken(const MWWorld::Ptr &ptr, const MWWorld::Ptr &item, const MWWorld::Ptr &container, int count) = 0

Utility to check if taking this item is illegal and calling commitCrime if so

Parameters
  • container: The container the item is in; may be empty for an item in the world

virtual void objectOpened(const MWWorld::Ptr &ptr, const MWWorld::Ptr &item) = 0

Utility to check if opening (i.e. unlocking) this object is illegal and calling commitCrime if so.

virtual bool sleepInBed(const MWWorld::Ptr &ptr, const MWWorld::Ptr &bed) = 0

Attempt sleeping in a bed. If this is illegal, call commitCrime.

Return
was it illegal, and someone saw you doing it?

virtual void getPersuasionDispositionChange(const MWWorld::Ptr &npc, PersuasionType type, bool &success, float &tempChange, float &permChange) = 0

Perform a persuasion action on NPC.

virtual void forceStateUpdate(const MWWorld::Ptr &ptr) = 0

Forces an object to refresh its animation state.

virtual bool playAnimationGroup(const MWWorld::Ptr &ptr, const std::string &groupName, int mode, int number = 1, bool persist = false) = 0

Run animation for a MW-reference. Calls to this function for references that are currently not in the scene should be ignored.

Return
Success or error
Parameters
  • mode: 0 normal, 1 immediate start, 2 immediate loop
  • count: How many times the animation should be run
  • persist: Whether the animation state should be stored in saved games and persist after cell unload.

virtual void skipAnimation(const MWWorld::Ptr &ptr) = 0

Skip the animation for the given MW-reference for one frame. Calls to this function for references that are currently not in the scene should be ignored.

virtual bool checkAnimationPlaying(const MWWorld::Ptr &ptr, const std::string &groupName) = 0
virtual void persistAnimationStates() = 0

Save the current animation state of managed references to their RefData.

virtual void updateMagicEffects(const MWWorld::Ptr &ptr) = 0

Update magic effects for an actor. Usually done automatically once per frame, but if we’re currently paused we may want to do it manually (after equipping permanent enchantment)

virtual bool toggleAI() = 0
virtual bool isAIActive() = 0
virtual void getObjectsInRange(const osg::Vec3f &position, float radius, std::vector<MWWorld::Ptr> &objects) = 0
virtual void getActorsInRange(const osg::Vec3f &position, float radius, std::vector<MWWorld::Ptr> &objects) = 0
virtual std::list<MWWorld::Ptr> getActorsSidingWith(const MWWorld::Ptr &actor) = 0

Returns the list of actors which are siding with the given actor in fights.

ie AiFollow or AiEscort is active and the target is the actor

virtual std::list<MWWorld::Ptr> getActorsFollowing(const MWWorld::Ptr &actor) = 0
virtual std::list<int> getActorsFollowingIndices(const MWWorld::Ptr &actor) = 0
virtual std::list<MWWorld::Ptr> getActorsFighting(const MWWorld::Ptr &actor) = 0

Returns a list of actors who are fighting the given actor within the fAlarmDistance.

ie AiCombat is active and the target is the actor

virtual std::list<MWWorld::Ptr> getEnemiesNearby(const MWWorld::Ptr &actor) = 0
virtual void playerLoaded() = 0
virtual int countSavedGameRecords() const = 0
virtual void write(ESM::ESMWriter &writer, Loading::Listener &listener) const = 0
virtual void readRecord(ESM::ESMReader &reader, uint32_t type) = 0
virtual void clear() = 0
virtual bool isAggressive(const MWWorld::Ptr &ptr, const MWWorld::Ptr &target) = 0
virtual void keepPlayerAlive() = 0

Resurrects the player if necessary.

virtual bool isReadyToBlock(const MWWorld::Ptr &ptr) const = 0
virtual void confiscateStolenItems(const MWWorld::Ptr &player, const MWWorld::Ptr &targetContainer) = 0
virtual std::vector<std::pair<std::string, int>> getStolenItemOwners(const std::string &itemid) = 0

List the owners that the player has stolen this item from (the owner can be an NPC or a faction). <Owner, item count>

virtual bool isItemStolenFrom(const std::string &itemid, const std::string &ownerid) = 0

Has the player stolen this item from the given owner?

virtual bool isAllowedToUse(const MWWorld::Ptr &ptr, const MWWorld::CellRef &cellref, MWWorld::Ptr &victim) = 0
virtual void setWerewolf(const MWWorld::Ptr &actor, bool werewolf) = 0

Turn actor into werewolf or normal form.

virtual void applyWerewolfAcrobatics(const MWWorld::Ptr &actor) = 0

Sets the NPC’s Acrobatics skill to match the fWerewolfAcrobatics GMST. It only applies to the current form the NPC is in.

virtual void cleanupSummonedCreature(const MWWorld::Ptr &caster, int creatureActorId) = 0

Private Functions

MechanicsManager(const MechanicsManager&)

not implemented

MechanicsManager &operator=(const MechanicsManager&)

not implemented

namespace MWBase
class ScriptManager
#include <scriptmanager.hpp>

Interface for script manager (implemented in MWScript)

Public Functions

ScriptManager()
virtual ~ScriptManager()
virtual void run(const std::string &name, Interpreter::Context &interpreterContext) = 0

Run the script with the given name (compile first, if not compiled yet)

virtual bool compile(const std::string &name) = 0

Compile script with the given namen

Return
Success?

virtual std::pair<int, int> compileAll() = 0

Compile all scripts

Return
count, success

virtual const Compiler::Locals &getLocals(const std::string &name) = 0

Return locals for script name.

virtual MWScript::GlobalScripts &getGlobalScripts() = 0

Private Functions

ScriptManager(const ScriptManager&)

not implemented

ScriptManager &operator=(const ScriptManager&)

not implemented

namespace MWSound

Typedefs

typedef boost::shared_ptr<Sound_Decoder> DecoderPtr
namespace MWBase

Typedefs

typedef boost::shared_ptr<MWSound::Sound> SoundPtr
typedef boost::shared_ptr<MWSound::Stream> SoundStreamPtr
class SoundManager
#include <soundmanager.hpp>

Interface for sound manager (implemented in MWSound)

Public Types

enum PlayMode

Values:

Play_Normal = 0
Play_Loop = 1<<0
Play_NoEnv = 1<<1
Play_RemoveAtDistance = 1<<2
Play_NoPlayerLocal = 1<<3
Play_LoopNoEnv = Play_Loop | Play_NoEnv
Play_LoopRemoveAtDistance = Play_Loop | Play_RemoveAtDistance
enum PlayType

Values:

Play_TypeSfx = 1<<4
Play_TypeVoice = 1<<5
Play_TypeFoot = 1<<6
Play_TypeMusic = 1<<7
Play_TypeMovie = 1<<8
Play_TypeMask = Play_TypeSfx|Play_TypeVoice|Play_TypeFoot|Play_TypeMusic|Play_TypeMovie

Public Functions

SoundManager()
virtual ~SoundManager()
virtual void processChangedSettings(const std::set<std::pair<std::string, std::string>> &settings) = 0
virtual void stopMusic() = 0

Stops music if it’s playing.

virtual void streamMusic(const std::string &filename) = 0

Play a soundifle

Parameters
  • filename: name of a sound file in “Music/” in the data directory.

virtual void startRandomTitle() = 0

Starts a random track from the current playlist.

virtual bool isMusicPlaying() = 0

Returns true if music is playing.

virtual void playPlaylist(const std::string &playlist) = 0

Start playing music from the selected folder

Parameters
  • name: of the folder that contains the playlist

virtual void say(const MWWorld::ConstPtr &reference, const std::string &filename) = 0

Make an actor say some text.

Parameters
  • filename: name of a sound file in “Sound/” in the data directory.

virtual void say(const std::string &filename) = 0

Say some text, without an actor ref

Parameters
  • filename: name of a sound file in “Sound/” in the data directory.

virtual bool sayDone(const MWWorld::ConstPtr &reference = MWWorld::ConstPtr()) const = 0

Is actor not speaking?

virtual void stopSay(const MWWorld::ConstPtr &reference = MWWorld::ConstPtr()) = 0

Stop an actor speaking.

virtual float getSaySoundLoudness(const MWWorld::ConstPtr &reference) const = 0

Check the currently playing say sound for this actor and get an average loudness value (scale [0,1]) at the current time position. If the actor is not saying anything, returns 0.

virtual SoundStreamPtr playTrack(const MWSound::DecoderPtr &decoder, PlayType type) = 0

Play a 2D audio track, using a custom decoder.

virtual void stopTrack(SoundStreamPtr stream) = 0

Stop the given audio track from playing.

virtual double getTrackTimeDelay(SoundStreamPtr stream) = 0

Retives the time delay, in seconds, of the audio track (must be a sound returned by playTrack). Only intended to be called by the track decoder’s read method.

virtual SoundPtr playSound(const std::string &soundId, float volume, float pitch, PlayType type = Play_TypeSfx, PlayMode mode = Play_Normal, float offset = 0) = 0

Play a sound, independently of 3D-position

Parameters
  • offset: Number of seconds into the sound to start playback.

virtual MWBase::SoundPtr playSound3D(const MWWorld::ConstPtr &reference, const std::string &soundId, float volume, float pitch, PlayType type = Play_TypeSfx, PlayMode mode = Play_Normal, float offset = 0) = 0

Play a 3D sound attached to an MWWorld::Ptr. Will be updated automatically with the Ptr’s position, unless Play_NoTrack is specified.

Parameters
  • offset: Number of seconds into the sound to start playback.

virtual MWBase::SoundPtr playSound3D(const osg::Vec3f &initialPos, const std::string &soundId, float volume, float pitch, PlayType type = Play_TypeSfx, PlayMode mode = Play_Normal, float offset = 0) = 0

Play a 3D sound at initialPos. If the sound should be moving, it must be updated using Sound::setPosition.

virtual void stopSound(SoundPtr sound) = 0

Stop the given sound from playing.

virtual void stopSound3D(const MWWorld::ConstPtr &reference, const std::string &soundId) = 0

Stop the given object from playing the given sound,.

virtual void stopSound3D(const MWWorld::ConstPtr &reference) = 0

Stop the given object from playing all sounds.

virtual void stopSound(const MWWorld::CellStore *cell) = 0

Stop all sounds for the given cell.

virtual void stopSound(const std::string &soundId) = 0

Stop a non-3d looping sound.

virtual void fadeOutSound3D(const MWWorld::ConstPtr &reference, const std::string &soundId, float duration) = 0

Fade out given sound (that is already playing) of given object

Parameters
  • reference: Reference to object, whose sound is faded out
  • soundId: ID of the sound to fade out.
  • duration: Time until volume reaches 0.

virtual bool getSoundPlaying(const MWWorld::ConstPtr &reference, const std::string &soundId) const = 0

Is the given sound currently playing on the given object? If you want to check if sound played with playSound is playing, use empty Ptr

virtual void pauseSounds(int types = Play_TypeMask) = 0

Pauses all currently playing sounds, including music.

virtual void resumeSounds(int types = Play_TypeMask) = 0

Resumes all previously paused sounds.

virtual void update(float duration) = 0
virtual void setListenerPosDir(const osg::Vec3f &pos, const osg::Vec3f &dir, const osg::Vec3f &up, bool underwater) = 0
virtual void updatePtr(const MWWorld::ConstPtr &old, const MWWorld::ConstPtr &updated) = 0
virtual void clear() = 0

Private Functions

SoundManager(const SoundManager&)

not implemented

SoundManager &operator=(const SoundManager&)

not implemented

namespace MWBase
class StateManager
#include <statemanager.hpp>

Interface for game state manager (implemented in MWState)

Public Types

enum State

Values:

State_NoGame
State_Ended
State_Running
typedef std::list<MWState::Character>::const_iterator CharacterIterator

Public Functions

StateManager()
virtual ~StateManager()
virtual void requestQuit() = 0
virtual bool hasQuitRequest() const = 0
virtual void askLoadRecent() = 0
virtual State getState() const = 0
virtual void newGame(bool bypass = false) = 0

Start a new game.

Parameters
  • bypass: Skip new game mechanics.

virtual void endGame() = 0
virtual void deleteGame(const MWState::Character *character, const MWState::Slot *slot) = 0
virtual void saveGame(const std::string &description, const MWState::Slot *slot = 0) = 0

Write a saved game to slot or create a new slot if slot == 0.

Note
Slot must belong to the current character.

virtual void loadGame(const std::string &filepath) = 0

Load a saved game directly from the given file path. This will search the CharacterManager for a Character containing this save file, and set this Character current if one was found. Otherwise, a new Character will be created.

virtual void loadGame(const MWState::Character *character, const std::string &filepath) = 0

Load a saved game file belonging to the given character.

virtual void quickSave(std::string = "Quicksave") = 0

Simple saver, writes over the file if already existing.

Used for quick save and autosave

virtual void quickLoad() = 0

Simple loader, loads the last saved file.

Used for quickload

virtual MWState::Character *getCurrentCharacter() = 0

Note
May return null.

virtual CharacterIterator characterBegin() = 0

Any call to SaveGame and getCurrentCharacter can invalidate the returned iterator.

virtual CharacterIterator characterEnd() = 0
virtual void update(float duration) = 0

Private Functions

StateManager(const StateManager&)

not implemented

StateManager &operator=(const StateManager&)

not implemented

namespace MWGui

Enums

enum ShowInDialogueMode

Values:

ShowInDialogueMode_IfPossible
ShowInDialogueMode_Only
ShowInDialogueMode_Never
namespace MWBase
class WindowManager
#include <windowmanager.hpp>

Interface for widnow manager (implemented in MWGui)

Public Types

typedef std::vector<int> SkillList

Public Functions

WindowManager()
virtual ~WindowManager()
virtual void update() = 0

Should be called each frame to update windows/gui elements. This could mean updating sizes of gui elements or opening new dialogs.

virtual void playVideo(const std::string &name, bool allowSkipping) = 0

Note
This method will block until the video finishes playing (and will continually update the window while doing so)

virtual void setNewGame(bool newgame) = 0
virtual void pushGuiMode(MWGui::GuiMode mode) = 0
virtual void popGuiMode() = 0
virtual void removeGuiMode(MWGui::GuiMode mode) = 0

can be anywhere in the stack

virtual void goToJail(int days) = 0
virtual void updatePlayer() = 0
virtual MWGui::GuiMode getMode() const = 0
virtual bool containsMode(MWGui::GuiMode) const = 0
virtual bool isGuiMode() const = 0
virtual bool isConsoleMode() const = 0
virtual void toggleVisible(MWGui::GuiWindow wnd) = 0
virtual void forceHide(MWGui::GuiWindow wnd) = 0
virtual void unsetForceHide(MWGui::GuiWindow wnd) = 0
virtual void disallowAll() = 0

Disallow all inventory mode windows.

virtual void allow(MWGui::GuiWindow wnd) = 0

Allow one or more windows.

virtual bool isAllowed(MWGui::GuiWindow wnd) const = 0
virtual MWGui::DialogueWindow *getDialogueWindow() = 0

virtual MWGui::InventoryWindow *getInventoryWindow() = 0
virtual MWGui::CountDialog *getCountDialog() = 0
virtual MWGui::ConfirmationDialog *getConfirmationDialog() = 0
virtual MWGui::TradeWindow *getTradeWindow() = 0
virtual void useItem(const MWWorld::Ptr &item) = 0

Make the player use an item, while updating GUI state accordingly.

virtual void updateSpellWindow() = 0
virtual void setConsoleSelectedObject(const MWWorld::Ptr &object) = 0
virtual void setValue(const std::string &id, const MWMechanics::AttributeValue &value) = 0

Set value for the given ID.

virtual void setValue(int parSkill, const MWMechanics::SkillValue &value) = 0
virtual void setValue(const std::string &id, const MWMechanics::DynamicStat<float> &value) = 0
virtual void setValue(const std::string &id, const std::string &value) = 0
virtual void setValue(const std::string &id, int value) = 0
virtual void setDrowningTimeLeft(float time, float maxTime) = 0

Set time left for the player to start drowning (update the drowning bar)

Parameters
  • time: time left to start drowning
  • maxTime: how long we can be underwater (in total) until drowning starts

virtual void setPlayerClass(const ESM::Class &class_) = 0

set current class of player

virtual void configureSkills(const SkillList &major, const SkillList &minor) = 0

configure skill groups, each set contains the skill ID for that group.

virtual void updateSkillArea() = 0

update display of skills, factions, birth sign, reputation and bounty

virtual void changeCell(const MWWorld::CellStore *cell) = 0

change the active cell

virtual void setFocusObject(const MWWorld::Ptr &focus) = 0
virtual void setFocusObjectScreenCoords(float min_x, float min_y, float max_x, float max_y) = 0
virtual void setCursorVisible(bool visible) = 0
virtual void getMousePosition(int &x, int &y) = 0
virtual void getMousePosition(float &x, float &y) = 0
virtual void setDragDrop(bool dragDrop) = 0
virtual bool getWorldMouseOver() = 0
virtual bool toggleFogOfWar() = 0
virtual bool toggleFullHelp() = 0

show extra info in item tooltips (owner, script)

virtual bool getFullHelp() const = 0
virtual void setActiveMap(int x, int y, bool interior) = 0

set the indices of the map texture that should be used

virtual void setDrowningBarVisibility(bool visible) = 0

sets the visibility of the drowning bar

virtual void setHMSVisibility(bool visible) = 0

sets the visibility of the hud health/magicka/stamina bars

virtual void setMinimapVisibility(bool visible) = 0

sets the visibility of the hud minimap

virtual void setWeaponVisibility(bool visible) = 0
virtual void setSpellVisibility(bool visible) = 0
virtual void setSneakVisibility(bool visible) = 0
virtual void activateQuickKey(int index) = 0
virtual std::string getSelectedSpell() = 0
virtual void setSelectedSpell(const std::string &spellId, int successChancePercent) = 0
virtual void setSelectedEnchantItem(const MWWorld::Ptr &item) = 0
virtual void setSelectedWeapon(const MWWorld::Ptr &item) = 0
virtual void unsetSelectedSpell() = 0
virtual void unsetSelectedWeapon() = 0
virtual void showCrosshair(bool show) = 0
virtual bool getSubtitlesEnabled() = 0
virtual bool toggleGui() = 0
virtual void disallowMouse() = 0
virtual void allowMouse() = 0
virtual void notifyInputActionBound() = 0
virtual void addVisitedLocation(const std::string &name, int x, int y) = 0
virtual void removeDialog(MWGui::Layout *dialog) = 0

Hides dialog and schedules dialog to be deleted.

virtual void exitCurrentGuiMode() = 0

Gracefully attempts to exit the topmost GUI mode.

No guarentee of actually closing the window

virtual void MWBase::WindowManager::messageBox(const std::string & message, enum MWGui::ShowInDialogueMode showInDialogueMode = MWGui::ShowInDialogueMode_IfPossible) = 0
virtual void staticMessageBox(const std::string &message) = 0
virtual void removeStaticMessageBox() = 0
virtual void interactiveMessageBox(const std::string &message, const std::vector<std::string> &buttons = std::vector< std::string >(), bool block = false) = 0
virtual int readPressedButton() = 0

returns the index of the pressed button or -1 if no button was pressed (->MessageBoxmanager->InteractiveMessageBox)

virtual void onFrame(float frameDuration) = 0
virtual std::map<int, MWMechanics::SkillValue> getPlayerSkillValues() = 0

virtual std::map<int, MWMechanics::AttributeValue> getPlayerAttributeValues() = 0
virtual SkillList getPlayerMinorSkills() = 0
virtual SkillList getPlayerMajorSkills() = 0
virtual std::string getGameSettingString(const std::string &id, const std::string &default_) = 0

Fetches a GMST string from the store, if there is no setting with the given ID or it is not a string the default string is returned.

Parameters
  • id: Identifier for the GMST setting, e.g. “aName”
  • default: Default value if the GMST setting cannot be used.

virtual void processChangedSettings(const std::set<std::pair<std::string, std::string>> &changed) = 0
virtual void windowResized(int x, int y) = 0
virtual void executeInConsole(const std::string &path) = 0
virtual void enableRest() = 0
virtual bool getRestEnabled() = 0
virtual bool getJournalAllowed() = 0
virtual bool getPlayerSleeping() = 0
virtual void wakeUpPlayer() = 0
virtual void showCompanionWindow(MWWorld::Ptr actor) = 0
virtual void startSpellMaking(MWWorld::Ptr actor) = 0
virtual void startEnchanting(MWWorld::Ptr actor) = 0
virtual void startRecharge(MWWorld::Ptr soulgem) = 0
virtual void startSelfEnchanting(MWWorld::Ptr soulgem) = 0
virtual void startTraining(MWWorld::Ptr actor) = 0
virtual void startRepair(MWWorld::Ptr actor) = 0
virtual void startRepairItem(MWWorld::Ptr item) = 0
virtual void startTravel(const MWWorld::Ptr &actor) = 0
virtual void startSpellBuying(const MWWorld::Ptr &actor) = 0
virtual void startTrade(const MWWorld::Ptr &actor) = 0
virtual void openContainer(const MWWorld::Ptr &container, bool loot) = 0
virtual void showBook(const MWWorld::Ptr &item, bool showTakeButton) = 0
virtual void showScroll(const MWWorld::Ptr &item, bool showTakeButton) = 0
virtual void showSoulgemDialog(MWWorld::Ptr item) = 0
virtual void changePointer(const std::string &name) = 0
virtual void setEnemy(const MWWorld::Ptr &enemy) = 0
virtual const Translation::Storage &getTranslationDataStorage() const = 0
virtual void setKeyFocusWidget(MyGUI::Widget *widget) = 0

Warning: do not use MyGUI::InputManager::setKeyFocusWidget directly. Instead use this.

virtual Loading::Listener *getLoadingScreen() = 0
virtual bool getCursorVisible() = 0

Should the cursor be visible?

virtual void clear() = 0

Clear all savegame-specific data.

virtual void write(ESM::ESMWriter &writer, Loading::Listener &progress) = 0
virtual void readRecord(ESM::ESMReader &reader, uint32_t type) = 0
virtual int countSavedGameRecords() const = 0
virtual bool isSavingAllowed() const = 0

Does the current stack of GUI-windows permit saving?

virtual void exitCurrentModal() = 0

Send exit command to active Modal window.

virtual void addCurrentModal(MWGui::WindowModal *input) = 0

Sets the current Modal.

Used to send exit command to active Modal when Esc is pressed

virtual void removeCurrentModal(MWGui::WindowModal *input) = 0

Removes the top Modal.

Used when one Modal adds another Modal

Parameters
  • input: Pointer to the current modal, to ensure proper modal is removed

virtual void pinWindow(MWGui::GuiWindow window) = 0
virtual void fadeScreenIn(const float time, bool clearQueue = true) = 0

Fade the screen in, over time seconds.

virtual void fadeScreenOut(const float time, bool clearQueue = true) = 0

Fade the screen out to black, over time seconds.

virtual void fadeScreenTo(const int percent, const float time, bool clearQueue = true) = 0

Fade the screen to a specified percentage of black, over time seconds.

virtual void setBlindness(const int percent) = 0

Darken the screen to a specified percentage.

virtual void activateHitOverlay(bool interrupt = true) = 0
virtual void setWerewolfOverlay(bool set) = 0
virtual void toggleDebugWindow() = 0
virtual void cycleSpell(bool next) = 0

Cycle to next or previous spell.

virtual void cycleWeapon(bool next) = 0

Cycle to next or previous weapon.

virtual std::string correctIconPath(const std::string &path) = 0
virtual std::string correctBookartPath(const std::string &path, int width, int height) = 0
virtual std::string correctTexturePath(const std::string &path) = 0
virtual bool textureExists(const std::string &path) = 0
virtual void removeCell(MWWorld::CellStore *cell) = 0
virtual void writeFog(MWWorld::CellStore *cell) = 0

Private Functions

WindowManager(const WindowManager&)

not implemented

WindowManager &operator=(const WindowManager&)

not implemented

namespace MWWorld

Typedefs

typedef std::vector<std::pair<MWWorld::Ptr, MWMechanics::Movement>> PtrMovementList
namespace MWBase
class World
#include <world.hpp>

Interface for the World (implemented in MWWorld)

Public Types

enum DetectionType

Values:

Detect_Enchantment
Detect_Key
Detect_Creature

Public Functions

World()
virtual ~World()
virtual void preloadCommonAssets() = 0
virtual void startNewGame(bool bypass) = 0

Parameters
  • bypass: Bypass regular game start.

virtual void clear() = 0
virtual int countSavedGameRecords() const = 0
virtual int countSavedGameCells() const = 0
virtual void write(ESM::ESMWriter &writer, Loading::Listener &listener) const = 0
virtual void readRecord(ESM::ESMReader &reader, uint32_t type, const std::map<int, int> &contentFileMap) = 0
virtual MWWorld::CellStore *getExterior(int x, int y) = 0
virtual MWWorld::CellStore *getInterior(const std::string &name) = 0
virtual MWWorld::CellStore *getCell(const ESM::CellId &id) = 0
virtual void useDeathCamera() = 0
virtual void setWaterHeight(const float height) = 0
virtual bool toggleWater() = 0
virtual bool toggleWorld() = 0
virtual void adjustSky() = 0
virtual const Fallback::Map *getFallback() const = 0
virtual MWWorld::Player &getPlayer() = 0
virtual MWWorld::Ptr getPlayerPtr() = 0
virtual const MWWorld::ESMStore &getStore() const = 0
virtual std::vector<ESM::ESMReader> &getEsmReader() = 0
virtual MWWorld::LocalScripts &getLocalScripts() = 0
virtual bool hasCellChanged() const = 0

Has the set of active cells changed, since the last frame?

virtual bool isCellExterior() const = 0
virtual bool isCellQuasiExterior() const = 0
virtual osg::Vec2f getNorthVector(const MWWorld::CellStore *cell) = 0

get north vector for given interior cell

virtual void getDoorMarkers(MWWorld::CellStore *cell, std::vector<DoorMarker> &out) = 0

get a list of teleport door markers for a given cell, to be displayed on the local map

virtual void setGlobalInt(const std::string &name, int value) = 0

Set value independently from real type.

virtual void setGlobalFloat(const std::string &name, float value) = 0

Set value independently from real type.

virtual int getGlobalInt(const std::string &name) const = 0

Get value independently from real type.

virtual float getGlobalFloat(const std::string &name) const = 0

Get value independently from real type.

virtual char getGlobalVariableType(const std::string &name) const = 0

Return ‘ ‘, if there is no global variable with this name.

virtual std::string getCellName(const MWWorld::CellStore *cell = 0) const = 0

Return name of the cell.

Note
If cell==0, the cell the player is currently in will be used instead to generate a name.

virtual void removeRefScript(MWWorld::RefData *ref) = 0
virtual MWWorld::Ptr getPtr(const std::string &name, bool activeOnly) = 0

Return a pointer to a liveCellRef with the given name.

Parameters
  • activeOnly: do non search inactive cells.

virtual MWWorld::Ptr searchPtr(const std::string &name, bool activeOnly) = 0

Return a pointer to a liveCellRef with the given name.

Parameters
  • activeOnly: do non search inactive cells.

virtual MWWorld::Ptr searchPtrViaActorId(int actorId) = 0

Search is limited to the active cells.

virtual MWWorld::Ptr findContainer(const MWWorld::ConstPtr &ptr) = 0

Return a pointer to a liveCellRef which contains ptr.

Note
Search is limited to the active cells.

virtual void enable(const MWWorld::Ptr &ptr) = 0
virtual void disable(const MWWorld::Ptr &ptr) = 0
virtual void advanceTime(double hours, bool incremental = false) = 0

Advance in-game time.

virtual void setHour(double hour) = 0

Set in-game time hour.

virtual void setMonth(int month) = 0

Set in-game time month.

virtual void setDay(int day) = 0

Set in-game time day.

virtual int getDay() const = 0
virtual int getMonth() const = 0
virtual int getYear() const = 0
virtual std::string getMonthName(int month = -1) const = 0

Return name of month (-1: current month)

virtual MWWorld::TimeStamp getTimeStamp() const = 0

Return current in-game time stamp.

virtual bool toggleSky() = 0

Return
Resulting mode

virtual void changeWeather(const std::string &region, const unsigned int id) = 0
virtual int getCurrentWeather() const = 0
virtual int getMasserPhase() const = 0
virtual int getSecundaPhase() const = 0
virtual void setMoonColour(bool red) = 0
virtual void modRegion(const std::string &regionid, const std::vector<char> &chances) = 0
virtual float getTimeScaleFactor() const = 0
virtual void changeToInteriorCell(const std::string &cellName, const ESM::Position &position, bool adjustPlayerPos, bool changeEvent = true) = 0

Move to interior cell.

Parameters
  • changeEvent: If false, do not trigger cell change flag or detect worldspace changes

virtual void changeToExteriorCell(const ESM::Position &position, bool adjustPlayerPos, bool changeEvent = true) = 0

Move to exterior cell.

Parameters
  • changeEvent: If false, do not trigger cell change flag or detect worldspace changes

virtual void changeToCell(const ESM::CellId &cellId, const ESM::Position &position, bool adjustPlayerPos, bool changeEvent = true) = 0

Parameters
  • changeEvent: If false, do not trigger cell change flag or detect worldspace changes

virtual const ESM::Cell *getExterior(const std::string &cellName) const = 0

Return a cell matching the given name or a 0-pointer, if there is no such cell.

virtual void markCellAsUnchanged() = 0
virtual MWWorld::Ptr getFacedObject() = 0

Return pointer to the object the player is looking at, if it is within activation range.

virtual float getDistanceToFacedObject() = 0
virtual float getMaxActivationDistance() = 0
virtual std::pair<MWWorld::Ptr, osg::Vec3f> getHitContact(const MWWorld::ConstPtr &ptr, float distance) = 0

Returns a pointer to the object the provided object would hit (if within the specified distance), and the point where the hit occurs. This will attempt to use the “Head” node, or alternatively the “Bip01 Head” node as a basis.

virtual void adjustPosition(const MWWorld::Ptr &ptr, bool force) = 0

Adjust position after load to be on ground. Must be called after model load.

Parameters
  • force: do this even if the ptr is flying

virtual void fixPosition(const MWWorld::Ptr &actor) = 0

Attempt to fix position so that the Ptr is no longer inside collision geometry.

virtual void deleteObject(const MWWorld::Ptr &ptr) = 0

Note
No-op for items in containers. Use ContainerStore::removeItem instead.

virtual void undeleteObject(const MWWorld::Ptr &ptr) = 0
virtual MWWorld::Ptr moveObject(const MWWorld::Ptr &ptr, float x, float y, float z) = 0

Return
an updated Ptr in case the Ptr’s cell changes

virtual MWWorld::Ptr moveObject(const MWWorld::Ptr &ptr, MWWorld::CellStore *newCell, float x, float y, float z, bool movePhysics = true) = 0

Return
an updated Ptr

virtual void scaleObject(const MWWorld::Ptr &ptr, float scale) = 0
virtual void rotateObject(const MWWorld::Ptr &ptr, float x, float y, float z, bool adjust = false) = 0
virtual MWWorld::Ptr placeObject(const MWWorld::ConstPtr &ptr, MWWorld::CellStore *cell, ESM::Position pos) = 0

Place an object. Makes a copy of the Ptr.

virtual MWWorld::Ptr safePlaceObject(const MWWorld::ConstPtr &ptr, const MWWorld::ConstPtr &referenceObject, MWWorld::CellStore *referenceCell, int direction, float distance) = 0

Place an object in a safe place next to referenceObject. direction and distance specify the wanted placement relative to referenceObject (but the object may be placed somewhere else if the wanted location is obstructed).

virtual void indexToPosition(int cellX, int cellY, float &x, float &y, bool centre = false) const = 0

Convert cell numbers to position.

virtual void positionToIndex(float x, float y, int &cellX, int &cellY) const = 0

Convert position to cell numbers.

virtual void queueMovement(const MWWorld::Ptr &ptr, const osg::Vec3f &velocity) = 0

Queues movement for ptr (in local space), to be applied in the next call to doPhysics.

virtual bool castRay(float x1, float y1, float z1, float x2, float y2, float z2) = 0

cast a Ray and return true if there is an object in the ray path.

virtual bool toggleCollisionMode() = 0

Toggle collision mode for player. If disabled player object should ignore collisions and gravity.

Return
Resulting mode

virtual bool toggleRenderMode(MWRender::RenderMode mode) = 0

Toggle a render mode.

Return
Resulting mode

virtual const ESM::Potion *createRecord(const ESM::Potion &record) = 0

Create a new record (of type potion) in the ESM store.

Return
pointer to created record

virtual const ESM::Spell *createRecord(const ESM::Spell &record) = 0

Create a new record (of type spell) in the ESM store.

Return
pointer to created record

virtual const ESM::Class *createRecord(const ESM::Class &record) = 0

Create a new record (of type class) in the ESM store.

Return
pointer to created record

virtual const ESM::Cell *createRecord(const ESM::Cell &record) = 0

Create a new record (of type cell) in the ESM store.

Return
pointer to created record

virtual const ESM::NPC *createRecord(const ESM::NPC &record) = 0

Create a new record (of type npc) in the ESM store.

Return
pointer to created record

virtual const ESM::Armor *createRecord(const ESM::Armor &record) = 0

Create a new record (of type armor) in the ESM store.

Return
pointer to created record

virtual const ESM::Weapon *createRecord(const ESM::Weapon &record) = 0

Create a new record (of type weapon) in the ESM store.

Return
pointer to created record

virtual const ESM::Clothing *createRecord(const ESM::Clothing &record) = 0

Create a new record (of type clothing) in the ESM store.

Return
pointer to created record

virtual const ESM::Enchantment *createRecord(const ESM::Enchantment &record) = 0

Create a new record (of type enchantment) in the ESM store.

Return
pointer to created record

virtual const ESM::Book *createRecord(const ESM::Book &record) = 0

Create a new record (of type book) in the ESM store.

Return
pointer to created record

virtual const ESM::CreatureLevList *createOverrideRecord(const ESM::CreatureLevList &record) = 0

Write this record to the ESM store, allowing it to override a pre-existing record with the same ID.

Return
pointer to created record

virtual const ESM::ItemLevList *createOverrideRecord(const ESM::ItemLevList &record) = 0

Write this record to the ESM store, allowing it to override a pre-existing record with the same ID.

Return
pointer to created record

virtual void update(float duration, bool paused) = 0
virtual MWWorld::Ptr placeObject(const MWWorld::ConstPtr &object, float cursorX, float cursorY, int amount) = 0

copy and place an object into the gameworld at the specified cursor position

Parameters
  • object:
  • cursor: X (relative 0-1)
  • cursor: Y (relative 0-1)
  • number: of objects to place

virtual MWWorld::Ptr dropObjectOnGround(const MWWorld::Ptr &actor, const MWWorld::ConstPtr &object, int amount) = 0

copy and place an object into the gameworld at the given actor’s position

Parameters
  • actor: giving the dropped object position
  • object:
  • number: of objects to place

virtual bool canPlaceObject(float cursorX, float cursorY) = 0

Return
true if it is possible to place on object at specified cursor location

virtual void processChangedSettings(const std::set<std::pair<std::string, std::string>> &settings) = 0
virtual bool isFlying(const MWWorld::Ptr &ptr) const = 0
virtual bool isSlowFalling(const MWWorld::Ptr &ptr) const = 0
virtual bool isSwimming(const MWWorld::ConstPtr &object) const = 0
virtual bool isWading(const MWWorld::ConstPtr &object) const = 0
virtual bool isSubmerged(const MWWorld::ConstPtr &object) const = 0

Is the head of the creature underwater?

virtual bool isUnderwater(const MWWorld::CellStore *cell, const osg::Vec3f &pos) const = 0
virtual bool isWaterWalkingCastableOnTarget(const MWWorld::ConstPtr &target) const = 0
virtual bool isOnGround(const MWWorld::Ptr &ptr) const = 0
virtual osg::Matrixf getActorHeadTransform(const MWWorld::ConstPtr &actor) const = 0
virtual void togglePOV() = 0
virtual bool isFirstPerson() const = 0
virtual void togglePreviewMode(bool enable) = 0
virtual bool toggleVanityMode(bool enable) = 0
virtual void allowVanityMode(bool allow) = 0
virtual void togglePlayerLooking(bool enable) = 0
virtual void changeVanityModeScale(float factor) = 0
virtual bool vanityRotateCamera(float *rot) = 0
virtual void setCameraDistance(float dist, bool adjust = false, bool override = true) = 0
virtual void setupPlayer() = 0
virtual void renderPlayer() = 0
virtual void activateDoor(const MWWorld::Ptr &door) = 0

open or close a non-teleport door (depending on current state)

virtual void activateDoor(const MWWorld::Ptr &door, int state) = 0

update movement state of a non-teleport door as specified

Note
throws an exception when invoked on a teleport door
Parameters
  • state: see MWClass::setDoorState

virtual bool getPlayerStandingOn(const MWWorld::ConstPtr &object) = 0

Return
true if the player is standing on object

virtual bool getActorStandingOn(const MWWorld::ConstPtr &object) = 0

Return
true if any actor is standing on object

virtual bool getPlayerCollidingWith(const MWWorld::ConstPtr &object) = 0

Return
true if the player is colliding with object

virtual bool getActorCollidingWith(const MWWorld::ConstPtr &object) = 0

Return
true if any actor is colliding with object

virtual void hurtStandingActors(const MWWorld::ConstPtr &object, float dmgPerSecond) = 0

Apply a health difference to any actors standing on object. To hurt actors, healthPerSecond should be a positive value. For a negative value, actors will be healed.

virtual void hurtCollidingActors(const MWWorld::ConstPtr &object, float dmgPerSecond) = 0

Apply a health difference to any actors colliding with object. To hurt actors, healthPerSecond should be a positive value. For a negative value, actors will be healed.

virtual float getWindSpeed() = 0
virtual void getContainersOwnedBy(const MWWorld::ConstPtr &npc, std::vector<MWWorld::Ptr> &out) = 0

get all containers in active cells owned by this Npc

virtual void getItemsOwnedBy(const MWWorld::ConstPtr &npc, std::vector<MWWorld::Ptr> &out) = 0

get all items in active cells owned by this Npc

virtual bool getLOS(const MWWorld::ConstPtr &actor, const MWWorld::ConstPtr &targetActor) = 0

get Line of Sight (morrowind stupid implementation)

virtual float getDistToNearestRayHit(const osg::Vec3f &from, const osg::Vec3f &dir, float maxDist, bool includeWater = false) = 0
virtual void enableActorCollision(const MWWorld::Ptr &actor, bool enable) = 0
virtual int canRest() = 0

check if the player is allowed to rest 0 - yes 1 - only waiting 2 - player is underwater 3 - enemies are nearby (not implemented)

virtual MWRender::Animation *getAnimation(const MWWorld::Ptr &ptr) = 0

virtual const MWRender::Animation *getAnimation(const MWWorld::ConstPtr &ptr) const = 0
virtual void reattachPlayerCamera() = 0
virtual void screenshot(osg::Image *image, int w, int h) = 0

virtual bool findExteriorPosition(const std::string &name, ESM::Position &pos) = 0

Find default position inside exterior cell specified by name

Return
false if exterior with given name not exists, true otherwise

virtual bool findInteriorPosition(const std::string &name, ESM::Position &pos) = 0

Find default position inside interior cell specified by name

Return
false if interior with given name not exists, true otherwise

virtual void enableTeleporting(bool enable) = 0

Enables or disables use of teleport spell effects (recall, intervention, etc).

virtual bool isTeleportingEnabled() const = 0

Returns true if teleport spell effects are allowed.

virtual void enableLevitation(bool enable) = 0

Enables or disables use of levitation spell effect.

virtual bool isLevitationEnabled() const = 0

Returns true if levitation spell effect is allowed.

virtual bool getGodModeState() = 0
virtual bool toggleGodMode() = 0
virtual bool toggleScripts() = 0
virtual bool getScriptsEnabled() const = 0
virtual bool startSpellCast(const MWWorld::Ptr &actor) = 0

startSpellCast attempt to start casting a spell. Might fail immediately if conditions are not met.

Return
true if the spell can be casted (i.e. the animation should start)
Parameters
  • actor:

virtual void castSpell(const MWWorld::Ptr &actor) = 0
virtual void launchMagicBolt(const std::string &spellId, bool stack, const ESM::EffectList &effects, const MWWorld::Ptr &caster, const std::string &sourceName, const osg::Vec3f &fallbackDirection) = 0
virtual void launchProjectile(MWWorld::Ptr actor, MWWorld::ConstPtr projectile, const osg::Vec3f &worldPos, const osg::Quat &orient, MWWorld::Ptr bow, float speed, float attackStrength) = 0
virtual const std::vector<std::string> &getContentFiles() const = 0
virtual void breakInvisibility(const MWWorld::Ptr &actor) = 0
virtual bool isDark() const = 0
virtual bool findInteriorPositionInWorldSpace(const MWWorld::CellStore *cell, osg::Vec3f &result) = 0
virtual void teleportToClosestMarker(const MWWorld::Ptr &ptr, const std::string &id) = 0

Teleports ptr to the closest reference of id (e.g. DivineMarker, PrisonMarker, TempleMarker)

Note
id must be lower case

virtual void listDetectedReferences(const MWWorld::Ptr &ptr, std::vector<MWWorld::Ptr> &out, DetectionType type) = 0

List all references (filtered by type) detected by ptr. The range is determined by the current magnitude of the “Detect X” magic effect belonging to type.

Note
This also works for references in containers.

virtual void updateDialogueGlobals() = 0

Update the value of some globals according to the world state, which may be used by dialogue entries. This should be called when initiating a dialogue.

virtual void confiscateStolenItems(const MWWorld::Ptr &ptr) = 0

Moves all stolen items from ptr to the closest evidence chest.

virtual void goToJail() = 0
virtual void spawnRandomCreature(const std::string &creatureList) = 0

Spawn a random creature from a levelled list next to the player.

virtual void spawnBloodEffect(const MWWorld::Ptr &ptr, const osg::Vec3f &worldPosition) = 0

Spawn a blood effect for ptr at worldPosition.

virtual void spawnEffect(const std::string &model, const std::string &textureOverride, const osg::Vec3f &worldPos) = 0
virtual void explodeSpell(const osg::Vec3f &origin, const ESM::EffectList &effects, const MWWorld::Ptr &caster, const MWWorld::Ptr &ignore, ESM::RangeType rangeType, const std::string &id, const std::string &sourceName) = 0
virtual void activate(const MWWorld::Ptr &object, const MWWorld::Ptr &actor) = 0
virtual bool isInStorm() const = 0

See
MWWorld::WeatherManager::isInStorm

virtual osg::Vec3f getStormDirection() const = 0

See
MWWorld::WeatherManager::getStormDirection

virtual void resetActors() = 0

Resets all actors in the current active cells to their original location within that cell.

virtual bool isWalkingOnWater(const MWWorld::ConstPtr &actor) const = 0
virtual osg::Vec3f aimToTarget(const MWWorld::ConstPtr &actor, const MWWorld::ConstPtr &target) = 0

Return a vector aiming the actor’s weapon towards a target.

Note
The length of the vector is the distance between actor and target.

virtual float getHitDistance(const MWWorld::ConstPtr &actor, const MWWorld::ConstPtr &target) = 0

Return the distance between actor’s weapon and target’s collision box.

virtual void removeContainerScripts(const MWWorld::Ptr &reference) = 0
virtual bool isPlayerInJail() const = 0
virtual float getTerrainHeightAt(const osg::Vec3f &worldPos) const = 0

Return terrain height at worldPos position.

virtual osg::Vec3f getHalfExtents(const MWWorld::ConstPtr &actor, bool rendering = false) const = 0

Return physical or rendering half extents of the given actor.

Private Functions

World(const World&)

not implemented

World &operator=(const World&)

not implemented

struct DoorMarker

Public Members

std::string name
float x
float y
ESM::CellId dest