mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-19 22:53:50 +00:00
Merge remote-tracking branch 'kunesj/master'
This commit is contained in:
commit
964cd44e96
9 changed files with 60 additions and 4 deletions
|
@ -23,6 +23,7 @@ namespace MWWorld
|
||||||
{
|
{
|
||||||
class Ptr;
|
class Ptr;
|
||||||
class CellStore;
|
class CellStore;
|
||||||
|
class CellRef;
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace Loading
|
namespace Loading
|
||||||
|
@ -211,6 +212,8 @@ namespace MWBase
|
||||||
|
|
||||||
/// Has the player stolen this item from the given owner?
|
/// Has the player stolen this item from the given owner?
|
||||||
virtual bool isItemStolenFrom(const std::string& itemid, const std::string& ownerid) = 0;
|
virtual bool isItemStolenFrom(const std::string& itemid, const std::string& ownerid) = 0;
|
||||||
|
|
||||||
|
virtual bool isAllowedToUse (const MWWorld::Ptr& ptr, const MWWorld::CellRef& cellref, MWWorld::Ptr& victim) = 0;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -519,6 +519,20 @@ namespace MWGui
|
||||||
mCrosshair->setVisible (visible);
|
mCrosshair->setVisible (visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HUD::setCrosshairOwned(bool owned)
|
||||||
|
{
|
||||||
|
MyGUI::Colour red = MyGUI::Colour(1.0, 0, 0);
|
||||||
|
MyGUI::Colour white = MyGUI::Colour(1.0, 1.0, 1.0);
|
||||||
|
if(owned)
|
||||||
|
{
|
||||||
|
mCrosshair->setColour(red);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
mCrosshair->setColour(white);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void HUD::setHmsVisible(bool visible)
|
void HUD::setHmsVisible(bool visible)
|
||||||
{
|
{
|
||||||
mHealth->setVisible(visible);
|
mHealth->setVisible(visible);
|
||||||
|
|
|
@ -47,6 +47,7 @@ namespace MWGui
|
||||||
void unsetSelectedWeapon();
|
void unsetSelectedWeapon();
|
||||||
|
|
||||||
void setCrosshairVisible(bool visible);
|
void setCrosshairVisible(bool visible);
|
||||||
|
void setCrosshairOwned(bool owned);
|
||||||
|
|
||||||
void onFrame(float dt);
|
void onFrame(float dt);
|
||||||
|
|
||||||
|
|
|
@ -347,6 +347,25 @@ namespace MWGui
|
||||||
return tooltipSize;
|
return tooltipSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ToolTips::checkOwned()
|
||||||
|
{
|
||||||
|
if(!mFocusObject.isEmpty())
|
||||||
|
{
|
||||||
|
const MWWorld::CellRef& cellref = mFocusObject.getCellRef();
|
||||||
|
MWWorld::Ptr ptr = MWBase::Environment::get().getWorld()->getPlayerPtr();
|
||||||
|
MWWorld::Ptr victim;
|
||||||
|
|
||||||
|
MWBase::MechanicsManager* mm = MWBase::Environment::get().getMechanicsManager();
|
||||||
|
bool allowed = mm->isAllowedToUse(ptr, cellref, victim);
|
||||||
|
|
||||||
|
return !allowed;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
MyGUI::IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
MyGUI::IntSize ToolTips::createToolTip(const MWGui::ToolTipInfo& info)
|
||||||
{
|
{
|
||||||
mDynamicToolTipBox->setVisible(true);
|
mDynamicToolTipBox->setVisible(true);
|
||||||
|
|
|
@ -88,6 +88,9 @@ namespace MWGui
|
||||||
static void createClassToolTip(MyGUI::Widget* widget, const ESM::Class& playerClass);
|
static void createClassToolTip(MyGUI::Widget* widget, const ESM::Class& playerClass);
|
||||||
static void createMagicEffectToolTip(MyGUI::Widget* widget, short id);
|
static void createMagicEffectToolTip(MyGUI::Widget* widget, short id);
|
||||||
|
|
||||||
|
bool checkOwned();
|
||||||
|
/// Returns True if taking mFocusObject would be crime
|
||||||
|
|
||||||
private:
|
private:
|
||||||
MyGUI::Widget* mDynamicToolTipBox;
|
MyGUI::Widget* mDynamicToolTipBox;
|
||||||
|
|
||||||
|
|
|
@ -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()
|
||||||
|
@ -1038,6 +1041,12 @@ namespace MWGui
|
||||||
void WindowManager::setFocusObject(const MWWorld::Ptr& focus)
|
void WindowManager::setFocusObject(const MWWorld::Ptr& focus)
|
||||||
{
|
{
|
||||||
mToolTips->setFocusObject(focus);
|
mToolTips->setFocusObject(focus);
|
||||||
|
|
||||||
|
if(mShowOwned && mHud)
|
||||||
|
{
|
||||||
|
bool owned = mToolTips->checkOwned();
|
||||||
|
mHud->setCrosshairOwned(owned);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WindowManager::setFocusObjectScreenCoords(float min_x, float min_y, float max_x, float max_y)
|
void WindowManager::setFocusObjectScreenCoords(float min_x, float min_y, float max_x, float max_y)
|
||||||
|
|
|
@ -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:
|
||||||
|
|
|
@ -176,12 +176,14 @@ namespace MWMechanics
|
||||||
/// Has the player stolen this item from the given owner?
|
/// Has the player stolen this item from the given owner?
|
||||||
virtual bool isItemStolenFrom(const std::string& itemid, const std::string& ownerid);
|
virtual bool isItemStolenFrom(const std::string& itemid, const std::string& ownerid);
|
||||||
|
|
||||||
|
/// @return is \a ptr allowed to take/use \a cellref or is it a crime?
|
||||||
|
virtual bool isAllowedToUse (const MWWorld::Ptr& ptr, const MWWorld::CellRef& cellref, MWWorld::Ptr& victim);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void reportCrime (const MWWorld::Ptr& ptr, const MWWorld::Ptr& victim,
|
void reportCrime (const MWWorld::Ptr& ptr, const MWWorld::Ptr& victim,
|
||||||
OffenseType type, int arg=0);
|
OffenseType type, int arg=0);
|
||||||
|
|
||||||
/// @return is \a ptr allowed to take/use \a cellref or is it a crime?
|
|
||||||
virtual bool isAllowedToUse (const MWWorld::Ptr& ptr, const MWWorld::CellRef& cellref, MWWorld::Ptr& victim);
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -162,6 +162,9 @@ best attack = false
|
||||||
|
|
||||||
difficulty = 0
|
difficulty = 0
|
||||||
|
|
||||||
|
# change crosshair color when pointing on owned object
|
||||||
|
show owned = false
|
||||||
|
|
||||||
[Saves]
|
[Saves]
|
||||||
character =
|
character =
|
||||||
# Save when resting
|
# Save when resting
|
||||||
|
|
Loading…
Reference in a new issue