Add a setting to disable graphical herbalism

pull/593/head
Evil Eye 4 years ago
parent c2933721c6
commit e62fff5f2e

@ -386,8 +386,6 @@ OMW::Engine::Engine(Files::ConfigurationManager& configurationManager)
, mNewGame (false) , mNewGame (false)
, mCfgMgr(configurationManager) , mCfgMgr(configurationManager)
{ {
MWClass::registerClasses();
SDL_SetHint(SDL_HINT_ACCELEROMETER_AS_JOYSTICK, "0"); // We use only gamepads 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; 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; std::string settingspath;
settingspath = loadSettings (settings); settingspath = loadSettings (settings);
MWClass::registerClasses();
// Create encoder // Create encoder
mEncoder = new ToUTF8::Utf8Encoder(mEncoding); mEncoder = new ToUTF8::Utf8Encoder(mEncoding);

@ -2,6 +2,7 @@
#include <components/esm/loadcont.hpp> #include <components/esm/loadcont.hpp>
#include <components/esm/containerstate.hpp> #include <components/esm/containerstate.hpp>
#include <components/settings/settings.hpp>
#include "../mwbase/environment.hpp" #include "../mwbase/environment.hpp"
#include "../mwbase/world.hpp" #include "../mwbase/world.hpp"
@ -59,6 +60,11 @@ namespace MWClass
return *this; return *this;
} }
Container::Container()
{
mHarvestEnabled = Settings::Manager::getBool("enable graphic herbalism", "Game");
}
void Container::ensureCustomData (const MWWorld::Ptr& ptr) const void Container::ensureCustomData (const MWWorld::Ptr& ptr) const
{ {
if (!ptr.getRefData().getCustomData()) 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); const MWRender::Animation* animation = MWBase::Environment::get().getWorld()->getAnimation(ptr);
if (animation == nullptr) if (animation == nullptr)
return false; return false;

@ -30,11 +30,16 @@ namespace MWClass
class Container : public MWWorld::Class class Container : public MWWorld::Class
{ {
bool mHarvestEnabled;
void ensureCustomData (const MWWorld::Ptr& ptr) const; void ensureCustomData (const MWWorld::Ptr& ptr) const;
MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const override; MWWorld::Ptr copyToCellImpl(const MWWorld::ConstPtr &ptr, MWWorld::CellStore &cell) const override;
bool canBeHarvested(const MWWorld::ConstPtr& ptr) const;
public: public:
Container();
void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override; void insertObjectRendering (const MWWorld::Ptr& ptr, const std::string& model, MWRender::RenderingInterface& renderingInterface) const override;
///< Add reference into a cell for rendering ///< 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. # Make stealing items from NPCs that were knocked down possible during combat.
always allow stealing from knocked out actors = false always allow stealing from knocked out actors = false
# Enables visually harvesting plants for models that support it.
enable graphic herbalism = true
[General] [General]
# Anisotropy reduces distortion in textures at low angles (e.g. 0 to 16). # Anisotropy reduces distortion in textures at low angles (e.g. 0 to 16).

Loading…
Cancel
Save