mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-13 21:40:11 +00:00
Add a setting to disable graphical herbalism
This commit is contained in:
parent
c2933721c6
commit
e62fff5f2e
@ -386,8 +386,6 @@ OMW::Engine::Engine(Files::ConfigurationManager& configurationManager)
|
||||
, mNewGame (false)
|
||||
, mCfgMgr(configurationManager)
|
||||
{
|
||||
MWClass::registerClasses();
|
||||
|
||||
SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); // We use only gamepads
|
||||
|
||||
Uint32 flags = SDL_INIT_VIDEO|SDL_INIT_NOPARACHUTE|SDL_INIT_GAMECONTROLLER|SDL_INIT_JOYSTICK|SDL_INIT_SENSOR;
|
||||
@ -838,6 +836,8 @@ void OMW::Engine::go()
|
||||
std::string settingspath;
|
||||
settingspath = loadSettings (settings);
|
||||
|
||||
MWClass::registerClasses();
|
||||
|
||||
// Create encoder
|
||||
mEncoder = new ToUTF8::Utf8Encoder(mEncoding);
|
||||
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include <components/esm/loadcont.hpp>
|
||||
#include <components/esm/containerstate.hpp>
|
||||
#include <components/settings/settings.hpp>
|
||||
|
||||
#include "../mwbase/environment.hpp"
|
||||
#include "../mwbase/world.hpp"
|
||||
@ -59,6 +60,11 @@ namespace MWClass
|
||||
return *this;
|
||||
}
|
||||
|
||||
Container::Container()
|
||||
{
|
||||
mHarvestEnabled = Settings::Manager::getBool("enable graphic herbalism", "Game");
|
||||
}
|
||||
|
||||
void Container::ensureCustomData (const MWWorld::Ptr& ptr) const
|
||||
{
|
||||
if (!ptr.getRefData().getCustomData())
|
||||
@ -72,8 +78,10 @@ namespace MWClass
|
||||
}
|
||||
}
|
||||
|
||||
bool canBeHarvested(const MWWorld::ConstPtr& ptr)
|
||||
bool Container::canBeHarvested(const MWWorld::ConstPtr& ptr) const
|
||||
{
|
||||
if (!mHarvestEnabled)
|
||||
return false;
|
||||
const MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(ptr);
|
||||
if (animation == nullptr)
|
||||
return false;
|
||||
|
@ -30,11 +30,16 @@ namespace MWClass
|
||||
|
||||
class Container : public MWWorld::Class
|
||||
{
|
||||
bool mHarvestEnabled;
|
||||
|
||||
void ensureCustomData (const MWWorld::Ptr& ptr) const;
|
||||
|
||||
MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const override;
|
||||
|
||||
bool canBeHarvested(const MWWorld::ConstPtr& ptr) const;
|
||||
|
||||
public:
|
||||
Container();
|
||||
|
||||
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
|
||||
///< Add reference into a cell for rendering
|
||||
|
@ -361,6 +361,9 @@ trainers training skills based on base skill = false
|
||||
# Make stealing items from NPCs that were knocked down possible during combat.
|
||||
always allow stealing from knocked out actors = false
|
||||
|
||||
# Enables visually harvesting plants for models that support it.
|
||||
enable graphic herbalism = true
|
||||
|
||||
[General]
|
||||
|
||||
# Anisotropy reduces distortion in textures at low angles (e.g. 0 to 16).
|
||||
|
Loading…
x
Reference in New Issue
Block a user