use MyGUI::InputManager instead of MWInputManager to detect ctrl/shift

actorid
scrawl 13 years ago
parent 24a0fecd37
commit 7fbee0d488

@ -54,11 +54,11 @@ void ContainerBase::onSelectedItem(MyGUI::Widget* _sender)
MWWorld::Ptr object = (*_sender->getUserData<MWWorld::Ptr>());
int count = object.getRefData().getCount();
if (MWBase::Environment::get().getInputManager()->getShiftDown() || count == 1)
if (MyGUI::InputManager::getInstance().isShiftPressed() || count == 1)
{
onSelectedItemImpl(_sender, count);
}
else if (MWBase::Environment::get().getInputManager()->getCtrlDown())
else if (MyGUI::InputManager::getInstance().isControlPressed())
{
onSelectedItemImpl(_sender, 1);
}
@ -90,7 +90,6 @@ void ContainerBase::onSelectedItemImpl(MyGUI::Widget* _sender, int count)
MWBase::Environment::get().getSoundManager()->playSound (sound, 1.0, 1.0);
mDragAndDrop->mDraggedWidget = mSelectedItem;
mDragAndDrop->mContainerWindow = const_cast<MWGui::ContainerBase*>(this);
static_cast<MyGUI::TextBox*>(mSelectedItem->getChildAt(0)->getChildAt(0))->setCaption(
getCountString((*mDragAndDrop->mStore.begin()).getRefData().getCount()));
drawItems();
@ -115,7 +114,6 @@ void ContainerBase::onContainerClicked(MyGUI::Widget* _sender)
mDragAndDrop->mDraggedWidget->detachFromWidget();
mDragAndDrop->mDraggedWidget->attachToWidget(mContainerWidget);
mDragAndDrop->mDraggedWidget = 0;
mDragAndDrop->mContainerWindow = 0;
drawItems();
MWBase::Environment::get().getWindowManager()->setDragDrop(false);

@ -37,7 +37,6 @@ namespace MWGui
{
public:
bool mIsOnDragAndDrop;
ContainerBase* mContainerWindow;
MyGUI::Widget* mDraggedWidget;
MyGUI::Widget* mDragAndDropWidget;
MWWorld::ContainerStore mStore;

@ -279,7 +279,6 @@ void HUD::onWorldClicked(MyGUI::Widget* _sender)
mDragAndDrop->mIsOnDragAndDrop = false;
MyGUI::Gui::getInstance().destroyWidget(mDragAndDrop->mDraggedWidget);
mDragAndDrop->mDraggedWidget = 0;
mDragAndDrop->mContainerWindow = 0;
MWBase::Environment::get().getWindowManager()->setDragDrop(false);
}

@ -99,7 +99,6 @@ WindowManager::WindowManager(
mDragAndDrop->mIsOnDragAndDrop = false;
mDragAndDrop->mDraggedWidget = 0;
mDragAndDrop->mDragAndDropWidget = dragAndDropWidget;
mDragAndDrop->mContainerWindow = 0;
menu = new MainMenu(w,h);
map = new MapWindow(*this);

@ -69,8 +69,6 @@ namespace MWInput
A_ToggleWeapon,
A_ToggleSpell,
A_Shift,
A_ToggleFps, // Toggle FPS display (this is temporary)
A_LAST // Marker for the last item
@ -92,14 +90,6 @@ namespace MWInput
bool mDragDrop;
bool mShiftDown;
bool mCtrlDown;
public:
bool getShiftDown() { return mShiftDown; }
bool getCtrlDown() { return mCtrlDown; }
private:
/* InputImpl Methods */
@ -238,9 +228,7 @@ private:
player(_player),
windows(_windows),
mEngine (engine),
mDragDrop(false),
mShiftDown(false),
mCtrlDown(false)
mDragDrop(false)
{
using namespace OEngine::Input;
using namespace OEngine::Render;
@ -338,8 +326,6 @@ private:
poller.bind(A_Jump, KC_E);
poller.bind(A_Crouch, KC_LCONTROL);
poller.bind(A_Shift, KC_LSHIFT);
}
void setDragDrop(bool dragDrop)
@ -361,9 +347,6 @@ private:
// event callbacks (which may crash)
windows.update();
mShiftDown = poller.isDown(A_Shift);
mCtrlDown = poller.isDown(A_Crouch);
// Disable movement in Gui mode
if (windows.isGuiMode()) return;
@ -462,14 +445,4 @@ private:
{
impl->setDragDrop(dragDrop);
}
bool MWInputManager::getShiftDown()
{
return impl->getShiftDown();
}
bool MWInputManager::getCtrlDown()
{
return impl->getCtrlDown();
}
}

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

Loading…
Cancel
Save