|
|
@ -67,7 +67,12 @@ namespace MWGui
|
|
|
|
, mLastYSize(0)
|
|
|
|
, mLastYSize(0)
|
|
|
|
, mPreview(new MWRender::InventoryPreview(parent, resourceSystem, MWMechanics::getPlayer()))
|
|
|
|
, mPreview(new MWRender::InventoryPreview(parent, resourceSystem, MWMechanics::getPlayer()))
|
|
|
|
, mTrading(false)
|
|
|
|
, mTrading(false)
|
|
|
|
|
|
|
|
, mScaleFactor(1.0f)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
float uiScale = Settings::Manager::getFloat("scaling factor", "GUI");
|
|
|
|
|
|
|
|
if (uiScale > 1.0)
|
|
|
|
|
|
|
|
mScaleFactor = uiScale;
|
|
|
|
|
|
|
|
|
|
|
|
mPreviewTexture.reset(new osgMyGUI::OSGTexture(mPreview->getTexture()));
|
|
|
|
mPreviewTexture.reset(new osgMyGUI::OSGTexture(mPreview->getTexture()));
|
|
|
|
mPreview->rebuild();
|
|
|
|
mPreview->rebuild();
|
|
|
|
|
|
|
|
|
|
|
@ -431,10 +436,10 @@ namespace MWGui
|
|
|
|
MyGUI::IntSize size = mAvatarImage->getSize();
|
|
|
|
MyGUI::IntSize size = mAvatarImage->getSize();
|
|
|
|
int width = std::min(mPreview->getTextureWidth(), size.width);
|
|
|
|
int width = std::min(mPreview->getTextureWidth(), size.width);
|
|
|
|
int height = std::min(mPreview->getTextureHeight(), size.height);
|
|
|
|
int height = std::min(mPreview->getTextureHeight(), size.height);
|
|
|
|
mPreview->setViewport(width, height);
|
|
|
|
mPreview->setViewport(int(width*mScaleFactor), int(height*mScaleFactor));
|
|
|
|
|
|
|
|
|
|
|
|
mAvatarImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f,
|
|
|
|
mAvatarImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f,
|
|
|
|
width/float(mPreview->getTextureWidth()), height/float(mPreview->getTextureHeight())));
|
|
|
|
width*mScaleFactor/float(mPreview->getTextureWidth()), height*mScaleFactor/float(mPreview->getTextureHeight())));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void InventoryWindow::onFilterChanged(MyGUI::Widget* _sender)
|
|
|
|
void InventoryWindow::onFilterChanged(MyGUI::Widget* _sender)
|
|
|
@ -591,6 +596,11 @@ namespace MWGui
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// convert to OpenGL lower-left origin
|
|
|
|
// convert to OpenGL lower-left origin
|
|
|
|
y = (mAvatarImage->getHeight()-1) - y;
|
|
|
|
y = (mAvatarImage->getHeight()-1) - y;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Scale coordinates
|
|
|
|
|
|
|
|
x = int(x*mScaleFactor);
|
|
|
|
|
|
|
|
y = int(y*mScaleFactor);
|
|
|
|
|
|
|
|
|
|
|
|
int slot = mPreview->getSlotSelected (x, y);
|
|
|
|
int slot = mPreview->getSlotSelected (x, y);
|
|
|
|
|
|
|
|
|
|
|
|
if (slot == -1)
|
|
|
|
if (slot == -1)
|
|
|
|