Skip to content

Commit

Permalink
fix bug where you couldn't place stamps on top of special signs
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Apr 12, 2014
1 parent 181f0cf commit 35d97eb
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gui/game/GameController.cpp
Expand Up @@ -557,7 +557,7 @@ bool GameController::MouseDown(int x, int y, unsigned button)
ui::Point point = PointTranslate(ui::Point(x, y));
x = point.X;
y = point.Y;
if(ret && y<YRES && x<XRES)
if (ret && y<YRES && x<XRES && !gameView->GetPlacingSave())
if (gameModel->GetActiveTool(0)->GetIdentifier() != "DEFAULT_UI_SIGN" || button != BUTTON_LEFT) //If it's not a sign tool or you are right/middle clicking
{
sign * foundSign = GetSignAt(x, y);
Expand All @@ -573,7 +573,7 @@ bool GameController::MouseUp(int x, int y, unsigned button)
ui::Point point = PointTranslate(ui::Point(x, y));
x = point.X;
y = point.Y;
if(ret && y<YRES && x<XRES)
if (ret && y<YRES && x<XRES && !gameView->GetPlacingSave())
{
if (gameModel->GetActiveTool(0)->GetIdentifier() != "DEFAULT_UI_SIGN" || button != BUTTON_LEFT) //If it's not a sign tool or you are right/middle clicking
{
Expand Down
5 changes: 5 additions & 0 deletions src/gui/game/GameView.cpp
Expand Up @@ -618,6 +618,11 @@ ui::Point GameView::GetMousePosition()
return currentMouse;
}

bool GameView::GetPlacingSave()
{
return selectMode != SelectNone;
}

void GameView::NotifyActiveToolsChanged(GameModel * sender)
{
for(int i = 0; i < toolButtons.size(); i++)
Expand Down
1 change: 1 addition & 0 deletions src/gui/game/GameView.h
Expand Up @@ -136,6 +136,7 @@ class GameView: public ui::Window
bool GetHudEnable();
void SetDebugHUD(bool mode);
bool GetDebugHUD();
bool GetPlacingSave();
bool CtrlBehaviour(){ return ctrlBehaviour; }
bool ShiftBehaviour(){ return shiftBehaviour; }
bool AltBehaviour(){ return altBehaviour; }
Expand Down

0 comments on commit 35d97eb

Please sign in to comment.