mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-28 19:21:04 +00:00
This commit is contained in:
parent
e582d5ecaa
commit
b1fa0e9560
@ -29,6 +29,7 @@ Programmers
|
|||||||
Alex S (docwest)
|
Alex S (docwest)
|
||||||
Alexey Yaryshev (skeevert)
|
Alexey Yaryshev (skeevert)
|
||||||
Allofich
|
Allofich
|
||||||
|
Andreas Stöckel
|
||||||
Andrei Kortunov (akortunov)
|
Andrei Kortunov (akortunov)
|
||||||
AnyOldName3
|
AnyOldName3
|
||||||
Ardekantur
|
Ardekantur
|
||||||
|
@ -9,6 +9,8 @@
|
|||||||
Bug #6066: addtopic "return" does not work from within script. No errors thrown
|
Bug #6066: addtopic "return" does not work from within script. No errors thrown
|
||||||
Bug #6101: Disarming trapped unlocked owned objects isn't considered a crime
|
Bug #6101: Disarming trapped unlocked owned objects isn't considered a crime
|
||||||
Bug #6115: Showmap overzealous matching
|
Bug #6115: Showmap overzealous matching
|
||||||
|
Bug #6129: Player avatar not displayed correctly for large window sizes when GUI scaling active
|
||||||
|
Bug #6131: Item selection in the avatar window not working correctly for large window sizes
|
||||||
Bug #6133: Cannot reliably sneak or steal in the sight of the NPCs siding with player
|
Bug #6133: Cannot reliably sneak or steal in the sight of the NPCs siding with player
|
||||||
|
|
||||||
0.47.0
|
0.47.0
|
||||||
|
@ -171,7 +171,7 @@ namespace MWBase
|
|||||||
virtual void setDragDrop(bool dragDrop) = 0;
|
virtual void setDragDrop(bool dragDrop) = 0;
|
||||||
virtual bool getWorldMouseOver() = 0;
|
virtual bool getWorldMouseOver() = 0;
|
||||||
|
|
||||||
virtual float getScalingFactor() = 0;
|
virtual float getScalingFactor() const = 0;
|
||||||
|
|
||||||
virtual bool toggleFogOfWar() = 0;
|
virtual bool toggleFogOfWar() = 0;
|
||||||
|
|
||||||
|
@ -461,14 +461,10 @@ namespace MWGui
|
|||||||
|
|
||||||
void InventoryWindow::updatePreviewSize()
|
void InventoryWindow::updatePreviewSize()
|
||||||
{
|
{
|
||||||
MyGUI::IntSize size = mAvatarImage->getSize();
|
const MyGUI::IntSize viewport = getPreviewViewportSize();
|
||||||
int width = std::min(mPreview->getTextureWidth(), size.width);
|
mPreview->setViewport(viewport.width, viewport.height);
|
||||||
int height = std::min(mPreview->getTextureHeight(), size.height);
|
|
||||||
float scalingFactor = MWBase::Environment::get().getWindowManager()->getScalingFactor();
|
|
||||||
mPreview->setViewport(int(width*scalingFactor), int(height*scalingFactor));
|
|
||||||
|
|
||||||
mAvatarImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f,
|
mAvatarImage->getSubWidgetMain()->_setUVSet(MyGUI::FloatRect(0.f, 0.f,
|
||||||
width*scalingFactor/float(mPreview->getTextureWidth()), height*scalingFactor/float(mPreview->getTextureHeight())));
|
viewport.width / float(mPreview->getTextureWidth()), viewport.height / float(mPreview->getTextureHeight())));
|
||||||
}
|
}
|
||||||
|
|
||||||
void InventoryWindow::onNameFilterChanged(MyGUI::EditBox* _sender)
|
void InventoryWindow::onNameFilterChanged(MyGUI::EditBox* _sender)
|
||||||
@ -629,15 +625,8 @@ namespace MWGui
|
|||||||
|
|
||||||
MWWorld::Ptr InventoryWindow::getAvatarSelectedItem(int x, int y)
|
MWWorld::Ptr InventoryWindow::getAvatarSelectedItem(int x, int y)
|
||||||
{
|
{
|
||||||
// convert to OpenGL lower-left origin
|
const osg::Vec2f viewport_coords = mapPreviewWindowToViewport(x, y);
|
||||||
y = (mAvatarImage->getHeight()-1) - y;
|
int slot = mPreview->getSlotSelected(viewport_coords.x(), viewport_coords.y());
|
||||||
|
|
||||||
// Scale coordinates
|
|
||||||
float scalingFactor = MWBase::Environment::get().getWindowManager()->getScalingFactor();
|
|
||||||
x = static_cast<int>(x*scalingFactor);
|
|
||||||
y = static_cast<int>(y*scalingFactor);
|
|
||||||
|
|
||||||
int slot = mPreview->getSlotSelected (x, y);
|
|
||||||
|
|
||||||
if (slot == -1)
|
if (slot == -1)
|
||||||
return MWWorld::Ptr();
|
return MWWorld::Ptr();
|
||||||
@ -832,4 +821,26 @@ namespace MWGui
|
|||||||
{
|
{
|
||||||
mPreview->rebuild();
|
mPreview->rebuild();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MyGUI::IntSize InventoryWindow::getPreviewViewportSize() const
|
||||||
|
{
|
||||||
|
const MyGUI::IntSize previewWindowSize = mAvatarImage->getSize();
|
||||||
|
const float scale = MWBase::Environment::get().getWindowManager()->getScalingFactor();
|
||||||
|
|
||||||
|
return MyGUI::IntSize(std::min<int>(mPreview->getTextureWidth(), previewWindowSize.width * scale),
|
||||||
|
std::min<int>(mPreview->getTextureHeight(), previewWindowSize.height * scale));
|
||||||
|
}
|
||||||
|
|
||||||
|
osg::Vec2f InventoryWindow::mapPreviewWindowToViewport(int x, int y) const
|
||||||
|
{
|
||||||
|
const MyGUI::IntSize previewWindowSize = mAvatarImage->getSize();
|
||||||
|
const float normalisedX = x / std::max<float>(1.0f, previewWindowSize.width);
|
||||||
|
const float normalisedY = y / std::max<float>(1.0f, previewWindowSize.height);
|
||||||
|
|
||||||
|
const MyGUI::IntSize viewport = getPreviewViewportSize();
|
||||||
|
return osg::Vec2f(
|
||||||
|
normalisedX * float(viewport.width - 1),
|
||||||
|
(1.0 - normalisedY) * float(viewport.height - 1)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -130,6 +130,9 @@ namespace MWGui
|
|||||||
void updatePreviewSize();
|
void updatePreviewSize();
|
||||||
void updateArmorRating();
|
void updateArmorRating();
|
||||||
|
|
||||||
|
MyGUI::IntSize getPreviewViewportSize() const;
|
||||||
|
osg::Vec2f mapPreviewWindowToViewport(int x, int y) const;
|
||||||
|
|
||||||
void adjustPanes();
|
void adjustPanes();
|
||||||
|
|
||||||
/// Unequips count items from mSelectedItem, if it is equipped, and then updates mSelectedItem in case the items were re-stacked
|
/// Unequips count items from mSelectedItem, if it is equipped, and then updates mSelectedItem in case the items were re-stacked
|
||||||
|
@ -1326,7 +1326,7 @@ namespace MWGui
|
|||||||
return mHud->getWorldMouseOver();
|
return mHud->getWorldMouseOver();
|
||||||
}
|
}
|
||||||
|
|
||||||
float WindowManager::getScalingFactor()
|
float WindowManager::getScalingFactor() const
|
||||||
{
|
{
|
||||||
return mScalingFactor;
|
return mScalingFactor;
|
||||||
}
|
}
|
||||||
|
@ -208,7 +208,7 @@ namespace MWGui
|
|||||||
void setDragDrop(bool dragDrop) override;
|
void setDragDrop(bool dragDrop) override;
|
||||||
bool getWorldMouseOver() override;
|
bool getWorldMouseOver() override;
|
||||||
|
|
||||||
float getScalingFactor() override;
|
float getScalingFactor() const override;
|
||||||
|
|
||||||
bool toggleFogOfWar() override;
|
bool toggleFogOfWar() override;
|
||||||
bool toggleFullHelp() override; ///< show extra info in item tooltips (owner, script)
|
bool toggleFullHelp() override; ///< show extra info in item tooltips (owner, script)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user