diff --git a/gui/line_waiting_status.cc b/gui/line_waiting_status.cc index c1a63c311f8..0639cbd46e8 100644 --- a/gui/line_waiting_status.cc +++ b/gui/line_waiting_status.cc @@ -12,10 +12,11 @@ #include "../simworld.h" -gui_halt_waiting_catg_t::gui_halt_waiting_catg_t(halthandle_t h, uint8 catg) +gui_halt_waiting_catg_t::gui_halt_waiting_catg_t(halthandle_t h, uint8 catg, bool yesno) { halt = h; catg_index = catg; + divide_by_class = yesno; set_table_layout(1,0); update(); } @@ -52,7 +53,20 @@ void gui_halt_waiting_catg_t::update() PIXVAL goods_color = wtyp->get_color(); new_component(goods_color)->set_size(GOODS_COLOR_BOX_SIZE); gui_label_buf_t *lb = new_component(overcrowded ? SYSCOL_OVERCROWDED : SYSCOL_TEXT); - lb->buf().printf("%s %d", translator::translate(wtyp->get_name()), sum); + const uint8 number_of_classes = wtyp->get_number_of_classes(); + if (divide_by_class && number_of_classes>1) { + bool got_one_class = false; + for (uint8 wealth = 0; wealthget_ware_summe(wtyp, wealth)) { + if (got_one_class) lb->buf().append(", "); + lb->buf().printf("%s %d", goods_manager_t::get_translated_wealth_name(catg_index,wealth), csum); + got_one_class = true; + } + } + } + else { + lb->buf().printf("%s %d", translator::translate(wtyp->get_name()), sum); + } lb->update(); got_one = true; diff --git a/gui/line_waiting_status.h b/gui/line_waiting_status.h index 2208c514b65..eef8dc5bc6a 100644 --- a/gui/line_waiting_status.h +++ b/gui/line_waiting_status.h @@ -22,9 +22,10 @@ class gui_halt_waiting_catg_t : public gui_aligned_container_t // for update flag. uint32 update_seed = 0; + bool divide_by_class; public: - gui_halt_waiting_catg_t(halthandle_t h, uint8 catg); + gui_halt_waiting_catg_t(halthandle_t h, uint8 catg, bool divide_by_class = true); void update(); @@ -39,6 +40,7 @@ class gui_line_waiting_status_t : public gui_aligned_container_t schedule_t *schedule; bool show_name=true; + bool divide_by_class = false; public: gui_line_waiting_status_t(linehandle_t line); @@ -48,6 +50,7 @@ class gui_line_waiting_status_t : public gui_aligned_container_t // for reload from the save void set_line(linehandle_t line_) { line = line_; init(); } void set_show_name(bool yesno) { show_name = yesno; init(); } + void set_divided_by_class(bool yesno) { divide_by_class = yesno; init(); } void draw(scr_coord offset) OVERRIDE; }; diff --git a/gui/schedule_list.cc b/gui/schedule_list.cc index 4c0a8ab2b54..d02f39cf00c 100644 --- a/gui/schedule_list.cc +++ b/gui/schedule_list.cc @@ -466,11 +466,27 @@ schedule_list_gui_t::schedule_list_gui_t(player_t *player_) : info_tabs.add_tab(&scroll_times_history, translator::translate("times_history")); cont_tab_haltlist.set_table_layout(1,0); - bt_show_halt_name.init(button_t::square_state, "show station names"); - bt_show_halt_name.set_tooltip("helptxt_show_station_name"); - bt_show_halt_name.pressed=true; - bt_show_halt_name.add_listener(this); - cont_tab_haltlist.add_component(&bt_show_halt_name); + cont_tab_haltlist.add_table(4,1); + { + bt_hw_show_halt_name.init(button_t::square_state, "show station names"); + bt_hw_show_halt_name.set_tooltip("helptxt_show_station_name"); + bt_hw_show_halt_name.pressed=true; + bt_hw_show_halt_name.add_listener(this); + cont_tab_haltlist.add_component(&bt_hw_show_halt_name); + + cont_tab_haltlist.new_component(LINEASCENT); + + bt_hw_divided_class.init(button_t::square_state, "Divided by class"); + bt_hw_divided_class.set_tooltip("Waiting cargoes are displayed separately for each class."); + bt_hw_divided_class.pressed = true; + bt_hw_divided_class.add_listener(this); + cont_tab_haltlist.add_component(&bt_hw_divided_class); + + cont_tab_haltlist.new_component(); + } + cont_tab_haltlist.end_table(); + + cont_tab_haltlist.add_component(&cont_haltlist); info_tabs.add_tab(&scroll_halt_waiting, translator::translate("waiting_status")); @@ -744,9 +760,13 @@ bool schedule_list_gui_t::action_triggered( gui_action_creator_t *comp, value_t filter_btn_all_freights.pressed = line_type_flags & (1 << simline_t::all_freight); build_line_list(tabs.get_active_tab_index()); } - else if (comp == &bt_show_halt_name) { - bt_show_halt_name.pressed = !bt_show_halt_name.pressed; - cont_haltlist.set_show_name( bt_show_halt_name.pressed ); + else if (comp == &bt_hw_show_halt_name) { + bt_hw_show_halt_name.pressed = !bt_hw_show_halt_name.pressed; + cont_haltlist.set_show_name( bt_hw_show_halt_name.pressed ); + } + else if (comp == &bt_hw_divided_class) { + bt_hw_divided_class.pressed = !bt_hw_divided_class.pressed; + cont_haltlist.set_divided_by_class(bt_hw_divided_class.pressed); } else if (comp == &reset_all_pass_button) { cbuffer_t buf; diff --git a/gui/schedule_list.h b/gui/schedule_list.h index 888aab2b850..06f11eb582a 100644 --- a/gui/schedule_list.h +++ b/gui/schedule_list.h @@ -43,7 +43,8 @@ class schedule_list_gui_t : public gui_frame_t, public action_listener_t static const char *sort_text[SORT_MODES]; - button_t bt_new_line, bt_edit_line, bt_delete_line, bt_withdraw_line, bt_mode_convois, bt_show_halt_name; + button_t bt_new_line, bt_edit_line, bt_delete_line, bt_withdraw_line, bt_mode_convois; + button_t bt_hw_show_halt_name, bt_hw_divided_class; button_t sort_order; button_t bt_access_minimap, bt_line_color_editor, bt_replace; button_t reset_all_pass_button, reset_all_mail_button; diff --git a/simutrans/text/en.tab b/simutrans/text/en.tab index ddaab6162ca..2996282b15c 100644 --- a/simutrans/text/en.tab +++ b/simutrans/text/en.tab @@ -6000,6 +6000,8 @@ Divided by class Divided by class Waiting bars are displayed separately for each class. Waiting bars are displayed separately for each class. +Waiting cargoes are displayed separately for each class. +Waiting cargoes are displayed separately for each class. Unified Unified Divided by category diff --git a/simutrans/text/ja.tab b/simutrans/text/ja.tab index 68299f26ab5..bacef39cb06 100644 --- a/simutrans/text/ja.tab +++ b/simutrans/text/ja.tab @@ -3961,6 +3961,8 @@ Divided by class クラス毎に分割表示 Waiting bars are displayed separately for each class. 待機バーを各クラス毎に分割して表示します。 +Waiting cargoes are displayed separately for each class. +待機数を各クラス毎に分割して表示します。 Unified 全ての貨物をまとめて表示 Divided by category