(svn r6593) -Fix: [depot window] added sprites to the buttons, that lacked one
authorbjarni
Sat, 30 Sep 2006 21:23:34 +0000
changeset 4688 bdfb36de1cea
parent 4687 917afc747425
child 4689 b4bf1ef178d8
(svn r6593) -Fix: [depot window] added sprites to the buttons, that lacked one
Also changed the sprites on some of the other buttons to make the buttons consistent
Credits for this:
Drawing: skidd13 (first sprite copied/heavily inspired by Bot_40)
Grfencoding: peter1138
Coding to apply the new sprites: peter1138 (modified by me)
Ideas:
Born Acorn
MeusH
ValHallA|SW
XeryusTC
Sorry if I forgot to mention somebody
data/openttd.grf
depot_gui.c
gfxinit.c
table/sprites.h
Binary file data/openttd.grf has changed
--- a/depot_gui.c	Sat Sep 30 21:12:53 2006 +0000
+++ b/depot_gui.c	Sat Sep 30 21:23:34 2006 +0000
@@ -86,8 +86,8 @@
 
 	{ WWT_PUSHIMGBTN,     RESIZE_LR,    14,   270,   280,    14,    25, SPR_FLAG_VEH_STOPPED,STR_NULL},                         // DEPOT_WIDGET_STOP_ALL
 	{ WWT_PUSHIMGBTN,     RESIZE_LR,    14,   281,   292,    14,    25, SPR_FLAG_VEH_RUNNING,STR_NULL},                         // DEPOT_WIDGET_START_ALL
-	{     WWT_IMGBTN,    RESIZE_LRB,    14,   270,   292,    26,    49, 0x2A9,               STR_NULL},                         // DEPOT_WIDGET_SELL
-	{      WWT_PANEL,   RESIZE_LRTB,    14,   326,   348,     0,     0, 0x2BF,               STR_DRAG_WHOLE_TRAIN_TO_SELL_TIP}, // DEPOT_WIDGET_SELL_CHAIN, trains only
+	{     WWT_IMGBTN,    RESIZE_LRB,    14,   270,   292,    26,    49, 0x0,                 STR_NULL},                         // DEPOT_WIDGET_SELL
+	{      WWT_PANEL,   RESIZE_LRTB,    14,   326,   348,     0,     0, SPR_SELL_CHAIN_TRAIN,STR_DRAG_WHOLE_TRAIN_TO_SELL_TIP}, // DEPOT_WIDGET_SELL_CHAIN, trains only
 	{ WWT_PUSHIMGBTN,   RESIZE_LRTB,    14,   270,   292,    50,    72, 0x0,                 STR_NULL},                         // DEPOT_WIDGET_SELL_ALL
 
 	{     WWT_MATRIX,     RESIZE_RB,    14,     0,   269,    14,    83, 0x0,                 STR_NULL},                         // DEPOT_WIDGET_MATRIX
@@ -788,6 +788,10 @@
 	}
 }
 
+/* Function to set up vehicle specific sprites and strings
+ * Only use this if it's the same widget, that's used for more than one vehicle type and it needs different text/sprites
+ * Vehicle specific text/sprites, that's in a widget, that's only shown for one vehicle type (like sell whole train) is set in the widget array
+ */
 static void SetupStringsForDepotWindow(Window *w, byte type)
 {
 	switch (type) {
@@ -808,6 +812,11 @@
 			w->widget[DEPOT_WIDGET_VEHICLE_LIST].data = STR_TRAIN;
 			w->widget[DEPOT_WIDGET_VEHICLE_LIST].tooltips = STR_DEPOT_VEHICLE_ORDER_LIST_TRAIN_TIP;
 			w->widget[DEPOT_WIDGET_AUTOREPLACE].tooltips = STR_DEPOT_AUTOREPLACE_TRAIN_TIP;
+
+			/* Sprites */
+			w->widget[DEPOT_WIDGET_SELL].data        = SPR_SELL_TRAIN;
+			w->widget[DEPOT_WIDGET_SELL_ALL].data    = SPR_SELL_ALL_TRAIN;
+			w->widget[DEPOT_WIDGET_AUTOREPLACE].data = SPR_REPLACE_TRAIN;
 			break;
 
 		case VEH_Road:
@@ -827,6 +836,11 @@
 			w->widget[DEPOT_WIDGET_VEHICLE_LIST].data = STR_LORRY;
 			w->widget[DEPOT_WIDGET_VEHICLE_LIST].tooltips = STR_DEPOT_VEHICLE_ORDER_LIST_ROADVEH_TIP;
 			w->widget[DEPOT_WIDGET_AUTOREPLACE].tooltips = STR_DEPOT_AUTOREPLACE_ROADVEH_TIP;
+
+			/* Sprites */
+			w->widget[DEPOT_WIDGET_SELL].data        = SPR_SELL_ROADVEH;
+			w->widget[DEPOT_WIDGET_SELL_ALL].data    = SPR_SELL_ALL_ROADVEH;
+			w->widget[DEPOT_WIDGET_AUTOREPLACE].data = SPR_REPLACE_ROADVEH;
 			break;
 
 		case VEH_Ship:
@@ -846,6 +860,11 @@
 			w->widget[DEPOT_WIDGET_VEHICLE_LIST].data = STR_SHIP;
 			w->widget[DEPOT_WIDGET_VEHICLE_LIST].tooltips = STR_DEPOT_VEHICLE_ORDER_LIST_SHIP_TIP;
 			w->widget[DEPOT_WIDGET_AUTOREPLACE].tooltips = STR_DEPOT_AUTOREPLACE_SHIP_TIP;
+
+			/* Sprites */
+			w->widget[DEPOT_WIDGET_SELL].data        = SPR_SELL_SHIP;
+			w->widget[DEPOT_WIDGET_SELL_ALL].data    = SPR_SELL_ALL_SHIP;
+			w->widget[DEPOT_WIDGET_AUTOREPLACE].data = SPR_REPLACE_SHIP;
 			break;
 
 		case VEH_Aircraft:
@@ -865,6 +884,11 @@
 			w->widget[DEPOT_WIDGET_VEHICLE_LIST].data = STR_PLANE;
 			w->widget[DEPOT_WIDGET_VEHICLE_LIST].tooltips = STR_DEPOT_VEHICLE_ORDER_LIST_AIRCRAFT_TIP;
 			w->widget[DEPOT_WIDGET_AUTOREPLACE].tooltips = STR_DEPOT_AUTOREPLACE_AIRCRAFT_TIP;
+
+			/* Sprites */
+			w->widget[DEPOT_WIDGET_SELL].data        = SPR_SELL_AIRCRAFT;
+			w->widget[DEPOT_WIDGET_SELL_ALL].data    = SPR_SELL_ALL_AIRCRAFT;
+			w->widget[DEPOT_WIDGET_AUTOREPLACE].data = SPR_REPLACE_AIRCRAFT;
 			break;
 	}
 }
