mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-29 10:49:53 +02:00
Load element icons in element search, fixes #73
This commit is contained in:
@@ -115,7 +115,15 @@ void ElementSearchActivity::searchTools(std::string query)
|
|||||||
if(!firstResult)
|
if(!firstResult)
|
||||||
firstResult = tool;
|
firstResult = tool;
|
||||||
|
|
||||||
ToolButton * tempButton = new ToolButton(current+viewPosition, ui::Point(30, 18), tool->GetName());
|
VideoBuffer * tempTexture = tool->GetTexture(26, 14);
|
||||||
|
ToolButton * tempButton;
|
||||||
|
|
||||||
|
if(tempTexture)
|
||||||
|
tempButton = new ToolButton(current+viewPosition, ui::Point(30, 18), "", tool->GetDescription());
|
||||||
|
else
|
||||||
|
tempButton = new ToolButton(current+viewPosition, ui::Point(30, 18), tool->GetName(), tool->GetDescription());
|
||||||
|
|
||||||
|
tempButton->Appearance.SetTexture(tempTexture);
|
||||||
tempButton->Appearance.BackgroundInactive = ui::Colour(tool->colRed, tool->colGreen, tool->colBlue);
|
tempButton->Appearance.BackgroundInactive = ui::Colour(tool->colRed, tool->colGreen, tool->colBlue);
|
||||||
tempButton->SetActionCallback(new ToolAction(this, tool));
|
tempButton->SetActionCallback(new ToolAction(this, tool));
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user