diff --git a/apps/openmw/mwgui/container.cpp b/apps/openmw/mwgui/container.cpp index bc3bcf4752..2c09d6b293 100644 --- a/apps/openmw/mwgui/container.cpp +++ b/apps/openmw/mwgui/container.cpp @@ -28,7 +28,11 @@ ContainerWindow::ContainerWindow(WindowManager& parWindowManager,MWWorld::Enviro mEnvironment(environment) { setText("_Main", "Name of Container"); - center(); + + int w = MyGUI::RenderManager::getInstance().getViewSize().width; + int h = MyGUI::RenderManager::getInstance().getViewSize().height; + setCoord(w-600,h-300,600,300); + //center(); adjustWindowCaption(); getWidget(containerWidget, "Items"); @@ -109,7 +113,6 @@ void ContainerWindow::open(MWWorld::Ptr& container) containerStore.add(goldRef.getPtr());*/ - // ESMS::LiveCellRef *ref = iter->get(); @@ -120,39 +123,35 @@ void ContainerWindow::open(MWWorld::Ptr& container) for (MWWorld::ContainerStoreIterator iter (containerStore.begin()); iter!=containerStore.end(); ++iter) { std::string path = std::string("icons\\"); - - path+=MWWorld::Class::get(*iter).getInventoryIcon(*iter); count++; - if(count % 8 == 0) + MyGUI::ImageBox* image = containerWidget->createWidget("ImageBox", MyGUI::IntCoord(x, y, 32, 32), MyGUI::Align::Default); + MyGUI::TextBox* text = containerWidget->createWidget("SandBrightText", MyGUI::IntCoord(x, y, 18, 18), MyGUI::Align::Default, std::string("Label")); + + x += 36; + if(count % 20 == 0) { y += 36; x = 4; count = 0; } - x += 36; - - - MyGUI::ImageBox* image = containerWidget->createWidget("ImageBox", MyGUI::IntCoord(x, y, 32, 32), MyGUI::Align::Default); - MyGUI::TextBox* text = containerWidget->createWidget("SandBrightText", MyGUI::IntCoord(x, y, 18, 18), MyGUI::Align::Default, std::string("Label")); if(iter->getRefData().getCount() > 1) text->setCaption(boost::lexical_cast(iter->getRefData().getCount())); - containerWidgets.push_back(image); - int pos = path.rfind("."); path.erase(pos); path.append(".dds"); - //std::cout << path << std::endl; image->setImageTexture(path); } + + setVisible(true); } @@ -163,6 +162,8 @@ void ContainerWindow::Update() void ContainerWindow::onByeClicked(MyGUI::Widget* _sender) { - mEnvironment.mWindowManager->setGuiMode(MWGui::GuiMode::GM_Game); + mEnvironment.mWindowManager->setGuiMode(GM_Game); + + setVisible(false); } diff --git a/apps/openmw/mwworld/actionopen.cpp b/apps/openmw/mwworld/actionopen.cpp index aa4a67b2b5..e245989d7f 100644 --- a/apps/openmw/mwworld/actionopen.cpp +++ b/apps/openmw/mwworld/actionopen.cpp @@ -16,7 +16,7 @@ namespace MWWorld void ActionOpen::execute (Environment& environment) { - environment.mWindowManager->setGuiMode(MWGui::GuiMode::GM_Container); + environment.mWindowManager->setGuiMode(MWGui::GM_Container); environment.mWindowManager->getContainerWindow()->open(mContainer); } } diff --git a/files/mygui/openmw_container_window_layout.xml b/files/mygui/openmw_container_window_layout.xml index a9de148804..7fce9e187c 100644 --- a/files/mygui/openmw_container_window_layout.xml +++ b/files/mygui/openmw_container_window_layout.xml @@ -1,13 +1,13 @@ - + - - + - --> +