Loading

Paste #pg1bbsh28

  1. diff --git a/src/road_gui.cpp b/src/road_gui.cpp
  2. index 92c660e..8d6c123 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. @@ -361,11 +362,10 @@ struct BuildRoadToolbarWindow : Window {
  14.     {
  15.         /* The remove and the one way button state is driven
  16.          * by the other buttons so they don't act on themselves.
  17. -        * Both are only valid if they are able to apply as options. */
  18. +        * They are only valid if they are able to apply as options. */
  19.         switch (clicked_widget) {
  20.             case WID_ROT_REMOVE:
  21.                 this->RaiseWidget(WID_ROT_ONE_WAY);
  22. -               this->SetWidgetDirty(WID_ROT_ONE_WAY);
  23.                 break;
  24.  
  25.             case WID_ROT_ONE_WAY:
  26. @@ -626,7 +626,7 @@ struct BuildRoadToolbarWindow : Window {
  27.                      * not the 3rd bit set) */
  28.                     _place_road_flag = (RoadFlags)((_place_road_flag & RF_DIR_Y) ? (_place_road_flag & 0x07) : (_place_road_flag >> 3));
  29.  
  30. -                   DoCommandP(start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 5),
  31. +                   DoCommandP(start_tile, end_tile, _place_road_flag | (_cur_roadtype << 3) | (_one_way_button_clicked << 5) | (_catenary_flag << 7),
  32.                             _remove_button_clicked ?
  33.                             CMD_REMOVE_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_remove_road) :
  34.                             CMD_BUILD_LONG_ROAD | CMD_MSG(_road_type_infos[_cur_roadtype].err_build_road), CcPlaySound1D);
  35. @@ -802,13 +802,13 @@ static WindowDesc _build_tramway_desc(
  36.   *
  37.   * @return newly opened road toolbar, or NULL if the toolbar could not be opened.
  38.   */
  39. -Window *ShowBuildRoadToolbar(RoadType roadtype)
  40. +Window *ShowBuildRoadToolbar(RoadType roadtype, bool _catenary_flag)
  41.  {
  42.     if (!Company::IsValidID(_local_company)) return NULL;
  43.     _cur_roadtype = roadtype;
  44.  
  45.     DeleteWindowByClass(WC_BUILD_TOOLBAR);
  46. -   return AllocateWindowDescFront<BuildRoadToolbarWindow>(roadtype == ROADTYPE_ROAD ? &_build_road_desc : &_build_tramway_desc, TRANSPORT_ROAD);
  47. +   return AllocateWindowDescFront<BuildRoadToolbarWindow>(roadtype == ROADTYPE_ROAD ? &_build_road_desc : &_build_tramway_desc, TRANSPORT_ROAD, _catenary_flag);
  48.  }
  49.  
  50.  static const NWidgetPart _nested_build_road_scen_widgets[] = {

Comments