Loading

Paste #pkyiaogho

  1. diff --git a/src/road_gui.cpp b/src/road_gui.cpp
  2. index 92c660e..65e4dd9 100644
  3. --- a/src/road_gui.cpp
  4. +++ b/src/road_gui.cpp
  5. @@ -60,6 +60,7 @@ DECLARE_ENUM_AS_BIT_SET(RoadFlags)
  6.  static RoadFlags _place_road_flag;
  7.  
  8.  static RoadType _cur_roadtype;
  9. +bool _catenary_flag;
  10.  
  11.  static DiagDirection _road_depot_orientation;
  12.  static DiagDirection _road_station_picker_orientation;
  13. @@ -626,7 +627,7 @@ struct BuildRoadToolbarWindow : Window {
  14.                      * not the 3rd bit set) */
  15.                     _place_road_flag = (RoadFlags)((_place_road_flag & RF_DIR_Y) ? (_place_road_flag & 0x07) : (_place_road_flag >> 3));
  16.  
  17. -                   DoCommandP(start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 5),
  18. +                   DoCommandP(start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 5) | (_catenary_flag << 7),
  19.                             _remove_button_clicked ?
  20.                             CMD_REMOVE_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_road) :
  21.                             CMD_BUILD_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road), CcPlaySound1D);
  22. @@ -802,13 +803,13 @@ static WindowDesc _build_tramway_desc(
  23.   *
  24.   * @return newly opened road toolbar, or NULL if the toolbar could not be opened.
  25.   */
  26. -Window *ShowBuildRoadToolbar(RoadType roadtype)
  27. +Window *ShowBuildRoadToolbar(RoadType roadtype, bool _catenary_flag)
  28.  {
  29.     if (!Company::IsValidID(_local_company)) return NULL;
  30.     _cur_roadtype = roadtype;
  31.  
  32.     DeleteWindowByClass(WC_BUILD_TOOLBAR);
  33. -   return AllocateWindowDescFront<BuildRoadToolbarWindow>(roadtype == ROADTYPE_ROAD ? &_build_road_desc : &_build_tramway_desc, TRANSPORT_ROAD);
  34. +   return AllocateWindowDescFront<BuildRoadToolbarWindow>(roadtype == ROADTYPE_ROAD ? &_build_road_desc : &_build_tramway_desc, TRANSPORT_ROAD, _catenary_flag);
  35.  }
  36.  
  37.  static const NWidgetPart _nested_build_road_scen_widgets[] = {

Comments