fix bug where you couldn't place stamps on top of special signs

This commit is contained in:
jacob1 2014-04-11 23:17:35 -04:00
parent 181f0cfe5b
commit 35d97eb14d
3 changed files with 8 additions and 2 deletions

View File

@ -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);
@ -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
{

View File

@ -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++)

View File

@ -136,6 +136,7 @@ public:
bool GetHudEnable();
void SetDebugHUD(bool mode);
bool GetDebugHUD();
bool GetPlacingSave();
bool CtrlBehaviour(){ return ctrlBehaviour; }
bool ShiftBehaviour(){ return shiftBehaviour; }
bool AltBehaviour(){ return altBehaviour; }