From 46acb837eb98d5bd6ab6a73e2923db66f204dbad Mon Sep 17 00:00:00 2001 From: frosch Date: Thu, 2 Sep 2010 20:00:48 +0000 Subject: [PATCH] (svn r20720) -Add: separate GUI icons for vehicle/company profit, exclusive rights and unread news. --- bin/data/openttd.grf | Bin 520301 -> 520722 bytes bin/data/orig_dos.obg | 2 +- bin/data/orig_dos_de.obg | 2 +- bin/data/orig_win.obg | 2 +- media/extra_grf/openttdgui.nfo | 8 +++++++- media/extra_grf/openttdgui.pcx | Bin 67854 -> 68381 bytes src/network/network_gui.cpp | 4 ++-- src/statusbar_gui.cpp | 4 ++-- src/table/sprites.h | 12 ++++++++++-- src/town_gui.cpp | 7 ++++--- src/vehicle_gui.cpp | 14 +++++++------- 11 files changed, 35 insertions(+), 20 deletions(-) diff --git a/bin/data/openttd.grf b/bin/data/openttd.grf index 3c616164a8363d6659e0a600d414b8f4b14df8da..50a2670aabf0e5c55b6eee107822c7e4f702d956 100644 GIT binary patch delta 473 zcmaF+Kz`B_c@`Fi|F;`iT3HxdS(sW`m|Iy`wz9A$++jU-!7FcyI*}i=n zNaxnATepIBZUO7u_JE&p^9x0$ty|D^)*~!+c5-qAX?1XLZ~$wy2WxeFz|Uy+LXpYA z9!)Dk=lOHzLP0u1LPA2oI)lMFLm%)n2E9;Z3JC`3j9_5of_Rjbfq|8k^#wD?!}WZ8 ze0&#pnOXT*FYrC!U}9vvz|kRaLywX1gvJXu7Epk^aGTD+$;HdS!0_+Cz6gU9gF1r+ zgF8bQLo!1FLp4Ji10y4ABR4BE1EUKoBO7Zo7pn^^3j?E*3oA403vT8XPSzLPjJ+=e zUkE*5dBAalpV8?B^9?p;)^5fJaxXL#Pw+CHJ;BR!mbH_K@ywaCXV0EF^MITAmqc@`Fi|5qDXT3HxdS(sW`m|Iy`wz9A$++>`!J@qE*?n&)ObJ?~Z&1Ls( F0RXq@5^4Yd diff --git a/bin/data/orig_dos.obg b/bin/data/orig_dos.obg index ec588fa9d7..496e244afd 100644 --- a/bin/data/orig_dos.obg +++ b/bin/data/orig_dos.obg @@ -55,7 +55,7 @@ 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. diff --git a/bin/data/orig_dos_de.obg b/bin/data/orig_dos_de.obg index d0f5d2d5aa..2f739af1fd 100644 --- a/bin/data/orig_dos_de.obg +++ b/bin/data/orig_dos_de.obg @@ -55,7 +55,7 @@ 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. diff --git a/bin/data/orig_win.obg b/bin/data/orig_win.obg index 3e1cb5ed04..d06519e7d5 100644 --- a/bin/data/orig_win.obg +++ b/bin/data/orig_win.obg @@ -55,7 +55,7 @@ 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. diff --git a/media/extra_grf/openttdgui.nfo b/media/extra_grf/openttdgui.nfo index a61f77eac9..f7236fad5f 100644 --- a/media/extra_grf/openttdgui.nfo +++ b/media/extra_grf/openttdgui.nfo @@ -13,7 +13,7 @@ // -- 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 @@ -168,6 +168,12 @@ -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 diff --git a/media/extra_grf/openttdgui.pcx b/media/extra_grf/openttdgui.pcx index 2273bea367d60cec2d641418c7507cf0f4c11c8e..b9680fada2ba18dfd1f3d9aae4e48a4a96ad9494 100644 GIT binary patch delta 711 zcmeC1#4>jpOT!jMerDZc{|_-7xqgTNAAKzA*nftslMGqY8<`nJ8Bb1EV`fzJJocaA z;Pr!F4{0bKyv_jTEIG7&8;tFI$jK4LK6w7nxll0Y5W~UiNBFXi{Xcl!CF?K)2)SfU zY!qQUIX#Yh!&17a&bOITmaYP{tr1aqR?MJq5fv}v8IM_p2AcKM-%p-hI!wxyQWWg}RVHcSh z)vZY~jPKBOm~p3_px)zWVN`YonWA`DAu9r6>9)gLw`_(m9S=L$+d-J2heLvcAWW#M z7!F=Pp#UJPJHn7}b2hp{{TUWF902wjKf*2w^)M0+|S5ha3VK$pEq+?l@5F zodp|v$m!r&h{1s;|6lokh~dojBma*x9RGhDlq{|@9K6nO==w2&2?ZRr2d`&=R35y3 z=*;1>ht6b8H)LWIlK~lfgyGcn|No!<2P=alxP#Y^pM&W#ikb=Vu g$EVjbGm5i=Bu_9Ln{LR$C_cI2FUxjuR>tql0BTm0p#T5? delta 169 zcmbO`jiqlAOT!jMe&*?i*ce5W{{Mgc|HyxagV&ETocw=^;mGwP|Bqik{{Q&(WB(5^ z9K6nO@cMK^CPoRy$I~w|Gpc~~F#rGmc)B+WqvFIyF~-N!53?|;Pd8>_1hK7H8I>WT z+gKUZV4`+xjFJ-@#W)`Szw-YG!>Q|&1BE3xPW`{~{}{sw1m^_9F)(Ml3OnOZW&jd! BOO*fs diff --git a/src/network/network_gui.cpp b/src/network/network_gui.cpp index 1d57179c68..70f21a682c 100644 --- a/src/network/network_gui.cpp +++ b/src/network/network_gui.cpp @@ -1551,7 +1551,7 @@ struct NetworkLobbyWindow : public Window { 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; @@ -1575,7 +1575,7 @@ struct NetworkLobbyWindow : public Window { /* 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; diff --git a/src/statusbar_gui.cpp b/src/statusbar_gui.cpp index 7c4849fafa..7f9afe8fa8 100644 --- a/src/statusbar_gui.cpp +++ b/src/statusbar_gui.cpp @@ -181,8 +181,8 @@ struct StatusBarWindow : Window { } 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; } diff --git a/src/table/sprites.h b/src/table/sprites.h index 385649827a..5e84181805 100644 --- a/src/table/sprites.h +++ b/src/table/sprites.h @@ -56,7 +56,7 @@ 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; @@ -64,7 +64,7 @@ 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; @@ -116,6 +116,14 @@ 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; diff --git a/src/town_gui.cpp b/src/town_gui.cpp index ff78ff3e38..5978d2bbe0 100644 --- a/src/town_gui.cpp +++ b/src/town_gui.cpp @@ -34,6 +34,7 @@ #include "townname_type.h" #include "core/geometry_func.hpp" #include "genworld.h" +#include "sprite.h" #include "table/sprites.h" #include "table/strings.h" @@ -139,9 +140,9 @@ public: 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); @@ -171,7 +172,7 @@ public: 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); diff --git a/src/vehicle_gui.cpp b/src/vehicle_gui.cpp index 223100d494..ab71d06c76 100644 --- a/src/vehicle_gui.cpp +++ b/src/vehicle_gui.cpp @@ -190,19 +190,19 @@ void DepotSortList(VehicleList *list) /** 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 */ @@ -1023,7 +1023,7 @@ void BaseVehicleListWindow::DrawVehicleListItems(VehicleID selected_vehicle, int 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());