1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-20 05:23:51 +00:00

fixed comment, save settings to member variable, removed usless include, changed variable to const

This commit is contained in:
Jiří Kuneš 2015-07-17 20:30:00 +02:00
parent e68b388d16
commit 4a6d806127
5 changed files with 10 additions and 9 deletions

View file

@ -6,8 +6,6 @@
#include <list> #include <list>
#include <stdint.h> #include <stdint.h>
#include "../mwworld/ptr.hpp"
namespace osg namespace osg
{ {
class Vec3f; class Vec3f;
@ -25,6 +23,7 @@ namespace MWWorld
{ {
class Ptr; class Ptr;
class CellStore; class CellStore;
class CellRef;
} }
namespace Loading namespace Loading

View file

@ -298,7 +298,6 @@ namespace MWGui
tooltipSize.height); tooltipSize.height);
mDynamicToolTipBox->setVisible(true); mDynamicToolTipBox->setVisible(true);
} }
} }
} }
@ -343,7 +342,6 @@ namespace MWGui
if (!image) if (!image)
info.icon = ""; info.icon = "";
tooltipSize = createToolTip(info); tooltipSize = createToolTip(info);
} }
return tooltipSize; return tooltipSize;
@ -351,10 +349,9 @@ namespace MWGui
bool ToolTips::checkOwned() bool ToolTips::checkOwned()
{ {
// true=owned, false=notOwned
if(!mFocusObject.isEmpty()) if(!mFocusObject.isEmpty())
{ {
MWWorld::CellRef& cellref = mFocusObject.getCellRef(); const MWWorld::CellRef& cellref = mFocusObject.getCellRef();
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr(); MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr();
MWWorld::Ptr victim; MWWorld::Ptr victim;

View file

@ -89,7 +89,7 @@ namespace MWGui
static void createMagicEffectToolTip(MyGUI::Widget* widget, short id); static void createMagicEffectToolTip(MyGUI::Widget* widget, short id);
bool checkOwned(); bool checkOwned();
/// Checks if object is owned and sets correct crosshair mode /// Returns True if taking mFocusObject would be crime
private: private:
MyGUI::Widget* mDynamicToolTipBox; MyGUI::Widget* mDynamicToolTipBox;

View file

@ -187,6 +187,7 @@ namespace MWGui
, mRestAllowed(true) , mRestAllowed(true)
, mFPS(0.0f) , mFPS(0.0f)
, mFallbackMap(fallbackMap) , mFallbackMap(fallbackMap)
, mShowOwned(false)
{ {
float uiScale = Settings::Manager::getFloat("scaling factor", "GUI"); float uiScale = Settings::Manager::getFloat("scaling factor", "GUI");
mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getTextureManager(), uiScale); mGuiPlatform = new osgMyGUI::Platform(viewer, guiRoot, resourceSystem->getTextureManager(), uiScale);
@ -261,6 +262,8 @@ namespace MWGui
MyGUI::ClipboardManager::getInstance().eventClipboardChanged += MyGUI::newDelegate(this, &WindowManager::onClipboardChanged); MyGUI::ClipboardManager::getInstance().eventClipboardChanged += MyGUI::newDelegate(this, &WindowManager::onClipboardChanged);
MyGUI::ClipboardManager::getInstance().eventClipboardRequested += MyGUI::newDelegate(this, &WindowManager::onClipboardRequested); MyGUI::ClipboardManager::getInstance().eventClipboardRequested += MyGUI::newDelegate(this, &WindowManager::onClipboardRequested);
mShowOwned = Settings::Manager::getBool("show owned", "Game");
} }
void WindowManager::initUI() void WindowManager::initUI()
@ -1039,7 +1042,7 @@ namespace MWGui
{ {
mToolTips->setFocusObject(focus); mToolTips->setFocusObject(focus);
if(Settings::Manager::getBool("show owned", "Game") && mHud) if(mShowOwned && mHud)
{ {
bool owned = mToolTips->checkOwned(); bool owned = mToolTips->checkOwned();
mHud->setCrosshairOwned(owned); mHud->setCrosshairOwned(owned);

View file

@ -487,6 +487,8 @@ namespace MWGui
std::map<std::string, std::string> mFallbackMap; std::map<std::string, std::string> mFallbackMap;
bool mShowOwned;
/** /**
* Called when MyGUI tries to retrieve a tag's value. Tags must be denoted in #{tag} notation and will be replaced upon setting a user visible text/property. * Called when MyGUI tries to retrieve a tag's value. Tags must be denoted in #{tag} notation and will be replaced upon setting a user visible text/property.
* Supported syntax: * Supported syntax: