mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-06 18:45:32 +00:00
removed setCrosshairOwned from windowmanager
This commit is contained in:
parent
c019f8e23d
commit
e68b388d16
5 changed files with 22 additions and 30 deletions
|
@ -219,7 +219,6 @@ namespace MWBase
|
|||
virtual void unsetSelectedWeapon() = 0;
|
||||
|
||||
virtual void showCrosshair(bool show) = 0;
|
||||
virtual void setCrosshairOwned(bool owned) = 0;
|
||||
virtual bool getSubtitlesEnabled() = 0;
|
||||
virtual bool toggleGui() = 0;
|
||||
|
||||
|
|
|
@ -300,8 +300,6 @@ namespace MWGui
|
|||
mDynamicToolTipBox->setVisible(true);
|
||||
|
||||
}
|
||||
|
||||
checkOwned();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -351,12 +349,9 @@ namespace MWGui
|
|||
return tooltipSize;
|
||||
}
|
||||
|
||||
void ToolTips::checkOwned()
|
||||
bool ToolTips::checkOwned()
|
||||
{
|
||||
if(Settings::Manager::getBool("show owned", "Game"))
|
||||
{
|
||||
MWBase::WindowManager *wm = MWBase::Environment::get().getWindowManager();
|
||||
|
||||
// true=owned, false=notOwned
|
||||
if(!mFocusObject.isEmpty())
|
||||
{
|
||||
MWWorld::CellRef& cellref = mFocusObject.getCellRef();
|
||||
|
@ -364,14 +359,13 @@ namespace MWGui
|
|||
MWWorld::Ptr victim;
|
||||
|
||||
MWBase::MechanicsManager* mm = MWBase::Environment::get().getMechanicsManager();
|
||||
bool allowed = mm->isAllowedToUse(ptr, cellref, victim); // 0 - owned, 1 - not owned
|
||||
bool allowed = mm->isAllowedToUse(ptr, cellref, victim);
|
||||
|
||||
wm->setCrosshairOwned(!allowed);
|
||||
return !allowed;
|
||||
}
|
||||
else
|
||||
{
|
||||
wm->setCrosshairOwned(false);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -88,6 +88,9 @@ namespace MWGui
|
|||
static void createClassToolTip(MyGUI::Widget* widget, const ESM::Class& playerClass);
|
||||
static void createMagicEffectToolTip(MyGUI::Widget* widget, short id);
|
||||
|
||||
bool checkOwned();
|
||||
/// Checks if object is owned and sets correct crosshair mode
|
||||
|
||||
private:
|
||||
MyGUI::Widget* mDynamicToolTipBox;
|
||||
|
||||
|
@ -96,9 +99,6 @@ namespace MWGui
|
|||
MyGUI::IntSize getToolTipViaPtr (bool image=true);
|
||||
///< @return requested tooltip size
|
||||
|
||||
void checkOwned();
|
||||
/// Checks if object is owned and sets correct crosshair mode
|
||||
|
||||
MyGUI::IntSize createToolTip(const ToolTipInfo& info);
|
||||
///< @return requested tooltip size
|
||||
|
||||
|
|
|
@ -1038,6 +1038,12 @@ namespace MWGui
|
|||
void WindowManager::setFocusObject(const MWWorld::Ptr& focus)
|
||||
{
|
||||
mToolTips->setFocusObject(focus);
|
||||
|
||||
if(Settings::Manager::getBool("show owned", "Game") && mHud)
|
||||
{
|
||||
bool owned = mToolTips->checkOwned();
|
||||
mHud->setCrosshairOwned(owned);
|
||||
}
|
||||
}
|
||||
|
||||
void WindowManager::setFocusObjectScreenCoords(float min_x, float min_y, float max_x, float max_y)
|
||||
|
@ -1424,12 +1430,6 @@ namespace MWGui
|
|||
mHud->setCrosshairVisible (show && mCrosshairEnabled);
|
||||
}
|
||||
|
||||
void WindowManager::setCrosshairOwned (bool owned)
|
||||
{
|
||||
if (mHud)
|
||||
mHud->setCrosshairOwned (owned);
|
||||
}
|
||||
|
||||
void WindowManager::activateQuickKey (int index)
|
||||
{
|
||||
mQuickKeysMenu->activateQuickKey(index);
|
||||
|
|
|
@ -233,7 +233,6 @@ namespace MWGui
|
|||
virtual void unsetSelectedWeapon();
|
||||
|
||||
virtual void showCrosshair(bool show);
|
||||
virtual void setCrosshairOwned(bool owned);
|
||||
virtual bool getSubtitlesEnabled();
|
||||
|
||||
/// Turn visibility of *all* GUI elements on or off (HUD and all windows, except the console)
|
||||
|
|
Loading…
Reference in a new issue