src/dock_gui.cpp
branchcpp_gui
changeset 6298 c30fe89622df
parent 6268 4b5241e5dd10
child 6303 84c215fc8eb8
equal deleted inserted replaced
6297:4bf29d14edba 6298:c30fe89622df
    15 #include "gfx.h"
    15 #include "gfx.h"
    16 #include "sound.h"
    16 #include "sound.h"
    17 #include "command.h"
    17 #include "command.h"
    18 #include "variables.h"
    18 #include "variables.h"
    19 
    19 
    20 static void ShowBuildDockStationPicker(void);
    20 static void ShowBuildDockStationPicker();
    21 static void ShowBuildDocksDepotPicker(void);
    21 static void ShowBuildDocksDepotPicker();
    22 
    22 
    23 static Axis _ship_depot_direction;
    23 static Axis _ship_depot_direction;
    24 
    24 
    25 void CcBuildDocks(bool success, TileIndex tile, uint32 p1, uint32 p2)
    25 void CcBuildDocks(bool success, TileIndex tile, uint32 p1, uint32 p2)
    26 {
    26 {
   214 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
   214 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_STICKY_BUTTON,
   215 	_build_docks_toolb_widgets,
   215 	_build_docks_toolb_widgets,
   216 	BuildDocksToolbWndProc
   216 	BuildDocksToolbWndProc
   217 };
   217 };
   218 
   218 
   219 void ShowBuildDocksToolbar(void)
   219 void ShowBuildDocksToolbar()
   220 {
   220 {
   221 	if (!IsValidPlayer(_current_player)) return;
   221 	if (!IsValidPlayer(_current_player)) return;
   222 
   222 
   223 	DeleteWindowById(WC_BUILD_TOOLBAR, 0);
   223 	DeleteWindowById(WC_BUILD_TOOLBAR, 0);
   224 	BaseWindow *w = BaseWindow::Allocate(&_build_docks_toolbar_desc);
   224 	BaseWindow *w = BaseWindow::Allocate(&_build_docks_toolbar_desc);
   288 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
   288 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
   289 	_build_dock_station_widgets,
   289 	_build_dock_station_widgets,
   290 	BuildDockStationWndProc
   290 	BuildDockStationWndProc
   291 };
   291 };
   292 
   292 
   293 static void ShowBuildDockStationPicker(void)
   293 static void ShowBuildDockStationPicker()
   294 {
   294 {
   295 	BaseWindow::Allocate(&_build_dock_station_desc);
   295 	BaseWindow::Allocate(&_build_dock_station_desc);
   296 }
   296 }
   297 
   297 
   298 static void UpdateDocksDirection(void)
   298 static void UpdateDocksDirection()
   299 {
   299 {
   300 	if (_ship_depot_direction != AXIS_X) {
   300 	if (_ship_depot_direction != AXIS_X) {
   301 		SetTileSelectSize(1, 2);
   301 		SetTileSelectSize(1, 2);
   302 	} else {
   302 	} else {
   303 		SetTileSelectSize(2, 1);
   303 		SetTileSelectSize(2, 1);
   358 	_build_docks_depot_widgets,
   358 	_build_docks_depot_widgets,
   359 	BuildDocksDepotWndProc
   359 	BuildDocksDepotWndProc
   360 };
   360 };
   361 
   361 
   362 
   362 
   363 static void ShowBuildDocksDepotPicker(void)
   363 static void ShowBuildDocksDepotPicker()
   364 {
   364 {
   365 	BaseWindow::Allocate(&_build_docks_depot_desc);
   365 	BaseWindow::Allocate(&_build_docks_depot_desc);
   366 	UpdateDocksDirection();
   366 	UpdateDocksDirection();
   367 }
   367 }
   368 
   368 
   369 
   369 
   370 void InitializeDockGui(void)
   370 void InitializeDockGui()
   371 {
   371 {
   372 	_ship_depot_direction = AXIS_X;
   372 	_ship_depot_direction = AXIS_X;
   373 }
   373 }