mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-23 06:40:06 +00:00
ToggleAI: Report current status on toggle
This commit is contained in:
parent
688415ce54
commit
793649c854
4 changed files with 10 additions and 4 deletions
|
@ -156,7 +156,7 @@ namespace MWBase
|
||||||
/// paused we may want to do it manually (after equipping permanent enchantment)
|
/// paused we may want to do it manually (after equipping permanent enchantment)
|
||||||
virtual void updateMagicEffects (const MWWorld::Ptr& ptr) = 0;
|
virtual void updateMagicEffects (const MWWorld::Ptr& ptr) = 0;
|
||||||
|
|
||||||
virtual void toggleAI() = 0;
|
virtual bool toggleAI() = 0;
|
||||||
virtual bool isAIActive() = 0;
|
virtual bool isAIActive() = 0;
|
||||||
|
|
||||||
virtual void getObjectsInRange (const Ogre::Vector3& position, float radius, std::vector<MWWorld::Ptr>& objects) = 0;
|
virtual void getObjectsInRange (const Ogre::Vector3& position, float radius, std::vector<MWWorld::Ptr>& objects) = 0;
|
||||||
|
|
|
@ -750,9 +750,10 @@ namespace MWMechanics
|
||||||
mActors.updateMagicEffects(ptr);
|
mActors.updateMagicEffects(ptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MechanicsManager::toggleAI()
|
bool MechanicsManager::toggleAI()
|
||||||
{
|
{
|
||||||
mAI = !mAI;
|
mAI = !mAI;
|
||||||
|
return mAI;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MechanicsManager::isAIActive()
|
bool MechanicsManager::isAIActive()
|
||||||
|
|
|
@ -137,7 +137,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
virtual std::list<MWWorld::Ptr> getActorsFollowing(const MWWorld::Ptr& actor);
|
virtual std::list<MWWorld::Ptr> getActorsFollowing(const MWWorld::Ptr& actor);
|
||||||
|
|
||||||
virtual void toggleAI();
|
virtual bool toggleAI();
|
||||||
virtual bool isAIActive();
|
virtual bool isAIActive();
|
||||||
|
|
||||||
virtual void playerLoaded();
|
virtual void playerLoaded();
|
||||||
|
|
|
@ -464,7 +464,12 @@ namespace MWScript
|
||||||
|
|
||||||
virtual void execute (Interpreter::Runtime& runtime)
|
virtual void execute (Interpreter::Runtime& runtime)
|
||||||
{
|
{
|
||||||
MWBase::Environment::get().getMechanicsManager()->toggleAI();
|
InterpreterContext& context
|
||||||
|
= static_cast<InterpreterContext&> (runtime.getContext());
|
||||||
|
|
||||||
|
bool enabled = MWBase::Environment::get().getMechanicsManager()->toggleAI();
|
||||||
|
|
||||||
|
context.report (enabled ? "AI -> On" : "AI -> Off");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue