Changeset - r16017:2291ca54c6cd
[Not reviewed]
master
0 11 0
frosch - 14 years ago 2010-09-02 20:00:48
frosch@openttd.org
(svn r20720) -Add: separate GUI icons for vehicle/company profit, exclusive rights and unread news.
11 files changed with 35 insertions and 20 deletions:
0 comments (0 inline, 0 general)
bin/data/openttd.grf
Show inline comments
 
binary diff not shown
bin/data/orig_dos.obg
Show inline comments
 
@@ -52,11 +52,11 @@ extra        = OPENTTD.GRF
 
[md5s]
 
TRG1.GRF     = 9311676280e5b14077a8ee41c1b42192
 
TRGI.GRF     = da6a6c9dcc451eec88d79211437b76a8
 
TRGC.GRF     = ed446637e034104c5559b32c18afe78d
 
TRGH.GRF     = ee6616fb0e6ef6b24892c58c93d86fc9
 
TRGT.GRF     = e30e8a398ae86c03dc534a8ac7dfb3b6
 
OPENTTD.GRF  = d4c3f8d93c85136203feb7159151beb5
 
OPENTTD.GRF  = 36d94ea7a6f715eb9ead5f9732c6edea
 

	
 
[origin]
 
default      = You can find it on your Transport Tycoon Deluxe CD-ROM.
 
OPENTTD.GRF  = This file was part of your OpenTTD installation.
bin/data/orig_dos_de.obg
Show inline comments
 
@@ -52,11 +52,11 @@ extra        = OPENTTD.GRF
 
[md5s]
 
TRG1.GRF     = 9311676280e5b14077a8ee41c1b42192
 
TRGI.GRF     = da6a6c9dcc451eec88d79211437b76a8
 
TRGC.GRF     = ed446637e034104c5559b32c18afe78d
 
TRGH.GRF     = ee6616fb0e6ef6b24892c58c93d86fc9
 
TRGT.GRF     = fcde1d7e8a74197d72a62695884b909e
 
OPENTTD.GRF  = d4c3f8d93c85136203feb7159151beb5
 
OPENTTD.GRF  = 36d94ea7a6f715eb9ead5f9732c6edea
 

	
 
[origin]
 
default      = You can find it on your Transport Tycoon Deluxe CD-ROM.
 
OPENTTD.GRF  = This file was part of your OpenTTD installation.
bin/data/orig_win.obg
Show inline comments
 
@@ -52,11 +52,11 @@ extra        = OPENTTD.GRF
 
[md5s]
 
TRG1R.GRF    = b04ce593d8c5016e07473a743d7d3358
 
TRGIR.GRF    = 0c2484ff6be49fc63a83be6ab5c38f32
 
TRGCR.GRF    = 3668f410c761a050b5e7095a2b14879b
 
TRGHR.GRF    = 06bf2b7a31766f048baac2ebe43457b1
 
TRGTR.GRF    = de53650517fe661ceaa3138c6edb0eb8
 
OPENTTD.GRF  = d4c3f8d93c85136203feb7159151beb5
 
OPENTTD.GRF  = 36d94ea7a6f715eb9ead5f9732c6edea
 

	
 
[origin]
 
default      = You can find it on your Transport Tycoon Deluxe CD-ROM.
 
OPENTTD.GRF  = This file was part of your OpenTTD installation.
media/extra_grf/openttdgui.nfo
Show inline comments
 
@@ -10,13 +10,13 @@
 
// Do not make nforenum warn about the fact that we use more sprites.
 
// We are the 'authority' on how many sprites may be used.
 
// @@WARNING DISABLE 60
 
// -- End of NFO Renum 'settings' --
 
//
 
   -1 * 0	 0C "OpenTTD GUI graphics"
 
   -1 * 0	 05 15 9A
 
   -1 * 0	 05 15 A0
 
   -1 sprites/openttdgui.pcx 18 8 09 31 64 -31 7
 
   -1 sprites/openttdgui.pcx 98 8 09 31 64 -31 7
 
   -1 sprites/openttdgui.pcx 178 8 09 31 64 -31 7
 
   -1 sprites/openttdgui.pcx 258 8 09 31 64 -31 7
 
   -1 sprites/openttdgui.pcx 338 8 09 31 64 -31 -1
 
   -1 sprites/openttdgui.pcx 418 8 09 39 64 -31 -1
 
