1
0
Fork 0

(svn r2496) -Fix: [1179933] When toggling build/remove via keyboard the selection wasn't correctly redrawn

release/0.4.5
tron 2005-06-29 08:14:09 +00:00
parent a45b6278d1
commit 6e72d514b7
4 changed files with 13 additions and 4 deletions

View File

@ -288,9 +288,9 @@ static void BuildRailClick_Remove(Window *w)
SetWindowDirty(w); SetWindowDirty(w);
SndPlayFx(SND_15_BEEP); SndPlayFx(SND_15_BEEP);
_thd.make_square_red = !!((w->click_state ^= (1 << 16)) & (1<<16)); w->click_state ^= (1 << 16);
MarkTileDirty(_thd.pos.x, _thd.pos.y);
_remove_button_clicked = (w->click_state & (1 << 16)) != 0; _remove_button_clicked = (w->click_state & (1 << 16)) != 0;
SetSelectionRed((w->click_state & (1 << 16)) != 0);
// handle station builder // handle station builder
if( w->click_state & (1 << 16) ) if( w->click_state & (1 << 16) )

View File

@ -159,8 +159,8 @@ static void BuildRoadClick_Remove(Window *w)
return; return;
SetWindowDirty(w); SetWindowDirty(w);
SndPlayFx(SND_15_BEEP); SndPlayFx(SND_15_BEEP);
_thd.make_square_red = !!((w->click_state ^= (1 << 11)) & (1<<11)); w->click_state ^= (1 << 11);
MarkTileDirty(_thd.pos.x, _thd.pos.y); SetSelectionRed((w->click_state & (1 << 11)) != 0);
} }
static void BuildRoadClick_Landscaping(Window *w) static void BuildRoadClick_Landscaping(Window *w)

View File

@ -1486,6 +1486,13 @@ static void SetSelectionTilesDirty(void)
} }
void SetSelectionRed(bool b)
{
_thd.make_square_red = b;
SetSelectionTilesDirty();
}
static bool CheckClickOnTown(ViewPort *vp, int x, int y) static bool CheckClickOnTown(ViewPort *vp, int x, int y)
{ {
Town *t; Town *t;

View File

@ -11,6 +11,8 @@ struct ViewPort {
byte zoom; byte zoom;
}; };
void SetSelectionRed(bool);
/* viewport.c */ /* viewport.c */
Point MapXYZToViewport(ViewPort *vp, uint x, uint y, uint z); Point MapXYZToViewport(ViewPort *vp, uint x, uint y, uint z);
void AssignWindowViewport(Window *w, int x, int y, void AssignWindowViewport(Window *w, int x, int y,