From a1b4168b30979fc9bb8571d382b4bfc6aa8f87f0 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Sun, 22 Jul 2012 15:01:56 +0100 Subject: [PATCH] Sign tool icon --- src/game/GameView.cpp | 10 ++++++++-- src/game/SignTool.cpp | 13 ++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp index 4b5a43887..ac718c3ec 100644 --- a/src/game/GameView.cpp +++ b/src/game/GameView.cpp @@ -436,12 +436,18 @@ void GameView::NotifyToolListChanged(GameModel * sender) for(int i = 0; i < toolList.size(); i++) { //ToolButton * tempButton = new ToolButton(ui::Point(XRES+1, currentY), ui::Point(28, 15), toolList[i]->GetName()); - ToolButton * tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), toolList[i]->GetName(), toolList[i]->GetDescription()); + VideoBuffer * tempTexture = toolList[i]->GetTexture(26, 14); + ToolButton * tempButton; + + if(tempTexture) + tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), "", toolList[i]->GetDescription()); + else + tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), toolList[i]->GetName(), toolList[i]->GetDescription()); + //currentY -= 17; currentX -= 31; tempButton->SetActionCallback(new ToolAction(this, toolList[i])); - VideoBuffer * tempTexture = toolList[i]->GetTexture(26, 14); tempButton->Appearance.SetTexture(tempTexture); if(tempTexture) delete tempTexture; diff --git a/src/game/SignTool.cpp b/src/game/SignTool.cpp index 5b3bb8b66..333646b47 100644 --- a/src/game/SignTool.cpp +++ b/src/game/SignTool.cpp @@ -120,7 +120,18 @@ void SignWindow::OnDraw() VideoBuffer * SignTool::GetIcon(int toolID, int width, int height) { - + VideoBuffer * newTexture = new VideoBuffer(width, height); + for (int y=0; ySetPixel(x, y, PIXR(pc), PIXG(pc), PIXB(pc), 255); + } + } + newTexture->SetCharacter((width/2)-5, (height/2)-4, 0xA1, 32, 64, 128, 255); + newTexture->SetCharacter((width/2)-5, (height/2)-4, 0xA0, 255, 255, 255, 255); + return newTexture; } void SignTool::Click(Simulation * sim, Brush * brush, ui::Point position)