From 15107ca5cf4085792a57e10dbcdb7974e8d675b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ji=C5=99=C3=AD=20Kune=C5=A1?= Date: Fri, 17 Jul 2015 17:48:38 +0200 Subject: [PATCH] crosshair owned - settings option --- apps/openmw/mwgui/tooltips.cpp | 29 ++++++++++++++++------------- files/settings-default.cfg | 3 +++ 2 files changed, 19 insertions(+), 13 deletions(-) diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 34762de5a..51bdd97f9 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -354,22 +354,25 @@ namespace MWGui void ToolTips::checkOwned() { - MWBase::WindowManager *wm = MWBase::Environment::get().getWindowManager(); - - if(!mFocusObject.isEmpty()) + if(Settings::Manager::getBool("show owned", "Game")) { - MWWorld::CellRef& cellref = mFocusObject.getCellRef(); - MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr(); - MWWorld::Ptr victim; + MWBase::WindowManager *wm = MWBase::Environment::get().getWindowManager(); - MWMechanics::MechanicsManager* mm = new MWMechanics::MechanicsManager; - bool allowed = mm->isAllowedToUse(ptr, cellref, victim); // 0 - owned, 1 - not owned + if(!mFocusObject.isEmpty()) + { + MWWorld::CellRef& cellref = mFocusObject.getCellRef(); + MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr(); + MWWorld::Ptr victim; + + MWMechanics::MechanicsManager* mm = new MWMechanics::MechanicsManager; + bool allowed = mm->isAllowedToUse(ptr, cellref, victim); // 0 - owned, 1 - not owned - wm->setCrosshairOwned(!allowed); - } - else - { - wm->setCrosshairOwned(false); + wm->setCrosshairOwned(!allowed); + } + else + { + wm->setCrosshairOwned(false); + } } } diff --git a/files/settings-default.cfg b/files/settings-default.cfg index 0581d7356..4ec0c2480 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -162,6 +162,9 @@ best attack = false difficulty = 0 +# change crosshair color when pointing on owned object +show owned = false + [Saves] character = # Save when resting