mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-31 20:45:32 +00:00
Merge branch 'cliherbalism' into 'master'
Add a setting to disable graphical herbalism See merge request OpenMW/openmw!440
This commit is contained in:
commit
fd64aacf7d
4 changed files with 19 additions and 3 deletions
|
@ -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("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.
|
||||
graphic herbalism = true
|
||||
|
||||
[General]
|
||||
|
||||
# Anisotropy reduces distortion in textures at low angles (e.g. 0 to 16).
|
||||
|
|
Loading…
Reference in a new issue