summaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2013-07-17 20:53:14 (GMT)
committer jacob1 <jfu614@gmail.com>2013-07-17 20:53:14 (GMT)
commit4243987acdbd7f105366df55ef3a958181148c90 (patch)
tree83f4641c1f3ad4d3ef5f0d9e12a2dc8c45e8a7c6 /src/gui
parent9628a11245acc1b2c8dd213a4dd30a3fb9930e01 (diff)
downloadpowder-4243987acdbd7f105366df55ef3a958181148c90.zip
powder-4243987acdbd7f105366df55ef3a958181148c90.tar.gz
black decoration preset, improve look of deco buttons a little
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/game/DecorationTool.h18
-rw-r--r--src/gui/game/GameModel.cpp15
-rw-r--r--src/gui/game/GameView.cpp2
3 files changed, 19 insertions, 16 deletions
diff --git a/src/gui/game/DecorationTool.h b/src/gui/game/DecorationTool.h
index 67ab915..2edb201 100644
--- a/src/gui/game/DecorationTool.h
+++ b/src/gui/game/DecorationTool.h
@@ -26,15 +26,17 @@ public:
// vid_buf[(XRES+BARSIZE)*(y+j)+(x+i)] = PIXRGB(PIXR(pc)+10*j, PIXG(pc)+10*j, PIXB(pc)+10*j);
if (toolID == DECO_SMUDGE)
newTexture->SetPixel(x, y, 0, 255-5*x, 255+5*x, 255);
- else
+ else if (toolID == DECO_DRAW || toolID == DECO_CLEAR)
newTexture->SetPixel(x, y, Red, Green, Blue, Alpha);
+ else
+ newTexture->SetPixel(x, y, 50, 50, 50, 255);
}
}
- int reverseRed = (Red+127)%256;
- int reverseGreen = (Green+127)%256;
- int reverseBlue = (Blue+127)%256;
if (toolID == DECO_CLEAR)
{
+ int reverseRed = (Red+127)%256;
+ int reverseGreen = (Green+127)%256;
+ int reverseBlue = (Blue+127)%256;
for (int y=4; y<12; y++)
{
newTexture->SetPixel(y+5, y-1, reverseRed, reverseGreen, reverseBlue, 255);
@@ -44,13 +46,13 @@ public:
}
}
else if (toolID == DECO_ADD)
- newTexture->AddCharacter(11, 4, '+', reverseRed, reverseGreen, reverseBlue, 255);
+ newTexture->AddCharacter(11, 4, '+', Red, Green, Blue, 255);
else if (toolID == DECO_SUBTRACT)
- newTexture->AddCharacter(11, 4, '-', reverseRed, reverseGreen, reverseBlue, 255);
+ newTexture->AddCharacter(11, 4, '-', Red, Green, Blue, 255);
else if (toolID == DECO_MULTIPLY)
- newTexture->AddCharacter(11, 3, 'x', reverseRed, reverseGreen, reverseBlue, 255);
+ newTexture->AddCharacter(11, 3, 'x', Red, Green, Blue, 255);
else if (toolID == DECO_DIVIDE)
- newTexture->AddCharacter(11, 4, '/', reverseRed, reverseGreen, reverseBlue, 255);
+ newTexture->AddCharacter(11, 4, '/', Red, Green, Blue, 255);
return newTexture;
}
diff --git a/src/gui/game/GameModel.cpp b/src/gui/game/GameModel.cpp
index 0852e71..fdd70dc 100644
--- a/src/gui/game/GameModel.cpp
+++ b/src/gui/game/GameModel.cpp
@@ -145,6 +145,7 @@ GameModel::GameModel():
colourPresets.push_back(ui::Colour(255, 0, 0));
colourPresets.push_back(ui::Colour(0, 255, 0));
colourPresets.push_back(ui::Colour(0, 0, 255));
+ colourPresets.push_back(ui::Colour(0, 0, 0));
}
GameModel::~GameModel()
@@ -327,13 +328,13 @@ void GameModel::BuildMenus()
menuList[SC_TOOL]->AddTool(new SampleTool(this));
//Add decoration tools to menu
- menuList[SC_DECO]->AddTool(new DecorationTool(DECO_ADD, "ADD", "Colour blending: Add", 0, 0, 0, "DEFAULT_DECOR_ADD"));
- menuList[SC_DECO]->AddTool(new DecorationTool(DECO_SUBTRACT, "SUB", "Colour blending: Subtract", 0, 0, 0, "DEFAULT_DECOR_SUB"));
- menuList[SC_DECO]->AddTool(new DecorationTool(DECO_MULTIPLY, "MUL", "Colour blending: Multiply", 0, 0, 0, "DEFAULT_DECOR_MUL"));
- menuList[SC_DECO]->AddTool(new DecorationTool(DECO_DIVIDE, "DIV", "Colour blending: Divide" , 0, 0, 0, "DEFAULT_DECOR_DIV"));
- menuList[SC_DECO]->AddTool(new DecorationTool(DECO_SMUDGE, "SMDG", "Smudge colour", 0, 0, 0, "DEFAULT_DECOR_SMDG"));
- menuList[SC_DECO]->AddTool(new DecorationTool(DECO_DRAW, "SET", "Set colour (No blending)", 0, 0, 0, "DEFAULT_DECOR_SET"));
- menuList[SC_DECO]->AddTool(new DecorationTool(DECO_CLEAR, "CLR", "Clear any set decoration", 0, 0, 0, "DEFAULT_DECOR_CLR"));
+ menuList[SC_DECO]->AddTool(new DecorationTool(DECO_ADD, "ADD", "Colour blending: Add.", 0, 0, 0, "DEFAULT_DECOR_ADD"));
+ menuList[SC_DECO]->AddTool(new DecorationTool(DECO_SUBTRACT, "SUB", "Colour blending: Subtract.", 0, 0, 0, "DEFAULT_DECOR_SUB"));
+ menuList[SC_DECO]->AddTool(new DecorationTool(DECO_MULTIPLY, "MUL", "Colour blending: Multiply.", 0, 0, 0, "DEFAULT_DECOR_MUL"));
+ menuList[SC_DECO]->AddTool(new DecorationTool(DECO_DIVIDE, "DIV", "Colour blending: Divide." , 0, 0, 0, "DEFAULT_DECOR_DIV"));
+ menuList[SC_DECO]->AddTool(new DecorationTool(DECO_SMUDGE, "SMDG", "Smudge tool, blends surrounding deco together.", 0, 0, 0, "DEFAULT_DECOR_SMDG"));
+ menuList[SC_DECO]->AddTool(new DecorationTool(DECO_DRAW, "SET", "Draw decoration (No blending).", 0, 0, 0, "DEFAULT_DECOR_SET"));
+ menuList[SC_DECO]->AddTool(new DecorationTool(DECO_CLEAR, "CLR", "Erase any set decoration.", 0, 0, 0, "DEFAULT_DECOR_CLR"));
decoToolset[0] = GetToolFromIdentifier("DEFAULT_DECOR_SET");
decoToolset[1] = GetToolFromIdentifier("DEFAULT_DECOR_CLR");
decoToolset[2] = GetToolFromIdentifier("DEFAULT_UI_SAMPLE");
diff --git a/src/gui/game/GameView.cpp b/src/gui/game/GameView.cpp
index 027f06b..5bbcb3a 100644
--- a/src/gui/game/GameView.cpp
+++ b/src/gui/game/GameView.cpp
@@ -776,7 +776,7 @@ void GameView::NotifyColourPresetsChanged(GameModel * sender)
int i = 0;
for(std::vector<ui::Colour>::iterator iter = colours.begin(), end = colours.end(); iter != end; ++iter)
{
- ToolButton * tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), "");
+ ToolButton * tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), "", "Decoration Presets.");
tempButton->Appearance.BackgroundInactive = *iter;
tempButton->SetActionCallback(new ColourPresetAction(this, i));