summaryrefslogtreecommitdiff
path: root/src/game/GameView.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-04-22 16:13:43 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-04-22 16:13:43 (GMT)
commite38fd405af5f07667203c6f584a5cdb00ed20ca2 (patch)
treef5630c0e43cb848bb36a29c0d20599dcc324161c /src/game/GameView.cpp
parent553cf6552070aae93e1db031b57afdc8c9ba19e0 (diff)
downloadpowder-e38fd405af5f07667203c6f584a5cdb00ed20ca2.zip
powder-e38fd405af5f07667203c6f584a5cdb00ed20ca2.tar.gz
Correct quirks with drawrect and fillrect, change UI components accordingly, shorten save name in save button
Diffstat (limited to 'src/game/GameView.cpp')
-rw-r--r--src/game/GameView.cpp42
1 files changed, 21 insertions, 21 deletions
diff --git a/src/game/GameView.cpp b/src/game/GameView.cpp
index 7e04c6e..cfc6a19 100644
--- a/src/game/GameView.cpp
+++ b/src/game/GameView.cpp
@@ -45,7 +45,7 @@ GameView::GameView():
v->c->OpenSearch();
}
};
- searchButton = new ui::Button(ui::Point(currentX, Size.Y-18), ui::Point(16, 16)); //Open
+ searchButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(17, 15)); //Open
searchButton->SetIcon(IconOpen);
currentX+=18;
searchButton->SetTogglable(false);
@@ -62,7 +62,7 @@ GameView::GameView():
v->c->ReloadSim();
}
};
- reloadButton = new ui::Button(ui::Point(currentX, Size.Y-18), ui::Point(16, 16));
+ reloadButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(17, 15));
reloadButton->SetIcon(IconReload);
currentX+=18;
reloadButton->SetActionCallback(new ReloadAction(this));
@@ -78,9 +78,9 @@ GameView::GameView():
v->c->OpenSaveWindow();
}
};
- saveSimulationButton = new ui::Button(ui::Point(currentX, Size.Y-18), ui::Point(Size.X/5, 16));
+ saveSimulationButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(150, 15));
saveSimulationButton->SetIcon(IconSave);
- currentX+=(Size.X/5)+2;
+ currentX+=151;
saveSimulationButton->SetActionCallback(new SaveSimulationAction(this));
AddComponent(saveSimulationButton);
@@ -94,9 +94,9 @@ GameView::GameView():
v->c->Vote(1);
}
};
- upVoteButton = new ui::Button(ui::Point(currentX, Size.Y-18), ui::Point(16, 16));
+ upVoteButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(15, 15));
upVoteButton->SetIcon(IconVoteUp);
- currentX+=16;
+ currentX+=15;
upVoteButton->SetActionCallback(new UpVoteAction(this));
AddComponent(upVoteButton);
@@ -110,9 +110,9 @@ GameView::GameView():
v->c->Vote(-1);
}
};
- downVoteButton = new ui::Button(ui::Point(currentX, Size.Y-18), ui::Point(16, 16));
+ downVoteButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(15, 15));
downVoteButton->SetIcon(IconVoteDown);
- currentX+=18;
+ currentX+=16;
downVoteButton->SetActionCallback(new DownVoteAction(this));
AddComponent(downVoteButton);
@@ -126,9 +126,9 @@ GameView::GameView():
v->c->OpenTags();
}
};
- tagSimulationButton = new ui::Button(ui::Point(currentX, Size.Y-18), ui::Point(Size.X-(currentX+176), 16));
+ tagSimulationButton = new ui::Button(ui::Point(currentX, Size.Y-16), ui::Point(250, 15));
tagSimulationButton->SetIcon(IconTag);
- currentX+=Size.X-(currentX+176);
+ currentX+=251;
tagSimulationButton->SetActionCallback(new TagSimulationAction(this));
AddComponent(tagSimulationButton);
@@ -142,7 +142,7 @@ GameView::GameView():
v->c->ClearSim();
}
};
- clearSimButton = new ui::Button(ui::Point(Size.X-174, Size.Y-18), ui::Point(16, 16));
+ clearSimButton = new ui::Button(ui::Point(Size.X-159, Size.Y-16), ui::Point(17, 15));
clearSimButton->SetIcon(IconNew);
clearSimButton->SetActionCallback(new ClearSimAction(this));
AddComponent(clearSimButton);
@@ -157,7 +157,7 @@ GameView::GameView():
v->c->OpenLogin();
}
};
- loginButton = new ui::Button(ui::Point(Size.X-156, Size.Y-18), ui::Point(100, 16), "Login");
+ loginButton = new ui::Button(ui::Point(Size.X-141, Size.Y-16), ui::Point(92, 15), "Login");
loginButton->SetIcon(IconLogin);
loginButton->SetActionCallback(new LoginAction(this));
AddComponent(loginButton);
@@ -172,7 +172,7 @@ GameView::GameView():
v->c->OpenOptions();
}
};
- simulationOptionButton = new ui::Button(ui::Point(Size.X-54, Size.Y-18), ui::Point(16, 16));
+ simulationOptionButton = new ui::Button(ui::Point(Size.X-48, Size.Y-16), ui::Point(15, 15));
simulationOptionButton->SetIcon(IconSimulationSettings);
simulationOptionButton->SetActionCallback(new SimulationOptionAction(this));
AddComponent(simulationOptionButton);
@@ -187,7 +187,7 @@ GameView::GameView():
v->c->OpenRenderOptions();
}
};
- displayModeButton = new ui::Button(ui::Point(Size.X-36, Size.Y-18), ui::Point(16, 16));
+ displayModeButton = new ui::Button(ui::Point(Size.X-32, Size.Y-16), ui::Point(15, 15));
displayModeButton->SetIcon(IconRenderSettings);
displayModeButton->SetActionCallback(new DisplayModeAction(this));
AddComponent(displayModeButton);
@@ -202,7 +202,7 @@ GameView::GameView():
v->c->SetPaused(sender->GetToggleState());
}
};
- pauseButton = new ui::Button(ui::Point(Size.X-18, Size.Y-18), ui::Point(16, 16)); //Pause
+ pauseButton = new ui::Button(ui::Point(Size.X-16, Size.Y-16), ui::Point(15, 15)); //Pause
pauseButton->SetIcon(IconPause);
pauseButton->SetTogglable(true);
pauseButton->SetActionCallback(new PauseAction(this));
@@ -257,7 +257,7 @@ public:
void GameView::NotifyMenuListChanged(GameModel * sender)
{
- int currentY = YRES+MENUSIZE-18-(sender->GetMenuList().size()*18);
+ int currentY = YRES+MENUSIZE-16-(sender->GetMenuList().size()*16);
for(int i = 0; i < menuButtons.size(); i++)
{
RemoveComponent(menuButtons[i]);
@@ -275,10 +275,10 @@ void GameView::NotifyMenuListChanged(GameModel * sender)
{
std::string tempString = "";
tempString += menuList[i]->GetIcon();
- ui::Button * tempButton = new ui::Button(ui::Point(XRES+BARSIZE-18, currentY), ui::Point(16, 16), tempString);
+ ui::Button * tempButton = new ui::Button(ui::Point(XRES+BARSIZE-16, currentY), ui::Point(15, 15), tempString);
tempButton->SetTogglable(true);
tempButton->SetActionCallback(new MenuAction(this, menuList[i]));
- currentY+=18;
+ currentY+=16;
AddComponent(tempButton);
menuButtons.push_back(tempButton);
}
@@ -344,9 +344,9 @@ 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(28, 15), toolList[i]->GetName());
+ ToolButton * tempButton = new ToolButton(ui::Point(currentX, YRES+1), ui::Point(30, 18), toolList[i]->GetName());
//currentY -= 17;
- currentX -= 32;
+ currentX -= 31;
tempButton->SetActionCallback(new ToolAction(this, toolList[i]));
tempButton->SetBackgroundColour(ui::Colour(toolList[i]->colRed, toolList[i]->colGreen, toolList[i]->colBlue));
@@ -364,7 +364,7 @@ void GameView::NotifyToolListChanged(GameModel * sender)
tempButton->SetSelectionState(2); //Tertiary
}
- tempButton->SetAlignment(AlignCentre, AlignBottom);
+ tempButton->SetAlignment(AlignCentre, AlignMiddle);
AddComponent(tempButton);
toolButtons.push_back(tempButton);
}