rail_gui.c
changeset 1093 4fdc46eaf423
parent 1074 02884489f8ba
child 1116 242ddc1401b5
equal deleted inserted replaced
1092:e3b4a131db7c 1093:4fdc46eaf423
    24 	bool dragdrop;
    24 	bool dragdrop;
    25 } _railstation;
    25 } _railstation;
    26 
    26 
    27 
    27 
    28 static void HandleStationPlacement(uint start, uint end);
    28 static void HandleStationPlacement(uint start, uint end);
    29 static void ShowBuildTrainDepotPicker();
    29 static void ShowBuildTrainDepotPicker(void);
    30 static void ShowBuildWaypointPicker();
    30 static void ShowBuildWaypointPicker(void);
    31 static void ShowStationBuilder();
    31 static void ShowStationBuilder(void);
    32 
    32 
    33 typedef void OnButtonClick(Window *w);
    33 typedef void OnButtonClick(Window *w);
    34 
    34 
    35 void CcPlaySound1E(bool success, uint tile, uint32 p1, uint32 p2)
    35 void CcPlaySound1E(bool success, uint tile, uint32 p1, uint32 p2)
    36 {
    36 {
   320 	);
   320 	);
   321 }
   321 }
   322 
   322 
   323 
   323 
   324 // This function is more or less a hack because DoRailroadTrack() would otherwise screw up
   324 // This function is more or less a hack because DoRailroadTrack() would otherwise screw up
   325 static void SwapSelection()
   325 static void SwapSelection(void)
   326 {
   326 {
   327 	TileHighlightData *thd = &_thd;
   327 	TileHighlightData *thd = &_thd;
   328 	Point pt = thd->selstart;
   328 	Point pt = thd->selstart;
   329 	thd->selstart.x = thd->selend.x & ~0xF;
   329 	thd->selstart.x = thd->selend.x & ~0xF;
   330 	thd->selstart.y = thd->selend.y & ~0xF;
   330 	thd->selstart.y = thd->selend.y & ~0xF;
   331 	thd->selend = pt;
   331 	thd->selend = pt;
   332 }
   332 }
   333 
   333 
   334 
   334 
   335 static void HandleAutodirPlacement()
   335 static void HandleAutodirPlacement(void)
   336 {
   336 {
   337 	TileHighlightData *thd = &_thd;
   337 	TileHighlightData *thd = &_thd;
   338 	int bit;
   338 	int bit;
   339 	int dx = thd->selstart.x - (thd->selend.x&~0xF);
   339 	int dx = thd->selstart.x - (thd->selend.x&~0xF);
   340 	int dy = thd->selstart.y - (thd->selend.y&~0xF);
   340 	int dy = thd->selstart.y - (thd->selend.y&~0xF);
   863 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
   863 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
   864 	_station_builder_widgets,
   864 	_station_builder_widgets,
   865 	StationBuildWndProc
   865 	StationBuildWndProc
   866 };
   866 };
   867 
   867 
   868 static void ShowStationBuilder()
   868 static void ShowStationBuilder(void)
   869 {
   869 {
   870 	AllocateWindowDesc(&_station_builder_desc);
   870 	AllocateWindowDesc(&_station_builder_desc);
   871 }
   871 }
   872 
   872 
   873 static void BuildTrainDepotWndProc(Window *w, WindowEvent *e)
   873 static void BuildTrainDepotWndProc(Window *w, WindowEvent *e)
   930 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
   930 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
   931 	_build_depot_widgets,
   931 	_build_depot_widgets,
   932 	BuildTrainDepotWndProc
   932 	BuildTrainDepotWndProc
   933 };
   933 };
   934 
   934 
   935 static void ShowBuildTrainDepotPicker()
   935 static void ShowBuildTrainDepotPicker(void)
   936 {
   936 {
   937 	AllocateWindowDesc(&_build_depot_desc);
   937 	AllocateWindowDesc(&_build_depot_desc);
   938 }
   938 }
   939 
   939 
   940 
   940 
  1005 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
  1005 	WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET,
  1006 	_build_waypoint_widgets,
  1006 	_build_waypoint_widgets,
  1007 	BuildWaypointWndProc
  1007 	BuildWaypointWndProc
  1008 };
  1008 };
  1009 
  1009 
  1010 static void ShowBuildWaypointPicker()
  1010 static void ShowBuildWaypointPicker(void)
  1011 {
  1011 {
  1012 	Window *w = AllocateWindowDesc(&_build_waypoint_desc);
  1012 	Window *w = AllocateWindowDesc(&_build_waypoint_desc);
  1013 	w->hscroll.cap = 5;
  1013 	w->hscroll.cap = 5;
  1014 	w->hscroll.count = (uint) (_waypoint_count+4) / 5;
  1014 	w->hscroll.count = (uint) (_waypoint_count+4) / 5;
  1015 }
  1015 }
  1016 
  1016 
  1017 
  1017 
  1018 void InitializeRailGui()
  1018 void InitializeRailGui(void)
  1019 {
  1019 {
  1020 	_build_depot_direction = 3;
  1020 	_build_depot_direction = 3;
  1021 	_railstation.numtracks = 1;
  1021 	_railstation.numtracks = 1;
  1022 	_railstation.platlength = 1;
  1022 	_railstation.platlength = 1;
  1023 	_railstation.dragdrop = true;
  1023 	_railstation.dragdrop = true;