Merge remote-tracking branch 'swick/inventorypos'

Conflicts:
	apps/openmw/mwgui/inventorywindow.cpp
pull/51/head
Marc Zinnschlag 12 years ago
commit ca94d1a2fb

@ -37,6 +37,11 @@ namespace MWGui
, mPreviewDirty(true)
, mDragAndDrop(dragAndDrop)
, mSelectedItem(-1)
, mPositionInventory(0, 342, 498, 258)
, mPositionContainer(0, 342, 498, 258)
, mPositionCompanion(0, 342, 498, 258)
, mPositionBarter(0, 342, 498, 258)
, mGuiMode(GM_Inventory)
{
static_cast<MyGUI::Window*>(mMainWidget)->eventWindowChangeCoord += MyGUI::newDelegate(this, &InventoryWindow::onWindowResize);
@ -68,7 +73,7 @@ namespace MWGui
mFilterAll->setStateSelected(true);
setCoord(0, 342, 498, 258);
setCoord(mPositionInventory.left, mPositionInventory.top, mPositionInventory.width, mPositionInventory.height);
onWindowResize(static_cast<MyGUI::Window*>(mMainWidget));
mPreview.setup();
@ -84,6 +89,27 @@ namespace MWGui
mPreview.setup();
}
void InventoryWindow::setGuiMode(GuiMode mode)
{
mGuiMode = mode;
switch(mode) {
case GM_Container:
mMainWidget->setCoord(mPositionContainer);
break;
case GM_Companion:
mMainWidget->setCoord(mPositionCompanion);
break;
case GM_Barter:
mMainWidget->setCoord(mPositionBarter);
break;
case GM_Inventory:
default:
mMainWidget->setCoord(mPositionInventory);
break;
}
onWindowResize(static_cast<MyGUI::Window*>(mMainWidget));
}
TradeItemModel* InventoryWindow::getTradeModel()
{
return mTradeModel;
@ -211,6 +237,21 @@ namespace MWGui
_sender->getSize().width - 12 - (_sender->getSize().height-44) * aspect - 15,
_sender->getSize().height-44 );
switch(mGuiMode) {
case GM_Container:
mPositionContainer = _sender->getCoord();
break;
case GM_Companion:
mPositionCompanion = _sender->getCoord();
break;
case GM_Barter:
mPositionBarter = _sender->getCoord();
break;
case GM_Inventory:
default:
mPositionInventory = _sender->getCoord();
}
if (mMainWidget->getSize().width != mLastXSize || mMainWidget->getSize().height != mLastYSize)
{
mLastXSize = mMainWidget->getSize().width;

@ -5,6 +5,7 @@
#include "windowpinnablebase.hpp"
#include "widgets.hpp"
#include "mode.hpp"
namespace MWGui
{
@ -47,6 +48,8 @@ namespace MWGui
void updatePlayer();
void setGuiMode(GuiMode mode);
private:
DragAndDrop* mDragAndDrop;
@ -73,6 +76,13 @@ namespace MWGui
MyGUI::Button* mFilterMagic;
MyGUI::Button* mFilterMisc;
MyGUI::IntCoord mPositionInventory;
MyGUI::IntCoord mPositionContainer;
MyGUI::IntCoord mPositionCompanion;
MyGUI::IntCoord mPositionBarter;
GuiMode mGuiMode;
int mLastXSize;
int mLastYSize;

@ -441,16 +441,19 @@ namespace MWGui
mMap ->setVisible(eff & GW_Map);
mStatsWindow ->setVisible(eff & GW_Stats);
mInventoryWindow->setVisible(eff & GW_Inventory);
mInventoryWindow->setGuiMode(mode);
mSpellWindow ->setVisible(eff & GW_Magic);
break;
}
case GM_Container:
mContainerWindow->setVisible(true);
mInventoryWindow->setVisible(true);
mInventoryWindow->setGuiMode(mode);
break;
case GM_Companion:
mCompanionWindow->setVisible(true);
mInventoryWindow->setVisible(true);
mInventoryWindow->setGuiMode(mode);
break;
case GM_Dialogue:
mDialogueWindow->setVisible(true);
@ -458,6 +461,7 @@ namespace MWGui
case GM_Barter:
mInventoryWindow->setVisible(true);
mInventoryWindow->setTrading(true);
mInventoryWindow->setGuiMode(mode);
mTradeWindow->setVisible(true);
break;
case GM_SpellBuying:

Loading…
Cancel
Save