Merge branch 'inventoryGUI' of https://github.com/pchan3/openmw.git into inventoryGUI

Conflicts:
	apps/openmw/mwgui/container.cpp
This commit is contained in:
gugus 2012-04-21 11:08:10 +02:00
commit 93ba773d2e
3 changed files with 20 additions and 19 deletions

View file

@ -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<ESM::Armor, MWWorld::RefData> *ref = iter->get<ESM::Armor>();
@ -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<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(x, y, 32, 32), MyGUI::Align::Default);
MyGUI::TextBox* text = containerWidget->createWidget<MyGUI::TextBox>("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<MyGUI::ImageBox>("ImageBox", MyGUI::IntCoord(x, y, 32, 32), MyGUI::Align::Default);
MyGUI::TextBox* text = containerWidget->createWidget<MyGUI::TextBox>("SandBrightText", MyGUI::IntCoord(x, y, 18, 18), MyGUI::Align::Default, std::string("Label"));
if(iter->getRefData().getCount() > 1)
text->setCaption(boost::lexical_cast<std::string>(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);
}

View file

@ -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);
}
}

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<MyGUI type="Layout">
<Widget type="Window" skin="MW_Window" layer="Windows" position="900 500 600 300" name="_Main">
<Widget type="Window" skin="MW_Window" layer="Windows" position="0 0 600 300" align="Left Bottom" name="_Main">
<!-- HEADER
<!-- HEADER -->
<Widget type="TextBox" skin="HeaderText" position="0 0 588 18" name="ContainerName" align="ALIGN_LEFT ALIGN_TOP">
<Property key="Caption" value="Name"/>
<Property key="Caption" value=""/>
<Property key="TextAlign" value="ALIGN_CENTER"/>
</Widget>-->
</Widget>