1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-02-23 18:39:41 +00:00

hide the cursor during drag&drop and don't allow hotkeys that change guimode

This commit is contained in:
scrawl 2012-05-13 10:18:17 +02:00
parent f31853d30b
commit d266b4fe87
5 changed files with 38 additions and 3 deletions

View file

@ -60,12 +60,14 @@ void ContainerBase::onSelectedItem(MyGUI::Widget* _sender)
std::string sound = MWWorld::Class::get(object).getUpSoundId(object);
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
_sender->setUserString("drag","on");
mDragAndDrop->mDraggedWidget = _sender;
mDragAndDrop->mContainerWindow = const_cast<MWGui::ContainerBase*>(this);
// hide the count text
_sender->getChildAt(0)->getChildAt(0)->setVisible(false);
drawItems();
MWBase::Environment::get().getInputManager()->setDragDrop(true);
MWBase::Environment::get().getWindowManager()->setMouseVisible(false);
}
else
onContainerClicked(mContainerWidget);
@ -90,6 +92,9 @@ void ContainerBase::onContainerClicked(MyGUI::Widget* _sender)
mDragAndDrop->mDraggedWidget = 0;
mDragAndDrop->mContainerWindow = 0;
drawItems();
MWBase::Environment::get().getInputManager()->setDragDrop(false);
MWBase::Environment::get().getWindowManager()->setMouseVisible(true);
}
}
@ -146,7 +151,9 @@ void ContainerBase::drawItems()
else if (mFilter == Filter_Misc)
{
categories = MWWorld::ContainerStore::Type_Miscellaneous + MWWorld::ContainerStore::Type_Book
+ MWWorld::ContainerStore::Type_Ingredient;
+ MWWorld::ContainerStore::Type_Ingredient + MWWorld::ContainerStore::Type_Repair
+ MWWorld::ContainerStore::Type_Lockpick + MWWorld::ContainerStore::Type_Light
+ MWWorld::ContainerStore::Type_Apparatus;
}
for (MWWorld::ContainerStoreIterator iter (containerStore.begin(categories)); iter!=containerStore.end(); ++iter)

View file

@ -558,3 +558,8 @@ void WindowManager::setSpellVisibility(bool visible)
{
hud->spellBox->setVisible(visible);
}
void WindowManager::setMouseVisible(bool visible)
{
MyGUI::PointerManager::getInstance().setVisible(visible);
}

View file

@ -166,6 +166,8 @@ namespace MWGui
void setFocusObject(const MWWorld::Ptr& focus);
void setMouseVisible(bool visible);
void toggleFogOfWar();
void toggleFullHelp(); ///< show extra info in item tooltips (owner, script)
bool getFullHelp() const;

View file

@ -88,6 +88,8 @@ namespace MWInput
MWGui::WindowManager &windows;
OMW::Engine& mEngine;
bool mDragDrop;
/* InputImpl Methods */
@ -143,6 +145,9 @@ namespace MWInput
{
using namespace MWGui;
if (mDragDrop)
return;
GuiMode mode = windows.getMode();
// Toggle between game mode and inventory mode
@ -159,6 +164,9 @@ namespace MWInput
{
using namespace MWGui;
if (mDragDrop)
return;
GuiMode mode = windows.getMode();
// Switch to console mode no matter what mode we are currently
@ -219,7 +227,8 @@ namespace MWInput
poller(input),
player(_player),
windows(_windows),
mEngine (engine)
mEngine (engine),
mDragDrop(false)
{
using namespace OEngine::Input;
using namespace OEngine::Render;
@ -319,6 +328,11 @@ namespace MWInput
poller.bind(A_Crouch, KC_LCONTROL);
}
void setDragDrop(bool dragDrop)
{
mDragDrop = dragDrop;
}
//NOTE: Used to check for movement keys
void update ()
{
@ -426,4 +440,9 @@ namespace MWInput
{
impl->update();
}
void MWInputManager::setDragDrop(bool dragDrop)
{
impl->setDragDrop(dragDrop);
}
}

View file

@ -50,6 +50,8 @@ namespace MWInput
void update();
void setDragDrop(bool dragDrop);
void setGuiMode(MWGui::GuiMode mode);
};
}