|
@@ -14,6 +14,16 @@ Game::Game(Bildschirm* zScreen)
|
|
|
recipieVisible(0),
|
|
|
itemListContainer(0)
|
|
|
{
|
|
|
+ LTDBDatei dat;
|
|
|
+ dat.setDatei(new Text("data/images/gui_icons.ltdb"));
|
|
|
+ dat.leseDaten(0);
|
|
|
+ Bild* search = dat.laden(0, new Text("search.png"));
|
|
|
+ searchIcon = new BildZ();
|
|
|
+ searchIcon->setBildZ(search);
|
|
|
+ searchIcon->setStyle(
|
|
|
+ BildZ::Style::Sichtbar | BildZ::Style::Alpha | BildZ::Style::Rahmen);
|
|
|
+ searchIcon->setSize(20, 20);
|
|
|
+ searchIcon->setRahmenFarbe(0xFF6d6d6d);
|
|
|
elements.add(new ScreenCenter());
|
|
|
inventoryDragController = new DragController<InventoryDragSource, int>();
|
|
|
logout = initKnopf(10, 10, 200, 20, Knopf::Style::Normal, "Verlassen");
|
|
@@ -54,6 +64,8 @@ Game::Game(Bildschirm* zScreen)
|
|
|
20,
|
|
|
Framework::TextFeld::Style::TextFeld,
|
|
|
"");
|
|
|
+ searchIcon->setPosition(
|
|
|
+ filter->getX() + filter->getBreite() - 20, filter->getY());
|
|
|
|
|
|
chat = new Chat();
|
|
|
elements.add(chat);
|
|
@@ -90,7 +102,8 @@ Game::~Game()
|
|
|
{
|
|
|
inventoryDragController->release();
|
|
|
filter->release();
|
|
|
- if(itemListContainer) itemListContainer->release();
|
|
|
+ searchIcon->release();
|
|
|
+ if (itemListContainer) itemListContainer->release();
|
|
|
}
|
|
|
|
|
|
void Game::updatePosition(
|
|
@@ -204,25 +217,25 @@ void Game::api(char* data)
|
|
|
delete[] uiml;
|
|
|
}
|
|
|
case 3:
|
|
|
- { // update dialog content
|
|
|
- short dialogNameLen = *(short*)(data + 1);
|
|
|
- char* dialogName = new char[dialogNameLen + 1];
|
|
|
- memcpy(dialogName, data + 3, dialogNameLen);
|
|
|
- dialogName[dialogNameLen] = 0;
|
|
|
- for (UIMLDialog* dialog : dialogs)
|
|
|
- {
|
|
|
- if (dialog->getName().istGleich(dialogName))
|
|
|
+ { // update dialog content
|
|
|
+ short dialogNameLen = *(short*)(data + 1);
|
|
|
+ char* dialogName = new char[dialogNameLen + 1];
|
|
|
+ memcpy(dialogName, data + 3, dialogNameLen);
|
|
|
+ dialogName[dialogNameLen] = 0;
|
|
|
+ for (UIMLDialog* dialog : dialogs)
|
|
|
{
|
|
|
- int uimlLen = *(int*)(data + 3 + dialogNameLen);
|
|
|
- char* uiml = new char[uimlLen + 1];
|
|
|
- memcpy(uiml, data + 7 + dialogNameLen, uimlLen);
|
|
|
- uiml[uimlLen] = 0;
|
|
|
- dialog->updateUIML(uiml);
|
|
|
- delete[] uiml;
|
|
|
- break;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ if (dialog->getName().istGleich(dialogName))
|
|
|
+ {
|
|
|
+ int uimlLen = *(int*)(data + 3 + dialogNameLen);
|
|
|
+ char* uiml = new char[uimlLen + 1];
|
|
|
+ memcpy(uiml, data + 7 + dialogNameLen, uimlLen);
|
|
|
+ uiml[uimlLen] = 0;
|
|
|
+ dialog->updateUIML(uiml);
|
|
|
+ delete[] uiml;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -269,6 +282,8 @@ void Game::updateRecipieVisibility()
|
|
|
recipieVisible = 1;
|
|
|
window->zBildschirm()->addMember(
|
|
|
dynamic_cast<Zeichnung*>(filter->getThis()));
|
|
|
+ window->zBildschirm()->addMember(
|
|
|
+ dynamic_cast<Zeichnung*>(searchIcon->getThis()));
|
|
|
}
|
|
|
}
|
|
|
else
|
|
@@ -277,6 +292,7 @@ void Game::updateRecipieVisibility()
|
|
|
{
|
|
|
recipieVisible = 0;
|
|
|
window->zBildschirm()->removeMember(filter);
|
|
|
+ window->zBildschirm()->removeMember(searchIcon);
|
|
|
if (itemListContainer)
|
|
|
itemListContainer->removeStyle(Fenster::Style::Sichtbar);
|
|
|
}
|
|
@@ -296,8 +312,8 @@ void Game::showItemList()
|
|
|
|
|
|
bool Game::isItemListVisible()
|
|
|
{
|
|
|
- return itemListContainer && itemListContainer->hatStyle(
|
|
|
- Fenster::Style::Sichtbar);
|
|
|
+ return itemListContainer
|
|
|
+ && itemListContainer->hatStyle(Fenster::Style::Sichtbar);
|
|
|
}
|
|
|
|
|
|
const Text* Game::zFilterText()
|
|
@@ -340,7 +356,7 @@ ScreenCenter::ScreenCenter()
|
|
|
setSize(uiFactory.initParam.bildschirm->getBackBufferSize());
|
|
|
}
|
|
|
|
|
|
-void ScreenCenter::render(Bild& zRObj)
|
|
|
+void ScreenCenter::render(Bild& zRObj)
|
|
|
{
|
|
|
zRObj.drawLinieH(gr.x / 2 - 5, gr.y / 2, 10, 0xFFFFFFFF);
|
|
|
zRObj.drawLinieV(gr.x / 2, gr.y / 2 - 5, 10, 0xFFFFFFFF);
|