diff options
author | bjarni <bjarni@openttd.org> | 2006-09-30 21:23:34 +0000 |
---|---|---|
committer | bjarni <bjarni@openttd.org> | 2006-09-30 21:23:34 +0000 |
commit | 37ddda749a750a3b98b08a7374b852ee19957946 (patch) | |
tree | 63985341d352d7f2da3fdfac06b503fc31be21b2 | |
parent | b312ea6239ca75bbd684df468cd47d98bef9948b (diff) | |
download | openttd-37ddda749a750a3b98b08a7374b852ee19957946.tar.xz |
(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
-rw-r--r-- | data/openttd.grf | bin | 25704 -> 28153 bytes | |||
-rw-r--r-- | depot_gui.c | 28 | ||||
-rw-r--r-- | gfxinit.c | 3 | ||||
-rw-r--r-- | table/sprites.h | 16 |
4 files changed, 43 insertions, 4 deletions
diff --git a/data/openttd.grf b/data/openttd.grf Binary files differindex 6204dd1b0..5674a4b38 100644 --- a/data/openttd.grf +++ b/data/openttd.grf diff --git a/depot_gui.c b/depot_gui.c index a302c6f6a..f2f2e205e 100644 --- a/depot_gui.c +++ b/depot_gui.c @@ -86,8 +86,8 @@ static const Widget _depot_widgets[] = { { 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 @@ static void DepotWndProc(Window *w, WindowEvent *e) } } +/* 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 @@ static void SetupStringsForDepotWindow(Window *w, byte type) 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 @@ static void SetupStringsForDepotWindow(Window *w, byte type) 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 @@ static void SetupStringsForDepotWindow(Window *w, byte type) 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 @@ static void SetupStringsForDepotWindow(Window *w, byte type) 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; } } @@ -265,7 +265,7 @@ static const SpriteID trg1idx[] = { * 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 @@ static const SpriteID _openttd_grf_indexes[] = { 594, 597, // ° ± ² ³ large 633, 633, // × large 665, 665, // ÷ large + SPR_SELL_TRAIN, SPR_SELL_CHAIN_TRAIN, END }; diff --git a/table/sprites.h b/table/sprites.h index 6aa982f37..67e31cecb 100644 --- a/table/sprites.h +++ b/table/sprites.h @@ -75,12 +75,26 @@ enum Sprites { 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, |