--- a/gfxinit.c	Sat Sep 30 21:12:53 2006 +0000
+++ b/gfxinit.c	Sat Sep 30 21:23:34 2006 +0000
@@ -265,7 +265,7 @@
  * the old sprite-count offset from SPR_OPENTTD_BASE. With this there is no
  * correspondence of any kind with the ID's in the grf file, but results in
  * a maximum use of sprite slots. */
-#define OPENTTD_SPRITES_COUNT 95
+#define OPENTTD_SPRITES_COUNT 109
 static const SpriteID _openttd_grf_indexes[] = {
 	SPR_IMG_AUTORAIL, SPR_CURSOR_WAYPOINT, // icons etc
 	134, 134,  // euro symbol medium size
@@ -309,6 +309,7 @@
 	594, 597, // ° ± ² ³ large
 	633, 633, // × large
 	665, 665, // ÷ large
+	SPR_SELL_TRAIN, SPR_SELL_CHAIN_TRAIN,
 	END
 };
 
--- a/table/sprites.h	Sat Sep 30 21:12:53 2006 +0000
+++ b/table/sprites.h	Sat Sep 30 21:23:34 2006 +0000
@@ -75,12 +75,26 @@
 	SPR_CLONE_SHIP     = SPR_OPENTTD_BASE + 92,
 	SPR_CLONE_TRAIN    = SPR_OPENTTD_BASE + 92,
 
+	SPR_SELL_TRAIN        = SPR_OPENTTD_BASE + 96,
+	SPR_SELL_ROADVEH      = SPR_OPENTTD_BASE + 97,
+	SPR_SELL_SHIP         = SPR_OPENTTD_BASE + 98,
+	SPR_SELL_AIRCRAFT     = SPR_OPENTTD_BASE + 99,
+	SPR_SELL_ALL_TRAIN    = SPR_OPENTTD_BASE + 100,
+	SPR_SELL_ALL_ROADVEH  = SPR_OPENTTD_BASE + 101,
+	SPR_SELL_ALL_SHIP     = SPR_OPENTTD_BASE + 102,
+	SPR_SELL_ALL_AIRCRAFT = SPR_OPENTTD_BASE + 103,
+	SPR_REPLACE_TRAIN     = SPR_OPENTTD_BASE + 104,
+	SPR_REPLACE_ROADVEH   = SPR_OPENTTD_BASE + 105,
+	SPR_REPLACE_SHIP      = SPR_OPENTTD_BASE + 106,
+	SPR_REPLACE_AIRCRAFT  = SPR_OPENTTD_BASE + 107,
+	SPR_SELL_CHAIN_TRAIN  = SPR_OPENTTD_BASE + 108,
+
 	/* Network GUI sprites */
 	SPR_SQUARE = SPR_OPENTTD_BASE + 20,     // colored square (used for newgrf compatibility)
 	SPR_LOCK = SPR_OPENTTD_BASE + 19,       // lock icon (for password protected servers)
 	SPR_FLAGS_BASE = SPR_OPENTTD_BASE + 83, // start of the flags block (in same order as enum NetworkLanguage)
 
-	SPR_AIRPORTX_BASE = SPR_OPENTTD_BASE + 95, // The sprites used for other airport angles
+	SPR_AIRPORTX_BASE = SPR_OPENTTD_BASE + 109, // The sprites used for other airport angles
 	SPR_NEWAIRPORT_TARMAC = SPR_AIRPORTX_BASE,
 	SPR_NSRUNWAY1 = SPR_AIRPORTX_BASE + 1,
 	SPR_NSRUNWAY2 = SPR_AIRPORTX_BASE + 2,