summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-05-01 08:48:07 +0000
committeralberth <alberth@openttd.org>2009-05-01 08:48:07 +0000
commitb1de51b8d648787400c9189241f84bc3d57f01ec (patch)
tree9822c1eefb2d4de6fb7ec9bd82ab4f27dac92497
parent9dd72dfaa39c4e9badfcaf02bd2255e62bfe0718 (diff)
downloadopenttd-b1de51b8d648787400c9189241f84bc3d57f01ec.tar.xz
(svn r16192) -Codechange: Moving smallmap and extra viewport widget enums out of the window structs, completing smallmap enum.
-rw-r--r--src/smallmap_gui.cpp111
1 files changed, 58 insertions, 53 deletions
diff --git a/src/smallmap_gui.cpp b/src/smallmap_gui.cpp
index aa640ab01..44620c582 100644
--- a/src/smallmap_gui.cpp
+++ b/src/smallmap_gui.cpp
@@ -24,26 +24,49 @@
#include "table/strings.h"
#include "table/sprites.h"
+/** Widget numbers of the small map window. */
+enum SmallMapWindowWidgets {
+ SM_WIDGET_CLOSEBOX,
+ SM_WIDGET_CAPTION,
+ SM_WIDGET_STICKYBOX,
+ SM_WIDGET_MAP_BORDER,
+ SM_WIDGET_MAP,
+ SM_WIDGET_LEGEND,
+ SM_WIDGET_BUTTONSPANEL,
+ SM_WIDGET_CONTOUR,
+ SM_WIDGET_VEHICLES,
+ SM_WIDGET_INDUSTRIES,
+ SM_WIDGET_ROUTES,
+ SM_WIDGET_VEGETATION,
+ SM_WIDGET_OWNERS,
+ SM_WIDGET_CENTERMAP,
+ SM_WIDGET_TOGGLETOWNNAME,
+ SM_WIDGET_BOTTOMPANEL,
+ SM_WIDGET_ENABLEINDUSTRIES,
+ SM_WIDGET_DISABLEINDUSTRIES,
+ SM_WIDGET_RESIZEBOX,
+};
+
static const Widget _smallmap_widgets[] = {
-{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_BROWN, 0, 10, 0, 13, STR_BLACK_CROSS, STR_TOOLTIP_CLOSE_WINDOW},
-{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_BROWN, 11, 337, 0, 13, STR_SMALLMAP_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS},
-{ WWT_STICKYBOX, RESIZE_LR, COLOUR_BROWN, 338, 349, 0, 13, 0x0, STR_STICKY_BUTTON},
-{ WWT_PANEL, RESIZE_RB, COLOUR_BROWN, 0, 349, 14, 157, 0x0, STR_NULL},
-{ WWT_INSET, RESIZE_RB, COLOUR_BROWN, 2, 347, 16, 155, 0x0, STR_NULL},
-{ WWT_PANEL, RESIZE_RTB, COLOUR_BROWN, 0, 261, 158, 201, 0x0, STR_NULL},
-{ WWT_PANEL, RESIZE_LRTB, COLOUR_BROWN, 262, 349, 158, 158, 0x0, STR_NULL},
-{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 284, 305, 158, 179, SPR_IMG_SHOW_COUNTOURS, STR_SMALLMAP_TOOLTIP_SHOW_LAND_CONTOURS_ON_MAP},
-{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 306, 327, 158, 179, SPR_IMG_SHOW_VEHICLES, STR_SMALLMAP_TOOLTIP_SHOW_VEHICLES_ON_MAP},
-{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 328, 349, 158, 179, SPR_IMG_INDUSTRY, STR_SMALLMAP_TOOLTIP_SHOW_INDUSTRIES_ON_MAP},
-{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 284, 305, 180, 201, SPR_IMG_SHOW_ROUTES, STR_SMALLMAP_TOOLTIP_SHOW_TRANSPORT_ROUTES_ON},
-{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 306, 327, 180, 201, SPR_IMG_PLANTTREES, STR_SMALLMAP_TOOLTIP_SHOW_VEGETATION_ON_MAP},
-{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 328, 349, 180, 201, SPR_IMG_COMPANY_GENERAL, STR_SMALLMAP_TOOLTIP_SHOW_LAND_OWNERS_ON_MAP},
-{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 262, 283, 158, 179, SPR_IMG_SMALLMAP, STR_SMALLMAP_CENTER},
-{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 262, 283, 180, 201, SPR_IMG_TOWN, STR_SMALLMAP_TOOLTIP_TOGGLE_TOWN_NAMES_ON_OFF},
-{ WWT_PANEL, RESIZE_RTB, COLOUR_BROWN, 0, 337, 202, 213, 0x0, STR_NULL},
-{ WWT_TEXTBTN, RESIZE_TB, COLOUR_BROWN, 0, 99, 202, 213, STR_MESSAGES_ENABLE_ALL, STR_NULL},
-{ WWT_TEXTBTN, RESIZE_TB, COLOUR_BROWN, 100, 201, 202, 213, STR_MESSAGES_DISABLE_ALL, STR_NULL},
-{ WWT_RESIZEBOX, RESIZE_LRTB, COLOUR_BROWN, 338, 349, 202, 213, 0x0, STR_RESIZE_BUTTON},
+{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_BROWN, 0, 10, 0, 13, STR_BLACK_CROSS, STR_TOOLTIP_CLOSE_WINDOW}, // SM_WIDGET_CLOSEBOX
+{ WWT_CAPTION, RESIZE_RIGHT, COLOUR_BROWN, 11, 337, 0, 13, STR_SMALLMAP_CAPTION, STR_TOOLTIP_WINDOW_TITLE_DRAG_THIS}, // SM_WIDGET_CAPTION
+{ WWT_STICKYBOX, RESIZE_LR, COLOUR_BROWN, 338, 349, 0, 13, 0x0, STR_STICKY_BUTTON}, // SM_WIDGET_STICKYBOX
+{ WWT_PANEL, RESIZE_RB, COLOUR_BROWN, 0, 349, 14, 157, 0x0, STR_NULL}, // SM_WIDGET_MAP_BORDER
+{ WWT_INSET, RESIZE_RB, COLOUR_BROWN, 2, 347, 16, 155, 0x0, STR_NULL}, // SM_WIDGET_MAP
+{ WWT_PANEL, RESIZE_RTB, COLOUR_BROWN, 0, 261, 158, 201, 0x0, STR_NULL}, // SM_WIDGET_LEGEND
+{ WWT_PANEL, RESIZE_LRTB, COLOUR_BROWN, 262, 349, 158, 158, 0x0, STR_NULL}, // SM_WIDGET_BUTTONSPANEL
+{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 284, 305, 158, 179, SPR_IMG_SHOW_COUNTOURS, STR_SMALLMAP_TOOLTIP_SHOW_LAND_CONTOURS_ON_MAP}, // SM_WIDGET_CONTOUR
+{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 306, 327, 158, 179, SPR_IMG_SHOW_VEHICLES, STR_SMALLMAP_TOOLTIP_SHOW_VEHICLES_ON_MAP}, // SM_WIDGET_VEHICLES
+{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 328, 349, 158, 179, SPR_IMG_INDUSTRY, STR_SMALLMAP_TOOLTIP_SHOW_INDUSTRIES_ON_MAP}, // SM_WIDGET_INDUSTRIES
+{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 284, 305, 180, 201, SPR_IMG_SHOW_ROUTES, STR_SMALLMAP_TOOLTIP_SHOW_TRANSPORT_ROUTES_ON}, // SM_WIDGET_ROUTES
+{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 306, 327, 180, 201, SPR_IMG_PLANTTREES, STR_SMALLMAP_TOOLTIP_SHOW_VEGETATION_ON_MAP}, // SM_WIDGET_VEGETATION
+{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 328, 349, 180, 201, SPR_IMG_COMPANY_GENERAL, STR_SMALLMAP_TOOLTIP_SHOW_LAND_OWNERS_ON_MAP}, // SM_WIDGET_OWNERS
+{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 262, 283, 158, 179, SPR_IMG_SMALLMAP, STR_SMALLMAP_CENTER}, // SM_WIDGET_CENTERMAP
+{ WWT_IMGBTN, RESIZE_LRTB, COLOUR_BROWN, 262, 283, 180, 201, SPR_IMG_TOWN, STR_SMALLMAP_TOOLTIP_TOGGLE_TOWN_NAMES_ON_OFF}, // SM_WIDGET_TOGGLETOWNNAME
+{ WWT_PANEL, RESIZE_RTB, COLOUR_BROWN, 0, 337, 202, 213, 0x0, STR_NULL}, // SM_WIDGET_BOTTOMPANEL
+{ WWT_TEXTBTN, RESIZE_TB, COLOUR_BROWN, 0, 99, 202, 213, STR_MESSAGES_ENABLE_ALL, STR_NULL}, // SM_WIDGET_ENABLEINDUSTRIES
+{ WWT_TEXTBTN, RESIZE_TB, COLOUR_BROWN, 100, 201, 202, 213, STR_MESSAGES_DISABLE_ALL, STR_NULL}, // SM_WIDGET_DISABLEINDUSTRIES
+{ WWT_RESIZEBOX, RESIZE_LRTB, COLOUR_BROWN, 338, 349, 202, 213, 0x0, STR_RESIZE_BUTTON}, // SM_WIDGET_RESIZEBOX
{ WIDGETS_END},
};
@@ -516,25 +539,6 @@ static void DrawHorizMapIndicator(int x, int y, int x2, int y2)
GfxFillRect(x2 - 3, y, x2, y2, 69);
}
-enum SmallMapWindowWidgets {
- SM_WIDGET_MAP_BORDER = 3,
- SM_WIDGET_MAP,
- SM_WIDGET_LEGEND,
- SM_WIDGET_BUTTONSPANEL,
- SM_WIDGET_CONTOUR,
- SM_WIDGET_VEHICLES,
- SM_WIDGET_INDUSTRIES,
- SM_WIDGET_ROUTES,
- SM_WIDGET_VEGETATION,
- SM_WIDGET_OWNERS,
- SM_WIDGET_CENTERMAP,
- SM_WIDGET_TOGGLETOWNNAME,
- SM_WIDGET_BOTTOMPANEL,
- SM_WIDGET_ENABLEINDUSTRIES,
- SM_WIDGET_DISABLEINDUSTRIES,
- SM_WIDGET_RESIZEBOX,
-};
-
class SmallMapWindow : public Window
{
enum SmallMapType {
@@ -1067,6 +1071,22 @@ void ShowSmallMap()
AllocateWindowDescFront<SmallMapWindow>(&_smallmap_desc, 0);
}
+/** Widget numbers of the extra viewport window. */
+enum ExtraViewportWindowWidgets {
+ EVW_CLOSE,
+ EVW_CAPTION,
+ EVW_STICKY,
+ EVW_BACKGROUND,
+ EVW_VIEWPORT,
+ EVW_ZOOMIN,
+ EVW_ZOOMOUT,
+ EVW_MAIN_TO_VIEW,
+ EVW_VIEW_TO_MAIN,
+ EVW_SPACER1,
+ EVW_SPACER2,
+ EVW_RESIZE,
+};
+
/* Extra ViewPort Window Stuff */
static const Widget _extra_view_port_widgets[] = {
{ WWT_CLOSEBOX, RESIZE_NONE, COLOUR_GREY, 0, 10, 0, 13, STR_BLACK_CROSS, STR_TOOLTIP_CLOSE_WINDOW},
@@ -1086,21 +1106,6 @@ static const Widget _extra_view_port_widgets[] = {
class ExtraViewportWindow : public Window
{
- enum ExtraViewportWindowWidgets {
- EVW_CLOSE,
- EVW_CAPTION,
- EVW_STICKY,
- EVW_BACKGROUND,
- EVW_VIEWPORT,
- EVW_ZOOMIN,
- EVW_ZOOMOUT,
- EVW_MAIN_TO_VIEW,
- EVW_VIEW_TO_MAIN,
- EVW_SPACER1,
- EVW_SPACER2,
- EVW_RESIZE,
- };
-
public:
ExtraViewportWindow(const WindowDesc *desc, int window_number, TileIndex tile) : Window(desc, window_number)
{