Index: source.list =================================================================== --- source.list (revision 10995) +++ source.list (working copy) @@ -211,6 +211,7 @@ depot_gui.cpp dock_gui.cpp engine_gui.cpp +fast_main_gui.cpp genworld_gui.cpp graph_gui.cpp group_gui.cpp Index: src/fast_main_gui.cpp =================================================================== --- src/fast_main_gui.cpp (revision 0) +++ src/fast_main_gui.cpp (revision 0) @@ -0,0 +1,81 @@ +/* $Id:$ */ + +/** @file fast_main_gui.cpp */ + +#include "stdafx.h" +#include "openttd.h" +#include "table/sprites.h" +#include "table/strings.h" +#include "functions.h" +#include "window.h" +#include "gui.h" +#include "viewport.h" +#include "gfx.h" +#include "sound.h" +#include "variables.h" + +enum FastMainGuiWidgets{ + FMGW_WIDGET_RAIL = 1, ///< railroad construction widget + FMGW_WIDGET_ROAD, ///< road construction widget + FMGW_WIDGET_TOPRIGHT, ///< blank widget + FMGW_WIDGET_WATER, ///< water contruction widget + FMGW_WIDGET_AIR, ///< airport construction widget + FMGW_WIDGET_BOTTOMLEFT, ///< blank widget + FMGW_WIDGET_HELP, ///< query tool + FMGW_WIDGET_BOTTOMRIGHT, ///< blank widget +}; + +static void FastMenuWndProc(Window *w, WindowEvent *e) +{ + switch (e->event) { + case WE_CREATE: { + } break; + + case WE_PAINT: { + DrawWindowWidgets(w); + } break; + + case WE_DESTROY: { + Window *v = FindWindowById(WC_FAST_MAIN_GUI_TOOLBAR, 0); + //RaiseWindowWidget(v, WP(w,menu_d).main_button); + SetWindowDirty(v); + return; + } + + case WE_CLICK: { + if (e->we.click.widget >= FMGW_WIDGET_RAIL) { + + } + } + } +} + +static const Widget _fast_main_gui_widgets[] = { +{ WWT_TRANSPARENT,RESIZE_NONE, 0, 0, 75, 0, 77, 0x0, STR_NULL}, //clicking on the transparent area will close the gui + +{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 0, 22, SPR_IMG_BUILDRAIL, STR_TRANSPARENT_SIGNS_DESC}, +{ WWT_IMGBTN, RESIZE_NONE, 7, 27, 48, 0, 22, SPR_IMG_BUILDROAD, STR_TRANSPARENT_TREES_DESC}, +{ WWT_PANEL, RESIZE_NONE, 7, 54, 75, 0, 22, 0x0, STR_NULL}, + +{ WWT_IMGBTN, RESIZE_NONE, 7, 0, 21, 28, 50, SPR_IMG_BUILDWATER, STR_TRANSPARENT_HOUSES_DESC}, +/* nothing here, transparent area */ +{ WWT_IMGBTN, RESIZE_NONE, 7, 54, 75, 28, 50, SPR_IMG_BUILDAIR, STR_TRANSPARENT_INDUSTRIES_DESC}, + +{ WWT_PANEL, RESIZE_NONE, 7, 0, 21, 55, 77, 0x0, STR_NULL}, +{ WWT_IMGBTN, RESIZE_NONE, 7, 27, 48, 55, 77, SPR_IMG_QUERY, STR_TRANSPARENT_BUILDINGS_DESC}, +{ WWT_PANEL, RESIZE_NONE, 7, 54, 75, 55, 77, 0x0, STR_NULL}, +{ WIDGETS_END}, +}; + +static const WindowDesc _fast_main_gui_desc = { + WDP_CENTER, WDP_CENTER, 76, 78, 76, 78, //i want it at the mouse coords, but seems to be impossible with _cursor.pos.x/y, so center on the screen + WC_FAST_MAIN_GUI_TOOLBAR, WC_NONE, + WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON, + _fast_main_gui_widgets, + FastMenuWndProc +}; + +void ShowFastMainGui(void) +{ + AllocateWindowDescFront(&_fast_main_gui_desc, 0); +} Index: src/gui.h =================================================================== --- src/gui.h (revision 10995) +++ src/gui.h (working copy) @@ -15,6 +15,9 @@ void CcBuildCanal(bool success, TileIndex tile, uint32 p1, uint32 p2); void CcTerraform(bool success, TileIndex tile, uint32 p1, uint32 p2); +/* fast main gui */ +void ShowFastMainGui(); + /* settings_gui.cpp */ void ShowGameOptions(); void ShowGameDifficulty(); Index: src/main_gui.cpp =================================================================== --- src/main_gui.cpp (revision 10995) +++ src/main_gui.cpp (working copy) @@ -2262,6 +2262,8 @@ ToggleTransparency(); break; + case WKC_CTRL | 'F': ShowFastMainGui(); break; + #ifdef ENABLE_NETWORK case WKC_RETURN: case 'T': // smart chat; send to team if any, otherwise to all if (_networking) { Index: src/openttd.h =================================================================== --- src/openttd.h (revision 10995) +++ src/openttd.h (working copy) @@ -572,6 +572,7 @@ WC_CONFIRM_POPUP_QUERY, WC_TRANSPARENCY_TOOLBAR, WC_VEHICLE_TIMETABLE, + WC_FAST_MAIN_GUI_TOOLBAR, }; Index: src/widget.cpp =================================================================== --- src/widget.cpp (revision 10995) +++ src/widget.cpp (working copy) @@ -218,6 +218,12 @@ goto draw_default; } + case WWT_TRANSPARENT: { + assert(wi->data == 0); + //DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, FR_TRANSPARENT); + goto draw_default; + } + case WWT_TEXTBTN: case WWT_TEXTBTN_2: { DrawFrameRect(r.left, r.top, r.right, r.bottom, wi->color, (clicked) ? FR_LOWERED : FR_NONE); Index: src/window.h =================================================================== --- src/window.h (revision 10995) +++ src/window.h (working copy) @@ -533,6 +533,7 @@ WWT_SCROLL2BAR, ///< 2nd vertical scrollbar WWT_RESIZEBOX, WWT_CLOSEBOX, + WWT_TRANSPARENT,///< should be transparent widget WWT_LAST, ///< Last Item. use WIDGETS_END to fill up padding!! WWT_MASK = 0x1F,