diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index 0236e17c2..1b165f995 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -66,8 +66,7 @@ void ContainerBase::onSelectedItem(MyGUI::Widget* _sender) _sender->getChildAt(0)->getChildAt(0)->setVisible(false); drawItems(); - MWBase::Environment::get().getInputManager()->setDragDrop(true); - MWBase::Environment::get().getWindowManager()->setMouseVisible(false); + MWBase::Environment::get().getWindowManager()->setDragDrop(true); } else onContainerClicked(mContainerWidget); @@ -93,8 +92,7 @@ void ContainerBase::onContainerClicked(MyGUI::Widget* _sender) mDragAndDrop->mContainerWindow = 0; drawItems(); - MWBase::Environment::get().getInputManager()->setDragDrop(false); - MWBase::Environment::get().getWindowManager()->setMouseVisible(true); + MWBase::Environment::get().getWindowManager()->setDragDrop(false); } } @@ -128,7 +126,7 @@ void ContainerBase::drawItems() int x = 0; int y = 0; - int maxHeight = mItemView->getSize().height - 48; + int maxHeight = mItemView->getSize().height - 58; int index = 0; @@ -195,7 +193,12 @@ void ContainerBase::drawItems() } if(iter->getRefData().getCount() > 1) - text->setCaption(boost::lexical_cast(iter->getRefData().getCount())); + { + if (iter->getRefData().getCount() > 9999) + text->setCaption(boost::lexical_cast(iter->getRefData().getCount()/1000.f) + "k"); + else + text->setCaption(boost::lexical_cast(iter->getRefData().getCount())); + } } } @@ -209,7 +212,7 @@ void ContainerBase::Update() if(mDragAndDrop->mIsOnDragAndDrop) { if(mDragAndDrop->mDraggedWidget) - mDragAndDrop->mDraggedWidget->setPosition(MyGUI::InputManager::getInstance().getMousePosition()); + mDragAndDrop->mDraggedWidget->setPosition(MyGUI::InputManager::getInstance().getMousePosition() - MyGUI::IntPoint(21, 21)); else mDragAndDrop->mIsOnDragAndDrop = false; //If this happens, there is a bug. } } diff --git a/apps/openmw/mwgui/inventorywindow.cpp b/apps/openmw/mwgui/inventorywindow.cpp index 560e940d8..4bd4fe88c 100644 --- a/apps/openmw/mwgui/inventorywindow.cpp +++ b/apps/openmw/mwgui/inventorywindow.cpp @@ -35,6 +35,8 @@ namespace MWGui getWidget(mFilterApparel, "ApparelButton"); getWidget(mFilterMagic, "MagicButton"); getWidget(mFilterMisc, "MiscButton"); + getWidget(mLeftPane, "LeftPane"); + getWidget(mRightPane, "RightPane"); MyGUI::ScrollView* itemView; MyGUI::Widget* containerWidget; @@ -86,6 +88,12 @@ namespace MWGui void InventoryWindow::onWindowResize(MyGUI::Window* _sender) { + const float aspect = 0.5; // fixed aspect ratio for the left pane + mLeftPane->setSize( (_sender->getSize().height-44) * aspect, _sender->getSize().height-44 ); + mRightPane->setCoord( mLeftPane->getPosition().left + (_sender->getSize().height-44) * aspect + 4, + mRightPane->getPosition().top, + _sender->getSize().width - 12 - (_sender->getSize().height-44) * aspect - 15, + _sender->getSize().height-44 ); drawItems(); } diff --git a/apps/openmw/mwgui/inventorywindow.hpp b/apps/openmw/mwgui/inventorywindow.hpp index dd4ff90b6..f16dcf433 100644 --- a/apps/openmw/mwgui/inventorywindow.hpp +++ b/apps/openmw/mwgui/inventorywindow.hpp @@ -36,6 +36,9 @@ namespace MWGui MyGUI::ProgressBar* mEncumbranceBar; MyGUI::TextBox* mEncumbranceText; + MyGUI::Widget* mLeftPane; + MyGUI::Widget* mRightPane; + MyGUI::Button* mFilterAll; MyGUI::Button* mFilterWeapon; MyGUI::Button* mFilterApparel; diff --git a/apps/openmw/mwgui/tooltips.cpp b/apps/openmw/mwgui/tooltips.cpp index 7fc29f8c3..635e9481b 100644 --- a/apps/openmw/mwgui/tooltips.cpp +++ b/apps/openmw/mwgui/tooltips.cpp @@ -16,6 +16,7 @@ ToolTips::ToolTips(WindowManager* windowManager) : , mGameMode(true) , mWindowManager(windowManager) , mFullHelp(false) + , mEnabled(true) { getWidget(mDynamicToolTipBox, "DynamicToolTipBox"); @@ -27,6 +28,11 @@ ToolTips::ToolTips(WindowManager* windowManager) : mMainWidget->setNeedMouseFocus(false); } +void ToolTips::setEnabled(bool enabled) +{ + mEnabled = enabled; +} + void ToolTips::onFrame(float frameDuration) { MyGUI::Gui::getInstance().destroyWidget(mDynamicToolTipBox); @@ -36,6 +42,12 @@ void ToolTips::onFrame(float frameDuration) const IntSize &viewSize = RenderManager::getInstance().getViewSize(); + if (!mEnabled) + { + mDynamicToolTipBox->setVisible(false); + return; + } + if (!mGameMode) { Widget* focus = InputManager::getInstance().getMouseFocusWidget(); diff --git a/apps/openmw/mwgui/tooltips.hpp b/apps/openmw/mwgui/tooltips.hpp index 8d0970965..87b9e97bf 100644 --- a/apps/openmw/mwgui/tooltips.hpp +++ b/apps/openmw/mwgui/tooltips.hpp @@ -39,6 +39,8 @@ namespace MWGui void enterGameMode(); void enterGuiMode(); + void setEnabled(bool enabled); + void toggleFullHelp(); ///< show extra info in item tooltips (owner, script) bool getFullHelp() const; @@ -73,6 +75,8 @@ namespace MWGui bool mGameMode; + bool mEnabled; + bool mFullHelp; }; } diff --git a/apps/openmw/mwgui/window_manager.cpp b/apps/openmw/mwgui/window_manager.cpp index 067d67ca4..47fae2003 100644 --- a/apps/openmw/mwgui/window_manager.cpp +++ b/apps/openmw/mwgui/window_manager.cpp @@ -563,3 +563,10 @@ void WindowManager::setMouseVisible(bool visible) { MyGUI::PointerManager::getInstance().setVisible(visible); } + +void WindowManager::setDragDrop(bool dragDrop) +{ + mToolTips->setEnabled(!dragDrop); + MWBase::Environment::get().getInputManager()->setDragDrop(dragDrop); + setMouseVisible(!dragDrop); +} diff --git a/apps/openmw/mwgui/window_manager.hpp b/apps/openmw/mwgui/window_manager.hpp index b55b425a8..5dfcf6470 100644 --- a/apps/openmw/mwgui/window_manager.hpp +++ b/apps/openmw/mwgui/window_manager.hpp @@ -166,7 +166,8 @@ namespace MWGui void setFocusObject(const MWWorld::Ptr& focus); - void setMouseVisible(bool visible); + void setMouseVisible(bool visible); + void setDragDrop(bool dragDrop); void toggleFogOfWar(); void toggleFullHelp(); ///< show extra info in item tooltips (owner, script) diff --git a/files/mygui/openmw_inventory_window_layout.xml b/files/mygui/openmw_inventory_window_layout.xml index 0e8abf45b..cd6e1469e 100644 --- a/files/mygui/openmw_inventory_window_layout.xml +++ b/files/mygui/openmw_inventory_window_layout.xml @@ -3,37 +3,44 @@ - - - - - - + + + + + + + + + - - - - - + + + + + + - - - - - + + + + + + + + + + + + + + + + - - - - - - - -