@@ -165,11 +165,17 @@
 
   -1 sprites/openttdgui.pcx 780 376 09 10 10 0 0
 
   -1 sprites/openttdgui.pcx 4 430 09 7 7 0 0
 
   -1 sprites/openttdgui.pcx 20 430 09 13 14 4 4
 
   -1 sprites/openttdgui.pcx 38 430 09 8 7 0 0
 
   -1 sprites/openttdgui.pcx 52 430 09 8 7 0 0
 
   -1 sprites/openttdgui.pcx 65 430 09 8 7 0 0
 
   -1 sprites/openttdgui.pcx  78 430 01 8 8 0 0
 
   -1 sprites/openttdgui.pcx  92 430 01 8 8 0 0
 
   -1 sprites/openttdgui.pcx 106 430 01 8 8 0 0
 
   -1 sprites/openttdgui.pcx 120 430 01 8 8 0 0
 
   -1 sprites/openttdgui.pcx 134 430 01 10 8 0 0
 
   -1 sprites/openttdgui.pcx 148 430 09 10 13 0 -2
 

	
 
// -- NFO Renum 'settings' --
 
// Undo disabling the warning
 
// @@WARNING ENABLE 60
 
// -- End of NFO Renum 'settings' --
media/extra_grf/openttdgui.pcx
Show inline comments
 
binary diff not shown
src/network/network_gui.cpp
Show inline comments
 
@@ -1548,13 +1548,13 @@ struct NetworkLobbyWindow : public Windo
 
		uint right = r.right - WD_FRAMERECT_RIGHT;
 

	
 
		Dimension lock_size = GetSpriteSize(SPR_LOCK);
 
		int lock_width      = lock_size.width;
 
		int lock_y_offset   = (this->resize.step_height - WD_MATRIX_TOP - WD_MATRIX_BOTTOM - lock_size.height) / 2;
 

	
 
		Dimension profit_size = GetSpriteSize(SPR_BLOT);
 
		Dimension profit_size = GetSpriteSize(SPR_PROFIT_LOT);
 
		int profit_width      = lock_size.width;
 
		int profit_y_offset   = (this->resize.step_height - WD_MATRIX_TOP - WD_MATRIX_BOTTOM - profit_size.height) / 2;
 

	
 
		uint text_left   = left  + (rtl ? lock_width + profit_width + 4 : 0);
 
		uint text_right  = right - (rtl ? 0 : lock_width + profit_width + 4);
 
		uint profit_left = rtl ? left : right - profit_width;
 
@@ -1572,13 +1572,13 @@ struct NetworkLobbyWindow : public Windo
 

	
 
			DrawString(text_left, text_right, y, this->company_info[company].company_name, TC_BLACK);
 
			if (this->company_info[company].use_password != 0) DrawSprite(SPR_LOCK, PAL_NONE, lock_left, y + lock_y_offset);
 

	
 
			/* If the company's income was positive puts a green dot else a red dot */
 
			if (this->company_info[company].income >= 0) income = true;
 
			DrawSprite(SPR_BLOT, income ? PALETTE_TO_GREEN : PALETTE_TO_RED, profit_left, y + profit_y_offset);
 
			DrawSprite(income ? SPR_PROFIT_LOT : SPR_PROFIT_NEGATIVE, PAL_NONE, profit_left, y + profit_y_offset);
 

	
 
			pos++;
 
			y += this->resize.step_height;
 
			if (pos >= this->vscroll->GetPosition() + this->vscroll->GetCapacity()) break;
 
		}
 
	}
src/statusbar_gui.cpp
Show inline comments
 
@@ -178,14 +178,14 @@ struct StatusBarWindow : Window {
 
						SetDParam(0, _local_company);
 
						DrawString(r.left + WD_FRAMERECT_LEFT, r.right - WD_FRAMERECT_RIGHT, r.top + WD_FRAMERECT_TOP, STR_STATUSBAR_COMPANY_NAME, TC_FROMSTRING, SA_HOR_CENTER);
 
					}
 
				}
 

	
 
				if (this->reminder_timeout > 0) {
 
					Dimension icon_size = GetSpriteSize(SPR_BLOT);
 
					DrawSprite(SPR_BLOT, PALETTE_TO_RED, r.right - WD_FRAMERECT_RIGHT - icon_size.width, r.top + WD_FRAMERECT_TOP + (FONT_HEIGHT_NORMAL - icon_size.height) / 2);
 
					Dimension icon_size = GetSpriteSize(SPR_UNREAD_NEWS);
 
					DrawSprite(SPR_UNREAD_NEWS, PAL_NONE, r.right - WD_FRAMERECT_RIGHT - icon_size.width, r.top + WD_FRAMERECT_TOP + (FONT_HEIGHT_NORMAL - icon_size.height) / 2);
 
				}
 
				break;
 
		}
 
	}
 

	
 
	virtual void OnInvalidateData(int data)
src/table/sprites.h
Show inline comments
 
@@ -53,21 +53,21 @@ static const SpriteID SPR_ASCII_SPACE_SM
 
static const SpriteID SPR_ASCII_SPACE_BIG   = 450;
 

	
 
