forked from mirror/OpenTTD
(svn r12547) -Feature: invisibility options to make objects invisible instead of transparent
This commit is contained in:
@@ -1230,8 +1230,8 @@ static void ViewportAddSigns(DrawPixelInfo *dpi)
|
||||
const Sign *si;
|
||||
int left, top, right, bottom;
|
||||
|
||||
if (!HasBit(_display_opt, DO_SHOW_SIGNS))
|
||||
return;
|
||||
/* Signs are turned off or are invisible */
|
||||
if (!HasBit(_display_opt, DO_SHOW_SIGNS) || IsInvisibilitySet(TO_SIGNS)) return;
|
||||
|
||||
left = dpi->left;
|
||||
top = dpi->top;
|
||||
@@ -1495,6 +1495,12 @@ static void ViewportDrawStrings(DrawPixelInfo *dpi, const StringSpriteToDraw *ss
|
||||
uint16 colour;
|
||||
|
||||
if (ss->width != 0) {
|
||||
/* Do not draw signs nor station names if they are set invisible */
|
||||
if (IsInvisibilitySet(TO_SIGNS) && ss->string != STR_2806) {
|
||||
ss = ss->next;
|
||||
continue;
|
||||
}
|
||||
|
||||
int x = UnScaleByZoom(ss->x, zoom) - 1;
|
||||
int y = UnScaleByZoom(ss->y, zoom) - 1;
|
||||
int bottom = y + 11;
|
||||
@@ -1958,7 +1964,8 @@ static bool CheckClickOnSign(const ViewPort *vp, int x, int y)
|
||||
{
|
||||
const Sign *si;
|
||||
|
||||
if (!HasBit(_display_opt, DO_SHOW_SIGNS) || _current_player == PLAYER_SPECTATOR) return false;
|
||||
/* Signs are turned off, or they are transparent and invisibility is ON, or player is a spectator */
|
||||
if (!HasBit(_display_opt, DO_SHOW_SIGNS) || IsInvisibilitySet(TO_SIGNS) || _current_player == PLAYER_SPECTATOR) return false;
|
||||
|
||||
switch (vp->zoom) {
|
||||
case ZOOM_LVL_NORMAL:
|
||||
|
Reference in New Issue
Block a user