static const SpriteID SPR_LARGE_SMALL_WINDOW = 682;
 

	
 
/* Extra graphic spritenumbers */
 
static const SpriteID SPR_OPENTTD_BASE   = 4896;
 
static const uint16 OPENTTD_SPRITE_COUNT = 154;
 
static const uint16 OPENTTD_SPRITE_COUNT = 160;
 

	
 
/* Halftile-selection sprites */
 
static const SpriteID SPR_HALFTILE_SELECTION_FLAT = SPR_OPENTTD_BASE;
 
static const SpriteID SPR_HALFTILE_SELECTION_DOWN = SPR_OPENTTD_BASE + 4;
 
static const SpriteID SPR_HALFTILE_SELECTION_UP   = SPR_OPENTTD_BASE + 8;
 

	
 
static const SpriteID SPR_SQUARE             = SPR_OPENTTD_BASE + 38;  // coloured square (used for newgrf compatibility)
 
static const SpriteID SPR_BLOT               = SPR_OPENTTD_BASE + 39;  // coloured circle (mainly used as vehicle profit marker and for server compatibility)
 
static const SpriteID SPR_BLOT               = SPR_OPENTTD_BASE + 39;  // coloured circle (used for server compatibility and installed content)
 
static const SpriteID SPR_LOCK               = SPR_OPENTTD_BASE + 40;  // lock icon (for password protected servers)
 
static const SpriteID SPR_BOX_EMPTY          = SPR_OPENTTD_BASE + 41;
 
static const SpriteID SPR_BOX_CHECKED        = SPR_OPENTTD_BASE + 42;
 
static const SpriteID SPR_WARNING_SIGN       = SPR_OPENTTD_BASE + 43;  // warning sign (shown if there are any newgrf errors)
 
static const SpriteID SPR_WINDOW_RESIZE_RIGHT= SPR_OPENTTD_BASE + 44;  // resize icon to the right
 
static const SpriteID SPR_WINDOW_RESIZE_LEFT = SPR_OPENTTD_BASE + 149; // resize icon to the left
 
@@ -113,12 +113,20 @@ static const SpriteID SPR_SELL_ALL_AIRCR
 
static const SpriteID SPR_REPLACE_TRAIN     = SPR_OPENTTD_BASE + 101;
 
static const SpriteID SPR_REPLACE_ROADVEH   = SPR_OPENTTD_BASE + 102;
 
static const SpriteID SPR_REPLACE_SHIP      = SPR_OPENTTD_BASE + 103;
 
static const SpriteID SPR_REPLACE_AIRCRAFT  = SPR_OPENTTD_BASE + 104;
 
static const SpriteID SPR_SELL_CHAIN_TRAIN  = SPR_OPENTTD_BASE + 105;
 

	
 
static const SpriteID SPR_PROFIT_NA         = SPR_OPENTTD_BASE + 154;
 
static const SpriteID SPR_PROFIT_NEGATIVE   = SPR_OPENTTD_BASE + 155;
 
static const SpriteID SPR_PROFIT_SOME       = SPR_OPENTTD_BASE + 156;
 
static const SpriteID SPR_PROFIT_LOT        = SPR_OPENTTD_BASE + 157;
 

	
 
static const SpriteID SPR_UNREAD_NEWS                = SPR_OPENTTD_BASE + 158;
 
static const SpriteID SPR_EXCLUSIVE_TRANSPORT        = SPR_OPENTTD_BASE + 159;
 

	
 
static const SpriteID SPR_GROUP_CREATE_TRAIN         = SPR_OPENTTD_BASE + 114;
 
static const SpriteID SPR_GROUP_CREATE_ROADVEH       = SPR_OPENTTD_BASE + 115;
 
static const SpriteID SPR_GROUP_CREATE_SHIP          = SPR_OPENTTD_BASE + 116;
 
static const SpriteID SPR_GROUP_CREATE_AIRCRAFT      = SPR_OPENTTD_BASE + 117;
 
static const SpriteID SPR_GROUP_DELETE_TRAIN         = SPR_OPENTTD_BASE + 118;
 
static const SpriteID SPR_GROUP_DELETE_ROADVEH       = SPR_OPENTTD_BASE + 119;
src/town_gui.cpp
Show inline comments
 
@@ -31,12 +31,13 @@
 
#include "querystring_gui.h"
 
#include "window_func.h"
 
#include "townname_func.h"
 
#include "townname_type.h"
 
#include "core/geometry_func.hpp"
 
#include "genworld.h"
 
#include "sprite.h"
 

	
 
#include "table/sprites.h"
 
#include "table/strings.h"
 

	
 
typedef GUIList<const Town*> GUITownList;
 

	
 
@@ -136,15 +137,15 @@ public:
 
		y += FONT_HEIGHT_NORMAL;
 

	
 
		Dimension icon_size = GetSpriteSize(SPR_COMPANY_ICON);
 
		int icon_width      = icon_size.width;
 
		int icon_y_offset   = (FONT_HEIGHT_NORMAL - icon_size.height) / 2;
 

	
 
		Dimension exclusive_size = GetSpriteSize(SPR_BLOT);
 
		Dimension exclusive_size = GetSpriteSize(SPR_EXCLUSIVE_TRANSPORT);
 
		int exclusive_width      = exclusive_size.width;
 
		int exlusive_y_offset    = (FONT_HEIGHT_NORMAL - exclusive_size.height) / 2;
 
		int exclusive_y_offset   = (FONT_HEIGHT_NORMAL - exclusive_size.height) / 2;
 

	
 
		bool rtl = _dynlang.text_dir == TD_RTL;
 
		uint text_left      = left  + (rtl ? 0 : icon_width + exclusive_width + 4);
 
		uint text_right     = right - (rtl ? icon_width + exclusive_width + 4 : 0);
 
		uint icon_left      = rtl ? right - icon_width : left;
 
		uint exclusive_left = rtl ? right - icon_width - exclusive_width - 2 : left + icon_width + 2;
 
@@ -168,13 +169,13 @@ public:
 
				(str++,                    r <= RATING_VERYGOOD)  || // Very Good
 
				(str++,                    r <= RATING_EXCELLENT) || // Excellent
 
				(str++,                    true);                    // Outstanding
 

	
 
				SetDParam(2, str);
 
				if (this->town->exclusivity == c->index) {
 
					DrawSprite(SPR_BLOT, PALETTE_TO_RED, exclusive_left, y + exlusive_y_offset);
 
					DrawSprite(SPR_EXCLUSIVE_TRANSPORT, COMPANY_SPRITE_COLOUR(c->index), exclusive_left, y + exclusive_y_offset);
 
				}
 

	
 
				DrawString(text_left, text_right, y, STR_LOCAL_AUTHORITY_COMPANY_RATING);
 
				y += FONT_HEIGHT_NORMAL;
 
			}
 
		}
src/vehicle_gui.cpp
Show inline comments
 
@@ -187,25 +187,25 @@ void DepotSortList(VehicleList *list)
 
	QSortT(list->Begin(), list->Length(), &VehicleNumberSorter);
 
}
 

	
 
/** draw the vehicle profit button in the vehicle list window. */
 
static void DrawVehicleProfitButton(const Vehicle *v, int x, int y)
 
{
 
	PaletteID pal;
 
	SpriteID spr;
 

	
 
	/* draw profit-based coloured icons */
 
	if (v->age <= DAYS_IN_YEAR * 2) {
 
		pal = PALETTE_TO_GREY;
 
		spr = SPR_PROFIT_NA;
 
	} else if (v->GetDisplayProfitLastYear() < 0) {
 
		pal = PALETTE_TO_RED;
 
		spr = SPR_PROFIT_NEGATIVE;
 
	} else if (v->GetDisplayProfitLastYear() < 10000) {
 
		pal = PALETTE_TO_YELLOW;
 
		spr = SPR_PROFIT_SOME;
 
	} else {
 
		pal = PALETTE_TO_GREEN;
 
		spr = SPR_PROFIT_LOT;
 
	}
 
	DrawSprite(SPR_BLOT, pal, x, y);
 
	DrawSprite(spr, PAL_NONE, x, y);
 
}
 

	
 
/** Maximum number of refit cycles we try, to prevent infinite loops. And we store only a byte anyway */
 
static const uint MAX_REFIT_CYCLE = 256;
 

	
 
/**
 
@@ -1020,13 +1020,13 @@ void BaseVehicleListWindow::DrawVehicleL
 
	int orderlist_left  = left  + (rtl ? 0 : max(100 + text_offset, width / 2));
 
	int orderlist_right = right - (rtl ? max(100 + text_offset, width / 2) : 0);
 

	
 
	int image_left  = (rtl && show_orderlist) ? orderlist_right : text_left;
 
	int image_right = (!rtl && show_orderlist) ? orderlist_left : text_right;
 

	
 
	int vehicle_button_x = rtl ? right - GetSpriteSize(SPR_BLOT).width : left;
 
	int vehicle_button_x = rtl ? right - GetSpriteSize(SPR_PROFIT_LOT).width : left;
 

	
 
	int y = r.top;
 
	uint max = min(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->vehicles.Length());
 
	for (uint i = this->vscroll->GetPosition(); i < max; ++i) {
 
		const Vehicle *v = this->vehicles[i];
 
		StringID str;
0 comments (0 inline, 0 general)